Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/IndexRAdaptor.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/IndexRAdaptor.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/IndexRAdaptor.java	(revision 2397)
@@ -19,11 +19,11 @@
  *
  */
 public class IndexRAdaptor extends RAdaptor {
-
 	
+	
 	/** The novoc. */
 	protected static int no_index = 1;
-
+	
 	/** The prefix r. */
 	protected static String prefixR = "Index"; //$NON-NLS-1$
 	
@@ -38,63 +38,61 @@
 			return sended.get(index);
 		}
 		
-		String symbol = prefixR+no_index;
-
+		String symbol = prefixR + no_index;
+		
 		ArrayList<String> colnames = new ArrayList<String>();
-
+		
 		colnames.add("F"); //$NON-NLS-1$
 		List<String> partnames = index.getPartnames();
 		if (partnames.size() > 1)
 			for (int j = 0; j < partnames.size(); j++)
-				colnames.add(partnames.get(j)); 
-
-		//System.out.println("cols: "+colnames);
-
+			colnames.add(partnames.get(j));
+		
+		// System.out.println("cols: "+colnames);
+		
 		List<Line> lines = index.getAllLines();
 		String[] keywords = new String[lines.size()];
-
+		
 		int[] freq = new int[lines.size()];
 		ArrayList<int[]> partfreqs = new ArrayList<int[]>(partnames.size());
 		if (partnames.size() > 1)
 			for (int j = 0; j < partnames.size(); j++)
-				partfreqs.add(new int[lines.size()]);
-
-		for (int i = 0 ; i < lines.size() ; i++) 
-		{
+			partfreqs.add(new int[lines.size()]);
+		
+		for (int i = 0; i < lines.size(); i++) {
 			Line ligne = lines.get(i);
-			freq[i] = ligne.getFrequency(); 
+			freq[i] = ligne.getFrequency();
 			keywords[i] = ligne.toString();
 			if (partnames.size() > 1)
-				for (int j = 0; j < partnames.size(); j++)
-				{
-					partfreqs.get(j)[i] = ligne.getFrequency(j);
+				for (int j = 0; j < partnames.size(); j++) {
+				partfreqs.get(j)[i] = ligne.getFrequency(j);
 				}
-
+				
 		}
-
+		
 		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
 		if (partnames.size() > 1)
 			for (int j = 0; j < partnames.size(); j++)
-				rw.addVectorToWorkspace("vocpartfreqs"+j, partfreqs.get(j)); //$NON-NLS-1$
+			rw.addVectorToWorkspace("vocpartfreqs" + j, partfreqs.get(j)); //$NON-NLS-1$
 		rw.addVectorToWorkspace("vocfreq", freq); //$NON-NLS-1$
 		rw.addVectorToWorkspace("vockeywords", keywords); //$NON-NLS-1$
 		rw.addVectorToWorkspace("voccolnames", colnames.toArray(new String[colnames.size()])); //$NON-NLS-1$
-
+		
 		int ncol = 1;
 		if (partnames.size() > 1)
 			ncol += partnames.size();
-
+		
 		int nrow = lines.size();
 		String partscmd = ""; //$NON-NLS-1$
 		if (partnames.size() > 1)
 			for (int j = 0; j < partnames.size(); j++)
-				partscmd +=", vocpartfreqs"+j; //$NON-NLS-1$
-
-		rw.eval(symbol+ "<- matrix(data = c(vocfreq"+partscmd+"), nrow = "+nrow+", ncol = "+ncol+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		rw.eval("colnames("+symbol+" ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval("rownames("+symbol+" ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval(symbol+ "<- list(data="+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
-
+			partscmd += ", vocpartfreqs" + j; //$NON-NLS-1$
+			
+		rw.eval(symbol + "<- matrix(data = c(vocfreq" + partscmd + "), nrow = " + nrow + ", ncol = " + ncol + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		rw.eval("colnames(" + symbol + " ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("rownames(" + symbol + " ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval(symbol + "<- list(data=" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+		
 		no_index++;
 		
 		sended.put(index, symbol);
@@ -114,42 +112,41 @@
 			return sended.get(index);
 		}
 		
-		String symbol = prefixR+no_index;
-
+		String symbol = prefixR + no_index;
+		
 		ArrayList<String> colnames = new ArrayList<String>();
-
+		
 		colnames.add("F"); //$NON-NLS-1$
-
-		//System.out.println("cols: "+colnames);
-
+		
+		// System.out.println("cols: "+colnames);
+		
 		List<Line> lines = index.getAllLines();
 		String[] keywords = new String[lines.size()];
-
+		
 		int[] freq = new int[lines.size()];
-
-		for (int i = 0 ; i < lines.size() ; i++) 
-		{
+		
+		for (int i = 0; i < lines.size(); i++) {
 			Line ligne = lines.get(i);
-			freq[i] = ligne.getFrequency(); 
+			freq[i] = ligne.getFrequency();
 			keywords[i] = ligne.toString();
-
+			
 		}
-
+		
 		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
 		rw.addVectorToWorkspace("vocfreq", freq); //$NON-NLS-1$
 		rw.addVectorToWorkspace("vockeywords", keywords); //$NON-NLS-1$
 		rw.addVectorToWorkspace("voccolnames", colnames.toArray(new String[colnames.size()])); //$NON-NLS-1$
-
+		
 		int ncol = 1;
-
+		
 		int nrow = lines.size();
 		String partscmd = ""; //$NON-NLS-1$
-
-		rw.eval(symbol+ "<- matrix(data = c(vocfreq"+partscmd+"), nrow = "+nrow+", ncol = "+ncol+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		rw.eval("colnames("+symbol+" ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval("rownames("+symbol+" ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval(symbol+ "<- list(data="+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
-
+		
+		rw.eval(symbol + "<- matrix(data = c(vocfreq" + partscmd + "), nrow = " + nrow + ", ncol = " + ncol + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		rw.eval("colnames(" + symbol + " ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("rownames(" + symbol + " ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval(symbol + "<- list(data=" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+		
 		no_index++;
 		
 		sended.put(index, symbol);
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/LexiconAdapterFactory.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/LexiconAdapterFactory.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/LexiconAdapterFactory.java	(revision 2397)
@@ -12,21 +12,21 @@
 
 /**
  * A factory for creating Adapter objects.
- *  
+ * 
  * @author mdecorde
  * @author sjacquot
  */
 public class LexiconAdapterFactory extends TXMResultAdapterFactory {
-
 	
-	public static final ImageDescriptor ICON =
-			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(LexiconAdapterFactory.class).getSymbolicName(),
-					"platform:/plugin/"+ FrameworkUtil.getBundle(LexiconAdapterFactory.class).getSymbolicName() + "/icons/lexicon.png"); //$NON-NLS-1$ //$NON-NLS-2$
 	
+	public static final ImageDescriptor ICON = AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(LexiconAdapterFactory.class).getSymbolicName(),
+			"platform:/plugin/" + FrameworkUtil.getBundle(LexiconAdapterFactory.class).getSymbolicName() + "/icons/lexicon.png"); //$NON-NLS-1$ //$NON-NLS-2$
+	
 	@Override
 	public Object getAdapter(Object adaptableObject, Class adapterType) {
-		if(this.canAdapt(adapterType) && adaptableObject instanceof Lexicon)	{
+		if (this.canAdapt(adapterType) && adaptableObject instanceof Lexicon) {
 			return new TXMResultAdapter() {
+				
 				@Override
 				public ImageDescriptor getImageDescriptor(Object object) {
 					return ICON;
@@ -35,6 +35,6 @@
 		}
 		return null;
 	}
-
-
+	
+	
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/PartitionIndexAdapterFactory.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/PartitionIndexAdapterFactory.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/PartitionIndexAdapterFactory.java	(revision 2397)
@@ -11,21 +11,21 @@
 
 /**
  * Display an Index or Lexicon icon dependaing on the Index used a lexicon to compute
- *  
+ * 
  * @author mdecorde
  * @author sjacquot
  */
 public class PartitionIndexAdapterFactory extends TXMResultAdapterFactory {
-
-
-	public static final ImageDescriptor ICON =
-			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(PartitionIndexAdapterFactory.class).getSymbolicName(),
-					"platform:/plugin/"+ FrameworkUtil.getBundle(PartitionIndexAdapterFactory.class).getSymbolicName() + "/icons/partitionindex.png"); //$NON-NLS-1$ //$NON-NLS-2$
 	
+	
+	public static final ImageDescriptor ICON = AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(PartitionIndexAdapterFactory.class).getSymbolicName(),
+			"platform:/plugin/" + FrameworkUtil.getBundle(PartitionIndexAdapterFactory.class).getSymbolicName() + "/icons/partitionindex.png"); //$NON-NLS-1$ //$NON-NLS-2$
+	
 	@Override
 	public Object getAdapter(Object adaptableObject, Class adapterType) {
-		if(this.canAdapt(adapterType) && adaptableObject instanceof PartitionIndex)	{
+		if (this.canAdapt(adapterType) && adaptableObject instanceof PartitionIndex) {
 			return new TXMResultAdapter() {
+				
 				@Override
 				public ImageDescriptor getImageDescriptor(Object object) {
 					return ICON;
@@ -34,6 +34,6 @@
 		}
 		return null;
 	}
-
-
+	
+	
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/IndexAdapterFactory.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/IndexAdapterFactory.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/adapters/IndexAdapterFactory.java	(revision 2397)
@@ -13,21 +13,21 @@
 
 /**
  * Display an Index or Lexicon icon dependaing on the Index used a lexicon to compute
- *  
+ * 
  * @author mdecorde
  * @author sjacquot
  */
 public class IndexAdapterFactory extends TXMResultAdapterFactory {
-
-
-	public static final ImageDescriptor ICON =
-			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(IndexAdapterFactory.class).getSymbolicName(),
-					"platform:/plugin/"+ FrameworkUtil.getBundle(IndexAdapterFactory.class).getSymbolicName() + "/icons/index.png"); //$NON-NLS-1$ //$NON-NLS-2$
 	
+	
+	public static final ImageDescriptor ICON = AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(IndexAdapterFactory.class).getSymbolicName(),
+			"platform:/plugin/" + FrameworkUtil.getBundle(IndexAdapterFactory.class).getSymbolicName() + "/icons/index.png"); //$NON-NLS-1$ //$NON-NLS-2$
+	
 	@Override
 	public Object getAdapter(Object adaptableObject, Class adapterType) {
-		if(this.canAdapt(adapterType) && adaptableObject instanceof Index)	{
+		if (this.canAdapt(adapterType) && adaptableObject instanceof Index) {
 			return new TXMResultAdapter() {
+				
 				@Override
 				public ImageDescriptor getImageDescriptor(Object object) {
 					// TODO Auto-generated method stub
@@ -37,6 +37,6 @@
 		}
 		return null;
 	}
-
-
+	
+	
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/IndexUIMessages.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/IndexUIMessages.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/IndexUIMessages.java	(revision 2397)
@@ -10,31 +10,40 @@
  *
  */
 public class IndexUIMessages extends NLS {
-
+	
 	private static final String BUNDLE_NAME = "org.txm.index.rcp.messages.messages"; //$NON-NLS-1$
-
-	public static String infos; 
 	
-	public static String numberOfLinesPerResultPage; 
-	public static String index; 
+	public static String infos;
 	
-	public static String indexColonQueryIsEmpty; 
-	public static String failedToComputeIndex; 
+	public static String numberOfLinesPerResultPage;
+	
+	public static String index;
+	
+	public static String indexColonQueryIsEmpty;
+	
+	public static String failedToComputeIndex;
+	
 	public static String IndexEditor_17;
-	public static String indexOfInfP0SupWithPropertyColonP1InTheCorpusColonP2; 
-	public static String indexOfInfP0SupWithPropertyColonP1InThePartitionColonP2; 
-	public static String couldntInitializeIndexTable; 
-	public static String openingTheIndexResults; 
-	public static String computingIndex; 
-	public static String pageSize; 
-	public static String openingIndexResults; 
-
 	
+	public static String indexOfInfP0SupWithPropertyColonP1InTheCorpusColonP2;
+	
+	public static String indexOfInfP0SupWithPropertyColonP1InThePartitionColonP2;
+	
+	public static String couldntInitializeIndexTable;
+	
+	public static String openingTheIndexResults;
+	
+	public static String computingIndex;
+	
+	public static String pageSize;
+	
+	public static String openingIndexResults;
+	
+	
 	static {
 		// initialize resource bundle
 		Utf8NLS.initializeMessages(BUNDLE_NAME, IndexUIMessages.class);
 	}
-
-	private IndexUIMessages() {
-	}
+	
+	private IndexUIMessages() {}
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LexiconEditor.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LexiconEditor.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LexiconEditor.java	(revision 2397)
@@ -5,10 +5,10 @@
 
 /**
  * Extends the index editor to:
- * - set the number of property to 1 
+ * - set the number of property to 1
  * - hide the query field
  * 
- *  @author mdecorde
+ * @author mdecorde
  */
 public class LexiconEditor extends IndexEditor {
 	
@@ -29,4 +29,4 @@
 		// no query field -> no need to expand the zone
 		this.getMainParametersComposite().setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/PartitionIndexEditor.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/PartitionIndexEditor.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/PartitionIndexEditor.java	(revision 2397)
@@ -80,82 +80,83 @@
  * @author mdecorde
  */
 public class PartitionIndexEditor extends TXMEditor<PartitionIndex> {
-
+	
 	/** The index. */
 	protected PartitionIndex index;
-
+	
 	// params
 	/** The query label. */
 	protected Label queryLabel;
-
+	
 	// infos
 	/** The navigation area. */
 	protected NavigationWidget navigationArea;
-
+	
 	/** The l fmin info. */
 	protected Label lFminInfo;
-
+	
 	/** The l fmax info. */
 	protected Label lFmaxInfo;
-
+	
 	/** The l v info. */
 	protected Label lVInfo;
-
+	
 	/** The l t info. */
 	protected Label lTInfo;
+	
 	// result
 	/** The line table viewer. */
 	protected TableViewer viewer;
-
+	
 	/** The n column. */
 	protected TableColumn nColumn;
-
+	
 	/** The unit column. */
 	protected TableColumn unitColumn;
-
+	
 	/** The freq column. */
 	protected TableColumn freqColumn;
-
+	
 	/** The separator column. */
 	protected TableColumn separatorColumn;
-
-
+	
+	
 	/** The title. */
 	String title;
-
+	
 	/** The query widget. */
-	@Parameter(key=TXMPreferences.QUERY)
+	@Parameter(key = TXMPreferences.QUERY)
 	protected AssistedChoiceQueryWidget queryWidget;
-
+	
 	/**
 	 * Minimum frequency filtering spinner.
 	 */
-	@Parameter(key=TXMPreferences.F_MIN)
+	@Parameter(key = TXMPreferences.F_MIN)
 	protected Spinner fMinSpinner;
-
+	
 	/**
 	 * Maximum frequency filtering spinner.
 	 */
-	@Parameter(key=TXMPreferences.F_MAX)
+	@Parameter(key = TXMPreferences.F_MAX)
 	protected Spinner fMaxSpinner;
-
+	
 	/**
 	 * Maximum number of lines filtering.
 	 */
-	@Parameter(key=TXMPreferences.V_MAX)
+	@Parameter(key = TXMPreferences.V_MAX)
 	protected Spinner vMaxSpinner;
-
-
+	
+	
 	/** The N ligne p page spinner. */
-	@Parameter(key=TXMPreferences.N_LINES_PER_PAGE)
+	@Parameter(key = TXMPreferences.N_LINES_PER_PAGE)
 	protected Spinner nLinesPerPageSpinner;
-
+	
 	/**
 	 * Word properties selector.
 	 */
-	@Parameter(key=TXMPreferences.UNIT_PROPERTIES)
+	@Parameter(key = TXMPreferences.UNIT_PROPERTIES)
 	protected PropertiesSelector<WordProperty> propertiesSelector;
-
+	
 	/**
 	 * Creates the part control.
 	 *
@@ -164,47 +165,47 @@
 	 */
 	@Override
 	public void _createPartControl() {
-
-
+		
+		
 		this.index = (PartitionIndex) this.getResult();
-
+		
 		// Computing listeners
 		ComputeSelectionListener computeSelectionListener = new ComputeSelectionListener(this);
 		ComputeKeyListener computeKeyListener = new ComputeKeyListener(this);
-
+		
 		Composite extendedParametersComposite = this.getExtendedParametersGroup();
-		//		paramArea.setLayout(new FormLayout());
-
+		// paramArea.setLayout(new FormLayout());
+		
 		// info&navigation panel
 		final GLComposite infosArea = this.getBottomToolbar().installGLComposite(IndexUIMessages.infos, 1, false);
 		infosArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 		infosArea.getLayout().numColumns = 5; // nav panel + labels
-
-		//		// on créé une Query, ici le pivot de la concordance est "[]"
-		//		// Query Area: query itself + view properties
-		//		Composite queryArea = new Composite(paramArea, SWT.NONE);
+		
+		// // on créé une Query, ici le pivot de la concordance est "[]"
+		// // Query Area: query itself + view properties
+		// Composite queryArea = new Composite(paramArea, SWT.NONE);
 		//
-		//		FormData queryLayoutData = new FormData();
-		//		queryLayoutData.top = new FormAttachment(0);
-		//		queryLayoutData.left = new FormAttachment(0);
-		//		queryLayoutData.right = new FormAttachment(100);
-		//		queryArea.setLayoutData(queryLayoutData);
+		// FormData queryLayoutData = new FormData();
+		// queryLayoutData.top = new FormAttachment(0);
+		// queryLayoutData.left = new FormAttachment(0);
+		// queryLayoutData.right = new FormAttachment(100);
+		// queryArea.setLayoutData(queryLayoutData);
 		//
-		//		queryArea.setLayout(new GridLayout(4, false));
-
+		// queryArea.setLayout(new GridLayout(4, false));
+		
 		// | Query: [ (v)] [Search] |
-
+		
 		// Main parameters
 		// Query
 		this.getMainParametersComposite().getLayout().numColumns = 3;
 		// make the zone expandable to display the longest query field
 		this.getMainParametersComposite().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
-
+		
 		// Query:
 		queryLabel = new Label(this.getMainParametersComposite(), SWT.NONE);
 		queryLabel.setText(TXMCoreMessages.common_query);
 		queryLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, true));
-
+		
 		// [ (v)]
 		queryWidget = new AssistedChoiceQueryWidget(this.getMainParametersComposite(), SWT.DROP_DOWN, index.getCorpus());
 		GridData layoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER);
@@ -212,8 +213,8 @@
 		layoutData.grabExcessHorizontalSpace = true;
 		queryWidget.setLayoutData(layoutData);
 		queryWidget.addKeyListener(computeKeyListener);
-
-
+		
+		
 		// Word properties selector
 		propertiesSelector = new PropertiesSelector<WordProperty>(this.getMainParametersComposite(), SWT.NONE);
 		propertiesSelector.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
@@ -227,118 +228,118 @@
 		}
 		// Listener
 		propertiesSelector.addSelectionListener(computeSelectionListener);
-
-
+		
+		
 		// extended parameters
-
+		
 		// FIXME: old version
 		// Filters
-		//		Composite filtercontrols = new Composite(paramArea, SWT.NONE);
-		//		FormData filtersLayoutData = new FormData();
-		//		filtersLayoutData.top = new FormAttachment(queryArea, 0);
-		//		filtersLayoutData.bottom = new FormAttachment(100);
-		//		filtersLayoutData.left = new FormAttachment(0);
-		//		filtersLayoutData.right = new FormAttachment(100);
-		//		filtercontrols.setLayoutData(filtersLayoutData);
+		// Composite filtercontrols = new Composite(paramArea, SWT.NONE);
+		// FormData filtersLayoutData = new FormData();
+		// filtersLayoutData.top = new FormAttachment(queryArea, 0);
+		// filtersLayoutData.bottom = new FormAttachment(100);
+		// filtersLayoutData.left = new FormAttachment(0);
+		// filtersLayoutData.right = new FormAttachment(100);
+		// filtercontrols.setLayoutData(filtersLayoutData);
 		//
-		//		GridLayout gridLayout = new GridLayout();
-		//		gridLayout.numColumns = 9;
-		//		gridLayout.makeColumnsEqualWidth = false;
-		//		filtercontrols.setLayout(gridLayout);
+		// GridLayout gridLayout = new GridLayout();
+		// gridLayout.numColumns = 9;
+		// gridLayout.makeColumnsEqualWidth = false;
+		// filtercontrols.setLayout(gridLayout);
 		//
-		//		Label tmp = new Label(filtercontrols, SWT.NONE);
-		//		tmp.setText(TXMCoreMessages.common_thresholds);
-		//		tmp.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+		// Label tmp = new Label(filtercontrols, SWT.NONE);
+		// tmp.setText(TXMCoreMessages.common_thresholds);
+		// tmp.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
 		//
-		//		Label lFmin = new Label(filtercontrols, SWT.NONE);
-		//		lFmin.setText(TXMCoreMessages.common_fMin);
-		//		lFmin.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+		// Label lFmin = new Label(filtercontrols, SWT.NONE);
+		// lFmin.setText(TXMCoreMessages.common_fMin);
+		// lFmin.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
 		//
-		//		GridData fieldsGridData = new GridData(GridData.VERTICAL_ALIGN_END);
-		//		fieldsGridData.minimumWidth = 100;
+		// GridData fieldsGridData = new GridData(GridData.VERTICAL_ALIGN_END);
+		// fieldsGridData.minimumWidth = 100;
 		//
-		//		fMinSpinner = new Spinner(filtercontrols, SWT.BORDER);
-		//		fMinSpinner.setMinimum(0);
-		//		fMinSpinner.setMaximum(9999999);
-		//		fMinSpinner.setIncrement(1);
-		//		fMinSpinner.setPageIncrement(100);
-		//		fMinSpinner.setLayoutData(fieldsGridData);
-		//		fMinSpinner.addKeyListener(computeKeyListener);
-		//		fMinSpinner.addSelectionListener(computeSelectionListener);
+		// fMinSpinner = new Spinner(filtercontrols, SWT.BORDER);
+		// fMinSpinner.setMinimum(0);
+		// fMinSpinner.setMaximum(9999999);
+		// fMinSpinner.setIncrement(1);
+		// fMinSpinner.setPageIncrement(100);
+		// fMinSpinner.setLayoutData(fieldsGridData);
+		// fMinSpinner.addKeyListener(computeKeyListener);
+		// fMinSpinner.addSelectionListener(computeSelectionListener);
 		//
-		//		Label lFmax = new Label(filtercontrols, SWT.NONE);
-		//		lFmax.setText(TXMCoreMessages.common_fMax);
-		//		lFmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+		// Label lFmax = new Label(filtercontrols, SWT.NONE);
+		// lFmax.setText(TXMCoreMessages.common_fMax);
+		// lFmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
 		//
-		//		fMaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
-		//		fMaxSpinner.setMinimum(0);
-		//		fMaxSpinner.setMaximum(9999999);
-		//		fMaxSpinner.setIncrement(1);
-		//		fMaxSpinner.setPageIncrement(100);
-		//		fMaxSpinner.setLayoutData(fieldsGridData);
-		//		fMaxSpinner.addKeyListener(computeKeyListener);
-		//		fMaxSpinner.addSelectionListener(computeSelectionListener);
+		// fMaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
+		// fMaxSpinner.setMinimum(0);
+		// fMaxSpinner.setMaximum(9999999);
+		// fMaxSpinner.setIncrement(1);
+		// fMaxSpinner.setPageIncrement(100);
+		// fMaxSpinner.setLayoutData(fieldsGridData);
+		// fMaxSpinner.addKeyListener(computeKeyListener);
+		// fMaxSpinner.addSelectionListener(computeSelectionListener);
 		//
-		//		Label lVmax = new Label(filtercontrols, SWT.NONE);
-		//		lVmax.setText(TXMCoreMessages.VMAX_1);
-		//		lVmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+		// Label lVmax = new Label(filtercontrols, SWT.NONE);
+		// lVmax.setText(TXMCoreMessages.VMAX_1);
+		// lVmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
 		//
-		//		vMaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
-		//		vMaxSpinner.setMinimum(0);
-		//		vMaxSpinner.setMaximum(9999999);
-		//		vMaxSpinner.setIncrement(1);
-		//		vMaxSpinner.setPageIncrement(100);
-		//		vMaxSpinner.setLayoutData(fieldsGridData);
-		//		vMaxSpinner.addKeyListener(computeKeyListener);
-		//		vMaxSpinner.addSelectionListener(computeSelectionListener);
-
-
+		// vMaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
+		// vMaxSpinner.setMinimum(0);
+		// vMaxSpinner.setMaximum(9999999);
+		// vMaxSpinner.setIncrement(1);
+		// vMaxSpinner.setPageIncrement(100);
+		// vMaxSpinner.setLayoutData(fieldsGridData);
+		// vMaxSpinner.addKeyListener(computeKeyListener);
+		// vMaxSpinner.addSelectionListener(computeSelectionListener);
+		
+		
 		// FIXME: new version
 		// Filters
 		ThresholdsGroup thresholdsGroup = new ThresholdsGroup(this.getExtendedParametersGroup(), this);
 		this.fMinSpinner = thresholdsGroup.getFMinSpinner();
 		this.fMaxSpinner = thresholdsGroup.getFMaxSpinner();
 		this.vMaxSpinner = thresholdsGroup.getVMaxSpinner();
-
-
-
-
+		
+		
+		
+		
 		Label lNLigneppage = new Label(this.getExtendedParametersGroup(), SWT.NONE);
 		lNLigneppage.setText(IndexUIMessages.pageSize);
-
+		
 		nLinesPerPageSpinner = new Spinner(this.getExtendedParametersGroup(), SWT.BORDER);
 		nLinesPerPageSpinner.setMinimum(0);
 		nLinesPerPageSpinner.setMaximum(99999);
 		nLinesPerPageSpinner.setIncrement(1);
 		nLinesPerPageSpinner.setPageIncrement(100);
-
+		
 		// FIXME; became useless?
-		//		nLinesPerPageSpinner.addSelectionListener(new SelectionListener() {
-		//			@Override
-		//			public void widgetSelected(SelectionEvent e) { }
+		// nLinesPerPageSpinner.addSelectionListener(new SelectionListener() {
+		// @Override
+		// public void widgetSelected(SelectionEvent e) { }
 		//
-		//			@Override
-		//			public void widgetDefaultSelected(SelectionEvent e) {
-		//				index.setTopLine(0);
-		//				index.setNLinesPerPage(nLinesPerPageSpinner.getSelection());
-		//				fillResultArea();
-		//				viewer.getTable().select(0);
-		//				viewer.getTable().showSelection();
-		//			}
-		//		});
-
+		// @Override
+		// public void widgetDefaultSelected(SelectionEvent e) {
+		// index.setTopLine(0);
+		// index.setNLinesPerPage(nLinesPerPageSpinner.getSelection());
+		// fillResultArea();
+		// viewer.getTable().select(0);
+		// viewer.getTable().showSelection();
+		// }
+		// });
+		
 		nLinesPerPageSpinner.addSelectionListener(computeSelectionListener);
 		nLinesPerPageSpinner.addKeyListener(computeKeyListener);
-
-
+		
+		
 		navigationArea = new NavigationWidget(infosArea, SWT.NONE);
-		navigationArea.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true,	false));
-
+		navigationArea.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false));
+		
 		navigationArea.addFirstListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				index.setTopLine(0);
@@ -349,27 +350,27 @@
 			}
 		});
 		navigationArea.addLastListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				int i = (index.getV()/nLinesPerPageSpinner.getSelection());
-				int top = i*nLinesPerPageSpinner.getSelection();
-
+				int i = (index.getV() / nLinesPerPageSpinner.getSelection());
+				int top = i * nLinesPerPageSpinner.getSelection();
+				
 				index.setTopLine(top);
 				fillResultArea();
-
+				
 				viewer.getTable().select(0);
 				viewer.getTable().showSelection();
 			}
 		});
 		navigationArea.addNextListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				index.setTopLine(index.getTopIndex() + index.getNLinesPerPage());
@@ -379,71 +380,74 @@
 			}
 		});
 		navigationArea.addPreviousListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				int top = index.getTopIndex() - index.getNLinesPerPage();
-				if (top < 0) { top = 0; }
+				if (top < 0) {
+					top = 0;
+				}
 				index.setTopLine(top);
 				fillResultArea();
 				viewer.getTable().select(0);
 				viewer.getTable().showSelection();
 			}
 		});
-
+		
 		// Labels added after the top toolbar
 		lTInfo = new Label(infosArea, SWT.NONE);
 		lTInfo.setText(""); //$NON-NLS-1$
-		//		lTInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		// lTInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		
 		lVInfo = new Label(infosArea, SWT.NONE);
 		lVInfo.setText(""); //$NON-NLS-1$
-		//		lVInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		// lVInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		
 		lFminInfo = new Label(infosArea, SWT.NONE);
 		lFminInfo.setText(""); //$NON-NLS-1$
-		//		lFminInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		// lFminInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		
 		lFmaxInfo = new Label(infosArea, SWT.NONE);
 		lFmaxInfo.setText(""); //$NON-NLS-1$
-		//		lFmaxInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		// lFmaxInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		
 		// results
 		Composite resultArea = this.getResultArea();
-
+		
 		viewer = new TableViewer(resultArea, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
-
+		
 		viewer.getTable().setLinesVisible(true);
 		viewer.getTable().setHeaderVisible(true);
 		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
-
+		
 		String fontName = index.getCorpus().getProject().getFont();
 		if (fontName != null && fontName.length() > 0) {
 			Font old = viewer.getTable().getFont();
 			FontData fD = old.getFontData()[0];
-			//Font f = new Font(old.getDevice(), corpus.getFont(), fD.getHeight(), fD.getStyle());
-			Font font = new Font(Display.getCurrent(), fontName, fD.getHeight(), fD.getStyle()); 
+			// Font f = new Font(old.getDevice(), corpus.getFont(), fD.getHeight(), fD.getStyle());
+			Font font = new Font(Display.getCurrent(), fontName, fD.getHeight(), fD.getStyle());
 			viewer.getTable().setFont(font);
 		}
-
+		
 		viewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
-
+		
 		viewer.setLabelProvider(new LineLabelProvider());
 		viewer.setContentProvider(new LineContentProvider());
 		viewer.setInput(new ArrayList<Property>());
-
+		
 		nColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
 		nColumn.setText(" "); //$NON-NLS-1$
 		nColumn.pack();
-
+		
 		unitColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
 		unitColumn.setText(TXMCoreMessages.common_units);
 		unitColumn.setToolTipText(TXMCoreMessages.common_units);
 		unitColumn.setWidth(200);
 		unitColumn.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				StatusLine.setMessage(TXMUIMessages.sortingColumn);
@@ -451,74 +455,79 @@
 					viewer.getTable().setSortColumn(unitColumn);
 					viewer.getTable().setSortDirection(SWT.UP);
 					index.sortLines(SortMode.UNIT, false);
-				} else {
+				}
+				else {
 					if (viewer.getTable().getSortDirection() == SWT.UP) {
 						viewer.getTable().setSortDirection(SWT.DOWN);
 						index.sortLines(SortMode.UNITFREQ, true);
-					} else {
+					}
+					else {
 						viewer.getTable().setSortDirection(SWT.UP);
 						index.sortLines(SortMode.UNITFREQ, false);
 					}
 				}
-
+				
 				StatusLine.setMessage(TXMUIMessages.sortDone);
 				fillResultArea();
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		// columns build later
-
+		
 		// Register the context menu
 		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
-
-
+		
+		
 		if (queryWidget != null && !queryWidget.isDisposed()) {
 			queryWidget.setFocus();
 		}
-
+		
 	}
-
-
-
-
+	
+	
+	
+	
 	@Override
 	public void updateResultFromEditor() {
 		// nothing to do
 	}
-
-
+	
+	
 	/**
 	 * Computes index.
 	 */
 	@Override
 	public void updateEditorFromResult(final boolean update) {
-
+		
 		if (freqColumn == null) {
 			freqColumn = new TableColumn(viewer.getTable(), SWT.RIGHT);
 			try {
-				freqColumn.setText(TXMCoreMessages.common_frequency+" T="+index.getPartition().getTotalSize()); //$NON-NLS-1$
-			} catch (CqiClientException e2) {
+				freqColumn.setText(TXMCoreMessages.common_frequency + " T=" + index.getPartition().getTotalSize()); //$NON-NLS-1$
+			}
+			catch (CqiClientException e2) {
 				// TODO Auto-generated catch block
 				org.txm.utils.logger.Log.printStackTrace(e2);
 			}
 			freqColumn.setToolTipText(TXMCoreMessages.common_frequency);
 			freqColumn.setWidth(100);
 			freqColumn.addSelectionListener(new SelectionListener() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					if (viewer.getTable().getSortColumn() != freqColumn) {
 						viewer.getTable().setSortColumn(freqColumn);
 						viewer.getTable().setSortDirection(SWT.UP);
 						index.sortLines(SortMode.FREQUNIT, false);
-					} else {
+					}
+					else {
 						if (viewer.getTable().getSortDirection() == SWT.UP) {
 							viewer.getTable().setSortDirection(SWT.DOWN);
 							index.sortLines(SortMode.FREQUNIT, true);
-						} else {
+						}
+						else {
 							viewer.getTable().setSortDirection(SWT.UP);
 							index.sortLines(SortMode.FREQUNIT, false);
 						}
@@ -526,12 +535,11 @@
 					StatusLine.setMessage(TXMUIMessages.sortDone);
 					fillResultArea();
 				}
-
+				
 				@Override
-				public void widgetDefaultSelected(SelectionEvent e) {
-				}
+				public void widgetDefaultSelected(SelectionEvent e) {}
 			});
-
+			
 			// rmv/creates parts columns if needed
 			List<Part> parts = index.getPartition().getParts();
 			List<String> partnames = index.getPartition().getPartNames();
@@ -541,7 +549,8 @@
 						final TableColumn partColumn = new TableColumn(viewer.getTable(), SWT.RIGHT);
 						try {
 							partColumn.setText(partnames.get(i) + " t=" + parts.get(i).getSize()); //$NON-NLS-1$
-						} catch (CqiClientException e1) {
+						}
+						catch (CqiClientException e1) {
 							org.txm.utils.logger.Log.printStackTrace(e1);
 						}
 						partColumn.setToolTipText(partnames.get(i));
@@ -549,32 +558,32 @@
 					}
 				}
 			}
-
+			
 			separatorColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
 			separatorColumn.setText(""); //$NON-NLS-1$
 			separatorColumn.pack();
-
+			
 			// Add double click, "Send to" command
 			TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 1, "org.txm.concordance.rcp.handlers.ComputeConcordance"); //$NON-NLS-1$
 			TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 2, viewer.getTable().getColumnCount() - 1, "org.txm.progression.rcp.handlers.ComputeProgression"); //$NON-NLS-1$
 		}
-
+		
 		QueriesView.refresh();
 		RVariablesView.refresh();
-
+		
 		if (!queryWidget.isDisposed()) {
 			queryWidget.memorize();
 		}
-
-
-
+		
+		
+		
 		fillResultArea();
-
+		
 		viewer.getTable().setFocus();
 	}
-
-
-
+	
+	
+	
 	/**
 	 * Fill result area using the index top and index number of results per page parameters.
 	 *
@@ -582,10 +591,10 @@
 	public void fillResultArea() {
 		// System.out.println("call fill from "+from+" to "+to);
 		int from = index.getTopIndex();
-
+		
 		int to = from + index.getNLinesPerPage();
 		to = Math.min(to, index.getV());
-
+		
 		List<Line> lines = null;
 		if (index.getV() > 0) {
 			lines = index.getLines(from, to);
@@ -593,21 +602,21 @@
 		else {
 			lines = new ArrayList<Line>();
 		}
-
-		navigationArea.setInfoLineText(""+(from + 1), //$NON-NLS-1$
+		
+		navigationArea.setInfoLineText("" + (from + 1), //$NON-NLS-1$
 				"-" + (to) + " / " + index.getV()); //$NON-NLS-1$ //$NON-NLS-2$
 		navigationArea.setPreviousEnabled(from > 0);
 		navigationArea.setFirstEnabled(from > 0);
 		navigationArea.setNextEnabled(to < index.getV());
 		navigationArea.setLastEnabled(to < index.getV());
-
+		
 		lFminInfo.setText(TXMCoreMessages.fmin + index.getFmin());
 		lFmaxInfo.setText(TXMCoreMessages.fmax + index.getFmax());
 		lTInfo.setText(TXMCoreMessages.common_t + index.getT());
 		lVInfo.setText(TXMCoreMessages.v + index.getV());
-
+		
 		lVInfo.getParent().layout();
-
+		
 		String unitColumnHeader = ""; //$NON-NLS-1$
 		for (Property p : index.getProperties()) {
 			unitColumnHeader += p.getName() + index.getPropertySeparator();
@@ -616,14 +625,14 @@
 			unitColumnHeader = unitColumnHeader.substring(0, unitColumnHeader.length() - 1);
 		}
 		unitColumn.setText(unitColumnHeader);
-
+		
 		viewer.setInput(lines);
-
+		
 		// Refresh and pack the columns
 		TXMEditor.packColumns(viewer);
-
+		
 	}
-
+	
 	/**
 	 * Sets the focus.
 	 *
@@ -636,7 +645,7 @@
 		}
 		StatusLine.setMessage(IndexUIMessages.openingTheIndexResults);
 	}
-
+	
 	/**
 	 * Gets the corpus.
 	 *
@@ -645,7 +654,7 @@
 	public CQPCorpus getCorpus() {
 		return index.getCorpus();
 	}
-
+	
 	/**
 	 * Sets the focus.
 	 *
@@ -654,8 +663,8 @@
 	public void setFocus(String query) {
 		this.queryWidget.setText(query);
 	}
-
+	
 	public IQuery getQuery() {
 		return queryWidget.getQuery();
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LineContentProvider.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LineContentProvider.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LineContentProvider.java	(revision 2397)
@@ -40,10 +40,9 @@
  * @author jmague
  */
 public class LineContentProvider implements IStructuredContentProvider {
-
+	
 	/*
 	 * (non-Javadoc)
-	 * 
 	 * @see
 	 * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java
 	 * .lang.Object)
@@ -54,21 +53,19 @@
 		List<Line> lines = (List<Line>) inputElement;
 		return lines.toArray();
 	}
-
+	
 	/*
 	 * (non-Javadoc)
-	 * 
 	 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
 	 */
 	@Override
 	public void dispose() {
 		// TODO Auto-generated method stub
-
+		
 	}
-
+	
 	/*
 	 * (non-Javadoc)
-	 * 
 	 * @see
 	 * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
 	 * .viewers.Viewer, java.lang.Object, java.lang.Object)
@@ -77,5 +74,5 @@
 	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
 		// TODO Auto-generated method stub
 	}
-
+	
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 2397)
@@ -78,80 +78,80 @@
  * @author mdecorde
  */
 public class IndexEditor extends TXMEditor<Index> {
-
+	
 	/** The index. */
 	protected Index index;
-
+	
 	// params
 	/** The query label. */
 	protected Label queryLabel;
-
+	
 	// infos
 	/** The navigation area. */
 	protected NavigationWidget navigationArea;
-
+	
 	/** The l fmin info. */
 	protected Label lFminInfo;
-
+	
 	/** The l fmax info. */
 	protected Label lFmaxInfo;
-
+	
 	/** The l v info. */
 	protected Label lVInfo;
-
+	
 	/** The l t info. */
 	protected Label lTInfo;
 	
 	/** The line table viewer. */
 	protected TableViewer viewer;
-
+	
 	/** The n column. */
 	protected TableColumn nColumn;
-
+	
 	/** The unit column. */
 	protected TableColumn unitColumn;
-
+	
 	/** The freq column. */
 	protected TableColumn freqColumn;
-
+	
 	/** The separator column. */
 	protected TableColumn separatorColumn;
-
-
+	
+	
 	/** The title. */
 	String title;
-
+	
 	/** The query widget. */
-	@Parameter(key=TXMPreferences.QUERY)
+	@Parameter(key = TXMPreferences.QUERY)
 	protected AssistedChoiceQueryWidget queryWidget;
-
+	
 	/**
 	 * Minimum frequency filtering spinner.
 	 */
-	@Parameter(key=TXMPreferences.F_MIN)
+	@Parameter(key = TXMPreferences.F_MIN)
 	protected Spinner fMinSpinner;
-
+	
 	/**
 	 * Maximum frequency filtering spinner.
 	 */
-	@Parameter(key=TXMPreferences.F_MAX)
+	@Parameter(key = TXMPreferences.F_MAX)
 	protected Spinner fMaxSpinner;
-
+	
 	/**
 	 * Maximum number of lines filtering.
 	 */
-	@Parameter(key=TXMPreferences.V_MAX)
+	@Parameter(key = TXMPreferences.V_MAX)
 	protected Spinner vMaxSpinner;
-
 	
+	
 	/** The N ligne p page spinner. */
-	@Parameter(key=TXMPreferences.N_LINES_PER_PAGE)
+	@Parameter(key = TXMPreferences.N_LINES_PER_PAGE)
 	protected Spinner nLinesPerPageSpinner;
 	
 	/**
 	 * Word properties selector.
 	 */
-	@Parameter(key=TXMPreferences.UNIT_PROPERTIES)
+	@Parameter(key = TXMPreferences.UNIT_PROPERTIES)
 	protected PropertiesSelector<WordProperty> propertiesSelector;
 	
 	/**
@@ -162,8 +162,8 @@
 	 */
 	@Override
 	public void _createPartControl() {
-
 		
+		
 		this.index = (Index) this.getResult();
 		
 		// Computing listeners
@@ -171,8 +171,8 @@
 		ComputeKeyListener computeKeyListener = new ComputeKeyListener(this);
 		
 		Composite extendedParametersComposite = this.getExtendedParametersGroup();
-		//extendedParametersComposite.setLayout(new FormLayout());
-
+		// extendedParametersComposite.setLayout(new FormLayout());
+		
 		// info&navigation panel
 		final GLComposite infosArea = this.getBottomToolbar().installGLComposite(IndexUIMessages.infos, 1, false);
 		infosArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
@@ -180,16 +180,16 @@
 		
 		// on créé une Query, ici le pivot de la concordance est "[]"
 		// Query Area: query itself + view properties
-//		Composite queryArea = new Composite(extendedParametersComposite, SWT.NONE);
-//
-//		FormData queryLayoutData = new FormData();
-//		queryLayoutData.top = new FormAttachment(0);
-//		queryLayoutData.left = new FormAttachment(0);
-//		queryLayoutData.right = new FormAttachment(100);
-//		queryArea.setLayoutData(queryLayoutData);
-//
-//		queryArea.setLayout(new GridLayout(4, false));
-
+		// Composite queryArea = new Composite(extendedParametersComposite, SWT.NONE);
+		//
+		// FormData queryLayoutData = new FormData();
+		// queryLayoutData.top = new FormAttachment(0);
+		// queryLayoutData.left = new FormAttachment(0);
+		// queryLayoutData.right = new FormAttachment(100);
+		// queryArea.setLayoutData(queryLayoutData);
+		//
+		// queryArea.setLayout(new GridLayout(4, false));
+		
 		// | Query: [ (v)] [Search] |
 		
 		
@@ -198,12 +198,12 @@
 		this.getMainParametersComposite().getLayout().numColumns = 3;
 		// make the zone expandable to display the longest query field
 		this.getMainParametersComposite().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
-				
+		
 		// Query:
 		queryLabel = new Label(this.getMainParametersComposite(), SWT.NONE);
 		queryLabel.setText(TXMCoreMessages.common_query);
 		queryLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, true));
-
+		
 		// [ (v)]
 		queryWidget = new AssistedChoiceQueryWidget(this.getMainParametersComposite(), SWT.DROP_DOWN, index.getCorpus());
 		GridData layoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER);
@@ -237,8 +237,8 @@
 		this.vMaxSpinner = thresholdsGroup.getVMaxSpinner();
 		
 		
-		// FIXME: SJ: we should create a widget class for the number of results per page 
-		// Number of results per page 
+		// FIXME: SJ: we should create a widget class for the number of results per page
+		// Number of results per page
 		LabeledSpinner numberOfResultsPerPage = new LabeledSpinner(this.getExtendedParametersGroup(), this, IndexUIMessages.pageSize);
 		this.nLinesPerPageSpinner = numberOfResultsPerPage.getSpinner();
 		this.nLinesPerPageSpinner.setMinimum(0);
@@ -246,17 +246,17 @@
 		this.nLinesPerPageSpinner.setIncrement(1);
 		this.nLinesPerPageSpinner.setPageIncrement(100);
 		
-
 		
+		
 		// Bottom toolbar
 		navigationArea = new NavigationWidget(infosArea, SWT.NONE);
-		navigationArea.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true,	false));
-
+		navigationArea.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false));
+		
 		navigationArea.addFirstListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				index.setTopLine(0);
@@ -267,14 +267,14 @@
 			}
 		});
 		navigationArea.addLastListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				int i = (index.getV()/nLinesPerPageSpinner.getSelection());
-				int top = i*nLinesPerPageSpinner.getSelection();
+				int i = (index.getV() / nLinesPerPageSpinner.getSelection());
+				int top = i * nLinesPerPageSpinner.getSelection();
 				
 				index.setTopLine(top);
 				fillResultArea();
@@ -284,10 +284,10 @@
 			}
 		});
 		navigationArea.addNextListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				index.setTopLine(index.getTopIndex() + index.getNLinesPerPage());
@@ -297,71 +297,74 @@
 			}
 		});
 		navigationArea.addPreviousListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				int top = index.getTopIndex() - index.getNLinesPerPage();
-				if (top < 0) { top = 0; }
+				if (top < 0) {
+					top = 0;
+				}
 				index.setTopLine(top);
 				fillResultArea();
 				viewer.getTable().select(0);
 				viewer.getTable().showSelection();
 			}
 		});
-
+		
 		// Labels added after the top toolbar
 		lTInfo = new Label(infosArea, SWT.NONE);
 		lTInfo.setText(""); //$NON-NLS-1$
-//		lTInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		// lTInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		
 		lVInfo = new Label(infosArea, SWT.NONE);
 		lVInfo.setText(""); //$NON-NLS-1$
-//		lVInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		// lVInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		
 		lFminInfo = new Label(infosArea, SWT.NONE);
 		lFminInfo.setText(""); //$NON-NLS-1$
-//		lFminInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		// lFminInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		
 		lFmaxInfo = new Label(infosArea, SWT.NONE);
 		lFmaxInfo.setText(""); //$NON-NLS-1$
-//		lFmaxInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		// lFmaxInfo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		
 		// results
 		Composite resultArea = this.getResultArea();
-
+		
 		viewer = new TableViewer(resultArea, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
 		
 		viewer.getTable().setLinesVisible(true);
 		viewer.getTable().setHeaderVisible(true);
 		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
-
+		
 		String fontName = index.getCorpus().getProject().getFont();
 		if (fontName != null && fontName.length() > 0) {
 			Font old = viewer.getTable().getFont();
 			FontData fD = old.getFontData()[0];
-			//Font f = new Font(old.getDevice(), corpus.getFont(), fD.getHeight(), fD.getStyle());
-			Font font = new Font(Display.getCurrent(), fontName, fD.getHeight(), fD.getStyle()); 
+			// Font f = new Font(old.getDevice(), corpus.getFont(), fD.getHeight(), fD.getStyle());
+			Font font = new Font(Display.getCurrent(), fontName, fD.getHeight(), fD.getStyle());
 			viewer.getTable().setFont(font);
 		}
-
+		
 		viewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
-
+		
 		viewer.setLabelProvider(new LineLabelProvider());
 		viewer.setContentProvider(new LineContentProvider());
 		viewer.setInput(new ArrayList<Property>());
-
+		
 		nColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
 		nColumn.setText(" "); //$NON-NLS-1$
 		nColumn.pack();
-
+		
 		unitColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
 		unitColumn.setText(TXMCoreMessages.common_units);
 		unitColumn.setToolTipText(TXMCoreMessages.common_units);
 		unitColumn.setWidth(200);
 		unitColumn.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				StatusLine.setMessage(TXMUIMessages.sortingColumn);
@@ -369,41 +372,45 @@
 					viewer.getTable().setSortColumn(unitColumn);
 					viewer.getTable().setSortDirection(SWT.UP);
 					index.sortLines(SortMode.UNIT, false);
-				} else {
+				}
+				else {
 					if (viewer.getTable().getSortDirection() == SWT.UP) {
 						viewer.getTable().setSortDirection(SWT.DOWN);
 						index.sortLines(SortMode.UNITFREQ, true);
-					} else {
+					}
+					else {
 						viewer.getTable().setSortDirection(SWT.UP);
 						index.sortLines(SortMode.UNITFREQ, false);
 					}
 				}
-
+				
 				StatusLine.setMessage(TXMUIMessages.sortDone);
 				fillResultArea();
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		freqColumn = new TableColumn(viewer.getTable(), SWT.RIGHT);
 		freqColumn.setText(TXMCoreMessages.common_frequency);
 		freqColumn.setToolTipText(TXMCoreMessages.common_frequency);
 		freqColumn.setWidth(100);
 		freqColumn.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				if (viewer.getTable().getSortColumn() != freqColumn) {
 					viewer.getTable().setSortColumn(freqColumn);
 					viewer.getTable().setSortDirection(SWT.UP);
 					index.sortLines(SortMode.FREQUNIT, false);
-				} else {
+				}
+				else {
 					if (viewer.getTable().getSortDirection() == SWT.UP) {
 						viewer.getTable().setSortDirection(SWT.DOWN);
 						index.sortLines(SortMode.FREQUNIT, true);
-					} else {
+					}
+					else {
 						viewer.getTable().setSortDirection(SWT.UP);
 						index.sortLines(SortMode.FREQUNIT, false);
 					}
@@ -411,57 +418,56 @@
 				StatusLine.setMessage(TXMUIMessages.sortDone);
 				fillResultArea();
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		separatorColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
 		separatorColumn.setText(""); //$NON-NLS-1$
 		separatorColumn.pack();
 		extendedParametersComposite.pack();
-
+		
 		// Add double click, "Send to" command
 		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 1, "org.txm.concordance.rcp.handlers.ComputeConcordance"); //$NON-NLS-1$
 		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), 2, viewer.getTable().getColumnCount() - 1, "org.txm.progression.rcp.handlers.ComputeProgression"); //$NON-NLS-1$
 		
 		// Register the context menu
 		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
-
+		
 		setFocus();
-
+		
 	}
-
 	
 	
-
+	
+	
 	@Override
 	public void updateResultFromEditor() {
 		// nothing to do
 	}
-
 	
+	
 	/**
 	 * Computes index.
 	 */
 	@Override
 	public void updateEditorFromResult(final boolean update) {
-
+		
 		QueriesView.refresh();
 		RVariablesView.refresh();
-
+		
 		if (!queryWidget.isDisposed()) {
 			queryWidget.memorize();
 		}
-
+		
 		fillResultArea();
-
+		
 		viewer.getTable().setFocus();
 	}
-
-
-
+	
+	
+	
 	/**
 	 * Fill result area using the index top and index number of results per page parameters.
 	 *
@@ -480,21 +486,21 @@
 		else {
 			lines = new ArrayList<Line>();
 		}
-
-		navigationArea.setInfoLineText(""+(from + 1), //$NON-NLS-1$
+		
+		navigationArea.setInfoLineText("" + (from + 1), //$NON-NLS-1$
 				"-" + (to) + " / " + index.getV()); //$NON-NLS-1$ //$NON-NLS-2$
 		navigationArea.setPreviousEnabled(from > 0);
 		navigationArea.setFirstEnabled(from > 0);
 		navigationArea.setNextEnabled(to < index.getV());
 		navigationArea.setLastEnabled(to < index.getV());
-
+		
 		lFminInfo.setText(TXMCoreMessages.fmin + index.getFmin());
 		lFmaxInfo.setText(TXMCoreMessages.fmax + index.getFmax());
 		lTInfo.setText(TXMCoreMessages.common_t + index.getT());
 		lVInfo.setText(TXMCoreMessages.v + index.getV());
-
+		
 		lVInfo.getParent().layout();
-
+		
 		String unitColumnHeader = ""; //$NON-NLS-1$
 		for (Property p : index.getProperties()) {
 			unitColumnHeader += p.getName() + index.getPropertySeparator();
@@ -503,17 +509,17 @@
 			unitColumnHeader = unitColumnHeader.substring(0, unitColumnHeader.length() - 1);
 		}
 		unitColumn.setText(unitColumnHeader);
-
+		
 		viewer.setInput(lines);
 		if (from == 0) {
 			viewer.getTable().setTopIndex(0);
 		}
-
+		
 		// Refresh and pack the columns
 		TXMEditor.packColumns(viewer);
 		
 	}
-
+	
 	/**
 	 * Sets the focus.
 	 *
@@ -526,7 +532,7 @@
 		}
 		StatusLine.setMessage(IndexUIMessages.openingTheIndexResults);
 	}
-
+	
 	/**
 	 * Gets the corpus of the index.
 	 *
@@ -535,12 +541,13 @@
 	public CQPCorpus getCorpus() {
 		return index.getCorpus();
 	}
-
+	
 	/**
 	 * Gets the query of the query widget.
+	 * 
 	 * @return
 	 */
 	public IQuery getQuery() {
 		return queryWidget.getQuery();
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LineLabelProvider.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LineLabelProvider.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/LineLabelProvider.java	(revision 2397)
@@ -37,54 +37,59 @@
  * The Class LineLabelProvider.
  */
 public class LineLabelProvider implements ITableLabelProvider {
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
 	 */
 	@Override
 	public Image getColumnImage(Object element, int columnIndex) {
 		return null;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
 	 */
 	@Override
 	public String getColumnText(Object element, int columnIndex) {
 		Line line = (Line) element;
 		switch (columnIndex) {
-		case 0:
-			return ""; //$NON-NLS-1$
-		case 1:
-			return line.toString();
-		case 2:
-			return "" + line.getFrequency(); //$NON-NLS-1$
-		default:
-			if (line.getFrequencies().length > 1
-					&& columnIndex - 3 < line.getFrequencies().length)
-				return "" + line.getFrequency(columnIndex - 3); //$NON-NLS-1$
-			else
-				return "";//$NON-NLS-1$
+			case 0:
+				return ""; //$NON-NLS-1$
+			case 1:
+				return line.toString();
+			case 2:
+				return "" + line.getFrequency(); //$NON-NLS-1$
+			default:
+				if (line.getFrequencies().length > 1
+						&& columnIndex - 3 < line.getFrequencies().length)
+					return "" + line.getFrequency(columnIndex - 3); //$NON-NLS-1$
+				else
+					return "";//$NON-NLS-1$
 		}
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
 	 */
 	@Override
 	public void addListener(ILabelProviderListener listener) {
 		// TODO Auto-generated method stub
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
 	 */
 	@Override
 	public void dispose() {
 		// TODO Auto-generated method stub
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
 	 */
 	@Override
@@ -92,8 +97,9 @@
 		// TODO Auto-generated method stub
 		return false;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
 	 */
 	@Override
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java	(revision 2397)
@@ -45,15 +45,15 @@
  * 
  */
 public class ComputeIndex extends BaseAbstractHandler {
-
 	
+	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-
-		if(!this.checkCorpusEngine()) {
+		
+		if (!this.checkCorpusEngine()) {
 			return false;
 		}
-
+		
 		Index index = null;
 		
 		// From link: creating from parameters node
@@ -62,7 +62,7 @@
 			index = new Index(parametersNodePath);
 		}
 		// From view result node
-		else	{
+		else {
 			Object selection = this.getCorporaViewSelectedObject(event);
 			
 			// New editor from corpus
@@ -70,7 +70,7 @@
 				index = new Index((CQPCorpus) selection);
 			}
 			// Reopen an existing result
-			else if (selection instanceof Index) { 
+			else if (selection instanceof Index) {
 				index = (Index) selection;
 			}
 			else {
@@ -82,5 +82,5 @@
 		
 		return null;
 	}
-
+	
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 2397)
@@ -46,34 +46,34 @@
  * 
  */
 public class SendIndexTo extends SendSelectionToQueryable {
-
-
+	
+	
 	@Override
 	public String createQuery(ExecutionEvent event, ISelection selection) {
 		if (selection instanceof StructuredSelection) {
-			StructuredSelection sselection = (StructuredSelection)selection;
+			StructuredSelection sselection = (StructuredSelection) selection;
 			return Index.createQuery(sselection.toList());
 		}
 		return null;
 	}
-
+	
 	@Override
 	public String createQueries(ExecutionEvent event, ISelection selection) {
 		if (selection instanceof StructuredSelection) {
-			StructuredSelection sselection = (StructuredSelection)selection;
+			StructuredSelection sselection = (StructuredSelection) selection;
 			return CQLQuery.queriesToString(Index.createQueries(sselection.toList()));
 		}
 		return null;
 	}
-
-
-
+	
+	
+	
 	@Override
 	public TXMResult getResultParent(ExecutionEvent event) {
 		TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
 		return CQPCorpus.getFirstParentCorpus(editor.getResult());
 	}
-
-
-
+	
+	
+	
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java	(revision 2397)
@@ -26,7 +26,7 @@
 	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-
+		
 		if (!this.checkCorpusEngine()) {
 			return false;
 		}
@@ -36,18 +36,19 @@
 		Lexicon index = null;
 		
 		// New Lexicon from Corpus
-		if (selection instanceof CQPCorpus)	{
+		if (selection instanceof CQPCorpus) {
 			CQPCorpus corpus = (CQPCorpus) selection;
 			index = new Lexicon(corpus);
 			try {
 				index.setProperties(Arrays.asList(corpus.getWordProperty()));
-			} catch (CqiClientException e) {
+			}
+			catch (CqiClientException e) {
 				// TODO Auto-generated catch block
 				e.printStackTrace();
 			}
 		}
 		// Reopening an existing Lexicon
-		else if(selection instanceof Lexicon) { 
+		else if (selection instanceof Lexicon) {
 			index = (Lexicon) selection;
 		}
 		else {
@@ -62,4 +63,4 @@
 	public static void open(Index lexicon) {
 		TXMEditor.openEditor(lexicon, LexiconEditor.class.getName());
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputePartitionIndex.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputePartitionIndex.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputePartitionIndex.java	(revision 2397)
@@ -45,43 +45,43 @@
  * 
  */
 public class ComputePartitionIndex extends BaseAbstractHandler {
-
-
+	
+	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-
+		
 		if (!this.checkCorpusEngine()) {
 			return false;
 		}
-
+		
 		PartitionIndex index = null;
-
-		// FIXME: SJ: is this command need to be linked? or only the corpus index command? 
+		
+		// FIXME: SJ: is this command need to be linked? or only the corpus index command?
 		// From link: creating from parameters node
 		String parametersNodePath = event.getParameter(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
 		if (parametersNodePath != null && !parametersNodePath.isEmpty()) {
 			index = new PartitionIndex(parametersNodePath);
 		}
 		// From view result node
-		else	{
+		else {
 			Object selection = this.getCorporaViewSelectedObject(event);
-
+			
 			// New editor from corpus
 			if (selection instanceof Partition) {
 				index = new PartitionIndex((Partition) selection);
 			}
 			// Reopen an existing result
-			else if (selection instanceof PartitionIndex) { 
+			else if (selection instanceof PartitionIndex) {
 				index = (PartitionIndex) selection;
 			}
 			else {
 				return super.logCanNotExecuteCommand(selection);
 			}
 		}
-
+		
 		TXMEditor.openEditor(index, PartitionIndexEditor.class.getName());
-
+		
 		return null;
 	}
-
+	
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/PartitionIndexToLexicalTable.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/PartitionIndexToLexicalTable.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/PartitionIndexToLexicalTable.java	(revision 2397)
@@ -34,37 +34,41 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.rcp.handlers.BaseAbstractHandler;
+
 // TODO: Auto-generated Javadoc
 /**
  * The Class IndexToLexicalTable.
  */
 // FIXME: not used?
 public class PartitionIndexToLexicalTable extends BaseAbstractHandler {
-
+	
 	/** The window. */
 	private IWorkbenchWindow window;
 	
 	/** The selection. */
 	private IStructuredSelection selection;
+	
 	private static Shell shell;
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		
-		if(!this.checkStatsEngine()) {
+		if (!this.checkStatsEngine()) {
 			return null;
 		}
-
 		
+		
 		// TODO Auto-generated method stub
 		window = HandlerUtil.getActiveWorkbenchWindow(event);
 		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
 		shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
 		return null;
 	}
-
+	
 	/**
 	 * Builds the lexical table.
 	 *
@@ -74,52 +78,52 @@
 	 * @return true, if successful
 	 */
 	// FIXME: SJ: temporary commented to avoid cyclic dependencies
-//	public boolean buildLexicalTable(Index voc, int from, int to) {
-//		LexicalTable table;
-//
-//		if (!voc.isComputedWithPartition()) {
-//			
-//			System.out.println(TXMUIMessages.cannotCreateALexicalTableFromAnIndexCreatedWithACorpusMoreThanOneColumnIsNeeded);
-//			StatusLine.setMessage(TXMUIMessages.cannotCreateALexicalTableFromAnIndexCreatedWithACorpusMoreThanOneColumnIsNeeded);
-//			return false;
-//		}
-//
-//		System.out.println(LexicalTableUIMessages.openingMargeConfigurationDialog);
-//		ArrayList<String> choices = new ArrayList<String>();
-//		choices.add(LexicalTableUIMessages.useAllOccurrences);
-//		choices.add(LexicalTableUIMessages.userIndexOccurrences);
-//		ListSelectionDialog dialog = new ListSelectionDialog(shell, 
-//				choices, new ArrayContentProvider(), new LabelProvider(), 
-//				LexicalTableUIMessages.selectWhichMarginsYouWantToUse);
-//		
-//		int ret = dialog.open();
-//		//System.out.println("ret= "+ret);
-//		if (ret == Dialog.OK_OPTION) {
-//			
-//		} else {
-//			return false;
-//		}
-//		
-//		try {
-//			table = new LexicalTable(voc);
-//		} catch (Exception e) {
-//			// TODO Auto-generated catch block
-//			org.txm.utils.logger.Log.printStackTrace(e);
-//			return false;
-//		}
-//
-//		try {
-//			IWorkbenchWindow window = PlatformUI.getWorkbench()
-//					.getActiveWorkbenchWindow();
-//			IWorkbenchPage page = window.getActivePage();
-//			___LexicalTableEditorInput editorInput = new ___LexicalTableEditorInput(table);
-//			StatusLine.setMessage(LexicalTableUIMessages.ComputeLexicalTable_10);
-//			page.openEditor(editorInput, "org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
-//		} catch (PartInitException e) {
-//			org.txm.utils.logger.Log.printStackTrace(e);
-//		} 
-//
-//		return true;
-//	}
-
-}
\ No newline at end of file
+	// public boolean buildLexicalTable(Index voc, int from, int to) {
+	// LexicalTable table;
+	//
+	// if (!voc.isComputedWithPartition()) {
+	//
+	// System.out.println(TXMUIMessages.cannotCreateALexicalTableFromAnIndexCreatedWithACorpusMoreThanOneColumnIsNeeded);
+	// StatusLine.setMessage(TXMUIMessages.cannotCreateALexicalTableFromAnIndexCreatedWithACorpusMoreThanOneColumnIsNeeded);
+	// return false;
+	// }
+	//
+	// System.out.println(LexicalTableUIMessages.openingMargeConfigurationDialog);
+	// ArrayList<String> choices = new ArrayList<String>();
+	// choices.add(LexicalTableUIMessages.useAllOccurrences);
+	// choices.add(LexicalTableUIMessages.userIndexOccurrences);
+	// ListSelectionDialog dialog = new ListSelectionDialog(shell,
+	// choices, new ArrayContentProvider(), new LabelProvider(),
+	// LexicalTableUIMessages.selectWhichMarginsYouWantToUse);
+	//
+	// int ret = dialog.open();
+	// //System.out.println("ret= "+ret);
+	// if (ret == Dialog.OK_OPTION) {
+	//
+	// } else {
+	// return false;
+	// }
+	//
+	// try {
+	// table = new LexicalTable(voc);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// org.txm.utils.logger.Log.printStackTrace(e);
+	// return false;
+	// }
+	//
+	// try {
+	// IWorkbenchWindow window = PlatformUI.getWorkbench()
+	// .getActiveWorkbenchWindow();
+	// IWorkbenchPage page = window.getActivePage();
+	// ___LexicalTableEditorInput editorInput = new ___LexicalTableEditorInput(table);
+	// StatusLine.setMessage(LexicalTableUIMessages.ComputeLexicalTable_10);
+	// page.openEditor(editorInput, "org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
+	// } catch (PartInitException e) {
+	// org.txm.utils.logger.Log.printStackTrace(e);
+	// }
+	//
+	// return true;
+	// }
+	
+}
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java	(revision 2396)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java	(revision 2397)
@@ -16,7 +16,7 @@
  *
  */
 public class IndexPreferencesPage extends TXMPreferencePage {
-
+	
 	@Override
 	public void init(IWorkbench workbench) {
 		
@@ -24,9 +24,9 @@
 		this.setTitle(IndexUIMessages.index);
 		this.setImageDescriptor(IndexAdapterFactory.ICON);
 	}
-
+	
 	@Override
 	protected void createFieldEditors() {
 		this.addField(new IntegerFieldEditor(TXMPreferences.N_LINES_PER_PAGE, IndexUIMessages.numberOfLinesPerResultPage, this.getFieldEditorParent()));
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.index.rcp/.classpath
===================================================================
--- tmp/org.txm.index.rcp/.classpath	(revision 2396)
+++ tmp/org.txm.index.rcp/.classpath	(revision 2397)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.imports.metopes/.classpath
===================================================================
--- tmp/org.txm.imports.metopes/.classpath	(revision 2396)
+++ tmp/org.txm.imports.metopes/.classpath	(revision 2397)
@@ -1,13 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
 		<accessrules>
-			<accessrule kind="accessible" pattern="**"/>
+			<accessrule kind="accessible" pattern="**" />
 		</accessrules>
 	</classpathentry>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="res"/>
-	<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
-	<classpathentry kind="output" path="bin"/>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="src" path="res" />
+	<classpathentry exported="true" kind="con"
+		path="GROOVY_DSL_SUPPORT" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
Index: tmp/org.txm.groovy.rcp/.classpath
===================================================================
--- tmp/org.txm.groovy.rcp/.classpath	(revision 2396)
+++ tmp/org.txm.groovy.rcp/.classpath	(revision 2397)
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins" />
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.groovy.rcp/contexts.xml
===================================================================
--- tmp/org.txm.groovy.rcp/contexts.xml	(revision 2396)
+++ tmp/org.txm.groovy.rcp/contexts.xml	(revision 2397)
@@ -1,12 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <contexts>
 	<context id="viewer" title="Sample View">
-		<description>This is the context help for the sample view with a table viewer. It was generated by a PDE template.</description>
-		<topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
+		<description>This is the context help for the sample view with a table
+			viewer. It was generated by a PDE template.</description>
+		<topic
+			href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm"
+			label="Context-sensitive help">
 			<enablement>
 				<with variable="platform">
-	            	<test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
-	     		</with>
+					<test property="org.eclipse.core.runtime.isBundleInstalled"
+						args="org.eclipse.platform.doc.isv" />
+				</with>
 			</enablement>
 		</topic>
 	</context>
Index: tmp/org.txm.groovy.rcp/src/org/txm/groovy/rcp/Activator.java
===================================================================
--- tmp/org.txm.groovy.rcp/src/org/txm/groovy/rcp/Activator.java	(revision 2396)
+++ tmp/org.txm.groovy.rcp/src/org/txm/groovy/rcp/Activator.java	(revision 2397)
@@ -4,11 +4,11 @@
 import org.osgi.framework.BundleContext;
 
 public class Activator extends AbstractUIPlugin {
-
+	
 	public Activator() {
 		// TODO Auto-generated constructor stub
 	}
-
+	
 	@Override
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
Index: tmp/org.txm.groovy.rcp/src/org/txm/groovy/rcp/views/SampleView.java
===================================================================
--- tmp/org.txm.groovy.rcp/src/org/txm/groovy/rcp/views/SampleView.java	(revision 2396)
+++ tmp/org.txm.groovy.rcp/src/org/txm/groovy/rcp/views/SampleView.java	(revision 2397)
@@ -31,57 +31,64 @@
  */
 
 public class SampleView extends ViewPart {
-
+	
 	/**
 	 * The ID of the view as specified by the extension.
 	 */
 	public static final String ID = "org.txm.groovy.rcp.views.SampleView";
-
+	
 	private TableViewer viewer;
+	
 	private Action action1;
+	
 	private Action action2;
+	
 	private Action doubleClickAction;
-
+	
 	/*
 	 * The content provider class is responsible for
 	 * providing objects to the view. It can wrap
 	 * existing objects in adapters or simply return
 	 * objects as-is. These objects may be sensitive
 	 * to the current input of the view, or ignore
-	 * it and always show the same content 
+	 * it and always show the same content
 	 * (like Task List, for example).
 	 */
-	 
+	
 	class ViewContentProvider implements IStructuredContentProvider {
-		public void inputChanged(Viewer v, Object oldInput, Object newInput) {
-		}
-		public void dispose() {
-		}
+		
+		public void inputChanged(Viewer v, Object oldInput, Object newInput) {}
+		
+		public void dispose() {}
+		
 		public Object[] getElements(Object parent) {
 			return new String[] { "One", "Two", "Three" };
 		}
 	}
+	
 	class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {
+		
 		public String getColumnText(Object obj, int index) {
 			return getText(obj);
 		}
+		
 		public Image getColumnImage(Object obj, int index) {
 			return getImage(obj);
 		}
+		
 		public Image getImage(Object obj) {
-			return PlatformUI.getWorkbench().
-					getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
+			return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
 		}
 	}
+	
 	class NameSorter extends ViewerSorter {
 	}
-
+	
 	/**
 	 * The constructor.
 	 */
-	public SampleView() {
-	}
-
+	public SampleView() {}
+	
 	/**
 	 * This is a callback that will allow us
 	 * to create the viewer and initialize it.
@@ -92,7 +99,7 @@
 		viewer.setLabelProvider(new ViewLabelProvider());
 		viewer.setSorter(new NameSorter());
 		viewer.setInput(getViewSite());
-
+		
 		// Create the help context id for the viewer's control
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.txm.groovy.rcp.viewer");
 		makeActions();
@@ -100,11 +107,12 @@
 		hookDoubleClickAction();
 		contributeToActionBars();
 	}
-
+	
 	private void hookContextMenu() {
 		MenuManager menuMgr = new MenuManager("#PopupMenu");
 		menuMgr.setRemoveAllWhenShown(true);
 		menuMgr.addMenuListener(new IMenuListener() {
+			
 			public void menuAboutToShow(IMenuManager manager) {
 				SampleView.this.fillContextMenu(manager);
 			}
@@ -113,19 +121,19 @@
 		viewer.getControl().setMenu(menu);
 		getSite().registerContextMenu(menuMgr, viewer);
 	}
-
+	
 	private void contributeToActionBars() {
 		IActionBars bars = getViewSite().getActionBars();
 		fillLocalPullDown(bars.getMenuManager());
 		fillLocalToolBar(bars.getToolBarManager());
 	}
-
+	
 	private void fillLocalPullDown(IMenuManager manager) {
 		manager.add(action1);
 		manager.add(new Separator());
 		manager.add(action2);
 	}
-
+	
 	private void fillContextMenu(IMenuManager manager) {
 		manager.add(action1);
 		manager.add(action2);
@@ -137,54 +145,57 @@
 		manager.add(action1);
 		manager.add(action2);
 	}
-
+	
 	private void makeActions() {
 		action1 = new Action() {
+			
 			public void run() {
 				showMessage("Action 1 executed");
 			}
 		};
 		action1.setText("Action 1");
 		action1.setToolTipText("Action 1 tooltip");
-		action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
-			getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+		action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
 		
 		action2 = new Action() {
+			
 			public void run() {
 				showMessage("Action 2 executed");
 			}
 		};
 		action2.setText("Action 2");
 		action2.setToolTipText("Action 2 tooltip");
-		action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
-				getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+		action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
 		doubleClickAction = new Action() {
+			
 			public void run() {
 				ISelection selection = viewer.getSelection();
-				Object obj = ((IStructuredSelection)selection).getFirstElement();
-				showMessage("Double-click detected on "+obj.toString());
+				Object obj = ((IStructuredSelection) selection).getFirstElement();
+				showMessage("Double-click detected on " + obj.toString());
 			}
 		};
 	}
-
+	
 	private void hookDoubleClickAction() {
 		viewer.addDoubleClickListener(new IDoubleClickListener() {
+			
 			public void doubleClick(DoubleClickEvent event) {
 				doubleClickAction.run();
 			}
 		});
 	}
+	
 	private void showMessage(String message) {
 		MessageDialog.openInformation(
-			viewer.getControl().getShell(),
-			"Sample View",
-			message);
+				viewer.getControl().getShell(),
+				"Sample View",
+				message);
 	}
-
+	
 	/**
 	 * Passing the focus request to the viewer's control.
 	 */
 	public void setFocus() {
 		viewer.getControl().setFocus();
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/package.html
===================================================================
--- tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/package.html	(revision 2396)
+++ tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Prototype of Query index.</p>
+	<p>Prototype of Query index.</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.cql2lsa.rcp/.classpath
===================================================================
--- tmp/org.txm.cql2lsa.rcp/.classpath	(revision 2396)
+++ tmp/org.txm.cql2lsa.rcp/.classpath	(revision 2397)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.dictionary.rcp/.classpath
===================================================================
--- tmp/org.txm.dictionary.rcp/.classpath	(revision 2396)
+++ tmp/org.txm.dictionary.rcp/.classpath	(revision 2397)
@@ -1,12 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry exported="true" kind="con"
+		path="GROOVY_DSL_SUPPORT" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.core/.classpath
===================================================================
--- tmp/org.txm.core/.classpath	(revision 2396)
+++ tmp/org.txm.core/.classpath	(revision 2397)
@@ -1,50 +1,77 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry exported="true" kind="lib" path="lib/ant-1.7.1.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/ant-launcher.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/ant.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.7.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/asm-analysis-2.2.3.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/asm-tree-2.2.3.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/concurrent-1.3.4.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/forms-1.0.7.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/jline-0.9.94.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/junit-4.5.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/jvectClipboard-1.2.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/liquidlnf.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.12.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/looks-2.0.1.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/macSpecific.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/quaqua.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/rtfCleaner.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/swing-layout-1.0.3.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/juniversalchardet-1.0.3.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/textcat-1.0.1.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/json-20090211.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/ridl-3.2.1.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/unoil-3.2.1.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/sqlite-jdbc-3.8.11.2.jar"/>
-	  <classpathentry exported="true" kind="lib" path="lib/postgresql-9.4.1207.jre6.jar"/>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry exported="true"
-                   kind="con"
-                   path="org.eclipse.pde.core.requiredPlugins">
-		    <attributes>
-			      <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY"
-                    value="org.txm.toolbox/native"/>
-		    </attributes>
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src/java"/>
-	  <classpathentry kind="src" path="test"/>
-	  <classpathentry kind="src" path="res"/>
-	  <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
-	  <classpathentry exported="true"
-                   kind="lib"
-                   path="lib/jodconverter-core-3.1-beta.jar"/>
-	  <classpathentry kind="lib" path="lib/jsoup-1.11.3.jar"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry exported="true" kind="lib"
+		path="lib/ant-1.7.1.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/ant-launcher.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/ant.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/antlr-2.7.7.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/asm-analysis-2.2.3.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/asm-tree-2.2.3.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/concurrent-1.3.4.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/dom4j-1.6.1.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/forms-1.0.7.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/jline-0.9.94.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/junit-4.5.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/jvectClipboard-1.2.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/liquidlnf.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/log4j-1.2.12.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/looks-2.0.1.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/macSpecific.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/quaqua.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/rtfCleaner.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/swing-layout-1.0.3.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/juniversalchardet-1.0.3.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/textcat-1.0.1.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/json-20090211.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/ridl-3.2.1.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/unoil-3.2.1.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/sqlite-jdbc-3.8.11.2.jar" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/postgresql-9.4.1207.jre6.jar" />
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry exported="true" kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<attributes>
+			<attribute
+				name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY"
+				value="org.txm.toolbox/native" />
+		</attributes>
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src/java" />
+	<classpathentry kind="src" path="test" />
+	<classpathentry kind="src" path="res" />
+	<classpathentry exported="true" kind="con"
+		path="GROOVY_DSL_SUPPORT" />
+	<classpathentry exported="true" kind="lib"
+		path="lib/jodconverter-core-3.1-beta.jar" />
+	<classpathentry kind="lib" path="lib/jsoup-1.11.3.jar" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.core/default.xml
===================================================================
--- tmp/org.txm.core/default.xml	(revision 2396)
+++ tmp/org.txm.core/default.xml	(revision 2397)
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <workspace name="default">
-   <projects>
-      <project name="default">
-         <bases>
-         </bases>
+	<projects>
+		<project name="default">
+			<bases>
+			</bases>
 
-         <corpora>
-         </corpora>
-      </project>
-   </projects>
+			<corpora>
+			</corpora>
+		</project>
+	</projects>
 </workspace>
\ No newline at end of file
Index: tmp/org.txm.core/buildJavadoc.xml
===================================================================
--- tmp/org.txm.core/buildJavadoc.xml	(revision 2396)
+++ tmp/org.txm.core/buildJavadoc.xml	(revision 2397)
@@ -1,9 +1,10 @@
 <project name="Toolbox" default="doc">
-	
+
 	<path id="lib.dir">
 		<!-- fileset : TO BE DEFINED MANUALLY -->
-		<fileset dir="/home/mdecorde/ECLIPSE 442/eclipse/plugins/org.codehaus.groovy_2.3.7.xx-201411061335-e44-RELEASE/lib">
-			
+		<fileset
+			dir="/home/mdecorde/ECLIPSE 442/eclipse/plugins/org.codehaus.groovy_2.3.7.xx-201411061335-e44-RELEASE/lib">
+
 			<include name="*.jar" />
 		</fileset>
 	</path>
@@ -12,32 +13,31 @@
 		<format property="TODAY" pattern="yyyy-MM-dd HH:mm" />
 	</tstamp>
 
-	<taskdef name="groovydoc" classname="org.codehaus.groovy.ant.Groovydoc" classpathref="lib.dir" />
-	
+	<taskdef name="groovydoc"
+		classname="org.codehaus.groovy.ant.Groovydoc" classpathref="lib.dir" />
+
 	<target name="doc">
 		<mkdir dir="../javadoc/" />
-		<!-- packagenames : 
-		TO BE UPDATED MANUALLY using project names of the SVN directory. 
-		-->
-		<!-- packagenames : 
-		TO BE UPDATED MANUALLY using project exported packages list. 
-		-->
-		<groovydoc 
-			destdir="javadoc/" 
-			sourcepath="../org.txm.core/src/java:../org.txm.statsengine.r.core/src:../org.txm.core.tests/src:../org.txm.cql2lsa.rcp/src:../org.txm.oriflamms.rcp/src:../org.txm.dictionary.rcp/src:../org.txm.para.core/src:../org.txm.groovy.core/src:../org.txm.para.rcp/src:../org.txm.groovy.rcp/src:../org.txm.partition.core/src:../org.txm.statsengine.r.rcp/src:../org.txm.imports.metopes/src:../org.txm.partition.rcp/src:../org.txm.svn.rcp/src:../org.txm.annotation.urs.rcp/src:../org.txm.index.core/src:../org.txm.practically.rcp/src:../org.txm.annotation.core/src:../org.txm.index.rcp/src:../org.txm.progression.core/src:../org.txm.edition.rcp/src:../org.txm.annotation.rcp/src:../org.txm.internalview.core/src:../org.txm.progression.rcp/src:../org.txm.textsbalance.core/src:../org.txm.backtomedia.rcp/src:../org.txm.internalview.rcp/src:../org.txm.querycooccurrences.rcp/src:../org.txm.ca.core/src:../org.txm.jodconverter.core/src:../org.txm.queryindex.rcp/src:../org.txm.textsbalance.rcp/src:../org.txm.ahc.core/src:../org.txm.lexicaltable.core/src:../org.txm.r/src:../org.txm.tigersearch.rcp/src:../org.txm.cah.rcp/src:../org.txm.lexicaltable.rcp/src:../org.txm.rcp/src/main/java:../org.txm.tmp.rcp/src:../org.txm.ca.rcp/src:../org.txm.lexicon.core/src:../org.txm.rcp.about.fragment/src:../org.txm.treetaggerinstaller.rcp/src:../org.txm.chartsengine.core/src:../org.txm.lexicon.rcp/src:../org.txm.treetagger.rcp/src:../org.txm.chartsengine.jfreechart.core/src:../org.txm.rcp.p2.ui/src:../org.txm.utils/src:../org.txm.chartsengine.jfreechart.rcp/src:../org.txm.referencer.core/src:../org.txm.wordcloud.core/src:../org.txm.chartsengine.raster.rcp/src:../org.txm.referencer.rcp/src:../org.txm.chartsengine.r.core/src:../org.txm.searchengine.core/src:../org.txm.wordcloud.rcp/src:../org.txm.chartsengine.rcp/src:../org.txm.searchengine.cqp.core/src:../org.txm.xmleditor.rcp/src:../org.txm.chartsengine.r.rcp/src:../org.txm.chartsengine.svgbatik.rcp/src:../org.txm.searchengine.cqp.rcp/src:../org.txm.concordance.core/src:../org.txm.setups.startdialog/src:../org.txm.concordance.rcp/src:../org.txm.specificities.core/src:../org.txm.cooccurrence.core/src:../org.txm.specificities.rcp/src:../org.txm.cooccurrence.rcp/src:../org.txm.statsengine.core" 
-			packagenames="org.txm.*" 
+		<!-- packagenames : TO BE UPDATED MANUALLY using project names of the SVN 
+			directory. -->
+		<!-- packagenames : TO BE UPDATED MANUALLY using project exported packages 
+			list. -->
+		<groovydoc destdir="javadoc/"
+			sourcepath="../org.txm.core/src/java:../org.txm.statsengine.r.core/src:../org.txm.core.tests/src:../org.txm.cql2lsa.rcp/src:../org.txm.oriflamms.rcp/src:../org.txm.dictionary.rcp/src:../org.txm.para.core/src:../org.txm.groovy.core/src:../org.txm.para.rcp/src:../org.txm.groovy.rcp/src:../org.txm.partition.core/src:../org.txm.statsengine.r.rcp/src:../org.txm.imports.metopes/src:../org.txm.partition.rcp/src:../org.txm.svn.rcp/src:../org.txm.annotation.urs.rcp/src:../org.txm.index.core/src:../org.txm.practically.rcp/src:../org.txm.annotation.core/src:../org.txm.index.rcp/src:../org.txm.progression.core/src:../org.txm.edition.rcp/src:../org.txm.annotation.rcp/src:../org.txm.internalview.core/src:../org.txm.progression.rcp/src:../org.txm.textsbalance.core/src:../org.txm.backtomedia.rcp/src:../org.txm.internalview.rcp/src:../org.txm.querycooccurrences.rcp/src:../org.txm.ca.core/src:../org.txm.jodconverter.core/src:../org.txm.queryindex.rcp/src:../org.txm.textsbalance.rcp/src:../org.txm.ahc.core/src:../org.txm.lexicaltable.core/src:../org.txm.r/src:../org.txm.tigersearch.rcp/src:../org.txm.cah.rcp/src:../org.txm.lexicaltable.rcp/src:../org.txm.rcp/src/main/java:../org.txm.tmp.rcp/src:../org.txm.ca.rcp/src:../org.txm.lexicon.core/src:../org.txm.rcp.about.fragment/src:../org.txm.treetaggerinstaller.rcp/src:../org.txm.chartsengine.core/src:../org.txm.lexicon.rcp/src:../org.txm.treetagger.rcp/src:../org.txm.chartsengine.jfreechart.core/src:../org.txm.rcp.p2.ui/src:../org.txm.utils/src:../org.txm.chartsengine.jfreechart.rcp/src:../org.txm.referencer.core/src:../org.txm.wordcloud.core/src:../org.txm.chartsengine.raster.rcp/src:../org.txm.referencer.rcp/src:../org.txm.chartsengine.r.core/src:../org.txm.searchengine.core/src:../org.txm.wordcloud.rcp/src:../org.txm.chartsengine.rcp/src:../org.txm.searchengine.cqp.core/src:../org.txm.xmleditor.rcp/src:../org.txm.chartsengine.r.rcp/src:../org.txm.chartsengine.svgbatik.rcp/src:../org.txm.searchengine.cqp.rcp/src:../org.txm.concordance.core/src:../org.txm.setups.startdialog/src:../org.txm.concordance.rcp/src:../org.txm.specificities.core/src:../org.txm.cooccurrence.core/src:../org.txm.specificities.rcp/src:../org.txm.cooccurrence.rcp/src:../org.txm.statsengine.core"
+			packagenames="org.txm.*" use="true"
+			windowtitle="TXM Groovy&amp;Java doc ${TODAY}"
+			doctitle="Groovy&amp;Java doc ${TODAY}"
+			header="TXM Groovy&amp;Java doc ${TODAY}"
+			footer="TXM Groovy&amp;Java doc ${TODAY}" private="false">
 
-			use="true"  
-			windowtitle="TXM Groovy&amp;Java doc ${TODAY}" 
-			doctitle="Groovy&amp;Java doc ${TODAY}" 
-			header="TXM Groovy&amp;Java doc ${TODAY}" 
-			footer="TXM Groovy&amp;Java doc ${TODAY}" 
-			private="false">
-			
-			<link packages="java.,org.xml.,javax.,org.xml." href="http://java.sun.com/j2se/1.5.0/docs/api" />
-			<link packages="org.apache.ant.,org.apache.tools.ant." href="http://www.dpml.net/api/ant/1.7.0" />
-			<link packages="org.junit.,junit.framework." href="http://junit.sourceforge.net/junit3.8.1/javadoc/" />
-			<link packages="groovy.,org.codehaus.groovy." href="http://groovy.codehaus.org/api/" />
+			<link packages="java.,org.xml.,javax.,org.xml."
+				href="http://java.sun.com/j2se/1.5.0/docs/api" />
+			<link packages="org.apache.ant.,org.apache.tools.ant."
+				href="http://www.dpml.net/api/ant/1.7.0" />
+			<link packages="org.junit.,junit.framework."
+				href="http://junit.sourceforge.net/junit3.8.1/javadoc/" />
+			<link packages="groovy.,org.codehaus.groovy."
+				href="http://groovy.codehaus.org/api/" />
 		</groovydoc>
 	</target>
 </project>
Index: tmp/org.txm.core/src/java/org/txm/importer/scripts/filters/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/scripts/filters/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/importer/scripts/filters/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Filters base class</p>
+	<p>Filters base class</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Manages xml-tei-txm files</p>
+	<p>Manages xml-tei-txm files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/importer/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Import tools</p>
+	<p>Import tools</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/scripting/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/scripting/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/importer/scripting/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>classes for Groovy calls</p>
+	<p>classes for Groovy calls</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/metadatas/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/metadatas/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/metadatas/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Tools to manage metadata</p>
+	<p>Tools to manage metadata</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/core/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/core/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>RCP plugin classes</p>
+	<p>RCP plugin classes</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/core/preferences/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/package.html	(revision 2397)
@@ -1,2 +1,6 @@
-<html><body>Core preferences: contains the low level preferences and the TXMPreferences utility class to access preferences</body></html>
+<html>
+<body>Core preferences: contains the low level preferences and
+	the TXMPreferences utility class to access preferences
+</body>
+</html>
 
Index: tmp/org.txm.core/src/java/org/txm/core/results/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/results/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/core/results/package.html	(revision 2397)
@@ -1,3 +1,4 @@
 <html>
-<body>abtract classes to use TXM commands</body>
+<body>abtract classes to use TXM commands
+</body>
 </html>
Index: tmp/org.txm.core/src/java/org/txm/core/messages/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/messages/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/core/messages/package.html	(revision 2397)
@@ -1,5 +1,4 @@
 <html>
-<body>
-Core message keys : contains the low level shared messages
+<body>Core message keys : contains the low level shared messages
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/functions/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/functions/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/functions/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Core level commands API (no UI) - not implemented yet</p>
+	<p>Core level commands API (no UI) - not implemented yet</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/objects/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/objects/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Defines all objects used in TXM</p>
+	<p>Defines all objects used in TXM</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Entry point for launching the toolbox.</p>
+	<p>Entry point for launching the toolbox.</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/sql/package.html
===================================================================
--- tmp/org.txm.core/src/java/org/txm/sql/package.html	(revision 2396)
+++ tmp/org.txm.core/src/java/org/txm/sql/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>SQL tools</p>
+	<p>SQL tools</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/1-default-html.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/1-default-html.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/1-default-html.xsl	(revision 2397)
@@ -1,420 +1,590 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-	xmlns:tei="http://www.tei-c.org/ns/1.0" 
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
 	xmlns:txm="http://textometrie.org/1.0"
 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
 	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-                exclude-result-prefixes="#all" version="2.0">
-                
+	exclude-result-prefixes="#all" version="2.0">
+
 	<xd:doc type="stylesheet">
 		<xd:short>
-			This stylesheet is designed for TXM XTZ import module to create 
-			HTML editions of corpus texts. This stylesheet should be used at 
-			"4-edition" step and must be accompanied by 2-default-pager.xsl. 
-			See TXM User Manual for more details 
+			This stylesheet is designed for TXM XTZ import module to
+			create
+			HTML editions of corpus texts. This stylesheet should be used at
+			"4-edition" step and must be accompanied by 2-default-pager.xsl.
+			See TXM User Manual for more details
 			(http://textometrie.ens-lyon.fr/spip.php?rubrique64)
 		</xd:short>
 		<xd:detail>
-			This stylesheet is free software; you can redistribute it and/or
+			This stylesheet is free software; you can redistribute it
+			and/or
 			modify it under the terms of the GNU Lesser General Public
 			License as published by the Free Software Foundation; either
-			version 3 of the License, or (at your option) any later version.
-			
+			version 3
+			of the License, or (at your option) any later version.
+
 			This stylesheet is distributed in the hope that it will be useful,
-			but WITHOUT ANY WARRANTY; without even the implied warranty of
-			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+			but
+			WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 			Lesser General Public License for more details.
-			
+
 			You should have received a copy of GNU Lesser Public License with
-			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+			this
+			stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
 		</xd:detail>
 		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
 		<xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
 	</xd:doc>
-                
-                
-                
-	<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"/>
-	
-	<!-- <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> -->
-	
-                
-                <xsl:strip-space elements="*"/>
-                
-	<xsl:param name="pagination-element">pb</xsl:param>
-	
+
+
+
+	<xsl:output method="xml" encoding="UTF-8"
+		omit-xml-declaration="no" indent="no" />
+
+	<!-- <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" 
+		indent="no" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> -->
+
+
+	<xsl:strip-space elements="*" />
+
+	<xsl:param name="pagination-element">
+		pb
+	</xsl:param>
+
 	<xsl:variable name="word-element">
 		<xsl:choose>
-			<xsl:when test="//tei:c//txm:form">c</xsl:when>
-			<xsl:otherwise>w</xsl:otherwise>
+			<xsl:when test="//tei:c//txm:form">
+				c
+			</xsl:when>
+			<xsl:otherwise>
+				w
+			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:variable>
 
 	<xsl:variable name="page-number-adjust" as="xs:integer">
 		<xsl:choose>
-			<xsl:when test="//tei:c//txm:form">1</xsl:when>
-			<xsl:otherwise>2</xsl:otherwise>
+			<xsl:when test="//tei:c//txm:form">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				2
+			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:variable>
-	
 
-                <xsl:variable name="inputtype">
-                	<xsl:choose>
-                		<xsl:when test="//tei:w//txm:form">xmltxm</xsl:when>
-                		<xsl:otherwise>xmlw</xsl:otherwise>
-                	</xsl:choose>
-                </xsl:variable>
-	
+
+	<xsl:variable name="inputtype">
+		<xsl:choose>
+			<xsl:when test="//tei:w//txm:form">
+				xmltxm
+			</xsl:when>
+			<xsl:otherwise>
+				xmlw
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+
 	<xsl:variable name="filename">
-		<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/.]+$">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/.]+$">
 			<xsl:matching-substring>
-				<xsl:value-of select="regex-group(2)"/>
+				<xsl:value-of select="regex-group(2)" />
 			</xsl:matching-substring>
 		</xsl:analyze-string>
 	</xsl:variable>
-                
-                <xsl:template match="/">
-                	<html>
-                		<head>
-                			<title><xsl:choose>
-                				<xsl:when test="//tei:text/@id"><xsl:value-of select="//tei:text[1]/@id"/></xsl:when>
-                				<xsl:otherwise><xsl:value-of select="$filename"/></xsl:otherwise>
-                			</xsl:choose></title>
-                			<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-                			<link rel="stylesheet" media="all" type="text/css" href="css/txm.css" />
-                		</head>
-                			<xsl:apply-templates select="descendant::tei:text"/>
-                	</html>
-                </xsl:template>
 
+	<xsl:template match="/">
+		<html>
+			<head>
+				<title>
+					<xsl:choose>
+						<xsl:when test="//tei:text/@id">
+							<xsl:value-of select="//tei:text[1]/@id" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$filename" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</title>
+				<meta http-equiv="Content-Type"
+					content="text/html;charset=UTF-8" />
+				<link rel="stylesheet" media="all" type="text/css"
+					href="css/txm.css" />
+			</head>
+			<xsl:apply-templates
+				select="descendant::tei:text" />
+		</html>
+	</xsl:template>
+
 	<xsl:template match="tei:text">
 		<body>
 			<xsl:if test="$word-element='w'">
-				<a class="txm-page" title="1"  next-word-id="w_0"/>
+				<a class="txm-page" title="1" next-word-id="w_0" />
 				<div class="metadata-page">
-					<h1><xsl:value-of select="@id"></xsl:value-of></h1>
-					<br/>
+					<h1>
+						<xsl:value-of select="@id"></xsl:value-of>
+					</h1>
+					<br />
 					<table>
 						<xsl:for-each select="@*">
 							<tr>
-								<td><xsl:value-of select="name()"/></td>
-								<td><xsl:value-of select="."/></td>
+								<td>
+									<xsl:value-of select="name()" />
+								</td>
+								<td>
+									<xsl:value-of select="." />
+								</td>
 							</tr>
 						</xsl:for-each>
 					</table>
 				</div>
-				
+
 			</xsl:if>
-			<xsl:apply-templates/>
-			
-			<xsl:variable name="page_id"><xsl:value-of select="count(descendant::*[local-name()=$pagination-element])"/></xsl:variable>
-			
-			<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][count(preceding::*[local-name()=$pagination-element]) = $page_id]">
+			<xsl:apply-templates />
+
+			<xsl:variable name="page_id">
+				<xsl:value-of
+					select="count(descendant::*[local-name()=$pagination-element])" />
+			</xsl:variable>
+
+			<xsl:if
+				test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][count(preceding::*[local-name()=$pagination-element]) = $page_id]">
 				<xsl:text>&#xa;</xsl:text>
-				<br/>
-				<br/>			
-				<span style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">                                                
-					<xsl:for-each select="//tei:note[count(preceding::*[local-name()=$pagination-element]) = $page_id]">
-						<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note) + 1"/></xsl:variable>
-						<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-->
+				<br />
+				<br />
+				<span
+					style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">
+					<xsl:for-each
+						select="//tei:note[count(preceding::*[local-name()=$pagination-element]) = $page_id]">
+						<xsl:variable name="note_count">
+							<xsl:value-of
+								select="count(preceding::tei:note) + 1" />
+						</xsl:variable>
+						<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" 
+							name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, 
+							l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> 
+							<xsl:value-of select="."/></p> -->
 						<span class="note">
-							<span style="position:absolute;left:-30px"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
-							<xsl:apply-templates mode="#current"/>
-						</span>                                                                
-					</xsl:for-each></span><xsl:text>&#xa;</xsl:text>                                                                
-				
+							<span style="position:absolute;left:-30px">
+								<a href="#noteref_{$note_count}" name="note_{$note_count}">
+									<xsl:value-of select="$note_count" />
+								</a>
+								.
+							</span>
+							<xsl:apply-templates mode="#current" />
+						</span>
+					</xsl:for-each>
+				</span>
+				<xsl:text>&#xa;</xsl:text>
+
 			</xsl:if>
-			
-			
+
+
 		</body>
 	</xsl:template>
-	
-	
-                <xsl:template match="*">
-                                <xsl:choose>
-                                	<xsl:when test="descendant::tei:p|descendant::tei:ab">
-                                		<div>
-                                			<xsl:call-template name="addClass"/>
-                                			<xsl:apply-templates/></div>
-                                		<xsl:text>&#xa;</xsl:text>
-                                	</xsl:when>
-                                	<xsl:otherwise><span>
-                                		<xsl:call-template name="addClass"/>
-                                		<xsl:if test="self::tei:add[@del]">
-                                			<xsl:attribute name="title"><xsl:value-of select="@del"/></xsl:attribute>
-                                		</xsl:if>
-                                		<xsl:apply-templates/></span>
-                                	<xsl:call-template name="spacing"/>
-                                	</xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="@*|processing-instruction()|comment()">
-                                <!--<xsl:copy/>-->
-                </xsl:template>
-                
-<!--                <xsl:template match="comment()">
-                                <xsl:copy/>
-                </xsl:template>
--->                
-                <xsl:template match="text()">
-                                <xsl:value-of select="normalize-space(.)"/>
-                </xsl:template>
-                
-                <xsl:template name="addClass">
-                	<xsl:attribute name="class">
-                		<xsl:value-of select="local-name(.)"/>
-                		<xsl:if test="@type"><xsl:value-of select="concat('-',@type)"/></xsl:if>
-                		<xsl:if test="@subtype"><xsl:value-of select="concat('-',@subtype)"/></xsl:if>
-                		<xsl:if test="@rend"><xsl:value-of select="concat('-',@rend)"/></xsl:if>
-                	</xsl:attribute>                	
-                </xsl:template>
-                
-                <xsl:template match="tei:p|tei:ab|tei:lg">
-                	<p>
-                		<xsl:call-template name="addClass"/>
-                		<xsl:apply-templates/>
-                	</p>
-                	<xsl:text>&#xa;</xsl:text>
-                </xsl:template>
-	
+
+
+	<xsl:template match="*">
+		<xsl:choose>
+			<xsl:when test="descendant::tei:p|descendant::tei:ab">
+				<div>
+					<xsl:call-template name="addClass" />
+					<xsl:apply-templates />
+				</div>
+				<xsl:text>&#xa;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<span>
+					<xsl:call-template name="addClass" />
+					<xsl:if test="self::tei:add[@del]">
+						<xsl:attribute name="title"><xsl:value-of
+							select="@del" /></xsl:attribute>
+					</xsl:if>
+					<xsl:apply-templates />
+				</span>
+				<xsl:call-template name="spacing" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+		<!--<xsl:copy/> -->
+	</xsl:template>
+
+	<!-- <xsl:template match="comment()"> <xsl:copy/> </xsl:template> -->
+	<xsl:template match="text()">
+		<xsl:value-of select="normalize-space(.)" />
+	</xsl:template>
+
+	<xsl:template name="addClass">
+		<xsl:attribute name="class">
+                		<xsl:value-of select="local-name(.)" />
+                		<xsl:if test="@type"><xsl:value-of
+			select="concat('-',@type)" /></xsl:if>
+                		<xsl:if test="@subtype"><xsl:value-of
+			select="concat('-',@subtype)" /></xsl:if>
+                		<xsl:if test="@rend"><xsl:value-of
+			select="concat('-',@rend)" /></xsl:if>
+                	</xsl:attribute>
+	</xsl:template>
+
+	<xsl:template match="tei:p|tei:ab|tei:lg">
+		<p>
+			<xsl:call-template name="addClass" />
+			<xsl:apply-templates />
+		</p>
+		<xsl:text>&#xa;</xsl:text>
+	</xsl:template>
+
 	<xsl:template match="tei:head">
 		<h2>
-			<xsl:call-template name="addClass"/>
-			<xsl:apply-templates/>
+			<xsl:call-template name="addClass" />
+			<xsl:apply-templates />
 		</h2>
 	</xsl:template>
-	
+
 	<xsl:template match="tei:gap">
 		<span class="gap">
 			<xsl:if test="@quantity and @unit">
-				<xsl:attribute name="title"><xsl:value-of select="concat(@quantity,' ',@unit)"/></xsl:attribute>
+				<xsl:attribute name="title"><xsl:value-of
+					select="concat(@quantity,' ',@unit)" /></xsl:attribute>
 			</xsl:if>
 			<xsl:text>[...]</xsl:text>
 		</span>
-		<xsl:call-template name="spacing"/>
+		<xsl:call-template name="spacing" />
 	</xsl:template>
-                
+
 	<xsl:template match="//tei:lb">
 		<xsl:variable name="lbcount">
 			<xsl:choose>
-				<xsl:when test="ancestor::tei:ab"><xsl:number from="tei:ab" level="any"/></xsl:when>
-				<xsl:when test="ancestor::tei:p"><xsl:number from="tei:p" level="any"/></xsl:when>
-				<xsl:otherwise>999</xsl:otherwise>
+				<xsl:when test="ancestor::tei:ab">
+					<xsl:number from="tei:ab" level="any" />
+				</xsl:when>
+				<xsl:when test="ancestor::tei:p">
+					<xsl:number from="tei:p" level="any" />
+				</xsl:when>
+				<xsl:otherwise>
+					999
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		<xsl:if test="@rend='hyphen(-)'"><span class="hyphen">-</span></xsl:if>
-		<xsl:if test="@rend='hyphen(=)'"><span class="hyphen">=</span></xsl:if>
-		<xsl:if test="ancestor::tei:w and not(contains(@rend,'hyphen'))"><span class="hyphen-added">-</span></xsl:if>
-		<xsl:if test="not($lbcount=1) or preceding-sibling::node()[matches(.,'\S')]"><br/><xsl:text>&#xa;</xsl:text></xsl:if>
+		<xsl:if test="@rend='hyphen(-)'">
+			<span class="hyphen">-</span>
+		</xsl:if>
+		<xsl:if test="@rend='hyphen(=)'">
+			<span class="hyphen">=</span>
+		</xsl:if>
+		<xsl:if
+			test="ancestor::tei:w and not(contains(@rend,'hyphen'))">
+			<span class="hyphen-added">-</span>
+		</xsl:if>
+		<xsl:if
+			test="not($lbcount=1) or preceding-sibling::node()[matches(.,'\S')]">
+			<br />
+			<xsl:text>&#xa;</xsl:text>
+		</xsl:if>
 		<xsl:if test="@n and not(@rend='prose')">
 			<xsl:choose>
 				<xsl:when test="matches(@n,'^[0-9]*[05]$')">
-					<!--<a title="{@n}" class="verseline" style="position:relative"> </a>-->
-					<!--<span class="verseline"><span class="verselinenumber"><xsl:value-of select="@n"/></span></span>-->
-					<span class="verselinenumber"><xsl:value-of select="@n"/></span>
-					
+					<!--<a title="{@n}" class="verseline" style="position:relative"> </a> -->
+					<!--<span class="verseline"><span class="verselinenumber"><xsl:value-of 
+						select="@n"/></span></span> -->
+					<span class="verselinenumber">
+						<xsl:value-of select="@n" />
+					</span>
+
 				</xsl:when>
 				<xsl:when test="matches(@n,'[^0-9]')">
-					<!--<a title="{@n}" class="verseline" style="position:relative"> </a>-->
-					<!--<span class="verseline"><span class="verselinenumber"><xsl:value-of select="@n"/></span></span>-->
-					<span class="verselinenumber"><xsl:value-of select="@n"/></span>
+					<!--<a title="{@n}" class="verseline" style="position:relative"> </a> -->
+					<!--<span class="verseline"><span class="verselinenumber"><xsl:value-of 
+						select="@n"/></span></span> -->
+					<span class="verselinenumber">
+						<xsl:value-of select="@n" />
+					</span>
 				</xsl:when>
 				<xsl:otherwise>
 				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:if>
 	</xsl:template>
-	
-	<!-- Page breaks -->                
-	<xsl:template match="//*[local-name()=$pagination-element]">
-		
+
+	<!-- Page breaks -->
+	<xsl:template
+		match="//*[local-name()=$pagination-element]">
+
 		<xsl:variable name="next-word-position" as="xs:integer">
 			<xsl:choose>
 				<xsl:when test="following::*[local-name()=$word-element]">
-					<xsl:value-of select="count(following::*[local-name()=$word-element][1]/preceding::*[local-name()=$word-element])"/>
+					<xsl:value-of
+						select="count(following::*[local-name()=$word-element][1]/preceding::*[local-name()=$word-element])" />
 				</xsl:when>
-				<xsl:otherwise>0</xsl:otherwise>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
 		<xsl:variable name="next-pb-position" as="xs:integer">
 			<xsl:choose>
-				<xsl:when test="following::*[local-name()=$pagination-element]">
-					<xsl:value-of select="count(following::*[local-name()=$pagination-element][1]/preceding::*[local-name()=$word-element])"/>
+				<xsl:when
+					test="following::*[local-name()=$pagination-element]">
+					<xsl:value-of
+						select="count(following::*[local-name()=$pagination-element][1]/preceding::*[local-name()=$word-element])" />
 				</xsl:when>
-				<xsl:otherwise>999999999</xsl:otherwise>
+				<xsl:otherwise>
+					999999999
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
 		<xsl:variable name="next-word-id">
 			<xsl:choose>
-				<xsl:when test="$next-pb-position - $next-word-position = 999999999">w_0</xsl:when>
-				<xsl:when test="$next-pb-position &gt; $next-word-position"><xsl:value-of select="following::*[local-name()=$word-element][1]/@id"/></xsl:when>
-				<xsl:otherwise>w_0</xsl:otherwise>
+				<xsl:when
+					test="$next-pb-position - $next-word-position = 999999999">
+					w_0
+				</xsl:when>
+				<xsl:when test="$next-pb-position &gt; $next-word-position">
+					<xsl:value-of
+						select="following::*[local-name()=$word-element][1]/@id" />
+				</xsl:when>
+				<xsl:otherwise>
+					w_0
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		
-		
+
+
 		<xsl:variable name="editionpagetype">
 			<xsl:choose>
-				<xsl:when test="ancestor::tei:ab">editionpageverse</xsl:when>
-				<xsl:otherwise>editionpage</xsl:otherwise>
+				<xsl:when test="ancestor::tei:ab">
+					editionpageverse
+				</xsl:when>
+				<xsl:otherwise>
+					editionpage
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
 		<xsl:variable name="pagenumber">
 			<xsl:choose>
-				<xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when>
-				<xsl:when test="@facs"><xsl:value-of select="substring-before(@facs,'.')"/></xsl:when>
-				<xsl:otherwise>[NN]</xsl:otherwise>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:when test="@facs">
+					<xsl:value-of select="substring-before(@facs,'.')" />
+				</xsl:when>
+				<xsl:otherwise>
+					[NN]
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		
-		<xsl:variable name="page_id"><xsl:value-of select="count(preceding::*[local-name()=$pagination-element])"/></xsl:variable>
-		
-		<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $page_id]]">
+
+		<xsl:variable name="page_id">
+			<xsl:value-of
+				select="count(preceding::*[local-name()=$pagination-element])" />
+		</xsl:variable>
+
+		<xsl:if
+			test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $page_id]]">
 			<xsl:text>&#xa;</xsl:text>
-			<br/>
-			<br/>			
-			<span style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">                                                
-				<xsl:for-each select="//tei:note[following::*[local-name()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $page_id]]">
-					<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note) + 1"/></xsl:variable>
-					<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-->
+			<br />
+			<br />
+			<span
+				style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">
+				<xsl:for-each
+					select="//tei:note[following::*[local-name()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $page_id]]">
+					<xsl:variable name="note_count">
+						<xsl:value-of select="count(preceding::tei:note) + 1" />
+					</xsl:variable>
+					<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" 
+						name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, 
+						l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> 
+						<xsl:value-of select="."/></p> -->
 					<span class="note">
-						<span style="position:absolute;left:-30px"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
-						<xsl:apply-templates mode="#current"/>
-					</span>                                                                
-				</xsl:for-each></span><xsl:text>&#xa;</xsl:text>                                                                
-			
+						<span style="position:absolute;left:-30px">
+							<a href="#noteref_{$note_count}" name="note_{$note_count}">
+								<xsl:value-of select="$note_count" />
+							</a>
+							.
+						</span>
+						<xsl:apply-templates mode="#current" />
+					</span>
+				</xsl:for-each>
+			</span>
+			<xsl:text>&#xa;</xsl:text>
+
 		</xsl:if>
-		
-		
+
+
 		<xsl:text>&#xa;</xsl:text>
-		<br/><xsl:text>&#xa;</xsl:text>
-		
-			<a class="txm-page" title="{count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust}" next-word-id="{$next-word-id}"/>
-		
-		<span class="{$editionpagetype}"> &lt;<xsl:value-of select="$pagenumber"/>&gt; </span><br/><xsl:text>&#xa;</xsl:text>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
+
+		<a class="txm-page"
+			title="{count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust}"
+			next-word-id="{$next-word-id}" />
+
+		<span class="{$editionpagetype}">
+			&lt;
+			<xsl:value-of select="$pagenumber" />
+			&gt;
+		</span>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
 	</xsl:template>
-	
+
 	<!-- Notes -->
 	<xsl:template match="tei:note">
-		<!--<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] </span>-->	
-		<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note) + 1"/></xsl:variable>
+		<!--<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] 
+			</span> -->
+		<xsl:variable name="note_count">
+			<xsl:value-of select="count(preceding::tei:note) + 1" />
+		</xsl:variable>
 		<xsl:variable name="note_content">
 			<xsl:choose>
 				<xsl:when test="descendant::txm:form">
-					<xsl:for-each select="descendant::txm:form">						
-						<xsl:value-of select="."/>
-						<xsl:if test="not(matches(following::txm:form[1],'^[.,\)]')) and not(matches(.,'^\S+[''’]$|^[‘\(]$'))">
+					<xsl:for-each select="descendant::txm:form">
+						<xsl:value-of select="." />
+						<xsl:if
+							test="not(matches(following::txm:form[1],'^[.,\)]')) and not(matches(.,'^\S+[''’]$|^[‘\(]$'))">
 							<xsl:text> </xsl:text>
 						</xsl:if>
 					</xsl:for-each>
 				</xsl:when>
-				<xsl:otherwise><xsl:value-of select="normalize-space(.)"/></xsl:otherwise>
+				<xsl:otherwise>
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
 		<xsl:choose>
 			<xsl:when test="matches(@type,'intern|auto')"></xsl:when>
-			<xsl:when test="@place='inline'"><span class="note"> (Note : <xsl:value-of select="$note_content"/>)</span></xsl:when>
-			<xsl:when test="not(@place='inline') and not(matches(@type,'intern|auto'))">
-				<a title="{$note_content}" style="font-size:75%;position:relative;top:-5px" href="#note_{$note_count}" name="noteref_{$note_count}">[<xsl:value-of select="$note_count"/>]</a>
+			<xsl:when test="@place='inline'">
+				<span class="note">
+					(Note :
+					<xsl:value-of select="$note_content" />
+					)
+				</span>
 			</xsl:when>
-			<xsl:otherwise><span class="noteref" title="{$note_content}">[•]</span></xsl:otherwise>
+			<xsl:when
+				test="not(@place='inline') and not(matches(@type,'intern|auto'))">
+				<a title="{$note_content}"
+					style="font-size:75%;position:relative;top:-5px"
+					href="#note_{$note_count}" name="noteref_{$note_count}">
+					[
+					<xsl:value-of select="$note_count" />
+					]
+				</a>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="noteref" title="{$note_content}">[•]</span>
+			</xsl:otherwise>
 		</xsl:choose>
-		<xsl:call-template name="spacing"/>                                
+		<xsl:call-template name="spacing" />
 	</xsl:template>
-	
+
 	<xsl:template match="tei:bibl">
 		<span class="noteref" title="{normalize-space(.)}">[•]</span>
 	</xsl:template>
-	
+
 	<xsl:template match="a[@class='txmpageref']">
-		<xsl:copy-of select="."/>
+		<xsl:copy-of select="." />
 	</xsl:template>
-	
-	<!--<xsl:template match="tei:note[@place='inline']">
-		<span class="noteinline">
-			<xsl:apply-templates/>
-		</span>
-	</xsl:template>
-   -->             
-                <xsl:template match="//tei:w"><span class="w">
-                	<xsl:choose>
-                		<xsl:when test="descendant::tei:c//txm:form">
-                			<xsl:apply-templates select="descendant::tei:c"/>
-                		</xsl:when>
-                		<xsl:otherwise>
-                			<xsl:if test="@*:id">
-                				<xsl:attribute name="id"><xsl:value-of select="@*:id"/></xsl:attribute>
-                			</xsl:if>
-                			<xsl:attribute name="title">
-                				<xsl:for-each select="@*[not(matches(local-name(.),'id'))]">
-                					<xsl:value-of select="concat(name(.),' : ',.,' ; ')"/>
+
+	<!--<xsl:template match="tei:note[@place='inline']"> <span class="noteinline"> 
+		<xsl:apply-templates/> </span> </xsl:template> -->
+	<xsl:template match="//tei:w">
+		<span class="w">
+			<xsl:choose>
+				<xsl:when test="descendant::tei:c//txm:form">
+					<xsl:apply-templates select="descendant::tei:c" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:if test="@*:id">
+						<xsl:attribute name="id"><xsl:value-of
+							select="@*:id" /></xsl:attribute>
+					</xsl:if>
+					<xsl:attribute name="title">
+                				<xsl:for-each
+						select="@*[not(matches(local-name(.),'id'))]">
+                					<xsl:value-of
+						select="concat(name(.),' : ',.,' ; ')" />
                 				</xsl:for-each>
                 				<xsl:if test="descendant::txm:ana">	
-                					<xsl:for-each select="descendant::txm:ana">
-                						<xsl:value-of select="concat(substring-after(@type,'#'),' : ',.,' ; ')"/>
+                					<xsl:for-each
+						select="descendant::txm:ana">
+                						<xsl:value-of
+						select="concat(substring-after(@type,'#'),' : ',.,' ; ')" />
                 					</xsl:for-each>
                 				</xsl:if>
                 			</xsl:attribute>
-                			<xsl:choose>
-                				<xsl:when test="descendant::txm:form">
-                					<xsl:apply-templates select="txm:form"/>
-                				</xsl:when>
-                				<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
-                			</xsl:choose>
-                		</xsl:otherwise>
-                	</xsl:choose>
-                                </span><xsl:call-template name="spacing"/></xsl:template>
-                
-<!--                <xsl:template match="//txm:form">
-                                <xsl:apply-templates/>
-                </xsl:template>
--->                
-	
+					<xsl:choose>
+						<xsl:when test="descendant::txm:form">
+							<xsl:apply-templates select="txm:form" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+		<xsl:call-template name="spacing" />
+	</xsl:template>
 
+	<!-- <xsl:template match="//txm:form"> <xsl:apply-templates/> </xsl:template> -->
+
+
 	<xsl:template name="spacing">
 		<xsl:choose>
 			<xsl:when test="$inputtype='xmltxm'">
-				<xsl:call-template name="spacing-xmltxm"/>
+				<xsl:call-template name="spacing-xmltxm" />
 			</xsl:when>
 			<xsl:otherwise>
-				<xsl:call-template name="spacing-xmlw"/>
+				<xsl:call-template name="spacing-xmlw" />
 			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:template>
-	
+
 	<xsl:template name="spacing-xmlw">
 		<xsl:choose>
-			<xsl:when test="ancestor::tei:w"/>
-			<xsl:when test="following::tei:w[1][matches(.,'^\s*[.,)\]]+\s*$')]"/>			
+			<xsl:when test="ancestor::tei:w" />
+			<xsl:when
+				test="following::tei:w[1][matches(.,'^\s*[.,)\]]+\s*$')]" />
 			<xsl:when test="matches(.,'^\s*[(\[‘]+$|\w(''|’)\s*$')"></xsl:when>
-			<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
+			<xsl:when
+				test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
 			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-			<xsl:when test="following::tei:w[1][matches(.,'^\s*[:;!?]+\s*$')]">
+			<xsl:when
+				test="following::tei:w[1][matches(.,'^\s*[:;!?]+\s*$')]">
 				<xsl:text>&#xa0;</xsl:text>
 			</xsl:when>
 			<xsl:otherwise>
 				<xsl:text> </xsl:text>
 			</xsl:otherwise>
-		</xsl:choose>                
+		</xsl:choose>
 	</xsl:template>
 
 	<xsl:template name="spacing-xmltxm">
 		<xsl:choose>
-			<xsl:when test="ancestor::tei:w"/>
-			<xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[.,)\]]+$')]"/>			
-			<xsl:when test="matches(descendant::txm:form[1],'^[(\[‘]+$|\w(''|’)$')"></xsl:when>
-			<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
+			<xsl:when test="ancestor::tei:w" />
+			<xsl:when
+				test="following::tei:w[1][matches(descendant::txm:form[1],'^[.,)\]]+$')]" />
+			<xsl:when
+				test="matches(descendant::txm:form[1],'^[(\[‘]+$|\w(''|’)$')"></xsl:when>
+			<xsl:when
+				test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
 			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-			<xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[:;!?]+$')]">
+			<xsl:when
+				test="following::tei:w[1][matches(descendant::txm:form[1],'^[:;!?]+$')]">
 				<xsl:text>&#xa0;</xsl:text>
 			</xsl:when>
 			<xsl:otherwise>
 				<xsl:text> </xsl:text>
 			</xsl:otherwise>
-		</xsl:choose>                
+		</xsl:choose>
 	</xsl:template>
 
-                
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-teiHeader2textAtt.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-teiHeader2textAtt.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-teiHeader2textAtt.xsl	(revision 2397)
@@ -1,143 +1,171 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  exclude-result-prefixes="tei edate" xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	exclude-result-prefixes="tei edate"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet is designed for TXM XTZ+CSV import module to extract 
-      metadata from the teiHeader and add them as attributes
-      of the text element. It should be used at "2-front" step. See TXM 
-      User Manual for more details 
-      (http://textometrie.ens-lyon.fr/spip.php?rubrique64)
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
-  </xd:doc>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet is designed for TXM XTZ+CSV import module to extract
+			metadata from the teiHeader and add them as attributes
+			of the text element. It should be used at "2-front" step. See TXM
+			User Manual for more details
+			(http://textometrie.ens-lyon.fr/spip.php?rubrique64)
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
+	</xd:doc>
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> 
-  
-  
-<!-- General patterns: all elements, attributes, comments and processing instructions are copied -->
-  
-  <xsl:template match="*">      
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>    
-  </xsl:template>
-  
-  <xsl:template match="*" mode="position"><xsl:value-of select="count(preceding-sibling::*)"/></xsl:template>
 
-  <xsl:template match="@*|comment()|processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
 
-  <xsl:variable name="current-file-name">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
-  
-<!-- Extracting metadata to use -->
- 
-  <xsl:variable name="title">
-    <xsl:choose>
-      <xsl:when test="/TEI/teiHeader/fileDesc/titleStmt/title[@type='main']">
-        <xsl:value-of select="/TEI/teiHeader/fileDesc/titleStmt/title[@type='main'][1]"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="/TEI/teiHeader/fileDesc/titleStmt/title[1]"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  
-  <xsl:variable name="author">
-    <xsl:choose>
-      <xsl:when test="/TEI/teiHeader/fileDesc/titleStmt/author">
-        <xsl:for-each select="/TEI/teiHeader/fileDesc/titleStmt/author">
-          <xsl:value-of select="."/>
-          <xsl:if test="following-sibling::author">
-            <xsl:text>, </xsl:text>
-          </xsl:if>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>anonyme</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  
-  <xsl:variable name="text_creation_date">
-    <xsl:choose>
-      <xsl:when test="/TEI/teiHeader/profileDesc/creation/date[@type='compo']">
-        <xsl:choose>
-          <xsl:when test="/TEI/teiHeader/profileDesc/creation/date[@type='compo'][1]/@when">
-            <xsl:value-of select="/TEI/teiHeader/profileDesc/creation/date[@type='compo'][1]/@when"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="/TEI/teiHeader/profileDesc/creation/date[@type='compo'][1]"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="/TEI/teiHeader/profileDesc/creation/date">
-        <xsl:choose>
-          <xsl:when test="/TEI/teiHeader/profileDesc/creation/date[1]/@when">
-            <xsl:value-of select="/TEI/teiHeader/profileDesc/creation/date[1]/@when"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="/TEI/teiHeader/profileDesc/creation/date[1]"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>sans date</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  
-  <xsl:variable name="genre">
-    <xsl:choose>
-      <xsl:when test="/TEI/teiHeader//keywords/term[@type='genre']">
-        <xsl:value-of select="/TEI/teiHeader//keywords[1]/term[@type='genre'][1]"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>inconnu</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
 
-<!-- Injecting metadata into attibutes of the text element -->
 
-<xsl:template match="text">
-  <xsl:copy>
-    <xsl:apply-templates select="@*"/>
-    <xsl:attribute name="id"><xsl:value-of select="$current-file-name"/></xsl:attribute>
-    <xsl:attribute name="titre"><xsl:value-of select="$title"/></xsl:attribute>
-    <xsl:attribute name="auteur"><xsl:value-of select="$author"/></xsl:attribute>
-    <xsl:attribute name="date-compo"><xsl:value-of select="$text_creation_date"/></xsl:attribute>
-    <xsl:attribute name="genre"><xsl:value-of select="$genre"/></xsl:attribute>
-    <xsl:apply-templates/>
-  </xsl:copy>
-</xsl:template>
+	<!-- General patterns: all elements, attributes, comments and processing 
+		instructions are copied -->
 
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
+	<xsl:template match="*" mode="position">
+		<xsl:value-of select="count(preceding-sibling::*)" />
+	</xsl:template>
+
+	<xsl:template
+		match="@*|comment()|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:variable name="current-file-name">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+	<!-- Extracting metadata to use -->
+
+	<xsl:variable name="title">
+		<xsl:choose>
+			<xsl:when
+				test="/TEI/teiHeader/fileDesc/titleStmt/title[@type='main']">
+				<xsl:value-of
+					select="/TEI/teiHeader/fileDesc/titleStmt/title[@type='main'][1]" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="/TEI/teiHeader/fileDesc/titleStmt/title[1]" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+
+	<xsl:variable name="author">
+		<xsl:choose>
+			<xsl:when test="/TEI/teiHeader/fileDesc/titleStmt/author">
+				<xsl:for-each
+					select="/TEI/teiHeader/fileDesc/titleStmt/author">
+					<xsl:value-of select="." />
+					<xsl:if test="following-sibling::author">
+						<xsl:text>, </xsl:text>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>anonyme</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+
+	<xsl:variable name="text_creation_date">
+		<xsl:choose>
+			<xsl:when
+				test="/TEI/teiHeader/profileDesc/creation/date[@type='compo']">
+				<xsl:choose>
+					<xsl:when
+						test="/TEI/teiHeader/profileDesc/creation/date[@type='compo'][1]/@when">
+						<xsl:value-of
+							select="/TEI/teiHeader/profileDesc/creation/date[@type='compo'][1]/@when" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of
+							select="/TEI/teiHeader/profileDesc/creation/date[@type='compo'][1]" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="/TEI/teiHeader/profileDesc/creation/date">
+				<xsl:choose>
+					<xsl:when
+						test="/TEI/teiHeader/profileDesc/creation/date[1]/@when">
+						<xsl:value-of
+							select="/TEI/teiHeader/profileDesc/creation/date[1]/@when" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of
+							select="/TEI/teiHeader/profileDesc/creation/date[1]" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>sans date</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+
+	<xsl:variable name="genre">
+		<xsl:choose>
+			<xsl:when
+				test="/TEI/teiHeader//keywords/term[@type='genre']">
+				<xsl:value-of
+					select="/TEI/teiHeader//keywords[1]/term[@type='genre'][1]" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>inconnu</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+
+	<!-- Injecting metadata into attibutes of the text element -->
+
+	<xsl:template match="text">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="id"><xsl:value-of
+				select="$current-file-name" /></xsl:attribute>
+			<xsl:attribute name="titre"><xsl:value-of
+				select="$title" /></xsl:attribute>
+			<xsl:attribute name="auteur"><xsl:value-of
+				select="$author" /></xsl:attribute>
+			<xsl:attribute name="date-compo"><xsl:value-of
+				select="$text_creation_date" /></xsl:attribute>
+			<xsl:attribute name="genre"><xsl:value-of
+				select="$genre" /></xsl:attribute>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/concordance_simple.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/concordance_simple.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/concordance_simple.xsl	(revision 2397)
@@ -1,56 +1,69 @@
 ﻿<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
-								xmlns:exsl="http://exslt.org/common">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:exsl="http://exslt.org/common">
 	<!-- Revised 8 Feb 2012 by TMR -->
-	
+
 	<!-- Delimiter is tab. written as &#09; -->
 
 	<xsl:output method="text" encoding="UTF-8" indent="no" />
 
-	<xsl:param name="cx" select="15"/>
+	<xsl:param name="cx" select="15" />
 	<!-- vary this value to change the size of the context -->
-	
+
 	<xsl:param name="ntTypes"></xsl:param>
 	<!-- non-terminal pivot features to show -->
-		
-	<xsl:param name="tTypes" >pos form</xsl:param>
+
+	<xsl:param name="tTypes">
+		pos form
+	</xsl:param>
 	<!-- terminal pivot features to show -->
-				
-	<xsl:key name="idkey" match="t|nt" use="@id"/>
+
+	<xsl:key name="idkey" match="t|nt" use="@id" />
 	<!-- Lezius' lookup key -->
 
 	<xsl:template match="/">
-		
-		<xsl:variable name="valueshownt" ><xsl:value-of select="$ntTypes" /></xsl:variable>
-		
-		<xsl:variable name="valueshowt" ><xsl:value-of select="$tTypes" /></xsl:variable>
-		
-		<!--Write a header-->
-				
+
+		<xsl:variable name="valueshownt">
+			<xsl:value-of select="$ntTypes" />
+		</xsl:variable>
+
+		<xsl:variable name="valueshowt">
+			<xsl:value-of select="$tTypes" />
+		</xsl:variable>
+
+		<!--Write a header -->
+
 		<xsl:text>ID&#x09;LeftCxOutsideSnt&#x09;LeftCxInsideSnt&#x09;Pivot&#x09;</xsl:text>
-		
-		<xsl:for-each select="tokenize($valueshownt/node(), '\s+')">
-			
-			<xsl:value-of select="." /><xsl:text>&#x09;</xsl:text>
-			
+
+		<xsl:for-each
+			select="tokenize($valueshownt/node(), '\s+')">
+
+			<xsl:value-of select="." />
+			<xsl:text>&#x09;</xsl:text>
+
 		</xsl:for-each>
-		
-		<xsl:for-each select="tokenize($valueshowt/node(), '\s+')">
-			
-			<xsl:value-of select="." /><xsl:text>&#x09;</xsl:text>
-			
+
+		<xsl:for-each
+			select="tokenize($valueshowt/node(), '\s+')">
+
+			<xsl:value-of select="." />
+			<xsl:text>&#x09;</xsl:text>
+
 		</xsl:for-each>
-		
+
 		<xsl:text>RightCxInsideSnt&#x09;RightCxOutsideSnt&#x0D;&#x0A;</xsl:text>
-	
-		<xsl:for-each select="descendant::variable[@name='#pivot']">
-			
+
+		<xsl:for-each
+			select="descendant::variable[@name='#pivot']">
+
 			<!-- Each #pivot node in the document is selected -->
 
 			<xsl:variable name="inpivot">
 
 				<pivot>
-					<xsl:apply-templates select="key('idkey', @idref)" mode="get-terminals" />
+					<xsl:apply-templates
+						select="key('idkey', @idref)" mode="get-terminals" />
 				</pivot>
 
 			</xsl:variable>
@@ -66,52 +79,67 @@
 
 			<xsl:variable name="firstpivotid">
 
-				<xsl:apply-templates select="exsl:node-set($inpivot-sort)//t[1]" mode="id" />
-					
+				<xsl:apply-templates
+					select="exsl:node-set($inpivot-sort)//t[1]" mode="id" />
+
 			</xsl:variable>
 
 			<xsl:variable name="lastpivotid">
 
-				<xsl:apply-templates select="exsl:node-set($inpivot-sort)//t[last()]" mode="id" />
+				<xsl:apply-templates
+					select="exsl:node-set($inpivot-sort)//t[last()]" mode="id" />
 
 			</xsl:variable>
 
 			<!-- sentence ID -->
 
-			<xsl:apply-templates select="ancestor::s" mode="id" />			
+			<xsl:apply-templates select="ancestor::s"
+				mode="id" />
 			<xsl:text>&#x09;</xsl:text>
 
 			<!-- left context -->
 
-			<xsl:apply-templates select="key('idkey', $firstpivotid)" mode="left-cx" /><xsl:text>&#x09;</xsl:text>
+			<xsl:apply-templates
+				select="key('idkey', $firstpivotid)" mode="left-cx" />
+			<xsl:text>&#x09;</xsl:text>
 
 			<!-- pivot text -->
 
-			<xsl:apply-templates select="ancestor::s" mode="pivot">
-				<xsl:with-param name="inpivot" select="exsl:node-set($inpivot-sort)" />
-			</xsl:apply-templates><xsl:text>&#x09;</xsl:text>
-			
+			<xsl:apply-templates select="ancestor::s"
+				mode="pivot">
+				<xsl:with-param name="inpivot"
+					select="exsl:node-set($inpivot-sort)" />
+			</xsl:apply-templates>
+			<xsl:text>&#x09;</xsl:text>
+
 			<!-- pivot properties -->
-			
-			<xsl:variable name="thispivot" select="key('idkey', @idref)" />
-			
-			<xsl:for-each select="tokenize($valueshownt/node(), '\s+')">
-				
-				<xsl:variable name="attr" select="."/>
-				
-				<xsl:value-of select="$thispivot/@*[name()=$attr]"/><xsl:text>&#x09;</xsl:text>
-				
+
+			<xsl:variable name="thispivot"
+				select="key('idkey', @idref)" />
+
+			<xsl:for-each
+				select="tokenize($valueshownt/node(), '\s+')">
+
+				<xsl:variable name="attr" select="." />
+
+				<xsl:value-of select="$thispivot/@*[name()=$attr]" />
+				<xsl:text>&#x09;</xsl:text>
+
 			</xsl:for-each>
-			<xsl:for-each select="tokenize($valueshowt/node(), '\s+')">
-				
-				<xsl:variable name="attr" select="."/>
-				
-				<xsl:value-of select="$thispivot/@*[name()=$attr]"/><xsl:text>&#x09;</xsl:text>
-				
+			<xsl:for-each
+				select="tokenize($valueshowt/node(), '\s+')">
+
+				<xsl:variable name="attr" select="." />
+
+				<xsl:value-of select="$thispivot/@*[name()=$attr]" />
+				<xsl:text>&#x09;</xsl:text>
+
 			</xsl:for-each>
-				
+
 			<!-- right context -->
-			<xsl:apply-templates select="key('idkey', $lastpivotid)" mode="right-cx" /><xsl:text>&#x0D;&#x0A;</xsl:text>
+			<xsl:apply-templates
+				select="key('idkey', $lastpivotid)" mode="right-cx" />
+			<xsl:text>&#x0D;&#x0A;</xsl:text>
 
 		</xsl:for-each>
 
@@ -124,107 +152,142 @@
 	</xsl:template>
 
 	<xsl:template match="t" mode="left-cx">
-		
+
 		<xsl:variable name="pivot-node" select="." />
-		<xsl:variable name="this-sid"><xsl:value-of select="ancestor::s/@id" /></xsl:variable>
-		
-		<xsl:for-each select="preceding::t[position() &lt; number($cx)]" >
+		<xsl:variable name="this-sid">
+			<xsl:value-of select="ancestor::s/@id" />
+		</xsl:variable>
+
+		<xsl:for-each
+			select="preceding::t[position() &lt; number($cx)]">
 			<!-- xsl:sort select="@id" / -->
 			<xsl:choose>
 				<!-- switch from out-of-sentence to in-sentence context -->
-				<xsl:when test="ancestor::s[@id = $this-sid] and not(preceding-sibling::t)">
+				<xsl:when
+					test="ancestor::s[@id = $this-sid] and not(preceding-sibling::t)">
 					<xsl:text>&#x09;</xsl:text>
 				</xsl:when>
-				
+
 				<!-- first word of the context and in the same sentence -->
-				
-				<xsl:when test="position() = 1 and ancestor::s[@id=$this-sid]"><xsl:text>&#x09;</xsl:text></xsl:when>
-				
+
+				<xsl:when
+					test="position() = 1 and ancestor::s[@id=$this-sid]">
+					<xsl:text>&#x09;</xsl:text>
+				</xsl:when>
+
 				<!-- first word of the context -->
-				
+
 				<xsl:when test="position() = 1" />
-				
+
 				<!-- first word in a sentence -->
-				<xsl:when test="not(preceding-sibling::t)"><xsl:text> / </xsl:text></xsl:when>
-				
-				<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
-				
+				<xsl:when test="not(preceding-sibling::t)">
+					<xsl:text> / </xsl:text>
+				</xsl:when>
+
+				<xsl:otherwise>
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
+
 			</xsl:choose>
-			
+
 			<xsl:apply-templates select="." mode="output" />
-			
+
 			<!-- add blank column if there's no in-sentence context -->
-			<xsl:if test="position() = last() and ancestor::s[@id != $this-sid]"><xsl:text>&#x09;</xsl:text></xsl:if>
-			
+			<xsl:if
+				test="position() = last() and ancestor::s[@id != $this-sid]">
+				<xsl:text>&#x09;</xsl:text>
+			</xsl:if>
+
 		</xsl:for-each>
-		
+
 	</xsl:template>
-	
+
 	<xsl:template match="t" mode="right-cx">
-		
+
 		<xsl:variable name="pivot-node" select="." />
-		<xsl:variable name="this-sid"><xsl:value-of select="ancestor::s/@id" /></xsl:variable>
-		
-		<xsl:for-each select="following::t[position() &lt; number($cx)]" >
+		<xsl:variable name="this-sid">
+			<xsl:value-of select="ancestor::s/@id" />
+		</xsl:variable>
+
+		<xsl:for-each
+			select="following::t[position() &lt; number($cx)]">
 			<!-- xsl:sort select="@id" / -->
 			<xsl:choose>
 				<!-- switch from in-sentence to out-of-sentence context -->
-				<xsl:when test="ancestor::s[@id != $this-sid] and preceding::t[position()=1]/ancestor::s[@id = $this-sid]">
+				<xsl:when
+					test="ancestor::s[@id != $this-sid] and preceding::t[position()=1]/ancestor::s[@id = $this-sid]">
 					<xsl:text>&#x09;</xsl:text>
 				</xsl:when>
-				
+
 				<!-- first word of the context -->
-				
+
 				<xsl:when test="position() = 1" />
-				
+
 				<!-- first word in a sentence -->
-				<xsl:when test="not(preceding-sibling::t)"><xsl:text> / </xsl:text></xsl:when>
-				
-				<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
-				
+				<xsl:when test="not(preceding-sibling::t)">
+					<xsl:text> / </xsl:text>
+				</xsl:when>
+
+				<xsl:otherwise>
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
+
 			</xsl:choose>
 			<xsl:apply-templates select="." mode="output" />
 			<!-- add blank column if there's no out-of-sentence context -->
-			<xsl:if test="position() = last() and ancestor::s[@id = $this-sid]"><xsl:text>&#x09;</xsl:text></xsl:if>
-			
+			<xsl:if
+				test="position() = last() and ancestor::s[@id = $this-sid]">
+				<xsl:text>&#x09;</xsl:text>
+			</xsl:if>
+
 		</xsl:for-each>
-		
+
 	</xsl:template>
 
 	<xsl:template match="s" mode="pivot">
 		<xsl:param name="inpivot" />
 
-			<xsl:variable name="firstpivotid">
+		<xsl:variable name="firstpivotid">
 
-				<xsl:apply-templates select="$inpivot//t[1]" mode="id" />
-					
-			</xsl:variable>
+			<xsl:apply-templates select="$inpivot//t[1]"
+				mode="id" />
 
-			<xsl:variable name="lastpivotid">
-				<xsl:apply-templates select="$inpivot//t[last()]" mode="id" />
+		</xsl:variable>
 
-			</xsl:variable>
+		<xsl:variable name="lastpivotid">
+			<xsl:apply-templates select="$inpivot//t[last()]"
+				mode="id" />
 
-		<xsl:for-each select="descendant::t" >
-			<xsl:variable name="thisid" select = "@id" />
+		</xsl:variable>
+
+		<xsl:for-each select="descendant::t">
+			<xsl:variable name="thisid" select="@id" />
 			<xsl:choose>
 				<xsl:when test="following-sibling::t[@id=$firstpivotid]" />
 				<xsl:when test="preceding-sibling::t[@id=$lastpivotid]" />
-				<xsl:when test="$inpivot//t[@id=$thisid]"><xsl:apply-templates select="." mode="output" /><xsl:text> </xsl:text></xsl:when>
-				<xsl:otherwise>[<xsl:apply-templates select="." mode="output" />]<xsl:text> </xsl:text></xsl:otherwise>
-			</xsl:choose>			
+				<xsl:when test="$inpivot//t[@id=$thisid]">
+					<xsl:apply-templates select="." mode="output" />
+					<xsl:text> </xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					[
+					<xsl:apply-templates select="." mode="output" />
+					]
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
 		</xsl:for-each>
 
 	</xsl:template>
 
 	<xsl:template match="t" mode="output">
-		
+
 		<xsl:value-of select="@word" />
 
 	</xsl:template>
 
 	<xsl:template match="nt|t|s" mode="id">
-		
+
 		<xsl:value-of select="@id" />
 
 	</xsl:template>
@@ -233,8 +296,9 @@
 
 		<xsl:for-each select="edge">
 
-			<xsl:apply-templates select="key('idkey', @idref)" mode="get-terminals" />
-	
+			<xsl:apply-templates
+				select="key('idkey', @idref)" mode="get-terminals" />
+
 		</xsl:for-each>
 
 	</xsl:template>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-xmlw-preserve.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-xmlw-preserve.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-xmlw-preserve.xsl	(revision 2397)
@@ -1,113 +1,103 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de préparation de fichiers TEI à l'importation
-      TXM dans un format xml simple. 
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de préparation de fichiers TEI à l'importation
+			TXM dans un format xml simple.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
 	<!-- Listes des balises par type de traitement. -->
-	
-	<!--Par défaut, les balises sont conservées (les espaces de nommage sont
-	respectés). On peut utiliser les paramètres ci-dessous pour indiquer les balises
-	à supprimer en conservant ou non leur contenu--> 
-	
+
+	<!--Par défaut, les balises sont conservées (les espaces de nommage sont 
+		respectés). On peut utiliser les paramètres ci-dessous pour indiquer les 
+		balises à supprimer en conservant ou non leur contenu -->
+
 	<!-- balises à supprimer avec leur contenu -->
-	
-	<xsl:param name="deleteAll">teiHeader|facsimile</xsl:param>
-	
-	<xsl:template match="*[matches(name(),concat('^',$deleteAll,'$'))]"/>
-	
-	<!-- balises à supprimer en conservant le contenu-->
-	
+
+	<xsl:param name="deleteAll">
+		teiHeader|facsimile
+	</xsl:param>
+
+	<xsl:template
+		match="*[matches(name(),concat('^',$deleteAll,'$'))]" />
+
+	<!-- balises à supprimer en conservant le contenu -->
+
 	<xsl:param name="deleteTag"></xsl:param>
-	
-	<xsl:template match="*[matches(name(),concat('^',$deleteTag,'$'))]">
-		<xsl:apply-templates/>
+
+	<xsl:template
+		match="*[matches(name(),concat('^',$deleteTag,'$'))]">
+		<xsl:apply-templates />
 	</xsl:template>
-	
-  
-  <xsl:template match="*">
-  	<xsl:copy>
-  		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>	
-  	</xsl:copy>
-  </xsl:template>
 
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
-	
-	<xsl:template match="processing-instruction()"/>
-	
-	<xsl:template match="text()"><xsl:value-of select="."/></xsl:template>
 
-	<!-- On supprime le teiHeader  pour l'import xml-w -->
-	
-	<xsl:template match="tei:teiHeader">    
-		<!--<xsl:copy-of select="."/>-->    
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
 	</xsl:template>
-	
-	<xsl:template match="tei:facsimile">    
-		<!--<xsl:copy-of select="."/>-->    
+
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
 	</xsl:template>
-	
 
-	<!-- ancien filtre pour les noeuds texte, n'est plus nécessaire pour l'import xml/w TXM 0.5 -->
+	<xsl:template match="processing-instruction()" />
 
-  <!--<xsl:template match="text()">
-  	<xsl:analyze-string select="." regex="&amp;lt;|&amp;gt;|&lt;|&gt;|-\-">
-      <xsl:matching-substring>
-        <xsl:choose>
-        	<xsl:when test="matches(.,'&amp;lt;')">
-        		<xsl:text>‹</xsl:text>
-        	</xsl:when>
-        	<xsl:when test="matches(.,'&amp;gt;')">
-        		<xsl:text>›</xsl:text>
-        	</xsl:when>
-          <xsl:when test="matches(.,'&lt;')">
-            <xsl:text>‹</xsl:text>
-          </xsl:when>
-          <xsl:when test="matches(.,'&gt;')">
-            <xsl:text>›</xsl:text>
-          </xsl:when>
-          <!-\- pose problème si se trouve dans les notes transformés en commentaires xml par le tokeniseur -\->
-          <xsl:when test="matches(.,'-\-')">
-            <xsl:text> - </xsl:text>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="."/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>         
-            <xsl:value-of select="."/>
-      </xsl:non-matching-substring>      
-    </xsl:analyze-string>
-  </xsl:template>-->
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
 
+	<!-- On supprime le teiHeader pour l'import xml-w -->
+
+	<xsl:template match="tei:teiHeader">
+		<!--<xsl:copy-of select="."/> -->
+	</xsl:template>
+
+	<xsl:template match="tei:facsimile">
+		<!--<xsl:copy-of select="."/> -->
+	</xsl:template>
+
+
+	<!-- ancien filtre pour les noeuds texte, n'est plus nécessaire pour l'import 
+		xml/w TXM 0.5 -->
+
+	<!--<xsl:template match="text()"> <xsl:analyze-string select="." regex="&amp;lt;|&amp;gt;|&lt;|&gt;|-\-"> 
+		<xsl:matching-substring> <xsl:choose> <xsl:when test="matches(.,'&amp;lt;')"> 
+		<xsl:text>‹</xsl:text> </xsl:when> <xsl:when test="matches(.,'&amp;gt;')"> 
+		<xsl:text>›</xsl:text> </xsl:when> <xsl:when test="matches(.,'&lt;')"> <xsl:text>‹</xsl:text> 
+		</xsl:when> <xsl:when test="matches(.,'&gt;')"> <xsl:text>›</xsl:text> </xsl:when> 
+		<!-\- pose problème si se trouve dans les notes transformés en commentaires 
+		xml par le tokeniseur -\-> <xsl:when test="matches(.,'-\-')"> <xsl:text> 
+		- </xsl:text> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> 
+		</xsl:choose> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of 
+		select="."/> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> -->
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-xmlw-simplify.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-xmlw-simplify.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-xmlw-simplify.xsl	(revision 2397)
@@ -1,231 +1,203 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de préparation de fichiers TEI P5 à l'importation 
-      dans TXM en utilisant le module d'import xml-w. Permet de supprimer
-      le contenu de teiHeader et des élements hors-texte et de supprimer
-      les balises non utilisées dans les index TXM.
-      Par défaut, toutes les balises sauf celles qui sont listées dans le
-      paramètre "copyAll" sont supprimées
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <!-- Listes des balises par type de traitement. -->
-  
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de préparation de fichiers TEI P5 à l'importation
+			dans TXM en utilisant le module d'import xml-w. Permet de supprimer
+			le contenu de teiHeader et des élements hors-texte et de supprimer
+			les balises non utilisées dans les index TXM.
+			Par défaut, toutes les balises sauf celles qui sont listées dans le
+			paramètre "copyAll" sont supprimées
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<!-- Listes des balises par type de traitement. -->
+
 	<!-- balises à supprimer avec leur contenu -->
-  
-	<xsl:param name="deleteAll">teiHeader|facsimile|note</xsl:param>
-	
-	<xsl:template match="*[matches(name(),concat('^',$deleteAll,'$'))]">
-		<xsl:call-template name="deleteAll"/>
+
+	<xsl:param name="deleteAll">
+		teiHeader|facsimile|note
+	</xsl:param>
+
+	<xsl:template
+		match="*[matches(name(),concat('^',$deleteAll,'$'))]">
+		<xsl:call-template name="deleteAll" />
 	</xsl:template>
-		
-	<!-- balises à conserver  -->
-	<xsl:param name="copyAll">ab|body|div|front|head|lb|p|pb|s|TEI|text|w</xsl:param>
-	
-	<xsl:template match="*[matches(name(),concat('^',$copyAll,'$'))]">
+
+	<!-- balises à conserver -->
+	<xsl:param name="copyAll">
+		ab|body|div|front|head|lb|p|pb|s|TEI|text|w
+	</xsl:param>
+
+	<xsl:template
+		match="*[matches(name(),concat('^',$copyAll,'$'))]">
 		<xsl:call-template name="copyAll"></xsl:call-template>
 	</xsl:template>
-	
-	<!-- balises à supprimer, contenu à conserver, c'est la règle par défaut -->  
+
+	<!-- balises à supprimer, contenu à conserver, c'est la règle par défaut -->
 	<xsl:template match="*">
-		<xsl:call-template name="deleteTag"/>
+		<xsl:call-template name="deleteTag" />
 	</xsl:template>
-  
-  <!-- balises à transformer en notes-->
-  <!--<xsl:template match="">
-    <xsl:call-template name="makeNote"/>
-  </xsl:template>-->
-  
 
-  <!-- balises à transformer en W -->
-  
-<!--  <xsl:template match="tei:abbr[not(parent::tei:choice)]
-    |tei:expan
-    |tei:num[matches(.,'.')]">
-    <xsl:call-template name="makeWord"/>
-  </xsl:template>-->
-  
-  <!-- à transformer en AB typé -->
-  
-<!--  <xsl:template match="">
-    <xsl:call-template name="makeAb"/>
-  </xsl:template>
--->  
-  <!-- à transformer en DIV typé -->
-  
-<!--  <xsl:template match="">
-    <xsl:call-template name="makeDiv"/>
-  </xsl:template>
--->
-<!-- Partie générale : on copie les éléments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
+	<!-- balises à transformer en notes -->
+	<!--<xsl:template match=""> <xsl:call-template name="makeNote"/> </xsl:template> -->
 
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
 
-<xsl:template match="processing-instruction()"/>
+	<!-- balises à transformer en W -->
 
-<xsl:template match="text()"><xsl:value-of select="."/></xsl:template>
+	<!-- <xsl:template match="tei:abbr[not(parent::tei:choice)] |tei:expan |tei:num[matches(.,'.')]"> 
+		<xsl:call-template name="makeWord"/> </xsl:template> -->
 
-	<!-- ancien filtre pour les noeuds texte, n'est plus nécessaire pour l'import xml/w TXM 0.5 -->
-	
-	<!--<xsl:template match="text()">
-  	<xsl:analyze-string select="." regex="&amp;lt;|&amp;gt;|&lt;|&gt;|-\-">
-      <xsl:matching-substring>
-        <xsl:choose>
-        	<xsl:when test="matches(.,'&amp;lt;')">
-        		<xsl:text>‹</xsl:text>
-        	</xsl:when>
-        	<xsl:when test="matches(.,'&amp;gt;')">
-        		<xsl:text>›</xsl:text>
-        	</xsl:when>
-          <xsl:when test="matches(.,'&lt;')">
-            <xsl:text>‹</xsl:text>
-          </xsl:when>
-          <xsl:when test="matches(.,'&gt;')">
-            <xsl:text>›</xsl:text>
-          </xsl:when>
-          <!-\- pose problème si se trouve dans les notes transformés en commentaires xml par le tokeniseur -\->
-          <xsl:when test="matches(.,'-\-')">
-            <xsl:text> - </xsl:text>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="."/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>         
-            <xsl:value-of select="."/>
-      </xsl:non-matching-substring>      
-    </xsl:analyze-string>
-  </xsl:template>-->
-	
+	<!-- à transformer en AB typé -->
 
-<!-- On garde les balises utiles pour l'exploitation TXM -->
-  
-  <xsl:template name="copyAll">    
-  	<xsl:copy>
-  		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>	
-  	</xsl:copy>
-  </xsl:template>
-  
+	<!-- <xsl:template match=""> <xsl:call-template name="makeAb"/> </xsl:template> -->
+	<!-- à transformer en DIV typé -->
 
-<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments hors texte à ignorer lors de l'import -->
-  
-  <xsl:template name="deleteAll"/>
+	<!-- <xsl:template match=""> <xsl:call-template name="makeDiv"/> </xsl:template> -->
+	<!-- Partie générale : on copie les éléments, les attributs, le texte, les 
+		commentaires, on supprime mes prrocessing intstructions -->
 
-<!-- On supprime les balises non essentielles pour l'exploitation textométrique et susceptibles de poser des problèmes au tokeniseur,
-  mais on garde leur contenu qui fait partie du matériau textuel -->
-  
-  <xsl:template name="deleteTag">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
+	</xsl:template>
 
-<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, etc. -->
-  
-  <xsl:template name="makeNote">
-    <note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:value-of select="."/>
-    </note>
-  </xsl:template>
-  
-<!-- On supprime toutes les balises à l'intérieur des notes-->
-<!--  <xsl:template match="tei:note">
-    <xsl:copy>
-      <xsl:value-of select="."></xsl:value-of>
-    </xsl:copy>
-  </xsl:template>
--->
-  
-<!-- On transforme en DIV typés les balises de niveau de division textuelle (pouvant contenir des p) -->
+	<xsl:template match="processing-instruction()" />
 
-  <xsl:template name="makeDiv">
-    <div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>  
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
 
-<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
+	<!-- ancien filtre pour les noeuds texte, n'est plus nécessaire pour l'import 
+		xml/w TXM 0.5 -->
 
-  <xsl:template name="makeAb">
-    <ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates/>
-    </ab>
-  </xsl:template>
+	<!--<xsl:template match="text()"> <xsl:analyze-string select="." regex="&amp;lt;|&amp;gt;|&lt;|&gt;|-\-"> 
+		<xsl:matching-substring> <xsl:choose> <xsl:when test="matches(.,'&amp;lt;')"> 
+		<xsl:text>‹</xsl:text> </xsl:when> <xsl:when test="matches(.,'&amp;gt;')"> 
+		<xsl:text>›</xsl:text> </xsl:when> <xsl:when test="matches(.,'&lt;')"> <xsl:text>‹</xsl:text> 
+		</xsl:when> <xsl:when test="matches(.,'&gt;')"> <xsl:text>›</xsl:text> </xsl:when> 
+		<!-\- pose problème si se trouve dans les notes transformés en commentaires 
+		xml par le tokeniseur -\-> <xsl:when test="matches(.,'-\-')"> <xsl:text> 
+		- </xsl:text> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> 
+		</xsl:choose> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of 
+		select="."/> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> -->
 
-  <!-- on pré-tokenise les éléments équivalents à un mot -->
-  
-  <xsl:template name="makeWord">
-    <xsl:variable name="wordType">
-      <xsl:choose>
-        <xsl:when test="@type">
-          <xsl:value-of select="concat(local-name(),'-',@type)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name()"></xsl:value-of>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></w>
-  </xsl:template>  
 
-<!--<xsl:template name="makeName">
-  <xsl:variable name="nameType">
-    <xsl:choose>
-      <xsl:when test="@type">
-        <xsl:choose>
-          <xsl:when test="local-name()='name'"><xsl:value-of select='@type'/></xsl:when>
-          <xsl:otherwise><xsl:value-of select="concat(local-name(),'-',@type)"/></xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="local-name()"></xsl:value-of>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  <name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0">
-    <xsl:apply-templates/>
-  </name>
-</xsl:template>
--->
-<!-- les l sont transformés en lb -->
-  
-  <xsl:template match="tei:l">
-    <lb xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:if test="@n">
-        <xsl:attribute name="n"><xsl:value-of select="@n"/></xsl:attribute>
-      </xsl:if>
-    </lb>
-    <xsl:apply-templates/>
-  </xsl:template>
-  
+	<!-- On garde les balises utiles pour l'exploitation TXM -->
 
+	<xsl:template name="copyAll">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+
+	<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments 
+		hors texte à ignorer lors de l'import -->
+
+	<xsl:template name="deleteAll" />
+
+	<!-- On supprime les balises non essentielles pour l'exploitation textométrique 
+		et susceptibles de poser des problèmes au tokeniseur, mais on garde leur 
+		contenu qui fait partie du matériau textuel -->
+
+	<xsl:template name="deleteTag">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, 
+		etc. -->
+
+	<xsl:template name="makeNote">
+		<note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:value-of select="." />
+		</note>
+	</xsl:template>
+
+	<!-- On supprime toutes les balises à l'intérieur des notes -->
+	<!-- <xsl:template match="tei:note"> <xsl:copy> <xsl:value-of select="."></xsl:value-of> 
+		</xsl:copy> </xsl:template> -->
+
+	<!-- On transforme en DIV typés les balises de niveau de division textuelle 
+		(pouvant contenir des p) -->
+
+	<xsl:template name="makeDiv">
+		<div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+
+	<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
+
+	<xsl:template name="makeAb">
+		<ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</ab>
+	</xsl:template>
+
+	<!-- on pré-tokenise les éléments équivalents à un mot -->
+
+	<xsl:template name="makeWord">
+		<xsl:variable name="wordType">
+			<xsl:choose>
+				<xsl:when test="@type">
+					<xsl:value-of select="concat(local-name(),'-',@type)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()"></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates />
+		</w>
+	</xsl:template>
+
+	<!--<xsl:template name="makeName"> <xsl:variable name="nameType"> <xsl:choose> 
+		<xsl:when test="@type"> <xsl:choose> <xsl:when test="local-name()='name'"><xsl:value-of 
+		select='@type'/></xsl:when> <xsl:otherwise><xsl:value-of select="concat(local-name(),'-',@type)"/></xsl:otherwise> 
+		</xsl:choose> </xsl:when> <xsl:otherwise> <xsl:value-of select="local-name()"></xsl:value-of> 
+		</xsl:otherwise> </xsl:choose> </xsl:variable> <name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:apply-templates/> </name> </xsl:template> -->
+	<!-- les l sont transformés en lb -->
+
+	<xsl:template match="tei:l">
+		<lb xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:if test="@n">
+				<xsl:attribute name="n"><xsl:value-of
+					select="@n" /></xsl:attribute>
+			</xsl:if>
+		</lb>
+		<xsl:apply-templates />
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-structure2wordAtt.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-structure2wordAtt.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-structure2wordAtt.xsl	(revision 2397)
@@ -1,68 +1,75 @@
 <?xml version="1.0"?>
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet projects the number of nesting selected ancestor 
-      elements to attributes of the w element.
-      Designed for 3-posttok step of the XTZ + CSV TXM import module.
-      Enter element names separated by | as the value of 
-      elementsToProject parameter.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2018, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
-  </xd:doc>
-  
-  <!-- List elements to count and project here -->
-  <xsl:param name="elementsToProject">q|quote</xsl:param>
-  
-  <!-- Whenever you match any node or any attribute -->
-  <xsl:template match="node()|@*">
-    <!-- Copy the current node -->
-    <xsl:copy>
-      <!-- Including any attributes it has and any child nodes -->
-      <xsl:apply-templates select="@*|node()"/>
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="*:w">
-    <xsl:variable name="ancestors">
-      <ancestors>
-        <xsl:for-each select="ancestor::*">
-          <xsl:copy/>
-        </xsl:for-each>
-      </ancestors>
-    </xsl:variable>
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:for-each select="tokenize($elementsToProject,'\|')">
-        <xsl:variable name="elementName"><xsl:value-of select="."/></xsl:variable>
-        <xsl:attribute name="{$elementName}">
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc">
+
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet projects the number of nesting selected ancestor
+			elements to attributes of the w element.
+			Designed for 3-posttok step of the XTZ + CSV TXM import module.
+			Enter element names separated by | as the value of
+			elementsToProject parameter.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2018, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
+	</xd:doc>
+
+	<!-- List elements to count and project here -->
+	<xsl:param name="elementsToProject">
+		q|quote
+	</xsl:param>
+
+	<!-- Whenever you match any node or any attribute -->
+	<xsl:template match="node()|@*">
+		<!-- Copy the current node -->
+		<xsl:copy>
+			<!-- Including any attributes it has and any child nodes -->
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="*:w">
+		<xsl:variable name="ancestors">
+			<ancestors>
+				<xsl:for-each select="ancestor::*">
+					<xsl:copy />
+				</xsl:for-each>
+			</ancestors>
+		</xsl:variable>
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:for-each select="tokenize($elementsToProject,'\|')">
+				<xsl:variable name="elementName">
+					<xsl:value-of select="." />
+				</xsl:variable>
+				<xsl:attribute name="{$elementName}">
           <xsl:choose>
-            <xsl:when test="$ancestors//*[local-name(.)=$elementName]">
-              <xsl:number value="count($ancestors//*[local-name()=$elementName])"></xsl:number>
+            <xsl:when
+					test="$ancestors//*[local-name(.)=$elementName]">
+              <xsl:number
+					value="count($ancestors//*[local-name()=$elementName])"></xsl:number>
             </xsl:when>
             <xsl:otherwise>0</xsl:otherwise>
           </xsl:choose>
         </xsl:attribute>
-      </xsl:for-each>
-      <xsl:apply-templates/>
-    </xsl:copy>
-  </xsl:template>
-  
+			</xsl:for-each>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-rename-files-no-dots.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-rename-files-no-dots.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-rename-files-no-dots.xsl	(revision 2397)
@@ -1,55 +1,64 @@
 <!-- The Identity Transformation -->
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc">
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc">
 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet is designed for TXM XTZ+CSV import module to replace
-      dots with underscores in source file names. (A bug in TXM 0.7.8 prevents
-      files containing dots in their names from being imported). This stylesheet
-      should be used at "1-split-merge" step. See TXM User Manual for more
-      details (http://textometrie.ens-lyon.fr/spip.php?rubrique64)
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
-  </xd:doc>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet is designed for TXM XTZ+CSV import module to replace
+			dots with underscores in source file names. (A bug in TXM 0.7.8 prevents
+			files containing dots in their names from being imported). This
+			stylesheet
+			should be used at "1-split-merge" step. See TXM User Manual for more
+			details (http://textometrie.ens-lyon.fr/spip.php?rubrique64)
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-<xsl:param name="output-directory">
-  <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/.]+$">
-    <xsl:matching-substring>
-      <xsl:value-of select="regex-group(1)"/>
-    </xsl:matching-substring>
-  </xsl:analyze-string>
-</xsl:param>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
-  <xsl:variable name="filename">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/.]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
+	</xd:doc>
 
-<xsl:template match="/">
-  <xsl:result-document href="{$output-directory}/{replace($filename,'\.','_')}.xml">
-    <xsl:copy-of select="."></xsl:copy-of>
-  </xsl:result-document>
-  <warning>Result file written to <xsl:value-of select="concat($output-directory,'/',replace($filename,'\.','_'),'.xml')"/></warning>
-</xsl:template>
+	<xsl:param name="output-directory">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/.]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(1)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:param>
 
+	<xsl:variable name="filename">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/.]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
 
+	<xsl:template match="/">
+		<xsl:result-document
+			href="{$output-directory}/{replace($filename,'\.','_')}.xml">
+			<xsl:copy-of select="."></xsl:copy-of>
+		</xsl:result-document>
+		<warning>
+			Result file written to
+			<xsl:value-of
+				select="concat($output-directory,'/',replace($filename,'\.','_'),'.xml')" />
+		</warning>
+	</xsl:template>
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_mots_effaces.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_mots_effaces.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_mots_effaces.xsl	(revision 2397)
@@ -1,93 +1,103 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Cette feuille de style permet de préparer les transcriptions de tablettes
-      d'argile (projet UMR PROCLAC) à l'import XML/W + CSV de TXM en créant les
-      propriétés de mots "no-unclear" et "non-supplied" pour éliminer les formes
-      non présentes ou peu lisibles dans les sources.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev, alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2014-2015, CNRS / ICAR (équipe CACTUS)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Cette feuille de style permet de préparer les transcriptions de tablettes
+			d'argile (projet UMR PROCLAC) à l'import XML/W + CSV de TXM en créant
+			les
+			propriétés de mots "no-unclear" et "non-supplied" pour éliminer les formes
+			non présentes ou peu lisibles dans les sources.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-  <xsl:template match="@*|*">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()" />
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="@*|*" mode="nosupplied">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()" />
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="@*|*" mode="nounclear">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()" />
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="*[local-name()='teiHeader']"/>
-  
-  <xsl:template match="text()" mode="#all">
-    <xsl:choose>
-      <xsl:when test="ancestor::*[local-name()='w']">
-        <xsl:value-of select="."/>
-      </xsl:when>
-      <xsl:otherwise/>
-    </xsl:choose>
-  </xsl:template>
-  
-  <!-- On supprime les mots qui sont illisibles dans la source et on ajoute une propriété lexicale
-  qui correspond à la lisibilité -->
-  
-  <xsl:template match="//*[local-name()='w']">
-        <xsl:copy>
-          <xsl:apply-templates select="@*"/>
-          <xsl:attribute name="no-supplied">
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev, alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2014-2015, CNRS / ICAR (équipe CACTUS)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="yes" />
+
+	<xsl:template match="@*|*">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="@*|*" mode="nosupplied">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="@*|*" mode="nounclear">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="*[local-name()='teiHeader']" />
+
+	<xsl:template match="text()" mode="#all">
+		<xsl:choose>
+			<xsl:when test="ancestor::*[local-name()='w']">
+				<xsl:value-of select="." />
+			</xsl:when>
+			<xsl:otherwise />
+		</xsl:choose>
+	</xsl:template>
+
+	<!-- On supprime les mots qui sont illisibles dans la source et on ajoute 
+		une propriété lexicale qui correspond à la lisibilité -->
+
+	<xsl:template match="//*[local-name()='w']">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="no-supplied">
             <xsl:choose>
-              <xsl:when test="ancestor::*[local-name()='supplied']">¤</xsl:when>
-              <xsl:otherwise><xsl:apply-templates mode="nosupplied"/></xsl:otherwise>
+              <xsl:when
+				test="ancestor::*[local-name()='supplied']">¤</xsl:when>
+              <xsl:otherwise><xsl:apply-templates
+				mode="nosupplied" /></xsl:otherwise>
             </xsl:choose>
           </xsl:attribute>
-          <xsl:attribute name="no-unclear">
+			<xsl:attribute name="no-unclear">
             <xsl:choose>
-              <xsl:when test="ancestor::*[local-name()='supplied'] or ancestor::*[local-name()='unclear']">¤</xsl:when>
-              <xsl:otherwise><xsl:apply-templates mode="nounclear"/></xsl:otherwise>
+              <xsl:when
+				test="ancestor::*[local-name()='supplied'] or ancestor::*[local-name()='unclear']">¤</xsl:when>
+              <xsl:otherwise><xsl:apply-templates
+				mode="nounclear" /></xsl:otherwise>
             </xsl:choose>
           </xsl:attribute>
-          <xsl:apply-templates/>
-        </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="*[local-name()='supplied']" mode="nosupplied"/>
-  
-  <xsl:template match="*[local-name()='supplied']" mode="nounclear"/>
-  
-  <xsl:template match="*[local-name()='unclear']" mode="nounclear"/>
-	
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="*[local-name()='supplied']"
+		mode="nosupplied" />
+
+	<xsl:template match="*[local-name()='supplied']"
+		mode="nounclear" />
+
+	<xsl:template match="*[local-name()='unclear']"
+		mode="nounclear" />
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/breakByMilestone.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/breakByMilestone.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/breakByMilestone.xsl	(revision 2397)
@@ -1,75 +1,83 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
 
-    <!-- Based on a stylesheet for creating separate XML-TEI files for
-        each page by Paul Caton (posted on TEI-L 2008-12-11)-->
+	<!-- Based on a stylesheet for creating separate XML-TEI files for each 
+		page by Paul Caton (posted on TEI-L 2008-12-11) -->
 
-    <xsl:output method="xml" encoding="UTF-8"/>
+	<xsl:output method="xml" encoding="UTF-8" />
 
-    <xsl:param name="pbval1">7</xsl:param>
-    <xsl:param name="pbval2">8</xsl:param>
+	<xsl:param name="pbval1">
+		7
+	</xsl:param>
+	<xsl:param name="pbval2">
+		8
+	</xsl:param>
 
-    <xsl:function name="tei:page-content" as="node()*">
-        <xsl:param name="pb1" as="node()"/>
-        <xsl:param name="pb2" as="node()"/>
-        <xsl:param name="node" as="node()"/>
-        <xsl:choose>
-            <xsl:when test="$node[self::*]">
-                <!-- $node is an element() -->
-                <xsl:choose>
-                    <!--                    <xsl:when test="$node is $pb1">
-                        <xsl:copy-of select="$node"/>
-                    </xsl:when>
--->
-                    <xsl:when
-                        test="some $n in $node/descendant::* satisfies ($n is $pb1 or $n is $pb2)">
-                        <xsl:element name="{name($node)}" namespace="http://www.tei-c.org/ns/1.0">
-                            <!--<xsl:attribute name="testttt">http://www.menota.org/ns/1.0</xsl:attribute>-->
-                            <xsl:sequence select="for $i in ( $node/node() | $node/@* ) return tei:page-content($pb1, $pb2, $i)"/>
-                        </xsl:element>
-                    </xsl:when>
-                    <xsl:when test="($node >> $pb1) and ($node &lt;&lt; $pb2)">
-                        <xsl:copy-of select="$node"/>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <!-- do nothing -->
-                    </xsl:otherwise>
-                </xsl:choose>
-            </xsl:when>
-            <xsl:when test="$node[count(. | ../@*) = count(../@*)]">
-                <!-- $node is an attribute -->
-                <xsl:attribute name="{name($node)}">
-                    <xsl:sequence select="data($node)"/>
+	<xsl:function name="tei:page-content" as="node()*">
+		<xsl:param name="pb1" as="node()" />
+		<xsl:param name="pb2" as="node()" />
+		<xsl:param name="node" as="node()" />
+		<xsl:choose>
+			<xsl:when test="$node[self::*]">
+				<!-- $node is an element() -->
+				<xsl:choose>
+					<!-- <xsl:when test="$node is $pb1"> <xsl:copy-of select="$node"/> </xsl:when> -->
+					<xsl:when
+						test="some $n in $node/descendant::* satisfies ($n is $pb1 or $n is $pb2)">
+						<xsl:element name="{name($node)}"
+							namespace="http://www.tei-c.org/ns/1.0">
+							<!--<xsl:attribute name="testttt">http://www.menota.org/ns/1.0</xsl:attribute> -->
+							<xsl:sequence
+								select="for $i in ( $node/node() | $node/@* ) return tei:page-content($pb1, $pb2, $i)" />
+						</xsl:element>
+					</xsl:when>
+					<xsl:when test="($node >> $pb1) and ($node &lt;&lt; $pb2)">
+						<xsl:copy-of select="$node" />
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- do nothing -->
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="$node[count(. | ../@*) = count(../@*)]">
+				<!-- $node is an attribute -->
+				<xsl:attribute name="{name($node)}">
+                    <xsl:sequence select="data($node)" />
                 </xsl:attribute>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:choose>
-                    <xsl:when test="($node >> $pb1) and ($node &lt;&lt; $pb2)">
-                        <xsl:copy-of select="$node"/>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <!-- do nothing -->
-                    </xsl:otherwise>
-                </xsl:choose>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="($node >> $pb1) and ($node &lt;&lt; $pb2)">
+						<xsl:copy-of select="$node" />
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- do nothing -->
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
 
-    <xsl:template match="*|text()|@*">
-        <xsl:copy>
-            <xsl:apply-templates select="@*"/>
-            <xsl:apply-templates/>
-        </xsl:copy>
-    </xsl:template>
+	<xsl:template match="*|text()|@*">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
 
-    <xsl:template match="processing-instruction()">
-        <xsl:copy>
-            <xsl:value-of select="."/>
-        </xsl:copy>
-    </xsl:template>
+	<xsl:template match="processing-instruction()">
+		<xsl:copy>
+			<xsl:value-of select="." />
+		</xsl:copy>
+	</xsl:template>
 
-    <xsl:template match="body">
-        <!-- <xsl:variable name="containingNode" select="//text"/> -->
-        <xsl:sequence select="tei:page-content(//pb[@id=$pbval1], //pb[@id=$pbval2], //body)"/>
-    </xsl:template>
+	<xsl:template match="body">
+		<!-- <xsl:variable name="containingNode" select="//text"/> -->
+		<xsl:sequence
+			select="tei:page-content(//pb[@id=$pbval1], //pb[@id=$pbval2], //body)" />
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibvh-xmlw-posttok.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibvh-xmlw-posttok.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibvh-xmlw-posttok.xsl	(revision 2397)
@@ -1,369 +1,570 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:txm="http://textometrie.org/1.0"
-  exclude-result-prefixes="tei edate txm" xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/1.0"
+	exclude-result-prefixes="tei edate txm"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> 
-  
-  
-<!-- Partie générale : on copie les éléments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
-  
-  <xsl:template match="*">      
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>    
-  </xsl:template>
-  
-  <xsl:template match="*" mode="position"><xsl:value-of select="count(preceding-sibling::*)"/></xsl:template>
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
 
 
-  <xsl:template match="@*|comment()|processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
+	<!-- Partie générale : on copie les éléments, les attributs, le texte, les 
+		commentaires, on supprime mes prrocessing intstructions -->
 
-  <xsl:template match="text()">
-    <xsl:value-of select="."/>
-  </xsl:template>
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="teiHeader"/>
-  
-  <xsl:template match="text">
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:if test="not(child::*[1][self::pb])"><pb xmlns="http://www.tei-c.org/ns/1.0" n="title"/></xsl:if>
-      <xsl:apply-templates/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="*" mode="position">
+		<xsl:value-of select="count(preceding-sibling::*)" />
+	</xsl:template>
 
-  <xsl:template match="choice[not(@txm:wordPart)]">
-    <xsl:choose>
-      <xsl:when test="child::corr">
-        <corr xmlns="http://www.tei-c.org/ns/1.0">
-          <xsl:attribute name="sic"><xsl:value-of select="normalize-space(child::sic)"/></xsl:attribute>
-          <xsl:apply-templates select="child::corr/w"/>
-        	<xsl:if test="child::sic//lb and not(child::corr//lb)"><xsl:copy-of select="child::sic//lb"/></xsl:if>
-        </corr>
-      </xsl:when>
-      <xsl:when test="child::reg">
-        <reg xmlns="http://www.tei-c.org/ns/1.0">
-          <xsl:attribute name="orig"><xsl:value-of select="normalize-space(child::orig)"/></xsl:attribute>
-          <xsl:apply-templates select="child::reg/w"/>
-        	<xsl:if test="child::orig//lb  and not(child::reg//lb)"><xsl:copy-of select="child::orig//lb"/></xsl:if>
-        </reg>
-      </xsl:when>
-      <xsl:when test="child::expan">
-        <expan xmlns="http://www.tei-c.org/ns/1.0">
-          <xsl:attribute name="abbr"><xsl:value-of select="normalize-space(child::abbr)"/></xsl:attribute>
-          <xsl:apply-templates select="child::expan/w"/>
-        </expan>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="w">
-    <xsl:variable name="nextLb">
-      <xsl:choose>
-      	<xsl:when test="following::lb">
-      		<xsl:apply-templates select="following::lb[1]" mode="position"/>
-      	</xsl:when>      	
-<!--        <xsl:when test="following::lb[@rend='hyphen']">
-          <xsl:apply-templates select="following::lb[@rend='hyphen'][1]" mode="position"/>
-        </xsl:when>-->
-        <xsl:otherwise>99999999</xsl:otherwise>
-      </xsl:choose>      
-    </xsl:variable>
-    <xsl:variable name="nextW1">
-      <xsl:choose>
-        <xsl:when test="following-sibling::w[1]">
-          <xsl:apply-templates select="following::w[1]" mode="position"/>
-        </xsl:when>
-        <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>    
-    <xsl:variable name="nextW2">
-      <xsl:choose>
-        <xsl:when test="following::w[2]">
-          <xsl:apply-templates select="following::w[2]" mode="position"/>
-        </xsl:when>
-        <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="ref">
-      <xsl:choose>
-        <xsl:when test="preceding::pb[1][@n]">
-          <xsl:value-of select="concat(ancestor::text/@id,', p. ',preceding::pb[1]/@n)"/>
-        </xsl:when>
-        <xsl:when test="preceding::pb[1][@facs]">
-          <xsl:value-of select="concat(ancestor::text/@id,', p. ',substring-before(preceding::pb[1]/@facs,'.'))"/>
-        </xsl:when>
-        <xsl:otherwise><xsl:value-of select="ancestor::text/@id"/></xsl:otherwise>
-      </xsl:choose>
-      
-    </xsl:variable>
-    <xsl:variable name="lang">
-      <xsl:choose>
-        <xsl:when test="ancestor::*[@lang]"><xsl:value-of select="ancestor::*[@lang][1]/@lang"/></xsl:when>
-        <xsl:when test="ancestor::*[@xml:lang]"><xsl:value-of select="ancestor::*[@xml:lang][1]/@xml:lang"/></xsl:when>
-        <xsl:otherwise>frm</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="nametype">
-      <xsl:choose>
-        <xsl:when test="ancestor::name">
-          <xsl:choose>
-            <xsl:when test="ancestor::name[1][@type]"><xsl:value-of select="ancestor::name[1]/@type"/></xsl:when>
-            <xsl:otherwise>name</xsl:otherwise>
-          </xsl:choose>
-        </xsl:when>
-        <xsl:otherwise>NA</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="lb">
-      <xsl:choose>
-        <xsl:when test="preceding-sibling::*[1][self::lb]">avant</xsl:when>
-        <xsl:when test="following-sibling::*[1][self::lb or self::pb]">après</xsl:when>
-        <xsl:otherwise>non</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="sic">
-      <xsl:choose>
-        <xsl:when test="parent::corr[parent::choice]">
-          <xsl:value-of select="ancestor::choice/sic/w[position()]"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="."></xsl:value-of>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="orig">
-      <xsl:choose>
-        <xsl:when test="parent::reg[parent::choice]">
-          <xsl:value-of select="ancestor::choice/orig/w[position()]"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="."></xsl:value-of>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="abbr">
-      <xsl:choose>
-        <xsl:when test="parent::expan[parent::choice]">
-          <xsl:value-of select="ancestor::choice/abbr/w[position()]"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="."></xsl:value-of>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="matches(.,'^\s*[\-=]\s*$') and ($nextW1 &gt; $nextLb)">
-        <xsl:comment>trait d'union effacé</xsl:comment>
-      </xsl:when>      
-      <xsl:when test="matches(.,'[\-=]\s*$') and ($nextW1 &gt; $nextLb)">
-        <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}">
-          <xsl:apply-templates select="@*"/>
-          <xsl:attribute name="lb">milieu-marqué</xsl:attribute>
-          <xsl:analyze-string select="normalize-space(.)" regex="^(.+)(.)$">
-            <xsl:matching-substring><xsl:value-of select="regex-group(1)"/><lb rend="hyphen({regex-group(2)})"/></xsl:matching-substring>
-          </xsl:analyze-string>
-          <xsl:value-of select="normalize-space(following::w[1])"/>
-        </w>        
-      </xsl:when>
-      <xsl:when test="following::w[1][matches(.,'^\s*[\-=]\s*$')] and ($nextW2 &gt; $nextLb)">
-        <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}">
-          <xsl:apply-templates select="@*"/>
-          <xsl:attribute name="lb">milieu-marqué2</xsl:attribute>
-          <xsl:value-of select="normalize-space(.)"/><lb rend="hyphen({normalize-space(following::w[1])})"/><xsl:value-of select="normalize-space(following::w[2])"/>
-        </w>
-      </xsl:when>
-      <xsl:when test="not(matches(.,'-\s*$')) and following-sibling::*[1][self::lb[@rend='hyphen']]">
-        <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}">
-          <xsl:apply-templates select="@*"/>
-          <xsl:attribute name="lb">milieu-non-marqué</xsl:attribute>
-          <xsl:value-of select="normalize-space(.)"/><lb rend="noHyphen"/><xsl:value-of select="normalize-space(following::w[1])"/>
-        </w>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::*[1][self::lb[@rend='hyphen']]">
-        <xsl:comment>fin de mot coupé : <xsl:value-of select="."/></xsl:comment>
-      </xsl:when>
-    	<xsl:when test="preceding-sibling::*[1][self::lb] and preceding-sibling::*[2][self::w[matches(.,'\w[\-=]\s*$')]]">
-    		<xsl:comment>fin de mot coupé (lb non marqué !) : <xsl:value-of select="."/></xsl:comment>
-    	</xsl:when>    	
-      <xsl:when test="preceding-sibling::*[1][matches(@txm:wordPart,'^(end|middle)$')]">
-        <xsl:comment>fin de mot coupé par une balise : <xsl:value-of select="normalize-space(.)"/></xsl:comment>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::*[1][@txm:wordPart='start']">
-        <xsl:choose>
-          <xsl:when test="preceding-sibling::*[1][self::choice][child::reg]">
-            <reg>
-              <xsl:apply-templates select="preceding-sibling::choice[1]/reg/@*"/>
-              <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" sic="{$sic}" abbr="{$abbr}" lb="{$lb}">
-                <xsl:attribute name="orig"><xsl:value-of select="concat(preceding-sibling::choice[1]/orig[1]/w[1],.)"/></xsl:attribute>
-                <xsl:apply-templates select="@*"/>
-                <xsl:value-of select="preceding-sibling::choice[1]/reg/w"/><xsl:apply-templates/>
-              </w>
-            </reg>
-          </xsl:when>
-          <xsl:when test="preceding-sibling::*[1][self::choice][child::corr]">
-            <corr>
-              <xsl:apply-templates select="preceding-sibling::choice[1]/corr/@*"/>
-              <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}">
-                <xsl:attribute name="sic"><xsl:value-of select="concat(preceding-sibling::choice[1]/sic[1]/w[1],.)"/></xsl:attribute>
-                <xsl:apply-templates select="@*"/>
-                <xsl:value-of select="preceding-sibling::choice[1]/reg/w"/><xsl:apply-templates/>
-              </w>
-            </corr>
-          </xsl:when>
-          <xsl:when test="preceding-sibling::*[1][self::supplied]">
-            <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}">
-              <xsl:attribute name="sic"><xsl:value-of select="."/></xsl:attribute>
-              <xsl:apply-templates select="@*"/>
-              <supplied xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="preceding-sibling::supplied[1]/w"/></supplied><xsl:apply-templates/>
-            </w>
-          </xsl:when>
-          <xsl:when test="preceding-sibling::*[1][self::subst][child::add]">
-            <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}" del="{normalize-space(preceding-sibling::subst[1]/del)}">
-                <xsl:attribute name="del"><xsl:value-of select="concat('(',preceding-sibling::subst[1]/del[1]/w[1],')',.)"/></xsl:attribute>
-                <xsl:apply-templates select="@*"/>
-                <xsl:element name="add" namespace="http://www.tei-c.org/ns/1.0">
-<!--                  <xsl:attribute name="rend">inWord</xsl:attribute>-->
-                  <xsl:attribute name="del"><xsl:value-of select="normalize-space(preceding-sibling::subst[1]/del)"/></xsl:attribute>
-                  <xsl:apply-templates select="preceding-sibling::subst[1]/add/@*"/>
-                  <xsl:value-of select="preceding-sibling::subst[1]/add/w"/>
-                </xsl:element><xsl:apply-templates/>
-              </w>
-          </xsl:when>
-          <xsl:otherwise>
-            <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}">
-              <xsl:apply-templates select="@*"/>
-              <xsl:element name="{local-name(preceding-sibling::*[1])}" namespace="http://www.tei-c.org/ns/1.0">
-                <xsl:value-of select="preceding-sibling::*[1]//w"/>
-              </xsl:element>
-              <xsl:apply-templates/>
-            </w>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="following-sibling::*[1][matches(@txm:wordPart,'^(end|middle)$')]">
-        <xsl:variable name="wordPartPosition">
-          <xsl:value-of select="following-sibling::*[1]/@txm:wordPart"/>
-        </xsl:variable>
-        <xsl:choose>
-          <xsl:when test="following-sibling::*[1][self::choice][child::reg]">
-            <reg>
-              <xsl:apply-templates select="following-sibling::choice[1]/reg/@*"/>
-              <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" sic="{$sic}" abbr="{$abbr}" lb="{$lb}">
-                <xsl:attribute name="orig"><xsl:value-of select="concat(.,following-sibling::choice[1]/orig[1]/w[1])"/>
-                  <xsl:if test="$wordPartPosition='middle'"><xsl:value-of select="following-sibling::w[1]"/></xsl:if>
+
+	<xsl:template
+		match="@*|comment()|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template match="teiHeader" />
+
+	<xsl:template match="text">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:if test="not(child::*[1][self::pb])">
+				<pb xmlns="http://www.tei-c.org/ns/1.0" n="title" />
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="choice[not(@txm:wordPart)]">
+		<xsl:choose>
+			<xsl:when test="child::corr">
+				<corr xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:attribute name="sic"><xsl:value-of
+						select="normalize-space(child::sic)" /></xsl:attribute>
+					<xsl:apply-templates select="child::corr/w" />
+					<xsl:if test="child::sic//lb and not(child::corr//lb)">
+						<xsl:copy-of select="child::sic//lb" />
+					</xsl:if>
+				</corr>
+			</xsl:when>
+			<xsl:when test="child::reg">
+				<reg xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:attribute name="orig"><xsl:value-of
+						select="normalize-space(child::orig)" /></xsl:attribute>
+					<xsl:apply-templates select="child::reg/w" />
+					<xsl:if test="child::orig//lb  and not(child::reg//lb)">
+						<xsl:copy-of select="child::orig//lb" />
+					</xsl:if>
+				</reg>
+			</xsl:when>
+			<xsl:when test="child::expan">
+				<expan xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:attribute name="abbr"><xsl:value-of
+						select="normalize-space(child::abbr)" /></xsl:attribute>
+					<xsl:apply-templates select="child::expan/w" />
+				</expan>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="w">
+		<xsl:variable name="nextLb">
+			<xsl:choose>
+				<xsl:when test="following::lb">
+					<xsl:apply-templates select="following::lb[1]"
+						mode="position" />
+				</xsl:when>
+				<!-- <xsl:when test="following::lb[@rend='hyphen']"> <xsl:apply-templates 
+					select="following::lb[@rend='hyphen'][1]" mode="position"/> </xsl:when> -->
+				<xsl:otherwise>
+					99999999
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="nextW1">
+			<xsl:choose>
+				<xsl:when test="following-sibling::w[1]">
+					<xsl:apply-templates select="following::w[1]"
+						mode="position" />
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="nextW2">
+			<xsl:choose>
+				<xsl:when test="following::w[2]">
+					<xsl:apply-templates select="following::w[2]"
+						mode="position" />
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="ref">
+			<xsl:choose>
+				<xsl:when test="preceding::pb[1][@n]">
+					<xsl:value-of
+						select="concat(ancestor::text/@id,', p. ',preceding::pb[1]/@n)" />
+				</xsl:when>
+				<xsl:when test="preceding::pb[1][@facs]">
+					<xsl:value-of
+						select="concat(ancestor::text/@id,', p. ',substring-before(preceding::pb[1]/@facs,'.'))" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="ancestor::text/@id" />
+				</xsl:otherwise>
+			</xsl:choose>
+
+		</xsl:variable>
+		<xsl:variable name="lang">
+			<xsl:choose>
+				<xsl:when test="ancestor::*[@lang]">
+					<xsl:value-of select="ancestor::*[@lang][1]/@lang" />
+				</xsl:when>
+				<xsl:when test="ancestor::*[@xml:lang]">
+					<xsl:value-of
+						select="ancestor::*[@xml:lang][1]/@xml:lang" />
+				</xsl:when>
+				<xsl:otherwise>
+					frm
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="nametype">
+			<xsl:choose>
+				<xsl:when test="ancestor::name">
+					<xsl:choose>
+						<xsl:when test="ancestor::name[1][@type]">
+							<xsl:value-of select="ancestor::name[1]/@type" />
+						</xsl:when>
+						<xsl:otherwise>
+							name
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					NA
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="lb">
+			<xsl:choose>
+				<xsl:when test="preceding-sibling::*[1][self::lb]">
+					avant
+				</xsl:when>
+				<xsl:when
+					test="following-sibling::*[1][self::lb or self::pb]">
+					après
+				</xsl:when>
+				<xsl:otherwise>
+					non
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="sic">
+			<xsl:choose>
+				<xsl:when test="parent::corr[parent::choice]">
+					<xsl:value-of
+						select="ancestor::choice/sic/w[position()]" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="."></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="orig">
+			<xsl:choose>
+				<xsl:when test="parent::reg[parent::choice]">
+					<xsl:value-of
+						select="ancestor::choice/orig/w[position()]" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="."></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="abbr">
+			<xsl:choose>
+				<xsl:when test="parent::expan[parent::choice]">
+					<xsl:value-of
+						select="ancestor::choice/abbr/w[position()]" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="."></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="matches(.,'^\s*[\-=]\s*$') and ($nextW1 &gt; $nextLb)">
+				<xsl:comment>
+					trait d'union effacé
+				</xsl:comment>
+			</xsl:when>
+			<xsl:when
+				test="matches(.,'[\-=]\s*$') and ($nextW1 &gt; $nextLb)">
+				<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}"
+					nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}">
+					<xsl:apply-templates select="@*" />
+					<xsl:attribute name="lb">milieu-marqué</xsl:attribute>
+					<xsl:analyze-string select="normalize-space(.)"
+						regex="^(.+)(.)$">
+						<xsl:matching-substring>
+							<xsl:value-of select="regex-group(1)" />
+							<lb rend="hyphen({regex-group(2)})" />
+						</xsl:matching-substring>
+					</xsl:analyze-string>
+					<xsl:value-of
+						select="normalize-space(following::w[1])" />
+				</w>
+			</xsl:when>
+			<xsl:when
+				test="following::w[1][matches(.,'^\s*[\-=]\s*$')] and ($nextW2 &gt; $nextLb)">
+				<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}"
+					nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}">
+					<xsl:apply-templates select="@*" />
+					<xsl:attribute name="lb">milieu-marqué2</xsl:attribute>
+					<xsl:value-of select="normalize-space(.)" />
+					<lb rend="hyphen({normalize-space(following::w[1])})" />
+					<xsl:value-of
+						select="normalize-space(following::w[2])" />
+				</w>
+			</xsl:when>
+			<xsl:when
+				test="not(matches(.,'-\s*$')) and following-sibling::*[1][self::lb[@rend='hyphen']]">
+				<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}"
+					nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}">
+					<xsl:apply-templates select="@*" />
+					<xsl:attribute name="lb">milieu-non-marqué</xsl:attribute>
+					<xsl:value-of select="normalize-space(.)" />
+					<lb rend="noHyphen" />
+					<xsl:value-of
+						select="normalize-space(following::w[1])" />
+				</w>
+			</xsl:when>
+			<xsl:when
+				test="preceding-sibling::*[1][self::lb[@rend='hyphen']]">
+				<xsl:comment>
+					fin de mot coupé :
+					<xsl:value-of select="." />
+				</xsl:comment>
+			</xsl:when>
+			<xsl:when
+				test="preceding-sibling::*[1][self::lb] and preceding-sibling::*[2][self::w[matches(.,'\w[\-=]\s*$')]]">
+				<xsl:comment>
+					fin de mot coupé (lb non marqué !) :
+					<xsl:value-of select="." />
+				</xsl:comment>
+			</xsl:when>
+			<xsl:when
+				test="preceding-sibling::*[1][matches(@txm:wordPart,'^(end|middle)$')]">
+				<xsl:comment>
+					fin de mot coupé par une balise :
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:comment>
+			</xsl:when>
+			<xsl:when
+				test="preceding-sibling::*[1][@txm:wordPart='start']">
+				<xsl:choose>
+					<xsl:when
+						test="preceding-sibling::*[1][self::choice][child::reg]">
+						<reg>
+							<xsl:apply-templates
+								select="preceding-sibling::choice[1]/reg/@*" />
+							<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+								lang="{$lang}" nametype="{$nametype}" sic="{$sic}"
+								abbr="{$abbr}" lb="{$lb}">
+								<xsl:attribute name="orig"><xsl:value-of
+									select="concat(preceding-sibling::choice[1]/orig[1]/w[1],.)" /></xsl:attribute>
+								<xsl:apply-templates select="@*" />
+								<xsl:value-of
+									select="preceding-sibling::choice[1]/reg/w" />
+								<xsl:apply-templates />
+							</w>
+						</reg>
+					</xsl:when>
+					<xsl:when
+						test="preceding-sibling::*[1][self::choice][child::corr]">
+						<corr>
+							<xsl:apply-templates
+								select="preceding-sibling::choice[1]/corr/@*" />
+							<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+								lang="{$lang}" nametype="{$nametype}" orig="{$orig}"
+								abbr="{$abbr}" lb="{$lb}">
+								<xsl:attribute name="sic"><xsl:value-of
+									select="concat(preceding-sibling::choice[1]/sic[1]/w[1],.)" /></xsl:attribute>
+								<xsl:apply-templates select="@*" />
+								<xsl:value-of
+									select="preceding-sibling::choice[1]/reg/w" />
+								<xsl:apply-templates />
+							</w>
+						</corr>
+					</xsl:when>
+					<xsl:when test="preceding-sibling::*[1][self::supplied]">
+						<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+							lang="{$lang}" nametype="{$nametype}" orig="{$orig}"
+							abbr="{$abbr}" lb="{$lb}">
+							<xsl:attribute name="sic"><xsl:value-of
+								select="." /></xsl:attribute>
+							<xsl:apply-templates select="@*" />
+							<supplied xmlns="http://www.tei-c.org/ns/1.0">
+								<xsl:value-of
+									select="preceding-sibling::supplied[1]/w" />
+							</supplied>
+							<xsl:apply-templates />
+						</w>
+					</xsl:when>
+					<xsl:when
+						test="preceding-sibling::*[1][self::subst][child::add]">
+						<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+							lang="{$lang}" nametype="{$nametype}" orig="{$orig}"
+							abbr="{$abbr}" lb="{$lb}"
+							del="{normalize-space(preceding-sibling::subst[1]/del)}">
+							<xsl:attribute name="del"><xsl:value-of
+								select="concat('(',preceding-sibling::subst[1]/del[1]/w[1],')',.)" /></xsl:attribute>
+							<xsl:apply-templates select="@*" />
+							<xsl:element name="add"
+								namespace="http://www.tei-c.org/ns/1.0">
+								<!-- <xsl:attribute name="rend">inWord</xsl:attribute> -->
+								<xsl:attribute name="del"><xsl:value-of
+									select="normalize-space(preceding-sibling::subst[1]/del)" /></xsl:attribute>
+								<xsl:apply-templates
+									select="preceding-sibling::subst[1]/add/@*" />
+								<xsl:value-of
+									select="preceding-sibling::subst[1]/add/w" />
+							</xsl:element>
+							<xsl:apply-templates />
+						</w>
+					</xsl:when>
+					<xsl:otherwise>
+						<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+							lang="{$lang}" nametype="{$nametype}" sic="{$sic}" orig="{$orig}"
+							abbr="{$abbr}" lb="{$lb}">
+							<xsl:apply-templates select="@*" />
+							<xsl:element
+								name="{local-name(preceding-sibling::*[1])}"
+								namespace="http://www.tei-c.org/ns/1.0">
+								<xsl:value-of select="preceding-sibling::*[1]//w" />
+							</xsl:element>
+							<xsl:apply-templates />
+						</w>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when
+				test="following-sibling::*[1][matches(@txm:wordPart,'^(end|middle)$')]">
+				<xsl:variable name="wordPartPosition">
+					<xsl:value-of
+						select="following-sibling::*[1]/@txm:wordPart" />
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when
+						test="following-sibling::*[1][self::choice][child::reg]">
+						<reg>
+							<xsl:apply-templates
+								select="following-sibling::choice[1]/reg/@*" />
+							<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+								lang="{$lang}" nametype="{$nametype}" sic="{$sic}"
+								abbr="{$abbr}" lb="{$lb}">
+								<xsl:attribute name="orig"><xsl:value-of
+									select="concat(.,following-sibling::choice[1]/orig[1]/w[1])" />
+                  <xsl:if test="$wordPartPosition='middle'"><xsl:value-of
+									select="following-sibling::w[1]" /></xsl:if>
                 </xsl:attribute>
-                <xsl:apply-templates select="@*"/>
-                <xsl:apply-templates/>
-                <xsl:value-of select="following-sibling::choice[1]/reg/w"/>
-                <xsl:if test="$wordPartPosition='middle'"><xsl:value-of select="following-sibling::w[1]"/></xsl:if>
-              </w>
-            </reg>
-          </xsl:when>
-          <xsl:when test="following-sibling::*[1][self::choice][child::corr]">
-            <corr>
-              <xsl:apply-templates select="following-sibling::choice[1]/corr/@*"/>
-              <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}">
-                <xsl:attribute name="sic"><xsl:value-of select="concat(.,following-sibling::choice[1]/sic[1]/w[1])"/>
-                  <xsl:if test="$wordPartPosition='middle'"><xsl:value-of select="following-sibling::w[1]"/></xsl:if>
+								<xsl:apply-templates select="@*" />
+								<xsl:apply-templates />
+								<xsl:value-of
+									select="following-sibling::choice[1]/reg/w" />
+								<xsl:if test="$wordPartPosition='middle'">
+									<xsl:value-of select="following-sibling::w[1]" />
+								</xsl:if>
+							</w>
+						</reg>
+					</xsl:when>
+					<xsl:when
+						test="following-sibling::*[1][self::choice][child::corr]">
+						<corr>
+							<xsl:apply-templates
+								select="following-sibling::choice[1]/corr/@*" />
+							<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+								lang="{$lang}" nametype="{$nametype}" orig="{$orig}"
+								abbr="{$abbr}" lb="{$lb}">
+								<xsl:attribute name="sic"><xsl:value-of
+									select="concat(.,following-sibling::choice[1]/sic[1]/w[1])" />
+                  <xsl:if test="$wordPartPosition='middle'"><xsl:value-of
+									select="following-sibling::w[1]" /></xsl:if>
                 </xsl:attribute>
-                <xsl:apply-templates select="@*"/>
-                <xsl:apply-templates/><xsl:value-of select="following-sibling::choice[1]/reg/w"/>
-                <xsl:if test="$wordPartPosition='middle'"><xsl:value-of select="following-sibling::w[1]"/></xsl:if>
-              </w>
-            </corr>
-          </xsl:when>
-          <xsl:when test="following-sibling::*[1][self::supplied]">
-            <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}">
-              <xsl:attribute name="sic"><xsl:value-of select="."/></xsl:attribute>
-              <xsl:apply-templates select="@*"/>
-              <xsl:apply-templates/><supplied xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="following-sibling::supplied[1]/w"/></supplied>
-              <xsl:if test="$wordPartPosition='middle'"><xsl:value-of select="following-sibling::w[1]"/></xsl:if>
-            </w>
-          </xsl:when>
-          <xsl:when test="following-sibling::*[1][self::subst][child::add]">
-            <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}" del="{normalize-space(following-sibling::subst[1]/del)}">
-              <xsl:attribute name="del"><xsl:value-of select="concat('(',following-sibling::subst[1]/del[1]/w[1],')',.)"/></xsl:attribute>
-              <xsl:apply-templates select="@*"/>
-              <xsl:apply-templates/>
-              <xsl:element name="add" namespace="http://www.tei-c.org/ns/1.0">
-<!--                <xsl:attribute name="rend">inWord</xsl:attribute>-->
-                <xsl:attribute name="del"><xsl:value-of select="normalize-space(following-sibling::subst[1]/del)"></xsl:value-of></xsl:attribute>
-                <xsl:apply-templates select="following-sibling::subst[1]/add/@*"/>
-                <xsl:value-of select="following-sibling::subst[1]/add/w"/>
-              </xsl:element>
-              <xsl:if test="$wordPartPosition='middle'"><xsl:value-of select="following-sibling::w[1]"/></xsl:if>
-            </w>
-          </xsl:when>
-          <xsl:otherwise>
-            <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}">
-              <xsl:apply-templates select="@*"/>
-              <xsl:apply-templates/>
-              <xsl:element name="{local-name(following-sibling::*[1])}" namespace="http://www.tei-c.org/ns/1.0">
-                <xsl:value-of select="following-sibling::*[1]//w"/>
-              </xsl:element>
-              <xsl:if test="$wordPartPosition='middle'"><xsl:value-of select="following-sibling::w[1]"/></xsl:if>
-            </w>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}" nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}" lb="{$lb}">
-          <xsl:apply-templates select="@*"/>
-          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-        </w>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="*[@txm:wordPart]">
-    <xsl:choose>
-      <xsl:when test="matches(local-name(.),'choice') and count(child::*[1]/tei:w) &gt; 1">
-        <xsl:comment>Attention : problème de tokenisation (choice) : <xsl:value-of select="normalize-space(.)"/></xsl:comment>
-        <xsl:for-each select="tei:corr|tei:reg|tei:expan">
-          <xsl:element name="{name(.)}">
-            <xsl:apply-templates select="descendant::tei:w[not(position()=1)]"/>
-          </xsl:element>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:when test="matches(local-name(.),'subst') and count(child::*[1]/tei:w) &gt; 1">
-        <xsl:comment>Attention : problème de tokenisation (subst) : <xsl:value-of select="normalize-space(.)"/></xsl:comment>
-        <xsl:copy>
-          <xsl:apply-templates select="@*[not(local-name()='wordPart')]"/>
-          <xsl:for-each select="tei:add|tei:del">
-            <xsl:element name="{name(.)}">
-              <xsl:apply-templates select="descendant::tei:w[not(position()=1)]"/>
-            </xsl:element>
-          </xsl:for-each>
-        </xsl:copy>
-      </xsl:when>      
-      <xsl:when test="count(child::w) &gt; 1">
-        <xsl:comment>Attention : problème de tokenisation : <xsl:value-of select="normalize-space(.)"/></xsl:comment>
-        <xsl:copy>
-          <xsl:apply-templates select="@*[not(local-name()='wordPart')]"/>
-          <xsl:apply-templates select="descendant::tei:w[not(position()=1)]"/>
-        </xsl:copy>
-      </xsl:when>
-      <xsl:otherwise><xsl:comment>Mot coupé par une balise : <xsl:value-of select="normalize-space(.)"/></xsl:comment></xsl:otherwise>
-    </xsl:choose>
-    
-  </xsl:template>
-  
-  <xsl:template match="lb[@rend='hyphen' and preceding-sibling::*[1][self::w]]">
-    <xsl:comment>lb déplacé à l'intérieur du mot précédent</xsl:comment>
-  </xsl:template>
-	
-	<xsl:template match="lb[not(@rend='hyphen') and matches(preceding-sibling::tei:w[1],'\w+-\s*$')]">
-		<xsl:comment>Attention : coupure de mot non marquée ! lb déplacé à l'intérieur du mot précédent</xsl:comment>
-		<!--<note xmlns="http://www.tei-c.org/ns/1.0" type="auto">Attention : coupure de mot non marquée !</note>-->
+								<xsl:apply-templates select="@*" />
+								<xsl:apply-templates />
+								<xsl:value-of
+									select="following-sibling::choice[1]/reg/w" />
+								<xsl:if test="$wordPartPosition='middle'">
+									<xsl:value-of select="following-sibling::w[1]" />
+								</xsl:if>
+							</w>
+						</corr>
+					</xsl:when>
+					<xsl:when test="following-sibling::*[1][self::supplied]">
+						<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+							lang="{$lang}" nametype="{$nametype}" orig="{$orig}"
+							abbr="{$abbr}" lb="{$lb}">
+							<xsl:attribute name="sic"><xsl:value-of
+								select="." /></xsl:attribute>
+							<xsl:apply-templates select="@*" />
+							<xsl:apply-templates />
+							<supplied xmlns="http://www.tei-c.org/ns/1.0">
+								<xsl:value-of
+									select="following-sibling::supplied[1]/w" />
+							</supplied>
+							<xsl:if test="$wordPartPosition='middle'">
+								<xsl:value-of select="following-sibling::w[1]" />
+							</xsl:if>
+						</w>
+					</xsl:when>
+					<xsl:when
+						test="following-sibling::*[1][self::subst][child::add]">
+						<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+							lang="{$lang}" nametype="{$nametype}" orig="{$orig}"
+							abbr="{$abbr}" lb="{$lb}"
+							del="{normalize-space(following-sibling::subst[1]/del)}">
+							<xsl:attribute name="del"><xsl:value-of
+								select="concat('(',following-sibling::subst[1]/del[1]/w[1],')',.)" /></xsl:attribute>
+							<xsl:apply-templates select="@*" />
+							<xsl:apply-templates />
+							<xsl:element name="add"
+								namespace="http://www.tei-c.org/ns/1.0">
+								<!-- <xsl:attribute name="rend">inWord</xsl:attribute> -->
+								<xsl:attribute name="del"><xsl:value-of
+									select="normalize-space(following-sibling::subst[1]/del)"></xsl:value-of></xsl:attribute>
+								<xsl:apply-templates
+									select="following-sibling::subst[1]/add/@*" />
+								<xsl:value-of
+									select="following-sibling::subst[1]/add/w" />
+							</xsl:element>
+							<xsl:if test="$wordPartPosition='middle'">
+								<xsl:value-of select="following-sibling::w[1]" />
+							</xsl:if>
+						</w>
+					</xsl:when>
+					<xsl:otherwise>
+						<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}"
+							lang="{$lang}" nametype="{$nametype}" sic="{$sic}" orig="{$orig}"
+							abbr="{$abbr}" lb="{$lb}">
+							<xsl:apply-templates select="@*" />
+							<xsl:apply-templates />
+							<xsl:element
+								name="{local-name(following-sibling::*[1])}"
+								namespace="http://www.tei-c.org/ns/1.0">
+								<xsl:value-of select="following-sibling::*[1]//w" />
+							</xsl:element>
+							<xsl:if test="$wordPartPosition='middle'">
+								<xsl:value-of select="following-sibling::w[1]" />
+							</xsl:if>
+						</w>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}" lang="{$lang}"
+					nametype="{$nametype}" sic="{$sic}" orig="{$orig}" abbr="{$abbr}"
+					lb="{$lb}">
+					<xsl:apply-templates select="@*" />
+					<xsl:apply-templates
+						select="*|processing-instruction()|comment()|text()" />
+				</w>
+			</xsl:otherwise>
+		</xsl:choose>
 	</xsl:template>
-	
-  
-  <xsl:template match="s">
-    <xsl:apply-templates/>
-  </xsl:template>
 
+	<xsl:template match="*[@txm:wordPart]">
+		<xsl:choose>
+			<xsl:when
+				test="matches(local-name(.),'choice') and count(child::*[1]/tei:w) &gt; 1">
+				<xsl:comment>
+					Attention : problème de tokenisation (choice) :
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:comment>
+				<xsl:for-each select="tei:corr|tei:reg|tei:expan">
+					<xsl:element name="{name(.)}">
+						<xsl:apply-templates
+							select="descendant::tei:w[not(position()=1)]" />
+					</xsl:element>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when
+				test="matches(local-name(.),'subst') and count(child::*[1]/tei:w) &gt; 1">
+				<xsl:comment>
+					Attention : problème de tokenisation (subst) :
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:comment>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="@*[not(local-name()='wordPart')]" />
+					<xsl:for-each select="tei:add|tei:del">
+						<xsl:element name="{name(.)}">
+							<xsl:apply-templates
+								select="descendant::tei:w[not(position()=1)]" />
+						</xsl:element>
+					</xsl:for-each>
+				</xsl:copy>
+			</xsl:when>
+			<xsl:when test="count(child::w) &gt; 1">
+				<xsl:comment>
+					Attention : problème de tokenisation :
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:comment>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="@*[not(local-name()='wordPart')]" />
+					<xsl:apply-templates
+						select="descendant::tei:w[not(position()=1)]" />
+				</xsl:copy>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:comment>
+					Mot coupé par une balise :
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:comment>
+			</xsl:otherwise>
+		</xsl:choose>
+
+	</xsl:template>
+
+	<xsl:template
+		match="lb[@rend='hyphen' and preceding-sibling::*[1][self::w]]">
+		<xsl:comment>
+			lb déplacé à l'intérieur du mot précédent
+		</xsl:comment>
+	</xsl:template>
+
+	<xsl:template
+		match="lb[not(@rend='hyphen') and matches(preceding-sibling::tei:w[1],'\w+-\s*$')]">
+		<xsl:comment>
+			Attention : coupure de mot non marquée ! lb déplacé à l'intérieur du
+			mot précédent
+		</xsl:comment>
+		<!--<note xmlns="http://www.tei-c.org/ns/1.0" type="auto">Attention : coupure 
+			de mot non marquée !</note> -->
+	</xsl:template>
+
+
+	<xsl:template match="s">
+		<xsl:apply-templates />
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-rnc-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-rnc-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-rnc-xmlw.xsl	(revision 2397)
@@ -1,35 +1,43 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate" version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
 
-  <xsl:template match="*">
+	<xsl:template match="*">
 
-         <xsl:element name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:element>
+		<xsl:element name="{local-name(.)}">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
 
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template match="@*|processing-instruction()|comment()">
-    <xsl:copy/>
-  </xsl:template>
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+		<xsl:copy />
+	</xsl:template>
 
-<xsl:template match="head"/>
-  
-<xsl:template match="w">
-  <xsl:element name="w">
-    <xsl:attribute name="lex"><xsl:value-of select="child::ana/@lex"/></xsl:attribute>
-    <xsl:attribute name="gr"><xsl:value-of select="child::ana/@gr"/></xsl:attribute>
-    <xsl:attribute name="withstress"><xsl:value-of select="normalize-space(child::text())"/></xsl:attribute>
-    <xsl:value-of select="replace(child::text(),'`','')"/>
-  </xsl:element>
-</xsl:template>
+	<xsl:template match="head" />
 
-  <xsl:template match="text()">
-    <xsl:value-of select="."/>
-  </xsl:template>
+	<xsl:template match="w">
+		<xsl:element name="w">
+			<xsl:attribute name="lex"><xsl:value-of
+				select="child::ana/@lex" /></xsl:attribute>
+			<xsl:attribute name="gr"><xsl:value-of
+				select="child::ana/@gr" /></xsl:attribute>
+			<xsl:attribute name="withstress"><xsl:value-of
+				select="normalize-space(child::text())" /></xsl:attribute>
+			<xsl:value-of select="replace(child::text(),'`','')" />
+		</xsl:element>
+	</xsl:template>
 
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/filter-number-act-scene-line.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/filter-number-act-scene-line.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/filter-number-act-scene-line.xsl	(revision 2397)
@@ -1,56 +1,64 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xd="http://www.pnp-software.com/XSLTdoc" version="2.0">
- 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de numérotation d'éléments pouvant être utilisée comme
-      prétraitement de l'import XML/w+CSV. Elle est conçue pour numéroter les
-      actes, scènes et lignes de l'édition XML de la pièce "All's Well That Ends Well"
-      de William Shakespeare suivante https://www.ibiblio.org/xml/examples/shakespeare/all_well.xml
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Serge Heiden slh@ens-lyon.fr</xd:author>
-    <xd:copyright>2015, ENS de Lyon / UMR 5191 ICAR (Cactus)</xd:copyright>
-  </xd:doc>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes" indent="yes"/>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de numérotation d'éléments pouvant être utilisée comme
+			prétraitement de l'import XML/w+CSV. Elle est conçue pour numéroter
+			les
+			actes, scènes et lignes de l'édition XML de la pièce "All's Well That Ends
+			Well"
+			de William Shakespeare suivante
+			https://www.ibiblio.org/xml/examples/shakespeare/all_well.xml
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-  <xsl:template match="@*|node()">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()"/>
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="ACT|SCENE">
-   <xsl:copy>
-		<xsl:attribute name="n">
-			<xsl:number level="multiple" format="I.I" count="ACT|SCENE"/>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Serge Heiden slh@ens-lyon.fr</xd:author>
+		<xd:copyright>2015, ENS de Lyon / UMR 5191 ICAR (Cactus)</xd:copyright>
+	</xd:doc>
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="yes" indent="yes" />
+
+	<xsl:template match="@*|node()">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="ACT|SCENE">
+		<xsl:copy>
+			<xsl:attribute name="n">
+			<xsl:number level="multiple" format="I.I"
+				count="ACT|SCENE" />
 		</xsl:attribute>
-    	<xsl:apply-templates select="@*|node()"/>
-   </xsl:copy>
-  </xsl:template>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="LINE">
-   <xsl:copy>
-		<xsl:attribute name="n">
-			<xsl:number level="any" format="1" count="LINE" from="SCENE"/>
+	<xsl:template match="LINE">
+		<xsl:copy>
+			<xsl:attribute name="n">
+			<xsl:number level="any" format="1" count="LINE"
+				from="SCENE" />
 		</xsl:attribute>
-    	<xsl:apply-templates select="@*|node()"/>
-   </xsl:copy>
-  </xsl:template>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
 
 </xsl:stylesheet>
 
Index: tmp/org.txm.core/res/org/txm/xml/xsl/p4top5_perseus.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/p4top5_perseus.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/p4top5_perseus.xsl	(revision 2397)
@@ -1,843 +1,728 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate" version="1.0">
-  <!-- 
-       
-       P4 to P5 converter 
-       
-       Sebastian Rahtz <sebastian.rahtz@oucs.ox.ac.uk>
-       
-       $Date: 2007-11-01 16:33:34 +0000 (Thu, 01 Nov 2007) $  $Id: p4top5.xsl 3927 2007-11-01 16:33:34Z rahtz $
-       
-       Copyright 2007 TEI Consortium
-       
-       Permission is hereby granted, free of charge, to any person obtaining
-       a copy of this software and any associated documentation gfiles (the
-       ``Software''), to deal in the Software without restriction, including
-       without limitation the rights to use, copy, modify, merge, publish,
-       distribute, sublicense, and/or sell copies of the Software, and to
-       permit persons to whom the Software is furnished to do so, subject to
-       the following conditions:
-       
-       The above copyright notice and this permission notice shall be included
-       in all copies or substantial portions of the Software.
-       
-  -->
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate" version="1.0">
+	<!-- P4 to P5 converter Sebastian Rahtz <sebastian.rahtz@oucs.ox.ac.uk> 
+		$Date: 2007-11-01 16:33:34 +0000 (Thu, 01 Nov 2007) $ $Id: p4top5.xsl 3927 
+		2007-11-01 16:33:34Z rahtz $ Copyright 2007 TEI Consortium Permission is 
+		hereby granted, free of charge, to any person obtaining a copy of this software 
+		and any associated documentation gfiles (the ``Software''), to deal in the 
+		Software without restriction, including without limitation the rights to 
+		use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
+		of the Software, and to permit persons to whom the Software is furnished 
+		to do so, subject to the following conditions: The above copyright notice 
+		and this permission notice shall be included in all copies or substantial 
+		portions of the Software. -->
 
-  <!-- Added changes specific to BFM
-       
-       Alexei Lavrentiev
-       
-       2009-11-13
-       
-       p[@rend='gv'] - ab
-       corr[@sic and @rend]
-       
-       2010-03-12
-       including w into corr (for tokenised texts)
-       
-  -->
-  <xsl:output method="xml" encoding="utf-8" cdata-section-elements="tei:eg"
-    omit-xml-declaration="no"/>
+	<!-- Added changes specific to BFM Alexei Lavrentiev 2009-11-13 p[@rend='gv'] 
+		- ab corr[@sic and @rend] 2010-03-12 including w into corr (for tokenised 
+		texts) -->
+	<xsl:output method="xml" encoding="utf-8"
+		cdata-section-elements="tei:eg" omit-xml-declaration="no" />
 
-  <xsl:variable name="processor">
-    <xsl:value-of select="system-property('xsl:vendor')"/>
-  </xsl:variable>
+	<xsl:variable name="processor">
+		<xsl:value-of select="system-property('xsl:vendor')" />
+	</xsl:variable>
 
-  <xsl:variable name="today">
-    <xsl:choose>
-      <xsl:when test="function-available('edate:date-time')">
-        <xsl:value-of select="edate:date-time()"/>
-      </xsl:when>
-      <xsl:when test="contains($processor,'SAXON')">
-        <xsl:value-of select="Date:toString(Date:new())" xmlns:Date="/java.util.Date"/>
-      </xsl:when>
-      <xsl:otherwise>0000-00-00</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
+	<xsl:variable name="today">
+		<xsl:choose>
+			<xsl:when test="function-available('edate:date-time')">
+				<xsl:value-of select="edate:date-time()" />
+			</xsl:when>
+			<xsl:when test="contains($processor,'SAXON')">
+				<xsl:value-of select="Date:toString(Date:new())"
+					xmlns:Date="/java.util.Date" />
+			</xsl:when>
+			<xsl:otherwise>
+				0000-00-00
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
 
-  <xsl:variable name="uc">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
-  <xsl:variable name="lc">abcdefghijklmnopqrstuvwxyz</xsl:variable>
+	<xsl:variable name="uc">
+		ABCDEFGHIJKLMNOPQRSTUVWXYZ
+	</xsl:variable>
+	<xsl:variable name="lc">
+		abcdefghijklmnopqrstuvwxyz
+	</xsl:variable>
 
-  <xsl:template match="*">
-    <xsl:choose>
-      <xsl:when test="namespace-uri()=''">
-        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="*">
+		<xsl:choose>
+			<xsl:when test="namespace-uri()=''">
+				<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+					name="{local-name(.)}">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template match="@*|processing-instruction()|comment()">
-    <xsl:copy/>
-  </xsl:template>
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+		<xsl:copy />
+	</xsl:template>
 
 
-  <xsl:template match="text()">
-    <xsl:value-of select="."/>
-  </xsl:template>
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
 
 
-  <!-- change of name, or replaced by another element -->
-  <xsl:template match="teiCorpus.2">
-    <teiCorpus xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </teiCorpus>
-  </xsl:template>
+	<!-- change of name, or replaced by another element -->
+	<xsl:template match="teiCorpus.2">
+		<teiCorpus xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</teiCorpus>
+	</xsl:template>
 
-  <xsl:template match="witness/@sigil">
-    <xsl:attribute name="xml:id">
-      <xsl:value-of select="."/>
+	<xsl:template match="witness/@sigil">
+		<xsl:attribute name="xml:id">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template match="witList">
-    <listWit xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </listWit>
-  </xsl:template>
+	<xsl:template match="witList">
+		<listWit xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</listWit>
+	</xsl:template>
 
 
-  <xsl:template match="TEI.2">
-    <TEI xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </TEI>
-  </xsl:template>
+	<xsl:template match="TEI.2">
+		<TEI xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</TEI>
+	</xsl:template>
 
-  <xsl:template match="xref">
-    <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="ref">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
+	<xsl:template match="xref">
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+			name="ref">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
 
 
-  <xsl:template match="xptr">
-    <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="ptr">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
+	<xsl:template match="xptr">
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+			name="ptr">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
 
 
-  <xsl:template match="figure[@url]">
-    <figure xmlns="http://www.tei-c.org/ns/1.0">
-      <graphic xmlns="http://www.tei-c.org/ns/1.0">
-        <xsl:copy-of select="@*"/>
-      </graphic>
-      <xsl:apply-templates/>
-    </figure>
-  </xsl:template>
+	<xsl:template match="figure[@url]">
+		<figure xmlns="http://www.tei-c.org/ns/1.0">
+			<graphic xmlns="http://www.tei-c.org/ns/1.0">
+				<xsl:copy-of select="@*" />
+			</graphic>
+			<xsl:apply-templates />
+		</figure>
+	</xsl:template>
 
 
-  <xsl:template match="figure/@url"/>
+	<xsl:template match="figure/@url" />
 
-  <xsl:template match="figure/@entity"/>
+	<xsl:template match="figure/@entity" />
 
-  <xsl:template match="figure[@entity]">
-    <figure xmlns="http://www.tei-c.org/ns/1.0">
-      <graphic xmlns="http://www.tei-c.org/ns/1.0" url="{unparsed-entity-uri(@entity)}">
-        <xsl:apply-templates select="@*"/>
-      </graphic>
-      <xsl:apply-templates/>
-    </figure>
-  </xsl:template>
+	<xsl:template match="figure[@entity]">
+		<figure xmlns="http://www.tei-c.org/ns/1.0">
+			<graphic xmlns="http://www.tei-c.org/ns/1.0"
+				url="{unparsed-entity-uri(@entity)}">
+				<xsl:apply-templates select="@*" />
+			</graphic>
+			<xsl:apply-templates />
+		</figure>
+	</xsl:template>
 
-  <xsl:template match="event">
-    <incident xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="@*|*|text()|comment()|processing-instruction()"/>
-    </incident>
-  </xsl:template>
+	<xsl:template match="event">
+		<incident xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction()" />
+		</incident>
+	</xsl:template>
 
-  <xsl:template match="state">
-    <refState xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="@*|*|text()|comment()|processing-instruction()"/>
-    </refState>
-  </xsl:template>
+	<xsl:template match="state">
+		<refState xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction()" />
+		</refState>
+	</xsl:template>
 
 
-  <!-- lost elements -->
-  <xsl:template match="dateRange">
-    <date xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </date>
-  </xsl:template>
+	<!-- lost elements -->
+	<xsl:template match="dateRange">
+		<date xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</date>
+	</xsl:template>
 
 
-  <xsl:template match="dateRange/@from">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="dateRange/@from">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="dateRange/@to">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="dateRange/@to">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="language">
-    <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="language">
-      <xsl:if test="@id">
-        <xsl:attribute name="ident">
-          <xsl:value-of select="@id"/>
+	<xsl:template match="language">
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+			name="language">
+			<xsl:if test="@id">
+				<xsl:attribute name="ident">
+          <xsl:value-of select="@id" />
         </xsl:attribute>
-      </xsl:if>
-      <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
+			</xsl:if>
+			<xsl:apply-templates
+				select="*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
 
-  <!-- attributes lost -->
-  <!-- dropped from TEI. Added as new change records later -->
-  <xsl:template match="@date.created"/>
+	<!-- attributes lost -->
+	<!-- dropped from TEI. Added as new change records later -->
+	<xsl:template match="@date.created" />
 
-  <xsl:template match="@date.updated"/>
+	<xsl:template match="@date.updated" />
 
-  <!-- dropped from TEI. No replacement -->
-  <xsl:template match="refsDecl/@doctype"/>
+	<!-- dropped from TEI. No replacement -->
+	<xsl:template match="refsDecl/@doctype" />
 
-  <!-- attributes changed name -->
+	<!-- attributes changed name -->
 
-  <xsl:template match="date/@value">
-    <xsl:attribute name="when">
-      <xsl:value-of select="."/>
+	<xsl:template match="date/@value">
+		<xsl:attribute name="when">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
 
-  <xsl:template match="@url">
-    <xsl:attribute name="target">
-      <xsl:value-of select="."/>
+	<xsl:template match="@url">
+		<xsl:attribute name="target">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
 
-  <xsl:template match="@doc">
-    <xsl:attribute name="target">
-      <xsl:value-of select="unparsed-entity-uri(.)"/>
+	<xsl:template match="@doc">
+		<xsl:attribute name="target">
+      <xsl:value-of select="unparsed-entity-uri(.)" />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
 
-  <xsl:template match="@id">
-    <xsl:choose>
-      <xsl:when test="parent::lang">
-        <xsl:attribute name="ident">
-          <xsl:value-of select="."/>
+	<xsl:template match="@id">
+		<xsl:choose>
+			<xsl:when test="parent::lang">
+				<xsl:attribute name="ident">
+          <xsl:value-of select="." />
         </xsl:attribute>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:attribute name="xml:id">
-          <xsl:value-of select="."/>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:attribute name="xml:id">
+          <xsl:value-of select="." />
         </xsl:attribute>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template match="@lang">
-    <xsl:attribute name="xml:lang">
-      <xsl:value-of select="."/>
+	<xsl:template match="@lang">
+		<xsl:attribute name="xml:lang">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
 
-  <xsl:template match="change/@date"/>
+	<xsl:template match="change/@date" />
 
-  <xsl:template match="date/@certainty">
-    <xsl:attribute name="cert">
-      <xsl:value-of select="."/>
+	<xsl:template match="date/@certainty">
+		<xsl:attribute name="cert">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <!-- all pointing attributes preceded by # -->
+	<!-- all pointing attributes preceded by # -->
 
-  <xsl:template match="variantEncoding/@location">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="variantEncoding/@location">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template
-    match="@ana|@active|@adj|@adjFrom|@adjTo|@children|@children|@class|@code|@code|@copyOf|@corresp|@decls|@domains|@end|@exclude|@fVal|@feats|@follow|@from|@hand|@inst|@langKey|@location|@mergedin|@new|@next|@old|@origin|@otherLangs|@parent|@passive|@perf|@prev|@render|@resp|@sameAs|@scheme|@script|@select|@since|@start|@synch|@target|@targetEnd|@to|@to|@value|@value|@who|@wit">
-    <xsl:attribute name="{name(.)}">
+	<xsl:template
+		match="@ana|@active|@adj|@adjFrom|@adjTo|@children|@children|@class|@code|@code|@copyOf|@corresp|@decls|@domains|@end|@exclude|@fVal|@feats|@follow|@from|@hand|@inst|@langKey|@location|@mergedin|@new|@next|@old|@origin|@otherLangs|@parent|@passive|@perf|@prev|@render|@resp|@sameAs|@scheme|@script|@select|@since|@start|@synch|@target|@targetEnd|@to|@to|@value|@value|@who|@wit">
+		<xsl:attribute name="{name(.)}">
       <xsl:call-template name="splitter">
         <xsl:with-param name="val">
-          <xsl:value-of select="."/>
+          <xsl:value-of select="." />
         </xsl:with-param>
       </xsl:call-template>
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
 
-  <xsl:template name="splitter">
-    <xsl:param name="val"/>
-    <xsl:choose>
-      <xsl:when test="contains($val,' ')">
-        <xsl:text>#</xsl:text>
-        <xsl:value-of select="substring-before($val,' ')"/>
-        <xsl:text> </xsl:text>
-        <xsl:call-template name="splitter">
-          <xsl:with-param name="val">
-            <xsl:value-of select="substring-after($val,' ')"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>#</xsl:text>
-        <xsl:value-of select="$val"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="splitter">
+		<xsl:param name="val" />
+		<xsl:choose>
+			<xsl:when test="contains($val,' ')">
+				<xsl:text>#</xsl:text>
+				<xsl:value-of select="substring-before($val,' ')" />
+				<xsl:text> </xsl:text>
+				<xsl:call-template name="splitter">
+					<xsl:with-param name="val">
+						<xsl:value-of select="substring-after($val,' ')" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>#</xsl:text>
+				<xsl:value-of select="$val" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- fool around with selected elements -->
+	<!-- fool around with selected elements -->
 
 
-  <!-- imprint is no longer allowed inside bibl -->
-  <xsl:template match="bibl/imprint">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<!-- imprint is no longer allowed inside bibl -->
+	<xsl:template match="bibl/imprint">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="editionStmt/editor">
-    <respStmt xmlns="http://www.tei-c.org/ns/1.0">
-      <resp>
-        <xsl:value-of select="@role"/>
-      </resp>
-      <name>
-        <xsl:apply-templates/>
-      </name>
-    </respStmt>
-  </xsl:template>
+	<xsl:template match="editionStmt/editor">
+		<respStmt xmlns="http://www.tei-c.org/ns/1.0">
+			<resp>
+				<xsl:value-of select="@role" />
+			</resp>
+			<name>
+				<xsl:apply-templates />
+			</name>
+		</respStmt>
+	</xsl:template>
 
-  <!-- header -->
-  <!-- BFM special treatment 
-  <xsl:template match="teiHeader">
-    <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="@*|*|comment()|processing-instruction()"/>
-      
-      <xsl:if test="not(revisionDesc) and (@date.created or @date.updated)">
-	<revisionDesc  xmlns="http://www.tei-c.org/ns/1.0">
-	  <xsl:if test="@date.updated">
-	    <change  xmlns="http://www.tei-c.org/ns/1.0">>
-	    <label>updated</label>
-	    <date  xmlns="http://www.tei-c.org/ns/1.0">
-	      <xsl:value-of select="@date.updated"/>
-	    </date>
-	    <label  xmlns="http://www.tei-c.org/ns/1.0">Date edited</label>
-	    </change>
-	  </xsl:if>
-	  <xsl:if test="@date.created">
-	    <change  xmlns="http://www.tei-c.org/ns/1.0">
-	      <label>created</label>
-	      <date  xmlns="http://www.tei-c.org/ns/1.0">
-		<xsl:value-of select="@date.created"/>
-	      </date>
-	      <label  xmlns="http://www.tei-c.org/ns/1.0">Date created</label>
-	    </change>
-	  </xsl:if>
-	</revisionDesc>
-      </xsl:if>
-     [comment]
-	  <change when="{$today}"  xmlns="http://www.tei-c.org/ns/1.0">Converted to TEI P5 XML by p4top5.xsl
-	  written by Sebastian
-	  Rahtz at Oxford University Computing Services.</change>
-	  </revisionDesc>
-	  </xsl:if>
-      [/comment]
-    </teiHeader>
-  </xsl:template>
-  -->
-  <xsl:template match="revisionDesc">
-    <revisionDesc xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="@*|*|comment()|processing-instruction()"/>
-    </revisionDesc>
-  </xsl:template>
+	<!-- header -->
+	<!-- BFM special treatment <xsl:template match="teiHeader"> <teiHeader xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:apply-templates select="@*|*|comment()|processing-instruction()"/> <xsl:if 
+		test="not(revisionDesc) and (@date.created or @date.updated)"> <revisionDesc 
+		xmlns="http://www.tei-c.org/ns/1.0"> <xsl:if test="@date.updated"> <change 
+		xmlns="http://www.tei-c.org/ns/1.0">> <label>updated</label> <date xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:value-of select="@date.updated"/> </date> <label xmlns="http://www.tei-c.org/ns/1.0">Date 
+		edited</label> </change> </xsl:if> <xsl:if test="@date.created"> <change 
+		xmlns="http://www.tei-c.org/ns/1.0"> <label>created</label> <date xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:value-of select="@date.created"/> </date> <label xmlns="http://www.tei-c.org/ns/1.0">Date 
+		created</label> </change> </xsl:if> </revisionDesc> </xsl:if> [comment] <change 
+		when="{$today}" xmlns="http://www.tei-c.org/ns/1.0">Converted to TEI P5 XML 
+		by p4top5.xsl written by Sebastian Rahtz at Oxford University Computing Services.</change> 
+		</revisionDesc> </xsl:if> [/comment] </teiHeader> </xsl:template> -->
+	<xsl:template match="revisionDesc">
+		<revisionDesc xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="@*|*|comment()|processing-instruction()" />
+		</revisionDesc>
+	</xsl:template>
 
-  <xsl:template match="publicationStmt">
-    <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="@*|*|comment()|processing-instruction()"/>
-      <!--
-	  <availability xmlns="http://www.tei-c.org/ns/1.0">
-	  <p xmlns="http://www.tei-c.org/ns/1.0">Licensed under <ptr xmlns="http://www.tei-c.org/ns/1.0" target="http://creativecommons.org/licenses/by-sa/2.0/uk/"/></p>
-	  </availability>
-      -->
-    </publicationStmt>
-  </xsl:template>
+	<xsl:template match="publicationStmt">
+		<publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="@*|*|comment()|processing-instruction()" />
+			<!-- <availability xmlns="http://www.tei-c.org/ns/1.0"> <p xmlns="http://www.tei-c.org/ns/1.0">Licensed 
+				under <ptr xmlns="http://www.tei-c.org/ns/1.0" target="http://creativecommons.org/licenses/by-sa/2.0/uk/"/></p> 
+				</availability> -->
+		</publicationStmt>
+	</xsl:template>
 
-  <!-- space does not have @extent any more -->
-  <xsl:template match="space/@extent">
-    <xsl:attribute name="quantity">
-      <xsl:value-of select="."/>
+	<!-- space does not have @extent any more -->
+	<xsl:template match="space/@extent">
+		<xsl:attribute name="quantity">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <!-- tagsDecl has a compulsory namespace child now -->
-  <xsl:template match="tagsDecl">
-    <xsl:if test="*">
-      <tagsDecl xmlns="http://www.tei-c.org/ns/1.0">
-        <namespace name="http://www.tei-c.org/ns/1.0">
-          <xsl:apply-templates select="*|comment()|processing-instruction"/>
-        </namespace>
-      </tagsDecl>
-    </xsl:if>
-  </xsl:template>
+	<!-- tagsDecl has a compulsory namespace child now -->
+	<xsl:template match="tagsDecl">
+		<xsl:if test="*">
+			<tagsDecl xmlns="http://www.tei-c.org/ns/1.0">
+				<namespace name="http://www.tei-c.org/ns/1.0">
+					<xsl:apply-templates
+						select="*|comment()|processing-instruction" />
+				</namespace>
+			</tagsDecl>
+		</xsl:if>
+	</xsl:template>
 
-  <!-- orgTitle inside orgName? redundant -->
-  <xsl:template match="orgName/orgTitle">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<!-- orgTitle inside orgName? redundant -->
+	<xsl:template match="orgName/orgTitle">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <!-- no need for empty <p> in sourceDesc -->
-  <xsl:template match="sourceDesc/p[string-length(.)=0]"/>
+	<!-- no need for empty <p> in sourceDesc -->
+	<xsl:template match="sourceDesc/p[string-length(.)=0]" />
 
-  <!-- start creating the new choice element -->
-  <!-- corr & sic elements: BFM special treatment 
-  <xsl:template match="corr[@sic]">
-    <choice  xmlns="http://www.tei-c.org/ns/1.0">
-      <corr  xmlns="http://www.tei-c.org/ns/1.0">
-	<xsl:value-of select="text()" />
-      </corr>
-      <sic  xmlns="http://www.tei-c.org/ns/1.0">
-	<xsl:value-of select="@sic" />
-      </sic>
-    </choice>
-  </xsl:template>
-  
-  <xsl:template match="sic[@corr]">
-    <choice  xmlns="http://www.tei-c.org/ns/1.0">
-      <sic  xmlns="http://www.tei-c.org/ns/1.0">
-	<xsl:value-of select="text()" />
-      </sic>
-      <corr  xmlns="http://www.tei-c.org/ns/1.0">
-	<xsl:value-of select="@corr" />
-      </corr>
-    </choice>
-  </xsl:template>
-  -->
-  <xsl:template match="abbr[@expan]">
-    <choice xmlns="http://www.tei-c.org/ns/1.0">
-      <abbr xmlns="http://www.tei-c.org/ns/1.0">
-        <xsl:value-of select="text()"/>
-      </abbr>
-      <expan xmlns="http://www.tei-c.org/ns/1.0">
-        <xsl:value-of select="@expan"/>
-      </expan>
-    </choice>
-  </xsl:template>
+	<!-- start creating the new choice element -->
+	<!-- corr & sic elements: BFM special treatment <xsl:template match="corr[@sic]"> 
+		<choice xmlns="http://www.tei-c.org/ns/1.0"> <corr xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:value-of select="text()" /> </corr> <sic xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:value-of select="@sic" /> </sic> </choice> </xsl:template> <xsl:template 
+		match="sic[@corr]"> <choice xmlns="http://www.tei-c.org/ns/1.0"> <sic xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:value-of select="text()" /> </sic> <corr xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:value-of select="@corr" /> </corr> </choice> </xsl:template> -->
+	<xsl:template match="abbr[@expan]">
+		<choice xmlns="http://www.tei-c.org/ns/1.0">
+			<abbr xmlns="http://www.tei-c.org/ns/1.0">
+				<xsl:value-of select="text()" />
+			</abbr>
+			<expan xmlns="http://www.tei-c.org/ns/1.0">
+				<xsl:value-of select="@expan" />
+			</expan>
+		</choice>
+	</xsl:template>
 
-  <xsl:template match="expan[@abbr]">
-    <choice xmlns="http://www.tei-c.org/ns/1.0">
-      <expan xmlns="http://www.tei-c.org/ns/1.0">
-        <xsl:value-of select="text()"/>
-      </expan>
-      <abbr xmlns="http://www.tei-c.org/ns/1.0">
-        <xsl:value-of select="@abbr"/>
-      </abbr>
-    </choice>
-  </xsl:template>
+	<xsl:template match="expan[@abbr]">
+		<choice xmlns="http://www.tei-c.org/ns/1.0">
+			<expan xmlns="http://www.tei-c.org/ns/1.0">
+				<xsl:value-of select="text()" />
+			</expan>
+			<abbr xmlns="http://www.tei-c.org/ns/1.0">
+				<xsl:value-of select="@abbr" />
+			</abbr>
+		</choice>
+	</xsl:template>
 
-  <!-- special consideration for <change> element -->
-  <xsl:template match="change">
-    <change xmlns="http://www.tei-c.org/ns/1.0">
+	<!-- special consideration for <change> element -->
+	<xsl:template match="change">
+		<change xmlns="http://www.tei-c.org/ns/1.0">
 
-      <xsl:apply-templates select="date"/>
+			<xsl:apply-templates select="date" />
 
-      <xsl:if test="respStmt/resp">
-        <label>
-          <xsl:value-of select="respStmt/resp/text()"/>
-        </label>
-      </xsl:if>
-      <xsl:for-each select="respStmt/name">
-        <name xmlns="http://www.tei-c.org/ns/1.0">
-          <xsl:apply-templates select="@*|*|comment()|processing-instruction()|text()"/>
-        </name>
-      </xsl:for-each>
-      <xsl:for-each select="item">
-        <xsl:apply-templates select="@*|*|comment()|processing-instruction()|text()"/>
-      </xsl:for-each>
-    </change>
-  </xsl:template>
+			<xsl:if test="respStmt/resp">
+				<label>
+					<xsl:value-of select="respStmt/resp/text()" />
+				</label>
+			</xsl:if>
+			<xsl:for-each select="respStmt/name">
+				<name xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:apply-templates
+						select="@*|*|comment()|processing-instruction()|text()" />
+				</name>
+			</xsl:for-each>
+			<xsl:for-each select="item">
+				<xsl:apply-templates
+					select="@*|*|comment()|processing-instruction()|text()" />
+			</xsl:for-each>
+		</change>
+	</xsl:template>
 
 
-  <xsl:template match="respStmt[resp]">
-    <respStmt xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:choose>
-        <xsl:when test="resp/name">
-          <resp xmlns="http://www.tei-c.org/ns/1.0">
-            <xsl:value-of select="resp/text()"/>
-          </resp>
-          <xsl:for-each select="resp/name">
-            <name xmlns="http://www.tei-c.org/ns/1.0">
-              <xsl:apply-templates/>
-            </name>
-          </xsl:for-each>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates/>
-          <name xmlns="http://www.tei-c.org/ns/1.0"> </name>
-        </xsl:otherwise>
-      </xsl:choose>
-    </respStmt>
-  </xsl:template>
+	<xsl:template match="respStmt[resp]">
+		<respStmt xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:choose>
+				<xsl:when test="resp/name">
+					<resp xmlns="http://www.tei-c.org/ns/1.0">
+						<xsl:value-of select="resp/text()" />
+					</resp>
+					<xsl:for-each select="resp/name">
+						<name xmlns="http://www.tei-c.org/ns/1.0">
+							<xsl:apply-templates />
+						</name>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+					<name xmlns="http://www.tei-c.org/ns/1.0">
+					</name>
+				</xsl:otherwise>
+			</xsl:choose>
+		</respStmt>
+	</xsl:template>
 
-  <xsl:template match="q/@direct"/>
+	<xsl:template match="q/@direct" />
 
-  <xsl:template match="q">
-    <q xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="@*|*|comment()|processing-instruction()|text()"/>
-    </q>
-  </xsl:template>
+	<xsl:template match="q">
+		<q xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="@*|*|comment()|processing-instruction()|text()" />
+		</q>
+	</xsl:template>
 
 
-  <!-- if we are reading the P4 with a DTD,
-       we need to avoid copying the default values
-       of attributes -->
+	<!-- if we are reading the P4 with a DTD, we need to avoid copying the default 
+		values of attributes -->
 
-  <xsl:template match="@targOrder">
-    <xsl:if test="not(translate(.,$uc,$lc) ='u')">
-      <xsl:attribute name="targOrder">
-        <xsl:value-of select="."/>
+	<xsl:template match="@targOrder">
+		<xsl:if test="not(translate(.,$uc,$lc) ='u')">
+			<xsl:attribute name="targOrder">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template match="@opt">
-    <xsl:if test="not(translate(.,$uc,$lc) ='n')">
-      <xsl:attribute name="opt">
-        <xsl:value-of select="."/>
+	<xsl:template match="@opt">
+		<xsl:if test="not(translate(.,$uc,$lc) ='n')">
+			<xsl:attribute name="opt">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template match="@to">
-    <xsl:if test="not(translate(.,$uc,$lc) ='ditto')">
-      <xsl:attribute name="to">
-        <xsl:value-of select="."/>
+	<xsl:template match="@to">
+		<xsl:if test="not(translate(.,$uc,$lc) ='ditto')">
+			<xsl:attribute name="to">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template match="@default">
-    <xsl:choose>
-      <xsl:when test="translate(.,$uc,$lc)= 'no'"/>
-      <xsl:otherwise>
-        <xsl:attribute name="default">
-          <xsl:value-of select="."/>
+	<xsl:template match="@default">
+		<xsl:choose>
+			<xsl:when test="translate(.,$uc,$lc)= 'no'" />
+			<xsl:otherwise>
+				<xsl:attribute name="default">
+          <xsl:value-of select="." />
         </xsl:attribute>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template match="@part">
-    <xsl:if test="not(translate(.,$uc,$lc) ='n')">
-      <xsl:attribute name="part">
-        <xsl:value-of select="."/>
+	<xsl:template match="@part">
+		<xsl:if test="not(translate(.,$uc,$lc) ='n')">
+			<xsl:attribute name="part">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template match="@full">
-    <xsl:if test="not(translate(.,$uc,$lc) ='yes')">
-      <xsl:attribute name="full">
-        <xsl:value-of select="."/>
+	<xsl:template match="@full">
+		<xsl:if test="not(translate(.,$uc,$lc) ='yes')">
+			<xsl:attribute name="full">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template match="@from">
-    <xsl:if test="not(translate(.,$uc,$lc) ='root')">
-      <xsl:attribute name="from">
-        <xsl:value-of select="."/>
+	<xsl:template match="@from">
+		<xsl:if test="not(translate(.,$uc,$lc) ='root')">
+			<xsl:attribute name="from">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template match="@status">
-    <xsl:choose>
-      <xsl:when test="parent::teiHeader">
-        <xsl:if test="not(translate(.,$uc,$lc) ='new')">
-          <xsl:attribute name="status">
-            <xsl:value-of select="."/>
+	<xsl:template match="@status">
+		<xsl:choose>
+			<xsl:when test="parent::teiHeader">
+				<xsl:if test="not(translate(.,$uc,$lc) ='new')">
+					<xsl:attribute name="status">
+            <xsl:value-of select="." />
           </xsl:attribute>
-        </xsl:if>
-      </xsl:when>
-      <xsl:when test="parent::del">
-        <xsl:if test="not(translate(.,$uc,$lc) ='unremarkable')">
-          <xsl:attribute name="status">
-            <xsl:value-of select="."/>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="parent::del">
+				<xsl:if test="not(translate(.,$uc,$lc) ='unremarkable')">
+					<xsl:attribute name="status">
+            <xsl:value-of select="." />
           </xsl:attribute>
-        </xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:attribute name="status">
-          <xsl:value-of select="."/>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:attribute name="status">
+          <xsl:value-of select="." />
         </xsl:attribute>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template match="@place">
-    <xsl:if test="not(translate(.,$uc,$lc) ='unspecified')">
-      <xsl:attribute name="place">
-        <xsl:value-of select="."/>
+	<xsl:template match="@place">
+		<xsl:if test="not(translate(.,$uc,$lc) ='unspecified')">
+			<xsl:attribute name="place">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template match="@sample">
-    <xsl:if test="not(translate(.,$uc,$lc) ='complete')">
-      <xsl:attribute name="sample">
-        <xsl:value-of select="."/>
+	<xsl:template match="@sample">
+		<xsl:if test="not(translate(.,$uc,$lc) ='complete')">
+			<xsl:attribute name="sample">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template match="@org">
-    <xsl:if test="not(translate(.,$uc,$lc) ='uniform')">
-      <xsl:attribute name="org">
-        <xsl:value-of select="."/>
+	<xsl:template match="@org">
+		<xsl:if test="not(translate(.,$uc,$lc) ='uniform')">
+			<xsl:attribute name="org">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="teiHeader/@type">
-    <xsl:if test="not(translate(.,$uc,$lc) ='text')">
-      <xsl:attribute name="type">
-        <xsl:value-of select="."/>
+	<xsl:template match="teiHeader/@type">
+		<xsl:if test="not(translate(.,$uc,$lc) ='text')">
+			<xsl:attribute name="type">
+        <xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
-  <!-- yes|no to boolean -->
+	<!-- yes|no to boolean -->
 
-  <xsl:template match="@anchored">
-    <xsl:attribute name="anchored">
+	<xsl:template match="@anchored">
+		<xsl:attribute name="anchored">
       <xsl:choose>
         <xsl:when test="translate(.,$uc,$lc)='yes'">true</xsl:when>
         <xsl:when test="translate(.,$uc,$lc)='no'">false</xsl:when>
       </xsl:choose>
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template match="sourceDesc/@default"/>
+	<xsl:template match="sourceDesc/@default" />
 
-  <xsl:template match="@tei">
-    <xsl:attribute name="tei">
+	<xsl:template match="@tei">
+		<xsl:attribute name="tei">
       <xsl:choose>
         <xsl:when test="translate(.,$uc,$lc)='yes'">true</xsl:when>
         <xsl:when test="translate(.,$uc,$lc)='no'">false</xsl:when>
       </xsl:choose>
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template match="@langKey"/>
+	<xsl:template match="@langKey" />
 
-  <xsl:template match="@TEIform"/>
+	<xsl:template match="@TEIform" />
 
-  <!-- assorted atts -->
-  <xsl:template match="@old"/>
+	<!-- assorted atts -->
+	<xsl:template match="@old" />
 
-  <xsl:template match="@mergedin">
-    <xsl:attribute name="mergedIn">
-      <xsl:value-of select="."/>
+	<xsl:template match="@mergedin">
+		<xsl:attribute name="mergedIn">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <!-- deal with the loss of div0 -->
+	<!-- deal with the loss of div0 -->
 
-  <xsl:template match="div1|div2|div3|div4|div5|div6">
-    <xsl:variable name="divName">
-      <xsl:choose>
-        <xsl:when test="ancestor::div0">
-          <xsl:text>div</xsl:text>
-          <xsl:value-of select="number(substring-after(local-name(.),'div')) + 1"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name()"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element name="{$divName}" namespace="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
+	<xsl:template match="div1|div2|div3|div4|div5|div6">
+		<xsl:variable name="divName">
+			<xsl:choose>
+				<xsl:when test="ancestor::div0">
+					<xsl:text>div</xsl:text>
+					<xsl:value-of
+						select="number(substring-after(local-name(.),'div')) + 1" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element name="{$divName}"
+			namespace="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
 
-  <xsl:template match="div0">
-    <div1 xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </div1>
-  </xsl:template>
-  
- <xsl:template match="l">
-   <xsl:apply-templates/>
- </xsl:template>
-  
-  <xsl:template match="lb">
-    <xsl:text>&#xA;</xsl:text>
-    <lb xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="@*"></xsl:apply-templates>
-    </lb>
-  </xsl:template>
-  
-  <xsl:template match="sp[child::l]">
-    <sp xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="@*"/>
-      <xsl:text>&#xA;</xsl:text>
-      <xsl:apply-templates select="speaker"/>
-      <xsl:text>&#xA;</xsl:text>
-      <ab><xsl:apply-templates select="l|lb"/></ab>
-    </sp>
-  </xsl:template>
+	<xsl:template match="div0">
+		<div1 xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</div1>
+	</xsl:template>
 
-<!--
-  <!-\- BFM specific -\->
+	<xsl:template match="l">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="p[@rend]">
-    <ab xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </ab>
-  </xsl:template>
+	<xsl:template match="lb">
+		<xsl:text>&#xA;</xsl:text>
+		<lb xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates select="@*"></xsl:apply-templates>
+		</lb>
+	</xsl:template>
 
-  <!-\- reducing header -\->
-  <xsl:template match="teiHeader">
-    <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="fileDesc"/>
-    </teiHeader>
-  </xsl:template>
+	<xsl:template match="sp[child::l]">
+		<sp xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates select="@*" />
+			<xsl:text>&#xA;</xsl:text>
+			<xsl:apply-templates select="speaker" />
+			<xsl:text>&#xA;</xsl:text>
+			<ab>
+				<xsl:apply-templates select="l|lb" />
+			</ab>
+		</sp>
+	</xsl:template>
 
-  <xsl:template match="fileDesc">
-    <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="titleStmt"/>
-      <publicationStmt xmlns="http://www.tei-c.org/ns/1.0"><p xmlns="http://www.tei-c.org/ns/1.0"></p></publicationStmt><sourceDesc xmlns="http://www.tei-c.org/ns/1.0"><p xmlns="http://www.tei-c.org/ns/1.0"></p></sourceDesc>
-    </fileDesc>
-  </xsl:template>
-  
-  <xsl:template match="titleStmt">
-    <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:choose>
-        <xsl:when test="descendant::title[@type='normal']">
-          <xsl:apply-templates select="title[@type='normal']|author"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <title xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::title[1]"/></title>
-        </xsl:otherwise>
-      </xsl:choose>
-      
-    </titleStmt>
-  </xsl:template>
-  
-
-  <xsl:template name="corr-crochets">
-    <xsl:value-of select="substring-before(@rend,'[')"/>
-    <xsl:element name="supplied" namespace="http://www.tei-c.org/ns/1.0">
-      <xsl:if test="string-length(@sic) &gt; 0">
-        <xsl:attribute name="rend">word_part</xsl:attribute>
-      </xsl:if>
-      <xsl:value-of select="substring-before(substring-after(@rend,'['),']')"/>
-    </xsl:element>
-    <xsl:value-of select="substring-after(@rend,']')"/>
-  </xsl:template>
-
-  <xsl:template match="corr[@sic]">
-    <choice xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:element name="corr" namespace="http://www.tei-c.org/ns/1.0">
-        <xsl:if test="@resp">
-          <xsl:attribute name="resp">
-            <xsl:value-of select="@resp"/>
-          </xsl:attribute>
-        </xsl:if>
-        <xsl:if test="@rend[not(contains(.,'crochets')) and not(contains(.,'['))]">
-          <xsl:attribute name="rend">
-            <xsl:value-of select="@rend"/>
-          </xsl:attribute>
-        </xsl:if>
-        <xsl:choose>
-          <xsl:when test="contains(@rend,'[') and contains(@rend,']')">
-            <xsl:choose>
-              <xsl:when test="child::w">
-                <xsl:text>&#xA;</xsl:text>
-                <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
-                  <xsl:call-template name="corr-crochets"/>
-                </xsl:element>
-                <xsl:text>&#xA;</xsl:text>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:call-template name="corr-crochets"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:when>
-          <xsl:when test="string-length(@sic) = 0">
-            <xsl:element name="supplied" namespace="http://www.tei-c.org/ns/1.0">
-              <xsl:apply-templates select="@resp|@rend|*|text()"/>
-            </xsl:element>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:apply-templates select="@resp|@rend|*|text()"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:element>
-      <xsl:element name="sic" namespace="http://www.tei-c.org/ns/1.0">
-        <xsl:value-of select="@sic"/>
-      </xsl:element>
-    </choice>
-  </xsl:template>
-
-  <xsl:template match="sic[@corr]">
-    <choice xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:element name="corr" namespace="http://www.tei-c.org/ns/1.0">
-        <xsl:if test="@resp">
-          <xsl:attribute name="resp">
-            <xsl:value-of select="@resp"/>
-          </xsl:attribute>
-        </xsl:if>
-        <xsl:if test="@rend[not(contains(.,'crochets')) and not(contains(.,'['))]">
-          <xsl:attribute name="rend">
-            <xsl:value-of select="@rend"/>
-          </xsl:attribute>
-        </xsl:if>
-        <xsl:choose>
-          <xsl:when test="contains(@rend,'[') and contains(@rend,']')">
-            <xsl:choose>
-              <xsl:when test="child::w">
-                <xsl:text>&#xA;</xsl:text>
-                <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
-                  <xsl:call-template name="corr-crochets"/>
-                </xsl:element>
-                <xsl:text>&#xA;</xsl:text>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:call-template name="corr-crochets"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:when>
-          <xsl:when test="string-length(.) = 0">
-            <xsl:element name="supplied" namespace="http://www.tei-c.org/ns/1.0">
-              <xsl:apply-templates select="@resp|@rend|*|text()"/>
-            </xsl:element>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:apply-templates select="@resp|@rend"/>
-            <xsl:value-of select="@corr"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:element>
-      <xsl:element name="sic" namespace="http://www.tei-c.org/ns/1.0">
-        <xsl:apply-templates/>
-      </xsl:element>
-    </choice>
-  </xsl:template>
-
-
--->
+	<!-- <!-\- BFM specific -\-> <xsl:template match="p[@rend]"> <ab xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/> 
+		</ab> </xsl:template> <!-\- reducing header -\-> <xsl:template match="teiHeader"> 
+		<teiHeader xmlns="http://www.tei-c.org/ns/1.0"> <xsl:apply-templates select="fileDesc"/> 
+		</teiHeader> </xsl:template> <xsl:template match="fileDesc"> <fileDesc xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:apply-templates select="titleStmt"/> <publicationStmt xmlns="http://www.tei-c.org/ns/1.0"><p 
+		xmlns="http://www.tei-c.org/ns/1.0"></p></publicationStmt><sourceDesc xmlns="http://www.tei-c.org/ns/1.0"><p 
+		xmlns="http://www.tei-c.org/ns/1.0"></p></sourceDesc> </fileDesc> </xsl:template> 
+		<xsl:template match="titleStmt"> <titleStmt xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:choose> <xsl:when test="descendant::title[@type='normal']"> <xsl:apply-templates 
+		select="title[@type='normal']|author"/> </xsl:when> <xsl:otherwise> <title 
+		xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::title[1]"/></title> 
+		</xsl:otherwise> </xsl:choose> </titleStmt> </xsl:template> <xsl:template 
+		name="corr-crochets"> <xsl:value-of select="substring-before(@rend,'[')"/> 
+		<xsl:element name="supplied" namespace="http://www.tei-c.org/ns/1.0"> <xsl:if 
+		test="string-length(@sic) &gt; 0"> <xsl:attribute name="rend">word_part</xsl:attribute> 
+		</xsl:if> <xsl:value-of select="substring-before(substring-after(@rend,'['),']')"/> 
+		</xsl:element> <xsl:value-of select="substring-after(@rend,']')"/> </xsl:template> 
+		<xsl:template match="corr[@sic]"> <choice xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:element name="corr" namespace="http://www.tei-c.org/ns/1.0"> <xsl:if 
+		test="@resp"> <xsl:attribute name="resp"> <xsl:value-of select="@resp"/> 
+		</xsl:attribute> </xsl:if> <xsl:if test="@rend[not(contains(.,'crochets')) 
+		and not(contains(.,'['))]"> <xsl:attribute name="rend"> <xsl:value-of select="@rend"/> 
+		</xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="contains(@rend,'[') 
+		and contains(@rend,']')"> <xsl:choose> <xsl:when test="child::w"> <xsl:text>&#xA;</xsl:text> 
+		<xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0"> <xsl:call-template 
+		name="corr-crochets"/> </xsl:element> <xsl:text>&#xA;</xsl:text> </xsl:when> 
+		<xsl:otherwise> <xsl:call-template name="corr-crochets"/> </xsl:otherwise> 
+		</xsl:choose> </xsl:when> <xsl:when test="string-length(@sic) = 0"> <xsl:element 
+		name="supplied" namespace="http://www.tei-c.org/ns/1.0"> <xsl:apply-templates 
+		select="@resp|@rend|*|text()"/> </xsl:element> </xsl:when> <xsl:otherwise> 
+		<xsl:apply-templates select="@resp|@rend|*|text()"/> </xsl:otherwise> </xsl:choose> 
+		</xsl:element> <xsl:element name="sic" namespace="http://www.tei-c.org/ns/1.0"> 
+		<xsl:value-of select="@sic"/> </xsl:element> </choice> </xsl:template> <xsl:template 
+		match="sic[@corr]"> <choice xmlns="http://www.tei-c.org/ns/1.0"> <xsl:element 
+		name="corr" namespace="http://www.tei-c.org/ns/1.0"> <xsl:if test="@resp"> 
+		<xsl:attribute name="resp"> <xsl:value-of select="@resp"/> </xsl:attribute> 
+		</xsl:if> <xsl:if test="@rend[not(contains(.,'crochets')) and not(contains(.,'['))]"> 
+		<xsl:attribute name="rend"> <xsl:value-of select="@rend"/> </xsl:attribute> 
+		</xsl:if> <xsl:choose> <xsl:when test="contains(@rend,'[') and contains(@rend,']')"> 
+		<xsl:choose> <xsl:when test="child::w"> <xsl:text>&#xA;</xsl:text> <xsl:element 
+		name="w" namespace="http://www.tei-c.org/ns/1.0"> <xsl:call-template name="corr-crochets"/> 
+		</xsl:element> <xsl:text>&#xA;</xsl:text> </xsl:when> <xsl:otherwise> <xsl:call-template 
+		name="corr-crochets"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when 
+		test="string-length(.) = 0"> <xsl:element name="supplied" namespace="http://www.tei-c.org/ns/1.0"> 
+		<xsl:apply-templates select="@resp|@rend|*|text()"/> </xsl:element> </xsl:when> 
+		<xsl:otherwise> <xsl:apply-templates select="@resp|@rend"/> <xsl:value-of 
+		select="@corr"/> </xsl:otherwise> </xsl:choose> </xsl:element> <xsl:element 
+		name="sic" namespace="http://www.tei-c.org/ns/1.0"> <xsl:apply-templates/> 
+		</xsl:element> </choice> </xsl:template> -->
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/filter-keep-only-select.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/filter-keep-only-select.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/filter-keep-only-select.xsl	(revision 2397)
@@ -1,82 +1,97 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
- 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de suppression de tous les éléments XML sauf "select",
-      à utiliser comme prétraitement de l'import XML/w+CSV.
-      
-      Pour changer le nom de la balise à conserver, mettez le nouveau nom
-      à la place de "select" dans la balise <xsl:param/> ci-dessous. Vous pouvez 
-      mettre plusieurs noms en les séparant par une barre verticale. Vous 
-      pouvez également indiquer le(s) nom(s) de balises à conserver comme un 
-      paramètre au lancement de cette feuille de style
-      
-      L'espace de nommage de la balise à conserver n'est pas pris en compte.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2013, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-	
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de suppression de tous les éléments XML sauf
+			"select",
+			à utiliser comme prétraitement de l'import XML/w+CSV.
+
+			Pour changer le nom de la balise à conserver, mettez le nouveau nom
+			à la place de "select" dans la balise
+			<xsl:param />
+			ci-dessous. Vous pouvez
+			mettre plusieurs noms en les séparant par une barre verticale. Vous
+			pouvez également indiquer le(s) nom(s) de balises à conserver comme un
+			paramètre au lancement de cette feuille de style
+
+			L'espace de nommage de la balise à conserver n'est pas pris en compte.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2013, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
 	<!-- Mettez le nom de la balise à conserver à la place de "select" ci-dessous -->
-	<xsl:param name="tagToKeep">select</xsl:param>
+	<xsl:param name="tagToKeep">
+		select
+	</xsl:param>
 
-	<xsl:variable name="tagToKeepStrict"><xsl:value-of select="concat('^',$tagToKeep,'$')"/></xsl:variable>
+	<xsl:variable name="tagToKeepStrict">
+		<xsl:value-of select="concat('^',$tagToKeep,'$')" />
+	</xsl:variable>
 
-  <xsl:template match="@*|node()">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()" />
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="@*|node()">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
 
 
-<xsl:template match="/">
-  <xsl:apply-templates select="processing-instruction()"/>
-  <xsl:choose>
-    <xsl:when test="descendant::*[matches(local-name(),$tagToKeepStrict)]">
-      <xsl:apply-templates mode="with-select"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:apply-templates/>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
+	<xsl:template match="/">
+		<xsl:apply-templates
+			select="processing-instruction()" />
+		<xsl:choose>
+			<xsl:when
+				test="descendant::*[matches(local-name(),$tagToKeepStrict)]">
+				<xsl:apply-templates mode="with-select" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="*" mode="with-select">
-    <xsl:choose>
-    	<xsl:when test="ancestor-or-self::*[matches(local-name(),$tagToKeepStrict)]">
-        <xsl:copy>
-          <xsl:apply-templates select="@*|node()"/>
-        </xsl:copy>      
-      </xsl:when>
-    	<xsl:when test="descendant::*[matches(local-name(),$tagToKeepStrict)]">
-        <xsl:copy>
-          <xsl:apply-templates select="@*"/>
-        	<xsl:apply-templates select="*[descendant-or-self::*[matches(local-name(),$tagToKeepStrict)]]" mode="with-select"/>
-        </xsl:copy>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>  
-  
+	<xsl:template match="*" mode="with-select">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor-or-self::*[matches(local-name(),$tagToKeepStrict)]">
+				<xsl:copy>
+					<xsl:apply-templates select="@*|node()" />
+				</xsl:copy>
+			</xsl:when>
+			<xsl:when
+				test="descendant::*[matches(local-name(),$tagToKeepStrict)]">
+				<xsl:copy>
+					<xsl:apply-templates select="@*" />
+					<xsl:apply-templates
+						select="*[descendant-or-self::*[matches(local-name(),$tagToKeepStrict)]]"
+						mode="with-select" />
+				</xsl:copy>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-qgraal_cm-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-qgraal_cm-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-qgraal_cm-xmlw.xsl	(revision 2397)
@@ -1,175 +1,192 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:me="http://www.menota.org/ns/1.0"
-  xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0"
-  exclude-result-prefixes="tei edate bfm me" version="1.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0"
+	exclude-result-prefixes="tei edate bfm me" version="1.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <xsl:strip-space elements="me:norm tei:w"/>
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
 
-<!-- Original version -->
-<!--  <xsl:template match="*">
-    <xsl:choose>
-      <xsl:when test="namespace-uri()=''">
-        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  -->
-  <!-- Eliminating all namespaces and comments -->
-  <xsl:template match="*">
-        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|text()"/>
-        </xsl:element>
-  </xsl:template>
-  
-  
-  <xsl:template match="@*|processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
+	<xsl:strip-space elements="me:norm tei:w" />
 
-<xsl:template match="processing-instruction('oxygen')"/>
+	<!-- Original version -->
+	<!-- <xsl:template match="*"> <xsl:choose> <xsl:when test="namespace-uri()=''"> 
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}"> 
+		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/> 
+		</xsl:element> </xsl:when> <xsl:otherwise> <xsl:copy> <xsl:apply-templates 
+		select="*|@*|processing-instruction()|comment()|text()"/> </xsl:copy> </xsl:otherwise> 
+		</xsl:choose> </xsl:template> -->
+	<!-- Eliminating all namespaces and comments -->
+	<xsl:template match="*">
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+			name="{local-name(.)}">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|text()" />
+		</xsl:element>
+	</xsl:template>
 
-  <xsl:template match="text()">
-    <xsl:value-of select="."/>
-  </xsl:template>
 
-  <xsl:template match="//tei:TEI">
-    <xsl:element name="TEI" namespace="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates/>
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="tei:teiHeader"/>
-  
-  <xsl:template match="tei:text">
-    <xsl:element name="text" namespace="http://www.tei-c.org/ns/1.0">
-<xsl:attribute name="idbfm"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='reference']"/></xsl:attribute>
-<!--<xsl:attribute name="deaf"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:publicationStmt/tei:idno[@type='sigle_DEAF']"/></xsl:attribute>-->
-<xsl:attribute name="titre"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='normal']"/></xsl:attribute>
-<xsl:attribute name="auteur"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author"/></xsl:attribute>
-<xsl:attribute name="siecle"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@n"/></xsl:attribute>
-<xsl:attribute name="ssiecle"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo_sous_siecle']/@n"/></xsl:attribute>
-<xsl:attribute name="datecompolibre"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']"/></xsl:attribute>
-<xsl:attribute name="datecompo"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@when"/></xsl:attribute>
-<!--<xsl:attribute name="notbefore"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@notBefore"/></xsl:attribute>
-<xsl:attribute name="notafter"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@notAfter"/></xsl:attribute>
-<xsl:attribute name="msdatelibre"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='ms']"/></xsl:attribute>
-<xsl:attribute name="msdate"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='ms']/@when"/></xsl:attribute>
-<xsl:attribute name="msnotbefore"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='ms']/@notBefore"/></xsl:attribute>
-<xsl:attribute name="msnotafter"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='ms']/@notAfter"/></xsl:attribute>-->
-<xsl:attribute name="forme"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textClass/tei:catRef/@target[contains(.,'forme')]"/></xsl:attribute>
-<xsl:attribute name="domaine"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/tei:domain/@type"/></xsl:attribute>
-<xsl:attribute name="genre"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/@n"/></xsl:attribute>
-<xsl:attribute name="dialecte"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:region[@type='dialecte_auteur']"/></xsl:attribute>
-<!--<xsl:attribute name="morphosynt"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[contains(.,'étiquetage morpho')]"/></xsl:attribute>
-<xsl:attribute name="restrictions"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability/tei:ab[@type='availability_txmweb']/@subtype"/></xsl:attribute>
-<xsl:attribute name="relation"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/tei:derivation/@type"/></xsl:attribute>
-<xsl:attribute name="edsci"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:titleStmt/tei:respStmt[contains(.,'Éditeur scientifique')]/tei:name"/></xsl:attribute>
-<xsl:attribute name="edcomm"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:publicationStmt/tei:publisher"/></xsl:attribute>
-<xsl:attribute name="edville"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:publicationStmt/tei:pubPlace"/></xsl:attribute>
-<xsl:attribute name="eddate"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:publicationStmt/tei:date"/></xsl:attribute>
-<xsl:attribute name="ednum"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:editionStmt/tei:edition"/></xsl:attribute>-->
-     <xsl:apply-templates/> 
-    </xsl:element>
-  </xsl:template>
+	<xsl:template match="@*|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
 
-<xsl:template match="//tei:w">
-  <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
-    <xsl:apply-templates select="@*[not(name()='type')]"/>
-    <xsl:attribute name="pos"><xsl:value-of select="@type"/></xsl:attribute>
-    <xsl:attribute name="dipl"><xsl:apply-templates select="descendant::me:dipl"/></xsl:attribute>
-    <xsl:attribute name="ref"><xsl:value-of select="concat('graal_cm, col. ',substring-after(preceding::tei:cb[1]/@xml:id,'col_'),', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
-    <xsl:attribute name="q">
-      <xsl:value-of select="count(ancestor::tei:q)"/>
+	<xsl:template match="processing-instruction('oxygen')" />
+
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template match="//tei:TEI">
+		<xsl:element name="TEI"
+			namespace="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="tei:teiHeader" />
+
+	<xsl:template match="tei:text">
+		<xsl:element name="text"
+			namespace="http://www.tei-c.org/ns/1.0">
+			<xsl:attribute name="idbfm"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='reference']" /></xsl:attribute>
+			<!--<xsl:attribute name="deaf"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:publicationStmt/tei:idno[@type='sigle_DEAF']"/></xsl:attribute> -->
+			<xsl:attribute name="titre"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='normal']" /></xsl:attribute>
+			<xsl:attribute name="auteur"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author" /></xsl:attribute>
+			<xsl:attribute name="siecle"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@n" /></xsl:attribute>
+			<xsl:attribute name="ssiecle"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo_sous_siecle']/@n" /></xsl:attribute>
+			<xsl:attribute name="datecompolibre"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']" /></xsl:attribute>
+			<xsl:attribute name="datecompo"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@when" /></xsl:attribute>
+			<!--<xsl:attribute name="notbefore"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@notBefore"/></xsl:attribute> 
+				<xsl:attribute name="notafter"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@notAfter"/></xsl:attribute> 
+				<xsl:attribute name="msdatelibre"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='ms']"/></xsl:attribute> 
+				<xsl:attribute name="msdate"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='ms']/@when"/></xsl:attribute> 
+				<xsl:attribute name="msnotbefore"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='ms']/@notBefore"/></xsl:attribute> 
+				<xsl:attribute name="msnotafter"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='ms']/@notAfter"/></xsl:attribute> -->
+			<xsl:attribute name="forme"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textClass/tei:catRef/@target[contains(.,'forme')]" /></xsl:attribute>
+			<xsl:attribute name="domaine"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/tei:domain/@type" /></xsl:attribute>
+			<xsl:attribute name="genre"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/@n" /></xsl:attribute>
+			<xsl:attribute name="dialecte"><xsl:value-of
+				select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:region[@type='dialecte_auteur']" /></xsl:attribute>
+			<!--<xsl:attribute name="morphosynt"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[contains(.,'étiquetage 
+				morpho')]"/></xsl:attribute> <xsl:attribute name="restrictions"><xsl:value-of 
+				select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability/tei:ab[@type='availability_txmweb']/@subtype"/></xsl:attribute> 
+				<xsl:attribute name="relation"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/tei:derivation/@type"/></xsl:attribute> 
+				<xsl:attribute name="edsci"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:titleStmt/tei:respStmt[contains(.,'Éditeur 
+				scientifique')]/tei:name"/></xsl:attribute> <xsl:attribute name="edcomm"><xsl:value-of 
+				select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:publicationStmt/tei:publisher"/></xsl:attribute> 
+				<xsl:attribute name="edville"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:publicationStmt/tei:pubPlace"/></xsl:attribute> 
+				<xsl:attribute name="eddate"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:publicationStmt/tei:date"/></xsl:attribute> 
+				<xsl:attribute name="ednum"><xsl:value-of select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblFull/tei:editionStmt/tei:edition"/></xsl:attribute> -->
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="//tei:w">
+		<xsl:element name="w"
+			namespace="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="@*[not(name()='type')]" />
+			<xsl:attribute name="pos"><xsl:value-of
+				select="@type" /></xsl:attribute>
+			<xsl:attribute name="dipl"><xsl:apply-templates
+				select="descendant::me:dipl" /></xsl:attribute>
+			<xsl:attribute name="ref"><xsl:value-of
+				select="concat('graal_cm, col. ',substring-after(preceding::tei:cb[1]/@xml:id,'col_'),', l. ',preceding::tei:lb[1]/@n)" /></xsl:attribute>
+			<xsl:attribute name="q">
+      <xsl:value-of select="count(ancestor::tei:q)" />
     </xsl:attribute>
-    <xsl:apply-templates/>
-  </xsl:element>
-</xsl:template>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
 
-  <xsl:template match="//tei:choice[parent::tei:w]">
-    <xsl:choose>
-      <xsl:when test="descendant::me:norm">
-        <xsl:apply-templates select="me:norm"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates select="me:facs"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="me:dipl">
-    <xsl:for-each select="child::node()">
-      <xsl:choose>
-        <xsl:when test="self::tei:ex">
-          <xsl:value-of select="concat('‹',.,'›')"/>
-        </xsl:when>
-        <xsl:otherwise><xsl:value-of select="normalize-space(.)"/></xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  
-  
-  <xsl:template match="//tei:choice[descendant::tei:w]">
-    <xsl:apply-templates select="tei:corr|tei:reg"/>
-  </xsl:template>
-  
-  <xsl:template match="//tei:surplus"/>
-  
-  <xsl:template match="//tei:del"/>
-  
-  <xsl:template match="//tei:note"/>
-  
-  <xsl:variable name="apostrophe" select='"&apos;"'/>
+	<xsl:template match="//tei:choice[parent::tei:w]">
+		<xsl:choose>
+			<xsl:when test="descendant::me:norm">
+				<xsl:apply-templates select="me:norm" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="me:facs" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template match="@bfm:aggl">
-  <xsl:attribute name="rend"><xsl:value-of select="."/></xsl:attribute>
-</xsl:template>
+	<xsl:template match="me:dipl">
+		<xsl:for-each select="child::node()">
+			<xsl:choose>
+				<xsl:when test="self::tei:ex">
+					<xsl:value-of select="concat('‹',.,'›')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template match="me:norm|me:facs">
-    <xsl:apply-templates/>
-    <!-- added 2011-02-10 -->
-    <xsl:if test="ancestor::tei:w[@*='elision'] and not(substring(., string-length(.))=$apostrophe)">
-      <xsl:text>'</xsl:text>
-    </xsl:if>
-  </xsl:template>
-  
-<!--  <xsl:template match="tei:milestone[@unit='column']">
-    <xsl:element name="pb" namespace="http://www.tei-c.org/ns/1.0">      
-      <xsl:attribute name="n"><xsl:value-of select="substring-after(@xml:id,'col_')"/></xsl:attribute>
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="tei:pb[@ed='#Pauphilet1923']">
-    <xsl:element name="milestone" namespace="http://www.tei-c.org/ns/1.0">
-      <xsl:attribute name="unit">page-Pauphilet</xsl:attribute>
-      <xsl:attribute name="n"><xsl:value-of select="@n"/></xsl:attribute>
-    </xsl:element>
-  </xsl:template>-->
 
-<xsl:template match="tei:cb[@rend='hidden']"/>
+	<xsl:template match="//tei:choice[descendant::tei:w]">
+		<xsl:apply-templates select="tei:corr|tei:reg" />
+	</xsl:template>
 
-  <xsl:template match="tei:cb[not(@rend='hidden')]">
-    <xsl:element name="pb" namespace="http://www.tei-c.org/ns/1.0">      
-      <xsl:attribute name="n"><xsl:value-of select="substring-after(@xml:id,'col_')"/></xsl:attribute>
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="tei:pb"/>
-  
-  
-  <xsl:template match="bfm:sb"/>
-  
-  <xsl:template match="tei:lb[@ed='#facs']"/>
-  
+	<xsl:template match="//tei:surplus" />
 
+	<xsl:template match="//tei:del" />
+
+	<xsl:template match="//tei:note" />
+
+	<xsl:variable name="apostrophe" select='"&apos;"' />
+
+	<xsl:template match="@bfm:aggl">
+		<xsl:attribute name="rend"><xsl:value-of
+			select="." /></xsl:attribute>
+	</xsl:template>
+
+	<xsl:template match="me:norm|me:facs">
+		<xsl:apply-templates />
+		<!-- added 2011-02-10 -->
+		<xsl:if
+			test="ancestor::tei:w[@*='elision'] and not(substring(., string-length(.))=$apostrophe)">
+			<xsl:text>'</xsl:text>
+		</xsl:if>
+	</xsl:template>
+
+	<!-- <xsl:template match="tei:milestone[@unit='column']"> <xsl:element name="pb" 
+		namespace="http://www.tei-c.org/ns/1.0"> <xsl:attribute name="n"><xsl:value-of 
+		select="substring-after(@xml:id,'col_')"/></xsl:attribute> </xsl:element> 
+		</xsl:template> <xsl:template match="tei:pb[@ed='#Pauphilet1923']"> <xsl:element 
+		name="milestone" namespace="http://www.tei-c.org/ns/1.0"> <xsl:attribute 
+		name="unit">page-Pauphilet</xsl:attribute> <xsl:attribute name="n"><xsl:value-of 
+		select="@n"/></xsl:attribute> </xsl:element> </xsl:template> -->
+
+	<xsl:template match="tei:cb[@rend='hidden']" />
+
+	<xsl:template match="tei:cb[not(@rend='hidden')]">
+		<xsl:element name="pb"
+			namespace="http://www.tei-c.org/ns/1.0">
+			<xsl:attribute name="n"><xsl:value-of
+				select="substring-after(@xml:id,'col_')" /></xsl:attribute>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="tei:pb" />
+
+
+	<xsl:template match="bfm:sb" />
+
+	<xsl:template match="tei:lb[@ed='#facs']" />
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/svn2cl.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/svn2cl.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/svn2cl.xsl	(revision 2397)
@@ -1,500 +1,497 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<!--
-	USAGE:
-	svn log - -xml - -verbose > foo.txt
-	xsltproc etc/svn2cl.xsl foo.txt > ChangeLog
+<!-- USAGE: svn log - -xml - -verbose > foo.txt xsltproc etc/svn2cl.xsl foo.txt 
+	> ChangeLog svn2cl.xsl - xslt stylesheet for converting svn log to a normal 
+	changelog version 0.11 Usage (replace ++ with two minus signs which aren't 
+	allowed inside xml comments): svn ++verbose ++xml log | \ xsltproc ++stringparam 
+	strip-prefix `basename $(pwd)` \ ++stringparam linelen 75 \ ++stringparam 
+	groupbyday yes \ ++stringparam separate-daylogs yes \ ++stringparam include-rev 
+	yes \ ++stringparam include-actions yes \ ++stringparam breakbeforemsg yes/2 
+	\ ++stringparam reparagraph yes \ ++stringparam authorsfile FILE \ ++stringparam 
+	ignore-message-starting \ svn2cl.xsl - > ChangeLog This file is based on 
+	several implementations of this conversion that I was not completely happy 
+	with and some other common xslt constructs found on the web. Copyright (C) 
+	2004, 2005, 2006, 2007 Arthur de Jong. Redistribution and use in source and 
+	binary forms, with or without modification, are permitted provided that the 
+	following conditions are met: 1. Redistributions of source code must retain 
+	the above copyright notice, this list of conditions and the following disclaimer. 
+	2. Redistributions in binary form must reproduce the above copyright notice, 
+	this list of conditions and the following disclaimer in the documentation 
+	and/or other materials provided with the distribution. 3. The name of the 
+	author may not be used to endorse or promote products derived from this software 
+	without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE 
+	AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+	LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 
+	INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+	BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
+	USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+	THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+	NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
+	EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
 
-
-   svn2cl.xsl - xslt stylesheet for converting svn log to a normal
-                changelog
-
-   version 0.11
-
-   Usage (replace ++ with two minus signs which aren't allowed
-   inside xml comments):
-     svn ++verbose ++xml log | \
-       xsltproc ++stringparam strip-prefix `basename $(pwd)` \
-                ++stringparam linelen 75 \
-                ++stringparam groupbyday yes \
-                ++stringparam separate-daylogs yes \
-                ++stringparam include-rev yes \
-                ++stringparam include-actions yes \
-                ++stringparam breakbeforemsg yes/2 \
-                ++stringparam reparagraph yes \
-                ++stringparam authorsfile FILE \
-                ++stringparam ignore-message-starting \
-                svn2cl.xsl - > ChangeLog
-
-   This file is based on several implementations of this conversion
-   that I was not completely happy with and some other common
-   xslt constructs found on the web.
-
-   Copyright (C) 2004, 2005, 2006, 2007 Arthur de Jong.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-   1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-   2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in
-      the documentation and/or other materials provided with the
-      distribution.
-   3. The name of the author may not be used to endorse or promote
-      products derived from this software without specific prior
-      written permission.
-
-   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-   ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-   IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
--->
-
 <!DOCTYPE xsl:stylesheet [
  <!ENTITY tab "&#9;">
  <!ENTITY newl "&#38;#xA;">
  <!ENTITY space "&#32;">
 ]>
 
-<xsl:stylesheet
-  version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
- <xsl:output
-   method="text"
-   encoding="utf-8"
-   media-type="text/plain"
-   omit-xml-declaration="yes"
-   standalone="yes"
-   indent="no" />
+	<xsl:output method="text" encoding="utf-8"
+		media-type="text/plain" omit-xml-declaration="yes" standalone="yes"
+		indent="no" />
 
- <xsl:strip-space elements="*" />
+	<xsl:strip-space elements="*" />
 
- <!-- the prefix of pathnames to strip -->
- <xsl:param name="strip-prefix" select="'/'" />
+	<!-- the prefix of pathnames to strip -->
+	<xsl:param name="strip-prefix" select="'/'" />
 
- <!-- the length of a line to wrap messages at -->
- <xsl:param name="linelen" select="75" />
+	<!-- the length of a line to wrap messages at -->
+	<xsl:param name="linelen" select="75" />
 
- <!-- whether entries should be grouped by day -->
- <xsl:param name="groupbyday" select="'no'" />
+	<!-- whether entries should be grouped by day -->
+	<xsl:param name="groupbyday" select="'no'" />
 
- <!-- whether to seperate log messages by empty lines -->
- <xsl:param name="separate-daylogs" select="'no'" />
+	<!-- whether to seperate log messages by empty lines -->
+	<xsl:param name="separate-daylogs" select="'no'" />
 
- <!-- whether a revision number should be included -->
- <xsl:param name="include-rev" select="'no'" />
+	<!-- whether a revision number should be included -->
+	<xsl:param name="include-rev" select="'no'" />
 
- <!-- whether aaction labels should be added to files -->
- <xsl:param name="include-actions" select="'no'" />
+	<!-- whether aaction labels should be added to files -->
+	<xsl:param name="include-actions" select="'no'" />
 
- <!-- whether the log message should start on a new line -->
- <xsl:param name="breakbeforemsg" select="'no'" />
+	<!-- whether the log message should start on a new line -->
+	<xsl:param name="breakbeforemsg" select="'no'" />
 
- <!-- whether the message should be rewrapped within one paragraph -->
- <xsl:param name="reparagraph" select="'no'" />
+	<!-- whether the message should be rewrapped within one paragraph -->
+	<xsl:param name="reparagraph" select="'no'" />
 
- <!-- whether certain messages should be ignored -->
- <xsl:param name="ignore-message-starting" select="''" />
+	<!-- whether certain messages should be ignored -->
+	<xsl:param name="ignore-message-starting" select="''" />
 
- <!-- location of authors file if any -->
- <xsl:param name="authorsfile" select="''" />
- <xsl:key name="author-lookup" match="author" use="@uid" />
- <xsl:variable name="authors-top" select="document($authorsfile)/authors" />
+	<!-- location of authors file if any -->
+	<xsl:param name="authorsfile" select="''" />
+	<xsl:key name="author-lookup" match="author" use="@uid" />
+	<xsl:variable name="authors-top"
+		select="document($authorsfile)/authors" />
 
- <!-- match the topmost log entry -->
- <xsl:template match="log">
-  <xsl:choose>
-   <xsl:when test="$ignore-message-starting != ''">
-    <!-- only handle logentries with don't contain the string -->
-    <xsl:apply-templates select="logentry[not(starts-with(msg,$ignore-message-starting))]" />
-   </xsl:when>
-   <xsl:otherwise>
-    <xsl:apply-templates select="logentry" />
-   </xsl:otherwise>
-  </xsl:choose>
-  <!-- add newlines at the end of the changelog -->
-  <xsl:text>&newl;</xsl:text>
- </xsl:template>
+	<!-- match the topmost log entry -->
+	<xsl:template match="log">
+		<xsl:choose>
+			<xsl:when test="$ignore-message-starting != ''">
+				<!-- only handle logentries with don't contain the string -->
+				<xsl:apply-templates
+					select="logentry[not(starts-with(msg,$ignore-message-starting))]" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="logentry" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<!-- add newlines at the end of the changelog -->
+		<xsl:text>&newl;</xsl:text>
+	</xsl:template>
 
- <!-- format one entry from the log -->
- <xsl:template match="logentry">
-  <xsl:choose>
-   <!-- if we're grouping we should omit some headers -->
-   <xsl:when test="$groupbyday='yes'">
-    <!-- save log entry number -->
-    <xsl:variable name="pos" select="position()" />
-    <!-- fetch previous entry's date -->
-    <xsl:variable name="prevdate">
-     <xsl:apply-templates select="../logentry[position()=(($pos)-1)]/date" />
-    </xsl:variable>
-    <!-- fetch previous entry's author -->
-    <xsl:variable name="prevauthor">
-     <xsl:value-of select="normalize-space(../logentry[position()=(($pos)-1)]/author)" />
-    </xsl:variable>
-    <!-- fetch this entry's date -->
-    <xsl:variable name="date">
-     <xsl:apply-templates select="date" />
-    </xsl:variable>
-    <!-- fetch this entry's author -->
-    <xsl:variable name="author">
-     <xsl:value-of select="normalize-space(author)" />
-    </xsl:variable>
-    <!-- check if header is changed -->
-    <xsl:if test="($prevdate!=$date) or ($prevauthor!=$author)">
-     <!-- add newline -->
-     <xsl:if test="not(position()=1)">
-      <xsl:text>&newl;</xsl:text>
-     </xsl:if>
-     <!-- date -->
-     <xsl:value-of select="$date" />
-     <!-- two spaces -->
-     <xsl:text>&space;&space;</xsl:text>
-     <!-- author's name -->
-     <xsl:apply-templates select="author" />
-     <!-- two newlines -->
-     <xsl:text>&newl;</xsl:text>
-     <xsl:if test="$separate-daylogs!='yes'"><xsl:text>&newl;</xsl:text></xsl:if>
-    </xsl:if>
-   </xsl:when>
-   <!-- write the log header -->
-   <xsl:otherwise>
-    <!-- add newline -->
-    <xsl:if test="not(position()=1)">
-     <xsl:text>&newl;</xsl:text>
-    </xsl:if>
-    <!-- date -->
-    <xsl:apply-templates select="date" />
-    <!-- two spaces -->
-    <xsl:text>&space;&space;</xsl:text>
-    <!-- author's name -->
-    <xsl:apply-templates select="author" />
-    <!-- two newlines -->
-    <xsl:text>&newl;&newl;</xsl:text>
-   </xsl:otherwise>
-  </xsl:choose>
-  <!-- get paths string -->
-  <xsl:variable name="paths">
-   <xsl:apply-templates select="paths" />
-  </xsl:variable>
-  <!-- get revision number -->
-  <xsl:variable name="rev">
-   <xsl:if test="$include-rev='yes'">
-    <xsl:text>[r</xsl:text>
-    <xsl:value-of select="@revision" />
-    <xsl:text>]&space;</xsl:text>
-   </xsl:if>
-  </xsl:variable>
-  <!-- trim trailing newlines -->
-  <xsl:variable name="msg">
-   <!-- add a line break before the log message -->
-   <xsl:choose>
-    <xsl:when test="$breakbeforemsg='yes'">
-     <xsl:text>&newl;</xsl:text>
-    </xsl:when>
-    <xsl:when test="number($breakbeforemsg)&gt;0">
-     <xsl:call-template name="newlines">
-      <xsl:with-param name="count" select="number($breakbeforemsg)" />
-     </xsl:call-template>
-    </xsl:when>
-   </xsl:choose>
-   <xsl:call-template name="trim-newln">
-    <xsl:with-param name="txt" select="msg" />
-   </xsl:call-template>
-  </xsl:variable>
-  <!-- add newline here if separate-daylogs is in effect -->
-  <xsl:if test="$groupbyday='yes' and $separate-daylogs='yes'"><xsl:text>&newl;</xsl:text></xsl:if>
-  <!-- first line is indented (other indents are done in wrap template) -->
-  <xsl:text>&tab;*&space;</xsl:text>
-  <!-- set up the text to wrap -->
-  <xsl:variable name="txt">
-   <xsl:value-of select="$rev" />
-   <xsl:if test="$paths!=''">
-    <xsl:value-of select="concat($paths,':&space;')" />
-   </xsl:if>
-   <xsl:value-of select="$msg" />
-  </xsl:variable>
-  <!-- print the paths and message nicely wrapped -->
-  <xsl:call-template name="wrap">
-   <xsl:with-param name="txt" select="$txt" />
-  </xsl:call-template>
- </xsl:template>
+	<!-- format one entry from the log -->
+	<xsl:template match="logentry">
+		<xsl:choose>
+			<!-- if we're grouping we should omit some headers -->
+			<xsl:when test="$groupbyday='yes'">
+				<!-- save log entry number -->
+				<xsl:variable name="pos" select="position()" />
+				<!-- fetch previous entry's date -->
+				<xsl:variable name="prevdate">
+					<xsl:apply-templates
+						select="../logentry[position()=(($pos)-1)]/date" />
+				</xsl:variable>
+				<!-- fetch previous entry's author -->
+				<xsl:variable name="prevauthor">
+					<xsl:value-of
+						select="normalize-space(../logentry[position()=(($pos)-1)]/author)" />
+				</xsl:variable>
+				<!-- fetch this entry's date -->
+				<xsl:variable name="date">
+					<xsl:apply-templates select="date" />
+				</xsl:variable>
+				<!-- fetch this entry's author -->
+				<xsl:variable name="author">
+					<xsl:value-of select="normalize-space(author)" />
+				</xsl:variable>
+				<!-- check if header is changed -->
+				<xsl:if test="($prevdate!=$date) or ($prevauthor!=$author)">
+					<!-- add newline -->
+					<xsl:if test="not(position()=1)">
+						<xsl:text>&newl;</xsl:text>
+					</xsl:if>
+					<!-- date -->
+					<xsl:value-of select="$date" />
+					<!-- two spaces -->
+					<xsl:text>&space;&space;</xsl:text>
+					<!-- author's name -->
+					<xsl:apply-templates select="author" />
+					<!-- two newlines -->
+					<xsl:text>&newl;</xsl:text>
+					<xsl:if test="$separate-daylogs!='yes'">
+						<xsl:text>&newl;</xsl:text>
+					</xsl:if>
+				</xsl:if>
+			</xsl:when>
+			<!-- write the log header -->
+			<xsl:otherwise>
+				<!-- add newline -->
+				<xsl:if test="not(position()=1)">
+					<xsl:text>&newl;</xsl:text>
+				</xsl:if>
+				<!-- date -->
+				<xsl:apply-templates select="date" />
+				<!-- two spaces -->
+				<xsl:text>&space;&space;</xsl:text>
+				<!-- author's name -->
+				<xsl:apply-templates select="author" />
+				<!-- two newlines -->
+				<xsl:text>&newl;&newl;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+		<!-- get paths string -->
+		<xsl:variable name="paths">
+			<xsl:apply-templates select="paths" />
+		</xsl:variable>
+		<!-- get revision number -->
+		<xsl:variable name="rev">
+			<xsl:if test="$include-rev='yes'">
+				<xsl:text>[r</xsl:text>
+				<xsl:value-of select="@revision" />
+				<xsl:text>]&space;</xsl:text>
+			</xsl:if>
+		</xsl:variable>
+		<!-- trim trailing newlines -->
+		<xsl:variable name="msg">
+			<!-- add a line break before the log message -->
+			<xsl:choose>
+				<xsl:when test="$breakbeforemsg='yes'">
+					<xsl:text>&newl;</xsl:text>
+				</xsl:when>
+				<xsl:when test="number($breakbeforemsg)&gt;0">
+					<xsl:call-template name="newlines">
+						<xsl:with-param name="count"
+							select="number($breakbeforemsg)" />
+					</xsl:call-template>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:call-template name="trim-newln">
+				<xsl:with-param name="txt" select="msg" />
+			</xsl:call-template>
+		</xsl:variable>
+		<!-- add newline here if separate-daylogs is in effect -->
+		<xsl:if test="$groupbyday='yes' and $separate-daylogs='yes'">
+			<xsl:text>&newl;</xsl:text>
+		</xsl:if>
+		<!-- first line is indented (other indents are done in wrap template) -->
+		<xsl:text>&tab;*&space;</xsl:text>
+		<!-- set up the text to wrap -->
+		<xsl:variable name="txt">
+			<xsl:value-of select="$rev" />
+			<xsl:if test="$paths!=''">
+				<xsl:value-of select="concat($paths,':&space;')" />
+			</xsl:if>
+			<xsl:value-of select="$msg" />
+		</xsl:variable>
+		<!-- print the paths and message nicely wrapped -->
+		<xsl:call-template name="wrap">
+			<xsl:with-param name="txt" select="$txt" />
+		</xsl:call-template>
+	</xsl:template>
 
- <!-- format date -->
- <xsl:template match="date">
-  <xsl:variable name="date" select="normalize-space(.)" />
-  <!-- output date part -->
-  <xsl:value-of select="substring($date,1,10)" />
-  <!-- output time part -->
-  <xsl:if test="$groupbyday!='yes'">
-   <xsl:text>&space;</xsl:text>
-   <xsl:value-of select="substring($date,12,5)" />
-  </xsl:if>
- </xsl:template>
+	<!-- format date -->
+	<xsl:template match="date">
+		<xsl:variable name="date" select="normalize-space(.)" />
+		<!-- output date part -->
+		<xsl:value-of select="substring($date,1,10)" />
+		<!-- output time part -->
+		<xsl:if test="$groupbyday!='yes'">
+			<xsl:text>&space;</xsl:text>
+			<xsl:value-of select="substring($date,12,5)" />
+		</xsl:if>
+	</xsl:template>
 
- <!-- format author -->
- <xsl:template match="author">
-  <xsl:variable name="uid" select="normalize-space(.)" />
-  <!-- try to lookup author in authorsfile -->
-  <xsl:choose>
-   <xsl:when test="$authorsfile!=''">
-    <xsl:for-each select="$authors-top">
-     <xsl:variable name="author" select="key('author-lookup',$uid)" />
-     <!-- present result -->
-     <xsl:choose>
-      <xsl:when test="string($author/.)">
-       <xsl:apply-templates select="$author/node()" mode="copy" />
-      </xsl:when>
-      <xsl:otherwise>
-       <xsl:value-of select="$uid" />
-      </xsl:otherwise>
-     </xsl:choose>
-    </xsl:for-each>
-   </xsl:when>
-   <xsl:otherwise>
-    <xsl:value-of select="$uid" />
-   </xsl:otherwise>
-  </xsl:choose>
- </xsl:template>
+	<!-- format author -->
+	<xsl:template match="author">
+		<xsl:variable name="uid" select="normalize-space(.)" />
+		<!-- try to lookup author in authorsfile -->
+		<xsl:choose>
+			<xsl:when test="$authorsfile!=''">
+				<xsl:for-each select="$authors-top">
+					<xsl:variable name="author"
+						select="key('author-lookup',$uid)" />
+					<!-- present result -->
+					<xsl:choose>
+						<xsl:when test="string($author/.)">
+							<xsl:apply-templates select="$author/node()"
+								mode="copy" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$uid" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$uid" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
- <!-- copy but normalize text -->
- <xsl:template match="text()" mode="copy">
-  <xsl:value-of select="normalize-space(.)" />
- </xsl:template>
+	<!-- copy but normalize text -->
+	<xsl:template match="text()" mode="copy">
+		<xsl:value-of select="normalize-space(.)" />
+	</xsl:template>
 
- <!-- simple copy template -->
- <xsl:template match="@*|node()" mode="copy">
-  <xsl:copy>
-   <xsl:apply-templates select="@*|node()" mode="copy" />
-  </xsl:copy>
- </xsl:template>
+	<!-- simple copy template -->
+	<xsl:template match="@*|node()" mode="copy">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()"
+				mode="copy" />
+		</xsl:copy>
+	</xsl:template>
 
- <!-- present a list of paths names -->
- <xsl:template match="paths">
-  <xsl:choose>
-   <!-- only handle paths that begin with the path and strip the path -->
-   <xsl:when test="$strip-prefix != ''">
-    <!-- if strip-prefix does not start with a slash, prepend it -->
-    <xsl:variable name="tmpstrip1">
-     <xsl:choose>
-      <xsl:when test="starts-with($strip-prefix,'/')">
-       <xsl:value-of select="$strip-prefix" />
-      </xsl:when>
-      <xsl:otherwise>
-       <xsl:value-of select="concat('/',$strip-prefix)" />
-      </xsl:otherwise>
-     </xsl:choose>
-    </xsl:variable>
-    <!-- strip trailing slash from strip-prefix -->
-    <xsl:variable name="tmpstrip2">
-     <xsl:choose>
-      <xsl:when test="substring($tmpstrip1,string-length($tmpstrip1),1)='/'">
-       <xsl:value-of select="substring($tmpstrip1,1,string-length($tmpstrip1)-1)" />
-      </xsl:when>
-      <xsl:otherwise>
-       <xsl:value-of select="$tmpstrip1" />
-      </xsl:otherwise>
-     </xsl:choose>
-    </xsl:variable>
-    <!-- filter on all entries within directory -->
-    <xsl:for-each select="path[starts-with(concat(normalize-space(.),'/'),concat($tmpstrip2,'/'))]">
-     <xsl:sort select="normalize-space(.)" data-type="text" />
-     <!-- unless we are the first entry, add a comma -->
-     <xsl:if test="not(position()=1)">
-      <xsl:text>,&space;</xsl:text>
-     </xsl:if>
-     <!-- print the path name -->
-     <xsl:call-template name="printpath">
-      <xsl:with-param name="path" select="substring(normalize-space(.),string-length($strip-prefix)+3)" />
-     </xsl:call-template>
-     <!-- add the action flag -->
-     <xsl:if test="$include-actions='yes'">
-      <xsl:apply-templates select="." mode="action"/>
-     </xsl:if>
-    </xsl:for-each>
-   </xsl:when>
-   <!-- print a simple list of all paths -->
-   <xsl:otherwise>
-    <xsl:for-each select="path">
-     <xsl:sort select="normalize-space(.)" data-type="text" />
-     <!-- unless we are the first entry, add a comma -->
-     <xsl:if test="not(position()=1)">
-      <xsl:text>,&space;</xsl:text>
-     </xsl:if>
-     <!-- print the path name -->
-     <xsl:value-of select="normalize-space(.)" />
-     <!-- add the action flag -->
-     <xsl:if test="$include-actions='yes'">
-      <xsl:apply-templates select="." mode="action"/>
-     </xsl:if>
-    </xsl:for-each>
-   </xsl:otherwise>
-  </xsl:choose>
- </xsl:template>
+	<!-- present a list of paths names -->
+	<xsl:template match="paths">
+		<xsl:choose>
+			<!-- only handle paths that begin with the path and strip the path -->
+			<xsl:when test="$strip-prefix != ''">
+				<!-- if strip-prefix does not start with a slash, prepend it -->
+				<xsl:variable name="tmpstrip1">
+					<xsl:choose>
+						<xsl:when test="starts-with($strip-prefix,'/')">
+							<xsl:value-of select="$strip-prefix" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="concat('/',$strip-prefix)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<!-- strip trailing slash from strip-prefix -->
+				<xsl:variable name="tmpstrip2">
+					<xsl:choose>
+						<xsl:when
+							test="substring($tmpstrip1,string-length($tmpstrip1),1)='/'">
+							<xsl:value-of
+								select="substring($tmpstrip1,1,string-length($tmpstrip1)-1)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$tmpstrip1" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<!-- filter on all entries within directory -->
+				<xsl:for-each
+					select="path[starts-with(concat(normalize-space(.),'/'),concat($tmpstrip2,'/'))]">
+					<xsl:sort select="normalize-space(.)" data-type="text" />
+					<!-- unless we are the first entry, add a comma -->
+					<xsl:if test="not(position()=1)">
+						<xsl:text>,&space;</xsl:text>
+					</xsl:if>
+					<!-- print the path name -->
+					<xsl:call-template name="printpath">
+						<xsl:with-param name="path"
+							select="substring(normalize-space(.),string-length($strip-prefix)+3)" />
+					</xsl:call-template>
+					<!-- add the action flag -->
+					<xsl:if test="$include-actions='yes'">
+						<xsl:apply-templates select="." mode="action" />
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:when>
+			<!-- print a simple list of all paths -->
+			<xsl:otherwise>
+				<xsl:for-each select="path">
+					<xsl:sort select="normalize-space(.)" data-type="text" />
+					<!-- unless we are the first entry, add a comma -->
+					<xsl:if test="not(position()=1)">
+						<xsl:text>,&space;</xsl:text>
+					</xsl:if>
+					<!-- print the path name -->
+					<xsl:value-of select="normalize-space(.)" />
+					<!-- add the action flag -->
+					<xsl:if test="$include-actions='yes'">
+						<xsl:apply-templates select="." mode="action" />
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
- <xsl:template match="path" mode="action">
-  <xsl:choose>
-   <xsl:when test="@action='D'">
-    <xsl:text>[DEL]</xsl:text>
-   </xsl:when>
-   <xsl:when test="@copyfrom-path">
-    <xsl:text>[CPY]</xsl:text>
-   </xsl:when>
-   <xsl:when test="@action='D'">
-    <xsl:text>[ADD]</xsl:text>
-   </xsl:when>
-  </xsl:choose>
- </xsl:template>
+	<xsl:template match="path" mode="action">
+		<xsl:choose>
+			<xsl:when test="@action='D'">
+				<xsl:text>[DEL]</xsl:text>
+			</xsl:when>
+			<xsl:when test="@copyfrom-path">
+				<xsl:text>[CPY]</xsl:text>
+			</xsl:when>
+			<xsl:when test="@action='D'">
+				<xsl:text>[ADD]</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
- <!-- transform path to something printable -->
- <xsl:template name="printpath">
-  <!-- fetch the pathname -->
-  <xsl:param name="path" />
-  <!-- strip leading slash -->
-  <xsl:variable name="tmp1">
-   <xsl:choose>
-    <xsl:when test="starts-with($path,'/')">
-     <xsl:value-of select="substring($path,2)" />
-    </xsl:when>
-    <xsl:otherwise>
-     <xsl:value-of select="$path" />
-    </xsl:otherwise>
-   </xsl:choose>
-  </xsl:variable>
-  <!-- translate empty string to dot -->
-  <xsl:choose>
-   <xsl:when test="$tmp1 = ''">
-    <xsl:text>.</xsl:text>
-   </xsl:when>
-   <xsl:otherwise>
-    <xsl:value-of select="$tmp1" />
-   </xsl:otherwise>
-  </xsl:choose>
- </xsl:template>
+	<!-- transform path to something printable -->
+	<xsl:template name="printpath">
+		<!-- fetch the pathname -->
+		<xsl:param name="path" />
+		<!-- strip leading slash -->
+		<xsl:variable name="tmp1">
+			<xsl:choose>
+				<xsl:when test="starts-with($path,'/')">
+					<xsl:value-of select="substring($path,2)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$path" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<!-- translate empty string to dot -->
+		<xsl:choose>
+			<xsl:when test="$tmp1 = ''">
+				<xsl:text>.</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$tmp1" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
- <!-- string-wrapping template -->
- <xsl:template name="wrap">
-  <xsl:param name="txt" />
-  <xsl:variable name="normtxt" select="normalize-space($txt)" />
-  <xsl:choose>
-   <xsl:when test="contains($txt,'&newl;')">
-     <!-- text contains newlines, do the first line -->
-     <xsl:call-template name="wrap">
-      <xsl:with-param name="txt" select="substring-before($txt,'&newl;')" />
-     </xsl:call-template>
-     <!-- print tab -->
-     <xsl:text>&tab;&space;&space;</xsl:text>
-     <!-- wrap the rest of the text -->
-     <xsl:call-template name="wrap">
-      <xsl:with-param name="txt" select="substring-after($txt,'&newl;')" />
-     </xsl:call-template>
-   </xsl:when>
-   <xsl:when test="(string-length($normtxt) &lt; (($linelen)-9)) or not(contains($normtxt,' '))">
-    <!-- this is easy, nothing to do -->
-    <xsl:value-of select="$normtxt" />
-    <!-- add newline -->
-    <xsl:text>&newl;</xsl:text>
-   </xsl:when>
-   <xsl:otherwise>
-    <!-- find the first line -->
-    <xsl:variable name="tmp" select="substring($normtxt,1,(($linelen)-9))" />
-    <xsl:variable name="line">
-     <xsl:choose>
-      <!-- if our attempt contains spaces wrap on that -->
-      <xsl:when test="contains($tmp,' ')">
-       <xsl:call-template name="find-line">
-        <xsl:with-param name="txt" select="$tmp" />
-       </xsl:call-template>
-      </xsl:when>
-      <!-- otherwise use the first non-space characters from the text -->
-      <xsl:otherwise>
-       <xsl:value-of select="substring-before($normtxt,' ')" />
-      </xsl:otherwise>
-     </xsl:choose>
-    </xsl:variable>
-    <!-- print line -->
-    <xsl:value-of select="$line" />
-    <!-- print newline and tab -->
-    <xsl:text>&newl;&tab;&space;&space;</xsl:text>
-    <!-- wrap the rest of the text -->
-    <xsl:call-template name="wrap">
-     <xsl:with-param name="txt" select="normalize-space(substring($normtxt,string-length($line)+1))" />
-    </xsl:call-template>
-   </xsl:otherwise>
-  </xsl:choose>
- </xsl:template>
+	<!-- string-wrapping template -->
+	<xsl:template name="wrap">
+		<xsl:param name="txt" />
+		<xsl:variable name="normtxt"
+			select="normalize-space($txt)" />
+		<xsl:choose>
+			<xsl:when test="contains($txt,'&newl;')">
+				<!-- text contains newlines, do the first line -->
+				<xsl:call-template name="wrap">
+					<xsl:with-param name="txt"
+						select="substring-before($txt,'&newl;')" />
+				</xsl:call-template>
+				<!-- print tab -->
+				<xsl:text>&tab;&space;&space;</xsl:text>
+				<!-- wrap the rest of the text -->
+				<xsl:call-template name="wrap">
+					<xsl:with-param name="txt"
+						select="substring-after($txt,'&newl;')" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when
+				test="(string-length($normtxt) &lt; (($linelen)-9)) or not(contains($normtxt,' '))">
+				<!-- this is easy, nothing to do -->
+				<xsl:value-of select="$normtxt" />
+				<!-- add newline -->
+				<xsl:text>&newl;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- find the first line -->
+				<xsl:variable name="tmp"
+					select="substring($normtxt,1,(($linelen)-9))" />
+				<xsl:variable name="line">
+					<xsl:choose>
+						<!-- if our attempt contains spaces wrap on that -->
+						<xsl:when test="contains($tmp,' ')">
+							<xsl:call-template name="find-line">
+								<xsl:with-param name="txt" select="$tmp" />
+							</xsl:call-template>
+						</xsl:when>
+						<!-- otherwise use the first non-space characters from the text -->
+						<xsl:otherwise>
+							<xsl:value-of
+								select="substring-before($normtxt,' ')" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<!-- print line -->
+				<xsl:value-of select="$line" />
+				<!-- print newline and tab -->
+				<xsl:text>&newl;&tab;&space;&space;</xsl:text>
+				<!-- wrap the rest of the text -->
+				<xsl:call-template name="wrap">
+					<xsl:with-param name="txt"
+						select="normalize-space(substring($normtxt,string-length($line)+1))" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
- <!-- template to trim line to contain space as last char -->
- <xsl:template name="find-line">
-  <xsl:param name="txt" />
-  <xsl:choose>
-   <xsl:when test="substring($txt,string-length($txt),1)=' '">
-    <xsl:value-of select="substring($txt,1,string-length($txt)-1)" />
-   </xsl:when>
-   <xsl:otherwise>
-    <xsl:call-template name="find-line">
-     <xsl:with-param name="txt" select="substring($txt,1,string-length($txt)-1)" />
-    </xsl:call-template>
-   </xsl:otherwise>
-  </xsl:choose>
- </xsl:template>
+	<!-- template to trim line to contain space as last char -->
+	<xsl:template name="find-line">
+		<xsl:param name="txt" />
+		<xsl:choose>
+			<xsl:when test="substring($txt,string-length($txt),1)=' '">
+				<xsl:value-of
+					select="substring($txt,1,string-length($txt)-1)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="find-line">
+					<xsl:with-param name="txt"
+						select="substring($txt,1,string-length($txt)-1)" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
- <!-- template to trim trailing and starting newlines -->
- <xsl:template name="trim-newln">
-  <xsl:param name="txt" />
-  <xsl:choose>
-   <!-- find starting newlines -->
-   <xsl:when test="substring($txt,1,1) = '&newl;'">
-    <xsl:call-template name="trim-newln">
-     <xsl:with-param name="txt" select="substring($txt,2)" />
-    </xsl:call-template>
-   </xsl:when>
-   <!-- find trailing newlines -->
-   <xsl:when test="substring($txt,string-length($txt),1) = '&newl;'">
-    <xsl:call-template name="trim-newln">
-     <xsl:with-param name="txt" select="substring($txt,1,string-length($txt)-1)" />
-    </xsl:call-template>
-   </xsl:when>
-   <!-- if the message has paragrapgs, find the first one -->
-   <xsl:when test="$reparagraph='yes' and contains($txt,'&newl;&newl;')">
-     <!-- remove newlines from first paragraph -->
-     <xsl:value-of select="normalize-space(substring-before($txt,'&newl;&newl;'))" />
-     <!-- paragraph separator -->
-     <xsl:text>&newl;&newl;</xsl:text>
-     <!-- do the rest of the text -->
-     <xsl:call-template name="trim-newln">
-      <xsl:with-param name="txt" select="substring-after($txt,'&newl;&newl;')" />
-     </xsl:call-template>
-   </xsl:when>
-   <!-- remove more single newlines -->
-   <xsl:when test="$reparagraph='yes'">
-    <xsl:value-of select="normalize-space($txt)" />
-   </xsl:when>
-   <!-- no newlines found, we're done -->
-   <xsl:otherwise>
-    <xsl:value-of select="$txt" />
-   </xsl:otherwise>
-  </xsl:choose>
- </xsl:template>
+	<!-- template to trim trailing and starting newlines -->
+	<xsl:template name="trim-newln">
+		<xsl:param name="txt" />
+		<xsl:choose>
+			<!-- find starting newlines -->
+			<xsl:when test="substring($txt,1,1) = '&newl;'">
+				<xsl:call-template name="trim-newln">
+					<xsl:with-param name="txt"
+						select="substring($txt,2)" />
+				</xsl:call-template>
+			</xsl:when>
+			<!-- find trailing newlines -->
+			<xsl:when
+				test="substring($txt,string-length($txt),1) = '&newl;'">
+				<xsl:call-template name="trim-newln">
+					<xsl:with-param name="txt"
+						select="substring($txt,1,string-length($txt)-1)" />
+				</xsl:call-template>
+			</xsl:when>
+			<!-- if the message has paragrapgs, find the first one -->
+			<xsl:when
+				test="$reparagraph='yes' and contains($txt,'&newl;&newl;')">
+				<!-- remove newlines from first paragraph -->
+				<xsl:value-of
+					select="normalize-space(substring-before($txt,'&newl;&newl;'))" />
+				<!-- paragraph separator -->
+				<xsl:text>&newl;&newl;</xsl:text>
+				<!-- do the rest of the text -->
+				<xsl:call-template name="trim-newln">
+					<xsl:with-param name="txt"
+						select="substring-after($txt,'&newl;&newl;')" />
+				</xsl:call-template>
+			</xsl:when>
+			<!-- remove more single newlines -->
+			<xsl:when test="$reparagraph='yes'">
+				<xsl:value-of select="normalize-space($txt)" />
+			</xsl:when>
+			<!-- no newlines found, we're done -->
+			<xsl:otherwise>
+				<xsl:value-of select="$txt" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
- <!-- insert a number of newlines -->
- <xsl:template name="newlines">
-  <xsl:param name="count" />
-  <xsl:text>&newl;</xsl:text>
-  <xsl:if test="$count&gt;1">
-   <xsl:call-template name="newlines">
-    <xsl:with-param name="count" select="($count)-1" />
-   </xsl:call-template>
-  </xsl:if>
- </xsl:template>
+	<!-- insert a number of newlines -->
+	<xsl:template name="newlines">
+		<xsl:param name="count" />
+		<xsl:text>&newl;</xsl:text>
+		<xsl:if test="$count&gt;1">
+			<xsl:call-template name="newlines">
+				<xsl:with-param name="count" select="($count)-1" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teifrantext-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teifrantext-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teifrantext-xmlw.xsl	(revision 2397)
@@ -1,92 +1,98 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xsl:import href="txm-filter-teip5-xmlw-preserve.xsl"/>
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de préparation des fichiers TEI de la Revue
-      Discours à l'importation TXM dans un format xml simple. 
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <!--<xsl:variable name="langue"><xsl:value-of select="lower-case(//tei:teiHeader[1]/tei:profileDesc[1]/tei:langUsage[1]/tei:language[1])"/></xsl:variable>-->
+	<xsl:import href="txm-filter-teip5-xmlw-preserve.xsl" />
 
-<!-- On injecte les mots clés dans la langue de l'article et on ne garde que l'abstract dans la langue de l'article -->
-  
-  <xsl:template match="text()">
-    <xsl:analyze-string select="." regex="&amp;lt;|&amp;gt;|&amp;|&lt;|&gt;|--|\*(\w+)">
-      <xsl:matching-substring>
-        <xsl:choose>
-          <xsl:when test="matches(.,'&amp;lt;')">
-            <xsl:text>‹</xsl:text>
-          </xsl:when>
-          <xsl:when test="matches(.,'&amp;gt;')">
-            <xsl:text>›</xsl:text>
-          </xsl:when>
-          <!--          <xsl:when test="matches(.,'&amp;')">
-            <!-\-<expan xmlns="http://www.tei-c.org/ns/1.0">and</expan>-\->
-          	<xsl:text>&amp;amp;</xsl:text>
-          </xsl:when>-->
-          <xsl:when test="matches(.,'&lt;')">
-            <xsl:text>‹</xsl:text>
-          </xsl:when>
-          <xsl:when test="matches(.,'&gt;')">
-            <xsl:text>›</xsl:text>
-          </xsl:when>
-          <!-- pose problème si se trouve dans les notes transformés en commentaires xml par le tokeniseur -->
-          <xsl:when test="matches(.,'--')">
-            <xsl:text> - </xsl:text>
-          </xsl:when>
-          <!-- spécial Frantext!!! -->
-          <xsl:when test="matches(.,'\*(\w+)')">
-            <w xmlns="http://www.tei-c.org/ns/1.0" type="maj"><xsl:value-of select="regex-group(1)"/></w>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="."/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>         
-        <xsl:value-of select="."/>
-      </xsl:non-matching-substring>      
-    </xsl:analyze-string>
-  </xsl:template>
-  
-  <xsl:template match="tei:text">
-    <xsl:copy>
-      <xsl:apply-templates/>
-    </xsl:copy>
-  </xsl:template>
-  
-<xsl:template match="tei:div">
-  <xsl:copy>
-    <xsl:attribute name="n"><xsl:value-of select="count(preceding-sibling::tei:div) + 1"/></xsl:attribute>
-    <xsl:apply-templates select="@*"/>
-    <xsl:apply-templates/>
-  </xsl:copy>
-</xsl:template>
-  
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de préparation des fichiers TEI de la Revue
+			Discours à l'importation TXM dans un format xml simple.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<!--<xsl:variable name="langue"><xsl:value-of select="lower-case(//tei:teiHeader[1]/tei:profileDesc[1]/tei:langUsage[1]/tei:language[1])"/></xsl:variable> -->
+
+	<!-- On injecte les mots clés dans la langue de l'article et on ne garde 
+		que l'abstract dans la langue de l'article -->
+
+	<xsl:template match="text()">
+		<xsl:analyze-string select="."
+			regex="&amp;lt;|&amp;gt;|&amp;|&lt;|&gt;|--|\*(\w+)">
+			<xsl:matching-substring>
+				<xsl:choose>
+					<xsl:when test="matches(.,'&amp;lt;')">
+						<xsl:text>‹</xsl:text>
+					</xsl:when>
+					<xsl:when test="matches(.,'&amp;gt;')">
+						<xsl:text>›</xsl:text>
+					</xsl:when>
+					<!-- <xsl:when test="matches(.,'&amp;')"> <!-\-<expan xmlns="http://www.tei-c.org/ns/1.0">and</expan>-\-> 
+						<xsl:text>&amp;amp;</xsl:text> </xsl:when> -->
+					<xsl:when test="matches(.,'&lt;')">
+						<xsl:text>‹</xsl:text>
+					</xsl:when>
+					<xsl:when test="matches(.,'&gt;')">
+						<xsl:text>›</xsl:text>
+					</xsl:when>
+					<!-- pose problème si se trouve dans les notes transformés en commentaires 
+						xml par le tokeniseur -->
+					<xsl:when test="matches(.,'--')">
+						<xsl:text> - </xsl:text>
+					</xsl:when>
+					<!-- spécial Frantext!!! -->
+					<xsl:when test="matches(.,'\*(\w+)')">
+						<w xmlns="http://www.tei-c.org/ns/1.0" type="maj">
+							<xsl:value-of select="regex-group(1)" />
+						</w>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:value-of select="." />
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
+
+	<xsl:template match="tei:text">
+		<xsl:copy>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="tei:div">
+		<xsl:copy>
+			<xsl:attribute name="n"><xsl:value-of
+				select="count(preceding-sibling::tei:div) + 1" /></xsl:attribute>
+			<xsl:apply-templates select="@*" />
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-unbreakWords.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-unbreakWords.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-unbreakWords.xsl	(revision 2397)
@@ -1,80 +1,91 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:txm="http://textometrie.org/ns/1.0"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  exclude-result-prefixes="tei edate" xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/ns/1.0"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	exclude-result-prefixes="tei edate"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
 
 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet is designed for TXM XTZ+CSV import module to re-unite 
-      word tokens separated by lb, cb and pb tags bearing @break="no" 
-      attribute. This stylesheet should be used at "3-posttok" step.
-      All the tags separating the beginning and the end of a word must have 
-      a @break='no' and their number must not exceed 3 in each case.
-      See TXM User Manual for more details 
-      (http://textometrie.ens-lyon.fr/spip.php?rubrique64)
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
-  </xd:doc>
-       
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet is designed for TXM XTZ+CSV import module to re-unite
+			word tokens separated by lb, cb and pb tags bearing @break="no"
+			attribute. This stylesheet should be used at "3-posttok" step.
+			All the tags separating the beginning and the end of a word must have
+			a @break='no' and their number must not exceed 3 in each case.
+			See TXM User Manual for more details
+			(http://textometrie.ens-lyon.fr/spip.php?rubrique64)
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> 
-  
-  
-  <!-- General patterns: all elements, attributes, comments and processing instructions are copied -->
-  
-  <xsl:template match="*">      
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>    
-  </xsl:template>
-  
-  <xsl:template match="*" mode="position"><xsl:value-of select="count(preceding-sibling::*)"/></xsl:template>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
-  <xsl:template match="@*|comment()|processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
+	</xd:doc>
 
-<xsl:template match="*:w">
-  <xsl:choose>
-    <xsl:when test="following-sibling::*[1][@break='no']">
-      <xsl:copy>
-        <xsl:apply-templates select="@*"/>
-        <xsl:apply-templates/>
-        <xsl:copy-of select="following-sibling::*[position() lt 4][@break='no']"/>
-        <xsl:apply-templates select="following-sibling::w[1]/node()"/>
-      </xsl:copy>
-    </xsl:when>
-    <xsl:when test="preceding-sibling::*[1][@break='no']">
-      <!--Word ending agglutinated to the previous word-->
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:copy>
-        <xsl:apply-templates select="@*"/>
-        <xsl:apply-templates/>
-      </xsl:copy>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
 
-<xsl:template match="*[@break='no']"/>
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
 
 
+	<!-- General patterns: all elements, attributes, comments and processing 
+		instructions are copied -->
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="*" mode="position">
+		<xsl:value-of select="count(preceding-sibling::*)" />
+	</xsl:template>
+
+	<xsl:template
+		match="@*|comment()|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:template match="*:w">
+		<xsl:choose>
+			<xsl:when test="following-sibling::*[1][@break='no']">
+				<xsl:copy>
+					<xsl:apply-templates select="@*" />
+					<xsl:apply-templates />
+					<xsl:copy-of
+						select="following-sibling::*[position() lt 4][@break='no']" />
+					<xsl:apply-templates
+						select="following-sibling::w[1]/node()" />
+				</xsl:copy>
+			</xsl:when>
+			<xsl:when test="preceding-sibling::*[1][@break='no']">
+				<!--Word ending agglutinated to the previous word -->
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates select="@*" />
+					<xsl:apply-templates />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="*[@break='no']" />
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-split-xces-ids-corpus2text.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-split-xces-ids-corpus2text.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-split-xces-ids-corpus2text.xsl	(revision 2397)
@@ -1,63 +1,67 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet transforms a single file of a XCES-IDS corpus into as 
-      many files as separate texts for TXM XTZ import module
-      For more details on source corpus encoding schema see 
-      http://www1.ids-mannheim.de/kl/projekte/korpora/textmodell.html
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2018, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
-  </xd:doc>
-  
-  <!-- Whenever you match any node or any attribute -->
-  <xsl:template match="node()|@*">
-    <!-- Copy the current node -->
-    <xsl:copy>
-      <!-- Including any attributes it has and any child nodes -->
-      <xsl:apply-templates select="@*|node()"/>
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:param name="output-directory">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/.]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(1)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:param>
-  
-  <xsl:template match="/">
-    <note>Empty output. The content is transferred into result-documents</note>
-    <xsl:for-each select="descendant::idsText">
-      <xsl:variable name="filename">
-        <xsl:value-of select="substring-after(idsHeader//textSigle,'MK2')"/>
-      </xsl:variable>
-      <xsl:result-document href="{$output-directory}/{$filename}.xml">
-        <TEI>
-          <xsl:apply-templates/>
-        </TEI>
-      </xsl:result-document>
-    </xsl:for-each>
-  </xsl:template>
-  
-  
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc">
+
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet transforms a single file of a XCES-IDS corpus into as
+			many files as separate texts for TXM XTZ import module
+			For more details on source corpus encoding schema see
+			http://www1.ids-mannheim.de/kl/projekte/korpora/textmodell.html
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2018, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
+	</xd:doc>
+
+	<!-- Whenever you match any node or any attribute -->
+	<xsl:template match="node()|@*">
+		<!-- Copy the current node -->
+		<xsl:copy>
+			<!-- Including any attributes it has and any child nodes -->
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:param name="output-directory">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/.]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(1)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:param>
+
+	<xsl:template match="/">
+		<note>Empty output. The content is transferred into result-documents</note>
+		<xsl:for-each select="descendant::idsText">
+			<xsl:variable name="filename">
+				<xsl:value-of
+					select="substring-after(idsHeader//textSigle,'MK2')" />
+			</xsl:variable>
+			<xsl:result-document
+				href="{$output-directory}/{$filename}.xml">
+				<TEI>
+					<xsl:apply-templates />
+				</TEI>
+			</xsl:result-document>
+		</xsl:for-each>
+	</xsl:template>
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_syllabes.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_syllabes.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_syllabes.xsl	(revision 2397)
@@ -1,108 +1,151 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
- version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Cette feuille de style permet de préparer les transcriptions de tablettes
-      d'argile (projet UMR PROCLAC) à l'import XML/W + CSV de TXM en tokenisant
-      le corpus au niveau des syllabes.
-      Les propriétés de mots sont projetées vers les propriétés des syllabes (line,
-      lemma, pos).
-      Les propriétés unclear et supplied prennent la valeur "yes" si la syllabe se
-      trouve à l'intérieur de la balise correspondante.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev, alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2014-2015, CNRS / ICAR (équipe CACTUS)</xd:copyright>
-  </xd:doc>
-  
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <xsl:template match="*">
-  	<xsl:copy>
-  		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>	
-  	</xsl:copy>
-  </xsl:template>
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc" version="2.0">
 
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
-	
-	<xsl:template match="processing-instruction()"/>
-  
-  <xsl:template match="*[local-name()='teiHeader']"/>
-  
-  <xsl:template match="*[local-name()='w']//text()">
-    <xsl:variable name="line"><xsl:value-of select="ancestor::*[local-name()='w']/@line"/></xsl:variable>
-    <xsl:variable name="lemma"><xsl:value-of select="ancestor::*[local-name()='w']/@lemma"/></xsl:variable>
-    <xsl:variable name="pos"><xsl:value-of select="ancestor::*[local-name()='w']/@pos"/></xsl:variable>
-    <xsl:variable name="word-form"><xsl:value-of select="ancestor::*[local-name()='w']"/></xsl:variable>
-    <xsl:variable name="unclear">
-      <xsl:choose>
-        <xsl:when test="ancestor::*[local-name()='unclear']">yes</xsl:when>
-        <xsl:otherwise>no</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="supplied">
-      <xsl:choose>
-        <xsl:when test="ancestor::*[local-name()='supplied']">yes</xsl:when>
-        <xsl:otherwise>no</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    
-    <xsl:analyze-string select="." regex="[-.]|\([^\)]*\)">
-      <xsl:matching-substring>
-        <w line="{$line}" lemma="{$lemma}" pos="{$pos}" word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}"><xsl:value-of select="."/></w>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>
-        <w line="{$line}" lemma="{$lemma}" pos="{$pos}" word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}"><xsl:value-of select="."/></w>
-      </xsl:non-matching-substring>
-    </xsl:analyze-string>    
-  </xsl:template>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Cette feuille de style permet de préparer les transcriptions de tablettes
+			d'argile (projet UMR PROCLAC) à l'import XML/W + CSV de TXM en
+			tokenisant
+			le corpus au niveau des syllabes.
+			Les propriétés de mots sont projetées vers les propriétés des syllabes
+			(line,
+			lemma, pos).
+			Les propriétés unclear et supplied prennent la valeur "yes" si la
+			syllabe se
+			trouve à l'intérieur de la balise correspondante.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-<xsl:template match="text()[not(ancestor::*[local-name()='w'])]">
-  <xsl:analyze-string select="." regex="\[…\]">
-    <xsl:matching-substring>
-      <w line="¤" lemma="¤" pos="¤" word-form="¤" supplied="¤" unclear="¤"><xsl:value-of select="."/></w>
-    </xsl:matching-substring>
-    <xsl:non-matching-substring><xsl:comment><xsl:copy-of select="."/></xsl:comment></xsl:non-matching-substring>
-  </xsl:analyze-string>
-</xsl:template>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
-  <xsl:template match="*[local-name()='w']">
-  <word>
-    <xsl:apply-templates select="@*"/>
-    <xsl:attribute name="no-supplied">
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev, alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2014-2015, CNRS / ICAR (équipe CACTUS)</xd:copyright>
+	</xd:doc>
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:template match="processing-instruction()" />
+
+	<xsl:template match="*[local-name()='teiHeader']" />
+
+	<xsl:template match="*[local-name()='w']//text()">
+		<xsl:variable name="line">
+			<xsl:value-of
+				select="ancestor::*[local-name()='w']/@line" />
+		</xsl:variable>
+		<xsl:variable name="lemma">
+			<xsl:value-of
+				select="ancestor::*[local-name()='w']/@lemma" />
+		</xsl:variable>
+		<xsl:variable name="pos">
+			<xsl:value-of
+				select="ancestor::*[local-name()='w']/@pos" />
+		</xsl:variable>
+		<xsl:variable name="word-form">
+			<xsl:value-of select="ancestor::*[local-name()='w']" />
+		</xsl:variable>
+		<xsl:variable name="unclear">
+			<xsl:choose>
+				<xsl:when test="ancestor::*[local-name()='unclear']">
+					yes
+				</xsl:when>
+				<xsl:otherwise>
+					no
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="supplied">
+			<xsl:choose>
+				<xsl:when test="ancestor::*[local-name()='supplied']">
+					yes
+				</xsl:when>
+				<xsl:otherwise>
+					no
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+
+		<xsl:analyze-string select="."
+			regex="[-.]|\([^\)]*\)">
+			<xsl:matching-substring>
+				<w line="{$line}" lemma="{$lemma}" pos="{$pos}"
+					word-form="{$word-form}" supplied="{$supplied}"
+					unclear="{$unclear}">
+					<xsl:value-of select="." />
+				</w>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<w line="{$line}" lemma="{$lemma}" pos="{$pos}"
+					word-form="{$word-form}" supplied="{$supplied}"
+					unclear="{$unclear}">
+					<xsl:value-of select="." />
+				</w>
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
+
+	<xsl:template
+		match="text()[not(ancestor::*[local-name()='w'])]">
+		<xsl:analyze-string select="." regex="\[…\]">
+			<xsl:matching-substring>
+				<w line="¤" lemma="¤" pos="¤" word-form="¤" supplied="¤"
+					unclear="¤">
+					<xsl:value-of select="." />
+				</w>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:comment>
+					<xsl:copy-of select="." />
+				</xsl:comment>
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
+
+	<xsl:template match="*[local-name()='w']">
+		<word>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="no-supplied">
       <xsl:choose>
         <xsl:when test="ancestor::*[local-name()='supplied']">¤</xsl:when>
-        <xsl:otherwise><xsl:apply-templates mode="nosupplied"/></xsl:otherwise>
+        <xsl:otherwise><xsl:apply-templates
+				mode="nosupplied" /></xsl:otherwise>
       </xsl:choose>
     </xsl:attribute>
-    <xsl:attribute name="no-unclear">
+			<xsl:attribute name="no-unclear">
       <xsl:choose>
-        <xsl:when test="ancestor::*[local-name()='supplied'] or ancestor::*[local-name()='unclear']">¤</xsl:when>
-        <xsl:otherwise><xsl:apply-templates mode="nounclear"/></xsl:otherwise>
+        <xsl:when
+				test="ancestor::*[local-name()='supplied'] or ancestor::*[local-name()='unclear']">¤</xsl:when>
+        <xsl:otherwise><xsl:apply-templates
+				mode="nounclear" /></xsl:otherwise>
       </xsl:choose>
-    </xsl:attribute>    
-    <xsl:apply-templates/>
-  </word>
-</xsl:template>
+    </xsl:attribute>
+			<xsl:apply-templates />
+		</word>
+	</xsl:template>
 
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-perseustreebank-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-perseustreebank-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-perseustreebank-xmlw.xsl	(revision 2397)
@@ -1,73 +1,85 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-  xmlns:treebank="http://nlp.perseus.tufts.edu/syntax/treebank/1.5"
-  exclude-result-prefixes="edate xd xsi treebank" version="2.0">
-  
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      A stylesheet to prepare PERSEUS Treebank XML texts to TXM XML/w import.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:treebank="http://nlp.perseus.tufts.edu/syntax/treebank/1.5"
+	exclude-result-prefixes="edate xd xsi treebank" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <xsl:template match="*">
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>	
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
-  
-  <xsl:template match="processing-instruction()"/>
-  
-  <xsl:template match="text()"><xsl:value-of select="."/></xsl:template>
-  
-<xsl:template match="treebank">
-  <text type="treebank" version="{@version}" date="{normalize-space(child::date[1])}" annotator-short="{normalize-space(child::annotator[1]/short)}" annotator-name="{normalize-space(child::annotator[1]/name)}" annotator-address="{normalize-space(child::annotator[1]/address)}">
-    <xsl:apply-templates select="descendant::sentence"/>
-  </text>
-</xsl:template>
 
-<xsl:template match="annotator"/>
-  
-<xsl:template match="sentence">
-  <xsl:copy>
-    <xsl:apply-templates select="@*"/>
-    <xsl:attribute name="annotator"><xsl:value-of select="child::annotator"/></xsl:attribute>
-    <xsl:apply-templates/>
-  </xsl:copy>
-</xsl:template>
-  
-  <xsl:template match="word">
-    <w>
-      <xsl:apply-templates select="@*[not(name()='form')]"/>
-      <xsl:value-of select="@form"></xsl:value-of>
-    </w>
-  </xsl:template>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			A stylesheet to prepare PERSEUS Treebank XML texts to TXM XML/w
+			import.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:template match="processing-instruction()" />
+
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template match="treebank">
+		<text type="treebank" version="{@version}"
+			date="{normalize-space(child::date[1])}"
+			annotator-short="{normalize-space(child::annotator[1]/short)}"
+			annotator-name="{normalize-space(child::annotator[1]/name)}"
+			annotator-address="{normalize-space(child::annotator[1]/address)}">
+			<xsl:apply-templates
+				select="descendant::sentence" />
+		</text>
+	</xsl:template>
+
+	<xsl:template match="annotator" />
+
+	<xsl:template match="sentence">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="annotator"><xsl:value-of
+				select="child::annotator" /></xsl:attribute>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="word">
+		<w>
+			<xsl:apply-templates
+				select="@*[not(name()='form')]" />
+			<xsl:value-of select="@form"></xsl:value-of>
+		</w>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz-corpusakkadien-translit.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz-corpusakkadien-translit.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz-corpusakkadien-translit.xsl	(revision 2397)
@@ -1,204 +1,289 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:txm="http://textometrie.org/1.0"
-	exclude-result-prefixes="#all" version="2.0">
-	
-	<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
-	
-	<xsl:strip-space elements="*"/>
-	
-	<xsl:param name="editionpagetag">pb</xsl:param>
-	
-	<xsl:param name="textcontainer">text</xsl:param>
-	
-	<!--<xsl:param name="frontmatter"></xsl:param>
-	
-	<xsl:param name="backmatter">back</xsl:param>-->
-	
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/1.0" exclude-result-prefixes="#all"
+	version="2.0">
+
+	<xsl:output method="xml" encoding="UTF-8"
+		omit-xml-declaration="no" indent="no"
+		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
+
+	<xsl:strip-space elements="*" />
+
+	<xsl:param name="editionpagetag">
+		pb
+	</xsl:param>
+
+	<xsl:param name="textcontainer">
+		text
+	</xsl:param>
+
+	<!--<xsl:param name="frontmatter"></xsl:param> <xsl:param name="backmatter">back</xsl:param> -->
+
 	<xsl:variable name="inputtype">
 		<xsl:choose>
-			<xsl:when test="//tei:w//txm:form">xmltxm</xsl:when>
-			<xsl:otherwise>xmlw</xsl:otherwise>
+			<xsl:when test="//tei:w//txm:form">
+				xmltxm
+			</xsl:when>
+			<xsl:otherwise>
+				xmlw
+			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:variable>
-	
+
 	<xsl:template match="/">
 		<html>
 			<head>
-				<title><xsl:value-of select="//tei:text[1]/@id"/></title>
-				<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+				<title>
+					<xsl:value-of select="//tei:text[1]/@id" />
+				</title>
+				<meta http-equiv="Content-Type"
+					content="text/html;charset=UTF-8" />
 			</head>
 			<body>
-				<a class="txm-page" title="1"/>
+				<a class="txm-page" title="1" />
 				<div class="metadata-page">
-					<h1><xsl:value-of select="//tei:text[1]/@id"></xsl:value-of></h1>
-					<br/>
+					<h1>
+						<xsl:value-of select="//tei:text[1]/@id"></xsl:value-of>
+					</h1>
+					<br />
 					<table>
 						<xsl:for-each select="//tei:text[1]/@*">
 							<tr>
-								<td><xsl:value-of select="name()"/></td>
-								<td><xsl:value-of select="."/></td>
+								<td>
+									<xsl:value-of select="name()" />
+								</td>
+								<td>
+									<xsl:value-of select="." />
+								</td>
 							</tr>
 						</xsl:for-each>
 					</table>
-					<br/>
-					<br/>
+					<br />
+					<br />
 				</div>
-				<xsl:apply-templates select="descendant::*[local-name()=$textcontainer]"/>
-				
-				
+				<xsl:apply-templates
+					select="descendant::*[local-name()=$textcontainer]" />
+
+
 			</body>
 		</html>
 	</xsl:template>
-	
+
 	<xsl:template match="//*[local-name()=$textcontainer]">
 		<xsl:variable name="pbcount"></xsl:variable>
-		
+
 		<div class="text" style="margin-left:60px;">
-			<xsl:apply-templates/>
+			<xsl:apply-templates />
 		</div>
 	</xsl:template>
-	
-		
-	
+
+
+
 	<xsl:template match="*">
 		<xsl:choose>
 			<xsl:when test="descendant::tei:p|descendant::tei:ab">
 				<div>
-					<xsl:call-template name="addClass"/>
-					<xsl:apply-templates/></div>
+					<xsl:call-template name="addClass" />
+					<xsl:apply-templates />
+				</div>
 				<xsl:text>&#xa;</xsl:text>
 			</xsl:when>
-			<xsl:otherwise><span>
-				<xsl:call-template name="addClass"/>
-				<xsl:if test="self::tei:add[@del]">
-					<xsl:attribute name="title"><xsl:value-of select="@del"/></xsl:attribute>
-				</xsl:if>
-				<xsl:apply-templates/></span>
+			<xsl:otherwise>
+				<span>
+					<xsl:call-template name="addClass" />
+					<xsl:if test="self::tei:add[@del]">
+						<xsl:attribute name="title"><xsl:value-of
+							select="@del" /></xsl:attribute>
+					</xsl:if>
+					<xsl:apply-templates />
+				</span>
 			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:template>
-	
-	<xsl:template match="@*|processing-instruction()|comment()">
 
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+
 	</xsl:template>
-	
+
 	<xsl:template match="text()">
-		<xsl:value-of select="normalize-space(.)"/>
+		<xsl:value-of select="normalize-space(.)" />
 	</xsl:template>
-	
+
 	<xsl:template name="addClass">
 		<xsl:attribute name="class">
-			<xsl:value-of select="local-name(.)"/>
-			<xsl:if test="@type"><xsl:value-of select="concat('-',@type)"/></xsl:if>
-			<xsl:if test="@subtype"><xsl:value-of select="concat('-',@subtype)"/></xsl:if>
-			<xsl:if test="@rend"><xsl:value-of select="concat('-',@rend)"/></xsl:if>
-		</xsl:attribute>                	
+			<xsl:value-of select="local-name(.)" />
+			<xsl:if test="@type"><xsl:value-of
+			select="concat('-',@type)" /></xsl:if>
+			<xsl:if test="@subtype"><xsl:value-of
+			select="concat('-',@subtype)" /></xsl:if>
+			<xsl:if test="@rend"><xsl:value-of
+			select="concat('-',@rend)" /></xsl:if>
+		</xsl:attribute>
 	</xsl:template>
-	
 
-	
+
+
 	<xsl:template match="//word">
 		<xsl:choose>
-			<xsl:when test="@line = preceding::word[1]/@line"><xsl:text> </xsl:text></xsl:when>
-			<xsl:otherwise><br/><xsl:text>&#xa;</xsl:text><span style="position:relative"><span class="linenumber" style="position:absolute;width:40px;left:-50px;padding-right:20px;text-align:right"><xsl:value-of select="@line"/>&#xa0;</span></span></xsl:otherwise>
+			<xsl:when test="@line = preceding::word[1]/@line">
+				<xsl:text> </xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<br />
+				<xsl:text>&#xa;</xsl:text>
+				<span style="position:relative">
+					<span class="linenumber"
+						style="position:absolute;width:40px;left:-50px;padding-right:20px;text-align:right">
+						<xsl:value-of select="@line" />
+						&#xa0;
+					</span>
+				</span>
+			</xsl:otherwise>
 		</xsl:choose>
 		<span>
-			<xsl:call-template name="addClass"/>
-			<xsl:apply-templates/>
+			<xsl:call-template name="addClass" />
+			<xsl:apply-templates />
 		</span>
 	</xsl:template>
-	
-	
-	
-	<!-- Page breaks -->                
+
+
+
+	<!-- Page breaks -->
 	<xsl:template match="//*[local-name()=$editionpagetag]">
 		<xsl:variable name="editionpagetype">
 			<xsl:choose>
-				<xsl:when test="ancestor::tei:ab">editionpageverse</xsl:when>
-				<xsl:otherwise>editionpage</xsl:otherwise>
+				<xsl:when test="ancestor::tei:ab">
+					editionpageverse
+				</xsl:when>
+				<xsl:otherwise>
+					editionpage
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
 		<xsl:variable name="pagenumber">
 			<xsl:choose>
-				<xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when>
-				<xsl:when test="@facs"><xsl:value-of select="substring-before(@facs,'.')"/></xsl:when>
-				<xsl:otherwise>[NN]</xsl:otherwise>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:when test="@facs">
+					<xsl:value-of select="substring-before(@facs,'.')" />
+				</xsl:when>
+				<xsl:otherwise>
+					[NN]
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		
-		<xsl:variable name="page_id"><xsl:value-of select="count(preceding::*[local-name()=$editionpagetag])"/></xsl:variable>
-		<xsl:if test="@break='no'"><span class="hyphen">-</span></xsl:if>
-		<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
+
+		<xsl:variable name="page_id">
+			<xsl:value-of
+				select="count(preceding::*[local-name()=$editionpagetag])" />
+		</xsl:variable>
+		<xsl:if test="@break='no'">
+			<span class="hyphen">-</span>
+		</xsl:if>
+		<xsl:if
+			test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
 			<xsl:text>&#xa;</xsl:text>
-			<br/>
-			<br/>			
+			<br />
+			<br />
 			<span class="footnotes">
-				<xsl:for-each select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
-					<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) + 1"/></xsl:variable>
-					<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-->
+				<xsl:for-each
+					select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
+					<xsl:variable name="note_count">
+						<xsl:value-of
+							select="count(preceding::tei:note[not(@place='inline')]) + 1" />
+					</xsl:variable>
+					<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" 
+						name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, 
+						l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> 
+						<xsl:value-of select="."/></p> -->
 					<span class="note">
-						<span class="footnotenumber"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
-						<xsl:apply-templates mode="#current"/>
-					</span>                                                                
-				</xsl:for-each></span><xsl:text>&#xa;</xsl:text>                                                                
-			
-		</xsl:if>                                
-		
+						<span class="footnotenumber">
+							<a href="#noteref_{$note_count}" name="note_{$note_count}">
+								<xsl:value-of select="$note_count" />
+							</a>
+							.
+						</span>
+						<xsl:apply-templates mode="#current" />
+					</span>
+				</xsl:for-each>
+			</span>
+			<xsl:text>&#xa;</xsl:text>
+
+		</xsl:if>
+
 		<xsl:text>&#xa;</xsl:text>
-		<br/><xsl:text>&#xa;</xsl:text>
-		<a class="txm-page" title="{count(preceding::*[local-name()=$editionpagetag]) + 2}"/>
-		<span class="{$editionpagetype}"> - <xsl:value-of select="$pagenumber"/> - </span><br/><xsl:text>&#xa;</xsl:text>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
+		<a class="txm-page"
+			title="{count(preceding::*[local-name()=$editionpagetag]) + 2}" />
+		<span class="{$editionpagetype}">
+			-
+			<xsl:value-of select="$pagenumber" />
+			-
+		</span>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
 	</xsl:template>
-	
+
 	<!-- Notes -->
-<!--	<xsl:template match="tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]">
-		<!-\-<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] </span>-\->	
-		<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]) + 1"/></xsl:variable>
-		<a title="{.}" class="noteref" href="#note_{$note_count}" name="noteref_{$note_count}">[<xsl:value-of select="$note_count"/>]</a>
-		<xsl:call-template name="spacing"/>                                
-	</xsl:template>
--->	
-	
-	<xsl:template match="//w"><span class="w">
-		<xsl:if test="@id">
-			<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
-		</xsl:if>
-		<xsl:attribute name="title">
+	<!-- <xsl:template match="tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]"> 
+		<!-\-<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] </span>-\-> 
+		<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline') 
+		and not(matches(@type,'intern|auto'))]) + 1"/></xsl:variable> <a title="{.}" 
+		class="noteref" href="#note_{$note_count}" name="noteref_{$note_count}">[<xsl:value-of 
+		select="$note_count"/>]</a> <xsl:call-template name="spacing"/> </xsl:template> -->
+
+	<xsl:template match="//w">
+		<span class="w">
+			<xsl:if test="@id">
+				<xsl:attribute name="id"><xsl:value-of
+					select="@id" /></xsl:attribute>
+			</xsl:if>
+			<xsl:attribute name="title">
 			<xsl:choose>
 				<xsl:when test="descendant::txm:ana">
 					<xsl:for-each select="descendant::txm:ana">
-						<xsl:value-of select="concat(substring(@type,2),': ',.,' ; ')"/>				
+						<xsl:value-of
+				select="concat(substring(@type,2),': ',.,' ; ')" />				
 					</xsl:for-each>
-					<xsl:value-of select="concat('translit : ',descendant::txm:form)"/>
+					<xsl:value-of
+				select="concat('translit : ',descendant::txm:form)" />
 				</xsl:when>
 				<xsl:otherwise>
 					<xsl:for-each select="@*">
-						<xsl:value-of select="concat(name(),': ',.,' ; ')"/>				
+						<xsl:value-of select="concat(name(),': ',.,' ; ')" />				
 					</xsl:for-each>
-					<xsl:value-of select="concat('translit : ',.)"/>
+					<xsl:value-of select="concat('translit : ',.)" />
 				</xsl:otherwise>
 			</xsl:choose>
 
 		</xsl:attribute>
-		<xsl:choose>
-			<xsl:when test="descendant::txm:form">
-				<xsl:apply-templates select="txm:form"/>
-			</xsl:when>
-			<xsl:otherwise>
-				<xsl:value-of select="."/>
-			</xsl:otherwise>
-		</xsl:choose>
-		
-	</span>
-		<xsl:if test="following-sibling::w">-</xsl:if>
+			<xsl:choose>
+				<xsl:when test="descendant::txm:form">
+					<xsl:apply-templates select="txm:form" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+
+		</span>
+		<xsl:if test="following-sibling::w">
+			-
+		</xsl:if>
 	</xsl:template>
-	
-	
-	                <xsl:template match="//txm:form">
-	                		<xsl:value-of select="."/>
-                </xsl:template>
-                
-	
-	
+
+
+	<xsl:template match="//txm:form">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-teibfm.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-teibfm.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teip5-teibfm.xsl	(revision 2397)
@@ -1,72 +1,65 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de préparation de fichiers TEI P5 à l'importation 
-      dans TXM. Permet de simplifier la structure du document afin
-      d'optimiser les index CWB
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <!--
-    Modifications par AL le  2012-01-25
-    g dépalacé de "deleteAll" vers "deleteTag"
-    classe de balise "name" créée
-    (geogName, placeName, persName et name)
-  -->
-  
-  <!-- 
-    Modifications par LBe le 2012-02-17
-    Transformation automatique des esperluettes dans les métadonnées
-    Suppression des balises label et heraldry
-    Signed n'est plus transformé en ab
-    opener est transformé en ab
-    L'institution et le dépôt sont récupérés pour le lieu de conservation
-  -->
-  
-  <!-- Modifications par AL le 2012-02-20
-    rolename -> roleName
-    suppression des balises surname et forename
-  -->
-  
-  <!-- Modifications par LBe le 2012-03-09
-    Automatisation du nommage des sorties
-  -->
-  
-  <!-- Listes des balises par type de traitement (les templates sont plus bas) -->
-  
-  <!-- balises à supprimer avec leur contenu -->
-  <xsl:template match="tei:figDesc|tei:figure|tei:fw|tei:g
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de préparation de fichiers TEI P5 à l'importation
+			dans TXM. Permet de simplifier la structure du document afin
+			d'optimiser les index CWB
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<!-- Modifications par AL le 2012-01-25 g dépalacé de "deleteAll" vers "deleteTag" 
+		classe de balise "name" créée (geogName, placeName, persName et name) -->
+
+	<!-- Modifications par LBe le 2012-02-17 Transformation automatique des 
+		esperluettes dans les métadonnées Suppression des balises label et heraldry 
+		Signed n'est plus transformé en ab opener est transformé en ab L'institution 
+		et le dépôt sont récupérés pour le lieu de conservation -->
+
+	<!-- Modifications par AL le 2012-02-20 rolename -> roleName suppression 
+		des balises surname et forename -->
+
+	<!-- Modifications par LBe le 2012-03-09 Automatisation du nommage des sorties -->
+
+	<!-- Listes des balises par type de traitement (les templates sont plus 
+		bas) -->
+
+	<!-- balises à supprimer avec leur contenu -->
+	<xsl:template
+		match="tei:figDesc|tei:figure|tei:fw|tei:g
     |tei:space|tei:titlePage ">
-    <xsl:call-template name="deleteAll"/>
-  </xsl:template>
-  
-  <!-- balises à supprimer, contenu à conserver -->  
-  <xsl:template match="tei:add|tei:app
+		<xsl:call-template name="deleteAll" />
+	</xsl:template>
+
+	<!-- balises à supprimer, contenu à conserver -->
+	<xsl:template
+		match="tei:add|tei:app
     |tei:caesura|tei:castItem|tei:castGroup[ancestor::tei:castList]
     |tei:castList[ancestor::tei:p]|tei:cell|tei:choice|tei:cit|tei:corr|tei:date|tei:ex
     |tei:forename|tei:g|tei:head[parent::tei:list]|tei:heraldry|tei:hi|tei:item|tei:label|tei:lem
@@ -75,291 +68,328 @@
     |tei:ref|tei:reg|tei:role|tei:roleDesc
     |tei:row|tei:salute|tei:signed[ancestor::tei:closer]|tei:speaker|tei:stage[ancestor::tei:p|ancestor::tei:ab]
     |tei:surname|tei:table[ancestor::tei:p]|tei:subst|tei:term|tei:unclear">
-    <xsl:call-template name="deleteTag"/>
-  </xsl:template>
-  
-  <!-- balises à transformer en notes-->
-  <xsl:template match="tei:abbr[parent::tei:choice and not(ancestor::tei:note)]
+		<xsl:call-template name="deleteTag" />
+	</xsl:template>
+
+	<!-- balises à transformer en notes -->
+	<xsl:template
+		match="tei:abbr[parent::tei:choice and not(ancestor::tei:note)]
     |tei:bibl[not(ancestor::tei:note)]
     |tei:del
     |tei:orig[parent::tei:choice and not(ancestor::tei:note)]    
     |tei:rdg[parent::tei:app and not(ancestor::tei:note)]
     |tei:sic[parent::tei:choice and not(ancestor::tei:note)]
     |tei:surplus[not(ancestor::tei:w)]">
-    <xsl:call-template name="makeNote"/>
-  </xsl:template>
-  
-  <!-- balises de noms à indexer -->
-  
-  <xsl:template match="tei:name
+		<xsl:call-template name="makeNote" />
+	</xsl:template>
+
+	<!-- balises de noms à indexer -->
+
+	<xsl:template
+		match="tei:name
     |tei:geogName
     |tei:persName
     |tei:placeName
     |tei:roleName
     |tei:orgName">
-    <xsl:call-template name="makeName"/>
-  </xsl:template>
-  
-  <!-- à transformer en W -->
-  
-  <xsl:template match="tei:abbr[not(parent::tei:choice)]
+		<xsl:call-template name="makeName" />
+	</xsl:template>
+
+	<!-- à transformer en W -->
+
+	<xsl:template
+		match="tei:abbr[not(parent::tei:choice)]
     |tei:expan
     |tei:num[matches(.,'.')]">
-    <xsl:call-template name="makeWord"/>
-  </xsl:template>
-  
-  <!-- à transformer en AB typé -->
-  
-  <xsl:template match="tei:byline|tei:lg[not(child::tei:lg or ancestor::tei:sp)]|tei:list[not(ancestor::tei:p|ancestor::tei:ab)]
+		<xsl:call-template name="makeWord" />
+	</xsl:template>
+
+	<!-- à transformer en AB typé -->
+
+	<xsl:template
+		match="tei:byline|tei:lg[not(child::tei:lg or ancestor::tei:sp)]|tei:list[not(ancestor::tei:p|ancestor::tei:ab)]
     |tei:closer|tei:opener|tei:sp|tei:castGroup[not(ancestor::tei:castList)]|tei:castList[not(ancestor::tei:p)]
     |tei:signed[not(ancestor::tei:closer)]
     |tei:stage[not(ancestor::tei:p|ancestor::tei:ab)]
     |tei:table[not(ancestor::tei:p)]
     |tei:trailer">
-    <xsl:call-template name="makeAb"/>
-  </xsl:template>
-  
-  <!-- à transformer en DIV typé -->
-  
-  <xsl:template match="tei:set">
-    <xsl:call-template name="makeDiv"/>
-  </xsl:template>
+		<xsl:call-template name="makeAb" />
+	</xsl:template>
 
-<!-- Partie générale : on copie les éléments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
+	<!-- à transformer en DIV typé -->
 
-<!--  <xsl:template match="/">
-      <xsl:apply-templates/>  
-  </xsl:template>
--->
-  
-  <xsl:template match="*">    
-    <xsl:choose>
-      <xsl:when test="namespace-uri()=''">
-        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>  
-  </xsl:template>
+	<xsl:template match="tei:set">
+		<xsl:call-template name="makeDiv" />
+	</xsl:template>
 
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
+	<!-- Partie générale : on copie les éléments, les attributs, le texte, les 
+		commentaires, on supprime mes prrocessing intstructions -->
 
-  <xsl:template match="text()">
-    <xsl:analyze-string select="." regex="&amp;|&lt;|&gt;|--|\*(\w+)">
-      <xsl:matching-substring>
-        <xsl:choose>
-          <xsl:when test="matches(.,'&amp;')">
-            <expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
-          </xsl:when>
-          <xsl:when test="matches(.,'&lt;')">
-            <xsl:text>[</xsl:text>
-          </xsl:when>
-          <xsl:when test="matches(.,'&gt;')">
-            <xsl:text>]</xsl:text>
-          </xsl:when>
-          <!-- pose problème si se trouve dans les notes transformés en commentaires xml par le tokeniseur -->
-          <xsl:when test="matches(.,'--')">
-            <xsl:text> - </xsl:text>
-          </xsl:when>
-<!--          <!-\- Spécial FRANTEXT -\->
-          <xsl:when test="matches(.,'\*(\w+)')">
-            <name xmlns="http://www.tei-c.org/ns/1.0" type="maj"><xsl:value-of select="regex-group(1)"/></name>        		
-          </xsl:when>          -->
-          <xsl:otherwise>
-            <xsl:value-of select="."/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>         
-        <xsl:value-of select="."/>
-      </xsl:non-matching-substring>      
-    </xsl:analyze-string>
-  </xsl:template>
-  
+	<!-- <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> -->
 
-  <xsl:template match="processing-instruction()"/>
+	<xsl:template match="*">
+		<xsl:choose>
+			<xsl:when test="namespace-uri()=''">
+				<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+					name="{local-name(.)}">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<!-- On ne touche pas au teiHeader -->
-  
-  <xsl:template match="tei:teiHeader">    
-      <xsl:copy-of select="."/>    
-  </xsl:template>
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
+	</xsl:template>
 
-<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments hors texte à ignorer lors de l'import -->
-  
-  <xsl:template name="deleteAll"/>
+	<xsl:template match="text()">
+		<xsl:analyze-string select="."
+			regex="&amp;|&lt;|&gt;|--|\*(\w+)">
+			<xsl:matching-substring>
+				<xsl:choose>
+					<xsl:when test="matches(.,'&amp;')">
+						<expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
+					</xsl:when>
+					<xsl:when test="matches(.,'&lt;')">
+						<xsl:text>[</xsl:text>
+					</xsl:when>
+					<xsl:when test="matches(.,'&gt;')">
+						<xsl:text>]</xsl:text>
+					</xsl:when>
+					<!-- pose problème si se trouve dans les notes transformés en commentaires 
+						xml par le tokeniseur -->
+					<xsl:when test="matches(.,'--')">
+						<xsl:text> - </xsl:text>
+					</xsl:when>
+					<!-- <!-\- Spécial FRANTEXT -\-> <xsl:when test="matches(.,'\*(\w+)')"> 
+						<name xmlns="http://www.tei-c.org/ns/1.0" type="maj"><xsl:value-of select="regex-group(1)"/></name> 
+						</xsl:when> -->
+					<xsl:otherwise>
+						<xsl:value-of select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:value-of select="." />
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
 
-<!-- On supprime les balises non essentielles pour l'exploitation textométrique et susceptibles de poser des problèmes au tokeniseur,
-  mais on garde leur contenu qui fait partie du matériau textuel -->
-  
-  <xsl:template name="deleteTag">
-    <xsl:apply-templates/>
-  </xsl:template>
 
-<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, etc. -->
-  
-  <xsl:template name="makeNote">
-    <note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="text()"/>
-    </note>
-  </xsl:template>
-  
-<!-- On supprime toutes les balises à l'intérieur des notes-->
-  <xsl:template match="tei:note">
-    <xsl:copy>
-      <xsl:apply-templates select="text()"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="processing-instruction()" />
 
-<!-- On transforme en DIV typés les balises de niveau de division textuelle (pouvant contenir des p) -->
+	<!-- On ne touche pas au teiHeader -->
 
-  <xsl:template name="makeDiv">
-    <div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>  
+	<xsl:template match="tei:teiHeader">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
+	<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments 
+		hors texte à ignorer lors de l'import -->
 
-  <xsl:template name="makeAb">
-    <ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates/>
-    </ab>
-  </xsl:template>
+	<xsl:template name="deleteAll" />
 
-  <!-- on pré-tokenise les éléments équivalents à un mot -->
-  
-  <xsl:template name="makeWord">
-    <xsl:variable name="wordType">
-      <xsl:choose>
-        <xsl:when test="@type">
-          <xsl:value-of select="concat(local-name(),'-',@type)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name()"></xsl:value-of>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="descendant::tei:w or ancestor::tei:w">
-<!--            <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="seg">
-              <xsl:attribute name="type"><xsl:value-of select="local-name(.)"/></xsl:attribute>
-              <xsl:apply-templates select="*|@*[not(name()='type')]|processing-instruction()|comment()|text()"/>
-            </xsl:element>
--->
-        <xsl:apply-templates/> <!-- on supprime ces balises pour éviter la réduplication des mots-->
-      </xsl:when>
-      <xsl:otherwise>
-        <w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></w>
-      </xsl:otherwise>
-    </xsl:choose>    
-  </xsl:template>  
+	<!-- On supprime les balises non essentielles pour l'exploitation textométrique 
+		et susceptibles de poser des problèmes au tokeniseur, mais on garde leur 
+		contenu qui fait partie du matériau textuel -->
 
-<xsl:template name="makeName">
-  <xsl:variable name="nameType">
-    <xsl:choose>
-      <xsl:when test="@type">
-        <xsl:choose>
-          <xsl:when test="local-name()='name'"><xsl:value-of select='@type'/></xsl:when>
-          <xsl:otherwise><xsl:value-of select="concat(local-name(),'-',@type)"/></xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="local-name()"></xsl:value-of>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  <name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0">
-    <xsl:apply-templates/>
-  </name>
-</xsl:template>
+	<xsl:template name="deleteTag">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<!-- les l sont transformés en lb -->
-  
-  <xsl:template match="tei:l">
-    <lb xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:if test="@n">
-        <xsl:attribute name="n"><xsl:value-of select="@n"/></xsl:attribute>
-      </xsl:if>
-    </lb>
-    <xsl:apply-templates/>
-  </xsl:template>
-  
+	<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, 
+		etc. -->
 
-<!-- On met la ponctuation forte à l'extérieur de la balise foreign :
-Cet élément sera toujours à l'intérieur d'une phrase. Attention au risque
-de perdre les balises éventuelles à l'intérieur-->
-  
-  <xsl:template
-    match="tei:foreign[not(contains(@rend,'multi_s'))][matches(.,'[.!?]')]">
-    <xsl:variable name="lang">
-      <xsl:choose>
-        <xsl:when test="@lang"><xsl:value-of select="@lang"/></xsl:when>
-        <xsl:when test="@xml:lang"><xsl:value-of select="@xml:lang"/></xsl:when>
-        <xsl:otherwise>xx</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:for-each select="child::node()">
-      <xsl:choose>
-        <xsl:when test="self::text()">
-          <xsl:analyze-string select="." regex="([^.!?]*)([.?!]+)">
-            <xsl:matching-substring>
-              <xsl:element name="foreign" namespace="http://www.tei-c.org/ns/1.0">
-                <xsl:attribute name="lang"><xsl:value-of select="$lang"/></xsl:attribute>
-                <xsl:analyze-string select="regex-group(1)" regex="&amp;">
-                  <xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring>
-                  <xsl:non-matching-substring>         
-                    <xsl:value-of select="."/>
-                  </xsl:non-matching-substring>      
-                </xsl:analyze-string>
-              </xsl:element>
-              <xsl:value-of select="regex-group(2)"/>
-              <xsl:text> </xsl:text>
-            </xsl:matching-substring>
-            <xsl:non-matching-substring>
-              <xsl:analyze-string select="." regex="&amp;">
-                <xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring>
-                <xsl:non-matching-substring>         
-                  <xsl:value-of select="."/>
-                </xsl:non-matching-substring>      
-              </xsl:analyze-string>              
-            </xsl:non-matching-substring>
-          </xsl:analyze-string>          
-        </xsl:when>
-        <xsl:when test="self::*[not(descendant::text())]">
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:element name="foreign" namespace="http://www.tei-c.org/ns/1.0">
-            <xsl:attribute name="lang"><xsl:value-of select="$lang"/></xsl:attribute>
-            <xsl:apply-templates select="."/>          
-          </xsl:element>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  
-  
-  <xsl:template name="persname">
-      <xsl:choose>
-         <xsl:when test="tei:surname"><xsl:value-of select="tei:forename"/>&#160;<xsl:value-of select="tei:surname"/></xsl:when>
-         <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
-  
-  
-<!--  <!-\- traitement spécifique anciennes étiquettes bfm -\->
-  <xsl:template match="tei:w/@type[contains(.,'_')]">
-    <xsl:attribute name="type"><xsl:value-of select="substring-before(.,'_')"/></xsl:attribute>
-  </xsl:template>
--->
+	<xsl:template name="makeNote">
+		<note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates select="text()" />
+		</note>
+	</xsl:template>
+
+	<!-- On supprime toutes les balises à l'intérieur des notes -->
+	<xsl:template match="tei:note">
+		<xsl:copy>
+			<xsl:apply-templates select="text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- On transforme en DIV typés les balises de niveau de division textuelle 
+		(pouvant contenir des p) -->
+
+	<xsl:template name="makeDiv">
+		<div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+
+	<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
+
+	<xsl:template name="makeAb">
+		<ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</ab>
+	</xsl:template>
+
+	<!-- on pré-tokenise les éléments équivalents à un mot -->
+
+	<xsl:template name="makeWord">
+		<xsl:variable name="wordType">
+			<xsl:choose>
+				<xsl:when test="@type">
+					<xsl:value-of select="concat(local-name(),'-',@type)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()"></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="descendant::tei:w or ancestor::tei:w">
+				<!-- <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="seg"> 
+					<xsl:attribute name="type"><xsl:value-of select="local-name(.)"/></xsl:attribute> 
+					<xsl:apply-templates select="*|@*[not(name()='type')]|processing-instruction()|comment()|text()"/> 
+					</xsl:element> -->
+				<xsl:apply-templates /> <!-- on supprime ces balises pour éviter la réduplication des mots -->
+			</xsl:when>
+			<xsl:otherwise>
+				<w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:apply-templates />
+				</w>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="makeName">
+		<xsl:variable name="nameType">
+			<xsl:choose>
+				<xsl:when test="@type">
+					<xsl:choose>
+						<xsl:when test="local-name()='name'">
+							<xsl:value-of select='@type' />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="concat(local-name(),'-',@type)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()"></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates />
+		</name>
+	</xsl:template>
+
+	<!-- les l sont transformés en lb -->
+
+	<xsl:template match="tei:l">
+		<lb xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:if test="@n">
+				<xsl:attribute name="n"><xsl:value-of
+					select="@n" /></xsl:attribute>
+			</xsl:if>
+		</lb>
+		<xsl:apply-templates />
+	</xsl:template>
+
+
+	<!-- On met la ponctuation forte à l'extérieur de la balise foreign : Cet 
+		élément sera toujours à l'intérieur d'une phrase. Attention au risque de 
+		perdre les balises éventuelles à l'intérieur -->
+
+	<xsl:template
+		match="tei:foreign[not(contains(@rend,'multi_s'))][matches(.,'[.!?]')]">
+		<xsl:variable name="lang">
+			<xsl:choose>
+				<xsl:when test="@lang">
+					<xsl:value-of select="@lang" />
+				</xsl:when>
+				<xsl:when test="@xml:lang">
+					<xsl:value-of select="@xml:lang" />
+				</xsl:when>
+				<xsl:otherwise>
+					xx
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:for-each select="child::node()">
+			<xsl:choose>
+				<xsl:when test="self::text()">
+					<xsl:analyze-string select="."
+						regex="([^.!?]*)([.?!]+)">
+						<xsl:matching-substring>
+							<xsl:element name="foreign"
+								namespace="http://www.tei-c.org/ns/1.0">
+								<xsl:attribute name="lang"><xsl:value-of
+									select="$lang" /></xsl:attribute>
+								<xsl:analyze-string select="regex-group(1)"
+									regex="&amp;">
+									<xsl:matching-substring>
+										<expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
+									</xsl:matching-substring>
+									<xsl:non-matching-substring>
+										<xsl:value-of select="." />
+									</xsl:non-matching-substring>
+								</xsl:analyze-string>
+							</xsl:element>
+							<xsl:value-of select="regex-group(2)" />
+							<xsl:text> </xsl:text>
+						</xsl:matching-substring>
+						<xsl:non-matching-substring>
+							<xsl:analyze-string select="." regex="&amp;">
+								<xsl:matching-substring>
+									<expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
+								</xsl:matching-substring>
+								<xsl:non-matching-substring>
+									<xsl:value-of select="." />
+								</xsl:non-matching-substring>
+							</xsl:analyze-string>
+						</xsl:non-matching-substring>
+					</xsl:analyze-string>
+				</xsl:when>
+				<xsl:when test="self::*[not(descendant::text())]">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:element name="foreign"
+						namespace="http://www.tei-c.org/ns/1.0">
+						<xsl:attribute name="lang"><xsl:value-of
+							select="$lang" /></xsl:attribute>
+						<xsl:apply-templates select="." />
+					</xsl:element>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+
+
+	<xsl:template name="persname">
+		<xsl:choose>
+			<xsl:when test="tei:surname">
+				<xsl:value-of select="tei:forename" />
+				&#160;
+				<xsl:value-of select="tei:surname" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<!-- <!-\- traitement spécifique anciennes étiquettes bfm -\-> <xsl:template 
+		match="tei:w/@type[contains(.,'_')]"> <xsl:attribute name="type"><xsl:value-of 
+		select="substring-before(.,'_')"/></xsl:attribute> </xsl:template> -->
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz.xsl	(revision 2397)
@@ -1,290 +1,410 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:txm="http://textometrie.org/1.0"
-                exclude-result-prefixes="#all" version="2.0">
-                
-	<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
-                
-                <xsl:strip-space elements="*"/>
-                
-	<xsl:param name="editionpagetag">pb</xsl:param>
-                
-                <xsl:variable name="inputtype">
-                	<xsl:choose>
-                		<xsl:when test="//tei:w//txm:form">xmltxm</xsl:when>
-                		<xsl:otherwise>xmlw</xsl:otherwise>
-                	</xsl:choose>
-                </xsl:variable>
-                
-                <xsl:template match="/">
-                	<html>
-                		<head>
-                			<title><xsl:value-of select="//tei:text[1]/@id"/></title>
-                			<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-                			<link rel="stylesheet" media="all" type="text/css" href="css/bvhepistemon2014.css" />
-<!--                			<title>
-                				<xsl:if test="$author[not(contains(.,'anonym'))]">
-                					<xsl:value-of select="$author"/><xsl:text> : </xsl:text>
-                				</xsl:if>
-                				<xsl:value-of select="$title-normal"/>
-                			</title>                                                                -->
-                		</head>
-                			<xsl:apply-templates select="descendant::tei:text"/>
-                	</html>
-                </xsl:template>
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/1.0" exclude-result-prefixes="#all"
+	version="2.0">
 
-<xsl:template match="tei:text">
-	<body>
-		<a class="txm-page" title="1"/>
-		<div class="metadata-page">
-			<h1><xsl:value-of select="@id"></xsl:value-of></h1>
-			<br/>
-			<table>
-				<xsl:for-each select="@*">
-					<tr>
-						<td><xsl:value-of select="name()"/></td>
-						<td><xsl:value-of select="."/></td>
-					</tr>
-				</xsl:for-each>
-			</table>
-		</div>
-		<xsl:apply-templates/>		
-	</body>
-</xsl:template>
+	<xsl:output method="xml" encoding="UTF-8"
+		omit-xml-declaration="no" indent="no"
+		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
 
-                <xsl:template match="*">
-                                <xsl:choose>
-                                	<xsl:when test="descendant::tei:p|descendant::tei:ab">
-                                		<div>
-                                			<xsl:call-template name="addClass"/>
-                                			<xsl:apply-templates/></div>
-                                		<xsl:text>&#xa;</xsl:text>
-                                	</xsl:when>
-                                	<xsl:otherwise><span>
-                                		<xsl:call-template name="addClass"/>
-                                		<xsl:if test="self::tei:add[@del]">
-                                			<xsl:attribute name="title"><xsl:value-of select="@del"/></xsl:attribute>
-                                		</xsl:if>
-                                		<xsl:apply-templates/></span>
-                                	<xsl:call-template name="spacing"/>
-                                	</xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="@*|processing-instruction()|comment()">
-                                <!--<xsl:copy/>-->
-                </xsl:template>
-                
-<!--                <xsl:template match="comment()">
-                                <xsl:copy/>
-                </xsl:template>
--->                
-                <xsl:template match="text()">
-                                <xsl:value-of select="normalize-space(.)"/>
-                </xsl:template>
-                
-                <xsl:template name="addClass">
-                	<xsl:attribute name="class">
-                		<xsl:value-of select="local-name(.)"/>
-                		<xsl:if test="@type"><xsl:value-of select="concat('-',@type)"/></xsl:if>
-                		<xsl:if test="@subtype"><xsl:value-of select="concat('-',@subtype)"/></xsl:if>
-                		<xsl:if test="@rend"><xsl:value-of select="concat('-',@rend)"/></xsl:if>
-                	</xsl:attribute>                	
-                </xsl:template>
-                
-                <xsl:template match="tei:p|tei:ab|tei:lg">
-                	<p>
-                		<xsl:call-template name="addClass"/>
-                		<xsl:apply-templates/>
-                	</p>
-                	<xsl:text>&#xa;</xsl:text>
-                </xsl:template>
-	
+	<xsl:strip-space elements="*" />
+
+	<xsl:param name="editionpagetag">
+		pb
+	</xsl:param>
+
+	<xsl:variable name="inputtype">
+		<xsl:choose>
+			<xsl:when test="//tei:w//txm:form">
+				xmltxm
+			</xsl:when>
+			<xsl:otherwise>
+				xmlw
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+
+	<xsl:template match="/">
+		<html>
+			<head>
+				<title>
+					<xsl:value-of select="//tei:text[1]/@id" />
+				</title>
+				<meta http-equiv="Content-Type"
+					content="text/html;charset=UTF-8" />
+				<link rel="stylesheet" media="all" type="text/css"
+					href="css/bvhepistemon2014.css" />
+				<!-- <title> <xsl:if test="$author[not(contains(.,'anonym'))]"> <xsl:value-of 
+					select="$author"/><xsl:text> : </xsl:text> </xsl:if> <xsl:value-of select="$title-normal"/> 
+					</title> -->
+			</head>
+			<xsl:apply-templates
+				select="descendant::tei:text" />
+		</html>
+	</xsl:template>
+
+	<xsl:template match="tei:text">
+		<body>
+			<a class="txm-page" title="1" />
+			<div class="metadata-page">
+				<h1>
+					<xsl:value-of select="@id"></xsl:value-of>
+				</h1>
+				<br />
+				<table>
+					<xsl:for-each select="@*">
+						<tr>
+							<td>
+								<xsl:value-of select="name()" />
+							</td>
+							<td>
+								<xsl:value-of select="." />
+							</td>
+						</tr>
+					</xsl:for-each>
+				</table>
+			</div>
+			<xsl:apply-templates />
+		</body>
+	</xsl:template>
+
+	<xsl:template match="*">
+		<xsl:choose>
+			<xsl:when test="descendant::tei:p|descendant::tei:ab">
+				<div>
+					<xsl:call-template name="addClass" />
+					<xsl:apply-templates />
+				</div>
+				<xsl:text>&#xa;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<span>
+					<xsl:call-template name="addClass" />
+					<xsl:if test="self::tei:add[@del]">
+						<xsl:attribute name="title"><xsl:value-of
+							select="@del" /></xsl:attribute>
+					</xsl:if>
+					<xsl:apply-templates />
+				</span>
+				<xsl:call-template name="spacing" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+		<!--<xsl:copy/> -->
+	</xsl:template>
+
+	<!-- <xsl:template match="comment()"> <xsl:copy/> </xsl:template> -->
+	<xsl:template match="text()">
+		<xsl:value-of select="normalize-space(.)" />
+	</xsl:template>
+
+	<xsl:template name="addClass">
+		<xsl:attribute name="class">
+                		<xsl:value-of select="local-name(.)" />
+                		<xsl:if test="@type"><xsl:value-of
+			select="concat('-',@type)" /></xsl:if>
+                		<xsl:if test="@subtype"><xsl:value-of
+			select="concat('-',@subtype)" /></xsl:if>
+                		<xsl:if test="@rend"><xsl:value-of
+			select="concat('-',@rend)" /></xsl:if>
+                	</xsl:attribute>
+	</xsl:template>
+
+	<xsl:template match="tei:p|tei:ab|tei:lg">
+		<p>
+			<xsl:call-template name="addClass" />
+			<xsl:apply-templates />
+		</p>
+		<xsl:text>&#xa;</xsl:text>
+	</xsl:template>
+
 	<xsl:template match="tei:head">
 		<h2>
-			<xsl:call-template name="addClass"/>
-			<xsl:apply-templates/>
+			<xsl:call-template name="addClass" />
+			<xsl:apply-templates />
 		</h2>
 	</xsl:template>
-                
+
 	<xsl:template match="//tei:lb">
 		<xsl:variable name="lbcount">
 			<xsl:choose>
-				<xsl:when test="ancestor::tei:ab"><xsl:number from="tei:ab" level="any"/></xsl:when>
-				<xsl:when test="ancestor::tei:p"><xsl:number from="tei:p" level="any"/></xsl:when>
-				<xsl:otherwise>999</xsl:otherwise>
+				<xsl:when test="ancestor::tei:ab">
+					<xsl:number from="tei:ab" level="any" />
+				</xsl:when>
+				<xsl:when test="ancestor::tei:p">
+					<xsl:number from="tei:p" level="any" />
+				</xsl:when>
+				<xsl:otherwise>
+					999
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		<xsl:if test="@rend='hyphen(-)'"><span class="hyphen">-</span></xsl:if>
-		<xsl:if test="@rend='hyphen(=)'"><span class="hyphen">=</span></xsl:if>
-		<xsl:if test="not($lbcount=1) or preceding-sibling::node()[matches(.,'\S')]"><br/><xsl:text>&#xa;</xsl:text></xsl:if>
+		<xsl:if test="@rend='hyphen(-)'">
+			<span class="hyphen">-</span>
+		</xsl:if>
+		<xsl:if test="@rend='hyphen(=)'">
+			<span class="hyphen">=</span>
+		</xsl:if>
+		<xsl:if
+			test="not($lbcount=1) or preceding-sibling::node()[matches(.,'\S')]">
+			<br />
+			<xsl:text>&#xa;</xsl:text>
+		</xsl:if>
 		<xsl:if test="@n and not(@rend='prose')">
 			<xsl:choose>
 				<xsl:when test="matches(@n,'^[0-9]*[05]$')">
-					<!--<a title="{@n}" class="verseline" style="position:relative"> </a>-->
-					<span class="verseline"><span class="verselinenumber"><xsl:value-of select="@n"/></span></span>
+					<!--<a title="{@n}" class="verseline" style="position:relative"> </a> -->
+					<span class="verseline">
+						<span class="verselinenumber">
+							<xsl:value-of select="@n" />
+						</span>
+					</span>
 				</xsl:when>
 				<xsl:when test="matches(@n,'[^0-9]')">
-					<!--<a title="{@n}" class="verseline" style="position:relative"> </a>-->
-					<span class="verseline"><span class="verselinenumber"><xsl:value-of select="@n"/></span></span>
+					<!--<a title="{@n}" class="verseline" style="position:relative"> </a> -->
+					<span class="verseline">
+						<span class="verselinenumber">
+							<xsl:value-of select="@n" />
+						</span>
+					</span>
 				</xsl:when>
 				<xsl:otherwise>
 				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:if>
 	</xsl:template>
-	
-	<!-- Page breaks -->                
-	<xsl:template match="//*[local-name()=$editionpagetag][not(following-sibling::tei:cb)]">
+
+	<!-- Page breaks -->
+	<xsl:template
+		match="//*[local-name()=$editionpagetag][not(following-sibling::tei:cb)]">
 		<xsl:variable name="editionpagetype">
 			<xsl:choose>
-				<xsl:when test="ancestor::tei:ab">editionpageverse</xsl:when>
-				<xsl:otherwise>editionpage</xsl:otherwise>
+				<xsl:when test="ancestor::tei:ab">
+					editionpageverse
+				</xsl:when>
+				<xsl:otherwise>
+					editionpage
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
 		<xsl:variable name="pagenumber">
 			<xsl:choose>
-				<xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when>
-				<xsl:when test="@facs"><xsl:value-of select="substring-before(@facs,'.')"/></xsl:when>
-				<xsl:otherwise>[NN]</xsl:otherwise>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:when test="@facs">
+					<xsl:value-of select="substring-before(@facs,'.')" />
+				</xsl:when>
+				<xsl:otherwise>
+					[NN]
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		
-		<xsl:variable name="page_id"><xsl:value-of select="count(preceding::*[local-name()=$editionpagetag])"/></xsl:variable>
-		
-		<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
+
+		<xsl:variable name="page_id">
+			<xsl:value-of
+				select="count(preceding::*[local-name()=$editionpagetag])" />
+		</xsl:variable>
+
+		<xsl:if
+			test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
 			<xsl:text>&#xa;</xsl:text>
-			<br/>
-			<br/>			
-			<span style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">                                                
-				<xsl:for-each select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
-					<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) + 1"/></xsl:variable>
-					<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-->
+			<br />
+			<br />
+			<span
+				style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">
+				<xsl:for-each
+					select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
+					<xsl:variable name="note_count">
+						<xsl:value-of
+							select="count(preceding::tei:note[not(@place='inline')]) + 1" />
+					</xsl:variable>
+					<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" 
+						name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, 
+						l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> 
+						<xsl:value-of select="."/></p> -->
 					<span class="note">
-						<span style="position:absolute;left:-30px"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
-						<xsl:apply-templates mode="#current"/>
-					</span>                                                                
-				</xsl:for-each></span><xsl:text>&#xa;</xsl:text>                                                                
-			
-		</xsl:if>                                
-		
+						<span style="position:absolute;left:-30px">
+							<a href="#noteref_{$note_count}" name="note_{$note_count}">
+								<xsl:value-of select="$note_count" />
+							</a>
+							.
+						</span>
+						<xsl:apply-templates mode="#current" />
+					</span>
+				</xsl:for-each>
+			</span>
+			<xsl:text>&#xa;</xsl:text>
+
+		</xsl:if>
+
 		<xsl:text>&#xa;</xsl:text>
-		<br/><xsl:text>&#xa;</xsl:text>
-		<a class="txm-page" title="{count(preceding::*[local-name()=$editionpagetag]) + 2}"/>
-		<span class="{$editionpagetype}"> - <xsl:value-of select="$pagenumber"/> - </span><br/><xsl:text>&#xa;</xsl:text>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
+		<a class="txm-page"
+			title="{count(preceding::*[local-name()=$editionpagetag]) + 2}" />
+		<span class="{$editionpagetype}">
+			-
+			<xsl:value-of select="$pagenumber" />
+			-
+		</span>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
 	</xsl:template>
-	
+
 	<!-- Notes -->
-	<xsl:template match="tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]">
-		<!--<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] </span>-->	
-		<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]) + 1"/></xsl:variable>
+	<xsl:template
+		match="tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]">
+		<!--<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] 
+			</span> -->
+		<xsl:variable name="note_count">
+			<xsl:value-of
+				select="count(preceding::tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]) + 1" />
+		</xsl:variable>
 		<xsl:variable name="note_content">
 			<xsl:choose>
 				<xsl:when test="descendant::txm:form">
-					<xsl:for-each select="descendant::txm:form">						
-						<xsl:value-of select="."/>
-						<xsl:if test="not(matches(following::txm:form[1],'^[.,\)]')) and not(matches(.,'^\S+[''’]$|^[‘\(]$'))">
+					<xsl:for-each select="descendant::txm:form">
+						<xsl:value-of select="." />
+						<xsl:if
+							test="not(matches(following::txm:form[1],'^[.,\)]')) and not(matches(.,'^\S+[''’]$|^[‘\(]$'))">
 							<xsl:text> </xsl:text>
 						</xsl:if>
 					</xsl:for-each>
 				</xsl:when>
-				<xsl:otherwise><xsl:value-of select="normalize-space(.)"/></xsl:otherwise>
+				<xsl:otherwise>
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		<a title="{$note_content}" style="font-size:75%;position:relative;top:-5px" href="#note_{$note_count}" name="noteref_{$note_count}">[<xsl:value-of select="$note_count"/>]</a>
-		<xsl:call-template name="spacing"/>                                
+		<a title="{$note_content}"
+			style="font-size:75%;position:relative;top:-5px"
+			href="#note_{$note_count}" name="noteref_{$note_count}">
+			[
+			<xsl:value-of select="$note_count" />
+			]
+		</a>
+		<xsl:call-template name="spacing" />
 	</xsl:template>
-	
+
 	<xsl:template match="tei:note[@place='inline']">
 		<span class="noteinline">
-			<xsl:apply-templates/>
+			<xsl:apply-templates />
 		</span>
 	</xsl:template>
-                
-                <xsl:template match="//tei:w"><span class="w">
-                                                <xsl:if test="@id">
-                                                	<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
-                                                </xsl:if>
-                                	<xsl:attribute name="title">
+
+	<xsl:template match="//tei:w">
+		<span class="w">
+			<xsl:if test="@id">
+				<xsl:attribute name="id"><xsl:value-of
+					select="@id" /></xsl:attribute>
+			</xsl:if>
+			<xsl:attribute name="title">
                                 		<xsl:if test="@id">
-                                			<xsl:value-of select="@id"></xsl:value-of>
+                                			<xsl:value-of
+				select="@id"></xsl:value-of>
                                 		</xsl:if>
-                                		<xsl:if test="ancestor::tei:corr">
-                                			<xsl:value-of select="concat(' sic : ',@sic)"/>
+                                		<xsl:if
+				test="ancestor::tei:corr">
+                                			<xsl:value-of
+				select="concat(' sic : ',@sic)" />
                                 		</xsl:if>
-                                		<xsl:if test="ancestor::tei:reg">
-                                			<xsl:value-of select="concat(' orig : ',@orig)"/>
+                                		<xsl:if
+				test="ancestor::tei:reg">
+                                			<xsl:value-of
+				select="concat(' orig : ',@orig)" />
                                 		</xsl:if>
                                 		<xsl:choose>
-                                			<xsl:when test="descendant::txm:ana">	
-                                					<xsl:for-each select="descendant::txm:ana">
-                                						<xsl:value-of select="concat(' ',substring-after(@type,'#'),' : ',.)"/>
+                                			<xsl:when
+				test="descendant::txm:ana">	
+                                					<xsl:for-each
+				select="descendant::txm:ana">
+                                						<xsl:value-of
+				select="concat(' ',substring-after(@type,'#'),' : ',.)" />
                                 					</xsl:for-each>
                                 			</xsl:when>
                                 			<xsl:otherwise>
-                                				<xsl:for-each select="@*[not(local-name()='id')]">
-                                					<xsl:value-of select="concat(' ',name(.),' : ',.)"/>
+                                				<xsl:for-each
+				select="@*[not(local-name()='id')]">
+                                					<xsl:value-of
+				select="concat(' ',name(.),' : ',.)" />
                                 				</xsl:for-each>                                				
                                 			</xsl:otherwise>
                                 		</xsl:choose>
-                                		<xsl:if test="@*[matches(name(.),'pos$')]">
+                                		<xsl:if
+				test="@*[matches(name(.),'pos$')]">
                                 		</xsl:if>                                		
                                 	</xsl:attribute>
-                	<xsl:choose>
-                		<xsl:when test="descendant::txm:form">
-                			<xsl:apply-templates select="txm:form"/>
-                		</xsl:when>
-                		<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
-                	</xsl:choose>
-                	
-                                </span><xsl:call-template name="spacing"/></xsl:template>
-                
-<!--                <xsl:template match="//txm:form">
-                                <xsl:apply-templates/>
-                </xsl:template>
--->                
+			<xsl:choose>
+				<xsl:when test="descendant::txm:form">
+					<xsl:apply-templates select="txm:form" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+
+		</span>
+		<xsl:call-template name="spacing" />
+	</xsl:template>
+
+	<!-- <xsl:template match="//txm:form"> <xsl:apply-templates/> </xsl:template> -->
 	<xsl:template name="spacing">
 		<xsl:choose>
 			<xsl:when test="$inputtype='xmltxm'">
-				<xsl:call-template name="spacing-xmltxm"/>
+				<xsl:call-template name="spacing-xmltxm" />
 			</xsl:when>
 			<xsl:otherwise>
-				<xsl:call-template name="spacing-xmlw"/>
+				<xsl:call-template name="spacing-xmlw" />
 			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:template>
-	
+
 	<xsl:template name="spacing-xmlw">
 		<xsl:choose>
-			<xsl:when test="ancestor::tei:w"/>
-			<xsl:when test="following::tei:w[1][matches(.,'^\s*[.,)\]]+\s*$')]"/>			
+			<xsl:when test="ancestor::tei:w" />
+			<xsl:when
+				test="following::tei:w[1][matches(.,'^\s*[.,)\]]+\s*$')]" />
 			<xsl:when test="matches(.,'^\s*[(\[‘]+$|\w(''|’)\s*$')"></xsl:when>
-			<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
+			<xsl:when
+				test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
 			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-			<xsl:when test="following::tei:w[1][matches(.,'^\s*[:;!?]+\s*$')]">
+			<xsl:when
+				test="following::tei:w[1][matches(.,'^\s*[:;!?]+\s*$')]">
 				<xsl:text>&#xa0;</xsl:text>
 			</xsl:when>
 			<xsl:otherwise>
 				<xsl:text> </xsl:text>
 			</xsl:otherwise>
-		</xsl:choose>                
+		</xsl:choose>
 	</xsl:template>
 
 	<xsl:template name="spacing-xmltxm">
 		<xsl:choose>
-			<xsl:when test="ancestor::tei:w"/>
-			<xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[.,)\]]+$')]"/>			
-			<xsl:when test="matches(descendant::txm:form[1],'^[(\[‘]+$|\w(''|’)$')"></xsl:when>
-			<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
+			<xsl:when test="ancestor::tei:w" />
+			<xsl:when
+				test="following::tei:w[1][matches(descendant::txm:form[1],'^[.,)\]]+$')]" />
+			<xsl:when
+				test="matches(descendant::txm:form[1],'^[(\[‘]+$|\w(''|’)$')"></xsl:when>
+			<xsl:when
+				test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
 			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-			<xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[:;!?]+$')]">
+			<xsl:when
+				test="following::tei:w[1][matches(descendant::txm:form[1],'^[:;!?]+$')]">
 				<xsl:text>&#xa0;</xsl:text>
 			</xsl:when>
 			<xsl:otherwise>
 				<xsl:text> </xsl:text>
 			</xsl:otherwise>
-		</xsl:choose>                
+		</xsl:choose>
 	</xsl:template>
 
-                
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-idsHeader2textAtt.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-idsHeader2textAtt.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-idsHeader2textAtt.xsl	(revision 2397)
@@ -1,82 +1,91 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc" version="2.0">
 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet is designed for TXM XTZ+CSV import module to extract 
-      metadata from the idsHeader (IDS-XCES) and add them as attributes
-      of the text element. It should be used at "2-front" step. See TXM 
-      User Manual for more details 
-      (http://textometrie.ens-lyon.fr/spip.php?rubrique64)
-      For more details on source corpus encoding schema see 
-      http://www1.ids-mannheim.de/kl/projekte/korpora/textmodell.html
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
-  </xd:doc>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet is designed for TXM XTZ+CSV import module to extract
+			metadata from the idsHeader (IDS-XCES) and add them as attributes
+			of the text element. It should be used at "2-front" step. See TXM
+			User Manual for more details
+			(http://textometrie.ens-lyon.fr/spip.php?rubrique64)
+			For more details on source corpus encoding schema see
+			http://www1.ids-mannheim.de/kl/projekte/korpora/textmodell.html
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
+	</xd:doc>
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> 
-  
-  
-<!-- General patterns: all elements, attributes, comments and processing instructions are copied -->
-  
-  <xsl:template match="*">      
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>    
-  </xsl:template>
-  
-  <xsl:template match="@*|comment()|processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
 
-  <xsl:variable name="current-file-name">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
-  
-<!-- Extracting metadata to use -->
- 
-  <xsl:variable name="title">
-    <xsl:value-of select="/idsText/idsHeader//h.title[@type='abbr']"/>
-  </xsl:variable>
-  <xsl:variable name="date">
-    <xsl:value-of select="idsText/idsHeader//creatDate"/>
-  </xsl:variable>
-  
 
-<!-- Injecting metadata into attibutes of the text element -->
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
 
-<xsl:template match="text">
-  <xsl:copy>
-    <xsl:apply-templates select="@*"/>
-    <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
-    <xsl:attribute name="date"><xsl:value-of select="$date"/></xsl:attribute>
-    <xsl:apply-templates/>
-  </xsl:copy>
-</xsl:template>
 
+	<!-- General patterns: all elements, attributes, comments and processing 
+		instructions are copied -->
 
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template
+		match="@*|comment()|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:variable name="current-file-name">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+	<!-- Extracting metadata to use -->
+
+	<xsl:variable name="title">
+		<xsl:value-of
+			select="/idsText/idsHeader//h.title[@type='abbr']" />
+	</xsl:variable>
+	<xsl:variable name="date">
+		<xsl:value-of select="idsText/idsHeader//creatDate" />
+	</xsl:variable>
+
+
+	<!-- Injecting metadata into attibutes of the text element -->
+
+	<xsl:template match="text">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="title"><xsl:value-of
+				select="$title" /></xsl:attribute>
+			<xsl:attribute name="date"><xsl:value-of
+				select="$date" /></xsl:attribute>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/filter-out-p.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/filter-out-p.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/filter-out-p.xsl	(revision 2397)
@@ -1,46 +1,48 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
- 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de suppression de certains éléments XML à utiliser comme
-      prétraitement de l'import XML/w+CSV. 
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Serge Heiden slh@ens-lyon.fr</xd:author>
-    <xd:copyright>2013, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de suppression de certains éléments XML à utiliser comme
+			prétraitement de l'import XML/w+CSV.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-  <xsl:template match="@*|node()">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()" />
-    </xsl:copy>
-  </xsl:template>
-  
-<!-- On supprime tous les <p> dont l'attribut @type vaut 'ouverture' -->
-  
-  <xsl:template match="//p[@type='ouverture']">    
-      <!--<xsl:copy-of select="."/>-->    
-  </xsl:template>
-	
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Serge Heiden slh@ens-lyon.fr</xd:author>
+		<xd:copyright>2013, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="yes" />
+
+	<xsl:template match="@*|node()">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- On supprime tous les <p> dont l'attribut @type vaut 'ouverture' -->
+
+	<xsl:template match="//p[@type='ouverture']">
+		<!--<xsl:copy-of select="."/> -->
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/identity.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/identity.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/identity.xsl	(revision 2397)
@@ -1,11 +1,12 @@
 <!-- The Identity Transformation -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  <!-- Whenever you match any node or any attribute -->
-  <xsl:template match="node()|@*">
-    <!-- Copy the current node -->
-    <xsl:copy>
-      <!-- Including any attributes it has and any child nodes -->
-      <xsl:apply-templates select="@*|node()"/>
-    </xsl:copy>
-  </xsl:template>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<!-- Whenever you match any node or any attribute -->
+	<xsl:template match="node()|@*">
+		<!-- Copy the current node -->
+		<xsl:copy>
+			<!-- Including any attributes it has and any child nodes -->
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teifrantext-teibfm.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teifrantext-teibfm.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teifrantext-teibfm.xsl	(revision 2397)
@@ -1,76 +1,68 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de préparation de fichiers TEI P5 à l'importation 
-      dans TXM. Permet de simplifier la structure du document afin
-      d'optimiser les index CWB
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <!--
-    Modifications par AL le  2012-01-25
-    g dépalacé de "deleteAll" vers "deleteTag"
-    classe de balise "name" créée
-    (geogName, placeName, persName et name)
-  -->
-  
-  <!-- 
-    Modifications par LBe le 2012-02-17
-    Transformation automatique des esperluettes dans les métadonnées
-    Suppression des balises label et heraldry
-    Signed n'est plus transformé en ab
-    opener est transformé en ab
-    L'institution et le dépôt sont récupérés pour le lieu de conservation
-  -->
-  
-  <!-- Modifications par AL le 2012-02-20
-    rolename -> roleName
-    suppression des balises surname et forename
-  -->
-  
-  <!-- Modifications par LBe le 2012-03-09
-    Automatisation du nommage des sorties
-  -->
-  
-  <!-- Modification par AL le 2013-12-31 
-      harmonisation avec la feuille de style txm-filter-teip5-teibfm.xsl
-  -->
-  
-  <!-- Listes des balises par type de traitement (les templates sont plus bas) -->
-  
-  <!-- balises à supprimer avec leur contenu -->
-  <xsl:template match="tei:figDesc|tei:figure|tei:fw|tei:g
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de préparation de fichiers TEI P5 à l'importation
+			dans TXM. Permet de simplifier la structure du document afin
+			d'optimiser les index CWB
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<!-- Modifications par AL le 2012-01-25 g dépalacé de "deleteAll" vers "deleteTag" 
+		classe de balise "name" créée (geogName, placeName, persName et name) -->
+
+	<!-- Modifications par LBe le 2012-02-17 Transformation automatique des 
+		esperluettes dans les métadonnées Suppression des balises label et heraldry 
+		Signed n'est plus transformé en ab opener est transformé en ab L'institution 
+		et le dépôt sont récupérés pour le lieu de conservation -->
+
+	<!-- Modifications par AL le 2012-02-20 rolename -> roleName suppression 
+		des balises surname et forename -->
+
+	<!-- Modifications par LBe le 2012-03-09 Automatisation du nommage des sorties -->
+
+	<!-- Modification par AL le 2013-12-31 harmonisation avec la feuille de 
+		style txm-filter-teip5-teibfm.xsl -->
+
+	<!-- Listes des balises par type de traitement (les templates sont plus 
+		bas) -->
+
+	<!-- balises à supprimer avec leur contenu -->
+	<xsl:template
+		match="tei:figDesc|tei:figure|tei:fw|tei:g
     |tei:space|tei:titlePage ">
-    <xsl:call-template name="deleteAll"/>
-  </xsl:template>
-  
-  <!-- balises à supprimer, contenu à conserver -->  
-  <xsl:template match="tei:add|tei:app
+		<xsl:call-template name="deleteAll" />
+	</xsl:template>
+
+	<!-- balises à supprimer, contenu à conserver -->
+	<xsl:template
+		match="tei:add|tei:app
     |tei:caesura|tei:castItem|tei:castGroup[ancestor::tei:castList]
     |tei:castList[ancestor::tei:p]|tei:cell|tei:choice|tei:cit|tei:corr|tei:date|tei:ex
     |tei:forename|tei:g|tei:head[parent::tei:list]|tei:heraldry|tei:hi|tei:item|tei:label|tei:lem
@@ -79,285 +71,327 @@
     |tei:ref|tei:reg|tei:role|tei:roleDesc
     |tei:row|tei:salute|tei:signed[ancestor::tei:closer]|tei:speaker|tei:stage[ancestor::tei:p|ancestor::tei:ab]
     |tei:surname|tei:table[ancestor::tei:p]|tei:subst|tei:term|tei:unclear">
-    <xsl:call-template name="deleteTag"/>
-  </xsl:template>
-  
-  <!-- balises à transformer en notes-->
-  <xsl:template match="tei:abbr[parent::tei:choice and not(ancestor::tei:note)]
+		<xsl:call-template name="deleteTag" />
+	</xsl:template>
+
+	<!-- balises à transformer en notes -->
+	<xsl:template
+		match="tei:abbr[parent::tei:choice and not(ancestor::tei:note)]
     |tei:bibl[not(ancestor::tei:note)]
     |tei:del
     |tei:orig[parent::tei:choice and not(ancestor::tei:note)]    
     |tei:rdg[parent::tei:app and not(ancestor::tei:note)]
     |tei:sic[parent::tei:choice and not(ancestor::tei:note)]
     |tei:surplus[not(ancestor::tei:w)]">
-    <xsl:call-template name="makeNote"/>
-  </xsl:template>
-  
-  <!-- balises de noms à indexer -->
-  
-  <xsl:template match="tei:name
+		<xsl:call-template name="makeNote" />
+	</xsl:template>
+
+	<!-- balises de noms à indexer -->
+
+	<xsl:template
+		match="tei:name
     |tei:geogName
     |tei:persName
     |tei:placeName
     |tei:roleName
     |tei:orgName">
-    <xsl:call-template name="makeName"/>
-  </xsl:template>
-  
-  <!-- à transformer en W -->
-  
-  <xsl:template match="tei:abbr[not(parent::tei:choice)]
+		<xsl:call-template name="makeName" />
+	</xsl:template>
+
+	<!-- à transformer en W -->
+
+	<xsl:template
+		match="tei:abbr[not(parent::tei:choice)]
     |tei:expan
     |tei:num[matches(.,'.')]">
-    <xsl:call-template name="makeWord"/>
-  </xsl:template>
-  
-  <!-- à transformer en AB typé -->
-  
-  <xsl:template match="tei:byline|tei:lg[not(child::tei:lg or ancestor::tei:sp)]|tei:list[not(ancestor::tei:p|ancestor::tei:ab)]
+		<xsl:call-template name="makeWord" />
+	</xsl:template>
+
+	<!-- à transformer en AB typé -->
+
+	<xsl:template
+		match="tei:byline|tei:lg[not(child::tei:lg or ancestor::tei:sp)]|tei:list[not(ancestor::tei:p|ancestor::tei:ab)]
     |tei:closer|tei:opener|tei:sp|tei:castGroup[not(ancestor::tei:castList)]|tei:castList[not(ancestor::tei:p)]
     |tei:signed[not(ancestor::tei:closer)]
     |tei:stage[not(ancestor::tei:p|ancestor::tei:ab)]
     |tei:table[not(ancestor::tei:p)]
     |tei:trailer">
-    <xsl:call-template name="makeAb"/>
-  </xsl:template>
-  
-  <!-- à transformer en DIV typé -->
-  
-  <xsl:template match="tei:set">
-    <xsl:call-template name="makeDiv"/>
-  </xsl:template>
+		<xsl:call-template name="makeAb" />
+	</xsl:template>
 
-<!-- Partie générale : on copie les éléments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
+	<!-- à transformer en DIV typé -->
 
-<!--  <xsl:template match="/">
-      <xsl:apply-templates/>  
-  </xsl:template>
--->
-  
-  <xsl:template match="*">    
-    <xsl:choose>
-      <xsl:when test="namespace-uri()=''">
-        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>  
-  </xsl:template>
+	<xsl:template match="tei:set">
+		<xsl:call-template name="makeDiv" />
+	</xsl:template>
 
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
+	<!-- Partie générale : on copie les éléments, les attributs, le texte, les 
+		commentaires, on supprime mes prrocessing intstructions -->
 
-  <xsl:template match="text()">
-    <xsl:analyze-string select="." regex="&amp;|&lt;|&gt;|--|\*(\w+)">
-      <xsl:matching-substring>
-        <xsl:choose>
-          <xsl:when test="matches(.,'&amp;')">
-            <expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
-          </xsl:when>
-          <xsl:when test="matches(.,'&lt;')">
-            <xsl:text>[</xsl:text>
-          </xsl:when>
-          <xsl:when test="matches(.,'&gt;')">
-            <xsl:text>]</xsl:text>
-          </xsl:when>
-          <!-- pose problème si se trouve dans les notes transformés en commentaires xml par le tokeniseur -->
-          <xsl:when test="matches(.,'--')">
-            <xsl:text> - </xsl:text>
-          </xsl:when>
-          <!-- Spécial FRANTEXT -->
-          <xsl:when test="matches(.,'\*(\w+)')">
-            <name xmlns="http://www.tei-c.org/ns/1.0" type="maj"><xsl:value-of select="regex-group(1)"/></name>        		
-          </xsl:when>          
-          <xsl:otherwise>
-            <xsl:value-of select="."/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>         
-        <xsl:value-of select="."/>
-      </xsl:non-matching-substring>      
-    </xsl:analyze-string>
-  </xsl:template>
-  
+	<!-- <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> -->
 
-  <xsl:template match="processing-instruction()"/>
+	<xsl:template match="*">
+		<xsl:choose>
+			<xsl:when test="namespace-uri()=''">
+				<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+					name="{local-name(.)}">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<!-- On ne touche pas au teiHeader -->
-  
-  <xsl:template match="tei:teiHeader">    
-      <xsl:copy-of select="."/>    
-  </xsl:template>
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
+	</xsl:template>
 
-<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments hors texte à ignorer lors de l'import -->
-  
-  <xsl:template name="deleteAll"/>
+	<xsl:template match="text()">
+		<xsl:analyze-string select="."
+			regex="&amp;|&lt;|&gt;|--|\*(\w+)">
+			<xsl:matching-substring>
+				<xsl:choose>
+					<xsl:when test="matches(.,'&amp;')">
+						<expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
+					</xsl:when>
+					<xsl:when test="matches(.,'&lt;')">
+						<xsl:text>[</xsl:text>
+					</xsl:when>
+					<xsl:when test="matches(.,'&gt;')">
+						<xsl:text>]</xsl:text>
+					</xsl:when>
+					<!-- pose problème si se trouve dans les notes transformés en commentaires 
+						xml par le tokeniseur -->
+					<xsl:when test="matches(.,'--')">
+						<xsl:text> - </xsl:text>
+					</xsl:when>
+					<!-- Spécial FRANTEXT -->
+					<xsl:when test="matches(.,'\*(\w+)')">
+						<name xmlns="http://www.tei-c.org/ns/1.0" type="maj">
+							<xsl:value-of select="regex-group(1)" />
+						</name>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:value-of select="." />
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
 
-<!-- On supprime les balises non essentielles pour l'exploitation textométrique et susceptibles de poser des problèmes au tokeniseur,
-  mais on garde leur contenu qui fait partie du matériau textuel -->
-  
-  <xsl:template name="deleteTag">
-    <xsl:apply-templates/>
-  </xsl:template>
 
-<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, etc. -->
-  
-  <xsl:template name="makeNote">
-    <note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="text()"/>
-    </note>
-  </xsl:template>
-  
-<!-- On supprime toutes les balises à l'intérieur des notes-->
-  <xsl:template match="tei:note">
-    <xsl:copy>
-      <xsl:apply-templates select="text()"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="processing-instruction()" />
 
-<!-- On transforme en DIV typés les balises de niveau de division textuelle (pouvant contenir des p) -->
+	<!-- On ne touche pas au teiHeader -->
 
-  <xsl:template name="makeDiv">
-    <div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>  
+	<xsl:template match="tei:teiHeader">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
+	<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments 
+		hors texte à ignorer lors de l'import -->
 
-  <xsl:template name="makeAb">
-    <ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates/>
-    </ab>
-  </xsl:template>
+	<xsl:template name="deleteAll" />
 
-  <!-- on pré-tokenise les éléments équivalents à un mot -->
-  
-  <xsl:template name="makeWord">
-    <xsl:variable name="wordType">
-      <xsl:choose>
-        <xsl:when test="@type">
-          <xsl:value-of select="concat(local-name(),'-',@type)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name()"></xsl:value-of>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="descendant::tei:w or ancestor::tei:w">
-<!--            <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="seg">
-              <xsl:attribute name="type"><xsl:value-of select="local-name(.)"/></xsl:attribute>
-              <xsl:apply-templates select="*|@*[not(name()='type')]|processing-instruction()|comment()|text()"/>
-            </xsl:element>
--->
-        <xsl:apply-templates/> <!-- on supprime ces balises pour éviter la réduplication des mots-->
-      </xsl:when>
-      <xsl:otherwise>
-        <w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></w>
-      </xsl:otherwise>
-    </xsl:choose>    
-  </xsl:template>  
+	<!-- On supprime les balises non essentielles pour l'exploitation textométrique 
+		et susceptibles de poser des problèmes au tokeniseur, mais on garde leur 
+		contenu qui fait partie du matériau textuel -->
 
-<xsl:template name="makeName">
-  <xsl:variable name="nameType">
-    <xsl:choose>
-      <xsl:when test="@type">
-        <xsl:choose>
-          <xsl:when test="local-name()='name'"><xsl:value-of select='@type'/></xsl:when>
-          <xsl:otherwise><xsl:value-of select="concat(local-name(),'-',@type)"/></xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="local-name()"></xsl:value-of>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  <name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0">
-    <xsl:apply-templates/>
-  </name>
-</xsl:template>
+	<xsl:template name="deleteTag">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<!-- les l sont transformés en lb -->
-  
-  <xsl:template match="tei:l">
-    <lb xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:if test="@n">
-        <xsl:attribute name="n"><xsl:value-of select="@n"/></xsl:attribute>
-      </xsl:if>
-    </lb>
-    <xsl:apply-templates/>
-  </xsl:template>
-  
+	<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, 
+		etc. -->
 
-<!-- On met la ponctuation forte à l'extérieur de la balise foreign :
-Cet élément sera toujours à l'intérieur d'une phrase. Attention au risque
-de perdre les balises éventuelles à l'intérieur-->
-  
-  <xsl:template
-    match="tei:foreign[not(contains(@rend,'multi_s'))][matches(.,'[.!?]')]">
-    <xsl:variable name="lang">
-      <xsl:choose>
-        <xsl:when test="@lang"><xsl:value-of select="@lang"/></xsl:when>
-        <xsl:when test="@xml:lang"><xsl:value-of select="@xml:lang"/></xsl:when>
-        <xsl:otherwise>xx</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:for-each select="child::node()">
-      <xsl:choose>
-        <xsl:when test="self::text()">
-          <xsl:analyze-string select="." regex="([^.!?]*)([.?!]+)">
-            <xsl:matching-substring>
-              <xsl:element name="foreign" namespace="http://www.tei-c.org/ns/1.0">
-                <xsl:attribute name="lang"><xsl:value-of select="$lang"/></xsl:attribute>
-                <xsl:analyze-string select="regex-group(1)" regex="&amp;">
-                  <xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring>
-                  <xsl:non-matching-substring>         
-                    <xsl:value-of select="."/>
-                  </xsl:non-matching-substring>      
-                </xsl:analyze-string>
-              </xsl:element>
-              <xsl:value-of select="regex-group(2)"/>
-              <xsl:text> </xsl:text>
-            </xsl:matching-substring>
-            <xsl:non-matching-substring>
-              <xsl:analyze-string select="." regex="&amp;">
-                <xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring>
-                <xsl:non-matching-substring>         
-                  <xsl:value-of select="."/>
-                </xsl:non-matching-substring>      
-              </xsl:analyze-string>              
-            </xsl:non-matching-substring>
-          </xsl:analyze-string>          
-        </xsl:when>
-        <xsl:when test="self::*[not(descendant::text())]">
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:element name="foreign" namespace="http://www.tei-c.org/ns/1.0">
-            <xsl:attribute name="lang"><xsl:value-of select="$lang"/></xsl:attribute>
-            <xsl:apply-templates select="."/>          
-          </xsl:element>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  
-  
-  <xsl:template name="persname">
-      <xsl:choose>
-         <xsl:when test="tei:surname"><xsl:value-of select="tei:forename"/>&#160;<xsl:value-of select="tei:surname"/></xsl:when>
-         <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template name="makeNote">
+		<note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates select="text()" />
+		</note>
+	</xsl:template>
 
+	<!-- On supprime toutes les balises à l'intérieur des notes -->
+	<xsl:template match="tei:note">
+		<xsl:copy>
+			<xsl:apply-templates select="text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- On transforme en DIV typés les balises de niveau de division textuelle 
+		(pouvant contenir des p) -->
+
+	<xsl:template name="makeDiv">
+		<div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+
+	<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
+
+	<xsl:template name="makeAb">
+		<ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</ab>
+	</xsl:template>
+
+	<!-- on pré-tokenise les éléments équivalents à un mot -->
+
+	<xsl:template name="makeWord">
+		<xsl:variable name="wordType">
+			<xsl:choose>
+				<xsl:when test="@type">
+					<xsl:value-of select="concat(local-name(),'-',@type)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()"></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="descendant::tei:w or ancestor::tei:w">
+				<!-- <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="seg"> 
+					<xsl:attribute name="type"><xsl:value-of select="local-name(.)"/></xsl:attribute> 
+					<xsl:apply-templates select="*|@*[not(name()='type')]|processing-instruction()|comment()|text()"/> 
+					</xsl:element> -->
+				<xsl:apply-templates /> <!-- on supprime ces balises pour éviter la réduplication des mots -->
+			</xsl:when>
+			<xsl:otherwise>
+				<w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:apply-templates />
+				</w>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="makeName">
+		<xsl:variable name="nameType">
+			<xsl:choose>
+				<xsl:when test="@type">
+					<xsl:choose>
+						<xsl:when test="local-name()='name'">
+							<xsl:value-of select='@type' />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="concat(local-name(),'-',@type)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()"></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates />
+		</name>
+	</xsl:template>
+
+	<!-- les l sont transformés en lb -->
+
+	<xsl:template match="tei:l">
+		<lb xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:if test="@n">
+				<xsl:attribute name="n"><xsl:value-of
+					select="@n" /></xsl:attribute>
+			</xsl:if>
+		</lb>
+		<xsl:apply-templates />
+	</xsl:template>
+
+
+	<!-- On met la ponctuation forte à l'extérieur de la balise foreign : Cet 
+		élément sera toujours à l'intérieur d'une phrase. Attention au risque de 
+		perdre les balises éventuelles à l'intérieur -->
+
+	<xsl:template
+		match="tei:foreign[not(contains(@rend,'multi_s'))][matches(.,'[.!?]')]">
+		<xsl:variable name="lang">
+			<xsl:choose>
+				<xsl:when test="@lang">
+					<xsl:value-of select="@lang" />
+				</xsl:when>
+				<xsl:when test="@xml:lang">
+					<xsl:value-of select="@xml:lang" />
+				</xsl:when>
+				<xsl:otherwise>
+					xx
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:for-each select="child::node()">
+			<xsl:choose>
+				<xsl:when test="self::text()">
+					<xsl:analyze-string select="."
+						regex="([^.!?]*)([.?!]+)">
+						<xsl:matching-substring>
+							<xsl:element name="foreign"
+								namespace="http://www.tei-c.org/ns/1.0">
+								<xsl:attribute name="lang"><xsl:value-of
+									select="$lang" /></xsl:attribute>
+								<xsl:analyze-string select="regex-group(1)"
+									regex="&amp;">
+									<xsl:matching-substring>
+										<expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
+									</xsl:matching-substring>
+									<xsl:non-matching-substring>
+										<xsl:value-of select="." />
+									</xsl:non-matching-substring>
+								</xsl:analyze-string>
+							</xsl:element>
+							<xsl:value-of select="regex-group(2)" />
+							<xsl:text> </xsl:text>
+						</xsl:matching-substring>
+						<xsl:non-matching-substring>
+							<xsl:analyze-string select="." regex="&amp;">
+								<xsl:matching-substring>
+									<expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
+								</xsl:matching-substring>
+								<xsl:non-matching-substring>
+									<xsl:value-of select="." />
+								</xsl:non-matching-substring>
+							</xsl:analyze-string>
+						</xsl:non-matching-substring>
+					</xsl:analyze-string>
+				</xsl:when>
+				<xsl:when test="self::*[not(descendant::text())]">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:element name="foreign"
+						namespace="http://www.tei-c.org/ns/1.0">
+						<xsl:attribute name="lang"><xsl:value-of
+							select="$lang" /></xsl:attribute>
+						<xsl:apply-templates select="." />
+					</xsl:element>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+
+
+	<xsl:template name="persname">
+		<xsl:choose>
+			<xsl:when test="tei:surname">
+				<xsl:value-of select="tei:forename" />
+				&#160;
+				<xsl:value-of select="tei:surname" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/concordance_mot-pivot.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/concordance_mot-pivot.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/concordance_mot-pivot.xsl	(revision 2397)
@@ -1,50 +1,63 @@
 ﻿<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
-				xmlns:exsl="http://exslt.org/common">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:exsl="http://exslt.org/common">
 
 	<xsl:output method="text" encoding="UTF-8" indent="no" />
 
 	<xsl:strip-space elements="*" />
 
-	<xsl:param name="cx" select="30"/>
+	<xsl:param name="cx" select="30" />
 	<!-- vary this value to change the size of the context -->
-	
-	<xsl:param name="ntTypes">cat</xsl:param>
+
+	<xsl:param name="ntTypes">
+		cat
+	</xsl:param>
 	<!-- non-terminal pivot features to show -->
-	
-	<xsl:param name="tTypes" >pos</xsl:param>
+
+	<xsl:param name="tTypes">
+		pos
+	</xsl:param>
 	<!-- terminal pivot features to show -->
-	
-	<xsl:variable name="valueshownt" ><xsl:value-of select="$ntTypes" /></xsl:variable>
-	
-	<xsl:variable name="valueshowt" ><xsl:value-of select="$tTypes" /></xsl:variable>
 
-	<xsl:key name="idkey" match="t|nt" use="@id"/>
+	<xsl:variable name="valueshownt">
+		<xsl:value-of select="$ntTypes" />
+	</xsl:variable>
+
+	<xsl:variable name="valueshowt">
+		<xsl:value-of select="$tTypes" />
+	</xsl:variable>
+
+	<xsl:key name="idkey" match="t|nt" use="@id" />
 	<!-- Lezius' lookup key -->
 
-	<xsl:key name="idkey-reverse" match="edge" use="@idref"/>
+	<xsl:key name="idkey-reverse" match="edge" use="@idref" />
 	<!-- reverse lookup key -->
 
 	<xsl:template match="/">
-		
-		<!--Write a header-->
-		
+
+		<!--Write a header -->
+
 		<xsl:text>ID&#x09;LeftCxOutsideSnt&#x09;LeftCxInsideSnt&#x09;Pivot&#x09;</xsl:text>
-		
-		<xsl:for-each select="tokenize($valueshowt/node(), '\s+')">
-			
-			<xsl:value-of select="." /><xsl:text>&#x09;</xsl:text>
-			
+
+		<xsl:for-each
+			select="tokenize($valueshowt/node(), '\s+')">
+
+			<xsl:value-of select="." />
+			<xsl:text>&#x09;</xsl:text>
+
 		</xsl:for-each>
-		
+
 		<xsl:text>PivotStr&#x09;</xsl:text>
-		
-		<xsl:for-each select="tokenize($valueshownt/node(), '\s+')">
-			
-			<xsl:value-of select="." /><xsl:text>&#x09;</xsl:text>
-			
+
+		<xsl:for-each
+			select="tokenize($valueshownt/node(), '\s+')">
+
+			<xsl:value-of select="." />
+			<xsl:text>&#x09;</xsl:text>
+
 		</xsl:for-each>
-	
+
 		<xsl:text>RightCxInsideSnt&#x09;RightCxOutsideSnt&#x0D;&#x0A;</xsl:text>
 
 		<xsl:for-each select=".//match">
@@ -57,19 +70,24 @@
 
 			<!-- next, verify that pivot is a terminal node -->
 
-			<xsl:variable name="pivot-var" select="./variable[@name='#pivot']" />
+			<xsl:variable name="pivot-var"
+				select="./variable[@name='#pivot']" />
 
-			<xsl:variable name="pivot-node" select="key('idkey', exsl:node-set($pivot-var)/@idref)" />
+			<xsl:variable name="pivot-node"
+				select="key('idkey', exsl:node-set($pivot-var)/@idref)" />
 
 			<xsl:choose>
 
 				<xsl:when test="exsl:node-set($pivot-node)[self::t]">
 
-					<xsl:apply-templates select="exsl:node-set($pivot-node)" mode="write-table" />
+					<xsl:apply-templates
+						select="exsl:node-set($pivot-node)" mode="write-table" />
 
 				</xsl:when>
 
-				<xsl:otherwise><xsl:text>&#x09;Query error: #pivot is not a terminal node</xsl:text></xsl:otherwise>
+				<xsl:otherwise>
+					<xsl:text>&#x09;Query error: #pivot is not a terminal node</xsl:text>
+				</xsl:otherwise>
 
 			</xsl:choose>
 
@@ -80,85 +98,107 @@
 	</xsl:template>
 
 	<xsl:template match="t" mode="write-table">
-		
+
 		<!-- Context node is a t-node pivot -->
 
 		<!-- First stage: produce left context -->
 
-		<xsl:text>&#x09;</xsl:text><xsl:apply-templates select="." mode="left-cx" />
+		<xsl:text>&#x09;</xsl:text>
+		<xsl:apply-templates select="." mode="left-cx" />
 
 		<!-- Next stage, write the word in the pivot -->
 
-		<xsl:text>&#x09;</xsl:text><xsl:apply-templates select="." mode="output" />
+		<xsl:text>&#x09;</xsl:text>
+		<xsl:apply-templates select="." mode="output" />
 
 		<!-- Next stage, write other required terminal attributes -->
-		
+
 		<xsl:variable name="thispivot" select="." />
-		
+
 		<xsl:text>&#x09;</xsl:text>
-		<xsl:for-each select="tokenize($valueshowt/node(), '\s+')">
-			
-			<xsl:variable name="attr" select="."/>
-			
-			<xsl:value-of select="$thispivot/@*[name()=$attr]"/><xsl:text>&#x09;</xsl:text>
-			
+		<xsl:for-each
+			select="tokenize($valueshowt/node(), '\s+')">
+
+			<xsl:variable name="attr" select="." />
+
+			<xsl:value-of select="$thispivot/@*[name()=$attr]" />
+			<xsl:text>&#x09;</xsl:text>
+
 		</xsl:for-each>
-		
+
 		<!-- Next stage, write the lexical string contained in the parent NT node -->
 
-		<xsl:apply-templates select="key('idkey-reverse', @id)/ancestor::nt" mode="output" />
+		<xsl:apply-templates
+			select="key('idkey-reverse', @id)/ancestor::nt" mode="output" />
 
 		<!-- Next stage, write the required <nt /> properties -->
-		
-		<xsl:variable name="pivotnt" select="key('idkey-reverse', @id)/.." />
-		
+
+		<xsl:variable name="pivotnt"
+			select="key('idkey-reverse', @id)/.." />
+
 		<xsl:text>&#x09;</xsl:text>
-		<xsl:for-each select="tokenize($valueshownt/node(), '\s+')">
-			
-			<xsl:variable name="attr" select="."/>
-			
-			<xsl:value-of select="$pivotnt/@*[name()=$attr]"/><xsl:text>&#x09;</xsl:text>
-			
+		<xsl:for-each
+			select="tokenize($valueshownt/node(), '\s+')">
+
+			<xsl:variable name="attr" select="." />
+
+			<xsl:value-of select="$pivotnt/@*[name()=$attr]" />
+			<xsl:text>&#x09;</xsl:text>
+
 		</xsl:for-each>
 
 		<!-- Next stage, write the right-cx -->
 
-		<xsl:apply-templates select="." mode="right-cx"/>
+		<xsl:apply-templates select="." mode="right-cx" />
 
 	</xsl:template>
 
 	<xsl:template match="t" mode="left-cx">
 
 		<xsl:variable name="pivot-node" select="." />
-		<xsl:variable name="this-sid"><xsl:value-of select="ancestor::s/@id" /></xsl:variable>
+		<xsl:variable name="this-sid">
+			<xsl:value-of select="ancestor::s/@id" />
+		</xsl:variable>
 
-		<xsl:for-each select="preceding::t[position() &lt; number($cx)]" >
+		<xsl:for-each
+			select="preceding::t[position() &lt; number($cx)]">
 			<!-- xsl:sort select="@id" / -->
 			<xsl:choose>
 				<!-- switch from out-of-sentence to in-sentence context -->
-				<xsl:when test="ancestor::s[@id = $this-sid] and not(preceding-sibling::t)">
+				<xsl:when
+					test="ancestor::s[@id = $this-sid] and not(preceding-sibling::t)">
 					<xsl:text>&#x09;</xsl:text>
 				</xsl:when>
 
 				<!-- first word of the context and in the same sentence -->
 
-				<xsl:when test="position() = 1 and ancestor::s[@id=$this-sid]"><xsl:text>&#x09;</xsl:text></xsl:when>
+				<xsl:when
+					test="position() = 1 and ancestor::s[@id=$this-sid]">
+					<xsl:text>&#x09;</xsl:text>
+				</xsl:when>
 
 				<!-- first word of the context -->
 
 				<xsl:when test="position() = 1" />
 
 				<!-- first word in a sentence -->
-				<xsl:when test="not(preceding-sibling::t)"><xsl:text> / </xsl:text></xsl:when>
+				<xsl:when test="not(preceding-sibling::t)">
+					<xsl:text> / </xsl:text>
+				</xsl:when>
 
-				<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
+				<xsl:otherwise>
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
 
 			</xsl:choose>
 
 			<xsl:apply-templates select="." mode="output" />
-	
+
 			<!-- add blank column if there's no in-sentence context -->
-			<xsl:if test="position() = last() and ancestor::s[@id != $this-sid]"><xsl:text>&#x09;</xsl:text></xsl:if>
+			<xsl:if
+				test="position() = last() and ancestor::s[@id != $this-sid]">
+				<xsl:text>&#x09;</xsl:text>
+			</xsl:if>
 
 		</xsl:for-each>
 
@@ -167,13 +207,17 @@
 	<xsl:template match="t" mode="right-cx">
 
 		<xsl:variable name="pivot-node" select="." />
-		<xsl:variable name="this-sid"><xsl:value-of select="ancestor::s/@id" /></xsl:variable>
+		<xsl:variable name="this-sid">
+			<xsl:value-of select="ancestor::s/@id" />
+		</xsl:variable>
 
-		<xsl:for-each select="following::t[position() &lt; number($cx)]" >
+		<xsl:for-each
+			select="following::t[position() &lt; number($cx)]">
 			<!-- xsl:sort select="@id" / -->
 			<xsl:choose>
 				<!-- switch from in-sentence to out-of-sentence context -->
-				<xsl:when test="ancestor::s[@id != $this-sid] and preceding::t[position()=1]/ancestor::s[@id = $this-sid]">
+				<xsl:when
+					test="ancestor::s[@id != $this-sid] and preceding::t[position()=1]/ancestor::s[@id = $this-sid]">
 					<xsl:text>&#x09;</xsl:text>
 				</xsl:when>
 
@@ -182,33 +226,40 @@
 				<xsl:when test="position() = 1" />
 
 				<!-- first word in a sentence -->
-				<xsl:when test="not(preceding-sibling::t)"><xsl:text> / </xsl:text></xsl:when>
+				<xsl:when test="not(preceding-sibling::t)">
+					<xsl:text> / </xsl:text>
+				</xsl:when>
 
-				<xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
+				<xsl:otherwise>
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
 
 			</xsl:choose>
 			<xsl:apply-templates select="." mode="output" />
 			<!-- add blank column if there's no out-of-sentence context -->
-			<xsl:if test="position() = last() and ancestor::s[@id = $this-sid]"><xsl:text>&#x09;</xsl:text></xsl:if>
+			<xsl:if
+				test="position() = last() and ancestor::s[@id = $this-sid]">
+				<xsl:text>&#x09;</xsl:text>
+			</xsl:if>
 
 		</xsl:for-each>
 
 	</xsl:template>
 
 	<xsl:template match="nt|t|s" mode="id">
-		
+
 		<xsl:value-of select="@id" />
 
 	</xsl:template>
 
 	<xsl:template match="variable" mode="name">
-		
+
 		<xsl:value-of select="@name" />
 
 	</xsl:template>
 
 	<xsl:template match="t" mode="output">
-		
+
 		<xsl:value-of select="@word" />
 
 	</xsl:template>
@@ -217,11 +268,13 @@
 
 	<xsl:template match="nt" mode="output">
 
-		<!-- prints lexical content of nt node in correct order with constituents not in the pivot bracketed -->
+		<!-- prints lexical content of nt node in correct order with constituents 
+			not in the pivot bracketed -->
 
 		<!-- stuff a copy of all the tnodes in the pivot in $in-pivot -->
 		<xsl:variable name='in-pivot'>
-			<xsl:apply-templates select="." mode="get-terminals" />
+			<xsl:apply-templates select="."
+				mode="get-terminals" />
 		</xsl:variable>
 
 		<!-- create a copy of terminals, with an attribute "in-pivot='True'" -->
@@ -230,16 +283,19 @@
 
 			<xsl:for-each select="ancestor::s//t">
 
-				<xsl:variable name="current-id"><xsl:value-of select="@id" /></xsl:variable>
+				<xsl:variable name="current-id">
+					<xsl:value-of select="@id" />
+				</xsl:variable>
 
 				<!-- copy element into variable -->
 
 				<xsl:copy>
 
-					<xsl:if test="exsl:node-set($in-pivot)//t[@id = $current-id]">
+					<xsl:if
+						test="exsl:node-set($in-pivot)//t[@id = $current-id]">
 						<xsl:attribute name="in-pivot">True</xsl:attribute>
 					</xsl:if>
-					<xsl:apply-templates select="@*" mode="copy"/>
+					<xsl:apply-templates select="@*" mode="copy" />
 
 				</xsl:copy>
 
@@ -247,27 +303,43 @@
 
 		</xsl:variable>
 
-		<!-- $new-terminals is in the correct order, so we can calculate the limits of the segment -->
+		<!-- $new-terminals is in the correct order, so we can calculate the limits 
+			of the segment -->
 
-		<xsl:variable name="first-pivot-id"><xsl:value-of select="exsl:node-set($new-terminals)//t[@in-pivot][position()=1]/@id" /></xsl:variable>
+		<xsl:variable name="first-pivot-id">
+			<xsl:value-of
+				select="exsl:node-set($new-terminals)//t[@in-pivot][position()=1]/@id" />
+		</xsl:variable>
 
-		<xsl:variable name="last-pivot-id"><xsl:value-of select="exsl:node-set($new-terminals)//t[@in-pivot][position()=last()]/@id" /></xsl:variable>
+		<xsl:variable name="last-pivot-id">
+			<xsl:value-of
+				select="exsl:node-set($new-terminals)//t[@in-pivot][position()=last()]/@id" />
+		</xsl:variable>
 
 		<!-- At last! At last! We can output the MF! -->
 
 		<xsl:for-each select="exsl:node-set($new-terminals)//t">
 
-			<xsl:if test="@id = $first-pivot-id or @id = $last-pivot-id or (preceding-sibling::t[@id = $first-pivot-id] and following-sibling::t[@id = $last-pivot-id])">
+			<xsl:if
+				test="@id = $first-pivot-id or @id = $last-pivot-id or (preceding-sibling::t[@id = $first-pivot-id] and following-sibling::t[@id = $last-pivot-id])">
 
 				<!-- print the word -->
-				
-				<xsl:if test="not(@id = $first-pivot-id)"><xsl:text> </xsl:text></xsl:if>
 
+				<xsl:if test="not(@id = $first-pivot-id)">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+
 				<xsl:choose>
 
-					<xsl:when test="@in-pivot"><xsl:apply-templates select="." mode="output" /></xsl:when>
+					<xsl:when test="@in-pivot">
+						<xsl:apply-templates select="." mode="output" />
+					</xsl:when>
 
-					<xsl:otherwise><xsl:text>[</xsl:text><xsl:apply-templates select="." mode="output" /><xsl:text>]</xsl:text></xsl:otherwise>
+					<xsl:otherwise>
+						<xsl:text>[</xsl:text>
+						<xsl:apply-templates select="." mode="output" />
+						<xsl:text>]</xsl:text>
+					</xsl:otherwise>
 
 				</xsl:choose>
 
@@ -280,7 +352,7 @@
 	<xsl:template match="@*" mode="copy">
 		<!-- returns a copy of all attribute nodes -->
 		<xsl:copy />
-	</xsl:template>	
+	</xsl:template>
 
 	<xsl:template match="t" mode="get-terminals">
 
@@ -292,8 +364,9 @@
 
 		<xsl:for-each select="edge">
 
-			<xsl:apply-templates select="key('idkey', @idref)" mode="get-terminals" />
-	
+			<xsl:apply-templates
+				select="key('idkey', @idref)" mode="get-terminals" />
+
 		</xsl:for-each>
 
 	</xsl:template>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-addRef.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-addRef.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-posttok-addRef.xsl	(revision 2397)
@@ -1,103 +1,99 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:txm="http://textometrie.org/ns/1.0"
-  exclude-result-prefixes="tei edate" xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/ns/1.0"
+	exclude-result-prefixes="tei edate"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
 
-  <!--
-This software is dual-licensed:
+	<!-- This software is dual-licensed: 1. Distributed under a Creative Commons 
+		Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+		2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution 
+		and use in source and binary forms, with or without modification, are permitted 
+		provided that the following conditions are met: * Redistributions of source 
+		code must retain the above copyright notice, this list of conditions and 
+		the following disclaimer. * Redistributions in binary form must reproduce 
+		the above copyright notice, this list of conditions and the following disclaimer 
+		in the documentation and/or other materials provided with the distribution. 
+		This software is provided by the copyright holders and contributors "as is" 
+		and any express or implied warranties, including, but not limited to, the 
+		implied warranties of merchantability and fitness for a particular purpose 
+		are disclaimed. In no event shall the copyright holder or contributors be 
+		liable for any direct, indirect, incidental, special, exemplary, or consequential 
+		damages (including, but not limited to, procurement of substitute goods or 
+		services; loss of use, data, or profits; or business interruption) however 
+		caused and on any theory of liability, whether in contract, strict liability, 
+		or tort (including negligence or otherwise) arising in any way out of the 
+		use of this software, even if advised of the possibility of such damage. 
+		This stylesheet adds a ref attribute to w elements that will be used for 
+		references in TXM concordances. Can be used with TXM XTZ import module. Written 
+		by Alexei Lavrentiev, UMR 5317 IHRIM, 2017 -->
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+	<!-- General patterns: all elements, attributes, comments and processing 
+		instructions are copied -->
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+	<xsl:variable name="filename">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.xml$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
 
-     
-This stylesheet adds a ref attribute to w elements that will be used for
-references in TXM concordances. Can be used with TXM XTZ import module.
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-Written by Alexei Lavrentiev, UMR 5317 IHRIM, 2017
-  -->
+	<xsl:template match="*" mode="position">
+		<xsl:value-of select="count(preceding-sibling::*)" />
+	</xsl:template>
 
+	<xsl:template
+		match="@*|comment()|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> 
-  
-  
-  <!-- General patterns: all elements, attributes, comments and processing instructions are copied -->
-  
-  <xsl:variable name="filename">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.xml$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
-  
-  
-  <xsl:template match="*">      
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>    
-  </xsl:template>
-  
-  <xsl:template match="*" mode="position"><xsl:value-of select="count(preceding-sibling::*)"/></xsl:template>
+	<xsl:template match="*:w">
+		<xsl:variable name="ref">
+			<xsl:choose>
+				<xsl:when test="ancestor::*:text/@*:id">
+					<xsl:value-of select="ancestor::*:text[1]/@*:id[1]" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$filename" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:if test="preceding::*:pb[1]/@n">
+				<xsl:text>, p. </xsl:text>
+				<xsl:value-of select="preceding::*:pb[1]/@n" />
+			</xsl:if>
+			<xsl:if
+				test="(ancestor::*:text/@*:id or preceding::*:pb[1]/@n) and preceding::*:lb[1]/@n">
+				<xsl:text>, </xsl:text>
+			</xsl:if>
+			<xsl:if test="preceding::*:lb[1]/@n">
+				<xsl:text>l. </xsl:text>
+				<xsl:value-of select="preceding::*:lb[1]/@n" />
+			</xsl:if>
+		</xsl:variable>
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="ref"><xsl:value-of
+				select="$ref" /></xsl:attribute>
+			<xsl:apply-templates
+				select="*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="@*|comment()|processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
-    
-  <xsl:template match="*:w">
-    <xsl:variable name="ref">
-      <xsl:choose>
-        <xsl:when test="ancestor::*:text/@*:id">
-          <xsl:value-of select="ancestor::*:text[1]/@*:id[1]"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$filename"/>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:if test="preceding::*:pb[1]/@n">
-        <xsl:text>, p. </xsl:text>
-        <xsl:value-of select="preceding::*:pb[1]/@n"/>
-      </xsl:if>
-      <xsl:if test="(ancestor::*:text/@*:id or preceding::*:pb[1]/@n) and preceding::*:lb[1]/@n">
-        <xsl:text>, </xsl:text>
-      </xsl:if>
-      <xsl:if test="preceding::*:lb[1]/@n">
-        <xsl:text>l. </xsl:text>
-        <xsl:value-of select="preceding::*:lb[1]/@n"/>
-      </xsl:if>
-    </xsl:variable>
-        <xsl:copy>
-          <xsl:apply-templates select="@*"/>
-          <xsl:attribute name="ref"><xsl:value-of select="$ref"/></xsl:attribute>
-          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-  </xsl:template>  
-
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-bnc_oral-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-bnc_oral-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-bnc_oral-xmlw.xsl	(revision 2397)
@@ -1,124 +1,161 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de préparation de fichiers BNC oral à l'importation dans TXM
-      (module XML/W+CSV).
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2015, CNRS / ICAR (Cédilles-CACTUS)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de préparation de fichiers BNC oral à l'importation dans
+			TXM
+			(module XML/W+CSV).
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2015, CNRS / ICAR (Cédilles-CACTUS)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
 	<!-- Listes des balises par type de traitement. -->
-	
-	<!--Par défaut, les balises sont conservées (les espaces de nommage sont
-	respectés). On peut utiliser les paramètres ci-dessous pour indiquer les balises
-	à supprimer en conservant ou non leur contenu--> 
-	
+
+	<!--Par défaut, les balises sont conservées (les espaces de nommage sont 
+		respectés). On peut utiliser les paramètres ci-dessous pour indiquer les 
+		balises à supprimer en conservant ou non leur contenu -->
+
 	<!-- balises à supprimer avec leur contenu -->
-	
-	<xsl:param name="deleteAll">teiHeader</xsl:param>
-	
-	<xsl:template match="*[matches(name(),concat('^',$deleteAll,'$'))]"/>
-	
-	<!-- balises à supprimer en conservant le contenu-->
-	
+
+	<xsl:param name="deleteAll">
+		teiHeader
+	</xsl:param>
+
+	<xsl:template
+		match="*[matches(name(),concat('^',$deleteAll,'$'))]" />
+
+	<!-- balises à supprimer en conservant le contenu -->
+
 	<xsl:param name="deleteTag"></xsl:param>
-	
-	<xsl:template match="*[matches(name(),concat('^',$deleteTag,'$'))]">
-		<xsl:apply-templates/>
+
+	<xsl:template
+		match="*[matches(name(),concat('^',$deleteTag,'$'))]">
+		<xsl:apply-templates />
 	</xsl:template>
-	
-  
-  <xsl:template match="*">
-  	<xsl:copy>
-  		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>	
-  	</xsl:copy>
-  </xsl:template>
 
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
-	
-	<xsl:template match="processing-instruction()"/>
-	
-	<xsl:template match="text()"><xsl:value-of select="."/></xsl:template>
 
-<xsl:template match="stext">
-  <xsl:element name="text">
-    <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
-    <xsl:attribute name="title"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/fileDesc/titleStmt/title[1])"/></xsl:attribute>
-    <xsl:attribute name="creation"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/creation[1])"/></xsl:attribute>
-    <xsl:attribute name="dlee"><xsl:value-of select="/bncDoc/teiHeader/profileDesc/textClass/classCode[@scheme='DLEE']"/></xsl:attribute>
-    <xsl:choose>
-      <xsl:when test="not(descendant::div[@decls])">
-        
-        <xsl:element name="div">
-          <xsl:attribute name="placename"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/placeName[1])"/></xsl:attribute>
-          <xsl:attribute name="locale"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/locale[1])"/></xsl:attribute>
-          <xsl:attribute name="activity"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/activity[1])"/></xsl:attribute>
-          <xsl:attribute name="activity-spont"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/activity[1]/@spont)"/></xsl:attribute>
-          <xsl:attribute name="recordingdate"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/creation[1])"/></xsl:attribute>
-          <xsl:attribute name="dlee"><xsl:value-of select="/bncDoc/teiHeader/profileDesc/textClass/classCode[@scheme='DLEE']"/></xsl:attribute>
-          <xsl:apply-templates/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
-    </xsl:choose>    
-  </xsl:element>
-</xsl:template>
-  
-  <xsl:template match="div[@decls]">
-    <xsl:variable name="decls"><xsl:value-of select="@decls"/></xsl:variable>
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:attribute name="placename"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[matches($decls,@xml:id)]/placeName[1])"/></xsl:attribute>
-      <xsl:attribute name="locale"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[matches($decls,@xml:id)]/locale[1])"/></xsl:attribute>
-      <xsl:attribute name="activity"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[matches($decls,@xml:id)]/activity[1])"/></xsl:attribute>
-      <xsl:attribute name="activity-spont"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/activity[1]/@spont)"/></xsl:attribute>
-      
-      <xsl:attribute name="recordingdate"><xsl:value-of select="normalize-space(/bncDoc/teiHeader/fileDesc/sourceDesc/recordingStmt/recording[matches($decls,@xml:id)]/@date)"/></xsl:attribute>
-      <xsl:attribute name="dlee"><xsl:value-of select="/bncDoc/teiHeader/profileDesc/textClass/classCode[@scheme='DLEE']"/></xsl:attribute>
-      <xsl:apply-templates/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:template match="processing-instruction()" />
+
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template match="stext">
+		<xsl:element name="text">
+			<xsl:attribute name="type"><xsl:value-of
+				select="@type" /></xsl:attribute>
+			<xsl:attribute name="title"><xsl:value-of
+				select="normalize-space(/bncDoc/teiHeader/fileDesc/titleStmt/title[1])" /></xsl:attribute>
+			<xsl:attribute name="creation"><xsl:value-of
+				select="normalize-space(/bncDoc/teiHeader/profileDesc/creation[1])" /></xsl:attribute>
+			<xsl:attribute name="dlee"><xsl:value-of
+				select="/bncDoc/teiHeader/profileDesc/textClass/classCode[@scheme='DLEE']" /></xsl:attribute>
+			<xsl:choose>
+				<xsl:when test="not(descendant::div[@decls])">
+
+					<xsl:element name="div">
+						<xsl:attribute name="placename"><xsl:value-of
+							select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/placeName[1])" /></xsl:attribute>
+						<xsl:attribute name="locale"><xsl:value-of
+							select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/locale[1])" /></xsl:attribute>
+						<xsl:attribute name="activity"><xsl:value-of
+							select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/activity[1])" /></xsl:attribute>
+						<xsl:attribute name="activity-spont"><xsl:value-of
+							select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/activity[1]/@spont)" /></xsl:attribute>
+						<xsl:attribute name="recordingdate"><xsl:value-of
+							select="normalize-space(/bncDoc/teiHeader/profileDesc/creation[1])" /></xsl:attribute>
+						<xsl:attribute name="dlee"><xsl:value-of
+							select="/bncDoc/teiHeader/profileDesc/textClass/classCode[@scheme='DLEE']" /></xsl:attribute>
+						<xsl:apply-templates />
+					</xsl:element>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="div[@decls]">
+		<xsl:variable name="decls">
+			<xsl:value-of select="@decls" />
+		</xsl:variable>
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="placename"><xsl:value-of
+				select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[matches($decls,@xml:id)]/placeName[1])" /></xsl:attribute>
+			<xsl:attribute name="locale"><xsl:value-of
+				select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[matches($decls,@xml:id)]/locale[1])" /></xsl:attribute>
+			<xsl:attribute name="activity"><xsl:value-of
+				select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[matches($decls,@xml:id)]/activity[1])" /></xsl:attribute>
+			<xsl:attribute name="activity-spont"><xsl:value-of
+				select="normalize-space(/bncDoc/teiHeader/profileDesc/settingDesc/setting[1]/activity[1]/@spont)" /></xsl:attribute>
+
+			<xsl:attribute name="recordingdate"><xsl:value-of
+				select="normalize-space(/bncDoc/teiHeader/fileDesc/sourceDesc/recordingStmt/recording[matches($decls,@xml:id)]/@date)" /></xsl:attribute>
+			<xsl:attribute name="dlee"><xsl:value-of
+				select="/bncDoc/teiHeader/profileDesc/textClass/classCode[@scheme='DLEE']" /></xsl:attribute>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
 	<xsl:template match="u">
-	  <xsl:copy>
-	    <xsl:variable name="who"><xsl:value-of select="@who"/></xsl:variable>
-	    <xsl:attribute name="who"><xsl:value-of select="$who"/></xsl:attribute>
-	    <xsl:for-each select="/bncDoc/teiHeader/profileDesc/particDesc/person[@xml:id=$who]/@*[not(local-name()='id')]">
-	      <xsl:attribute name="{lower-case(local-name())}"><xsl:value-of select="."/></xsl:attribute>
-	    </xsl:for-each>
-	    <xsl:for-each select="/bncDoc/teiHeader/profileDesc/particDesc/person[@xml:id=$who]/*">
-	      <xsl:attribute name="{lower-case(local-name())}"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
-	    </xsl:for-each>
-	    <xsl:apply-templates/>
-	  </xsl:copy>
+		<xsl:copy>
+			<xsl:variable name="who">
+				<xsl:value-of select="@who" />
+			</xsl:variable>
+			<xsl:attribute name="who"><xsl:value-of
+				select="$who" /></xsl:attribute>
+			<xsl:for-each
+				select="/bncDoc/teiHeader/profileDesc/particDesc/person[@xml:id=$who]/@*[not(local-name()='id')]">
+				<xsl:attribute name="{lower-case(local-name())}"><xsl:value-of
+					select="." /></xsl:attribute>
+			</xsl:for-each>
+			<xsl:for-each
+				select="/bncDoc/teiHeader/profileDesc/particDesc/person[@xml:id=$who]/*">
+				<xsl:attribute name="{lower-case(local-name())}"><xsl:value-of
+					select="normalize-space(.)" /></xsl:attribute>
+			</xsl:for-each>
+			<xsl:apply-templates />
+		</xsl:copy>
 	</xsl:template>
-	
-	
-	
+
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibvh-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibvh-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibvh-xmlw.xsl	(revision 2397)
@@ -1,85 +1,74 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:txm="http://textometrie.org/1.0"
-  exclude-result-prefixes="tei edate" version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:txm="http://textometrie.org/1.0"
+	exclude-result-prefixes="tei edate" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Cette feuille de style prépare les textes BVH à l'import BFM
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
-  
-  <!-- !!! Enlever &#x2028 ou &#8232; dans 1600_BeroaldRich.xml !!! -->
-  
-  <!--
-    Modifications par AL le  2012-01-25
-    g dépalacé de "deleteAll" vers "deleteTag"
-    classe de balise "name" créée
-    (geogName, placeName, persName et name)
-  -->
-  
-  <!-- 
-    Modifications par LBe le 2012-02-17
-    Transformation automatique des esperluettes dans les métadonnées
-    Suppression des balises label et heraldry
-    Signed n'est plus transformé en ab
-    opener est transformé en ab
-    L'institution et le dépôt sont récupérés pour le lieu de conservation
-  -->
-  
-  <!-- Modifications par AL le 2012-02-20
-    rolename -> roleName
-    suppression des balises surname et forename
-  -->
-  
-  <!-- Modifications par LBe le 2012-03-09
-    Automatisation du nommage des sorties
-  -->
-  
-  <!-- Modifications par LBe le 2013-03-05
-    Ajout des nouveaux descripteurs pour Presto
-  -->
-  
-  <!-- Modifications par LBe le 2014-01-10
-    
-  -->
-  
-<!-- Modifications par AL le 2014-01-13
-    - Fusion des versions BVH et BFM
-    - Détectioon des mots coupés (detextBrokenWord)
--->
-  
-  <!-- Listes des balises par type de traitement (les templates sont plus bas) -->
-  
-  <!-- balises à supprimer avec leur contenu -->
-  <xsl:template match="tei:figDesc|tei:figure|tei:fw
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Cette feuille de style prépare les textes BVH à l'import BFM
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<!-- !!! Enlever &#x2028 ou &#8232; dans 1600_BeroaldRich.xml !!! -->
+
+	<!-- Modifications par AL le 2012-01-25 g dépalacé de "deleteAll" vers "deleteTag" 
+		classe de balise "name" créée (geogName, placeName, persName et name) -->
+
+	<!-- Modifications par LBe le 2012-02-17 Transformation automatique des 
+		esperluettes dans les métadonnées Suppression des balises label et heraldry 
+		Signed n'est plus transformé en ab opener est transformé en ab L'institution 
+		et le dépôt sont récupérés pour le lieu de conservation -->
+
+	<!-- Modifications par AL le 2012-02-20 rolename -> roleName suppression 
+		des balises surname et forename -->
+
+	<!-- Modifications par LBe le 2012-03-09 Automatisation du nommage des sorties -->
+
+	<!-- Modifications par LBe le 2013-03-05 Ajout des nouveaux descripteurs 
+		pour Presto -->
+
+	<!-- Modifications par LBe le 2014-01-10 -->
+
+	<!-- Modifications par AL le 2014-01-13 - Fusion des versions BVH et BFM 
+		- Détectioon des mots coupés (detextBrokenWord) -->
+
+	<!-- Listes des balises par type de traitement (les templates sont plus 
+		bas) -->
+
+	<!-- balises à supprimer avec leur contenu -->
+	<xsl:template
+		match="tei:figDesc|tei:figure|tei:fw
     |tei:space">
-    <xsl:call-template name="deleteAll"/>
-  </xsl:template>
-  
-  <!-- balises à supprimer, contenu à conserver -->  
-  <xsl:template match="tei:castItem|tei:castGroup[ancestor::tei:castList]
+		<xsl:call-template name="deleteAll" />
+	</xsl:template>
+
+	<!-- balises à supprimer, contenu à conserver -->
+	<xsl:template
+		match="tei:castItem|tei:castGroup[ancestor::tei:castList]
     |tei:castList[ancestor::tei:p]|tei:cell|tei:cit|tei:date
     |tei:forename|tei:g|tei:head[parent::tei:list]|tei:heraldry|tei:hi|tei:item|tei:label|tei:lem
     |tei:list[ancestor::tei:p|ancestor::tei:ab]|tei:lg[child::tei:lg|ancestor::tei:sp]
@@ -87,340 +76,382 @@
     |tei:ref|tei:role|tei:roleDesc
     |tei:row|tei:salute|tei:signed[ancestor::tei:closer]|tei:speaker|tei:stage[ancestor::tei:p|ancestor::tei:ab]
     |tei:surname|tei:table[ancestor::tei:p]|tei:term|tei:unclear">
-    <xsl:call-template name="deleteTag"/>
-  </xsl:template>
-  
-  <!-- balises à transformer en notes-->
-<!--  <xsl:template match="tei:bibl[not(ancestor::tei:note)]
-    |tei:rdg[parent::tei:app and not(ancestor::tei:note)]">
-    <xsl:call-template name="makeNote"/>
-  </xsl:template>
--->  
-  <!-- balises de noms à indexer -->
-  
-  <xsl:template match="tei:name
+		<xsl:call-template name="deleteTag" />
+	</xsl:template>
+
+	<!-- balises à transformer en notes -->
+	<!-- <xsl:template match="tei:bibl[not(ancestor::tei:note)] |tei:rdg[parent::tei:app 
+		and not(ancestor::tei:note)]"> <xsl:call-template name="makeNote"/> </xsl:template> -->
+	<!-- balises de noms à indexer -->
+
+	<xsl:template
+		match="tei:name
     |tei:geogName
     |tei:persName
     |tei:placeName
     |tei:roleName">
-    <xsl:call-template name="makeName"/>
-  </xsl:template>
-  
-  <!-- à transformer en W -->
-  
-  <xsl:template match="tei:abbr[not(parent::tei:choice)]
+		<xsl:call-template name="makeName" />
+	</xsl:template>
+
+	<!-- à transformer en W -->
+
+	<xsl:template
+		match="tei:abbr[not(parent::tei:choice)]
     |tei:num[matches(.,'.')]">
-    <xsl:call-template name="makeWord"/>
-  </xsl:template>
-  
-  <!-- à transformer en AB typé -->
-  
-  <xsl:template match="tei:byline|tei:lg[not(child::tei:lg or ancestor::tei:sp)]|tei:list[not(ancestor::tei:p|ancestor::tei:ab)]
+		<xsl:call-template name="makeWord" />
+	</xsl:template>
+
+	<!-- à transformer en AB typé -->
+
+	<xsl:template
+		match="tei:byline|tei:lg[not(child::tei:lg or ancestor::tei:sp)]|tei:list[not(ancestor::tei:p|ancestor::tei:ab)]
     |tei:closer|tei:opener|tei:sp|tei:castGroup[not(ancestor::tei:castList)]|tei:castList[not(ancestor::tei:p)]
     |tei:signed[not(ancestor::tei:closer)]
     |tei:stage[not(ancestor::tei:p|ancestor::tei:ab)]
     |tei:table[not(ancestor::tei:p)]
     |tei:trailer">
-    <xsl:call-template name="makeAb"/>
-  </xsl:template>
-  
-  <!-- à transformer en DIV typé -->
-  
-  <xsl:template match="tei:set">
-    <xsl:call-template name="makeDiv"/>
-  </xsl:template>
+		<xsl:call-template name="makeAb" />
+	</xsl:template>
 
-<!-- Partie générale : on copie les éléments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
-<!-- + nommage auto des fichiers -->
-  
-  <xsl:variable name="filedir">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(1)"></xsl:value-of>
-      </xsl:matching-substring>
-    </xsl:analyze-string></xsl:variable>
-  
-  
-  <xsl:template match="/">
-    <xsl:variable name="compare1" select="//tei:TEI/@xml:id"/>
-    <!--<xsl:variable name="compare2" select="document('Nommage_Output_TXM.xml')//name/@id"/>-->
-    <xsl:variable name="compare2" select="$nommage//name/@id"/>
-    <xsl:variable name="name" select="document('Nommage_Output_TXM.xml')//name"/>
-      <xsl:if test="$compare1 = $compare2">
-    <xsl:result-document href="{concat($filedir,'/out/',$name[@id=$compare1], '.xml')}">
-      <xsl:apply-templates/>  
-    </xsl:result-document>
-      </xsl:if>      
-  </xsl:template>
-  
-  
-  
-  <xsl:template match="*">    
-    <xsl:if test="descendant::tei:pb and (parent::tei:text or (position() &gt; 2))">
- <!-- on déplace les pb initiaux avant la balise de l'élément le plus haut -->
-      <xsl:call-template name="raisePb"/>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="namespace-uri()=''">
-        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>  
-  </xsl:template>
+	<!-- à transformer en DIV typé -->
 
-  <xsl:template match="@*|comment()|text()|processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
-	
+	<xsl:template match="tei:set">
+		<xsl:call-template name="makeDiv" />
+	</xsl:template>
+
+	<!-- Partie générale : on copie les éléments, les attributs, le texte, les 
+		commentaires, on supprime mes prrocessing intstructions -->
+	<!-- + nommage auto des fichiers -->
+
+	<xsl:variable name="filedir">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(1)"></xsl:value-of>
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+
+	<xsl:template match="/">
+		<xsl:variable name="compare1" select="//tei:TEI/@xml:id" />
+		<!--<xsl:variable name="compare2" select="document('Nommage_Output_TXM.xml')//name/@id"/> -->
+		<xsl:variable name="compare2" select="$nommage//name/@id" />
+		<xsl:variable name="name"
+			select="document('Nommage_Output_TXM.xml')//name" />
+		<xsl:if test="$compare1 = $compare2">
+			<xsl:result-document
+				href="{concat($filedir,'/out/',$name[@id=$compare1], '.xml')}">
+				<xsl:apply-templates />
+			</xsl:result-document>
+		</xsl:if>
+	</xsl:template>
+
+
+
+	<xsl:template match="*">
+		<xsl:if
+			test="descendant::tei:pb and (parent::tei:text or (position() &gt; 2))">
+			<!-- on déplace les pb initiaux avant la balise de l'élément le plus haut -->
+			<xsl:call-template name="raisePb" />
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="namespace-uri()=''">
+				<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+					name="{local-name(.)}">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template
+		match="@*|comment()|text()|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
+
 	<xsl:template match="@instant[.='false']"></xsl:template>
 	<xsl:template match="@status[.='unremarkable']"></xsl:template>
 
-<!--  <xsl:template match="text()">
-    <xsl:analyze-string select="." regex="&amp;">
-      <xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring>
-      <xsl:non-matching-substring>         
-            <xsl:value-of select="."/>
-      </xsl:non-matching-substring>      
-    </xsl:analyze-string>
-  </xsl:template>
-  
+	<!-- <xsl:template match="text()"> <xsl:analyze-string select="." regex="&amp;"> 
+		<xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring> 
+		<xsl:non-matching-substring> <xsl:value-of select="."/> </xsl:non-matching-substring> 
+		</xsl:analyze-string> </xsl:template> <xsl:template match="processing-instruction()"/> -->
 
-  <xsl:template match="processing-instruction()"/>-->
+	<!-- On supprime teiHeader -->
 
-<!-- On supprime teiHeader -->
-  
-  <xsl:template match="tei:teiHeader">    
-<!--      <xsl:copy-of select="."/>-->    
-  </xsl:template>
+	<xsl:template match="tei:teiHeader">
+		<!-- <xsl:copy-of select="."/> -->
+	</xsl:template>
 
-<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments hors texte à ignorer lors de l'import -->
-  
-  <xsl:template name="deleteAll"/>
+	<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments 
+		hors texte à ignorer lors de l'import -->
 
-<!-- On supprime les balises non essentielles pour l'exploitation textométrique et susceptibles de poser des problèmes au tokeniseur,
-  mais on garde leur contenu qui fait partie du matériau textuel -->
-  
-  <xsl:template name="deleteTag">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template name="deleteAll" />
 
-<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, etc. -->
-  
-<!--  <xsl:template name="makeNote">
-    <note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:value-of select="."/>
-    </note>
-  </xsl:template>
--->  
-<!-- On supprime toutes les balises à l'intérieur des notes-->
-<!--  <xsl:template match="tei:note">
-    <xsl:copy>
-      <xsl:value-of select="."></xsl:value-of>
-    </xsl:copy>
-  </xsl:template>-->
+	<!-- On supprime les balises non essentielles pour l'exploitation textométrique 
+		et susceptibles de poser des problèmes au tokeniseur, mais on garde leur 
+		contenu qui fait partie du matériau textuel -->
 
-<!-- On transforme en DIV typés les balises de niveau de division textuelle (pouvant contenir des p) -->
+	<xsl:template name="deleteTag">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template name="makeDiv">
-    <div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>  
+	<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, 
+		etc. -->
 
-<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
+	<!-- <xsl:template name="makeNote"> <note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0"> 
+		<xsl:value-of select="."/> </note> </xsl:template> -->
+	<!-- On supprime toutes les balises à l'intérieur des notes -->
+	<!-- <xsl:template match="tei:note"> <xsl:copy> <xsl:value-of select="."></xsl:value-of> 
+		</xsl:copy> </xsl:template> -->
 
-  <xsl:template name="makeAb">
-    <ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates/>
-    </ab>
-  </xsl:template>
+	<!-- On transforme en DIV typés les balises de niveau de division textuelle 
+		(pouvant contenir des p) -->
 
-  <!-- on pré-tokenise les éléments équivalents à un mot -->
-  
-  <xsl:template name="makeWord">
-    <xsl:variable name="wordType">
-      <xsl:choose>
-        <xsl:when test="@type">
-          <xsl:value-of select="concat(local-name(),'-',@type)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name()"></xsl:value-of>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></w>
-  </xsl:template>  
+	<xsl:template name="makeDiv">
+		<div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
 
-<xsl:template name="makeName">
-  <xsl:variable name="nameType">
-    <xsl:choose>
-      <xsl:when test="@type">
-        <xsl:value-of select="concat(local-name(),'-',@type)"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="local-name()"></xsl:value-of>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  <name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0">
-    <xsl:apply-templates/>
-  </name>
-</xsl:template>
+	<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
 
-<!-- on avant l'élément au début duquel ils se situent -->
+	<xsl:template name="makeAb">
+		<ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</ab>
+	</xsl:template>
 
-  <xsl:template name="raisePb">
-    <xsl:if test="descendant::tei:pb">
-      <xsl:for-each select="child::*[1][descendant-or-self::tei:pb]">
-        <xsl:choose>
-          <xsl:when test="self::tei:pb"><xsl:comment>Pb remonté</xsl:comment>
-            <xsl:copy>
-            	<xsl:apply-templates select="@*"/>
-            	<xsl:if test="not(@n) and not(@facs) and following-sibling::tei:fw[1 or 2][@type='pageNum']">
-            		<xsl:attribute name="n"><xsl:value-of select="normalize-space(following-sibling::tei:fw[@type='pageNum'][1])"/></xsl:attribute>
-            	</xsl:if>
-            </xsl:copy></xsl:when>
-          <xsl:otherwise><xsl:call-template name="raisePb"></xsl:call-template></xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each>
-    </xsl:if>
-  </xsl:template>
-  
+	<!-- on pré-tokenise les éléments équivalents à un mot -->
 
-<xsl:template match="tei:pb[not(preceding-sibling::*) and not(parent::tei:text)]">
-  <xsl:comment>Pb déplacé plus haut</xsl:comment>
-</xsl:template>
+	<xsl:template name="makeWord">
+		<xsl:variable name="wordType">
+			<xsl:choose>
+				<xsl:when test="@type">
+					<xsl:value-of select="concat(local-name(),'-',@type)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()"></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates />
+		</w>
+	</xsl:template>
 
-<xsl:template match="tei:pb[preceding-sibling::*]">
-	<xsl:copy>
-		<xsl:apply-templates select="@*"/>
-		<xsl:if test="not(@n) and not(@facs) and following-sibling::tei:fw[1 or 2][@type='pageNum']">
-			<xsl:attribute name="n"><xsl:value-of select="normalize-space(following-sibling::tei:fw[@type='pageNum'][1])"/></xsl:attribute>
+	<xsl:template name="makeName">
+		<xsl:variable name="nameType">
+			<xsl:choose>
+				<xsl:when test="@type">
+					<xsl:value-of select="concat(local-name(),'-',@type)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()"></xsl:value-of>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates />
+		</name>
+	</xsl:template>
+
+	<!-- on avant l'élément au début duquel ils se situent -->
+
+	<xsl:template name="raisePb">
+		<xsl:if test="descendant::tei:pb">
+			<xsl:for-each
+				select="child::*[1][descendant-or-self::tei:pb]">
+				<xsl:choose>
+					<xsl:when test="self::tei:pb">
+						<xsl:comment>
+							Pb remonté
+						</xsl:comment>
+						<xsl:copy>
+							<xsl:apply-templates select="@*" />
+							<xsl:if
+								test="not(@n) and not(@facs) and following-sibling::tei:fw[1 or 2][@type='pageNum']">
+								<xsl:attribute name="n"><xsl:value-of
+									select="normalize-space(following-sibling::tei:fw[@type='pageNum'][1])" /></xsl:attribute>
+							</xsl:if>
+						</xsl:copy>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="raisePb"></xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
 		</xsl:if>
-	</xsl:copy>
-</xsl:template>
+	</xsl:template>
 
-<!-- les l sont transformés en lb -->
-  
-  <xsl:template match="tei:l">
-    <lb xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:if test="@n">
-        <xsl:attribute name="n"><xsl:value-of select="@n"/></xsl:attribute>
-      </xsl:if>
-    </lb>
-    <xsl:apply-templates/>
-  </xsl:template>
-  
 
-<!-- On met la ponctuation forte à l'extérieur de la balise foreign :
-Cet élément sera toujours à l'intérieur d'une phrase. Attention au risque
-de perdre les balises éventuelles à l'intérieur-->
-  
-  <xsl:template
-    match="tei:foreign[matches(.,'[.!?]')]">
-    <xsl:variable name="lang">
-      <xsl:choose>
-        <xsl:when test="@lang"><xsl:value-of select="@lang"/></xsl:when>
-        <xsl:when test="@xml:lang"><xsl:value-of select="@xml:lang"/></xsl:when>
-        <xsl:otherwise>xx</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:for-each select="child::node()">
-      <xsl:choose>
-        <xsl:when test="self::text()">
-          <xsl:analyze-string select="." regex="([^.!?]*)([.?!]+)">
-            <xsl:matching-substring>
-              <foreign lang="{$lang}" xmlns="http://www.tei-c.org/ns/1.0">          
-                <xsl:analyze-string select="regex-group(1)" regex="&amp;">
-                  <xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring>
-                  <xsl:non-matching-substring>         
-                    <xsl:value-of select="."/>
-                  </xsl:non-matching-substring>      
-                </xsl:analyze-string>
-              </foreign>
-              <xsl:value-of select="regex-group(2)"/>
-              <xsl:text> </xsl:text>
-            </xsl:matching-substring>
-          </xsl:analyze-string>          
-        </xsl:when>
-        <xsl:when test="self::*[not(descendant::text())]">
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <foreign lang="{$lang}" xmlns="http://www.tei-c.org/ns/1.0">          
-            <xsl:apply-templates select="."/>          
-          </foreign>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  
-  <!-- Injection des métadonnées -->
-  
-  <!-- copie de la template créée pour le header BVH -->
-  
-  <xsl:template match="tei:text">
-    <xsl:variable name="auteur">
-      <xsl:choose>
-        <xsl:when test="//tei:monogr/tei:author[1]/tei:persName/tei:forename">
-          <xsl:value-of select="//tei:monogr/tei:author[1]/tei:persName/tei:forename"/>&#160;<xsl:value-of select="//tei:monogr/tei:author[1]/tei:persName/tei:surname"/>
-        </xsl:when>
-        <xsl:when test="//tei:monogr/tei:author[1]/tei:persName">
-          <xsl:value-of select="//tei:monogr/tei:author[1]/tei:persName"/>
-        </xsl:when>
-        <xsl:when test="//tei:monogr/tei:author">
-          <xsl:value-of select="//tei:monogr/tei:author"/>
-        </xsl:when>
-        <xsl:otherwise>anonyme</xsl:otherwise>
-      </xsl:choose>      
-    </xsl:variable>
-    <xsl:variable name="titre">
-      <xsl:value-of select="translate(//tei:monogr/tei:title[@type='titre_court'],'&amp;', 'et')"/>
-    </xsl:variable>    
-    
-        <text xmlns="http://www.tei-c.org/ns/1.0">
-          <!-- id -->
-             <xsl:variable name="compare1" select="//tei:TEI/@xml:id"/>
-             <xsl:variable name="compare2" select="document('Nommage_Output_TXM.xml')//name/@id"/>
-             <xsl:variable name="name" select="document('Nommage_Output_TXM.xml')//name"/>
-      <xsl:if test="$compare1 = $compare2">        
-          <xsl:attribute name="id">             
-            <xsl:value-of select="$name[@id=$compare1]"/>
+	<xsl:template
+		match="tei:pb[not(preceding-sibling::*) and not(parent::tei:text)]">
+		<xsl:comment>
+			Pb déplacé plus haut
+		</xsl:comment>
+	</xsl:template>
+
+	<xsl:template match="tei:pb[preceding-sibling::*]">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:if
+				test="not(@n) and not(@facs) and following-sibling::tei:fw[1 or 2][@type='pageNum']">
+				<xsl:attribute name="n"><xsl:value-of
+					select="normalize-space(following-sibling::tei:fw[@type='pageNum'][1])" /></xsl:attribute>
+			</xsl:if>
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- les l sont transformés en lb -->
+
+	<xsl:template match="tei:l">
+		<lb xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:if test="@n">
+				<xsl:attribute name="n"><xsl:value-of
+					select="@n" /></xsl:attribute>
+			</xsl:if>
+		</lb>
+		<xsl:apply-templates />
+	</xsl:template>
+
+
+	<!-- On met la ponctuation forte à l'extérieur de la balise foreign : Cet 
+		élément sera toujours à l'intérieur d'une phrase. Attention au risque de 
+		perdre les balises éventuelles à l'intérieur -->
+
+	<xsl:template match="tei:foreign[matches(.,'[.!?]')]">
+		<xsl:variable name="lang">
+			<xsl:choose>
+				<xsl:when test="@lang">
+					<xsl:value-of select="@lang" />
+				</xsl:when>
+				<xsl:when test="@xml:lang">
+					<xsl:value-of select="@xml:lang" />
+				</xsl:when>
+				<xsl:otherwise>
+					xx
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:for-each select="child::node()">
+			<xsl:choose>
+				<xsl:when test="self::text()">
+					<xsl:analyze-string select="."
+						regex="([^.!?]*)([.?!]+)">
+						<xsl:matching-substring>
+							<foreign lang="{$lang}"
+								xmlns="http://www.tei-c.org/ns/1.0">
+								<xsl:analyze-string select="regex-group(1)"
+									regex="&amp;">
+									<xsl:matching-substring>
+										<expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
+									</xsl:matching-substring>
+									<xsl:non-matching-substring>
+										<xsl:value-of select="." />
+									</xsl:non-matching-substring>
+								</xsl:analyze-string>
+							</foreign>
+							<xsl:value-of select="regex-group(2)" />
+							<xsl:text> </xsl:text>
+						</xsl:matching-substring>
+					</xsl:analyze-string>
+				</xsl:when>
+				<xsl:when test="self::*[not(descendant::text())]">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<foreign lang="{$lang}" xmlns="http://www.tei-c.org/ns/1.0">
+						<xsl:apply-templates select="." />
+					</foreign>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+
+	<!-- Injection des métadonnées -->
+
+	<!-- copie de la template créée pour le header BVH -->
+
+	<xsl:template match="tei:text">
+		<xsl:variable name="auteur">
+			<xsl:choose>
+				<xsl:when
+					test="//tei:monogr/tei:author[1]/tei:persName/tei:forename">
+					<xsl:value-of
+						select="//tei:monogr/tei:author[1]/tei:persName/tei:forename" />
+					&#160;
+					<xsl:value-of
+						select="//tei:monogr/tei:author[1]/tei:persName/tei:surname" />
+				</xsl:when>
+				<xsl:when test="//tei:monogr/tei:author[1]/tei:persName">
+					<xsl:value-of
+						select="//tei:monogr/tei:author[1]/tei:persName" />
+				</xsl:when>
+				<xsl:when test="//tei:monogr/tei:author">
+					<xsl:value-of select="//tei:monogr/tei:author" />
+				</xsl:when>
+				<xsl:otherwise>
+					anonyme
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="titre">
+			<xsl:value-of
+				select="translate(//tei:monogr/tei:title[@type='titre_court'],'&amp;', 'et')" />
+		</xsl:variable>
+
+		<text xmlns="http://www.tei-c.org/ns/1.0">
+			<!-- id -->
+			<xsl:variable name="compare1" select="//tei:TEI/@xml:id" />
+			<xsl:variable name="compare2"
+				select="document('Nommage_Output_TXM.xml')//name/@id" />
+			<xsl:variable name="name"
+				select="document('Nommage_Output_TXM.xml')//name" />
+			<xsl:if test="$compare1 = $compare2">
+				<xsl:attribute name="id">             
+            <xsl:value-of select="$name[@id=$compare1]" />
           </xsl:attribute>
-      </xsl:if>
-          <!-- sigle -->
-             <xsl:variable name="compare1" select="//tei:TEI/@xml:id"/>
-             <xsl:variable name="compare2" select="document('Nommage_Output_TXM.xml')//name/@id"/>
-             <xsl:variable name="name" select="document('Nommage_Output_TXM.xml')//name"/>
-      <xsl:if test="$compare1 = $compare2">        
-          <xsl:attribute name="nom">             
-            <xsl:value-of select="$name[@id=$compare1]"/>
+			</xsl:if>
+			<!-- sigle -->
+			<xsl:variable name="compare1" select="//tei:TEI/@xml:id" />
+			<xsl:variable name="compare2"
+				select="document('Nommage_Output_TXM.xml')//name/@id" />
+			<xsl:variable name="name"
+				select="document('Nommage_Output_TXM.xml')//name" />
+			<xsl:if test="$compare1 = $compare2">
+				<xsl:attribute name="nom">             
+            <xsl:value-of select="$name[@id=$compare1]" />
           </xsl:attribute>
-      </xsl:if>
-          <!-- auteur -->
-            <xsl:attribute name="auteur">
-              <xsl:value-of select="$auteur"/>
+			</xsl:if>
+			<!-- auteur -->
+			<xsl:attribute name="auteur">
+              <xsl:value-of select="$auteur" />
             </xsl:attribute>
-          <!-- titre -->
-            <xsl:attribute name="titre">
-                <xsl:value-of select="$titre"/>
+			<!-- titre -->
+			<xsl:attribute name="titre">
+                <xsl:value-of select="$titre" />
             </xsl:attribute>
-          <!-- date de composition -->
-          <xsl:attribute name="date">
-            <xsl:value-of select="//tei:monogr//tei:imprint/tei:date"/>
+			<!-- date de composition -->
+			<xsl:attribute name="date">
+            <xsl:value-of
+				select="//tei:monogr//tei:imprint/tei:date" />
           </xsl:attribute>
-          <!-- forme -->
-            <xsl:attribute name="forme">
+			<!-- forme -->
+			<xsl:attribute name="forme">
                 <xsl:choose>
-                    <xsl:when test="//tei:TEI[@xml:id='B360446201_B343_1_tei' 
+                    <xsl:when
+				test="//tei:TEI[@xml:id='B360446201_B343_1_tei' 
                       or @xml:id='B360446201_B343_2_tei'
                       or @xml:id='B360446201_THIA63_1_tei.xml'
                       or @xml:id='B372615206_1263_tei'
@@ -449,278 +480,314 @@
                     </xsl:otherwise>
                 </xsl:choose>
             </xsl:attribute>
-          <!-- domaine -->
-            <xsl:attribute name="domaine">
+			<!-- domaine -->
+			<xsl:attribute name="domaine">
                <xsl:text>Littéraire</xsl:text>
             </xsl:attribute>
-            <!-- genre -->
-            <xsl:attribute name="genre">
-            <xsl:text>|</xsl:text><xsl:value-of select="translate(@type, '_', ' ')"/><xsl:text>|</xsl:text><xsl:value-of select="translate(@subtype, '_', ' ')"/><xsl:text>|</xsl:text>
-            </xsl:attribute> 
-          <!-- nb mots -->
-          <xsl:attribute name="mots"/>
-            <!-- nb pages -->
-            <xsl:attribute name="pages">
-            <xsl:value-of select="count(//tei:pb)"/>
+			<!-- genre -->
+			<xsl:attribute name="genre">
+            <xsl:text>|</xsl:text><xsl:value-of
+				select="translate(@type, '_', ' ')" /><xsl:text>|</xsl:text><xsl:value-of
+				select="translate(@subtype, '_', ' ')" /><xsl:text>|</xsl:text>
             </xsl:attribute>
-          <!-- texte intégral -->
-          <xsl:attribute name="integral">
+			<!-- nb mots -->
+			<xsl:attribute name="mots" />
+			<!-- nb pages -->
+			<xsl:attribute name="pages">
+            <xsl:value-of select="count(//tei:pb)" />
+            </xsl:attribute>
+			<!-- texte intégral -->
+			<xsl:attribute name="integral">
             <xsl:text>Oui</xsl:text>
           </xsl:attribute>
-          <!-- editeur scientifique -->
-          <xsl:attribute name="edsci">
+			<!-- editeur scientifique -->
+			<xsl:attribute name="edsci">
             <xsl:text>Marie-Luce Demonet</xsl:text>
           </xsl:attribute>
-          <!-- maison d'édition -->
-          <xsl:attribute name="edcomm">
-            <xsl:text>Bibliothèques Virtuelles Humanistes (</xsl:text><xsl:value-of select="//tei:date[@type='mise_en_ligne']/@when"/><xsl:text>)</xsl:text>
+			<!-- maison d'édition -->
+			<xsl:attribute name="edcomm">
+            <xsl:text>Bibliothèques Virtuelles Humanistes (</xsl:text><xsl:value-of
+				select="//tei:date[@type='mise_en_ligne']/@when" /><xsl:text>)</xsl:text>
                      </xsl:attribute>
-            <!-- date d'édition -->
-            <xsl:attribute name="eddate">
-               <xsl:value-of select="//tei:monogr//tei:imprint/tei:date"/>
+			<!-- date d'édition -->
+			<xsl:attribute name="eddate">
+               <xsl:value-of
+				select="//tei:monogr//tei:imprint/tei:date" />
             </xsl:attribute>
-            <!-- origine du texte -->
-            <xsl:choose>
-              <xsl:when test="//tei:msDesc/tei:msIdentifier/tei:repository[text()]">
-            <xsl:attribute name="origine">
+			<!-- origine du texte -->
+			<xsl:choose>
+				<xsl:when
+					test="//tei:msDesc/tei:msIdentifier/tei:repository[text()]">
+					<xsl:attribute name="origine">
               <xsl:choose>
-              <xsl:when test="//tei:msDesc/tei:msIdentifier/tei:institution">
-               <xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:settlement"/>,<xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:institution"/>,<xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:repository"/>
+              <xsl:when
+						test="//tei:msDesc/tei:msIdentifier/tei:institution">
+               <xsl:value-of
+						select="//tei:msDesc/tei:msIdentifier/tei:settlement" />,<xsl:value-of
+						select="//tei:msDesc/tei:msIdentifier/tei:institution" />,<xsl:value-of
+						select="//tei:msDesc/tei:msIdentifier/tei:repository" />
               </xsl:when>
                 <xsl:otherwise>
-                  <xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:settlement"/>,<xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:repository"/>
+                  <xsl:value-of
+						select="//tei:msDesc/tei:msIdentifier/tei:settlement" />,<xsl:value-of
+						select="//tei:msDesc/tei:msIdentifier/tei:repository" />
                 </xsl:otherwise>
               </xsl:choose>              
             </xsl:attribute>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:attribute name="origine">
-                  <xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:settlement"/>,<xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:institution"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="origine">
+                  <xsl:value-of
+						select="//tei:msDesc/tei:msIdentifier/tei:settlement" />,<xsl:value-of
+						select="//tei:msDesc/tei:msIdentifier/tei:institution" />
                 </xsl:attribute>
-              </xsl:otherwise>
-            </xsl:choose>      
-            
-            <!-- copyright -->
-            <xsl:attribute name="statut">
+				</xsl:otherwise>
+			</xsl:choose>
+
+			<!-- copyright -->
+			<xsl:attribute name="statut">
                   <xsl:text>Creative Commons BY-NC-ND 2.0</xsl:text>
-            </xsl:attribute> 
-            <!-- etat -->            
-            <xsl:attribute name="etat">              
+            </xsl:attribute>
+			<!-- etat -->
+			<xsl:attribute name="etat">              
                 <xsl:text>TEI P5</xsl:text>           
-            </xsl:attribute>  
-            <!-- caractères modernisés -->
-          <xsl:attribute name="carmod">
+            </xsl:attribute>
+			<!-- caractères modernisés -->
+			<xsl:attribute name="carmod">
             <xsl:text>Oui</xsl:text>
           </xsl:attribute>
-          <!-- orthographe modernisée -->
-          <xsl:attribute name="orthomod">
+			<!-- orthographe modernisée -->
+			<xsl:attribute name="orthomod">
             <xsl:text>Non</xsl:text>
           </xsl:attribute>
-            <!-- lieu de publication -->
-          <xsl:if test="//tei:monogr//tei:pubPlace">
-            <xsl:attribute name="lieuPublication">
-                <xsl:value-of select="//tei:monogr//tei:pubPlace"/>
+			<!-- lieu de publication -->
+			<xsl:if test="//tei:monogr//tei:pubPlace">
+				<xsl:attribute name="lieuPublication">
+                <xsl:value-of
+					select="//tei:monogr//tei:pubPlace" />
             </xsl:attribute>
-          </xsl:if>          
-            <!-- imprimeur -->
-          <xsl:if test="//tei:monogr//tei:publisher[contains(@role,'imprimeur')]/tei:persName">
-            <xsl:attribute name="imprimeur">  
-                <xsl:for-each select="//tei:monogr//tei:publisher[contains(@role,'imprimeur')][not(position()=last())]/tei:persName">|<xsl:call-template name="persname"/></xsl:for-each>
-                <xsl:for-each select="//tei:monogr//tei:publisher[contains(@role,'imprimeur')][last()]/tei:persName">|<xsl:call-template name="persname"/>|</xsl:for-each>
+			</xsl:if>
+			<!-- imprimeur -->
+			<xsl:if
+				test="//tei:monogr//tei:publisher[contains(@role,'imprimeur')]/tei:persName">
+				<xsl:attribute name="imprimeur">  
+                <xsl:for-each
+					select="//tei:monogr//tei:publisher[contains(@role,'imprimeur')][not(position()=last())]/tei:persName">|<xsl:call-template name="persname" /></xsl:for-each>
+                <xsl:for-each
+					select="//tei:monogr//tei:publisher[contains(@role,'imprimeur')][last()]/tei:persName">|<xsl:call-template name="persname" />|</xsl:for-each>
             </xsl:attribute>
-          </xsl:if>
-            <!-- libraire -->
-          <xsl:if test="//tei:monogr//tei:publisher[contains(@role,'libraire')]/tei:persName">
-            <xsl:attribute name="libraire">
-                <xsl:for-each select="//tei:monogr//tei:publisher[contains(@role,'libraire')][not(position()=last())]/tei:persName">|<xsl:call-template name="persname"/></xsl:for-each>
-                <xsl:for-each select="//tei:monogr//tei:publisher[contains(@role,'libraire')][last()]/tei:persName">|<xsl:call-template name="persname"/>|</xsl:for-each>
+			</xsl:if>
+			<!-- libraire -->
+			<xsl:if
+				test="//tei:monogr//tei:publisher[contains(@role,'libraire')]/tei:persName">
+				<xsl:attribute name="libraire">
+                <xsl:for-each
+					select="//tei:monogr//tei:publisher[contains(@role,'libraire')][not(position()=last())]/tei:persName">|<xsl:call-template name="persname" /></xsl:for-each>
+                <xsl:for-each
+					select="//tei:monogr//tei:publisher[contains(@role,'libraire')][last()]/tei:persName">|<xsl:call-template name="persname" />|</xsl:for-each>
             </xsl:attribute>
-          </xsl:if>             
-            <!-- période du texte -->
-            <xsl:attribute name="siecle">
+			</xsl:if>
+			<!-- période du texte -->
+			<xsl:attribute name="siecle">
                 <xsl:choose>
-                    <xsl:when test="//tei:sourceDesc//tei:biblStruct//tei:date[number(.)&gt;=1301 and number(.)&lt;=1400]">
+                    <xsl:when
+				test="//tei:sourceDesc//tei:biblStruct//tei:date[number(.)&gt;=1301 and number(.)&lt;=1400]">
                         <xsl:text>XIVème siècle</xsl:text>
                     </xsl:when>
-                    <xsl:when test="//tei:sourceDesc//tei:biblStruct//tei:date[number(.)&gt;=1401 and number(.)&lt;=1500]">
+                    <xsl:when
+				test="//tei:sourceDesc//tei:biblStruct//tei:date[number(.)&gt;=1401 and number(.)&lt;=1500]">
                         <xsl:text>XVème siècle</xsl:text>
                     </xsl:when>
-                    <xsl:when test="//tei:sourceDesc//tei:biblStruct//tei:date[number(.)&gt;=1501 and number(.)&lt;=1600]">
+                    <xsl:when
+				test="//tei:sourceDesc//tei:biblStruct//tei:date[number(.)&gt;=1501 and number(.)&lt;=1600]">
                         <xsl:text>XVIème siècle</xsl:text>
                     </xsl:when>
-                    <xsl:when test="//tei:sourceDesc//tei:biblStruct//tei:date[number(.)&gt;=1601 and number(.)&lt;=1700]">
+                    <xsl:when
+				test="//tei:sourceDesc//tei:biblStruct//tei:date[number(.)&gt;=1601 and number(.)&lt;=1700]">
                         <xsl:text>XVIIème siècle</xsl:text>
                     </xsl:when>
                 </xsl:choose>
             </xsl:attribute>
-            <!-- lieu de conservation -->
-          <xsl:if test="//tei:msDesc/tei:msIdentifier">
-            <xsl:choose>
-              <xsl:when test="//tei:msDesc/tei:msIdentifier/tei:repository[text()]">
-            <xsl:attribute name="lieuConservation">
-               <xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:institution"/>&#160;<xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:repository"/>
+			<!-- lieu de conservation -->
+			<xsl:if test="//tei:msDesc/tei:msIdentifier">
+				<xsl:choose>
+					<xsl:when
+						test="//tei:msDesc/tei:msIdentifier/tei:repository[text()]">
+						<xsl:attribute name="lieuConservation">
+               <xsl:value-of
+							select="//tei:msDesc/tei:msIdentifier/tei:institution" />&#160;<xsl:value-of
+							select="//tei:msDesc/tei:msIdentifier/tei:repository" />
             </xsl:attribute>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:attribute name="lieuConservation">
-                  <xsl:value-of select="//tei:msDesc/tei:msIdentifier/tei:institution"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:attribute name="lieuConservation">
+                  <xsl:value-of
+							select="//tei:msDesc/tei:msIdentifier/tei:institution" />
                 </xsl:attribute>
-              </xsl:otherwise>
-            </xsl:choose>            
-          </xsl:if>          
-            <!-- format de l'ouvrage -->
-          <xsl:if test="//tei:dimensions/tei:dim[@type='format']">
-            <xsl:attribute name="format">
-               <xsl:value-of select="//tei:dimensions/tei:dim[@type='format']"/>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+			<!-- format de l'ouvrage -->
+			<xsl:if test="//tei:dimensions/tei:dim[@type='format']">
+				<xsl:attribute name="format">
+               <xsl:value-of
+					select="//tei:dimensions/tei:dim[@type='format']" />
             </xsl:attribute>
-          </xsl:if>          
-            <!-- langues présentes dans le livre, par ordre d'importance -->
-            <xsl:attribute name="langue">
-              <xsl:for-each select="//tei:langUsage/tei:language[not(position()=last())]"><xsl:value-of select="."/>&#160;</xsl:for-each><xsl:value-of select="//tei:langUsage/tei:language[last()]"/>               
-            </xsl:attribute>             
-        <!-- copyright -->
-            <xsl:attribute name="copyright">
+			</xsl:if>
+			<!-- langues présentes dans le livre, par ordre d'importance -->
+			<xsl:attribute name="langue">
+              <xsl:for-each
+				select="//tei:langUsage/tei:language[not(position()=last())]"><xsl:value-of select="." />&#160;</xsl:for-each><xsl:value-of
+				select="//tei:langUsage/tei:language[last()]" />               
+            </xsl:attribute>
+			<!-- copyright -->
+			<xsl:attribute name="copyright">
                   <xsl:text>Bibliothèques Virtuelles Humanistes, CESR, Creative Commons BY-NC-ND 2.0</xsl:text>
-            </xsl:attribute>          
-                <xsl:apply-templates/>
-            </text>        
-  </xsl:template>
-  
-  <xsl:template name="persname">
-      <xsl:choose>
-         <xsl:when test="tei:surname"><xsl:value-of select="tei:forename"/>&#160;<xsl:value-of select="tei:surname"/></xsl:when>
-         <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
-	
+            </xsl:attribute>
+			<xsl:apply-templates />
+		</text>
+	</xsl:template>
+
+	<xsl:template name="persname">
+		<xsl:choose>
+			<xsl:when test="tei:surname">
+				<xsl:value-of select="tei:forename" />
+				&#160;
+				<xsl:value-of select="tei:surname" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
 	<xsl:template match="tei:app">
 		<xsl:choose>
 			<xsl:when test="tei:lem">
-				<xsl:apply-templates select="tei:lem"/>
+				<xsl:apply-templates select="tei:lem" />
 				<note xmlns="http://www.tei-c.org/ns/1.0" type="app">
 					<xsl:for-each select="tei:rdg">
-						<xsl:value-of select="concat(@wit,' : ')"/><xsl:apply-templates/>
+						<xsl:value-of select="concat(@wit,' : ')" />
+						<xsl:apply-templates />
 						<xsl:choose>
-							<xsl:when test="following-sibling::tei:rdg">&#160;; </xsl:when>
-							<xsl:otherwise>. </xsl:otherwise>
+							<xsl:when test="following-sibling::tei:rdg">
+								&#160;;
+							</xsl:when>
+							<xsl:otherwise>
+								.
+							</xsl:otherwise>
 						</xsl:choose>
 					</xsl:for-each>
 				</note>
 			</xsl:when>
 			<xsl:otherwise>
-				<xsl:apply-templates select="tei:rdg[1]"/>
+				<xsl:apply-templates select="tei:rdg[1]" />
 				<note xmlns="http://www.tei-c.org/ns/1.0" type="app">
 					<xsl:for-each select="tei:rdg[not(position()=1)]">
-						<xsl:value-of select="concat(@wit,' : ')"/><xsl:apply-templates/>
+						<xsl:value-of select="concat(@wit,' : ')" />
+						<xsl:apply-templates />
 						<xsl:choose>
-							<xsl:when test="following-sibling::tei:rdg">&#160;; </xsl:when>
-							<xsl:otherwise>. </xsl:otherwise>
+							<xsl:when test="following-sibling::tei:rdg">
+								&#160;;
+							</xsl:when>
+							<xsl:otherwise>
+								.
+							</xsl:otherwise>
 						</xsl:choose>
 					</xsl:for-each>
 				</note>
 			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:template>
-   
-  <xsl:template match="//tei:choice|//tei:corr|//tei:expan|//tei:reg|//tei:supplied|//tei:subst|//tei:add|//tei:del">
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="detectBrokenWord"/>
-        <xsl:apply-templates/>
-     </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template name="detectBrokenWord">
-    <xsl:if test="not(matches(.,'^\s*[.,:;!?\])]'))"><xsl:choose>
-      <xsl:when test="following-sibling::text()[1][matches(.,'^\w')] and preceding-sibling::text()[1][matches(.,'\w$')]">
-        <xsl:attribute name="txm:wordPart">middle</xsl:attribute>
-      </xsl:when>
-      <xsl:when test="following-sibling::text()[1][matches(.,'^(’|'')?\w')]">
-        <xsl:attribute name="txm:wordPart">start</xsl:attribute>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::text()[1][matches(.,'\w$')]">
-        <xsl:attribute name="txm:wordPart">end</xsl:attribute>
-      </xsl:when>
-      <xsl:otherwise/>
-    </xsl:choose></xsl:if>
-  </xsl:template>
-   
-  <!--<xsl:variable name="filename">
-    <xsl:analyze-string select="document-uri(.)" regex="^.*/([^/]+)\.xml$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(1)"></xsl:value-of>
-      </xsl:matching-substring>
-    </xsl:analyze-string></xsl:variable>
-  
-  
-  <xsl:variable name="metadata" select="document(concat($filedir,'/meta/metadata.csv.xml'))//text[@id=$filename]" as="node()"/>
-  
-  <xsl:template match="tei:text">
-    <xsl:choose>
-      <xsl:when test="matches($metadata,'.+')">
-        <text xmlns="http://www.tei-c.org/ns/1.0">
-          <xsl:for-each select="$metadata/entry">
-            <xsl:attribute name="{@id}"><xsl:value-of select="@value"/></xsl:attribute>
-          </xsl:for-each>
-          <xsl:apply-templates/>
-        </text>
-      </xsl:when>
-      <xsl:otherwise>        
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>    -->
-  
-<xsl:variable name="nommage">
-	<collection>
-		<name id="B372615206_3436_tei">1586_GarzoniThe</name>
-		<name id="B372616101_3537_tei">1546_RabelaisTL</name>
-		<name id="B410186201_LI139_tei">1554_CalenzioRo</name>
-		<name id="B693836101_A489170_tei">1561_DPeriersNR</name>
-		<name id="B751131015_PYC612_tei">1545_HoraceAP</name>
-		<name id="B751131015_X1888_tei">1549_DuBellayDef</name>
-		<name id="B751131015_YE11562_tei">1555_LabeOeuv</name>
-		<name id="B751131015_YE1735_tei">1550_DuBellayOl</name>
-		<name id="XUVA_Gordon1543_B53_tei">1543_MarotBlaso</name>
-		<name id="XUVA_Gordon1578_L47_tei">1578_LeryBresil</name>
-		<name id="B372615206_4040_tei">1566_GelliDisc</name>
-		<name id="B751131015_Z1918_tei">1533_ToryMouche</name>
-		<name id="B861946101_DP1139_tei">1556_VinetDisc</name>
-		<name id="B372615206_1263_tei">1538_Castiglion</name>
-		<name id="B410186201_I65_tei">1529_ToryChampf</name>
-		<name id="B693836101_355925_tei">1547_SceveSauls</name>
-		<name id="B751131011_PYE868_tei">1563_RonsardRep</name>
-		<name id="B751131011_Y2_251_tei">1536_FloresFlam</name>
-		<name id="XUVA_Gordon1563_R65b_2_tei">1563_RonsardMis</name>
-		<name id="XUVA_Gordon1563_R66_tei">1563_RonsardIns</name>
-		<name id="XUVA_Gordon1563_R67b_tei">1563_RonsardRem</name>
-		<name id="XUVA_Gordon1563_R656_tei">1563_RonsardEle</name>
-		<name id="XUVA_Gordon1543_K43_tei">1543_CorroCebes</name>
-		<name id="B751131015_YE1457_1460_tei">1538_MarotAdole</name>
-		<name id="B759999999_Y2_2164_tei">1552_RabelaisQL</name>
-		<name id="B360446201_THIA63_1_tei">1576_DeschpsHT</name>
-		<name id="B372615206_4023_tei">1600_BeroaldRich</name>
-		<name id="B759999999_Y2_2162_tei">1552_RabelaisTL</name>
-		<name id="B693836101_346632_tei">1610_BeroaldVoyg</name>
-		<name id="B751131011_YE4769_tei">1550_RonsardQuat</name>
-		<name id="B360446201_B343_2_tei">1542_RabelaisGrgt</name>
-		<name id="B751131010_FR3370_suppl_tei">1552_RabelaisBDcl</name>
-		<name id="B751131011_YE645_tei">1550_RonsardPaix</name>
-		<name id="B372616101_2950_tei">1549_DuBellayOl</name>
-		<name id="XUVA_Gordon1563_R656b_tei">1563_RonsardEle2</name>
-		<name id="B751041006_FR_1513_tei">1548_RabelaisQL</name>
-		<name id="B360446201_B343_1_tei">1542_RabelaisPtgl</name>
-		<name id="B751131011_Y22168_tei">1564_RabelaisCL</name>
-		<name id="B751131011_Y22789_tei">1616_BeroaldMoy</name>
-		<name id="B452346101_D1497_3_tei">1572_MansSavoye</name>
-		<name id="B452346101_H6513_tei">1567_BuchananJephte</name>
-		<name id="M0275_01_tei">1580_MontaigneEssais</name>
-		<name id="Essais_88_tei">1588_MontaigneEssais</name>
-	</collection>	
-</xsl:variable>
 
+	<xsl:template
+		match="//tei:choice|//tei:corr|//tei:expan|//tei:reg|//tei:supplied|//tei:subst|//tei:add|//tei:del">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:call-template name="detectBrokenWord" />
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
 
+	<xsl:template name="detectBrokenWord">
+		<xsl:if test="not(matches(.,'^\s*[.,:;!?\])]'))">
+			<xsl:choose>
+				<xsl:when
+					test="following-sibling::text()[1][matches(.,'^\w')] and preceding-sibling::text()[1][matches(.,'\w$')]">
+					<xsl:attribute name="txm:wordPart">middle</xsl:attribute>
+				</xsl:when>
+				<xsl:when
+					test="following-sibling::text()[1][matches(.,'^(’|'')?\w')]">
+					<xsl:attribute name="txm:wordPart">start</xsl:attribute>
+				</xsl:when>
+				<xsl:when
+					test="preceding-sibling::text()[1][matches(.,'\w$')]">
+					<xsl:attribute name="txm:wordPart">end</xsl:attribute>
+				</xsl:when>
+				<xsl:otherwise />
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
+	<!--<xsl:variable name="filename"> <xsl:analyze-string select="document-uri(.)" 
+		regex="^.*/([^/]+)\.xml$"> <xsl:matching-substring> <xsl:value-of select="regex-group(1)"></xsl:value-of> 
+		</xsl:matching-substring> </xsl:analyze-string></xsl:variable> <xsl:variable 
+		name="metadata" select="document(concat($filedir,'/meta/metadata.csv.xml'))//text[@id=$filename]" 
+		as="node()"/> <xsl:template match="tei:text"> <xsl:choose> <xsl:when test="matches($metadata,'.+')"> 
+		<text xmlns="http://www.tei-c.org/ns/1.0"> <xsl:for-each select="$metadata/entry"> 
+		<xsl:attribute name="{@id}"><xsl:value-of select="@value"/></xsl:attribute> 
+		</xsl:for-each> <xsl:apply-templates/> </text> </xsl:when> <xsl:otherwise> 
+		<xsl:copy> <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/> 
+		</xsl:copy> </xsl:otherwise> </xsl:choose> </xsl:template> -->
+
+	<xsl:variable name="nommage">
+		<collection>
+			<name id="B372615206_3436_tei">1586_GarzoniThe</name>
+			<name id="B372616101_3537_tei">1546_RabelaisTL</name>
+			<name id="B410186201_LI139_tei">1554_CalenzioRo</name>
+			<name id="B693836101_A489170_tei">1561_DPeriersNR</name>
+			<name id="B751131015_PYC612_tei">1545_HoraceAP</name>
+			<name id="B751131015_X1888_tei">1549_DuBellayDef</name>
+			<name id="B751131015_YE11562_tei">1555_LabeOeuv</name>
+			<name id="B751131015_YE1735_tei">1550_DuBellayOl</name>
+			<name id="XUVA_Gordon1543_B53_tei">1543_MarotBlaso</name>
+			<name id="XUVA_Gordon1578_L47_tei">1578_LeryBresil</name>
+			<name id="B372615206_4040_tei">1566_GelliDisc</name>
+			<name id="B751131015_Z1918_tei">1533_ToryMouche</name>
+			<name id="B861946101_DP1139_tei">1556_VinetDisc</name>
+			<name id="B372615206_1263_tei">1538_Castiglion</name>
+			<name id="B410186201_I65_tei">1529_ToryChampf</name>
+			<name id="B693836101_355925_tei">1547_SceveSauls</name>
+			<name id="B751131011_PYE868_tei">1563_RonsardRep</name>
+			<name id="B751131011_Y2_251_tei">1536_FloresFlam</name>
+			<name id="XUVA_Gordon1563_R65b_2_tei">1563_RonsardMis</name>
+			<name id="XUVA_Gordon1563_R66_tei">1563_RonsardIns</name>
+			<name id="XUVA_Gordon1563_R67b_tei">1563_RonsardRem</name>
+			<name id="XUVA_Gordon1563_R656_tei">1563_RonsardEle</name>
+			<name id="XUVA_Gordon1543_K43_tei">1543_CorroCebes</name>
+			<name id="B751131015_YE1457_1460_tei">1538_MarotAdole</name>
+			<name id="B759999999_Y2_2164_tei">1552_RabelaisQL</name>
+			<name id="B360446201_THIA63_1_tei">1576_DeschpsHT</name>
+			<name id="B372615206_4023_tei">1600_BeroaldRich</name>
+			<name id="B759999999_Y2_2162_tei">1552_RabelaisTL</name>
+			<name id="B693836101_346632_tei">1610_BeroaldVoyg</name>
+			<name id="B751131011_YE4769_tei">1550_RonsardQuat</name>
+			<name id="B360446201_B343_2_tei">1542_RabelaisGrgt</name>
+			<name id="B751131010_FR3370_suppl_tei">1552_RabelaisBDcl</name>
+			<name id="B751131011_YE645_tei">1550_RonsardPaix</name>
+			<name id="B372616101_2950_tei">1549_DuBellayOl</name>
+			<name id="XUVA_Gordon1563_R656b_tei">1563_RonsardEle2</name>
+			<name id="B751041006_FR_1513_tei">1548_RabelaisQL</name>
+			<name id="B360446201_B343_1_tei">1542_RabelaisPtgl</name>
+			<name id="B751131011_Y22168_tei">1564_RabelaisCL</name>
+			<name id="B751131011_Y22789_tei">1616_BeroaldMoy</name>
+			<name id="B452346101_D1497_3_tei">1572_MansSavoye</name>
+			<name id="B452346101_H6513_tei">1567_BuchananJephte</name>
+			<name id="M0275_01_tei">1580_MontaigneEssais</name>
+			<name id="Essais_88_tei">1588_MontaigneEssais</name>
+		</collection>
+	</xsl:variable>
+
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-teitxm2xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-teitxm2xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-teitxm2xmlw.xsl	(revision 2397)
@@ -1,87 +1,96 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:txm="http://textometrie.org/1.0"
-                exclude-result-prefixes="tei edate" version="2.0">
-  
-<!--
-Copyright © 2019 ENS de Lyon, CNRS, University of Franche-Comté
-Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-@author Alexei Lavrentiev
--->
-  
-  <!-- This stylesheet converts TEI-TXM files to the format compatible with 
-    XML TEI Zero (XTZ) and XML/w import modules.
-    All annotations encoded as txm:ana elements are converted to attributes of
-    w elements. Customize the annotationsToKeep parameter to select the annotations 
-    to keep.
-  -->
-  
-                
-                
-                <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
-                
-                <xsl:strip-space elements="*"/>
-                
-                                
-                <!-- provide the names of annotations to keep in the form of a regular expression, e.g. pos|lemma -->
-                <xsl:param name="annotationsToKeep">.*</xsl:param>
-                
-                <xsl:variable name="filename">
-                                <xsl:analyze-string select="document-uri(.)" regex="/([^/.]+)\.[^/.]*$">
-                                                <xsl:matching-substring>
-                                                                <xsl:value-of select="regex-group(1)"/>
-                                                </xsl:matching-substring>
-                                </xsl:analyze-string>
-                </xsl:variable>
-                               
-<!--                <xsl:variable name="filedir">
-                                <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)$">
-                                                <xsl:matching-substring>
-                                                                <xsl:value-of select="regex-group(1)"/>
-                                                </xsl:matching-substring>
-                                </xsl:analyze-string>
-                </xsl:variable>-->
-                
-                
-                
-                
-                <xsl:template match="*">
-                                <xsl:choose>
-                                                <xsl:when test="namespace-uri()=''">
-                                                                <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-                                                                                <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-                                                                </xsl:element>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <xsl:copy>
-                                                                                <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-                                                                </xsl:copy>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="@*|processing-instruction()|comment()">
-                                <xsl:copy/>
-                </xsl:template>
-                
-                <xsl:template match="text()">
-                                <xsl:value-of select="normalize-space(.)"/>
-                </xsl:template>
-                
-                <xsl:template match="tei:w">
-                                <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
-                                                <xsl:for-each select="descendant::txm:ana[matches(@type,concat('^#(',$annotationsToKeep,')$'))]">
-                                                                <xsl:attribute name="{substring(@type,2)}"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
-                                                </xsl:for-each>
-                                                <xsl:attribute name="xml:id"><xsl:value-of select="@*[local-name()='id'][1]"/></xsl:attribute>
-                                                <!-- decomment the line below to keep the attributes of words from XML-TEI TXM file -->
-                                                <!--<xsl:copy-of select="@*"/>-->
-                                                <xsl:apply-templates select="txm:form"/>
-                                </xsl:element>
-                </xsl:template>
-                
-                <xsl:template match="txm:form">
-                                <xsl:apply-templates/>
-                </xsl:template>
-                
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/1.0"
+	exclude-result-prefixes="tei edate" version="2.0">
+
+	<!-- Copyright © 2019 ENS de Lyon, CNRS, University of Franche-Comté Licensed 
+		under the terms of the GNU General Public License (http://www.gnu.org/licenses) 
+		@author Alexei Lavrentiev -->
+
+	<!-- This stylesheet converts TEI-TXM files to the format compatible with 
+		XML TEI Zero (XTZ) and XML/w import modules. All annotations encoded as txm:ana 
+		elements are converted to attributes of w elements. Customize the annotationsToKeep 
+		parameter to select the annotations to keep. -->
+
+
+
+	<xsl:output method="xml" encoding="UTF-8"
+		omit-xml-declaration="no" indent="yes" />
+
+	<xsl:strip-space elements="*" />
+
+
+	<!-- provide the names of annotations to keep in the form of a regular expression, 
+		e.g. pos|lemma -->
+	<xsl:param name="annotationsToKeep">
+		.*
+	</xsl:param>
+
+	<xsl:variable name="filename">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="/([^/.]+)\.[^/.]*$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(1)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+	<!-- <xsl:variable name="filedir"> <xsl:analyze-string select="document-uri(.)" 
+		regex="^(.*)/([^/]+)$"> <xsl:matching-substring> <xsl:value-of select="regex-group(1)"/> 
+		</xsl:matching-substring> </xsl:analyze-string> </xsl:variable> -->
+
+
+
+
+	<xsl:template match="*">
+		<xsl:choose>
+			<xsl:when test="namespace-uri()=''">
+				<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+					name="{local-name(.)}">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:template match="text()">
+		<xsl:value-of select="normalize-space(.)" />
+	</xsl:template>
+
+	<xsl:template match="tei:w">
+		<xsl:element name="w"
+			namespace="http://www.tei-c.org/ns/1.0">
+			<xsl:for-each
+				select="descendant::txm:ana[matches(@type,concat('^#(',$annotationsToKeep,')$'))]">
+				<xsl:attribute name="{substring(@type,2)}"><xsl:value-of
+					select="normalize-space(.)" /></xsl:attribute>
+			</xsl:for-each>
+			<xsl:attribute name="xml:id"><xsl:value-of
+				select="@*[local-name()='id'][1]" /></xsl:attribute>
+			<!-- decomment the line below to keep the attributes of words from XML-TEI 
+				TXM file -->
+			<!--<xsl:copy-of select="@*"/> -->
+			<xsl:apply-templates select="txm:form" />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="txm:form">
+		<xsl:apply-templates />
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-page-split.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-page-split.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-page-split.xsl	(revision 2397)
@@ -1,193 +1,205 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet
-		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		version="2.0" xpath-default-namespace="http://www.w3.org/1999/xhtml">
-<!--
-This software is dual-licensed:
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xpath-default-namespace="http://www.w3.org/1999/xhtml">
+	<!-- This software is dual-licensed: 1. Distributed under a Creative Commons 
+		Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+		2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution 
+		and use in source and binary forms, with or without modification, are permitted 
+		provided that the following conditions are met: * Redistributions of source 
+		code must retain the above copyright notice, this list of conditions and 
+		the following disclaimer. * Redistributions in binary form must reproduce 
+		the above copyright notice, this list of conditions and the following disclaimer 
+		in the documentation and/or other materials provided with the distribution. 
+		This software is provided by the copyright holders and contributors "as is" 
+		and any express or implied warranties, including, but not limited to, the 
+		implied warranties of merchantability and fitness for a particular purpose 
+		are disclaimed. In no event shall the copyright holder or contributors be 
+		liable for any direct, indirect, incidental, special, exemplary, or consequential 
+		damages (including, but not limited to, procurement of substitute goods or 
+		services; loss of use, data, or profits; or business interruption) however 
+		caused and on any theory of liability, whether in contract, strict liability, 
+		or tort (including negligence or otherwise) arising in any way out of the 
+		use of this software, even if advised of the possibility of such damage. 
+		$Id$ This stylesheet is based on TEI processpb.xsl by Sebastian Rahtz available 
+		at https://github.com/TEIC/Stylesheets/blob/master/tools/processpb.xsl and 
+		is adapted by Alexei Lavrentiev to split an HTML edition for TXM platform. -->
+	<xsl:output indent="no" method="xml"
+		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:param name="cssname-txm">
+		txm
+	</xsl:param>
+	<xsl:param name="cssname">
+		tei
+	</xsl:param>
+	<xsl:param name="editionname">
+		default
+	</xsl:param>
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<xsl:template match="html/body">
+		<xsl:variable name="pages">
+			<xsl:copy>
+				<xsl:apply-templates select="@*" />
+				<xsl:apply-templates
+					select="*|processing-instruction()|comment()|text()" />
+			</xsl:copy>
+		</xsl:variable>
+		<xsl:for-each select="$pages">
+			<xsl:apply-templates mode="pass2" />
+		</xsl:for-each>
+		<!-- creating title page with metadata -->
+	</xsl:template>
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+	<!-- first (recursive) pass. look for <pb> elements and group on them -->
+	<xsl:template
+		match="comment()|@*|processing-instruction()|text()">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+	<xsl:template match="*">
+		<xsl:call-template name="checkpb">
+			<xsl:with-param name="eName" select="local-name()" />
+		</xsl:call-template>
+	</xsl:template>
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
+	<xsl:template match="a[@class='txm-page']">
+		<a xmlns="http://www.w3.org/1999/xhtml">
+			<xsl:copy-of select="@*" />
+		</a>
+	</xsl:template>
 
-     $Id$
+	<xsl:template name="checkpb">
+		<xsl:param name="eName" />
+		<xsl:choose>
+			<xsl:when test="not(.//a[@class='txm-page'])">
+				<xsl:copy-of select="." />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="pass">
+					<xsl:call-template name="groupbypb">
+						<xsl:with-param name="Name" select="$eName" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:for-each select="$pass">
+					<xsl:apply-templates />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-This stylesheet is based on TEI processpb.xsl by Sebastian Rahtz 
-available at 
-https://github.com/TEIC/Stylesheets/blob/master/tools/processpb.xsl 
-and is adapted by Alexei Lavrentiev to split an HTML edition for 
-TXM platform.
+	<xsl:template name="groupbypb">
+		<xsl:param name="Name" />
+		<xsl:for-each-group select="node()"
+			group-starting-with="a[@class='txm-page']">
+			<xsl:choose>
+				<xsl:when test="self::a[@class='txm-page']">
+					<xsl:copy-of select="." />
+					<xsl:element name="{$Name}"
+						namespace="http://www.w3.org/1999/xhtml">
+						<xsl:attribute name="rend">CONTINUED</xsl:attribute>
+						<xsl:apply-templates
+							select="current-group() except ." />
+					</xsl:element>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:element name="{$Name}"
+						namespace="http://www.w3.org/1999/xhtml">
+						<xsl:for-each select="..">
+							<xsl:copy-of select="@*" />
+							<xsl:apply-templates select="current-group()" />
+						</xsl:for-each>
+					</xsl:element>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+	</xsl:template>
 
-  -->
-  <xsl:output indent="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+	<!-- second pass. group by <pb> (now all at top level) and wrap groups in 
+		<page> -->
+	<xsl:template match="*" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="@*|*|processing-instruction()|comment()|text()" mode="pass2" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:param name="cssname-txm">txm</xsl:param>
-	<xsl:param name="cssname">tei</xsl:param>
-	<xsl:param name="editionname">default</xsl:param>
+	<xsl:template
+		match="comment()|@*|processing-instruction()|text()" mode="pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="html/body">
-      <xsl:variable name="pages">
-	<xsl:copy>
-	  <xsl:apply-templates select="@*"/>
-	  <xsl:apply-templates
-	      select="*|processing-instruction()|comment()|text()"/>
-	</xsl:copy>
-      </xsl:variable>
-      <xsl:for-each select="$pages">
-	<xsl:apply-templates  mode="pass2"/>
-      </xsl:for-each>
-    <!-- creating title page with metadata -->
-  </xsl:template>
-
-
- <!-- first (recursive) pass. look for <pb> elements and group on them -->
-  <xsl:template match="comment()|@*|processing-instruction()|text()">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-
-  <xsl:template match="*">
-    <xsl:call-template name="checkpb">
-      <xsl:with-param name="eName" select="local-name()"/>
-    </xsl:call-template>
-  </xsl:template>
-
-  <xsl:template match="a[@class='txm-page']">
-    <a xmlns="http://www.w3.org/1999/xhtml">
-      <xsl:copy-of select="@*"/>
-    </a>
-  </xsl:template>
-
-  <xsl:template name="checkpb">
-    <xsl:param name="eName"/>
-    <xsl:choose>
-      <xsl:when test="not(.//a[@class='txm-page'])">
-        <xsl:copy-of select="."/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="pass">
-	  <xsl:call-template name="groupbypb">
-	    <xsl:with-param name="Name" select="$eName"/>
-	  </xsl:call-template>
-        </xsl:variable>
-	<xsl:for-each select="$pass">
-	  <xsl:apply-templates/>
-	</xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template name="groupbypb">
-    <xsl:param name="Name"/>
-    <xsl:for-each-group select="node()" group-starting-with="a[@class='txm-page']">
-      <xsl:choose>
-        <xsl:when test="self::a[@class='txm-page']">
-          <xsl:copy-of select="."/>
-          <xsl:element name="{$Name}" namespace="http://www.w3.org/1999/xhtml">
-	    <xsl:attribute name="rend">CONTINUED</xsl:attribute>
-            <xsl:apply-templates select="current-group() except ."/>
-          </xsl:element>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:element name="{$Name}" namespace="http://www.w3.org/1999/xhtml">
-            <xsl:for-each select="..">
-              <xsl:copy-of select="@*"/>
-              <xsl:apply-templates select="current-group()"/>
-            </xsl:for-each>
-          </xsl:element>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each-group>
-  </xsl:template>
-
-  <!-- second pass. group by <pb> (now all at top level) and wrap groups
-       in <page> -->
-  <xsl:template match="*" mode="pass2">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|*|processing-instruction()|comment()|text()" mode="pass2"/>
-    </xsl:copy>
-  </xsl:template>
-
-  <xsl:template match="comment()|@*|processing-instruction()|text()" mode="pass2">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-
 	<xsl:variable name="filename">
-		<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/]+$">
 			<xsl:matching-substring>
-				<xsl:value-of select="regex-group(2)"/>
+				<xsl:value-of select="regex-group(2)" />
 			</xsl:matching-substring>
 		</xsl:analyze-string>
 	</xsl:variable>
-	
+
 	<xsl:variable name="filedir">
-		<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/]+$">
 			<xsl:matching-substring>
-				<xsl:value-of select="regex-group(1)"/>
+				<xsl:value-of select="regex-group(1)" />
 			</xsl:matching-substring>
 		</xsl:analyze-string>
 	</xsl:variable>
-	
-	
-<!--	<xsl:variable name="style">
-	  <xsl:copy-of select="/html/head[1]/style[1]"></xsl:copy-of>
-	</xsl:variable>-->
 
-  <xsl:template match="*[a[@class='txm-page']]" mode="pass2" >
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:for-each-group select="*" group-starting-with="a[@class='txm-page']">
-        <xsl:choose>
-          <xsl:when test="self::a[@class='txm-page']">
-          	<xsl:comment> Page <xsl:value-of select="@title"/> déplacée vers <xsl:value-of select="concat($filedir,'/',$editionname,'/',$filename,'_',@title,'.html')"/></xsl:comment>
-          	<xsl:result-document href="{$filedir}/{$editionname}/{$filename}_{@title}.html">
-          	<html>
-          		<head>
-          			<title><xsl:value-of select="concat($filename,', Page ',@title)"/></title>
-          			<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-          			<link rel="stylesheet" media="all" type="text/css" href="css/{$cssname-txm}.css"/>
-          			<xsl:if test="matches($cssname,'\S')"><link rel="stylesheet" media="all" type="text/css" href="css/{$cssname}.css"/></xsl:if>
-          		  <!--<xsl:copy-of select="$style"/>-->
-          		</head>
-          		<body>
-          		  <div class="txmeditionpage">
-          			  <xsl:copy-of select="current-group() except ."/>
-          			</div>
-          		</body>
-          	</html>
-          	</xsl:result-document>
 
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:copy-of select="current-group()"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each-group>
-    </xsl:copy>
-  </xsl:template>
+	<!-- <xsl:variable name="style"> <xsl:copy-of select="/html/head[1]/style[1]"></xsl:copy-of> 
+		</xsl:variable> -->
 
+	<xsl:template match="*[a[@class='txm-page']]" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:for-each-group select="*"
+				group-starting-with="a[@class='txm-page']">
+				<xsl:choose>
+					<xsl:when test="self::a[@class='txm-page']">
+						<xsl:comment>
+							Page
+							<xsl:value-of select="@title" />
+							déplacée vers
+							<xsl:value-of
+								select="concat($filedir,'/',$editionname,'/',$filename,'_',@title,'.html')" />
+						</xsl:comment>
+						<xsl:result-document
+							href="{$filedir}/{$editionname}/{$filename}_{@title}.html">
+							<html>
+								<head>
+									<title>
+										<xsl:value-of
+											select="concat($filename,', Page ',@title)" />
+									</title>
+									<meta http-equiv="Content-Type"
+										content="text/html;charset=UTF-8" />
+									<link rel="stylesheet" media="all" type="text/css"
+										href="css/{$cssname-txm}.css" />
+									<xsl:if test="matches($cssname,'\S')">
+										<link rel="stylesheet" media="all" type="text/css"
+											href="css/{$cssname}.css" />
+									</xsl:if>
+									<!--<xsl:copy-of select="$style"/> -->
+								</head>
+								<body>
+									<div class="txmeditionpage">
+										<xsl:copy-of select="current-group() except ." />
+									</div>
+								</body>
+							</html>
+						</xsl:result-document>
+
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy-of select="current-group()" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each-group>
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_syllabes-cuneiform.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_syllabes-cuneiform.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-corpusakkadien-xmlw_syllabes-cuneiform.xsl	(revision 2397)
@@ -1,172 +1,200 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
- version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Cette feuille de style permet de préparer les transcriptions de tablettes
-      d'argile (projet UMR PROCLAC) à l'import XML/W + CSV de TXM en tokenisant
-      le corpus au niveau des syllabes.
-      Les propriétés de mots sont projetées vers les propriétés des syllabes (line,
-      lemma, pos).
-      Les propriétés unclear et supplied prennent la valeur "yes" si la syllabe se
-      trouve à l'intérieur de la balise correspondante.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev, alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2014-2015, CNRS / ICAR (équipe CACTUS)</xd:copyright>
-  </xd:doc>
-  
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <xsl:template match="*">
-  	<xsl:copy>
-  		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>	
-  	</xsl:copy>
-  </xsl:template>
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc" version="2.0">
 
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
-	
-	<xsl:template match="processing-instruction()"/>
-  
-  <xsl:template match="*[local-name()='teiHeader']"/>
-  
-<!--  <xsl:template match="*[local-name()='w']//text()">
-    <xsl:variable name="line"><xsl:value-of select="ancestor::*[local-name()='w']/@line"/></xsl:variable>
-    <xsl:variable name="lemma"><xsl:value-of select="ancestor::*[local-name()='w']/@lemma"/></xsl:variable>
-    <xsl:variable name="pos"><xsl:value-of select="ancestor::*[local-name()='w']/@pos"/></xsl:variable>
-    <xsl:variable name="word-form"><xsl:value-of select="ancestor::*[local-name()='w']"/></xsl:variable>
-    <xsl:variable name="unclear">
-      <xsl:choose>
-        <xsl:when test="ancestor::*[local-name()='unclear']">yes</xsl:when>
-        <xsl:otherwise>no</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="supplied">
-      <xsl:choose>
-        <xsl:when test="ancestor::*[local-name()='supplied']">yes</xsl:when>
-        <xsl:otherwise>no</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    
-    <xsl:analyze-string select="." regex="[-.]|\([^\)]*\)">
-      <xsl:matching-substring>
-        <w line="{$line}" lemma="{$lemma}" pos="{$pos}" word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}"><xsl:value-of select="."/></w>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>
-        <w line="{$line}" lemma="{$lemma}" pos="{$pos}" word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}"><xsl:value-of select="."/></w>
-      </xsl:non-matching-substring>
-    </xsl:analyze-string>    
-  </xsl:template>-->
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Cette feuille de style permet de préparer les transcriptions de tablettes
+			d'argile (projet UMR PROCLAC) à l'import XML/W + CSV de TXM en
+			tokenisant
+			le corpus au niveau des syllabes.
+			Les propriétés de mots sont projetées vers les propriétés des syllabes
+			(line,
+			lemma, pos).
+			Les propriétés unclear et supplied prennent la valeur "yes" si la
+			syllabe se
+			trouve à l'intérieur de la balise correspondante.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-<!--<xsl:template match="text()[not(ancestor::*[local-name()='w'])]">
-  <xsl:analyze-string select="." regex="\[…\]">
-    <xsl:matching-substring>
-      <w line="¤" lemma="¤" pos="¤" word-form="¤" supplied="¤" unclear="¤"><xsl:value-of select="."/></w>
-    </xsl:matching-substring>
-    <xsl:non-matching-substring><xsl:comment><xsl:copy-of select="."/></xsl:comment></xsl:non-matching-substring>
-  </xsl:analyze-string>
-</xsl:template>-->
-  
-  <xsl:template match="text()[not(ancestor::*[local-name()='w']) and ancestor::*[local-name()='text']]">
-  <txmOffText><xsl:value-of select="."/></txmOffText>
-</xsl:template>
-  
-  <xsl:template match="*[local-name()='g']">
-    <xsl:variable name="line"><xsl:value-of select="ancestor::*[local-name()='w']/@line"/></xsl:variable>
-    <xsl:variable name="lemma"><xsl:value-of select="ancestor::*[local-name()='w']/@lemma"/></xsl:variable>
-    <xsl:variable name="pos"><xsl:value-of select="ancestor::*[local-name()='w']/@pos"/></xsl:variable>
-    <xsl:variable name="word-form">
-      <xsl:for-each select="ancestor::*[local-name()='w']/descendant::*[local-name()='g']">
-        <xsl:value-of select="."/>
-        <xsl:if test="following-sibling::*[local-name()='g']">-</xsl:if>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:variable name="unclear">
-      <xsl:choose>
-        <xsl:when test="ancestor::*[local-name()='unclear']">yes</xsl:when>
-        <xsl:otherwise>no</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="supplied">
-      <xsl:choose>
-        <xsl:when test="ancestor::*[local-name()='supplied']">yes</xsl:when>
-        <xsl:otherwise>no</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="decimal">
-      <xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="substring(@refUnicode,4)"/></xsl:with-param></xsl:call-template>
-    </xsl:variable>
-    
-    <w line="{$line}" lemma="{$lemma}" pos="{$pos}" word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}" ref-syllabaire="{@refSyllab}" ref-unicode="{@refUnicode}"><xsl:value-of select="."/></w>
-    
-  </xsl:template>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
-  <xsl:template match="*[local-name()='w']">
-  <word>
-    <xsl:apply-templates select="@*"/>
-    <xsl:attribute name="no-supplied">
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev, alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2014-2015, CNRS / ICAR (équipe CACTUS)</xd:copyright>
+	</xd:doc>
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:template match="processing-instruction()" />
+
+	<xsl:template match="*[local-name()='teiHeader']" />
+
+	<!-- <xsl:template match="*[local-name()='w']//text()"> <xsl:variable name="line"><xsl:value-of 
+		select="ancestor::*[local-name()='w']/@line"/></xsl:variable> <xsl:variable 
+		name="lemma"><xsl:value-of select="ancestor::*[local-name()='w']/@lemma"/></xsl:variable> 
+		<xsl:variable name="pos"><xsl:value-of select="ancestor::*[local-name()='w']/@pos"/></xsl:variable> 
+		<xsl:variable name="word-form"><xsl:value-of select="ancestor::*[local-name()='w']"/></xsl:variable> 
+		<xsl:variable name="unclear"> <xsl:choose> <xsl:when test="ancestor::*[local-name()='unclear']">yes</xsl:when> 
+		<xsl:otherwise>no</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable 
+		name="supplied"> <xsl:choose> <xsl:when test="ancestor::*[local-name()='supplied']">yes</xsl:when> 
+		<xsl:otherwise>no</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:analyze-string 
+		select="." regex="[-.]|\([^\)]*\)"> <xsl:matching-substring> <w line="{$line}" 
+		lemma="{$lemma}" pos="{$pos}" word-form="{$word-form}" supplied="{$supplied}" 
+		unclear="{$unclear}"><xsl:value-of select="."/></w> </xsl:matching-substring> 
+		<xsl:non-matching-substring> <w line="{$line}" lemma="{$lemma}" pos="{$pos}" 
+		word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}"><xsl:value-of 
+		select="."/></w> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:template> -->
+
+	<!--<xsl:template match="text()[not(ancestor::*[local-name()='w'])]"> <xsl:analyze-string 
+		select="." regex="\[…\]"> <xsl:matching-substring> <w line="¤" lemma="¤" 
+		pos="¤" word-form="¤" supplied="¤" unclear="¤"><xsl:value-of select="."/></w> 
+		</xsl:matching-substring> <xsl:non-matching-substring><xsl:comment><xsl:copy-of 
+		select="."/></xsl:comment></xsl:non-matching-substring> </xsl:analyze-string> 
+		</xsl:template> -->
+
+	<xsl:template
+		match="text()[not(ancestor::*[local-name()='w']) and ancestor::*[local-name()='text']]">
+		<txmOffText>
+			<xsl:value-of select="." />
+		</txmOffText>
+	</xsl:template>
+
+	<xsl:template match="*[local-name()='g']">
+		<xsl:variable name="line">
+			<xsl:value-of
+				select="ancestor::*[local-name()='w']/@line" />
+		</xsl:variable>
+		<xsl:variable name="lemma">
+			<xsl:value-of
+				select="ancestor::*[local-name()='w']/@lemma" />
+		</xsl:variable>
+		<xsl:variable name="pos">
+			<xsl:value-of
+				select="ancestor::*[local-name()='w']/@pos" />
+		</xsl:variable>
+		<xsl:variable name="word-form">
+			<xsl:for-each
+				select="ancestor::*[local-name()='w']/descendant::*[local-name()='g']">
+				<xsl:value-of select="." />
+				<xsl:if test="following-sibling::*[local-name()='g']">
+					-
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:variable name="unclear">
+			<xsl:choose>
+				<xsl:when test="ancestor::*[local-name()='unclear']">
+					yes
+				</xsl:when>
+				<xsl:otherwise>
+					no
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="supplied">
+			<xsl:choose>
+				<xsl:when test="ancestor::*[local-name()='supplied']">
+					yes
+				</xsl:when>
+				<xsl:otherwise>
+					no
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="decimal">
+			<xsl:call-template name="hex2num">
+				<xsl:with-param name="hex">
+					<xsl:value-of select="substring(@refUnicode,4)" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
+
+		<w line="{$line}" lemma="{$lemma}" pos="{$pos}"
+			word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}"
+			ref-syllabaire="{@refSyllab}" ref-unicode="{@refUnicode}">
+			<xsl:value-of select="." />
+		</w>
+
+	</xsl:template>
+
+	<xsl:template match="*[local-name()='w']">
+		<word>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="no-supplied">
       <xsl:choose>
         <xsl:when test="ancestor::*[local-name()='supplied']">¤</xsl:when>
         <xsl:otherwise>      
-          <xsl:for-each select="descendant::*[local-name()='g']">
-          <xsl:value-of select="."/>
+          <xsl:for-each
+				select="descendant::*[local-name()='g']">
+          <xsl:value-of select="." />
           <xsl:if test="following-sibling::*[local-name()='g']">-</xsl:if>
         </xsl:for-each>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:attribute>
-    <xsl:attribute name="no-unclear">
+			<xsl:attribute name="no-unclear">
       <xsl:choose>
-        <xsl:when test="ancestor::*[local-name()='supplied'] or ancestor::*[local-name()='unclear']">¤</xsl:when>
+        <xsl:when
+				test="ancestor::*[local-name()='supplied'] or ancestor::*[local-name()='unclear']">¤</xsl:when>
         <xsl:otherwise>
-          <xsl:for-each select="descendant::*[local-name()='g']">
-            <xsl:value-of select="."/>
-            <xsl:if test="following-sibling::*[local-name()='g']">-</xsl:if>
+          <xsl:for-each
+				select="descendant::*[local-name()='g']">
+            <xsl:value-of select="." />
+            <xsl:if
+				test="following-sibling::*[local-name()='g']">-</xsl:if>
           </xsl:for-each>
         </xsl:otherwise>
       </xsl:choose>
-    </xsl:attribute>    
-    <xsl:apply-templates/>
-  </word>
-</xsl:template>
+    </xsl:attribute>
+			<xsl:apply-templates />
+		</word>
+	</xsl:template>
 
 
-  <xsl:template name="hex2num">
-    <xsl:param name="hex"/>
-    <xsl:param name="num" select="0"/>
-    <xsl:param name="MSB" select="translate(substring($hex, 1, 1), 'abcdef', 'ABCDEF')"/>
-    <xsl:param name="value" select="string-length(substring-before('0123456789ABCDEF', $MSB))"/>
-    <xsl:param name="result" select="16 * $num + $value"/>
-    <xsl:choose>
-      <xsl:when test="string-length($hex) > 1">
-        <xsl:call-template name="hex2num">
-          <xsl:with-param name="hex" select="substring($hex, 2)"/>
-          <xsl:with-param name="num" select="$result"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="$result"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="hex2num">
+		<xsl:param name="hex" />
+		<xsl:param name="num" select="0" />
+		<xsl:param name="MSB"
+			select="translate(substring($hex, 1, 1), 'abcdef', 'ABCDEF')" />
+		<xsl:param name="value"
+			select="string-length(substring-before('0123456789ABCDEF', $MSB))" />
+		<xsl:param name="result" select="16 * $num + $value" />
+		<xsl:choose>
+			<xsl:when test="string-length($hex) > 1">
+				<xsl:call-template name="hex2num">
+					<xsl:with-param name="hex"
+						select="substring($hex, 2)" />
+					<xsl:with-param name="num" select="$result" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$result" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teiperseus-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teiperseus-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teiperseus-xmlw.xsl	(revision 2397)
@@ -1,57 +1,66 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xsl:import href="txm-filter-teip5-xmlw-preserve.xsl"/>
-  <xd:doc type="stylesheet">
-    <xd:short>
-      A stylesheet to prepare PERSEUS XML-TEI texts to TXM import.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <xsl:template match="//tei:text">
-    <xsl:copy>
-      <xsl:copy-of select="@*"/>
-      <xsl:attribute name="author"><xsl:value-of select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author"/></xsl:attribute>
-      <xsl:attribute name="title"><xsl:value-of select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='work']"/></xsl:attribute>
-      <xsl:attribute name="editor"><xsl:value-of select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:editor"/></xsl:attribute>
-      <xsl:apply-templates/>
-    </xsl:copy>
-  </xsl:template>
-  
-<xsl:template match="//tei:sp">
-  <div3 type="sp" xmlns="http://www.tei-c.org/ns/1.0">
-    <xsl:apply-templates/>    
-  </div3>
-</xsl:template>  
+	<xsl:import href="txm-filter-teip5-xmlw-preserve.xsl" />
+	<xd:doc type="stylesheet">
+		<xd:short>
+			A stylesheet to prepare PERSEUS XML-TEI texts to TXM import.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-<xsl:template match="//tei:speaker">
-  <head><xsl:apply-templates/></head>
-</xsl:template>
-  
-  <xsl:template match="//tei:bibl">
-    <note type="bibl" xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></note>
-  </xsl:template>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<xsl:template match="//tei:text">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:attribute name="author"><xsl:value-of
+				select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author" /></xsl:attribute>
+			<xsl:attribute name="title"><xsl:value-of
+				select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='work']" /></xsl:attribute>
+			<xsl:attribute name="editor"><xsl:value-of
+				select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:editor" /></xsl:attribute>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="//tei:sp">
+		<div3 type="sp" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates />
+		</div3>
+	</xsl:template>
+
+	<xsl:template match="//tei:speaker">
+		<head>
+			<xsl:apply-templates />
+		</head>
+	</xsl:template>
+
+	<xsl:template match="//tei:bibl">
+		<note type="bibl" xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates />
+		</note>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teicorpustextgrid-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teicorpustextgrid-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teicorpustextgrid-xmlw.xsl	(revision 2397)
@@ -1,82 +1,114 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:txm="http://textometrie.org/1.0"
-  exclude-result-prefixes="tei edate" version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:txm="http://textometrie.org/1.0"
+	exclude-result-prefixes="tei edate" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet prepares TextGrid TEI corpus for TXM xml/w import module
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2014, CNRS / ICAR (CACTUS)</xd:copyright>
-  </xd:doc>
-  
-  
-  
-<!-- Partie générale : on copie les éléments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
-<!-- + nommage auto des fichiers -->
-  
-  <xsl:variable name="filedir">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(1)"></xsl:value-of>
-      </xsl:matching-substring>
-    </xsl:analyze-string></xsl:variable>
-  
-  
-  <xsl:template match="/">
-  	<note>See output files in the OUT directory</note>
-  	<xsl:for-each select="descendant::tei:TEI">
-  		<xsl:variable name="author"><xsl:value-of select="tei:teiHeader[1]/tei:fileDesc[1]/tei:sourceDesc[1]/tei:biblFull[1]/tei:titleStmt[1]/tei:author[1]"></xsl:value-of></xsl:variable>
-  		<xsl:variable name="authorNorm"><xsl:value-of select="replace($author,'[, ]','')"/></xsl:variable>
-  		<xsl:variable name="title"><xsl:value-of select="tei:teiHeader[1]/tei:fileDesc[1]/tei:titleStmt[1]/tei:title[1]"></xsl:value-of></xsl:variable>
-  		<xsl:variable name="titleNorm"><xsl:value-of select="replace($title,'[, \[\]]','')"/></xsl:variable>
-  		<xsl:variable name="creationDate"><xsl:choose>
-  			<xsl:when test="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@when">
-  				<xsl:value-of select="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@when"/>
-  			</xsl:when>
-  			<xsl:when test="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@notAfter">
-  				<xsl:value-of select="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@notAfter"/>
-  			</xsl:when>
-  			<xsl:when test="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@notBefore">
-  				<xsl:value-of select="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@notBefore"/>
-  			</xsl:when>
-  			<xsl:otherwise>9999</xsl:otherwise>
-  		</xsl:choose>
-  		</xsl:variable>
-  		<xsl:result-document href="{$filedir}/out/{$creationDate}{$authorNorm}{$titleNorm}.xml">
-  			<xsl:copy>
-  				<xsl:copy-of select="@*"/>
-  				<xsl:comment>teiHeafer deleted for TXM xml/w import module</xsl:comment>
-  				<xsl:element name="text" namespace="http://www.tei-c.org/ns/1.0">
-  					<xsl:attribute name="author"><xsl:value-of select="$author"/></xsl:attribute>
-  					<xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
-  					<xsl:attribute name="creationDate"><xsl:value-of select="$creationDate"/></xsl:attribute>
-  					<xsl:for-each select="tei:text/*">
-  						<xsl:copy-of select="."/>
-  					</xsl:for-each>
-  				</xsl:element>
-  			</xsl:copy>
-  		</xsl:result-document>
-  	</xsl:for-each>  
-  </xsl:template>
-  
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet prepares TextGrid TEI corpus for TXM xml/w import module
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
+
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2014, CNRS / ICAR (CACTUS)</xd:copyright>
+	</xd:doc>
+
+
+
+	<!-- Partie générale : on copie les éléments, les attributs, le texte, les 
+		commentaires, on supprime mes prrocessing intstructions -->
+	<!-- + nommage auto des fichiers -->
+
+	<xsl:variable name="filedir">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(1)"></xsl:value-of>
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+
+	<xsl:template match="/">
+		<note>See output files in the OUT directory</note>
+		<xsl:for-each select="descendant::tei:TEI">
+			<xsl:variable name="author">
+				<xsl:value-of
+					select="tei:teiHeader[1]/tei:fileDesc[1]/tei:sourceDesc[1]/tei:biblFull[1]/tei:titleStmt[1]/tei:author[1]"></xsl:value-of>
+			</xsl:variable>
+			<xsl:variable name="authorNorm">
+				<xsl:value-of select="replace($author,'[, ]','')" />
+			</xsl:variable>
+			<xsl:variable name="title">
+				<xsl:value-of
+					select="tei:teiHeader[1]/tei:fileDesc[1]/tei:titleStmt[1]/tei:title[1]"></xsl:value-of>
+			</xsl:variable>
+			<xsl:variable name="titleNorm">
+				<xsl:value-of select="replace($title,'[, \[\]]','')" />
+			</xsl:variable>
+			<xsl:variable name="creationDate">
+				<xsl:choose>
+					<xsl:when
+						test="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@when">
+						<xsl:value-of
+							select="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@when" />
+					</xsl:when>
+					<xsl:when
+						test="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@notAfter">
+						<xsl:value-of
+							select="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@notAfter" />
+					</xsl:when>
+					<xsl:when
+						test="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@notBefore">
+						<xsl:value-of
+							select="tei:teiHeader[1]/tei:profileDesc[1]/tei:creation[1]/tei:date[1]/@notBefore" />
+					</xsl:when>
+					<xsl:otherwise>
+						9999
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:result-document
+				href="{$filedir}/out/{$creationDate}{$authorNorm}{$titleNorm}.xml">
+				<xsl:copy>
+					<xsl:copy-of select="@*" />
+					<xsl:comment>
+						teiHeafer deleted for TXM xml/w import module
+					</xsl:comment>
+					<xsl:element name="text"
+						namespace="http://www.tei-c.org/ns/1.0">
+						<xsl:attribute name="author"><xsl:value-of
+							select="$author" /></xsl:attribute>
+						<xsl:attribute name="title"><xsl:value-of
+							select="$title" /></xsl:attribute>
+						<xsl:attribute name="creationDate"><xsl:value-of
+							select="$creationDate" /></xsl:attribute>
+						<xsl:for-each select="tei:text/*">
+							<xsl:copy-of select="." />
+						</xsl:for-each>
+					</xsl:element>
+				</xsl:copy>
+			</xsl:result-document>
+		</xsl:for-each>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibrown-xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibrown-xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teibrown-xmlw.xsl	(revision 2397)
@@ -1,95 +1,98 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet prepares XML-TEI P5 files of the Brown corpus
-      for TXM import with xml/w+csv module.
-      Specify the location of this file on your system in the "Front
-      XSLT" import option.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
-  
-  
-<!--  <xsl:template match="/">
-      <xsl:apply-templates/>  
-  </xsl:template>
--->
-  
-  <xsl:template match="*">
-        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:element>
-  </xsl:template>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet prepares XML-TEI P5 files of the Brown corpus
+			for TXM import with xml/w+csv module.
+			Specify the location of this file on your system in the "Front
+			XSLT" import option.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-  <xsl:template match="@*|comment()">
-    <xsl:copy/>
-  </xsl:template>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
-  <xsl:template match="text()">
-    <xsl:analyze-string select="." regex="&amp;|&lt;|&gt;|--|\*(\w+)">
-      <xsl:matching-substring>
-        <xsl:choose>
-          <xsl:when test="matches(.,'&amp;')">
-            <expan xmlns="http://www.tei-c.org/ns/1.0">and</expan>
-          </xsl:when>
-          <xsl:when test="matches(.,'&lt;')">
-            <xsl:text>[</xsl:text>
-          </xsl:when>
-          <xsl:when test="matches(.,'&gt;')">
-            <xsl:text>]</xsl:text>
-          </xsl:when>          
-          <xsl:when test="matches(.,'--')">
-            <!-- double dash provokes malformed xml in the notes in the notes placed in xml comments by the tokenizer -->
-            <xsl:text> - </xsl:text>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="."/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>         
-            <xsl:value-of select="."/>
-      </xsl:non-matching-substring>      
-    </xsl:analyze-string>
-  </xsl:template>
-  
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
 
-  <xsl:template match="processing-instruction()"/>
 
-<!-- teiHeader deleted for the xml/w import module -->
-  
-  <xsl:template match="tei:teiHeader">    
-      <!--<xsl:copy-of select="."/>-->    
-  </xsl:template>
-	
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
+
+
+	<!-- <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> -->
+
+	<xsl:template match="*">
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+			name="{local-name(.)}">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="@*|comment()">
+		<xsl:copy />
+	</xsl:template>
+
+	<xsl:template match="text()">
+		<xsl:analyze-string select="."
+			regex="&amp;|&lt;|&gt;|--|\*(\w+)">
+			<xsl:matching-substring>
+				<xsl:choose>
+					<xsl:when test="matches(.,'&amp;')">
+						<expan xmlns="http://www.tei-c.org/ns/1.0">and</expan>
+					</xsl:when>
+					<xsl:when test="matches(.,'&lt;')">
+						<xsl:text>[</xsl:text>
+					</xsl:when>
+					<xsl:when test="matches(.,'&gt;')">
+						<xsl:text>]</xsl:text>
+					</xsl:when>
+					<xsl:when test="matches(.,'--')">
+						<!-- double dash provokes malformed xml in the notes in the notes placed 
+							in xml comments by the tokenizer -->
+						<xsl:text> - </xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:value-of select="." />
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
+
+
+	<xsl:template match="processing-instruction()" />
+
+	<!-- teiHeader deleted for the xml/w import module -->
+
+	<xsl:template match="tei:teiHeader">
+		<!--<xsl:copy-of select="."/> -->
+	</xsl:template>
+
 	<xsl:template match="tei:text">
 		<xsl:copy>
-		<xsl:apply-templates select="@*"/>
-		<xsl:attribute name="type">
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="type">
 			<xsl:choose>
 				<xsl:when test="@decls='A'">PRESS: REPORTAGE</xsl:when>
 				<xsl:when test="@decls='B'">PRESS: EDITORIAL</xsl:when>
@@ -108,28 +111,28 @@
 				<xsl:when test="@decls='R'">HUMOR</xsl:when>				
 			</xsl:choose>
 		</xsl:attribute>
-		<xsl:apply-templates/>
+			<xsl:apply-templates />
 		</xsl:copy>
 	</xsl:template>
 
-<xsl:template match="@type|@pos">
-	<xsl:attribute name="type">
+	<xsl:template match="@type|@pos">
+		<xsl:attribute name="type">
 		<xsl:value-of select="translate(.,' *','_')"></xsl:value-of>
 	</xsl:attribute>
-</xsl:template>
-	
+	</xsl:template>
+
 	<xsl:template match="tei:mw">
 		<w xmlns="http://www.tei-c.org/ns/1.0">
-			<xsl:apply-templates select="@*"/>
-			<xsl:apply-templates/>
+			<xsl:apply-templates select="@*" />
+			<xsl:apply-templates />
 		</w>
 	</xsl:template>
-	
+
 	<xsl:template match="tei:c[@type='pct']">
 		<w xmlns="http://www.tei-c.org/ns/1.0">
-			<xsl:apply-templates select="@*"/>
-			<xsl:apply-templates/>
-		</w>			
+			<xsl:apply-templates select="@*" />
+			<xsl:apply-templates />
+		</w>
 	</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz-cuneiform.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz-cuneiform.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xtz-cuneiform.xsl	(revision 2397)
@@ -1,335 +1,429 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:txm="http://textometrie.org/1.0"
-	exclude-result-prefixes="#all" version="2.0">
-	
-	<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
-	
-	<xsl:strip-space elements="*"/>
-	
-	<xsl:param name="editionpagetag">pb</xsl:param>
-	
-	<xsl:param name="textcontainer">text</xsl:param>
-	
-	<!--<xsl:param name="frontmatter"></xsl:param>
-	
-	<xsl:param name="backmatter">back</xsl:param>-->
-	
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/1.0" exclude-result-prefixes="#all"
+	version="2.0">
+
+	<xsl:output method="xml" encoding="UTF-8"
+		omit-xml-declaration="no" indent="no"
+		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
+
+	<xsl:strip-space elements="*" />
+
+	<xsl:param name="editionpagetag">
+		pb
+	</xsl:param>
+
+	<xsl:param name="textcontainer">
+		text
+	</xsl:param>
+
+	<!--<xsl:param name="frontmatter"></xsl:param> <xsl:param name="backmatter">back</xsl:param> -->
+
 	<xsl:variable name="inputtype">
 		<xsl:choose>
-			<xsl:when test="//tei:w//txm:form">xmltxm</xsl:when>
-			<xsl:otherwise>xmlw</xsl:otherwise>
+			<xsl:when test="//tei:w//txm:form">
+				xmltxm
+			</xsl:when>
+			<xsl:otherwise>
+				xmlw
+			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:variable>
-	
+
 	<xsl:template match="/">
 		<html>
 			<head>
-				<title><xsl:value-of select="//tei:text[1]/@id"/></title>
-				<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+				<title>
+					<xsl:value-of select="//tei:text[1]/@id" />
+				</title>
+				<meta http-equiv="Content-Type"
+					content="text/html;charset=UTF-8" />
 			</head>
 			<body>
-				<a class="txm-page" title="1"/>
+				<a class="txm-page" title="1" />
 				<div class="metadata-page">
-					<h1><xsl:value-of select="//tei:text[1]/@id"></xsl:value-of></h1>
-					<br/>
+					<h1>
+						<xsl:value-of select="//tei:text[1]/@id"></xsl:value-of>
+					</h1>
+					<br />
 					<table>
 						<xsl:for-each select="//tei:text[1]/@*">
 							<tr>
-								<td><xsl:value-of select="name()"/></td>
-								<td><xsl:value-of select="."/></td>
+								<td>
+									<xsl:value-of select="name()" />
+								</td>
+								<td>
+									<xsl:value-of select="." />
+								</td>
 							</tr>
 						</xsl:for-each>
 					</table>
-					<br/>
-					<br/>
+					<br />
+					<br />
 				</div>
-				<xsl:apply-templates select="descendant::*[local-name()=$textcontainer]"/>
-				
-				
-<!--				<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto')) and not(following::*[local-name()=$editionpagetag]) and preceding::*[local-name()=$editionpagetag]]">
-					<br/>
-					<br/>			
-					<span class="footnotes">
-					<xsl:for-each select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto')) and not(following::*[local-name()=$editionpagetag]) and preceding::*[local-name()=$editionpagetag]]">
-						<xsl:variable name="note_count">
-							<xsl:value-of select="count(preceding::tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]) + 1"/>
-						</xsl:variable>
-						<!-\-<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-\->
-						<span class="note">
-							<span class="footnotenumber"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
-							<xsl:apply-templates mode="#current"/>
-						</span>
-					</xsl:for-each>
-					</span>
-					
-				</xsl:if>
--->				
+				<xsl:apply-templates
+					select="descendant::*[local-name()=$textcontainer]" />
+
+
+				<!-- <xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto')) 
+					and not(following::*[local-name()=$editionpagetag]) and preceding::*[local-name()=$editionpagetag]]"> 
+					<br/> <br/> <span class="footnotes"> <xsl:for-each select="//tei:note[not(@place='inline') 
+					and not(matches(@type,'intern|auto')) and not(following::*[local-name()=$editionpagetag]) 
+					and preceding::*[local-name()=$editionpagetag]]"> <xsl:variable name="note_count"> 
+					<xsl:value-of select="count(preceding::tei:note[not(@place='inline') and 
+					not(matches(@type,'intern|auto'))]) + 1"/> </xsl:variable> <!-\-<p><xsl:value-of 
+					select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of 
+					select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> 
+					</xsl:text> <xsl:value-of select="."/></p>-\-> <span class="note"> <span 
+					class="footnotenumber"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of 
+					select="$note_count"/></a>. </span> <xsl:apply-templates mode="#current"/> 
+					</span> </xsl:for-each> </span> </xsl:if> -->
 			</body>
 		</html>
 	</xsl:template>
-	
+
 	<xsl:template match="//*[local-name()=$textcontainer]">
 		<xsl:variable name="pbcount"></xsl:variable>
-		
+
 		<div class="text" style="margin-left:60px;">
-			<xsl:apply-templates/>
+			<xsl:apply-templates />
 		</div>
 	</xsl:template>
-	
-		
-	
+
+
+
 	<xsl:template match="*">
 		<xsl:choose>
 			<xsl:when test="descendant::tei:p|descendant::tei:ab">
 				<div>
-					<xsl:call-template name="addClass"/>
-					<xsl:apply-templates/></div>
+					<xsl:call-template name="addClass" />
+					<xsl:apply-templates />
+				</div>
 				<xsl:text>&#xa;</xsl:text>
 			</xsl:when>
-			<xsl:otherwise><span>
-				<xsl:call-template name="addClass"/>
-				<xsl:if test="self::tei:add[@del]">
-					<xsl:attribute name="title"><xsl:value-of select="@del"/></xsl:attribute>
-				</xsl:if>
-				<xsl:apply-templates/></span>
-				<!--<xsl:call-template name="spacing"/>-->
+			<xsl:otherwise>
+				<span>
+					<xsl:call-template name="addClass" />
+					<xsl:if test="self::tei:add[@del]">
+						<xsl:attribute name="title"><xsl:value-of
+							select="@del" /></xsl:attribute>
+					</xsl:if>
+					<xsl:apply-templates />
+				</span>
+				<!--<xsl:call-template name="spacing"/> -->
 			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:template>
-	
-	<xsl:template match="@*|processing-instruction()|comment()">
-		<!--<xsl:copy/>-->
+
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+		<!--<xsl:copy/> -->
 	</xsl:template>
-	
-	<!--                <xsl:template match="comment()">
-                                <xsl:copy/>
-                </xsl:template>
--->                
+
+	<!-- <xsl:template match="comment()"> <xsl:copy/> </xsl:template> -->
 	<xsl:template match="text()">
-		<xsl:value-of select="normalize-space(.)"/>
+		<xsl:value-of select="normalize-space(.)" />
 	</xsl:template>
-	
+
 	<xsl:template name="addClass">
 		<xsl:attribute name="class">
-			<xsl:value-of select="local-name(.)"/>
-			<xsl:if test="@type"><xsl:value-of select="concat('-',@type)"/></xsl:if>
-			<xsl:if test="@subtype"><xsl:value-of select="concat('-',@subtype)"/></xsl:if>
-			<xsl:if test="@rend"><xsl:value-of select="concat('-',@rend)"/></xsl:if>
-		</xsl:attribute>                	
+			<xsl:value-of select="local-name(.)" />
+			<xsl:if test="@type"><xsl:value-of
+			select="concat('-',@type)" /></xsl:if>
+			<xsl:if test="@subtype"><xsl:value-of
+			select="concat('-',@subtype)" /></xsl:if>
+			<xsl:if test="@rend"><xsl:value-of
+			select="concat('-',@rend)" /></xsl:if>
+		</xsl:attribute>
 	</xsl:template>
-	
-<!--	<xsl:template match="tei:p|tei:ab">
-		<p>
-			<xsl:call-template name="addClass"/>
-			<xsl:apply-templates/>
-		</p>
-		<xsl:text>&#xa;</xsl:text>
-	</xsl:template>-->
-	
+
+	<!-- <xsl:template match="tei:p|tei:ab"> <p> <xsl:call-template name="addClass"/> 
+		<xsl:apply-templates/> </p> <xsl:text>&#xa;</xsl:text> </xsl:template> -->
+
 	<xsl:template match="//word">
 		<xsl:choose>
-			<xsl:when test="@line = preceding::word[1]/@line"><xsl:text> </xsl:text></xsl:when>
-			<xsl:otherwise><br/><xsl:text>&#xa;</xsl:text><span style="position:relative"><span class="linenumber" style="position:absolute;width:40px;left:-50px;padding-right:20px;text-align:right"><xsl:value-of select="@line"/>&#xa0;</span></span></xsl:otherwise>
+			<xsl:when test="@line = preceding::word[1]/@line">
+				<xsl:text> </xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<br />
+				<xsl:text>&#xa;</xsl:text>
+				<span style="position:relative">
+					<span class="linenumber"
+						style="position:absolute;width:40px;left:-50px;padding-right:20px;text-align:right">
+						<xsl:value-of select="@line" />
+						&#xa0;
+					</span>
+				</span>
+			</xsl:otherwise>
 		</xsl:choose>
 		<span>
-			<xsl:call-template name="addClass"/>
-			<xsl:apply-templates/>
+			<xsl:call-template name="addClass" />
+			<xsl:apply-templates />
 		</span>
 	</xsl:template>
-	
-	
-	
-	<!-- Page breaks -->                
+
+
+
+	<!-- Page breaks -->
 	<xsl:template match="//*[local-name()=$editionpagetag]">
 		<xsl:variable name="editionpagetype">
 			<xsl:choose>
-				<xsl:when test="ancestor::tei:ab">editionpageverse</xsl:when>
-				<xsl:otherwise>editionpage</xsl:otherwise>
+				<xsl:when test="ancestor::tei:ab">
+					editionpageverse
+				</xsl:when>
+				<xsl:otherwise>
+					editionpage
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
 		<xsl:variable name="pagenumber">
 			<xsl:choose>
-				<xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when>
-				<xsl:when test="@facs"><xsl:value-of select="substring-before(@facs,'.')"/></xsl:when>
-				<xsl:otherwise>[NN]</xsl:otherwise>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:when test="@facs">
+					<xsl:value-of select="substring-before(@facs,'.')" />
+				</xsl:when>
+				<xsl:otherwise>
+					[NN]
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		
-		<xsl:variable name="page_id"><xsl:value-of select="count(preceding::*[local-name()=$editionpagetag])"/></xsl:variable>
-		<xsl:if test="@break='no'"><span class="hyphen">-</span></xsl:if>
-		<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
+
+		<xsl:variable name="page_id">
+			<xsl:value-of
+				select="count(preceding::*[local-name()=$editionpagetag])" />
+		</xsl:variable>
+		<xsl:if test="@break='no'">
+			<span class="hyphen">-</span>
+		</xsl:if>
+		<xsl:if
+			test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
 			<xsl:text>&#xa;</xsl:text>
-			<br/>
-			<br/>			
+			<br />
+			<br />
 			<span class="footnotes">
-				<xsl:for-each select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
-					<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) + 1"/></xsl:variable>
-					<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-->
+				<xsl:for-each
+					select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$editionpagetag][1][count(preceding::*[local-name()=$editionpagetag]) = $page_id]]">
+					<xsl:variable name="note_count">
+						<xsl:value-of
+							select="count(preceding::tei:note[not(@place='inline')]) + 1" />
+					</xsl:variable>
+					<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" 
+						name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, 
+						l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> 
+						<xsl:value-of select="."/></p> -->
 					<span class="note">
-						<span class="footnotenumber"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
-						<xsl:apply-templates mode="#current"/>
-					</span>                                                                
-				</xsl:for-each></span><xsl:text>&#xa;</xsl:text>                                                                
-			
-		</xsl:if>                                
-		
+						<span class="footnotenumber">
+							<a href="#noteref_{$note_count}" name="note_{$note_count}">
+								<xsl:value-of select="$note_count" />
+							</a>
+							.
+						</span>
+						<xsl:apply-templates mode="#current" />
+					</span>
+				</xsl:for-each>
+			</span>
+			<xsl:text>&#xa;</xsl:text>
+
+		</xsl:if>
+
 		<xsl:text>&#xa;</xsl:text>
-		<br/><xsl:text>&#xa;</xsl:text>
-		<a class="txm-page" title="{count(preceding::*[local-name()=$editionpagetag]) + 2}"/>
-		<span class="{$editionpagetype}"> - <xsl:value-of select="$pagenumber"/> - </span><br/><xsl:text>&#xa;</xsl:text>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
+		<a class="txm-page"
+			title="{count(preceding::*[local-name()=$editionpagetag]) + 2}" />
+		<span class="{$editionpagetype}">
+			-
+			<xsl:value-of select="$pagenumber" />
+			-
+		</span>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
 	</xsl:template>
-	
+
 	<!-- Notes -->
-<!--	<xsl:template match="tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]">
-		<!-\-<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] </span>-\->	
-		<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]) + 1"/></xsl:variable>
-		<a title="{.}" class="noteref" href="#note_{$note_count}" name="noteref_{$note_count}">[<xsl:value-of select="$note_count"/>]</a>
-		<xsl:call-template name="spacing"/>                                
-	</xsl:template>
--->	
-	
-	<xsl:template match="//w"><span class="w" style="font-family:Santakku">
-		<xsl:variable name="unicode-chars" as="element()">
-			<unicode>
-				<xsl:choose>
-					<xsl:when test="contains(@ref-unicode,'&amp;')">
-						<char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="substring-before(substring(@ref-unicode,4),'&amp;')"/></xsl:with-param></xsl:call-template></char>
-						<char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="substring-after(@ref-unicode,'&amp;U+')"/></xsl:with-param></xsl:call-template></char>
-					</xsl:when>
-					<xsl:otherwise><char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="substring(@ref-unicode,4)"/></xsl:with-param></xsl:call-template></char></xsl:otherwise>
-				</xsl:choose>
-			</unicode>
-		</xsl:variable>
-		<xsl:if test="@id">
-			<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
-		</xsl:if>
-		<xsl:attribute name="title">
+	<!-- <xsl:template match="tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))]"> 
+		<!-\-<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] </span>-\-> 
+		<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline') 
+		and not(matches(@type,'intern|auto'))]) + 1"/></xsl:variable> <a title="{.}" 
+		class="noteref" href="#note_{$note_count}" name="noteref_{$note_count}">[<xsl:value-of 
+		select="$note_count"/>]</a> <xsl:call-template name="spacing"/> </xsl:template> -->
+
+	<xsl:template match="//w">
+		<span class="w" style="font-family:Santakku">
+			<xsl:variable name="unicode-chars" as="element()">
+				<unicode>
+					<xsl:choose>
+						<xsl:when test="contains(@ref-unicode,'&amp;')">
+							<char>
+								<xsl:call-template name="hex2num">
+									<xsl:with-param name="hex">
+										<xsl:value-of
+											select="substring-before(substring(@ref-unicode,4),'&amp;')" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</char>
+							<char>
+								<xsl:call-template name="hex2num">
+									<xsl:with-param name="hex">
+										<xsl:value-of
+											select="substring-after(@ref-unicode,'&amp;U+')" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</char>
+						</xsl:when>
+						<xsl:otherwise>
+							<char>
+								<xsl:call-template name="hex2num">
+									<xsl:with-param name="hex">
+										<xsl:value-of select="substring(@ref-unicode,4)" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</char>
+						</xsl:otherwise>
+					</xsl:choose>
+				</unicode>
+			</xsl:variable>
+			<xsl:if test="@id">
+				<xsl:attribute name="id"><xsl:value-of
+					select="@id" /></xsl:attribute>
+			</xsl:if>
+			<xsl:attribute name="title">
 			<xsl:choose>
 				<xsl:when test="descendant::txm:ana">
 					<xsl:for-each select="descendant::txm:ana">
-						<xsl:value-of select="concat(substring(@type,2),': ',.,' ; ')"/>				
+						<xsl:value-of
+				select="concat(substring(@type,2),': ',.,' ; ')" />				
 					</xsl:for-each>
-					<xsl:value-of select="concat('translit : ',descendant::txm:form)"/>
+					<xsl:value-of
+				select="concat('translit : ',descendant::txm:form)" />
 				</xsl:when>
 				<xsl:otherwise>
 					<xsl:for-each select="@*">
-						<xsl:value-of select="concat(name(),': ',.,' ; ')"/>				
+						<xsl:value-of select="concat(name(),': ',.,' ; ')" />				
 					</xsl:for-each>
-					<xsl:value-of select="concat('translit : ',.)"/>
+					<xsl:value-of select="concat('translit : ',.)" />
 				</xsl:otherwise>
 			</xsl:choose>
 
 		</xsl:attribute>
-		<xsl:choose>
-			<xsl:when test="descendant::txm:form">
-				<xsl:apply-templates select="txm:form"/>
-			</xsl:when>
-			<xsl:otherwise>
-				<!--<xsl:value-of select="codepoints-to-string($unicode)"/>-->
-				<xsl:for-each select="$unicode-chars/char">
-					<xsl:value-of select="codepoints-to-string(.)"/>
-				</xsl:for-each>
-			</xsl:otherwise>
-		</xsl:choose>
-		
-	</span>
-		<!--<xsl:if test="following-sibling::tei:w"></xsl:if>-->
+			<xsl:choose>
+				<xsl:when test="descendant::txm:form">
+					<xsl:apply-templates select="txm:form" />
+				</xsl:when>
+				<xsl:otherwise>
+					<!--<xsl:value-of select="codepoints-to-string($unicode)"/> -->
+					<xsl:for-each select="$unicode-chars/char">
+						<xsl:value-of select="codepoints-to-string(.)" />
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+
+		</span>
+		<!--<xsl:if test="following-sibling::tei:w"></xsl:if> -->
 	</xsl:template>
-	
+
 	<xsl:template name="hex2num">
-		<xsl:param name="hex"/>
-		<xsl:param name="num" select="0"/>
-		<xsl:param name="MSB" select="translate(substring($hex, 1, 1), 'abcdef', 'ABCDEF')"/>
-		<xsl:param name="value" select="string-length(substring-before('0123456789ABCDEF', $MSB))"/>
-		<xsl:param name="result" select="16 * $num + $value"/>
+		<xsl:param name="hex" />
+		<xsl:param name="num" select="0" />
+		<xsl:param name="MSB"
+			select="translate(substring($hex, 1, 1), 'abcdef', 'ABCDEF')" />
+		<xsl:param name="value"
+			select="string-length(substring-before('0123456789ABCDEF', $MSB))" />
+		<xsl:param name="result" select="16 * $num + $value" />
 		<xsl:choose>
 			<xsl:when test="string-length($hex) > 1">
 				<xsl:call-template name="hex2num">
-					<xsl:with-param name="hex" select="substring($hex, 2)"/>
-					<xsl:with-param name="num" select="$result"/>
+					<xsl:with-param name="hex"
+						select="substring($hex, 2)" />
+					<xsl:with-param name="num" select="$result" />
 				</xsl:call-template>
 			</xsl:when>
 			<xsl:otherwise>
-				<xsl:value-of select="$result"/>
+				<xsl:value-of select="$result" />
 			</xsl:otherwise>
 		</xsl:choose>
 	</xsl:template>
-	
-	
-	                <xsl:template match="//txm:form">
-	                	<xsl:variable name="unicode-chars" as="element()">
-	                		<unicode>
-	                			<xsl:choose>
-	                				<xsl:when test="contains(following-sibling::txm:ana[@type='#ref-unicode'],'&amp;')">
-	                					<xsl:for-each select="tokenize(substring(following-sibling::txm:ana[@type='#ref-unicode'],2),'&amp;')">
-	                						<char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="substring-after(.,'U+')"/></xsl:with-param></xsl:call-template></char>
-	                					</xsl:for-each>
-<!--	                					<char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="substring-before(substring(following-sibling::txm:ana[@type='#ref-unicode'],4),'&amp;')"/></xsl:with-param></xsl:call-template></char>
-	                					<char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="substring-after(following-sibling::txm:ana[@type='#ref-unicode'],'&amp;U+')"/></xsl:with-param></xsl:call-template></char>-->
-	                				</xsl:when>
-	                				<xsl:otherwise><char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="substring(following-sibling::txm:ana[@type='#ref-unicode'],4)"/></xsl:with-param></xsl:call-template></char></xsl:otherwise>
-	                			</xsl:choose>
-	                		</unicode>
-	                	</xsl:variable>
-	                	<!--<xsl:variable name="unicode">
-	                		<xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of select="ancestor::w/substring(child::txm:ana[@type='#ref-unicode'],4)"/></xsl:with-param></xsl:call-template>			
-	                	</xsl:variable>-->
-	                	
-	                	<!--<xsl:value-of select="codepoints-to-string($unicode)"/>-->
-	                	<xsl:for-each select="$unicode-chars/char">
-	                		<xsl:choose>
-	                			<!--<xsl:when test="number(.) = 74034">xxx</xsl:when>-->
-	                			<xsl:when test="number(.) gt 50"><xsl:value-of select="codepoints-to-string(.)"/><!--[<xsl:value-of select="."/>]--></xsl:when>
-	                			<xsl:otherwise>[?]</xsl:otherwise>
-	                		</xsl:choose>
-	                		
-	                		<!--<xsl:value-of select="."/>-->
-	                	</xsl:for-each>
-                </xsl:template>
-                
-<!--	<xsl:template name="spacing">
-		<xsl:choose>
-			<xsl:when test="$inputtype='xmltxm'">
-				<xsl:call-template name="spacing-xmltxm"/>
-			</xsl:when>
-			<xsl:otherwise>
-				<xsl:call-template name="spacing-xmlw"/>
-			</xsl:otherwise>
-		</xsl:choose>
+
+
+	<xsl:template match="//txm:form">
+		<xsl:variable name="unicode-chars" as="element()">
+			<unicode>
+				<xsl:choose>
+					<xsl:when
+						test="contains(following-sibling::txm:ana[@type='#ref-unicode'],'&amp;')">
+						<xsl:for-each
+							select="tokenize(substring(following-sibling::txm:ana[@type='#ref-unicode'],2),'&amp;')">
+							<char>
+								<xsl:call-template name="hex2num">
+									<xsl:with-param name="hex">
+										<xsl:value-of select="substring-after(.,'U+')" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</char>
+						</xsl:for-each>
+						<!-- <char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of 
+							select="substring-before(substring(following-sibling::txm:ana[@type='#ref-unicode'],4),'&amp;')"/></xsl:with-param></xsl:call-template></char> 
+							<char><xsl:call-template name="hex2num"><xsl:with-param name="hex"><xsl:value-of 
+							select="substring-after(following-sibling::txm:ana[@type='#ref-unicode'],'&amp;U+')"/></xsl:with-param></xsl:call-template></char> -->
+					</xsl:when>
+					<xsl:otherwise>
+						<char>
+							<xsl:call-template name="hex2num">
+								<xsl:with-param name="hex">
+									<xsl:value-of
+										select="substring(following-sibling::txm:ana[@type='#ref-unicode'],4)" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</char>
+					</xsl:otherwise>
+				</xsl:choose>
+			</unicode>
+		</xsl:variable>
+		<!--<xsl:variable name="unicode"> <xsl:call-template name="hex2num"><xsl:with-param 
+			name="hex"><xsl:value-of select="ancestor::w/substring(child::txm:ana[@type='#ref-unicode'],4)"/></xsl:with-param></xsl:call-template> 
+			</xsl:variable> -->
+
+		<!--<xsl:value-of select="codepoints-to-string($unicode)"/> -->
+		<xsl:for-each select="$unicode-chars/char">
+			<xsl:choose>
+				<!--<xsl:when test="number(.) = 74034">xxx</xsl:when> -->
+				<xsl:when test="number(.) gt 50">
+					<xsl:value-of select="codepoints-to-string(.)" /><!--[<xsl:value-of 
+						select="."/>] -->
+				</xsl:when>
+				<xsl:otherwise>
+					[?]
+				</xsl:otherwise>
+			</xsl:choose>
+
+			<!--<xsl:value-of select="."/> -->
+		</xsl:for-each>
 	</xsl:template>
 
-	<xsl:template name="spacing-xmlw">
-		<xsl:choose>
-			<xsl:when test="ancestor::tei:w"/>
-			<xsl:when test="following::tei:w[1][matches(.,'^\s*[.,)\]]+\s*$')]"/>			
-			<xsl:when test="matches(.,'^\s*[(\[]+$|\w(''|’)\s*$')"></xsl:when>
-			<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
-			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-			<xsl:when test="following::tei:w[1][matches(.,'^\s*[:;!?]+\s*$')]">
-				<xsl:text>&#xa0;</xsl:text>
-			</xsl:when>
-			<xsl:otherwise>
-				<xsl:text> </xsl:text>
-			</xsl:otherwise>
-		</xsl:choose>                
-	</xsl:template>
-	
-	<xsl:template name="spacing-xmltxm">
-		<xsl:choose>
-			<xsl:when test="ancestor::tei:w"/>
-			<xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[.,)\]]+$')]"/>			
-			<xsl:when test="matches(descendant::txm:form[1],'^[(\[]+$|\w(''|’)$')"></xsl:when>
-			<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
-			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-			<xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[:;!?]+$')]">
-				<xsl:text>&#xa0;</xsl:text>
-			</xsl:when>
-			<xsl:otherwise>
-				<xsl:text> </xsl:text>
-			</xsl:otherwise>
-		</xsl:choose>                
-	</xsl:template>-->
-	
-	
+	<!-- <xsl:template name="spacing"> <xsl:choose> <xsl:when test="$inputtype='xmltxm'"> 
+		<xsl:call-template name="spacing-xmltxm"/> </xsl:when> <xsl:otherwise> <xsl:call-template 
+		name="spacing-xmlw"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template 
+		name="spacing-xmlw"> <xsl:choose> <xsl:when test="ancestor::tei:w"/> <xsl:when 
+		test="following::tei:w[1][matches(.,'^\s*[.,)\]]+\s*$')]"/> <xsl:when test="matches(.,'^\s*[(\[]+$|\w(''|’)\s*$')"></xsl:when> 
+		<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when> 
+		<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when> <xsl:when 
+		test="following::tei:w[1][matches(.,'^\s*[:;!?]+\s*$')]"> <xsl:text>&#xa0;</xsl:text> 
+		</xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> 
+		</xsl:template> <xsl:template name="spacing-xmltxm"> <xsl:choose> <xsl:when 
+		test="ancestor::tei:w"/> <xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[.,)\]]+$')]"/> 
+		<xsl:when test="matches(descendant::txm:form[1],'^[(\[]+$|\w(''|’)$')"></xsl:when> 
+		<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when> 
+		<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when> <xsl:when 
+		test="following::tei:w[1][matches(descendant::txm:form[1],'^[:;!?]+$')]"> 
+		<xsl:text>&#xa0;</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> 
+		</xsl:otherwise> </xsl:choose> </xsl:template> -->
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/filter-out-sp.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/filter-out-sp.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/filter-out-sp.xsl	(revision 2397)
@@ -1,46 +1,48 @@
 <?xml version="1.0"?>
 <xsl:stylesheet
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-  exclude-result-prefixes="tei edate xd" version="2.0">
-  
-  <xd:doc type="stylesheet">
-    <xd:short>
-      Feuille de style de suppression de certains éléments XML à utiliser comme
-      prétraitement de l'import XML/w+CSV. 
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Serge Heiden slh@ens-lyon.fr</xd:author>
-    <xd:copyright>2013, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
-  </xd:doc>
-  
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei edate xd" version="2.0">
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			Feuille de style de suppression de certains éléments XML à utiliser comme
+			prétraitement de l'import XML/w+CSV.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-  <xsl:template match="@*|node()">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|node()" />
-    </xsl:copy>
-  </xsl:template>
-  
-  <!-- On supprime tous les <sp> dont l'attribut @who vaut 'enqueteur' -->
-  
-  <xsl:template match="//sp[@who='enqueteur']">    
-      <!--<xsl:copy-of select="."/>-->    
-  </xsl:template>
-	
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
+
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Serge Heiden slh@ens-lyon.fr</xd:author>
+		<xd:copyright>2013, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
+	</xd:doc>
+
+
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="yes" />
+
+	<xsl:template match="@*|node()">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- On supprime tous les <sp> dont l'attribut @who vaut 'enqueteur' -->
+
+	<xsl:template match="//sp[@who='enqueteur']">
+		<!--<xsl:copy-of select="."/> -->
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teitextgrid-xmlw-posttok.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teitextgrid-xmlw-posttok.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-filter-teitextgrid-xmlw-posttok.xsl	(revision 2397)
@@ -1,142 +1,174 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xd="http://www.pnp-software.com/XSLTdoc" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:txm="http://textometrie.org/1.0"
-  exclude-result-prefixes="tei edate txm" xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/1.0"
+	exclude-result-prefixes="tei edate txm"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet is used on tokenized DARIAH-DE TextGrid files
-      in the TXM XML/w + csv import process.
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2014, CNRS / ICAR (CACTUS)</xd:copyright>
-  </xd:doc>
-  
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet is used on tokenized DARIAH-DE TextGrid files
+			in the TXM XML/w + csv import process.
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> 
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
-  <!-- By default, copy all attributes, comments, processing instructions and text nodes -->
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2014, CNRS / ICAR (CACTUS)</xd:copyright>
+	</xd:doc>
 
-  <xsl:template match="@*|comment()|processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
-  
-  <xsl:template match="text()">
-    <xsl:value-of select="."/>
-  </xsl:template>
-  
-  <!-- delete the teiHeader for xml/w import module-->
-  
-  <xsl:template match="teiHeader"/>
-  
-  
-<!-- The page breaks must be placed before the structural units (text divions) that 
-    start on a given page (to avoid empty elements creation when splitting the pages of the
-    TXM edition) -->
 
-  <xsl:template match="text">
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:if test="not(child::*[1][self::pb])"><pb xmlns="http://www.tei-c.org/ns/1.0" n="title"/></xsl:if>
-      <xsl:apply-templates/>
-    </xsl:copy>
-  </xsl:template>  
+	<xsl:output method="xml" encoding="utf-8"
+		omit-xml-declaration="no" />
 
-  <xsl:template match="*">    
-    <xsl:if test="descendant::tei:pb and (parent::tei:text or preceding-sibling::*)">
-      <!-- on déplace les pb initiaux avant la balise de l'élément le plus haut -->
-      <xsl:call-template name="raisePb"/>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="namespace-uri()=''">
-        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>  
-  </xsl:template>
-  
-  <xsl:template match="tei:pb[not(preceding-sibling::*) and not(parent::tei:text)]">
-    <xsl:comment>Pb déplacé plus haut</xsl:comment>
-  </xsl:template>
-  
-  <xsl:template name="raisePb">
-    <xsl:if test="descendant::tei:pb">
-      <xsl:for-each select="child::*[1][descendant-or-self::tei:pb]">
-        <xsl:choose>
-          <xsl:when test="self::tei:pb"><xsl:comment>Pb remonté</xsl:comment>
-            <xsl:copy>
-              <xsl:apply-templates select="@*"/>
-              <xsl:if test="not(@n) and not(@facs) and following-sibling::tei:fw[1 or 2][@type='pageNum']">
-                <xsl:attribute name="n"><xsl:value-of select="normalize-space(following-sibling::tei:fw[@type='pageNum'][1])"/></xsl:attribute>
-              </xsl:if>
-            </xsl:copy></xsl:when>
-          <xsl:otherwise><xsl:call-template name="raisePb"></xsl:call-template></xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each>
-    </xsl:if>
-  </xsl:template>
-  
-  
-<!-- add @ref to words (for concordances) -->
+	<!-- By default, copy all attributes, comments, processing instructions 
+		and text nodes -->
 
-  <xsl:variable name="filename">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
-  
-  <xsl:template match="w">
-    <xsl:variable name="ref">
-      <xsl:choose>
-        <xsl:when test="preceding::pb[1][@n]">
-          <xsl:value-of select="concat($filename,', p. ',preceding::pb[1]/@n)"/>
-        </xsl:when>
-        <xsl:otherwise><xsl:value-of select="$filename"/></xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-        <w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}">
-          <xsl:apply-templates select="@*"/>
-          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-        </w>
-  </xsl:template>
+	<xsl:template
+		match="@*|comment()|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
 
-<!-- transform speaker into an attribute of the sp element -->
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
 
-  <xsl:template match="sp">
-    <xsl:copy>
-      <xsl:if test="child::speaker">
-        <xsl:variable name="who">
-          <xsl:value-of select="speaker"/>
-        </xsl:variable>
-        <xsl:attribute name="who"><xsl:value-of select="normalize-space(replace($who,'\s*\p{P}+\s*$',''))"/></xsl:attribute>
-        <xsl:apply-templates/>
-      </xsl:if>
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="speaker"/>
-  
+	<!-- delete the teiHeader for xml/w import module -->
 
+	<xsl:template match="teiHeader" />
+
+
+	<!-- The page breaks must be placed before the structural units (text divions) 
+		that start on a given page (to avoid empty elements creation when splitting 
+		the pages of the TXM edition) -->
+
+	<xsl:template match="text">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:if test="not(child::*[1][self::pb])">
+				<pb xmlns="http://www.tei-c.org/ns/1.0" n="title" />
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="*">
+		<xsl:if
+			test="descendant::tei:pb and (parent::tei:text or preceding-sibling::*)">
+			<!-- on déplace les pb initiaux avant la balise de l'élément le plus haut -->
+			<xsl:call-template name="raisePb" />
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="namespace-uri()=''">
+				<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+					name="{local-name(.)}">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template
+		match="tei:pb[not(preceding-sibling::*) and not(parent::tei:text)]">
+		<xsl:comment>
+			Pb déplacé plus haut
+		</xsl:comment>
+	</xsl:template>
+
+	<xsl:template name="raisePb">
+		<xsl:if test="descendant::tei:pb">
+			<xsl:for-each
+				select="child::*[1][descendant-or-self::tei:pb]">
+				<xsl:choose>
+					<xsl:when test="self::tei:pb">
+						<xsl:comment>
+							Pb remonté
+						</xsl:comment>
+						<xsl:copy>
+							<xsl:apply-templates select="@*" />
+							<xsl:if
+								test="not(@n) and not(@facs) and following-sibling::tei:fw[1 or 2][@type='pageNum']">
+								<xsl:attribute name="n"><xsl:value-of
+									select="normalize-space(following-sibling::tei:fw[@type='pageNum'][1])" /></xsl:attribute>
+							</xsl:if>
+						</xsl:copy>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="raisePb"></xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</xsl:if>
+	</xsl:template>
+
+
+	<!-- add @ref to words (for concordances) -->
+
+	<xsl:variable name="filename">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+	<xsl:template match="w">
+		<xsl:variable name="ref">
+			<xsl:choose>
+				<xsl:when test="preceding::pb[1][@n]">
+					<xsl:value-of
+						select="concat($filename,', p. ',preceding::pb[1]/@n)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$filename" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<w xmlns="http://www.tei-c.org/ns/1.0" ref="{$ref}">
+			<xsl:apply-templates select="@*" />
+			<xsl:apply-templates
+				select="*|processing-instruction()|comment()|text()" />
+		</w>
+	</xsl:template>
+
+	<!-- transform speaker into an attribute of the sp element -->
+
+	<xsl:template match="sp">
+		<xsl:copy>
+			<xsl:if test="child::speaker">
+				<xsl:variable name="who">
+					<xsl:value-of select="speaker" />
+				</xsl:variable>
+				<xsl:attribute name="who"><xsl:value-of
+					select="normalize-space(replace($who,'\s*\p{P}+\s*$',''))" /></xsl:attribute>
+				<xsl:apply-templates />
+			</xsl:if>
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="speaker" />
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-split-teicorpus.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-split-teicorpus.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-split-teicorpus.xsl	(revision 2397)
@@ -1,73 +1,78 @@
 <!-- The Identity Transformation -->
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet is designed for TXM XTZ+CSV import module to split a
-      single file containing a teiCorpus into individual files for each TEI
-      child. This stylesheet should be used at "1-split-merge" step. See 
-      TXM User Manual for more details 
-      (http://textometrie.ens-lyon.fr/spip.php?rubrique64)
-    </xd:short>
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
-    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
-  </xd:doc>
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet is designed for TXM XTZ+CSV import module to split a
+			single file containing a teiCorpus into individual files for each TEI
+			child. This stylesheet should be used at "1-split-merge" step. See
+			TXM User Manual for more details
+			(http://textometrie.ens-lyon.fr/spip.php?rubrique64)
+		</xd:short>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-<xsl:param name="output-directory">
-  <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/.]+$">
-    <xsl:matching-substring>
-      <xsl:value-of select="regex-group(1)"/>
-    </xsl:matching-substring>
-  </xsl:analyze-string>
-</xsl:param>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
-  <xsl:variable name="filename">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/.]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
+		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
+	</xd:doc>
 
-<xsl:template match="*:teiCorpus">
-  <xsl:for-each select="descendant::*:TEI">
-    <xsl:variable name="position" as="xs:integer">
-      <xsl:number level="any"/>
-    </xsl:variable>
-    <xsl:variable name="result-filename">
-      <xsl:choose>
-        <xsl:when test="descendant::*:text[1]/@*:id">
-          <xsl:value-of select="descendant::*:text[1]/@*:id"/>
-        </xsl:when>
-        <xsl:when test="@*:id">
-          <xsl:value-of select="@*:id"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="concat($filename,'-',format-number($position,'0000'))"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:result-document href="{$output-directory}/{$result-filename}.xml">
-      <xsl:copy-of select="."></xsl:copy-of>
-    </xsl:result-document>
-  </xsl:for-each>
-</xsl:template>
+	<xsl:param name="output-directory">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/.]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(1)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:param>
 
+	<xsl:variable name="filename">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/.]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
 
+	<xsl:template match="*:teiCorpus">
+		<xsl:for-each select="descendant::*:TEI">
+			<xsl:variable name="position" as="xs:integer">
+				<xsl:number level="any" />
+			</xsl:variable>
+			<xsl:variable name="result-filename">
+				<xsl:choose>
+					<xsl:when test="descendant::*:text[1]/@*:id">
+						<xsl:value-of select="descendant::*:text[1]/@*:id" />
+					</xsl:when>
+					<xsl:when test="@*:id">
+						<xsl:value-of select="@*:id" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of
+							select="concat($filename,'-',format-number($position,'0000'))" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:result-document
+				href="{$output-directory}/{$result-filename}.xml">
+				<xsl:copy-of select="."></xsl:copy-of>
+			</xsl:result-document>
+		</xsl:for-each>
+	</xsl:template>
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/teislides.css
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/teislides.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/teislides.css	(revision 2397)
@@ -1,319 +1,309 @@
 /* teislides.css */
-
-body
-{
-    background: white;
-    font-family: Helvetica;
-    font-size: 24pt; 
-    color: black;
+body {
+	background: white;
+	font-family: Helvetica;
+	font-size: 24pt;
+	color: black;
 }
 
-table,tr,td {
-    font-size: 20pt; 
+table, tr, td {
+	font-size: 20pt;
 }
+
 .label {
-   font-weight: bold;
-   background-color: #AAAAAA;
+	font-weight: bold;
+	background-color: #AAAAAA;
 }
 
-
 p {
-  margin-top: 10px;
-  margin-bottom: 10px;
-  }
+	margin-top: 10px;
+	margin-bottom: 10px;
+}
 
 li {
-   margin-bottom: 6px;
-   margin-top: 4px;
+	margin-bottom: 6px;
+	margin-top: 4px;
 }
 
-div.pre,div.eg {
-    background: #ffffcc;
-    padding: 6pt;
-    font-family: monospace;
-    white-space: pre ;
-    font-size: 16pt;
-    color: blue;
-    margin-left: 0em;
-    border-style: inset
+div.pre, div.eg {
+	background: #ffffcc;
+	padding: 6pt;
+	font-family: monospace;
+	white-space: pre;
+	font-size: 16pt;
+	color: blue;
+	margin-left: 0em;
+	border-style: inset
 }
 
 div.docAuthor {
-    padding: 12pt;
-    font-size: 34pt;
-    color: green;
+	padding: 12pt;
+	font-size: 34pt;
+	color: green;
 }
 
 div.docDate {
-    padding: 12pt;
-    font-size:34pt;
-    color: blue;
+	padding: 12pt;
+	font-size: 34pt;
+	color: blue;
 }
 
-p,ul,ol,li {
-    font-size: 24pt;
-    }
+p, ul, ol, li {
+	font-size: 24pt;
+}
 
 p.box {
-    background: blue; 
-    color: white ;
-    padding: 10pt;
-    margin-left: 5%;
-    font-size: 24pt;
-    font-weight: bold;
-    margin-right: 5%;
-    margin-top: 12pt;
-    border-style: outset;
+	background: blue;
+	color: white;
+	padding: 10pt;
+	margin-left: 5%;
+	font-size: 24pt;
+	font-weight: bold;
+	margin-right: 5%;
+	margin-top: 12pt;
+	border-style: outset;
 }
 
-
-td
-{
-    color: black;
-    padding: 3px;
-    margin-left: 5%;
-    margin-right: 5%;
-    margin-top: 3%;
+td {
+	color: black;
+	padding: 3px;
+	margin-left: 5%;
+	margin-right: 5%;
+	margin-top: 3%;
 }
 
-div.pre, code, tt, Code
-{
-    white-space: pre ;
-    font-family:  monospace;
-    color: blue;
-    font-size: 20pt;
+div.pre, code, tt, Code {
+	white-space: pre;
+	font-family: monospace;
+	color: blue;
+	font-size: 20pt;
 }
 
 tt.url {
-    font-family:  sans-serif;
-    }
+	font-family: sans-serif;
+}
 
+h2 {
+	margin-top: 24pt;
+	font-size: 32pt;
+	font-family: serif;
+	color: green;
+	background: white;
+	text-align: center;
+	border-width: 5pt;
+	border-color: white;
+	padding: 0pt;
+	margin: 0pt;
+}
 
-h2 {    margin-top: 24pt;
-    font-size: 32pt;
-    font-family: serif;
-    color: green;
-    background: white;
-        text-align: center;
-    border-width: 5pt;
-    border-color: white;
-    padding: 0pt;
-    margin: 0pt;
-    }
+ul, dl, ol {
+	font-size: 24pt;
+}
 
+li.lower {
+	font-style: normal;
+}
 
-ul,dl,ol {    
-    font-size: 24pt;
-     }
-
-li.lower {     font-style: normal; }
-
-
-
-blockquote
-{
-    margin-left: 5%;
-    margin-right: 5%;
-    margin-top: 0.5em;
-    margin-bottom: 1.5em;
-/*    color: gray; */
-    color: teal;
-    text-align: justify;
-    font-size: smaller;
+blockquote {
+	margin-left: 5%;
+	margin-right: 5%;
+	margin-top: 0.5em;
+	margin-bottom: 1.5em;
+	/*    color: gray; */
+	color: teal;
+	text-align: justify;
+	font-size: smaller;
 }
 
-address
-{
-    font-style:  normal;
-    font-family: cursive;
-    letter-spacing: .1em;
-    font-size: x-small;
+address {
+	font-style: normal;
+	font-family: cursive;
+	letter-spacing: .1em;
+	font-size: x-small;
 }
 
-a:link
-{
-    color:  blue;
+a:link {
+	color: blue;
 }
 
-
-a:visited
-{
-    color:  navy;
+a:visited {
+	color: navy;
 }
 
-
-a:active
-{
-    color:  purple;
-    background: yellow;
+a:active {
+	color: purple;
+	background: yellow;
 }
 
-
-a:hover
-{
-    color:  blue;
-    background:     silver;
+a:hover {
+	color: blue;
+	background: silver;
 }
 
-.titlebar
-{
-    color: white;
-    background: navy;
+.titlebar {
+	color: white;
+	background: navy;
 }
 
-
-
 div.slidemain {
-      clear: both;
-      height: 75%;
-      border-top: 2px;
-      border-left: 0;
-      border-bottom: 0;
-      border-right: 0;
-      border-style: solid;
-      border-color: blue;
-      padding-left: 5%;
-      padding-right: 5%;
-      padding-top: 10pt;
+	clear: both;
+	height: 75%;
+	border-top: 2px;
+	border-left: 0;
+	border-bottom: 0;
+	border-right: 0;
+	border-style: solid;
+	border-color: blue;
+	padding-left: 5%;
+	padding-right: 5%;
+	padding-top: 10pt;
+}
 
-	      }
-
 div.slidebottom-text {
-      font-style: italic;
-      font-size: 12pt;
-      float: right;
+	font-style: italic;
+	font-size: 12pt;
+	float: right;
 }
+
 div.slidebottom-image {
-      float: left;
+	float: left;
 }
+
 div.slidebottom {
-      clear:both;
-      height: 2%;
-      margin-top: 10pt;
-      border-top: 2px;
-      border-left: 0;
-      border-bottom: 0;
-      border-right: 0;
-	      }
+	clear: both;
+	height: 2%;
+	margin-top: 10pt;
+	border-top: 2px;
+	border-left: 0;
+	border-bottom: 0;
+	border-right: 0;
+}
 
 div.slidetop {
-      padding-top: 2%;
+	padding-top: 2%;
 }
 
 div.slidetitle {
-    height: 10%;
-    float: left;
-    color:red;
-    font-size: 35pt;
-    font-weight: bold;
-    font-family: sans-serif;
-    text-align: left;
-    margin-bottom: 12pt;
-    padding-left: 5%;
+	height: 10%;
+	float: left;
+	color: red;
+	font-size: 35pt;
+	font-weight: bold;
+	font-family: sans-serif;
+	text-align: left;
+	margin-bottom: 12pt;
+	padding-left: 5%;
 }
+
 div.xref {
-    height: 10%;
-    float: right;
-    font-size: 12pt;
-    font-weight: bold;
-    margin-bottom: 12pt;
+	height: 10%;
+	float: right;
+	font-size: 12pt;
+	font-weight: bold;
+	margin-bottom: 12pt;
 }
 
-span.bottomright{
-    float: right;
-    margin-top:0;
-    margin-bottom: 8pt;
+span.bottomright {
+	float: right;
+	margin-top: 0;
+	margin-bottom: 8pt;
 }
 
-
-
 li.slidetoc {
- display: inline;
-}	      
+	display: inline;
+}
 
 li.slidetoc:before {
-  content: " * ";
-  font-style: italic;
+	content: " * ";
+	font-style: italic;
 }
 
-
-
 img.simple {
-	   border-style: none;
-	   }
+	border-style: none;
+}
+
 img.inline {
-	   border-style: none;
-	   }
+	border-style: none;
+}
+
 img.right {
-	   float:right
-	   }
+	float: right
+}
+
 img.left {
-	   float:left
-	   }
+	float: left
+}
+
 .button {
-    font-family: Symbol;
-    padding: 2px;
-    font-weight: bold;
-    border-style: outset;
-    background: blue; 
-    color: white ;
+	font-family: Symbol;
+	padding: 2px;
+	font-weight: bold;
+	border-style: outset;
+	background: blue;
+	color: white;
 }
+
 a.xreflink:link {
-		        text-decoration: none;		 	    
-	    }		 
+	text-decoration: none;
+}
+
 a.xreflink:visited {
-		        text-decoration: none;		 	    
-	    }		 
+	text-decoration: none;
+}
 
 span.ident {
-    color: teal
+	color: teal
 }
 
-
-div.pre_verbatim{
-    white-space: pre ;
-	border-style: solid ;
+div.pre_verbatim {
+	white-space: pre;
+	border-style: solid;
 	border-width: 1pt;
 	border-color: yellow;
 	border-style: inset;
-        background-color: #ffffcc;
+	background-color: #ffffcc;
 }
 
-strong { color: green;
-	font-weight: normal; 
+strong {
+	color: green;
+	font-weight: normal;
 }
 
-
 dt {
-   font-weight: bold;
-   }
+	font-weight: bold;
+}
 
 tr.Odd {
-       }
+	
+}
+
 tr.Even {
 	background-color: #DDDDDD;
-	}
+}
 
 /* generic <hi> */
 span.hi {
-   font-weight: bold;
+	font-weight: bold;
 }
 /* verbatim display */
 span.element {
- font-weight: bold;
- color: blue;
+	font-weight: bold;
+	color: blue;
 }
 
 span.attribute {
-    color: green;
+	color: green;
 }
+
 span.attributevalue {
-    color: magenta;
+	color: magenta;
 }
+
 span.comment {
-    color: orange;
-    font-style:italic;
+	color: orange;
+	font-style: italic;
 }
+
 span.namespace {
-    color: red;
-}
+	color: red;
+}
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/bibtex/teitobib.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/bibtex/teitobib.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/bibtex/teitobib.xsl	(revision 2397)
@@ -1,176 +1,194 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xpath-default-namespace="http://www.tei-c.org/ns/1.0"
-                version="2.0">
-  <xsl:output method="text"/>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
+	<xsl:output method="text" />
 
-  <xsl:key name="B" match="biblStruct" use="1"/>
-    <xsl:strip-space elements="*"/>
+	<xsl:key name="B" match="biblStruct" use="1" />
+	<xsl:strip-space elements="*" />
 
-  <xsl:template match="/">
+	<xsl:template match="/">
 
-    <xsl:for-each select="key('B',1)">
-      <xsl:variable name="type">
-	<xsl:choose>
-	  <xsl:when test="idno[@type='url']">
-	    <xsl:text>techreport</xsl:text>
-	  </xsl:when>
-	  <xsl:when test="not(analytic)">
-	    <xsl:text>book</xsl:text>
-	  </xsl:when>
-	  <xsl:when test="monogr/imprint/biblScope[@type='volume']">
-	    <xsl:text>article</xsl:text>	    
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:text>incollection</xsl:text>	    
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:variable>
-      <xsl:text>@</xsl:text>
-      <xsl:value-of select="$type"/>
-      <xsl:text>{</xsl:text>
-      <xsl:value-of select="@xml:id"/>
-      <xsl:text>,&#10;</xsl:text>
-      <xsl:variable name="all">
-	<xsl:apply-templates/>
-      </xsl:variable>
-      <xsl:for-each select="tokenize($all,'@')">
-	<xsl:if test="not(.='')">
-	  <xsl:text>	</xsl:text>
-	  <xsl:value-of select="."/>
-	  <xsl:if test="not(position()=last())">,</xsl:if>
-	  <xsl:text>&#10;</xsl:text>
-	</xsl:if>
-	</xsl:for-each>
-      <xsl:text>}&#10;&#10;</xsl:text>
-    </xsl:for-each>
-  </xsl:template>
+		<xsl:for-each select="key('B',1)">
+			<xsl:variable name="type">
+				<xsl:choose>
+					<xsl:when test="idno[@type='url']">
+						<xsl:text>techreport</xsl:text>
+					</xsl:when>
+					<xsl:when test="not(analytic)">
+						<xsl:text>book</xsl:text>
+					</xsl:when>
+					<xsl:when test="monogr/imprint/biblScope[@type='volume']">
+						<xsl:text>article</xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>incollection</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:text>@</xsl:text>
+			<xsl:value-of select="$type" />
+			<xsl:text>{</xsl:text>
+			<xsl:value-of select="@xml:id" />
+			<xsl:text>,&#10;</xsl:text>
+			<xsl:variable name="all">
+				<xsl:apply-templates />
+			</xsl:variable>
+			<xsl:for-each select="tokenize($all,'@')">
+				<xsl:if test="not(.='')">
+					<xsl:text>	</xsl:text>
+					<xsl:value-of select="." />
+					<xsl:if test="not(position()=last())">
+						,
+					</xsl:if>
+					<xsl:text>&#10;</xsl:text>
+				</xsl:if>
+			</xsl:for-each>
+			<xsl:text>}&#10;&#10;</xsl:text>
+		</xsl:for-each>
+	</xsl:template>
 
-<xsl:template match="publisher">
-  <xsl:text>@publisher={</xsl:text>
-  <xsl:value-of select="."/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="publisher">
+		<xsl:text>@publisher={</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="note">
-  <xsl:text>@note={</xsl:text>
-  <xsl:value-of select="."/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="note">
+		<xsl:text>@note={</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="idno[@type='url']">
-  <xsl:text>@url={</xsl:text>
-  <xsl:value-of select="."/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="idno[@type='url']">
+		<xsl:text>@url={</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="pubPlace">
-  <xsl:text>@address={</xsl:text>
-  <xsl:value-of select="."/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="pubPlace">
+		<xsl:text>@address={</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="date">
-  <xsl:text>@year={</xsl:text>
-  <xsl:value-of select="."/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="date">
+		<xsl:text>@year={</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="series/title">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="series/title">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="title">
-  <xsl:variable name="name">
-    <xsl:choose>
-      <xsl:when test="@level='a' or not(ancestor::biblStruct/analytic)">title</xsl:when>
-      <xsl:when test="@level='j' or parent::monogr/imprint/biblScope[@type='volume']">journal</xsl:when>
-      <xsl:when test="@level='m' or parent::monogr">booktitle</xsl:when>
-      <xsl:when test="@level='s'">series</xsl:when>
-      <xsl:otherwise>title</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  <xsl:text>@</xsl:text>
-  <xsl:value-of select="$name"/>
-  <xsl:text>={{</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:text>}}</xsl:text>
-</xsl:template>
+	<xsl:template match="title">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when
+					test="@level='a' or not(ancestor::biblStruct/analytic)">
+					title
+				</xsl:when>
+				<xsl:when
+					test="@level='j' or parent::monogr/imprint/biblScope[@type='volume']">
+					journal
+				</xsl:when>
+				<xsl:when test="@level='m' or parent::monogr">
+					booktitle
+				</xsl:when>
+				<xsl:when test="@level='s'">
+					series
+				</xsl:when>
+				<xsl:otherwise>
+					title
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:text>@</xsl:text>
+		<xsl:value-of select="$name" />
+		<xsl:text>={{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="q">
-  <xsl:text>``</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:text>''</xsl:text>
-</xsl:template>
+	<xsl:template match="q">
+		<xsl:text>``</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>''</xsl:text>
+	</xsl:template>
 
-<xsl:template match="series">
-  <xsl:text>@type={</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="series">
+		<xsl:text>@type={</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="biblScope[@type='pages']">
-  <xsl:text>@pages={</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="biblScope[@type='pages']">
+		<xsl:text>@pages={</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="biblScope[@type='volume']">
-  <xsl:text>@volume={</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="biblScope[@type='volume']">
+		<xsl:text>@volume={</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="biblScope[@type='issue']">
-  <xsl:text>@issue={</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="biblScope[@type='issue']">
+		<xsl:text>@issue={</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="edition">
-  <xsl:text>@edition={</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:text>}</xsl:text>
-</xsl:template>
+	<xsl:template match="edition">
+		<xsl:text>@edition={</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-<xsl:template match="editor">
-  <xsl:if test="not(preceding-sibling::editor)">
-    <xsl:text>@editor={</xsl:text>
-    <xsl:for-each select="../editor">
-      <xsl:choose>
-	<xsl:when test="forename and surname">
-	  <xsl:value-of select="forename"/>
-	  <xsl:text> </xsl:text>
-	  <xsl:value-of select="surname"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:apply-templates/>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:if test="following-sibling::editor"> and </xsl:if>
-    </xsl:for-each>
-    <xsl:text>}</xsl:text>
-  </xsl:if>
-</xsl:template>
+	<xsl:template match="editor">
+		<xsl:if test="not(preceding-sibling::editor)">
+			<xsl:text>@editor={</xsl:text>
+			<xsl:for-each select="../editor">
+				<xsl:choose>
+					<xsl:when test="forename and surname">
+						<xsl:value-of select="forename" />
+						<xsl:text> </xsl:text>
+						<xsl:value-of select="surname" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:if test="following-sibling::editor">
+					and
+				</xsl:if>
+			</xsl:for-each>
+			<xsl:text>}</xsl:text>
+		</xsl:if>
+	</xsl:template>
 
-<xsl:template match="author">
-  <xsl:if test="not(preceding-sibling::author)">
-    <xsl:text>@author={</xsl:text>
-    <xsl:for-each select="../author">
-      <xsl:choose>
-	<xsl:when test="forename and surname">
-	  <xsl:value-of select="forename"/>
-	  <xsl:text> </xsl:text>
-	  <xsl:value-of select="surname"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:apply-templates/>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:if test="following-sibling::author"> and </xsl:if>
-    </xsl:for-each>
-    <xsl:text>}</xsl:text>
-  </xsl:if>
-</xsl:template>
+	<xsl:template match="author">
+		<xsl:if test="not(preceding-sibling::author)">
+			<xsl:text>@author={</xsl:text>
+			<xsl:for-each select="../author">
+				<xsl:choose>
+					<xsl:when test="forename and surname">
+						<xsl:value-of select="forename" />
+						<xsl:text> </xsl:text>
+						<xsl:value-of select="surname" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:if test="following-sibling::author">
+					and
+				</xsl:if>
+			</xsl:for-each>
+			<xsl:text>}</xsl:text>
+		</xsl:if>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub3/tei-to-epub3.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub3/tei-to-epub3.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub3/tei-to-epub3.xsl	(revision 2397)
@@ -1,583 +1,769 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:iso="http://www.iso.org/ns/1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2.0" exclude-result-prefixes="iso tei teix dc html ncx" xpath-default-namespace="http://www.tei-c.org/ns/1.0">
-  <xsl:import href="../html5/tei.xsl"/>
-  <xsl:import href="../epub/epub-common.xsl"/>
-  <xsl:import href="../epub/epub-preflight.xsl"/>
-  <xsl:output method="xml" encoding="utf-8" doctype-system="" indent="no"/>
-  <xsl:key match="tei:graphic[not(ancestor::teix:egXML)]" use="1" name="G"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p>
-	TEI stylesheet for making ePub output. A lot learnt from
-	http://www.hxa.name/articles/content/epub-guide_hxa7241_2007.xhtml and
-	the stylesheets of the NZETC.
-      </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2.0"
+	exclude-result-prefixes="iso tei teix dc html ncx"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0">
+	<xsl:import href="../html5/tei.xsl" />
+	<xsl:import href="../epub/epub-common.xsl" />
+	<xsl:import href="../epub/epub-preflight.xsl" />
+	<xsl:output method="xml" encoding="utf-8" doctype-system=""
+		indent="no" />
+	<xsl:key match="tei:graphic[not(ancestor::teix:egXML)]" use="1"
+		name="G" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet for making ePub output. A lot learnt from
+				http://www.hxa.name/articles/content/epub-guide_hxa7241_2007.xhtml
+				and
+				the stylesheets of the NZETC.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: tei-to-epub3.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:param name="opfPackageVersion">3.0</xsl:param>
-  <xsl:param name="STDOUT">false</xsl:param>
-  <xsl:param name="autoHead">true</xsl:param>
-  <xsl:param name="autoToc">true</xsl:param>
-  <xsl:param name="bottomNavigationPanel">false</xsl:param>
-  <xsl:param name="coverimage"/>
-  <xsl:param name="createanttask">false</xsl:param>
-  <xsl:param name="cssFile">../tei.css</xsl:param>
-  <xsl:param name="cssODDFile">../odd.css</xsl:param>
-  <xsl:param name="cssPrintFile">../epub-print.css</xsl:param>
-  <xsl:param name="debug">false</xsl:param>
-  <xsl:param name="directory">.</xsl:param>
-  <xsl:param name="doctypePublic"/>
-  <xsl:param name="doctypeSystem"/>
-  <xsl:param name="fixgraphicsurl">false</xsl:param>
-  <xsl:param name="inputDir">.</xsl:param>
-  <xsl:param name="institution"/>
-  <xsl:param name="linkPanel">false</xsl:param>
-  <xsl:param name="odd">false</xsl:param>
-  <xsl:param name="outputDir"><xsl:value-of select="$directory"/>/OPS</xsl:param>
-  <xsl:param name="outputMethod">xml</xsl:param>
-  <xsl:param name="outputSuffix">.xhtml</xsl:param>
-  <xsl:param name="outputTarget">epub3</xsl:param>
-  <xsl:param name="publisher"/>
-  <xsl:param name="splitLevel">0</xsl:param>
-  <xsl:param name="subject"/>
-  <xsl:param name="tocDepth">5</xsl:param>
-  <xsl:param name="tocFront">true</xsl:param>
-  <xsl:param name="topNavigationPanel">false</xsl:param>
-  <xsl:param name="uid"/>
-  <xsl:param name="useHeaderFrontMatter">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>(extensible) wrapper for root element</desc>
-  </doc>
-  <xsl:template match="/">
-    <xsl:call-template name="processTEI"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Override of top-level template. This does most of
-  the work: performing the normal transformation, fixing the links to graphics files so that they are
-  all relative, creating the extra output files, etc</desc>
-  </doc>
-  <xsl:template name="processTEI">
-    <xsl:variable name="stage1">
-      <xsl:apply-templates mode="preflight"/>
-    </xsl:variable>
-    <xsl:for-each select="$stage1">
-      <xsl:call-template name="processTEIHook"/>
-      <xsl:variable name="coverImageOutside">
-        <xsl:choose>
-          <xsl:when test="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs]">
-            <xsl:for-each select="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs][1]">
-              <xsl:for-each select="id(substring(@facs,2))">
-                <xsl:choose>
-                  <xsl:when test="count(tei:graphic)=1">
-                    <xsl:value-of select="tei:graphic/@url"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:value-of select="tei:graphic[2]/@url"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </xsl:for-each>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:when test="not($coverimage='')">
-            <xsl:value-of select="$coverimage"/>
-          </xsl:when>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="coverImageInside">
-        <xsl:choose>
-          <xsl:when test="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs]">
-            <xsl:for-each select="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs][1]">
-              <xsl:for-each select="id(substring(@facs,2))">
-                <xsl:value-of select="tei:graphic[1]/@url"/>
-              </xsl:for-each>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:when test="not($coverimage='')">
-            <xsl:value-of select="$coverimage"/>
-          </xsl:when>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-        <xsl:when test="$splitLevel='-1'">
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates mode="split"/>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:for-each select="*">
-        <xsl:variable name="TOC">
-          <TOC xmlns="http://www.w3.org/1999/xhtml">
-            <xsl:call-template name="mainTOC"/>
-          </TOC>
-        </xsl:variable>
-        <!--
-	    <xsl:result-document href="/tmp/TOC">
-	    <xsl:copy-of select="$TOC"/>
-	    </xsl:result-document>
--->
-        <xsl:for-each select="tokenize($javascriptFiles,',')">
-          <xsl:variable name="file" select="normalize-space(.)"/>
-          <xsl:variable name="name" select="tokenize($file,'/')[last()]"/>
-          <xsl:if test="$verbose='true'">
-            <xsl:message>write Javascript file <xsl:value-of select="$name"/></xsl:message>
-          </xsl:if>
-          <xsl:result-document method="text" href="{concat($directory,'/OPS/',$name)}">
-            <xsl:for-each select="unparsed-text($file)">
-              <xsl:copy-of select="."/>
-            </xsl:for-each>
-          </xsl:result-document>
-        </xsl:for-each>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/stylesheet.css</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="text" href="{concat($directory,'/OPS/stylesheet.css')}">
-          <xsl:if test="not($cssFile='')">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>reading file <xsl:value-of select="$cssFile"/></xsl:message>
-            </xsl:if>
-            <xsl:for-each select="tokenize(unparsed-text($cssFile),     '\r?\n')">
-              <xsl:call-template name="purgeCSS"/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="not($cssSecondaryFile='')">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>reading secondary file <xsl:value-of select="$cssSecondaryFile"/></xsl:message>
-            </xsl:if>
-            <xsl:for-each select="tokenize(unparsed-text($cssSecondaryFile),       '\r?\n')">
-              <xsl:call-template name="purgeCSS"/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="$odd='true'">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>reading file <xsl:value-of select="$cssODDFile"/></xsl:message>
-            </xsl:if>
-            <xsl:for-each select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
-              <xsl:call-template name="purgeCSS"/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="$odd='true'">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>reading file <xsl:value-of select="$cssODDFile"/></xsl:message>
-            </xsl:if>
-            <xsl:for-each select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
-              <xsl:call-template name="purgeCSS"/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="$filePerPage='true'">
-            <xsl:text>body { width: </xsl:text>
-            <xsl:value-of select="$viewPortWidth"/>
-            <xsl:text>px;
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-to-epub3.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:param name="opfPackageVersion">
+		3.0
+	</xsl:param>
+	<xsl:param name="STDOUT">
+		false
+	</xsl:param>
+	<xsl:param name="autoHead">
+		true
+	</xsl:param>
+	<xsl:param name="autoToc">
+		true
+	</xsl:param>
+	<xsl:param name="bottomNavigationPanel">
+		false
+	</xsl:param>
+	<xsl:param name="coverimage" />
+	<xsl:param name="createanttask">
+		false
+	</xsl:param>
+	<xsl:param name="cssFile">
+		../tei.css
+	</xsl:param>
+	<xsl:param name="cssODDFile">
+		../odd.css
+	</xsl:param>
+	<xsl:param name="cssPrintFile">
+		../epub-print.css
+	</xsl:param>
+	<xsl:param name="debug">
+		false
+	</xsl:param>
+	<xsl:param name="directory">
+		.
+	</xsl:param>
+	<xsl:param name="doctypePublic" />
+	<xsl:param name="doctypeSystem" />
+	<xsl:param name="fixgraphicsurl">
+		false
+	</xsl:param>
+	<xsl:param name="inputDir">
+		.
+	</xsl:param>
+	<xsl:param name="institution" />
+	<xsl:param name="linkPanel">
+		false
+	</xsl:param>
+	<xsl:param name="odd">
+		false
+	</xsl:param>
+	<xsl:param name="outputDir">
+		<xsl:value-of select="$directory" />
+		/OPS
+	</xsl:param>
+	<xsl:param name="outputMethod">
+		xml
+	</xsl:param>
+	<xsl:param name="outputSuffix">
+		.xhtml
+	</xsl:param>
+	<xsl:param name="outputTarget">
+		epub3
+	</xsl:param>
+	<xsl:param name="publisher" />
+	<xsl:param name="splitLevel">
+		0
+	</xsl:param>
+	<xsl:param name="subject" />
+	<xsl:param name="tocDepth">
+		5
+	</xsl:param>
+	<xsl:param name="tocFront">
+		true
+	</xsl:param>
+	<xsl:param name="topNavigationPanel">
+		false
+	</xsl:param>
+	<xsl:param name="uid" />
+	<xsl:param name="useHeaderFrontMatter">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>(extensible) wrapper for root element</desc>
+	</doc>
+	<xsl:template match="/">
+		<xsl:call-template name="processTEI" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Override of top-level template. This does most of
+			the work: performing the normal transformation, fixing the links to
+			graphics files so that they are
+			all relative, creating the extra output files, etc</desc>
+	</doc>
+	<xsl:template name="processTEI">
+		<xsl:variable name="stage1">
+			<xsl:apply-templates mode="preflight" />
+		</xsl:variable>
+		<xsl:for-each select="$stage1">
+			<xsl:call-template name="processTEIHook" />
+			<xsl:variable name="coverImageOutside">
+				<xsl:choose>
+					<xsl:when
+						test="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs]">
+						<xsl:for-each
+							select="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs][1]">
+							<xsl:for-each select="id(substring(@facs,2))">
+								<xsl:choose>
+									<xsl:when test="count(tei:graphic)=1">
+										<xsl:value-of select="tei:graphic/@url" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="tei:graphic[2]/@url" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="not($coverimage='')">
+						<xsl:value-of select="$coverimage" />
+					</xsl:when>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:variable name="coverImageInside">
+				<xsl:choose>
+					<xsl:when
+						test="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs]">
+						<xsl:for-each
+							select="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs][1]">
+							<xsl:for-each select="id(substring(@facs,2))">
+								<xsl:value-of select="tei:graphic[1]/@url" />
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="not($coverimage='')">
+						<xsl:value-of select="$coverimage" />
+					</xsl:when>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when test="$splitLevel='-1'">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="split" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:for-each select="*">
+				<xsl:variable name="TOC">
+					<TOC xmlns="http://www.w3.org/1999/xhtml">
+						<xsl:call-template name="mainTOC" />
+					</TOC>
+				</xsl:variable>
+				<!-- <xsl:result-document href="/tmp/TOC"> <xsl:copy-of select="$TOC"/> 
+					</xsl:result-document> -->
+				<xsl:for-each select="tokenize($javascriptFiles,',')">
+					<xsl:variable name="file" select="normalize-space(.)" />
+					<xsl:variable name="name"
+						select="tokenize($file,'/')[last()]" />
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							write Javascript file
+							<xsl:value-of select="$name" />
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document method="text"
+						href="{concat($directory,'/OPS/',$name)}">
+						<xsl:for-each select="unparsed-text($file)">
+							<xsl:copy-of select="." />
+						</xsl:for-each>
+					</xsl:result-document>
+				</xsl:for-each>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/stylesheet.css
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="text"
+					href="{concat($directory,'/OPS/stylesheet.css')}">
+					<xsl:if test="not($cssFile='')">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								reading file
+								<xsl:value-of select="$cssFile" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:for-each
+							select="tokenize(unparsed-text($cssFile),     '\r?\n')">
+							<xsl:call-template name="purgeCSS" />
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:if test="not($cssSecondaryFile='')">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								reading secondary file
+								<xsl:value-of select="$cssSecondaryFile" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:for-each
+							select="tokenize(unparsed-text($cssSecondaryFile),       '\r?\n')">
+							<xsl:call-template name="purgeCSS" />
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:if test="$odd='true'">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								reading file
+								<xsl:value-of select="$cssODDFile" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:for-each
+							select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
+							<xsl:call-template name="purgeCSS" />
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:if test="$odd='true'">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								reading file
+								<xsl:value-of select="$cssODDFile" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:for-each
+							select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
+							<xsl:call-template name="purgeCSS" />
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:if test="$filePerPage='true'">
+						<xsl:text>body { width: </xsl:text>
+						<xsl:value-of select="$viewPortWidth" />
+						<xsl:text>px;
  height: </xsl:text>
-            <xsl:value-of select="$viewPortHeight"/>
-            <xsl:text>px;
+						<xsl:value-of select="$viewPortHeight" />
+						<xsl:text>px;
 }
 img.fullpage {
 position: absolute;
 height: </xsl:text>
-            <xsl:value-of select="$viewPortHeight"/>
-            <xsl:text>px; left:0px; top:0px;}
+						<xsl:value-of select="$viewPortHeight" />
+						<xsl:text>px; left:0px; top:0px;}
 </xsl:text>
-          </xsl:if>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/print.css</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="text" href="{concat($directory,'/OPS/print.css')}">
-          <xsl:if test="$verbose='true'">
-            <xsl:message>reading file <xsl:value-of select="$cssPrintFile"/></xsl:message>
-          </xsl:if>
-          <xsl:for-each select="tokenize(unparsed-text($cssPrintFile),     '\r?\n')">
-            <xsl:call-template name="purgeCSS"/>
-          </xsl:for-each>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file mimetype</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="text" href="{concat($directory,'/mimetype')}">
-          <xsl:value-of select="$epubMimetype"/>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file META-INF/container.xml</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="xml" href="{concat($directory,'/META-INF/container.xml')}">
-          <container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
-            <rootfiles>
-              <rootfile full-path="OPS/package.opf" media-type="application/oebps-package+xml"/>
-            </rootfiles>
-          </container>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/package.opf</xsl:message>
-        </xsl:if>
-	<xsl:variable name="A">
-	  <xsl:call-template name="generateAuthor"/>
-	</xsl:variable>
-	<xsl:variable name="printA">
-	  <xsl:analyze-string select="$A" regex="([^,]+), ([^,]+), (.+)">
-	    <xsl:matching-substring>
-	      <xsl:value-of select="regex-group(1)"/>
-	      <xsl:text>, </xsl:text>
-	      <xsl:value-of select="regex-group(2)"/>
-	    </xsl:matching-substring>
-	    <xsl:non-matching-substring>
-	      <xsl:value-of select="."/>
-	    </xsl:non-matching-substring>
-	  </xsl:analyze-string>
-	</xsl:variable>	
-        <xsl:result-document
-	    href="{concat($directory,'/OPS/package.opf')}"
-	    method="xml" indent="yes">
-          <package xmlns="http://www.idpf.org/2007/opf" unique-identifier="pub-id" version="{$opfPackageVersion}">
-	    <xsl:call-template name="opfmetadata">
-	      <xsl:with-param name="author" select="$A"/>
-	      <xsl:with-param name="printAuthor" select="$printA"/>
-	      <xsl:with-param name="coverImageOutside" select="$coverImageOutside"/>
-	    </xsl:call-template>
-            <manifest>
-              <!-- deal with intricacies of overlay files -->
-              <xsl:variable name="TL" select="key('Timeline',1)"/>
-              <xsl:if test="$mediaoverlay='true' and key('Timeline',1)">
-                <xsl:if test="$verbose='true'">
-                  <xsl:message>write file SMIL files</xsl:message>
-                </xsl:if>
-                <xsl:for-each select="key('Timeline',1)">
-                  <xsl:variable name="TLnumber">
-                    <xsl:number level="any"/>
-                  </xsl:variable>
-                  <xsl:variable name="audio">
-                    <xsl:text>media/audio</xsl:text>
-                    <xsl:number level="any"/>
-                    <xsl:text>.</xsl:text>
-                    <xsl:value-of select="tokenize(@corresp,'\.')[last()]"/>
-                  </xsl:variable>
-                  <item id="timeline-audio{$TLnumber}" href="{$audio}">
-                    <xsl:attribute name="media-type">
+					</xsl:if>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/print.css
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="text"
+					href="{concat($directory,'/OPS/print.css')}">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							reading file
+							<xsl:value-of select="$cssPrintFile" />
+						</xsl:message>
+					</xsl:if>
+					<xsl:for-each
+						select="tokenize(unparsed-text($cssPrintFile),     '\r?\n')">
+						<xsl:call-template name="purgeCSS" />
+					</xsl:for-each>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file mimetype
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="text"
+					href="{concat($directory,'/mimetype')}">
+					<xsl:value-of select="$epubMimetype" />
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file META-INF/container.xml
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="xml"
+					href="{concat($directory,'/META-INF/container.xml')}">
+					<container
+						xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+						version="1.0">
+						<rootfiles>
+							<rootfile full-path="OPS/package.opf"
+								media-type="application/oebps-package+xml" />
+						</rootfiles>
+					</container>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/package.opf
+					</xsl:message>
+				</xsl:if>
+				<xsl:variable name="A">
+					<xsl:call-template name="generateAuthor" />
+				</xsl:variable>
+				<xsl:variable name="printA">
+					<xsl:analyze-string select="$A"
+						regex="([^,]+), ([^,]+), (.+)">
+						<xsl:matching-substring>
+							<xsl:value-of select="regex-group(1)" />
+							<xsl:text>, </xsl:text>
+							<xsl:value-of select="regex-group(2)" />
+						</xsl:matching-substring>
+						<xsl:non-matching-substring>
+							<xsl:value-of select="." />
+						</xsl:non-matching-substring>
+					</xsl:analyze-string>
+				</xsl:variable>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/package.opf')}" method="xml"
+					indent="yes">
+					<package xmlns="http://www.idpf.org/2007/opf"
+						unique-identifier="pub-id" version="{$opfPackageVersion}">
+						<xsl:call-template name="opfmetadata">
+							<xsl:with-param name="author" select="$A" />
+							<xsl:with-param name="printAuthor"
+								select="$printA" />
+							<xsl:with-param name="coverImageOutside"
+								select="$coverImageOutside" />
+						</xsl:call-template>
+						<manifest>
+							<!-- deal with intricacies of overlay files -->
+							<xsl:variable name="TL" select="key('Timeline',1)" />
+							<xsl:if test="$mediaoverlay='true' and key('Timeline',1)">
+								<xsl:if test="$verbose='true'">
+									<xsl:message>
+										write file SMIL files
+									</xsl:message>
+								</xsl:if>
+								<xsl:for-each select="key('Timeline',1)">
+									<xsl:variable name="TLnumber">
+										<xsl:number level="any" />
+									</xsl:variable>
+									<xsl:variable name="audio">
+										<xsl:text>media/audio</xsl:text>
+										<xsl:number level="any" />
+										<xsl:text>.</xsl:text>
+										<xsl:value-of
+											select="tokenize(@corresp,'\.')[last()]" />
+									</xsl:variable>
+									<item id="timeline-audio{$TLnumber}" href="{$audio}">
+										<xsl:attribute name="media-type">
                       <xsl:choose>
-                        <xsl:when test="contains($audio,'.m4a')">audio/m4a</xsl:when>
+                        <xsl:when
+											test="contains($audio,'.m4a')">audio/m4a</xsl:when>
                         <xsl:otherwise>audio/m4a</xsl:otherwise>
                       </xsl:choose>
                     </xsl:attribute>
-                  </item>
-                  <xsl:for-each select="key('PB',1)">
-                    <xsl:variable name="page">
-                      <xsl:value-of select="generate-id()"/>
-                    </xsl:variable>
-                    <xsl:variable name="target">
-                      <xsl:apply-templates select="." mode="ident"/>
-                    </xsl:variable>
-                    <xsl:if test="count(key('objectOnPage',$page))&gt;0">
-                      <item id="{$target}-audio" href="{$target}-overlay.smil" media-type="application/smil+xml"/>
-                      <xsl:result-document href="{concat($directory,'/OPS/',$target,'-overlay.smil')}" method="xml">
-                        <smil xmlns="http://www.w3.org/ns/SMIL" version="3.0" profile="http://www.ipdf.org/epub/30/profile/content/">
-                          <body>
-                            <xsl:for-each select="key('objectOnPage',$page)">
-                              <xsl:variable name="object" select="@xml:id"/>
-                              <xsl:for-each select="$TL">
-                                <xsl:for-each select="key('Object',$object)">
-                                  <par id="{@xml:id}">
-                                    <text src="{$target}.xhtml{@corresp}"/>
-                                    <audio src="{$audio}" clipBegin="{@from}{../@unit}" clipEnd="{@to}{../@unit}"/>
-                                  </par>
-                                </xsl:for-each>
-                              </xsl:for-each>
-                            </xsl:for-each>
-                          </body>
-                        </smil>
-                      </xsl:result-document>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:for-each>
-              </xsl:if>
-              <xsl:if test="not($coverImageOutside='')">
-                <item href="{$coverImageOutside}" id="cover-image" media-type="image/jpeg"/>
-              </xsl:if>
-              <xsl:if test="not($coverimage='') and not($coverimage=$coverImageOutside)">
-                <item href="{$coverimage}" id="cover-image-extra" media-type="image/jpeg"/>
-              </xsl:if>
-              <xsl:for-each select="tokenize($javascriptFiles,',')">
-                <xsl:variable name="name" select="tokenize(normalize-space(.),'/')[last()]"/>
-                <item href="{$name}" id="javascript{position()}" media-type="text/javascript"/>
-              </xsl:for-each>
-              <item id="css" href="stylesheet.css" media-type="text/css"/>
-              <item id="print.css" href="print.css" media-type="text/css"/>
-              <item href="titlepage.xhtml" id="titlepage" media-type="application/xhtml+xml"/>
-              <xsl:if test="$filePerPage='true'">
-                <item href="titlepageverso.xhtml" id="titlepageverso" media-type="application/xhtml+xml"/>
-              </xsl:if>
-              <xsl:for-each select="tei:text/tei:front/tei:titlePage">
-                <xsl:variable name="N" select="position()"/>
-                <item href="titlepage{$N}.xhtml" id="titlepage{$N}" media-type="application/xhtml+xml"/>
-              </xsl:for-each>
-              <item href="titlepageback.xhtml" id="titlepageback" media-type="application/xhtml+xml"/>
-              <item id="toc" properties="nav" href="toc.xhtml" media-type="application/xhtml+xml"/>
-              <item id="start" href="index.xhtml" media-type="application/xhtml+xml"/>
-              <xsl:choose>
-                <xsl:when test="$filePerPage='true'">
-                  <xsl:for-each select="key('PB',1)">
-                    <xsl:variable name="target">
-                      <xsl:apply-templates select="." mode="ident"/>
-                    </xsl:variable>
-                    <xsl:if test="@facs">
-                      <xsl:variable name="facstarget">
-                        <xsl:apply-templates select="." mode="ident"/>
-                        <xsl:text>-facs.xhtml</xsl:text>
-                      </xsl:variable>
-                      <item href="{$facstarget}" media-type="application/xhtml+xml">
-                        <xsl:attribute name="id">
+									</item>
+									<xsl:for-each select="key('PB',1)">
+										<xsl:variable name="page">
+											<xsl:value-of select="generate-id()" />
+										</xsl:variable>
+										<xsl:variable name="target">
+											<xsl:apply-templates select="."
+												mode="ident" />
+										</xsl:variable>
+										<xsl:if test="count(key('objectOnPage',$page))&gt;0">
+											<item id="{$target}-audio" href="{$target}-overlay.smil"
+												media-type="application/smil+xml" />
+											<xsl:result-document
+												href="{concat($directory,'/OPS/',$target,'-overlay.smil')}"
+												method="xml">
+												<smil xmlns="http://www.w3.org/ns/SMIL" version="3.0"
+													profile="http://www.ipdf.org/epub/30/profile/content/">
+													<body>
+														<xsl:for-each
+															select="key('objectOnPage',$page)">
+															<xsl:variable name="object" select="@xml:id" />
+															<xsl:for-each select="$TL">
+																<xsl:for-each
+																	select="key('Object',$object)">
+																	<par id="{@xml:id}">
+																		<text src="{$target}.xhtml{@corresp}" />
+																		<audio src="{$audio}"
+																			clipBegin="{@from}{../@unit}"
+																			clipEnd="{@to}{../@unit}" />
+																	</par>
+																</xsl:for-each>
+															</xsl:for-each>
+														</xsl:for-each>
+													</body>
+												</smil>
+											</xsl:result-document>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:for-each>
+							</xsl:if>
+							<xsl:if test="not($coverImageOutside='')">
+								<item href="{$coverImageOutside}" id="cover-image"
+									media-type="image/jpeg" />
+							</xsl:if>
+							<xsl:if
+								test="not($coverimage='') and not($coverimage=$coverImageOutside)">
+								<item href="{$coverimage}" id="cover-image-extra"
+									media-type="image/jpeg" />
+							</xsl:if>
+							<xsl:for-each
+								select="tokenize($javascriptFiles,',')">
+								<xsl:variable name="name"
+									select="tokenize(normalize-space(.),'/')[last()]" />
+								<item href="{$name}" id="javascript{position()}"
+									media-type="text/javascript" />
+							</xsl:for-each>
+							<item id="css" href="stylesheet.css" media-type="text/css" />
+							<item id="print.css" href="print.css" media-type="text/css" />
+							<item href="titlepage.xhtml" id="titlepage"
+								media-type="application/xhtml+xml" />
+							<xsl:if test="$filePerPage='true'">
+								<item href="titlepageverso.xhtml" id="titlepageverso"
+									media-type="application/xhtml+xml" />
+							</xsl:if>
+							<xsl:for-each
+								select="tei:text/tei:front/tei:titlePage">
+								<xsl:variable name="N" select="position()" />
+								<item href="titlepage{$N}.xhtml" id="titlepage{$N}"
+									media-type="application/xhtml+xml" />
+							</xsl:for-each>
+							<item href="titlepageback.xhtml" id="titlepageback"
+								media-type="application/xhtml+xml" />
+							<item id="toc" properties="nav" href="toc.xhtml"
+								media-type="application/xhtml+xml" />
+							<item id="start" href="index.xhtml"
+								media-type="application/xhtml+xml" />
+							<xsl:choose>
+								<xsl:when test="$filePerPage='true'">
+									<xsl:for-each select="key('PB',1)">
+										<xsl:variable name="target">
+											<xsl:apply-templates select="."
+												mode="ident" />
+										</xsl:variable>
+										<xsl:if test="@facs">
+											<xsl:variable name="facstarget">
+												<xsl:apply-templates select="."
+													mode="ident" />
+												<xsl:text>-facs.xhtml</xsl:text>
+											</xsl:variable>
+											<item href="{$facstarget}"
+												media-type="application/xhtml+xml">
+												<xsl:attribute name="id">
                           <xsl:text>pagefacs</xsl:text>
-                          <xsl:number level="any"/>
+                          <xsl:number level="any" />
                         </xsl:attribute>
-                      </item>
-                    </xsl:if>
-                    <item href="{$target}.xhtml" media-type="application/xhtml+xml">
-                      <xsl:if test="$mediaoverlay='true'">
-                        <xsl:attribute name="media-overlay">
-                          <xsl:value-of select="$target"/>
+											</item>
+										</xsl:if>
+										<item href="{$target}.xhtml"
+											media-type="application/xhtml+xml">
+											<xsl:if test="$mediaoverlay='true'">
+												<xsl:attribute name="media-overlay">
+                          <xsl:value-of select="$target" />
                           <xsl:text>-audio</xsl:text>
                         </xsl:attribute>
-                      </xsl:if>
-                      <xsl:attribute name="id">
+											</xsl:if>
+											<xsl:attribute name="id">
                         <xsl:text>page</xsl:text>
-                        <xsl:number level="any"/>
+                        <xsl:number level="any" />
                       </xsl:attribute>
-                    </item>
-                  </xsl:for-each>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
-                    <xsl:choose>
-                      <xsl:when test="not(html:a)"/>
-                      <xsl:when test="starts-with(html:a/@href,'#')"/>
-                      <xsl:otherwise>
-                        <item href="{html:a[1]/@href}" media-type="application/xhtml+xml">
-                          <xsl:attribute name="id">
+										</item>
+									</xsl:for-each>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each
+										select="$TOC/html:TOC/html:ul/html:li">
+										<xsl:choose>
+											<xsl:when test="not(html:a)" />
+											<xsl:when test="starts-with(html:a/@href,'#')" />
+											<xsl:otherwise>
+												<item href="{html:a[1]/@href}"
+													media-type="application/xhtml+xml">
+													<xsl:attribute name="id">
                             <xsl:text>section</xsl:text>
-                            <xsl:number count="html:li" level="any"/>
+                            <xsl:number count="html:li"
+														level="any" />
                           </xsl:attribute>
-                        </item>
-                      </xsl:otherwise>
-                    </xsl:choose>
-                    <xsl:if test="html:ul">
-                      <xsl:for-each select="html:ul//html:li[html:a          and          not(contains(html:a/@href,'#'))]">
-                        <item href="{html:a[1]/@href}" media-type="application/xhtml+xml">
-                          <xsl:attribute name="id">
+												</item>
+											</xsl:otherwise>
+										</xsl:choose>
+										<xsl:if test="html:ul">
+											<xsl:for-each
+												select="html:ul//html:li[html:a          and          not(contains(html:a/@href,'#'))]">
+												<item href="{html:a[1]/@href}"
+													media-type="application/xhtml+xml">
+													<xsl:attribute name="id">
                             <xsl:text>section</xsl:text>
-                            <xsl:number count="html:li" level="any"/>
+                            <xsl:number count="html:li"
+														level="any" />
                           </xsl:attribute>
-                        </item>
-                      </xsl:for-each>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:otherwise>
-              </xsl:choose>
-              <!-- images -->
-              <xsl:for-each select="key('GRAPHICS',1)">
-                <xsl:variable name="img" select="@url|@facs"/>
-                <xsl:if test="not($img=$coverImageOutside)">
-                  <xsl:variable name="ID">
-                    <xsl:number level="any"/>
-                  </xsl:variable>
-                  <xsl:variable name="mimetype">
-                    <xsl:choose>
-                      <xsl:when test="@mimeType != ''">
-                        <xsl:value-of select="@mimeType"/>
-                      </xsl:when>
-                      <xsl:when test="contains($img,'.gif')">image/gif</xsl:when>
-                      <xsl:when test="contains($img,'.png')">image/png</xsl:when>
-                      <xsl:when test="contains($img,'.mpeg')">video/mpeg4</xsl:when>
-                      <xsl:when test="contains($img,'.mp4')">video/mpeg4</xsl:when>
-                      <xsl:when test="contains($img,'.m4v')">video/mpeg4</xsl:when>
-                      <xsl:otherwise>image/jpeg</xsl:otherwise>
-                    </xsl:choose>
-                  </xsl:variable>
-                  <item href="{$img}" id="image-{$ID}" media-type="{$mimetype}"/>
-                </xsl:if>
-              </xsl:for-each>
-              <!-- page images -->
-              <xsl:for-each select="key('PBGRAPHICS',1)">
-                <xsl:variable name="img" select="@facs"/>
-                <xsl:variable name="ID">
-                  <xsl:number level="any"/>
-                </xsl:variable>
-                <xsl:variable name="mimetype">
-                  <xsl:choose>
-                    <xsl:when test="@mimeType != ''">
-                      <xsl:value-of select="@mimeType"/>
-                    </xsl:when>
-                    <xsl:when test="contains($img,'.gif')">image/gif</xsl:when>
-                    <xsl:when test="contains($img,'.png')">image/png</xsl:when>
-                    <xsl:otherwise>image/jpeg</xsl:otherwise>
-                  </xsl:choose>
-                </xsl:variable>
-                <item href="{$img}" id="pbimage-{$ID}" media-type="{$mimetype}"/>
-              </xsl:for-each>
-              <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
-              <xsl:call-template name="epubManifestHook"/>
-            </manifest>
-            <spine toc="ncx">
-              <itemref idref="titlepage" linear="yes"/>
-              <xsl:if test="$filePerPage='true'">
-                <itemref idref="titlepageverso" linear="yes"/>
-              </xsl:if>
-              <xsl:for-each select="tei:text/tei:front/tei:titlePage">
-                <xsl:variable name="N" select="position()"/>
-                <itemref idref="titlepage{$N}" linear="yes"/>
-              </xsl:for-each>
-              <itemref idref="start" linear="yes"/>
-              <xsl:choose>
-                <xsl:when test="$filePerPage='true'">
-                  <xsl:for-each select="key('PB',1)">
-                    <xsl:if test="@facs">
-                      <itemref>
-                        <xsl:attribute name="idref">
+												</item>
+											</xsl:for-each>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+							<!-- images -->
+							<xsl:for-each select="key('GRAPHICS',1)">
+								<xsl:variable name="img" select="@url|@facs" />
+								<xsl:if test="not($img=$coverImageOutside)">
+									<xsl:variable name="ID">
+										<xsl:number level="any" />
+									</xsl:variable>
+									<xsl:variable name="mimetype">
+										<xsl:choose>
+											<xsl:when test="@mimeType != ''">
+												<xsl:value-of select="@mimeType" />
+											</xsl:when>
+											<xsl:when test="contains($img,'.gif')">
+												image/gif
+											</xsl:when>
+											<xsl:when test="contains($img,'.png')">
+												image/png
+											</xsl:when>
+											<xsl:when test="contains($img,'.mpeg')">
+												video/mpeg4
+											</xsl:when>
+											<xsl:when test="contains($img,'.mp4')">
+												video/mpeg4
+											</xsl:when>
+											<xsl:when test="contains($img,'.m4v')">
+												video/mpeg4
+											</xsl:when>
+											<xsl:otherwise>
+												image/jpeg
+											</xsl:otherwise>
+										</xsl:choose>
+									</xsl:variable>
+									<item href="{$img}" id="image-{$ID}"
+										media-type="{$mimetype}" />
+								</xsl:if>
+							</xsl:for-each>
+							<!-- page images -->
+							<xsl:for-each select="key('PBGRAPHICS',1)">
+								<xsl:variable name="img" select="@facs" />
+								<xsl:variable name="ID">
+									<xsl:number level="any" />
+								</xsl:variable>
+								<xsl:variable name="mimetype">
+									<xsl:choose>
+										<xsl:when test="@mimeType != ''">
+											<xsl:value-of select="@mimeType" />
+										</xsl:when>
+										<xsl:when test="contains($img,'.gif')">
+											image/gif
+										</xsl:when>
+										<xsl:when test="contains($img,'.png')">
+											image/png
+										</xsl:when>
+										<xsl:otherwise>
+											image/jpeg
+										</xsl:otherwise>
+									</xsl:choose>
+								</xsl:variable>
+								<item href="{$img}" id="pbimage-{$ID}"
+									media-type="{$mimetype}" />
+							</xsl:for-each>
+							<item id="ncx" href="toc.ncx"
+								media-type="application/x-dtbncx+xml" />
+							<xsl:call-template name="epubManifestHook" />
+						</manifest>
+						<spine toc="ncx">
+							<itemref idref="titlepage" linear="yes" />
+							<xsl:if test="$filePerPage='true'">
+								<itemref idref="titlepageverso" linear="yes" />
+							</xsl:if>
+							<xsl:for-each
+								select="tei:text/tei:front/tei:titlePage">
+								<xsl:variable name="N" select="position()" />
+								<itemref idref="titlepage{$N}" linear="yes" />
+							</xsl:for-each>
+							<itemref idref="start" linear="yes" />
+							<xsl:choose>
+								<xsl:when test="$filePerPage='true'">
+									<xsl:for-each select="key('PB',1)">
+										<xsl:if test="@facs">
+											<itemref>
+												<xsl:attribute name="idref">
                           <xsl:text>pagefacs</xsl:text>
-                          <xsl:number level="any"/>
+                          <xsl:number level="any" />
                         </xsl:attribute>
-                        <xsl:attribute name="linear">yes</xsl:attribute>
-                      </itemref>
-                    </xsl:if>
-                    <itemref>
-                      <xsl:attribute name="idref">
+												<xsl:attribute name="linear">yes</xsl:attribute>
+											</itemref>
+										</xsl:if>
+										<itemref>
+											<xsl:attribute name="idref">
                         <xsl:text>page</xsl:text>
-                        <xsl:number level="any"/>
+                        <xsl:number level="any" />
                       </xsl:attribute>
-                      <xsl:attribute name="linear">yes</xsl:attribute>
-                    </itemref>
-                  </xsl:for-each>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
-                    <xsl:choose>
-                      <xsl:when test="not(html:a)"/>
-                      <xsl:when test="starts-with(html:a/@href,'#')"/>
-                      <xsl:otherwise>
-                        <itemref>
-                          <xsl:attribute name="idref">
+											<xsl:attribute name="linear">yes</xsl:attribute>
+										</itemref>
+									</xsl:for-each>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each
+										select="$TOC/html:TOC/html:ul/html:li">
+										<xsl:choose>
+											<xsl:when test="not(html:a)" />
+											<xsl:when test="starts-with(html:a/@href,'#')" />
+											<xsl:otherwise>
+												<itemref>
+													<xsl:attribute name="idref">
                             <xsl:text>section</xsl:text>
-                            <xsl:number count="html:li" level="any"/>
+                            <xsl:number count="html:li"
+														level="any" />
                           </xsl:attribute>
-                          <xsl:attribute name="linear">yes</xsl:attribute>
-                        </itemref>
-                      </xsl:otherwise>
-                    </xsl:choose>
-                    <xsl:if test="html:ul">
-                      <xsl:for-each select="html:ul//html:li[html:a and not(contains(html:a/@href,'#'))]">
-                        <itemref>
-                          <xsl:attribute name="idref">
+													<xsl:attribute name="linear">yes</xsl:attribute>
+												</itemref>
+											</xsl:otherwise>
+										</xsl:choose>
+										<xsl:if test="html:ul">
+											<xsl:for-each
+												select="html:ul//html:li[html:a and not(contains(html:a/@href,'#'))]">
+												<itemref>
+													<xsl:attribute name="idref">
                             <xsl:text>section</xsl:text>
-                            <xsl:number count="html:li" level="any"/>
+                            <xsl:number count="html:li"
+														level="any" />
                           </xsl:attribute>
-                          <xsl:attribute name="linear">yes</xsl:attribute>
-                        </itemref>
-                      </xsl:for-each>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:otherwise>
-              </xsl:choose>
-              <itemref idref="titlepageback">
-                <xsl:attribute name="linear">
+													<xsl:attribute name="linear">yes</xsl:attribute>
+												</itemref>
+											</xsl:for-each>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+							<itemref idref="titlepageback">
+								<xsl:attribute name="linear">
                   <xsl:choose>
                     <xsl:when test="$filePerPage='true'">yes</xsl:when>
                     <xsl:otherwise>no</xsl:otherwise>
                   </xsl:choose>
                 </xsl:attribute>
-              </itemref>
-              <xsl:call-template name="epubSpineHook"/>
-            </spine>
-            <guide>
-              <reference type="text" href="titlepage.xhtml" title="Cover"/>
-              <reference type="text" title="Start" href="index.xhtml"/>
-              <xsl:choose>
-                <xsl:when test="$filePerPage='true'">
-		</xsl:when>
-                <xsl:otherwise>
-                  <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
-                    <xsl:if test="html:a">
-                      <reference type="text" href="{html:a[1]/@href}">
-                        <xsl:attribute name="title">
-                          <xsl:value-of select="normalize-space(html:a[1])"/>
+							</itemref>
+							<xsl:call-template name="epubSpineHook" />
+						</spine>
+						<guide>
+							<reference type="text" href="titlepage.xhtml"
+								title="Cover" />
+							<reference type="text" title="Start" href="index.xhtml" />
+							<xsl:choose>
+								<xsl:when test="$filePerPage='true'">
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each
+										select="$TOC/html:TOC/html:ul/html:li">
+										<xsl:if test="html:a">
+											<reference type="text" href="{html:a[1]/@href}">
+												<xsl:attribute name="title">
+                          <xsl:value-of
+													select="normalize-space(html:a[1])" />
                         </xsl:attribute>
-                      </reference>
-                    </xsl:if>
-                    <xsl:if test="contains(parent::html:ul/@class,'group')">
-                      <xsl:for-each select="html:ul//html:li">
-                        <xsl:choose>
-                          <xsl:when test="not(html:a)"/>
-                          <xsl:when test="contains(html:a/@href,'#')"/>
-                          <xsl:otherwise>
-                            <reference type="text" href="{html:a/@href}">
-                              <xsl:attribute name="title">
-                                <xsl:value-of select="normalize-space(html:a[1])"/>
+											</reference>
+										</xsl:if>
+										<xsl:if test="contains(parent::html:ul/@class,'group')">
+											<xsl:for-each select="html:ul//html:li">
+												<xsl:choose>
+													<xsl:when test="not(html:a)" />
+													<xsl:when test="contains(html:a/@href,'#')" />
+													<xsl:otherwise>
+														<reference type="text" href="{html:a/@href}">
+															<xsl:attribute name="title">
+                                <xsl:value-of
+																select="normalize-space(html:a[1])" />
                               </xsl:attribute>
-                            </reference>
-                          </xsl:otherwise>
-                        </xsl:choose>
-                      </xsl:for-each>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:otherwise>
-              </xsl:choose>
-              <reference href="titlepageback.xhtml" type="text" title="About this book"/>
-            </guide>
-          </package>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/titlepage.xhtml</xsl:message>
-        </xsl:if>
-        <xsl:result-document href="{concat($directory,'/OPS/titlepage.xhtml')}" method="xml">
-          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-            <head>
-              <xsl:call-template name="metaHTML">
-                <xsl:with-param name="title">Title page</xsl:with-param>
-              </xsl:call-template>
-              <meta name="calibre:cover" content="true"/>
-              <title>Title page</title>
-              <style type="text/css" title="override_css">
-		@page {padding: 0pt; margin:0pt}
-		body { text-align: center; padding:0pt; margin: 0pt; }
-	      </style>
-            </head>
-            <body>
-              <xsl:choose>
-                <xsl:when test="$coverImageInside=''">
-                  <div>
-                    <xsl:attribute name="style">
+														</reference>
+													</xsl:otherwise>
+												</xsl:choose>
+											</xsl:for-each>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+							<reference href="titlepageback.xhtml" type="text"
+								title="About this book" />
+						</guide>
+					</package>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/titlepage.xhtml
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/titlepage.xhtml')}" method="xml">
+					<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+						<head>
+							<xsl:call-template name="metaHTML">
+								<xsl:with-param name="title">
+									Title page
+								</xsl:with-param>
+							</xsl:call-template>
+							<meta name="calibre:cover" content="true" />
+							<title>Title page</title>
+							<style type="text/css" title="override_css">
+								@page {padding: 0pt; margin:0pt}
+								body { text-align: center; padding:0pt; margin: 0pt; }
+							</style>
+						</head>
+						<body>
+							<xsl:choose>
+								<xsl:when test="$coverImageInside=''">
+									<div>
+										<xsl:attribute name="style">
 		      font-family: serif; 
 		      height:860;          
 		      font-size:30pt; 
@@ -587,299 +773,350 @@
 		      border: solid red 1pt; 
 		      text-align:center;
 		    </xsl:attribute>
-                    <xsl:call-template name="generateTitle"/>
-                  </div>
-                </xsl:when>
-                <xsl:otherwise>
-                  <div>
-                    <img width="1200" height="1700" alt="cover picture" src="{$coverImageInside}"/>
-                  </div>
-                </xsl:otherwise>
-              </xsl:choose>
-            </body>
-          </html>
-        </xsl:result-document>
-        <xsl:for-each select="tei:text/tei:front/tei:titlePage">
-          <xsl:variable name="N" select="position()"/>
-          <xsl:if test="$verbose='true'">
-            <xsl:message>write file OPS/titlepage<xsl:value-of select="$N"/>.xhtml</xsl:message>
-          </xsl:if>
-          <xsl:result-document href="{concat($directory,'/OPS/titlepage',$N,'.xhtml')}" method="xml">
-            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-              <head>
-                <xsl:call-template name="metaHTML">
-                  <xsl:with-param name="title">Title page</xsl:with-param>
-                </xsl:call-template>
-                <xsl:call-template name="linkCSS">
-		  <xsl:with-param
-		      name="file">stylesheet.css</xsl:with-param>
-		</xsl:call-template>
-                <title>Title page</title>
-              </head>
-              <body>
-                <div class="titlePage">
-                  <xsl:apply-templates/>
-                </div>
-              </body>
-            </html>
-          </xsl:result-document>
-        </xsl:for-each>
-        <xsl:if test="$filePerPage='true'">
-          <xsl:if test="$verbose='true'">
-            <xsl:message>write file OPS/titlepageverso.xhtml</xsl:message>
-          </xsl:if>
-          <xsl:result-document href="{concat($directory,'/OPS/titlepageverso.xhtml')}" method="xml">
-            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-              <head>
-                <xsl:call-template name="metaHTML">
-                  <xsl:with-param name="title">title page verso</xsl:with-param>
-                </xsl:call-template>
-                <title>title page verso</title>
-              </head>
-              <body>
-                <p/>
-              </body>
-            </html>
-          </xsl:result-document>
-        </xsl:if>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/titlepageback.xhtml</xsl:message>
-        </xsl:if>
-        <xsl:result-document href="{concat($directory,'/OPS/titlepageback.xhtml')}" method="xml">
-          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-            <head>
-              <xsl:call-template name="metaHTML">
-                <xsl:with-param name="title">About this book</xsl:with-param>
-              </xsl:call-template>
-              <title>About this book</title>
-            </head>
-            <body>
-              <div style="text-align: left; font-size: larger">
-                <h2>Information about this book</h2>
-                <xsl:for-each select="/*/tei:teiHeader/tei:fileDesc">
-                  <xsl:apply-templates mode="metadata"/>
-                </xsl:for-each>
-                <xsl:for-each select="/*/tei:teiHeader/tei:encodingDesc">
-                  <xsl:apply-templates mode="metadata"/>
-                </xsl:for-each>
-              </div>
-            </body>
-          </html>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/toc.ncx</xsl:message>
-        </xsl:if>
-        <xsl:result-document href="{concat($directory,'/OPS/toc.ncx')}" method="xml">
-          <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
-            <head>
-              <meta name="dtb:uid">
-                <xsl:attribute name="content">
-                  <xsl:call-template name="generateID"/>
+										<xsl:call-template name="generateTitle" />
+									</div>
+								</xsl:when>
+								<xsl:otherwise>
+									<div>
+										<img width="1200" height="1700" alt="cover picture"
+											src="{$coverImageInside}" />
+									</div>
+								</xsl:otherwise>
+							</xsl:choose>
+						</body>
+					</html>
+				</xsl:result-document>
+				<xsl:for-each select="tei:text/tei:front/tei:titlePage">
+					<xsl:variable name="N" select="position()" />
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							write file OPS/titlepage
+							<xsl:value-of select="$N" />
+							.xhtml
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document
+						href="{concat($directory,'/OPS/titlepage',$N,'.xhtml')}"
+						method="xml">
+						<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+							<head>
+								<xsl:call-template name="metaHTML">
+									<xsl:with-param name="title">
+										Title page
+									</xsl:with-param>
+								</xsl:call-template>
+								<xsl:call-template name="linkCSS">
+									<xsl:with-param name="file">
+										stylesheet.css
+									</xsl:with-param>
+								</xsl:call-template>
+								<title>Title page</title>
+							</head>
+							<body>
+								<div class="titlePage">
+									<xsl:apply-templates />
+								</div>
+							</body>
+						</html>
+					</xsl:result-document>
+				</xsl:for-each>
+				<xsl:if test="$filePerPage='true'">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							write file OPS/titlepageverso.xhtml
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document
+						href="{concat($directory,'/OPS/titlepageverso.xhtml')}"
+						method="xml">
+						<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+							<head>
+								<xsl:call-template name="metaHTML">
+									<xsl:with-param name="title">
+										title page verso
+									</xsl:with-param>
+								</xsl:call-template>
+								<title>title page verso</title>
+							</head>
+							<body>
+								<p />
+							</body>
+						</html>
+					</xsl:result-document>
+				</xsl:if>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/titlepageback.xhtml
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/titlepageback.xhtml')}" method="xml">
+					<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+						<head>
+							<xsl:call-template name="metaHTML">
+								<xsl:with-param name="title">
+									About this book
+								</xsl:with-param>
+							</xsl:call-template>
+							<title>About this book</title>
+						</head>
+						<body>
+							<div style="text-align: left; font-size: larger">
+								<h2>Information about this book</h2>
+								<xsl:for-each
+									select="/*/tei:teiHeader/tei:fileDesc">
+									<xsl:apply-templates mode="metadata" />
+								</xsl:for-each>
+								<xsl:for-each
+									select="/*/tei:teiHeader/tei:encodingDesc">
+									<xsl:apply-templates mode="metadata" />
+								</xsl:for-each>
+							</div>
+						</body>
+					</html>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/toc.ncx
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/toc.ncx')}" method="xml">
+					<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/"
+						version="2005-1">
+						<head>
+							<meta name="dtb:uid">
+								<xsl:attribute name="content">
+                  <xsl:call-template
+									name="generateID" />
                 </xsl:attribute>
-              </meta>
-              <meta name="dtb:totalPageCount" content="0"/>
-              <meta name="dtb:maxPageNumber" content="0"/>
-            </head>
-            <docTitle>
-              <text>
-                <xsl:call-template name="generateSimpleTitle"/>
-              </text>
-            </docTitle>
-            <navMap>
-              <xsl:variable name="navPoints">
-                <navPoint>
-                  <navLabel>
-                    <text>[Cover]</text>
-                  </navLabel>
-                  <content src="titlepage.xhtml"/>
-                </navPoint>
-                <xsl:for-each select="tei:text/tei:front/tei:titlePage[1]">
-                  <xsl:variable name="N" select="position()"/>
-                  <navPoint>
-                    <navLabel>
-                      <text>[Title page]</text>
-                    </navLabel>
-                    <content src="titlepage{$N}.xhtml"/>
-                  </navPoint>
-                </xsl:for-each>
-                <xsl:choose>
-                  <xsl:when test="not($TOC/html:TOC/html:ul[@class='toc toc_body']/html:li)">
-                    <xsl:for-each select="$TOC/html:TOC/html:ul[@class='toc toc_front']">
-                      <xsl:apply-templates select="html:li"/>
-                    </xsl:for-each>
-                    <navPoint>
-                      <navLabel>
-                        <text>[The book]</text>
-                      </navLabel>
-                      <content src="index.xhtml"/>
-                    </navPoint>
-                    <xsl:for-each select="$TOC/html:TOC/html:ul[contains(@class,'group')]">
-                      <xsl:apply-templates select=".//html:li[not(contains(html:a/@href,'#'))]"/>
-                    </xsl:for-each>
-                    <xsl:for-each select="$TOC/html:TOC/html:ul[@class='toc toc_back']">
-                      <xsl:apply-templates select="html:li"/>
-                    </xsl:for-each>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:for-each select="$TOC/html:TOC/html:ul">
-                      <xsl:apply-templates select="html:li"/>
-                    </xsl:for-each>
-                  </xsl:otherwise>
-                </xsl:choose>
-                <navPoint>
-                  <navLabel>
-                    <text>[About this book]</text>
-                  </navLabel>
-                  <content src="titlepageback.xhtml"/>
-                </navPoint>
-              </xsl:variable>
-              <xsl:for-each select="$navPoints/ncx:navPoint">
-                <xsl:variable name="pos" select="position()"/>
-                <navPoint id="navPoint-{$pos}" playOrder="{$pos}">
-                  <xsl:copy-of select="*"/>
-                </navPoint>
-              </xsl:for-each>
-            </navMap>
-          </ncx>
-        </xsl:result-document>
-        <xsl:if test="$filePerPage='true'">
-          <xsl:if test="$verbose='true'">
-            <xsl:message>write file META-INF/com.apple.ibooks.display-options.xml</xsl:message>
-          </xsl:if>
-          <xsl:result-document href="{concat($directory,'/META-INF/com.apple.ibooks.display-options.xml')}">
-            <display_options xmlns="">
-              <platform name="*">
-                <option name="fixed-layout">true</option>
-              </platform>
-            </display_options>
-          </xsl:result-document>
-        </xsl:if>
-        <xsl:if test="$debug='true'">
-          <xsl:message>write file OPS/toc.html</xsl:message>
-        </xsl:if>
-        <xsl:result-document href="{concat($directory,'/OPS/toc.xhtml')}" method="xml" doctype-system="">
-          <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
-            <head>
-              <title>
-                <xsl:call-template name="generateSimpleTitle"/>
-              </title>
-                <xsl:call-template name="linkCSS">
-		  <xsl:with-param
-		      name="file">stylesheet.css</xsl:with-param>
-		</xsl:call-template>
-            </head>
-            <body>
-              <section class="TableOfContents">
-                <header>
-                  <h1>Contents</h1>
-                </header>
-                <nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="toc" id="toc">
-                  <ol>
-                    <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
-                      <xsl:choose>
-                        <xsl:when test="not(html:a)"/>
-                        <xsl:when test="starts-with(html:a/@href,'#')"/>
-                        <xsl:when test="contains(@class,'headless')"/>
-                        <xsl:otherwise>
-                          <li>
-                            <a href="{html:a/@href}">
-                              <xsl:value-of select="html:span[@class='headingNumber']"/>
-                              <xsl:value-of select="normalize-space(html:a[1])"/>
-                            </a>
-                          </li>
-                        </xsl:otherwise>
-                      </xsl:choose>
-                    </xsl:for-each>
-                    <li>
-                      <a href="titlepageback.xhtml">[About this book]</a>
-                    </li>
-                  </ol>
-                </nav>
-                <nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="landmarks" id="guide">
-                  <h2>Guide</h2>
-                  <ol>
-                    <li>
-                      <a epub:type="titlepage" href="titlepage.xhtml">[Title page]</a>
-                    </li>
-                    <li>
-                      <a epub:type="bodymatter" href="index.xhtml">[The book]</a>
-                    </li>
-                    <li>
-                      <a epub:type="colophon" href="titlepageback.xhtml">[About this book]</a>
-                    </li>
-                  </ol>
-                </nav>
-              </section>
-            </body>
-          </html>
-        </xsl:result-document>
+							</meta>
+							<meta name="dtb:totalPageCount" content="0" />
+							<meta name="dtb:maxPageNumber" content="0" />
+						</head>
+						<docTitle>
+							<text>
+								<xsl:call-template name="generateSimpleTitle" />
+							</text>
+						</docTitle>
+						<navMap>
+							<xsl:variable name="navPoints">
+								<navPoint>
+									<navLabel>
+										<text>[Cover]</text>
+									</navLabel>
+									<content src="titlepage.xhtml" />
+								</navPoint>
+								<xsl:for-each
+									select="tei:text/tei:front/tei:titlePage[1]">
+									<xsl:variable name="N" select="position()" />
+									<navPoint>
+										<navLabel>
+											<text>[Title page]</text>
+										</navLabel>
+										<content src="titlepage{$N}.xhtml" />
+									</navPoint>
+								</xsl:for-each>
+								<xsl:choose>
+									<xsl:when
+										test="not($TOC/html:TOC/html:ul[@class='toc toc_body']/html:li)">
+										<xsl:for-each
+											select="$TOC/html:TOC/html:ul[@class='toc toc_front']">
+											<xsl:apply-templates select="html:li" />
+										</xsl:for-each>
+										<navPoint>
+											<navLabel>
+												<text>[The book]</text>
+											</navLabel>
+											<content src="index.xhtml" />
+										</navPoint>
+										<xsl:for-each
+											select="$TOC/html:TOC/html:ul[contains(@class,'group')]">
+											<xsl:apply-templates
+												select=".//html:li[not(contains(html:a/@href,'#'))]" />
+										</xsl:for-each>
+										<xsl:for-each
+											select="$TOC/html:TOC/html:ul[@class='toc toc_back']">
+											<xsl:apply-templates select="html:li" />
+										</xsl:for-each>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:for-each select="$TOC/html:TOC/html:ul">
+											<xsl:apply-templates select="html:li" />
+										</xsl:for-each>
+									</xsl:otherwise>
+								</xsl:choose>
+								<navPoint>
+									<navLabel>
+										<text>[About this book]</text>
+									</navLabel>
+									<content src="titlepageback.xhtml" />
+								</navPoint>
+							</xsl:variable>
+							<xsl:for-each select="$navPoints/ncx:navPoint">
+								<xsl:variable name="pos" select="position()" />
+								<navPoint id="navPoint-{$pos}" playOrder="{$pos}">
+									<xsl:copy-of select="*" />
+								</navPoint>
+							</xsl:for-each>
+						</navMap>
+					</ncx>
+				</xsl:result-document>
+				<xsl:if test="$filePerPage='true'">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							write file META-INF/com.apple.ibooks.display-options.xml
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document
+						href="{concat($directory,'/META-INF/com.apple.ibooks.display-options.xml')}">
+						<display_options xmlns="">
+							<platform name="*">
+								<option name="fixed-layout">true</option>
+							</platform>
+						</display_options>
+					</xsl:result-document>
+				</xsl:if>
+				<xsl:if test="$debug='true'">
+					<xsl:message>
+						write file OPS/toc.html
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/toc.xhtml')}" method="xml"
+					doctype-system="">
+					<html xmlns="http://www.w3.org/1999/xhtml"
+						xmlns:epub="http://www.idpf.org/2007/ops">
+						<head>
+							<title>
+								<xsl:call-template name="generateSimpleTitle" />
+							</title>
+							<xsl:call-template name="linkCSS">
+								<xsl:with-param name="file">
+									stylesheet.css
+								</xsl:with-param>
+							</xsl:call-template>
+						</head>
+						<body>
+							<section class="TableOfContents">
+								<header>
+									<h1>Contents</h1>
+								</header>
+								<nav xmlns:epub="http://www.idpf.org/2007/ops"
+									epub:type="toc" id="toc">
+									<ol>
+										<xsl:for-each
+											select="$TOC/html:TOC/html:ul/html:li">
+											<xsl:choose>
+												<xsl:when test="not(html:a)" />
+												<xsl:when test="starts-with(html:a/@href,'#')" />
+												<xsl:when test="contains(@class,'headless')" />
+												<xsl:otherwise>
+													<li>
+														<a href="{html:a/@href}">
+															<xsl:value-of
+																select="html:span[@class='headingNumber']" />
+															<xsl:value-of
+																select="normalize-space(html:a[1])" />
+														</a>
+													</li>
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:for-each>
+										<li>
+											<a href="titlepageback.xhtml">[About this book]</a>
+										</li>
+									</ol>
+								</nav>
+								<nav xmlns:epub="http://www.idpf.org/2007/ops"
+									epub:type="landmarks" id="guide">
+									<h2>Guide</h2>
+									<ol>
+										<li>
+											<a epub:type="titlepage" href="titlepage.xhtml">[Title page]</a>
+										</li>
+										<li>
+											<a epub:type="bodymatter" href="index.xhtml">[The book]</a>
+										</li>
+										<li>
+											<a epub:type="colophon" href="titlepageback.xhtml">[About this book]</a>
+										</li>
+									</ol>
+								</nav>
+							</section>
+						</body>
+					</html>
+				</xsl:result-document>
 
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="opfmetadata">
-    <xsl:param name="author"/>
-    <xsl:param name="printAuthor"/>
-    <xsl:param name="coverImageOutside"/>
-    <metadata xmlns="http://www.idpf.org/2007/opf"
-	      xmlns:dc="http://purl.org/dc/elements/1.1/"
-	      xmlns:dcterms="http://purl.org/dc/terms/" 
-	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	      xmlns:opf="http://www.idpf.org/2007/opf">
-      <dc:title id="title">
-	<xsl:call-template name="generateSimpleTitle"/>
-      </dc:title>
-      <meta refines="#title" property="title-type">main</meta>
-      <dc:creator id="creator">
-	<xsl:value-of select="$printAuthor"/>
-      </dc:creator>
-      <meta refines="#creator" property="file-as">
-	<xsl:value-of select="$author"/>
-      </meta>
-      <meta refines="#creator" property="role" scheme="marc:relators">aut</meta>
-      <dc:language>
-	<xsl:call-template name="generateLanguage"/>
-      </dc:language>
-      <xsl:call-template name="generateSubject"/>
-      <dc:identifier id="pub-id">
-	<xsl:call-template name="generateID"/>
-      </dc:identifier>
-      <meta refines="#pub-id" property="identifier-type" scheme="onix:codelist5">15</meta>
-      <dc:description>
-	<xsl:call-template name="generateSimpleTitle"/>
-	<xsl:text> / </xsl:text>
-	<xsl:value-of select="$author"/>
-      </dc:description>
-      <dc:publisher>
-	<xsl:call-template name="generatePublisher"/>
-      </dc:publisher>
-      <xsl:for-each select="tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@notAfter]">
-	<dc:date id="creation">
-	  <xsl:value-of select="@notAfter"/>
-	</dc:date>
-      </xsl:for-each>
-      <xsl:for-each select="tei:teiHeader/tei:fileDesc/tei:sourceDesc//tei:date[@when][1]">
-	<dc:date id="original-publication">
-	  <xsl:value-of select="@when"/>
-	</dc:date>
-      </xsl:for-each>
-      <dc:date id="epub-publication">
-	<xsl:call-template name="generateDate"/>
-      </dc:date>
-      <dc:rights>
-	<xsl:call-template name="generateLicence"/>
-      </dc:rights>
-      <xsl:if test="not($coverImageOutside='')">
-	<meta name="cover" content="cover-image"/>
-      </xsl:if>
-      <meta property="dcterms:modified">
-	<xsl:call-template name="generateRevDate"/>
-      </meta>
-    </metadata>
-  </xsl:template>
+	<xsl:template name="opfmetadata">
+		<xsl:param name="author" />
+		<xsl:param name="printAuthor" />
+		<xsl:param name="coverImageOutside" />
+		<metadata xmlns="http://www.idpf.org/2007/opf"
+			xmlns:dc="http://purl.org/dc/elements/1.1/"
+			xmlns:dcterms="http://purl.org/dc/terms/"
+			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+			xmlns:opf="http://www.idpf.org/2007/opf">
+			<dc:title id="title">
+				<xsl:call-template name="generateSimpleTitle" />
+			</dc:title>
+			<meta refines="#title" property="title-type">main</meta>
+			<dc:creator id="creator">
+				<xsl:value-of select="$printAuthor" />
+			</dc:creator>
+			<meta refines="#creator" property="file-as">
+				<xsl:value-of select="$author" />
+			</meta>
+			<meta refines="#creator" property="role" scheme="marc:relators">aut</meta>
+			<dc:language>
+				<xsl:call-template name="generateLanguage" />
+			</dc:language>
+			<xsl:call-template name="generateSubject" />
+			<dc:identifier id="pub-id">
+				<xsl:call-template name="generateID" />
+			</dc:identifier>
+			<meta refines="#pub-id" property="identifier-type"
+				scheme="onix:codelist5">15</meta>
+			<dc:description>
+				<xsl:call-template name="generateSimpleTitle" />
+				<xsl:text> / </xsl:text>
+				<xsl:value-of select="$author" />
+			</dc:description>
+			<dc:publisher>
+				<xsl:call-template name="generatePublisher" />
+			</dc:publisher>
+			<xsl:for-each
+				select="tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@notAfter]">
+				<dc:date id="creation">
+					<xsl:value-of select="@notAfter" />
+				</dc:date>
+			</xsl:for-each>
+			<xsl:for-each
+				select="tei:teiHeader/tei:fileDesc/tei:sourceDesc//tei:date[@when][1]">
+				<dc:date id="original-publication">
+					<xsl:value-of select="@when" />
+				</dc:date>
+			</xsl:for-each>
+			<dc:date id="epub-publication">
+				<xsl:call-template name="generateDate" />
+			</dc:date>
+			<dc:rights>
+				<xsl:call-template name="generateLicence" />
+			</dc:rights>
+			<xsl:if test="not($coverImageOutside='')">
+				<meta name="cover" content="cover-image" />
+			</xsl:if>
+			<meta property="dcterms:modified">
+				<xsl:call-template name="generateRevDate" />
+			</meta>
+		</metadata>
+	</xsl:template>
 
-  <xsl:template name="epubSpineHook"/>
-  <xsl:template name="epubManifestHook"/>
-  <xsl:template name="processTEIHook"/>
+	<xsl:template name="epubSpineHook" />
+	<xsl:template name="epubManifestHook" />
+	<xsl:template name="processTEIHook" />
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub3/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub3/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub3/build-to.xml	(revision 2397)
@@ -1,120 +1,131 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitoepub3">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 10057 2012-01-21 16:57:14Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into ePUB files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output ePUB file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="stylesheetFile"
-	    value="../profiles/${profile}/epub3/to.xsl"/>
-  <property name="listgraphics" value="../tools/makegraphicsanttask.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <import file="../odds2/build-to.xml"/>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
-  <target name="dist" depends="setup,odd,notodd,convert,cleanup"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 10057 2012-01-21 16:57:14Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into ePUB files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output ePUB file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="stylesheetFile"
+		value="../profiles/${profile}/epub3/to.xsl" />
+	<property name="listgraphics"
+		value="../tools/makegraphicsanttask.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<import file="../odds2/build-to.xml" />
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
+	<target name="dist" depends="setup,odd,notodd,convert,cleanup" />
 
-  <target name="convert">
-    <!-- Recreate temporary output directory -->
-    <!-- The transformation for EPUB output. -->
-    <echo level="info">XSLT generate epub3 files</echo>
-    <xslt force="yes" style="${stylesheetFile}" in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/OPS/index.xhtml" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <param name="inputDir" expression="${inputFileDir}/"/>
-      <param name="fixgraphicsurl" expression="true"/>
-      <!-- supply unique URN for ebook-->
-      <param name="uid" expression="${uid}" if="uid"/>
-      <!-- set splitting level-->
-      <param name="splitLevel" expression="${splitLevel}" if="splitLevel"/>
-      <!-- supply name of publisher for ebook-->
-      <param name="publisher" expression="${publisher}" if="publisher"/>
-      <!-- supply subject/category for ebook-->
-      <param name="subject" expression="${subject}" if="subject"/>
-      <!-- supply name of JPEG file for ebook cover-->
-      <param name="coverimage" expression="${coverimage}" if="coverimage"/>
-      <!-- supply name of CSS file-->
-      <param name="cssFile" expression="${cssFile}" if="cssFile"/>
-      <!-- name of media overlay file -->
-      <param name="mediaoverlay" expression="${mediaoverlay}" if="mediaoverlay"/>
-      <!-- file per page -->
-      <param name="filePerPage" expression="${filePerPage}" if="filePerPage"/>
-      <!-- epub viewport -->
-      <param name="viewPortHeight" expression="${viewPortHeight}" if="viewPortHeight"/>
-      <param name="viewPortWidth" expression="${viewPortWidth}" if="viewPortWidth"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-      <!-- disable compression on the output ZIP -->
-      <param name="nocompress" expression="${nocompress}" if="nocompress"/>
-    </xslt>
-    <echo level="info">Get names of graphics files and write an ant task</echo>
-    <xslt force="yes" style="${listgraphics}" classpath="classpath" in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/copy.xml">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="inputDir" expression="${inputFileDir}"/>
-      <param name="mediaDir" expression="OPS/media"/>
-      <param name="mediaoverlay" expression="${mediaoverlay}" if="mediaoverlay"/>
-      <param name="filePerPage" expression="${filePerPage}" if="filePerPage"/>
-    </xslt>
-    <echo level="info">Copy image files</echo>
-    <ant antfile="${outputTempDir}/copy.xml"/>
-    <echo level="info">ZIP: put files from ${outputTempDir} together into ${outputFile}</echo>
-    <delete file="${outputFile}"/>
-    <zip destfile="${outputFile}" basedir="${outputTempDir}"
-	 compress="true" excludes="mimetype,tmp1.xml,tmp2.xml,copy.xml"/>
-    <zip destfile="${outputFile}" basedir="${outputTempDir}" includes="mimetype" update="true" keepcompression="true" compress="false"/>
-  </target>
+	<target name="convert">
+		<!-- Recreate temporary output directory -->
+		<!-- The transformation for EPUB output. -->
+		<echo level="info">XSLT generate epub3 files</echo>
+		<xslt force="yes" style="${stylesheetFile}"
+			in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/OPS/index.xhtml"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<param name="inputDir" expression="${inputFileDir}/" />
+			<param name="fixgraphicsurl" expression="true" />
+			<!-- supply unique URN for ebook -->
+			<param name="uid" expression="${uid}" if="uid" />
+			<!-- set splitting level -->
+			<param name="splitLevel" expression="${splitLevel}"
+				if="splitLevel" />
+			<!-- supply name of publisher for ebook -->
+			<param name="publisher" expression="${publisher}"
+				if="publisher" />
+			<!-- supply subject/category for ebook -->
+			<param name="subject" expression="${subject}" if="subject" />
+			<!-- supply name of JPEG file for ebook cover -->
+			<param name="coverimage" expression="${coverimage}"
+				if="coverimage" />
+			<!-- supply name of CSS file -->
+			<param name="cssFile" expression="${cssFile}" if="cssFile" />
+			<!-- name of media overlay file -->
+			<param name="mediaoverlay" expression="${mediaoverlay}"
+				if="mediaoverlay" />
+			<!-- file per page -->
+			<param name="filePerPage" expression="${filePerPage}"
+				if="filePerPage" />
+			<!-- epub viewport -->
+			<param name="viewPortHeight" expression="${viewPortHeight}"
+				if="viewPortHeight" />
+			<param name="viewPortWidth" expression="${viewPortWidth}"
+				if="viewPortWidth" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+			<!-- disable compression on the output ZIP -->
+			<param name="nocompress" expression="${nocompress}"
+				if="nocompress" />
+		</xslt>
+		<echo level="info">Get names of graphics files and write an ant task</echo>
+		<xslt force="yes" style="${listgraphics}" classpath="classpath"
+			in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/copy.xml">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="inputDir" expression="${inputFileDir}" />
+			<param name="mediaDir" expression="OPS/media" />
+			<param name="mediaoverlay" expression="${mediaoverlay}"
+				if="mediaoverlay" />
+			<param name="filePerPage" expression="${filePerPage}"
+				if="filePerPage" />
+		</xslt>
+		<echo level="info">Copy image files</echo>
+		<ant antfile="${outputTempDir}/copy.xml" />
+		<echo level="info">ZIP: put files from ${outputTempDir} together into
+			${outputFile}</echo>
+		<delete file="${outputFile}" />
+		<zip destfile="${outputFile}" basedir="${outputTempDir}"
+			compress="true" excludes="mimetype,tmp1.xml,tmp2.xml,copy.xml" />
+		<zip destfile="${outputFile}" basedir="${outputTempDir}"
+			includes="mimetype" update="true" keepcompression="true"
+			compress="false" />
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/build-to.xml	(revision 2397)
@@ -1,79 +1,77 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitohtml">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9875 2011-12-04 18:27:43Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into HTML files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output ePUB file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="stylesheetFile"  value="../profiles/${profile}/html/to.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <import file="../odds2/build-to.xml"/>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
- 
-  <target name="transform">
-    <echo level="info">XSLT generate HTML files</echo>
-    <xslt force="yes" style="${stylesheetFile}" in="${outputTempDir}/tmp2.xml" out="${outputFile}" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <param name="inputDir" expression="${inputFileDir}/"/>
-      <param name="cssFile" expression="${cssFile}" if="cssFile"/>
-      <!-- name of media overlay file -->
-      <param name="mediaoverlay" expression="${mediaoverlay}" if="mediaoverlay"/>
-      <!-- file per page -->
-      <param name="filePerPage" expression="${filePerPage}" if="filePerPage"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9875 2011-12-04 18:27:43Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into HTML files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output ePUB file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="stylesheetFile"
+		value="../profiles/${profile}/html/to.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<import file="../odds2/build-to.xml" />
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
 
- <target name="dist" depends="setup,odd,notodd,transform,cleanup"/>
+	<target name="transform">
+		<echo level="info">XSLT generate HTML files</echo>
+		<xslt force="yes" style="${stylesheetFile}"
+			in="${outputTempDir}/tmp2.xml" out="${outputFile}"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<param name="inputDir" expression="${inputFileDir}/" />
+			<param name="cssFile" expression="${cssFile}" if="cssFile" />
+			<!-- name of media overlay file -->
+			<param name="mediaoverlay" expression="${mediaoverlay}"
+				if="mediaoverlay" />
+			<!-- file per page -->
+			<param name="filePerPage" expression="${filePerPage}"
+				if="filePerPage" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="dist" depends="setup,odd,notodd,transform,cleanup" />
 
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
+
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/corpus.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/corpus.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/corpus.xsl	(revision 2397)
@@ -1,180 +1,199 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:html="http://www.w3.org/1999/xhtml"
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
 
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fo rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the corpus module,
-      making HTML output. </p>
-         <p>This software is dual-licensed:
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the corpus module,
+				making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: corpus.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element catRef</desc>
-   </doc>
-  <xsl:template match="tei:catRef">
-      <xsl:variable name="W">
-         <xsl:choose>
-            <xsl:when test="starts-with(@target,'#')">
-               <xsl:value-of select="substring(@target,2)"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="@target"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:if test="preceding-sibling::tei:catRef">
-         <xsl:text> 
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: corpus.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element catRef</desc>
+	</doc>
+	<xsl:template match="tei:catRef">
+		<xsl:variable name="W">
+			<xsl:choose>
+				<xsl:when test="starts-with(@target,'#')">
+					<xsl:value-of select="substring(@target,2)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@target" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:if test="preceding-sibling::tei:catRef">
+			<xsl:text> 
     </xsl:text>
-      </xsl:if>
-      <em>
-         <xsl:value-of select="@scheme"/>
-      </em>: <xsl:apply-templates select="id($W)/catDesc"/>
-   </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element teiCorpus</desc>
-   </doc>
-  <xsl:template match="tei:teiCorpus">
-      <xsl:element name="html" namespace="{$outputNamespace}">
-         <xsl:call-template name="addLangAtt"/>
-         <head>
-            <title>
-               <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title/text()"/>
-            </title>
-            <xsl:call-template name="includeCSS"/>
-            <xsl:call-template name="cssHook"/>
-         </head>
-         <body class="simple">
-	   <xsl:call-template name="bodyMicroData"/>
-	   <xsl:call-template name="bodyHook"/>
-	   <xsl:call-template name="bodyJavascriptHook"/>
-	   <div class="stdheader">
-	     <xsl:call-template name="stdheader">
-		<xsl:with-param name="title">
-		  <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title"/>
-		</xsl:with-param>
-	     </xsl:call-template>
-	    </div>
-	    <xsl:call-template name="corpusBody"/>
-            <xsl:call-template name="stdfooter"/>
-            <xsl:call-template name="bodyEndHook"/>
-         </body>
-      </xsl:element>
-  </xsl:template>
-  <xsl:template match="tei:teiCorpus" mode="split">
-      <xsl:variable name="BaseFile">
-         <xsl:value-of select="$masterFile"/>
-         <xsl:call-template name="addCorpusID"/>
-      </xsl:variable>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>TEI HTML: run start hook template teiStartHook</xsl:message>
-      </xsl:if>
-      <xsl:call-template name="teiStartHook"/>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>TEI HTML in corpus splitting mode, base file is <xsl:value-of select="$BaseFile"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:variable name="outName">
-         <xsl:call-template name="outputChunkName">
-	           <xsl:with-param name="ident">
-	              <xsl:value-of select="$BaseFile"/>
-	           </xsl:with-param>
-         </xsl:call-template>
-      </xsl:variable>
-    
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Opening file <xsl:value-of select="$outName"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:result-document doctype-public="{$doctypePublic}" 
-			   doctype-system="{$doctypeSystem}"
-                           encoding="{$outputEncoding}"
-                           href="{$outName}"
-                           method="{$outputMethod}">
-      
-         <xsl:element name="html" namespace="{$outputNamespace}">
-	   <xsl:call-template name="addLangAtt"/>
-	   <head>
-	     <title>
-	       <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title/text()"/>
-	     </title>
-	     <xsl:call-template name="includeCSS"/>
-	     <xsl:call-template name="cssHook"/>
-	   </head>
-	   <body class="simple">
-	     <xsl:call-template name="bodyMicroData"/>
-	     <xsl:call-template name="bodyJavascriptHook"/>
-	     <xsl:call-template name="bodyHook"/>
-	     <div class="stdheader">
-	       <xsl:call-template name="stdheader">
-		 <xsl:with-param name="title">
-		   <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]"/>
-		 </xsl:with-param>
-	       </xsl:call-template>
-	     </div>
-	     <xsl:call-template name="corpusBody"/>
-	     <xsl:call-template name="stdfooter"/>
-	     <xsl:call-template name="bodyEndHook"/>
-	   </body>
-         </xsl:element>
-      </xsl:result-document>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Closing file <xsl:value-of select="$outName"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>TEI HTML: run end hook template teiEndHook</xsl:message>
-      </xsl:if>
-      <xsl:call-template name="teiEndHook"/>
-      <xsl:apply-templates select="tei:TEI" mode="split"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="corpusBody">
-    <xsl:call-template name="mainTOC"/>
-  </xsl:template>
+		</xsl:if>
+		<em>
+			<xsl:value-of select="@scheme" />
+		</em>
+		:
+		<xsl:apply-templates select="id($W)/catDesc" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element teiCorpus</desc>
+	</doc>
+	<xsl:template match="tei:teiCorpus">
+		<xsl:element name="html" namespace="{$outputNamespace}">
+			<xsl:call-template name="addLangAtt" />
+			<head>
+				<title>
+					<xsl:apply-templates
+						select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title/text()" />
+				</title>
+				<xsl:call-template name="includeCSS" />
+				<xsl:call-template name="cssHook" />
+			</head>
+			<body class="simple">
+				<xsl:call-template name="bodyMicroData" />
+				<xsl:call-template name="bodyHook" />
+				<xsl:call-template name="bodyJavascriptHook" />
+				<div class="stdheader">
+					<xsl:call-template name="stdheader">
+						<xsl:with-param name="title">
+							<xsl:apply-templates
+								select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</div>
+				<xsl:call-template name="corpusBody" />
+				<xsl:call-template name="stdfooter" />
+				<xsl:call-template name="bodyEndHook" />
+			</body>
+		</xsl:element>
+	</xsl:template>
+	<xsl:template match="tei:teiCorpus" mode="split">
+		<xsl:variable name="BaseFile">
+			<xsl:value-of select="$masterFile" />
+			<xsl:call-template name="addCorpusID" />
+		</xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				TEI HTML: run start hook template teiStartHook
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="teiStartHook" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				TEI HTML in corpus splitting mode, base file is
+				<xsl:value-of select="$BaseFile" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:variable name="outName">
+			<xsl:call-template name="outputChunkName">
+				<xsl:with-param name="ident">
+					<xsl:value-of select="$BaseFile" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
+
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Opening file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+			encoding="{$outputEncoding}" href="{$outName}"
+			method="{$outputMethod}">
+
+			<xsl:element name="html" namespace="{$outputNamespace}">
+				<xsl:call-template name="addLangAtt" />
+				<head>
+					<title>
+						<xsl:apply-templates
+							select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title/text()" />
+					</title>
+					<xsl:call-template name="includeCSS" />
+					<xsl:call-template name="cssHook" />
+				</head>
+				<body class="simple">
+					<xsl:call-template name="bodyMicroData" />
+					<xsl:call-template name="bodyJavascriptHook" />
+					<xsl:call-template name="bodyHook" />
+					<div class="stdheader">
+						<xsl:call-template name="stdheader">
+							<xsl:with-param name="title">
+								<xsl:apply-templates
+									select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</div>
+					<xsl:call-template name="corpusBody" />
+					<xsl:call-template name="stdfooter" />
+					<xsl:call-template name="bodyEndHook" />
+				</body>
+			</xsl:element>
+		</xsl:result-document>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Closing file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				TEI HTML: run end hook template teiEndHook
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="teiEndHook" />
+		<xsl:apply-templates select="tei:TEI" mode="split" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="corpusBody">
+		<xsl:call-template name="mainTOC" />
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/transcr.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/transcr.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/transcr.xsl	(revision 2397)
@@ -1,58 +1,61 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
 
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fo rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-    transcr module, making HTML output.
-      </p>
-         <p>This software is dual-licensed:
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				transcr module, making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: transcr.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: transcr.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/dictionaries.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/dictionaries.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/dictionaries.xsl	(revision 2397)
@@ -1,56 +1,60 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:html="http://www.w3.org/1999/xhtml"
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
 
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fo rng tei teix m"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the dictionaries
-      module, making HTML output. </p>
-         <p>This software is dual-licensed:
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo rng tei teix m" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the dictionaries
+				module, making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: dictionaries.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: dictionaries.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tei-param.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tei-param.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tei-param.xsl	(revision 2397)
@@ -1,786 +1,1048 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"                 
-    xmlns:html="http://www.w3.org/1999/xhtml"                
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"                
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="tei html xs"
-    version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>     <p>
-    TEI stylesheet customization module for HTML output.</p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei html xs" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet customization module for HTML output.</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei-param.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:key name="INDEX" use="1" match="tei:index"/>
-  <xsl:key name="PB" match="tei:pb" use="1"/>
-  <xsl:key name="NOTES" use="1"
-	   match="tei:note[@place='foot' or @place='bottom' or @place='end'
-		  and not(parent::tei:bibl or ancestor::tei:teiHeader)]"/>
-  <xsl:key name="ALLNOTES" use="1"
-	   match="tei:note[not(@place='margin' or @place='inline' or @place='display')
-		  and not(parent::tei:bibl or  ancestor::tei:teiHeader)]"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:key name="TAGREND" match="tei:tagUsage[@render]" use="@gi"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-param.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:key name="INDEX" use="1" match="tei:index" />
+	<xsl:key name="PB" match="tei:pb" use="1" />
+	<xsl:key name="NOTES" use="1"
+		match="tei:note[@place='foot' or @place='bottom' or @place='end'
+		  and not(parent::tei:bibl or ancestor::tei:teiHeader)]" />
+	<xsl:key name="ALLNOTES" use="1"
+		match="tei:note[not(@place='margin' or @place='inline' or @place='display')
+		  and not(parent::tei:bibl or  ancestor::tei:teiHeader)]" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS" type="string">
-    <desc>  CSS class for links derived from &lt;ptr&gt;    </desc>
-  </doc>
-  <xsl:param name="class_ptr">ptr</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS" type="string">
-      <desc>CSS class for links derived from &lt;ref&gt;</desc>
+	<xsl:key name="TAGREND" match="tei:tagUsage[@render]" use="@gi" />
 
-   </doc>
-  <xsl:param name="class_ref">ref</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS"
+		type="string">
+		<desc> CSS class for links derived from &lt;ptr&gt; </desc>
+	</doc>
+	<xsl:param name="class_ptr">
+		ptr
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS"
+		type="string">
+		<desc>CSS class for links derived from &lt;ref&gt;</desc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>Whether we should construct a separate file for each page
-      (based on page breaks)</desc>
-   </doc>
-  <xsl:param name="filePerPage">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="number">
-      <desc>When making fixed format epub, width of viewport</desc>
-  </doc>
-  <xsl:param name="viewPortWidth">1200</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="number">
-      <desc>When making fixed format epub, height of viewport</desc>
-  </doc>
-  <xsl:param name="viewPortHeight">1700</xsl:param>
+	</doc>
+	<xsl:param name="class_ref">
+		ref
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>Number footnotes consecutively</desc>
-   </doc>
-  <xsl:param name="consecutiveFNs">false</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>Whether we should construct a separate file for each page
+			(based on page breaks)</desc>
+	</doc>
+	<xsl:param name="filePerPage">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="number">
+		<desc>When making fixed format epub, width of viewport</desc>
+	</doc>
+	<xsl:param name="viewPortWidth">
+		1200
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="number">
+		<desc>When making fixed format epub, height of viewport</desc>
+	</doc>
+	<xsl:param name="viewPortHeight">
+		1700
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>Link back from footnotes to reference</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>Number footnotes consecutively</desc>
+	</doc>
+	<xsl:param name="consecutiveFNs">
+		false
+	</xsl:param>
 
-   </doc>
-  <xsl:param name="footnoteBackLink">false</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>Link back from footnotes to reference</desc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="cssFileInclude"
-        type="boolean">
-      <desc>Whether to include CSS by reference or by XInclusion</desc>
+	</doc>
+	<xsl:param name="footnoteBackLink">
+		false
+	</xsl:param>
 
-   </doc>
-  <xsl:param name="cssFileInclude">false</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="cssFileInclude" type="boolean">
+		<desc>Whether to include CSS by reference or by XInclusion</desc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS" type="anyURI">
-      <desc>CSS style file to be associated with output file(s)</desc>
+	</doc>
+	<xsl:param name="cssFileInclude">
+		false
+	</xsl:param>
 
-   </doc>
-  <xsl:param name="cssFile" as="xs:string">http://www.tei-c.org/release/xml/tei/stylesheet/tei.css</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS" type="anyURI">
-      <desc>CSS style file for print; this will be given a media=print attribute.
-    </desc>
-   </doc>
-  <xsl:param name="cssPrintFile" as="xs:string">http://www.tei-c.org/release/xml/tei/stylesheet/tei-print.css</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS" type="anyURI">
-      <desc>Secondary CSS style file; this will be given a media=screen attribute,
-so that it does not affect printing. It should be used for screen layout.
-  </desc>
-   </doc>
-    <xsl:param name="cssSecondaryFile"  as="xs:string" select="''"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS" type="anyURI">
-      <desc>CSS file to include in the output file directly</desc>
-   </doc>
-    <xsl:param name="cssInlineFile"  as="xs:string" select="''"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="integer">
-      <desc>Resolution of images. This is needed to calculate
-HTML width and height (in pixels) from supplied dimensions.</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS"
+		type="anyURI">
+		<desc>CSS style file to be associated with output file(s)</desc>
 
-   </doc>
-  <xsl:param name="dpi">96</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="boolean">
-      <desc>Display figures.</desc>
+	</doc>
+	<xsl:param name="cssFile" as="xs:string">
+		http://www.tei-c.org/release/xml/tei/stylesheet/tei.css
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS"
+		type="anyURI">
+		<desc>CSS style file for print; this will be given a media=print
+			attribute.
+		</desc>
+	</doc>
+	<xsl:param name="cssPrintFile" as="xs:string">
+		http://www.tei-c.org/release/xml/tei/stylesheet/tei-print.css
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS"
+		type="anyURI">
+		<desc>Secondary CSS style file; this will be given a media=screen
+			attribute,
+			so that it does not affect printing. It should be used for screen
+			layout.
+		</desc>
+	</doc>
+	<xsl:param name="cssSecondaryFile" as="xs:string" select="''" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS"
+		type="anyURI">
+		<desc>CSS file to include in the output file directly</desc>
+	</doc>
+	<xsl:param name="cssInlineFile" as="xs:string" select="''" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="integer">
+		<desc>Resolution of images. This is needed to calculate
+			HTML width and height (in pixels) from supplied dimensions.</desc>
 
-   </doc>
-  <xsl:param name="showFigures">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted just after &lt;body&gt;</desc>
-   </doc>
-  <xsl:template name="bodyHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>     <p>[html] Hook where HTML can be inserted just before the
-    &lt;body&gt; ends.</p>
-         <p>This can be used to add a page-wide footer block.</p>
-      </desc>
-   </doc>
-  <xsl:template name="bodyEndHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where Javascript calls can be inserted  just after &lt;body&gt;</desc>
-   </doc>
-  <xsl:template name="bodyJavascriptHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>     <p>[html] Hook where extra CSS can be inserted</p>
-         <p>&#160; </p>
-      </desc>
-   </doc>
-  <xsl:template name="cssHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>     <p>[html] Hook where code can be added to the HTML &lt;head&gt;.</p>
-         <p>This would be used to insert &lt;meta&gt; tags.</p>
-      </desc>
-   </doc>
-  <xsl:template name="headHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted when creating an &lt;img&gt;</desc>
-   </doc>
-  <xsl:template name="imgHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted when processing a
-    figure</desc>
-   </doc>
-  <xsl:template name="figureHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where extra Javascript functions can be defined</desc>
-   </doc>
-  <xsl:template name="javascriptHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted just before the &lt;address&gt;</desc>
-   </doc>
-  <xsl:template name="preAddressHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted at the start of
-    processing each section</desc>
-   </doc>
-  <xsl:template name="startDivHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted at the beginning
-    of the main text, after the header</desc>
-   </doc>
-  <xsl:template name="startHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted after processing &lt;TEI&gt;</desc>
-   </doc>
-  <xsl:template name="teiEndHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted before processing &lt;TEI&gt;</desc>
-   </doc>
-  <xsl:template name="teiStartHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hook where HTML can be inserted when creating an
-    &lt;a&gt; element</desc>
-   </doc>
-  <xsl:template name="xrefHook"/>
+	</doc>
+	<xsl:param name="dpi">
+		96
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="boolean">
+		<desc>Display figures.</desc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="i18n">
-      <desc>[html] Make a copyright claim</desc>
-   </doc>
-  <xsl:template name="copyrightStatement">This page is copyrighted</xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Banner for top of column</desc>
-   </doc>
-  <xsl:template name="columnHeader">
-</xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>     <p>How to use the front/body/back matter in creating
-columns.</p>
-         <p>
-	   The choice is between
-	   <ul xmlns="http://www.w3.org/1999/xhtml">
-	     <li>
-	       <b>all</b>: use &lt;front&gt; for left-hand column,
-	       use &lt;body&gt; for centre column, and use &lt;back&gt; for
-	     right-hand column</li>
-	     <li>
-	       <b>body</b>: use &lt;body&gt; for right-hand column,
-	     generate left-hand with a TOC or whatever</li>
-	   </ul>
-         </p>
-      </desc>
-  </doc>
-  <xsl:param name="contentStructure">body</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="integer">
-      <desc>     <p>The difference between TEI div levels and HTML.
-headings.</p>
-         <p>TEI &lt;div&gt;s are implicitly or explicitly numbered from 0
-upwards; this offset is added to that number to produce an HTML
-&lt;Hn&gt; element. So a value of 2 here means that a &lt;div1&gt;
-will generate an &lt;h2&gt;</p>
-      </desc>
-   </doc>
-  <xsl:param name="divOffset">2</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>Make a separate file for footnotes</desc>
+	</doc>
+	<xsl:param name="showFigures">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted just after &lt;body&gt;</desc>
+	</doc>
+	<xsl:template name="bodyHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>
+			<p>[html] Hook where HTML can be inserted just before the
+				&lt;body&gt; ends.</p>
+			<p>This can be used to add a page-wide footer block.</p>
+		</desc>
+	</doc>
+	<xsl:template name="bodyEndHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where Javascript calls can be inserted just after
+			&lt;body&gt;</desc>
+	</doc>
+	<xsl:template name="bodyJavascriptHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>
+			<p>[html] Hook where extra CSS can be inserted</p>
+			<p>&#160; </p>
+		</desc>
+	</doc>
+	<xsl:template name="cssHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>
+			<p>[html] Hook where code can be added to the HTML &lt;head&gt;.</p>
+			<p>This would be used to insert &lt;meta&gt; tags.</p>
+		</desc>
+	</doc>
+	<xsl:template name="headHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted when creating an
+			&lt;img&gt;</desc>
+	</doc>
+	<xsl:template name="imgHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted when processing a
+			figure</desc>
+	</doc>
+	<xsl:template name="figureHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where extra Javascript functions can be defined</desc>
+	</doc>
+	<xsl:template name="javascriptHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted just before the
+			&lt;address&gt;</desc>
+	</doc>
+	<xsl:template name="preAddressHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted at the start of
+			processing each section</desc>
+	</doc>
+	<xsl:template name="startDivHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted at the beginning
+			of the main text, after the header</desc>
+	</doc>
+	<xsl:template name="startHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted after processing
+			&lt;TEI&gt;</desc>
+	</doc>
+	<xsl:template name="teiEndHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted before processing
+			&lt;TEI&gt;</desc>
+	</doc>
+	<xsl:template name="teiStartHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hook where HTML can be inserted when creating an
+			&lt;a&gt; element</desc>
+	</doc>
+	<xsl:template name="xrefHook" />
 
-   </doc>
-  <xsl:param name="footnoteFile">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Header section across top of page </desc>
-   </doc>
-  <xsl:template name="hdr">
-      <xsl:call-template name="pageHeader">
-         <xsl:with-param name="mode"/>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Navigation bar </desc>
-   </doc>
-  <xsl:template name="hdr2">
-      <xsl:call-template name="navbar"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Text or action to take at the start of the
-    breadcrumb trail </desc>
-   </doc>
-  <xsl:template name="preBreadCrumbPath"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Breadcrumb trail </desc>
-   </doc>
-  <xsl:template name="hdr3">
-      <a href="#rh-col" title="Go to main page content" class="skiplinks">Skip links</a>
-      <a class="hide">|</a>
-      <xsl:call-template name="crumbPath"/>
-      <a class="hide">|</a>
-      <a class="bannerright" href="{$parentURL}" title="Go to home page">
-         <xsl:value-of select="$parentWords"/>
-      </a>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html]Bottom of left-hand column<param name="currentID">ID of selected section</param>
-      </desc>
-   </doc>
-  <xsl:template name="lh-col-bottom">
-      <xsl:param name="currentID"/>
-      <xsl:call-template name="leftHandFrame">
-         <xsl:with-param name="currentID" select="$currentID"/>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html]Top of left-hand column </desc>
-   </doc>
-  <xsl:template name="lh-col-top">
-      <xsl:call-template name="searchbox"/>
-      <xsl:call-template name="printLink"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>Width of left-hand column when $pageLayout is "Table"</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="i18n">
+		<desc>[html] Make a copyright claim</desc>
+	</doc>
+	<xsl:template name="copyrightStatement">
+		This page is copyrighted
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Banner for top of column</desc>
+	</doc>
+	<xsl:template name="columnHeader">
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			<p>How to use the front/body/back matter in creating
+				columns.</p>
+			<p>
+				The choice is between
+				<ul xmlns="http://www.w3.org/1999/xhtml">
+					<li>
+						<b>all</b>:
+						use &lt;front&gt; for left-hand column,
+						use &lt;body&gt; for centre column, and use &lt;back&gt; for
+						right-hand column
+					</li>
+					<li>
+						<b>body</b>:
+						use &lt;body&gt; for right-hand column,
+						generate left-hand with a TOC or whatever
+					</li>
+				</ul>
+			</p>
+		</desc>
+	</doc>
+	<xsl:param name="contentStructure">
+		body
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="integer">
+		<desc>
+			<p>The difference between TEI div levels and HTML.
+				headings.</p>
+			<p>TEI &lt;div&gt;s are implicitly or explicitly numbered from 0
+				upwards; this offset is added to that number to produce an HTML
+				&lt;Hn&gt; element. So a value of 2 here means that a &lt;div1&gt;
+				will generate an &lt;h2&gt;</p>
+		</desc>
+	</doc>
+	<xsl:param name="divOffset">
+		2
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>Make a separate file for footnotes</desc>
 
-   </doc>
-  <xsl:param name="linksWidth">15%</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Logo</desc>
-   </doc>
-  <xsl:template name="logoPicture">
-      <a class="framelogo" href="http://www.tei-c.org/Stylesheets/">
-         <img src="http://www.tei-c.org/release/common2/doc/tei-xsl-common/teixsl.png" vspace="5" width="124"
-              height="161"
-              border="0"
-              alt="created by TEI XSL Stylesheets"/>
-      </a>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Making elements in HTML &lt;head&gt;<param name="title">The text used to create the DC.Title field
-    in the HTML header</param>
-      </desc>
-   </doc>
-  <xsl:template name="metaHTML">
-      <xsl:param name="title"/>
-      <meta name="author">
-         <xsl:attribute name="content">
-            <xsl:call-template name="generateAuthor"/>
+	</doc>
+	<xsl:param name="footnoteFile">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Header section across top of page </desc>
+	</doc>
+	<xsl:template name="hdr">
+		<xsl:call-template name="pageHeader">
+			<xsl:with-param name="mode" />
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Navigation bar </desc>
+	</doc>
+	<xsl:template name="hdr2">
+		<xsl:call-template name="navbar" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Text or action to take at the start of the
+			breadcrumb trail
+		</desc>
+	</doc>
+	<xsl:template name="preBreadCrumbPath" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Breadcrumb trail </desc>
+	</doc>
+	<xsl:template name="hdr3">
+		<a href="#rh-col" title="Go to main page content" class="skiplinks">Skip links</a>
+		<a class="hide">|</a>
+		<xsl:call-template name="crumbPath" />
+		<a class="hide">|</a>
+		<a class="bannerright" href="{$parentURL}" title="Go to home page">
+			<xsl:value-of select="$parentWords" />
+		</a>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			[html]Bottom of left-hand column
+			<param name="currentID">ID of selected section</param>
+		</desc>
+	</doc>
+	<xsl:template name="lh-col-bottom">
+		<xsl:param name="currentID" />
+		<xsl:call-template name="leftHandFrame">
+			<xsl:with-param name="currentID" select="$currentID" />
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html]Top of left-hand column </desc>
+	</doc>
+	<xsl:template name="lh-col-top">
+		<xsl:call-template name="searchbox" />
+		<xsl:call-template name="printLink" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>Width of left-hand column when $pageLayout is "Table"</desc>
+
+	</doc>
+	<xsl:param name="linksWidth">
+		15%
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Logo</desc>
+	</doc>
+	<xsl:template name="logoPicture">
+		<a class="framelogo" href="http://www.tei-c.org/Stylesheets/">
+			<img
+				src="http://www.tei-c.org/release/common2/doc/tei-xsl-common/teixsl.png"
+				vspace="5" width="124" height="161" border="0"
+				alt="created by TEI XSL Stylesheets" />
+		</a>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html]
+			Making elements in HTML &lt;head&gt;
+			<param name="title">The text used to create the DC.Title field
+				in the HTML header</param>
+		</desc>
+	</doc>
+	<xsl:template name="metaHTML">
+		<xsl:param name="title" />
+		<meta name="author">
+			<xsl:attribute name="content">
+            <xsl:call-template name="generateAuthor" />
          </xsl:attribute>
-      </meta>
-      <xsl:if test="$filePerPage='true'">
-	<meta name="viewport" content="width={$viewPortWidth}, height={$viewPortHeight}"/>
-      </xsl:if>
-      <meta name="generator" content="Text Encoding Initiative Consortium XSLT stylesheets"/>
-      <xsl:choose>
-	<xsl:when test="$outputTarget='html5' or $outputTarget='epub3'">
-	  <meta charset="utf-8" />
-	</xsl:when>
-	<xsl:otherwise>
-	  <meta http-equiv="Content-Type" content="text/html; charset={$outputEncoding}"/>
-	  <meta name="DC.Title">
-	    <xsl:attribute name="content">
-	      <xsl:value-of select="normalize-space(translate($title,'&lt;&gt;','&#x2329;&#x3009;'))"/>
+		</meta>
+		<xsl:if test="$filePerPage='true'">
+			<meta name="viewport"
+				content="width={$viewPortWidth}, height={$viewPortHeight}" />
+		</xsl:if>
+		<meta name="generator"
+			content="Text Encoding Initiative Consortium XSLT stylesheets" />
+		<xsl:choose>
+			<xsl:when
+				test="$outputTarget='html5' or $outputTarget='epub3'">
+				<meta charset="utf-8" />
+			</xsl:when>
+			<xsl:otherwise>
+				<meta http-equiv="Content-Type"
+					content="text/html; charset={$outputEncoding}" />
+				<meta name="DC.Title">
+					<xsl:attribute name="content">
+	      <xsl:value-of
+						select="normalize-space(translate($title,'&lt;&gt;','&#x2329;&#x3009;'))" />
 	    </xsl:attribute>
-	  </meta>
-	  <meta name="DC.Type" content="Text"/>
-	  <meta name="DC.Format" content="text/html"/>
-	</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+				</meta>
+				<meta name="DC.Type" content="Text" />
+				<meta name="DC.Format" content="text/html" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>     <p>[html] Construction of navigation bar </p>
-         <p>A file is looked for relative to the <i xmlns="http://www.w3.org/1999/xhtml">stylesheet</i> (the
-    second parameter of the document function), which is expected to
-    contain a TEI &lt;list&gt; where each &lt;item&gt; has an embedded
-    &lt;xref&gt;</p>
-      </desc>
-   </doc>
-  <xsl:template name="navbar">
-    <xsl:choose>
-      <xsl:when test="$navbarFile=''">
-	<xsl:comment>no nav bar</xsl:comment>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:element name="{if ($outputTarget='html5') then 'nav' else 'div'}">
-	  <xsl:for-each select="document($navbarFile,document(''))">
-	    <xsl:for-each select="tei:list/tei:item">
-	      <span class="navbar">
-		<a href="{$URLPREFIX}{tei:xref/@url}" class="navbar">
-		  <xsl:apply-templates select="tei:xref/text()"/>
-		</a>
-	      </span>
-	      <xsl:if test="following-sibling::tei:item"> | </xsl:if>
-	    </xsl:for-each>
-	  </xsl:for-each>
-	</xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="anyURI">
-      <desc>     <p>XML resource defining a navigation bar.</p>
-         <p>The XML should provide a &lt;list&gt; containing a series
-of &lt;item&gt; elements, each containing an &lt;xref&gt; link.</p>
-      </desc>
-   </doc>
-  <xsl:param name="navbarFile"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Banner for top of page<param name="mode">layout mode</param>
-      </desc>
-   </doc>
-  <xsl:template name="pageHeader">
-      <xsl:param name="mode"/>
-      <xsl:choose>
-         <xsl:when test="$mode='table'">
-            <table width="100%" border="0">
-               <tr>
-                  <td height="98" class="bgimage" onclick="window.location='{$homeURL}'"
-                      cellpadding="0">
+		<desc>
+			<p>[html] Construction of navigation bar </p>
+			<p>
+				A file is looked for relative to the
+				<i xmlns="http://www.w3.org/1999/xhtml">stylesheet</i>
+				(the
+				second parameter of the document function), which is expected to
+				contain a TEI &lt;list&gt; where each &lt;item&gt; has an embedded
+				&lt;xref&gt;
+			</p>
+		</desc>
+	</doc>
+	<xsl:template name="navbar">
+		<xsl:choose>
+			<xsl:when test="$navbarFile=''">
+				<xsl:comment>
+					no nav bar
+				</xsl:comment>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element
+					name="{if ($outputTarget='html5') then 'nav' else 'div'}">
+					<xsl:for-each
+						select="document($navbarFile,document(''))">
+						<xsl:for-each select="tei:list/tei:item">
+							<span class="navbar">
+								<a href="{$URLPREFIX}{tei:xref/@url}" class="navbar">
+									<xsl:apply-templates
+										select="tei:xref/text()" />
+								</a>
+							</span>
+							<xsl:if test="following-sibling::tei:item">
+								|
+							</xsl:if>
+						</xsl:for-each>
+					</xsl:for-each>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="anyURI">
+		<desc>
+			<p>XML resource defining a navigation bar.</p>
+			<p>The XML should provide a &lt;list&gt; containing a series
+				of &lt;item&gt; elements, each containing an &lt;xref&gt; link.</p>
+		</desc>
+	</doc>
+	<xsl:param name="navbarFile" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			[html] Banner for top of page
+			<param name="mode">layout mode</param>
+		</desc>
+	</doc>
+	<xsl:template name="pageHeader">
+		<xsl:param name="mode" />
+		<xsl:choose>
+			<xsl:when test="$mode='table'">
+				<table width="100%" border="0">
+					<tr>
+						<td height="98" class="bgimage"
+							onclick="window.location='{$homeURL}'" cellpadding="0">
 
-	                    <xsl:call-template name="makeHTMLHeading">
-		                      <xsl:with-param name="class">subtitle</xsl:with-param>
-		                      <xsl:with-param name="text">
-		                         <xsl:call-template name="generateSubTitle"/>
-		                      </xsl:with-param>
-		                      <xsl:with-param name="level">2</xsl:with-param>
-	                    </xsl:call-template>
+							<xsl:call-template name="makeHTMLHeading">
+								<xsl:with-param name="class">
+									subtitle
+								</xsl:with-param>
+								<xsl:with-param name="text">
+									<xsl:call-template name="generateSubTitle" />
+								</xsl:with-param>
+								<xsl:with-param name="level">
+									2
+								</xsl:with-param>
+							</xsl:call-template>
 
-	                    <xsl:call-template name="makeHTMLHeading">
-		                      <xsl:with-param name="class">title</xsl:with-param>
-		                      <xsl:with-param name="text">
-		                         <xsl:call-template name="generateTitle"/>
-		                      </xsl:with-param>
-		                      <xsl:with-param name="level">1</xsl:with-param>
-	                    </xsl:call-template>
+							<xsl:call-template name="makeHTMLHeading">
+								<xsl:with-param name="class">
+									title
+								</xsl:with-param>
+								<xsl:with-param name="text">
+									<xsl:call-template name="generateTitle" />
+								</xsl:with-param>
+								<xsl:with-param name="level">
+									1
+								</xsl:with-param>
+							</xsl:call-template>
 
-                  </td>
-                  <td style="vertical-align:top;"/>
-               </tr>
-            </table>
-         </xsl:when>
-         <xsl:otherwise>
-	           <xsl:call-template name="makeHTMLHeading">
-	              <xsl:with-param name="class">subtitle</xsl:with-param>
-	              <xsl:with-param name="text">
-	                 <xsl:call-template name="generateSubTitle"/>
-	              </xsl:with-param>
-	              <xsl:with-param name="level">2</xsl:with-param>
-	           </xsl:call-template>
-	
-	           <xsl:call-template name="makeHTMLHeading">
-	              <xsl:with-param name="class">title</xsl:with-param>
-	              <xsl:with-param name="text">
-	                 <xsl:call-template name="generateTitle"/>
-	              </xsl:with-param>
-	              <xsl:with-param name="level">1</xsl:with-param>
-	           </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+						</td>
+						<td style="vertical-align:top;" />
+					</tr>
+				</table>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="makeHTMLHeading">
+					<xsl:with-param name="class">
+						subtitle
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:call-template name="generateSubTitle" />
+					</xsl:with-param>
+					<xsl:with-param name="level">
+						2
+					</xsl:with-param>
+				</xsl:call-template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Make a heading, if there some text to display<param name="text">Heading title</param>
-         <param name="class">CSS class</param>
-         <param name="level">Heading level</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeHTMLHeading">
-      <xsl:param name="text"/>
-      <xsl:param name="class">title</xsl:param>
-      <xsl:param name="level">1</xsl:param>
-      <xsl:if test="not($text='')">
-	<xsl:choose>
-	<xsl:when test="$level &gt; 6">
-	  <div class="h{$level}">
-            <xsl:copy-of select="$text"/>
-	  </div>
-	</xsl:when>
-	<xsl:otherwise>
-         <xsl:element name="h{$level}">
-	   <xsl:attribute name="class">
-	     <xsl:value-of select="$class"/>
+				<xsl:call-template name="makeHTMLHeading">
+					<xsl:with-param name="class">
+						title
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:call-template name="generateTitle" />
+					</xsl:with-param>
+					<xsl:with-param name="level">
+						1
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Make a heading, if there some text to display
+			<param name="text">Heading title</param>
+			<param name="class">CSS class</param>
+			<param name="level">Heading level</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeHTMLHeading">
+		<xsl:param name="text" />
+		<xsl:param name="class">
+			title
+		</xsl:param>
+		<xsl:param name="level">
+			1
+		</xsl:param>
+		<xsl:if test="not($text='')">
+			<xsl:choose>
+				<xsl:when test="$level &gt; 6">
+					<div class="h{$level}">
+						<xsl:copy-of select="$text" />
+					</div>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:element name="h{$level}">
+						<xsl:attribute name="class">
+	     <xsl:value-of select="$class" />
 	   </xsl:attribute>
-	   <xsl:copy-of select="$text"/>
-         </xsl:element>
-	</xsl:otherwise>
-	</xsl:choose>
-      </xsl:if>
-  </xsl:template>
+						<xsl:copy-of select="$text" />
+					</xsl:element>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Make a link saying how to get printable version
-    of file</desc>
-   </doc>
-  <xsl:template name="printLink"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Bottom of right-hand column<param name="currentID">ID of selected section</param>
-      </desc>
-   </doc>
-  <xsl:template name="rh-col-bottom">
-      <xsl:param name="currentID"/>
-      <xsl:call-template name="mainFrame">
-         <xsl:with-param name="currentID" select="$currentID"/>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Top of right-hand column</desc>
-   </doc>
-  <xsl:template name="rh-col-top">
-      <xsl:call-template name="columnHeader"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Make a search box</desc>
-   </doc>
-  <xsl:template name="searchbox"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>[html] Construct a label for the link which makes a
-    printable version of the document.</desc>
-   </doc>
-  <xsl:template name="singleFileLabel">For Printing</xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="string">
-      <desc>How to align the navigation panel at the bottom of the page</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] Make a link saying how to get printable version
+			of file</desc>
+	</doc>
+	<xsl:template name="printLink" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			[html] Bottom of right-hand column
+			<param name="currentID">ID of selected section</param>
+		</desc>
+	</doc>
+	<xsl:template name="rh-col-bottom">
+		<xsl:param name="currentID" />
+		<xsl:call-template name="mainFrame">
+			<xsl:with-param name="currentID" select="$currentID" />
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Top of right-hand column</desc>
+	</doc>
+	<xsl:template name="rh-col-top">
+		<xsl:call-template name="columnHeader" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Make a search box</desc>
+	</doc>
+	<xsl:template name="searchbox" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>[html] Construct a label for the link which makes a
+			printable version of the document.</desc>
+	</doc>
+	<xsl:template name="singleFileLabel">
+		For Printing
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="string">
+		<desc>How to align the navigation panel at the bottom of the page</desc>
 
-   </doc>
-  <xsl:param name="alignNavigationPanel">right</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="boolean">
-      <desc>Display navigation panel at bottom of pages</desc>
+	</doc>
+	<xsl:param name="alignNavigationPanel">
+		right
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="boolean">
+		<desc>Display navigation panel at bottom of pages</desc>
 
-   </doc>
-  <xsl:param name="bottomNavigationPanel">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="anyURI">
-      <desc>Link for feedback</desc>
+	</doc>
+	<xsl:param name="bottomNavigationPanel">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="anyURI">
+		<desc>Link for feedback</desc>
 
-   </doc>
-  <xsl:param name="feedbackURL">mailto:feedback</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="string">
-      <desc>Fixed string to insert before normal page title in HTML meta
-&lt;title&gt; element</desc>
+	</doc>
+	<xsl:param name="feedbackURL">
+		mailto:feedback
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="string">
+		<desc>Fixed string to insert before normal page title in HTML meta
+			&lt;title&gt; element</desc>
 
-   </doc>
-  <xsl:param name="htmlTitlePrefix"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="boolean">
-      <desc>Make a panel with next page/previous page links.</desc>
+	</doc>
+	<xsl:param name="htmlTitlePrefix" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="boolean">
+		<desc>Make a panel with next page/previous page links.</desc>
 
-   </doc>
-  <xsl:param name="linkPanel">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc" type="boolean">
-      <desc>Generate a unique ID for all paragraphs</desc>
+	</doc>
+	<xsl:param name="linkPanel">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc"
+		type="boolean">
+		<desc>Generate a unique ID for all paragraphs</desc>
 
-   </doc>
-  <xsl:param name="generateParagraphIDs">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc" type="string">
-      <desc>     <p>Character separating values in a rend attribute.</p>
-         <p>Some projects use multiple values in <tt
-         xmlns="http://www.w3.org/1999/xhtml">rend</tt>
-         attributes. These are handled, but the separator character(s)
-         must be specified.</p>
-      </desc>
-   </doc>
-  <xsl:param name="rendSeparator">; </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc" type="boolean">
-      <desc>Show a title and author at start of document</desc>
+	</doc>
+	<xsl:param name="generateParagraphIDs">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc"
+		type="string">
+		<desc>
+			<p>Character separating values in a rend attribute.</p>
+			<p>
+				Some projects use multiple values in
+				<tt xmlns="http://www.w3.org/1999/xhtml">rend</tt>
+				attributes. These are handled, but the separator character(s)
+				must be specified.
+			</p>
+		</desc>
+	</doc>
+	<xsl:param name="rendSeparator">
+		;
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc"
+		type="boolean">
+		<desc>Show a title and author at start of document</desc>
 
-   </doc>
-  <xsl:param name="showTitleAuthor">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc" type="boolean">
-      <desc>Be talkative while working.</desc>
+	</doc>
+	<xsl:param name="showTitleAuthor">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc"
+		type="boolean">
+		<desc>Be talkative while working.</desc>
 
-   </doc>
+	</doc>
 
-  <xsl:param name="verbose">false</xsl:param>
+	<xsl:param name="verbose">
+		false
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>Make all notes into endnotes
-  </desc>
-   </doc>
-  <xsl:param name="autoEndNotes">false</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>Make all notes into endnotes
+		</desc>
+	</doc>
+	<xsl:param name="autoEndNotes">
+		false
+	</xsl:param>
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>An ID passed to the stylesheet to indicate which section to display</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>An ID passed to the stylesheet to indicate which section to
+			display</desc>
 
-   </doc>
-  <xsl:param name="ID"/>
+	</doc>
+	<xsl:param name="ID" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>A wrapper around the ID, to allow for other ways of getting it</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>A wrapper around the ID, to allow for other ways of getting it</desc>
 
-   </doc>
-  <xsl:param name="requestedID">
-      <xsl:value-of select="$ID"/>
-  </xsl:param>
+	</doc>
+	<xsl:param name="requestedID">
+		<xsl:value-of select="$ID" />
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>A path fragment to put before all internal URLs </desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>A path fragment to put before all internal URLs </desc>
 
-   </doc>
-  <xsl:param name="URLPREFIX"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>The name of the output file</desc>
+	</doc>
+	<xsl:param name="URLPREFIX" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>The name of the output file</desc>
 
-   </doc>
-  <xsl:param name="outputName"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>Directory in which to place generated files.</desc>
+	</doc>
+	<xsl:param name="outputName" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>Directory in which to place generated files.</desc>
 
-   </doc>
-  <xsl:param name="outputDir"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>Encoding of output file(s).</desc>
+	</doc>
+	<xsl:param name="outputDir" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>Encoding of output file(s).</desc>
 
-   </doc>
-  <xsl:param name="outputEncoding">utf-8</xsl:param>
+	</doc>
+	<xsl:param name="outputEncoding">
+		utf-8
+	</xsl:param>
 
-  <xsl:param name="outputNamespace">http://www.w3.org/1999/xhtml</xsl:param>
+	<xsl:param name="outputNamespace">
+		http://www.w3.org/1999/xhtml
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>Output method for output file(s).</desc>
-   </doc>
-  <xsl:param name="outputMethod">xhtml</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>Suffix of output file(s).</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>Output method for output file(s).</desc>
+	</doc>
+	<xsl:param name="outputMethod">
+		xhtml
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>Suffix of output file(s).</desc>
 
-   </doc>
-  <xsl:param name="outputSuffix">.html</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>Public Doctype of output file(s).</desc>
+	</doc>
+	<xsl:param name="outputSuffix">
+		.html
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>Public Doctype of output file(s).</desc>
 
-   </doc>
+	</doc>
 
-  <xsl:param name="doctypePublic">-//W3C//DTD XHTML 1.0 Transitional//EN</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>System Doctype of output file(s).</desc>
+	<xsl:param name="doctypePublic">
+		-//W3C//DTD XHTML 1.0 Transitional//EN
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>System Doctype of output file(s).</desc>
 
-   </doc>
-  <xsl:param name="doctypeSystem">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>     <p>The style of HTML (Simple, CSS or Table) which creates the layout for generated pages.</p>
-         <p>The choice is between
-<ul xmlns="http://www.w3.org/1999/xhtml">
-               <li>
-                  <b>Simple</b>: A linear presentation is created</li>
-               <li>
-                  <b>CSS</b>: The page is created as a series of nested
- &lt;div&gt;s which can be arranged using CSS into a multicolumn
-layout</li>
-               <li>
-                  <b>Table</b>: The page is created as an HTML table</li>
-            </ul>
-         </p>
-      </desc>
-   </doc>
-  <xsl:param name="pageLayout">Simple</xsl:param>
+	</doc>
+	<xsl:param name="doctypeSystem">
+		http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>
+			<p>The style of HTML (Simple, CSS or Table) which creates the layout
+				for generated pages.</p>
+			<p>
+				The choice is between
+				<ul xmlns="http://www.w3.org/1999/xhtml">
+					<li>
+						<b>Simple</b>
+						: A linear presentation is created
+					</li>
+					<li>
+						<b>CSS</b>:
+						The page is created as a series of nested
+						&lt;div&gt;s which can be arranged using CSS into a multicolumn
+						layout
+					</li>
+					<li>
+						<b>Table</b>
+						: The page is created as an HTML table
+					</li>
+				</ul>
+			</p>
+		</desc>
+	</doc>
+	<xsl:param name="pageLayout">
+		Simple
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="boolean">
-      <desc>Break back matter into separate HTML pages (if splitting enabled).</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="boolean">
+		<desc>Break back matter into separate HTML pages (if splitting
+			enabled).</desc>
 
-   </doc>
-  <xsl:param name="splitBackmatter">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="boolean">
-      <desc>Break front matter into separate HTML pages (if splitting enabled).</desc>
+	</doc>
+	<xsl:param name="splitBackmatter">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="boolean">
+		<desc>Break front matter into separate HTML pages (if splitting
+			enabled).</desc>
 
-   </doc>
-  <xsl:param name="splitFrontmatter">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="integer">
-      <desc>     <p>Level at which to split sections.</p>
-         <p>When processing a &lt;div&gt; or &lt;div[0-5]&gt;, compare
-the nesting depth and see whether to start a new HTML page. Since the
-TEI starts with &lt;div1&gt;, setting this parameter to 0 will cause
-top-level sections to be split apart. The default is not to split at
-all.
-</p>
-      </desc>
-   </doc>
-  <xsl:param name="splitLevel">-1</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>Suffix for generated output files.</desc>
+	</doc>
+	<xsl:param name="splitFrontmatter">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="integer">
+		<desc>
+			<p>Level at which to split sections.</p>
+			<p>When processing a &lt;div&gt; or &lt;div[0-5]&gt;, compare
+				the nesting depth and see whether to start a new HTML page. Since the
+				TEI starts with &lt;div1&gt;, setting this parameter to 0 will cause
+				top-level sections to be split apart. The default is not to split at
+				all.
+			</p>
+		</desc>
+	</doc>
+	<xsl:param name="splitLevel">
+		-1
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>Suffix for generated output files.</desc>
 
-   </doc>
-  <xsl:param name="standardSuffix">
-      <xsl:choose>
-         <xsl:when test="tei:teiCorpus">.html</xsl:when>
-         <xsl:when test="$STDOUT='true'"/>
-         <xsl:otherwise>
-	           <xsl:value-of select="$outputSuffix"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="boolean">
-      <desc>Display navigation panel at top of pages.</desc>
+	</doc>
+	<xsl:param name="standardSuffix">
+		<xsl:choose>
+			<xsl:when test="tei:teiCorpus">
+				.html
+			</xsl:when>
+			<xsl:when test="$STDOUT='true'" />
+			<xsl:otherwise>
+				<xsl:value-of select="$outputSuffix" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="boolean">
+		<desc>Display navigation panel at top of pages.</desc>
 
-   </doc>
-  <xsl:param name="topNavigationPanel">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>How to specify infra-document links. When a document is split,
-links need to be constructed between parts of the document. 
-The default is to use a query parameter on the URL.</desc>
+	</doc>
+	<xsl:param name="topNavigationPanel">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>How to specify infra-document links. When a document is split,
+			links need to be constructed between parts of the document.
+			The default is to use a query parameter on the URL.</desc>
 
-   </doc>
-  <xsl:param name="urlChunkPrefix">?ID=</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="boolean">
-      <desc>     <p>Construct links using existing ID values.</p>
-         <p>It is often nice if, when making separate files, their names
-correspond to the ID attribute of the &gt;div&lt;. Alternatively, you
-	  can let the system choose names.</p>
-      </desc>
-   </doc>
-  <xsl:param name="useIDs">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>HTML element to put around visible text of display URLs</desc>
+	</doc>
+	<xsl:param name="urlChunkPrefix">
+		?ID=
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="boolean">
+		<desc>
+			<p>Construct links using existing ID values.</p>
+			<p>It is often nice if, when making separate files, their names
+				correspond to the ID attribute of the &gt;div&lt;. Alternatively,
+				you
+				can let the system choose names.</p>
+		</desc>
+	</doc>
+	<xsl:param name="useIDs">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>HTML element to put around visible text of display URLs</desc>
 
-   </doc>
-  <xsl:param name="urlMarkup">span</xsl:param>
+	</doc>
+	<xsl:param name="urlMarkup">
+		span
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="boolean">
-      <desc>Make an automatic table of contents</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="boolean">
+		<desc>Make an automatic table of contents</desc>
 
-   </doc>
-  <xsl:param name="autoToc">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>CSS class for second-level TOC entries</desc>
+	</doc>
+	<xsl:param name="autoToc">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>CSS class for second-level TOC entries</desc>
 
-   </doc>
-  <xsl:param name="class_subtoc">subtoc</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="integer">
-      <desc>
-	<p>Depth at which to stop doing a recursive table of contents.</p>
-         <p>You can have a mini table of contents at the start of each
-         section. The default is only to construct a TOC at the top
-         level; a value of -1 here means no subtoc at all. </p>
-      </desc>
-   </doc>
-  <xsl:param name="subTocDepth">-1</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="boolean">
-      <desc>Include the back matter in the table of contents.</desc>
+	</doc>
+	<xsl:param name="class_subtoc">
+		subtoc
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="integer">
+		<desc>
+			<p>Depth at which to stop doing a recursive table of contents.</p>
+			<p>You can have a mini table of contents at the start of each
+				section. The default is only to construct a TOC at the top
+				level; a value of -1 here means no subtoc at all.
+			</p>
+		</desc>
+	</doc>
+	<xsl:param name="subTocDepth">
+		-1
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="boolean">
+		<desc>Include the back matter in the table of contents.</desc>
 
-   </doc>
-  <xsl:param name="tocBack">true</xsl:param>
+	</doc>
+	<xsl:param name="tocBack">
+		true
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>Depth to which table of contents is constructed.</desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>Depth to which table of contents is constructed.</desc>
 
-   </doc>
-  <xsl:param name="tocDepth">5</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="boolean">
-      <desc>Include the front matter in the table of contents.</desc>
+	</doc>
+	<xsl:param name="tocDepth">
+		5
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="boolean">
+		<desc>Include the front matter in the table of contents.</desc>
 
-   </doc>
-  <xsl:param name="tocFront">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>Which HTML element to wrap each TOCs entry in.</desc>
+	</doc>
+	<xsl:param name="tocFront">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>Which HTML element to wrap each TOCs entry in.</desc>
 
-   </doc>
-  <xsl:param name="tocElement">p</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>Which HTML element to wrap each TOC sections in.</desc>
+	</doc>
+	<xsl:param name="tocElement">
+		p
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>Which HTML element to wrap each TOC sections in.</desc>
 
-   </doc>
-  <xsl:param name="tocContainerElement">div</xsl:param>
+	</doc>
+	<xsl:param name="tocContainerElement">
+		div
+	</xsl:param>
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>Text to link back to from foot of ODD reference pages
-  </desc>
-   </doc>
-   <xsl:param name="refDocFooterText">TEI Guidelines</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>Text to link back to from foot of ODD reference pages
+		</desc>
+	</doc>
+	<xsl:param name="refDocFooterText">
+		TEI Guidelines
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="anyURI">
-      <desc>URL to link back to from foot of ODD reference pages
-  </desc>
-   </doc>
-   <xsl:param name="refDocFooterURL">index.html</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="anyURI">
+		<desc>URL to link back to from foot of ODD reference pages
+		</desc>
+	</doc>
+	<xsl:param name="refDocFooterURL">
+		index.html
+	</xsl:param>
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="anyURI">
-      <desc>Gap between elements in navigation list
-  </desc></doc>
-   <xsl:template name="navInterSep">
-      <xsl:text>: </xsl:text>
-   </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="anyURI">
+		<desc>Gap between elements in navigation list
+		</desc>
+	</doc>
+	<xsl:template name="navInterSep">
+		<xsl:text>: </xsl:text>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="boolean">
-      <desc>Whether it should be attempted to make quotes into block
-      quotes if they are over a certain length</desc></doc>
-  <xsl:param name="autoBlockQuote">false</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="boolean">
+		<desc>Whether it should be attempted to make quotes into block
+			quotes if they are over a certain length</desc>
+	</doc>
+	<xsl:param name="autoBlockQuote">
+		false
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="integer">
-      <desc>Length beyond which a quote is a block quote</desc></doc>
-  <xsl:param name="autoBlockQuoteLength">150</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="integer">
+		<desc>Length beyond which a quote is a block quote</desc>
+	</doc>
+	<xsl:param name="autoBlockQuoteLength">
+		150
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[html] Hooks where HTML can be inserted when processing
-    &lt;egXML&gt; element</desc>
-   </doc>
-   <xsl:template name="egXMLStartHook"/>
-   <xsl:template name="egXMLEndHook"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[html] Hooks where HTML can be inserted when processing
+			&lt;egXML&gt; element</desc>
+	</doc>
+	<xsl:template name="egXMLStartHook" />
+	<xsl:template name="egXMLEndHook" />
 
-   <xsl:template name="emphasize">
-      <xsl:param name="class"/>
-      <xsl:param name="content"/>
-      <xsl:choose>
-         <xsl:when test="$class='titlea'">
-            <q class="titlea">
-	              <xsl:copy-of select="$content"/>
-            </q>
-         </xsl:when>
-         <xsl:otherwise>
-            <span class="{$class}">
-	              <xsl:copy-of select="$content"/>
-            </span>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template name="emphasize">
+		<xsl:param name="class" />
+		<xsl:param name="content" />
+		<xsl:choose>
+			<xsl:when test="$class='titlea'">
+				<q class="titlea">
+					<xsl:copy-of select="$content" />
+				</q>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="{$class}">
+					<xsl:copy-of select="$content" />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:param name="mediaoverlay">false</xsl:param>
+	<xsl:param name="mediaoverlay">
+		false
+	</xsl:param>
 
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tei.xsl	(revision 2397)
@@ -1,147 +1,154 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"                  
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-		xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="html a fo rng tei teix teidocx"
-                version="2.0">
-  <xsl:import href="../common2/tei.xsl"/>
-  <xsl:import href="tei-param.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet for making HTML output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="html a fo rng tei teix teidocx" version="2.0">
+	<xsl:import href="../common2/tei.xsl" />
+	<xsl:import href="tei-param.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet for making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:include href="core.xsl"/>
-  <xsl:include href="corpus.xsl"/>
-  <xsl:include href="dictionaries.xsl"/>
-  <xsl:include href="drama.xsl"/>
-  <xsl:include href="figures.xsl"/>
-  <xsl:include href="header.xsl"/>
-  <xsl:include href="linking.xsl"/>
-  <xsl:include href="namesdates.xsl"/>
-  <xsl:include href="tagdocs.xsl"/>
-  <xsl:include href="textstructure.xsl"/>
-  <xsl:include href="textcrit.xsl"/>
-  <xsl:include href="transcr.xsl"/>
-  <xsl:include href="verse.xsl"/>
-  <xsl:include href="../common2/verbatim.xsl"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:include href="core.xsl" />
+	<xsl:include href="corpus.xsl" />
+	<xsl:include href="dictionaries.xsl" />
+	<xsl:include href="drama.xsl" />
+	<xsl:include href="figures.xsl" />
+	<xsl:include href="header.xsl" />
+	<xsl:include href="linking.xsl" />
+	<xsl:include href="namesdates.xsl" />
+	<xsl:include href="tagdocs.xsl" />
+	<xsl:include href="textstructure.xsl" />
+	<xsl:include href="textcrit.xsl" />
+	<xsl:include href="transcr.xsl" />
+	<xsl:include href="verse.xsl" />
+	<xsl:include href="../common2/verbatim.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" type="string">
-      <desc>
-Stylesheet constant setting the name of the main output file.
-</desc>
-   </doc>
-  <xsl:variable name="top" select="/"/>
-  <xsl:variable name="masterFile">
-      <xsl:choose>
-         <xsl:when test="not($outputName ='')">
-            <xsl:choose>
-               <xsl:when test="$STDOUT='true'">
-                  <xsl:value-of select="$outputName"/>
-               </xsl:when>
-               <xsl:when test="contains($outputName,'.xml')">
-                  <xsl:value-of select="substring-before($outputName,'.xml')"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="$outputName"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:when test="contains($REQUEST,'.ID=')">
-            <xsl:call-template name="get-basename">
-               <xsl:with-param name="file">
-                  <xsl:value-of select="substring-before($REQUEST,'.ID=')"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="not($REQUEST='')">
-            <xsl:call-template name="get-basename">
-               <xsl:with-param name="file">
-                  <xsl:value-of select="$REQUEST"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$STDOUT='true'">
-            <xsl:text>index.xml</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>index</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:variable>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] How to work out the filename component of a path<param name="file">filename</param>
-      </desc>
-   </doc>
-  <xsl:template name="get-basename">
-      <xsl:param name="file"/>
-      <xsl:choose>
-         <xsl:when test="contains($file,'/')">
-            <xsl:call-template name="get-basename">
-               <xsl:with-param name="file">
-                  <xsl:value-of select="substring-after($file,'/')"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="$STDOUT='true'">
-                  <xsl:value-of select="$file"/>
-               </xsl:when>
-               <xsl:when test="contains($file,'.xml')">
-                  <xsl:value-of select="substring-before($file,'.xml')"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="$file"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
 
-  <xsl:template name="bodyMicroData"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" type="string">
+		<desc>
+			Stylesheet constant setting the name of the main output file.
+		</desc>
+	</doc>
+	<xsl:variable name="top" select="/" />
+	<xsl:variable name="masterFile">
+		<xsl:choose>
+			<xsl:when test="not($outputName ='')">
+				<xsl:choose>
+					<xsl:when test="$STDOUT='true'">
+						<xsl:value-of select="$outputName" />
+					</xsl:when>
+					<xsl:when test="contains($outputName,'.xml')">
+						<xsl:value-of
+							select="substring-before($outputName,'.xml')" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$outputName" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="contains($REQUEST,'.ID=')">
+				<xsl:call-template name="get-basename">
+					<xsl:with-param name="file">
+						<xsl:value-of
+							select="substring-before($REQUEST,'.ID=')" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not($REQUEST='')">
+				<xsl:call-template name="get-basename">
+					<xsl:with-param name="file">
+						<xsl:value-of select="$REQUEST" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$STDOUT='true'">
+				<xsl:text>index.xml</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>index</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] How to work out the filename component of a path
+			<param name="file">filename</param>
+		</desc>
+	</doc>
+	<xsl:template name="get-basename">
+		<xsl:param name="file" />
+		<xsl:choose>
+			<xsl:when test="contains($file,'/')">
+				<xsl:call-template name="get-basename">
+					<xsl:with-param name="file">
+						<xsl:value-of select="substring-after($file,'/')" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$STDOUT='true'">
+						<xsl:value-of select="$file" />
+					</xsl:when>
+					<xsl:when test="contains($file,'.xml')">
+						<xsl:value-of select="substring-before($file,'.xml')" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$file" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="bodyMicroData" />
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/verse.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/verse.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/verse.xsl	(revision 2397)
@@ -1,58 +1,61 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
 
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fo rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      verse module, making HTML output.
-      </p>
-         <p>This software is dual-licensed:
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				verse module, making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: verse.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: verse.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/drama.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/drama.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/drama.xsl	(revision 2397)
@@ -1,275 +1,295 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes=" a fo rng tei teix html"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the drama module,
-      making HTML output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes=" a fo rng tei teix html" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the drama module,
+				making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element actor</desc>
-   </doc>
-  <xsl:template match="tei:actor">
-      <span class="actor">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element camera</desc>
-   </doc>
-  <xsl:template match="tei:camera">
-      <span class="camera">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element caption</desc>
-   </doc>
-  <xsl:template match="tei:caption">
-      <span class="caption">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element castGroup</desc>
-   </doc>
-  <xsl:template match="tei:castGroup">
-      <ul>
-         <xsl:apply-templates/>
-      </ul>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element castItem</desc>
-   </doc>
-  <xsl:template match="tei:castItem">
-      <li>
-         <xsl:apply-templates/>
-      </li>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element castList</desc>
-   </doc>
-  <xsl:template match="tei:castList">
-      <xsl:if test="tei:head">
-         <p>
-            <em>
-               <xsl:for-each select="tei:head">
-                  <xsl:apply-templates/>
-               </xsl:for-each>
-            </em>
-         </p>
-      </xsl:if>
-      <ul>
-         <xsl:apply-templates/>
-      </ul>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element castList/tei:head</desc>
-   </doc>
-  <xsl:template match="tei:castList/tei:head"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element role</desc>
-   </doc>
-  <xsl:template match="tei:role">
-      <span class="role">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element roleDesc</desc>
-   </doc>
-  <xsl:template match="tei:roleDesc">
-      <blockquote>
-	        <xsl:choose>
-	           <xsl:when test="@rend">
-	              <xsl:attribute name="class">
-		                <xsl:value-of select="@rend"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element actor</desc>
+	</doc>
+	<xsl:template match="tei:actor">
+		<span class="actor">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element camera</desc>
+	</doc>
+	<xsl:template match="tei:camera">
+		<span class="camera">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element caption</desc>
+	</doc>
+	<xsl:template match="tei:caption">
+		<span class="caption">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element castGroup</desc>
+	</doc>
+	<xsl:template match="tei:castGroup">
+		<ul>
+			<xsl:apply-templates />
+		</ul>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element castItem</desc>
+	</doc>
+	<xsl:template match="tei:castItem">
+		<li>
+			<xsl:apply-templates />
+		</li>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element castList</desc>
+	</doc>
+	<xsl:template match="tei:castList">
+		<xsl:if test="tei:head">
+			<p>
+				<em>
+					<xsl:for-each select="tei:head">
+						<xsl:apply-templates />
+					</xsl:for-each>
+				</em>
+			</p>
+		</xsl:if>
+		<ul>
+			<xsl:apply-templates />
+		</ul>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element castList/tei:head</desc>
+	</doc>
+	<xsl:template match="tei:castList/tei:head" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element role</desc>
+	</doc>
+	<xsl:template match="tei:role">
+		<span class="role">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element roleDesc</desc>
+	</doc>
+	<xsl:template match="tei:roleDesc">
+		<blockquote>
+			<xsl:choose>
+				<xsl:when test="@rend">
+					<xsl:attribute name="class">
+		                <xsl:value-of select="@rend" />
 	              </xsl:attribute>
-	           </xsl:when>
-	           <xsl:when test="@rendition">
-		             <xsl:call-template name="applyRendition"/>
-	           </xsl:when>
-	           <xsl:otherwise>
-	              <xsl:attribute name="class">
+				</xsl:when>
+				<xsl:when test="@rendition">
+					<xsl:call-template name="applyRendition" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="class">
 		                <xsl:text>roleDesc</xsl:text>
 	              </xsl:attribute>
-	           </xsl:otherwise>
-	        </xsl:choose>
-         <xsl:choose>
-            <xsl:when test="tei:p">
-               <xsl:apply-templates/>
-            </xsl:when>
-            <xsl:otherwise>
-               <p>
-                  <xsl:apply-templates/>
-               </p>
-            </xsl:otherwise>
-         </xsl:choose>
-      </blockquote>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element set</desc>
-   </doc>
-  <xsl:template match="tei:set">
-      <span class="set">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element sound</desc>
-   </doc>
-  <xsl:template match="tei:sound">
-      <span class="sound">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process element sp</p>
-         <p>
-            <p xmlns="http://www.w3.org/1999/xhtml"> elaborated by Nick Nicholas &lt;nicholas@uci.edu&gt;, March
-        2001 </p>
-         </p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:sp">
-    <div class="speaker">
-      <xsl:call-template name="makeAnchor"/>
-      <xsl:apply-templates select="tei:speaker"/>
-    </div>
-    <xsl:apply-templates select="tei:*[not(self::tei:speaker)]"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element sp/tei:p</desc>
-   </doc>
-  <xsl:template match="tei:sp/tei:p">
-    <xsl:choose>
-      <xsl:when test="$filePerPage='true'">
-	<xsl:for-each-group select="node()" group-starting-with="tei:pb">
-	  <xsl:choose>
-	    <xsl:when test="self::tei:pb">
-	      <xsl:apply-templates select="."/>
-	      <div>
-		<xsl:for-each select="..">
-		  <xsl:call-template name="rendToClass">      
-		    <xsl:with-param name="default">p-in-sp</xsl:with-param>
-		    <xsl:with-param name="id">
-		      <xsl:choose>
-			<xsl:when test="@xml:id">
-			  <xsl:value-of select="@xml:id"/>
-			  <xsl:text>continued</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="tei:p">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<p>
+						<xsl:apply-templates />
+					</p>
+				</xsl:otherwise>
+			</xsl:choose>
+		</blockquote>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element set</desc>
+	</doc>
+	<xsl:template match="tei:set">
+		<span class="set">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element sound</desc>
+	</doc>
+	<xsl:template match="tei:sound">
+		<span class="sound">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element sp</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> elaborated by Nick Nicholas &lt;nicholas@uci.edu&gt;,
+					March
+					2001
+				</p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:sp">
+		<div class="speaker">
+			<xsl:call-template name="makeAnchor" />
+			<xsl:apply-templates select="tei:speaker" />
+		</div>
+		<xsl:apply-templates
+			select="tei:*[not(self::tei:speaker)]" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element sp/tei:p</desc>
+	</doc>
+	<xsl:template match="tei:sp/tei:p">
+		<xsl:choose>
+			<xsl:when test="$filePerPage='true'">
+				<xsl:for-each-group select="node()"
+					group-starting-with="tei:pb">
+					<xsl:choose>
+						<xsl:when test="self::tei:pb">
+							<xsl:apply-templates select="." />
+							<div>
+								<xsl:for-each select="..">
+									<xsl:call-template name="rendToClass">
+										<xsl:with-param name="default">
+											p-in-sp
+										</xsl:with-param>
+										<xsl:with-param name="id">
+											<xsl:choose>
+												<xsl:when test="@xml:id">
+													<xsl:value-of select="@xml:id" />
+													<xsl:text>continued</xsl:text>
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:text>false</xsl:text>
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:for-each>
+								<xsl:apply-templates
+									select="current-group() except ." />
+							</div>
+						</xsl:when>
+						<xsl:otherwise>
+							<div>
+								<xsl:for-each select="..">
+									<xsl:call-template name="rendToClass">
+										<xsl:with-param name="default">
+											p-in-sp
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:for-each>
+								<xsl:apply-templates
+									select="current-group()" />
+							</div>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each-group>
 			</xsl:when>
 			<xsl:otherwise>
-			  <xsl:text>false</xsl:text>
+				<div>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default">
+							p-in-sp
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:apply-templates />
+				</div>
 			</xsl:otherwise>
-		      </xsl:choose>
-		    </xsl:with-param>
-		  </xsl:call-template>
-		</xsl:for-each>
-		<xsl:apply-templates select="current-group() except ."/>
-	      </div>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <div>
-		<xsl:for-each select="..">
-		  <xsl:call-template name="rendToClass">      
-		    <xsl:with-param name="default">p-in-sp</xsl:with-param>
-		  </xsl:call-template>
-		</xsl:for-each>
-		<xsl:apply-templates select="current-group()"/>
-	      </div>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</xsl:for-each-group>
-      </xsl:when>
-      <xsl:otherwise>
-	<div>
-	  <xsl:call-template name="rendToClass">      
-	    <xsl:with-param name="default">p-in-sp</xsl:with-param>
-	  </xsl:call-template>
-	  <xsl:apply-templates/>
-	</div>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element stage</desc>
-   </doc>
-  <xsl:template match="tei:stage">
-    <xsl:element name="{if (tei:blockContext(.) or *[not(tei:is-inline(.))]) then 'div' else 'span' }">
-      <xsl:call-template name="rendToClass">
-	<xsl:with-param name="default">
-	  <xsl:choose>
-	    <xsl:when
-		test="ancestor::tei:text/@rend='firstfolio'">stage</xsl:when>
-	    <xsl:otherwise>stage it</xsl:otherwise>
-	  </xsl:choose>
-	</xsl:with-param>
-      </xsl:call-template>
-      <xsl:apply-templates/>
-    </xsl:element>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element stage</desc>
+	</doc>
+	<xsl:template match="tei:stage">
+		<xsl:element
+			name="{if (tei:blockContext(.) or *[not(tei:is-inline(.))]) then 'div' else 'span' }">
+			<xsl:call-template name="rendToClass">
+				<xsl:with-param name="default">
+					<xsl:choose>
+						<xsl:when test="ancestor::tei:text/@rend='firstfolio'">
+							stage
+						</xsl:when>
+						<xsl:otherwise>
+							stage it
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element tech</desc>
-   </doc>
-  <xsl:template match="tei:tech">
-      <span class="tech">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element view</desc>
-   </doc>
-  <xsl:template match="tei:view">
-      <span class="view">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element tech</desc>
+	</doc>
+	<xsl:template match="tei:tech">
+		<span class="tech">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element view</desc>
+	</doc>
+	<xsl:template match="tei:view">
+		<span class="view">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/namesdates.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/namesdates.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/namesdates.xsl	(revision 2397)
@@ -1,73 +1,77 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:html="http://www.w3.org/1999/xhtml"
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
 
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fo rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the namesdates module,
-      making HTML output. </p>
-         <p>This software is dual-licensed:
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the namesdates module,
+				making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: namesdates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <xsl:template match="tei:listPerson">
-      <ul>
-         <xsl:apply-templates/>
-      </ul>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template match="tei:person">
-      <li>
-         <xsl:apply-templates/>
-      </li>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: namesdates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:template match="tei:affiliation">
-      <br/>
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:listPerson">
+		<ul>
+			<xsl:apply-templates />
+		</ul>
+	</xsl:template>
 
+	<xsl:template match="tei:person">
+		<li>
+			<xsl:apply-templates />
+		</li>
+	</xsl:template>
+
+	<xsl:template match="tei:affiliation">
+		<br />
+		<xsl:apply-templates />
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tagdocs.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tagdocs.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/tagdocs.xsl	(revision 2397)
@@ -1,59 +1,77 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet  xmlns:s="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/1999/xhtml" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="s html a fo rng tei teix" version="2.0">
+<xsl:stylesheet
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="s html a fo rng tei teix" version="2.0">
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet dealing with elements from the tagdocs module,
-      making HTML output. </p>
-      <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the tagdocs module,
+				making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: tagdocs.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process elements teix:egXML</desc>
-  </doc>
-  <xsl:template match="teix:egXML">
-    <xsl:param name="simple">false</xsl:param>
-    <xsl:param name="highlight"/>
-    <div>
-      <xsl:attribute name="id">
-        <xsl:apply-templates mode="ident" select="."/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tagdocs.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements teix:egXML</desc>
+	</doc>
+	<xsl:template match="teix:egXML">
+		<xsl:param name="simple">
+			false
+		</xsl:param>
+		<xsl:param name="highlight" />
+		<div>
+			<xsl:attribute name="id">
+        <xsl:apply-templates mode="ident"
+				select="." />
       </xsl:attribute>
-      <xsl:attribute name="class">
+			<xsl:attribute name="class">
 	<xsl:text>pre</xsl:text>
 	<xsl:if test="not(*)">
 	  <xsl:text> cdata</xsl:text>
@@ -70,53 +88,53 @@
 	  </xsl:otherwise>
 	</xsl:choose>
       </xsl:attribute>
-      <xsl:choose>
-        <xsl:when test="$simple='true'">
-          <xsl:apply-templates mode="verbatim">
-            <xsl:with-param name="highlight">
-              <xsl:value-of select="$highlight"/>
-            </xsl:with-param>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="egXMLStartHook"/>
-          <xsl:apply-templates mode="verbatim">
-            <xsl:with-param name="highlight">
-              <xsl:value-of select="$highlight"/>
-            </xsl:with-param>
-          </xsl:apply-templates>
-          <xsl:call-template name="egXMLEndHook"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </div>
-  </xsl:template>
+			<xsl:choose>
+				<xsl:when test="$simple='true'">
+					<xsl:apply-templates mode="verbatim">
+						<xsl:with-param name="highlight">
+							<xsl:value-of select="$highlight" />
+						</xsl:with-param>
+					</xsl:apply-templates>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="egXMLStartHook" />
+					<xsl:apply-templates mode="verbatim">
+						<xsl:with-param name="highlight">
+							<xsl:value-of select="$highlight" />
+						</xsl:with-param>
+					</xsl:apply-templates>
+					<xsl:call-template name="egXMLEndHook" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</div>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element ident</desc>
-  </doc>
-  <xsl:template match="tei:ident">
-    <xsl:choose>
-      <xsl:when test="@type">
-        <span class="ident-{@type}">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <span class="ident">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element ident</desc>
+	</doc>
+	<xsl:template match="tei:ident">
+		<xsl:choose>
+			<xsl:when test="@type">
+				<span class="ident-{@type}">
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="ident">
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element gi</desc>
-  </doc>
-  <xsl:template match="tei:gi">
-    <span class="gi">
-      <xsl:text>&lt;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>&gt;</xsl:text>
-    </span>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element gi</desc>
+	</doc>
+	<xsl:template match="tei:gi">
+		<span class="gi">
+			<xsl:text>&lt;</xsl:text>
+			<xsl:apply-templates />
+			<xsl:text>&gt;</xsl:text>
+		</span>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/core.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/core.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/core.xsl	(revision 2397)
@@ -1,779 +1,832 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" exclude-result-prefixes="a fo html rng tei teix teidocx" version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet dealing with elements from the core module, making
-      HTML output. </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	exclude-result-prefixes="a fo html rng tei teix teidocx" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module, making
+				HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: core.xsl 10058 2012-01-22 12:51:37Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process elements tei:*</p>
-      <p>
-        <p xmlns="http://www.w3.org/1999/xhtml"> anything with a head can go in the TOC </p>
-      </p>
-      <param name="forcedepth">forcedepth</param>
-    </desc>
-  </doc>
-  <xsl:template match="tei:*" mode="maketoc">
-    <xsl:param name="forcedepth"/>
-    <xsl:variable name="myName">
-      <xsl:value-of select="local-name(.)"/>
-    </xsl:variable>
-    <xsl:if test="tei:head or $autoHead='true'">
-      <xsl:variable name="Depth">
-        <xsl:choose>
-          <xsl:when test="not($forcedepth='')">
-            <xsl:value-of select="$forcedepth"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="$tocDepth"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="thislevel">
-        <xsl:choose>
-          <xsl:when test="$myName = 'div'">
-            <xsl:value-of select="count(ancestor::tei:div)"/>
-          </xsl:when>
-          <xsl:when test="starts-with($myName,'div')">
-            <xsl:value-of select="number(substring-after($myName,'div')) - 1"/>
-          </xsl:when>
-          <xsl:otherwise>99</xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="pointer">
-        <xsl:apply-templates mode="generateLink" select="."/>
-      </xsl:variable>
-      <li>
-        <xsl:attribute name="class">
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: core.xsl 10058 2012-01-22 12:51:37Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process elements tei:*</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> anything with a head can go in the TOC </p>
+			</p>
+			<param name="forcedepth">forcedepth</param>
+		</desc>
+	</doc>
+	<xsl:template match="tei:*" mode="maketoc">
+		<xsl:param name="forcedepth" />
+		<xsl:variable name="myName">
+			<xsl:value-of select="local-name(.)" />
+		</xsl:variable>
+		<xsl:if test="tei:head or $autoHead='true'">
+			<xsl:variable name="Depth">
+				<xsl:choose>
+					<xsl:when test="not($forcedepth='')">
+						<xsl:value-of select="$forcedepth" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$tocDepth" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:variable name="thislevel">
+				<xsl:choose>
+					<xsl:when test="$myName = 'div'">
+						<xsl:value-of select="count(ancestor::tei:div)" />
+					</xsl:when>
+					<xsl:when test="starts-with($myName,'div')">
+						<xsl:value-of
+							select="number(substring-after($myName,'div')) - 1" />
+					</xsl:when>
+					<xsl:otherwise>
+						99
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:variable name="pointer">
+				<xsl:apply-templates mode="generateLink"
+					select="." />
+			</xsl:variable>
+			<li>
+				<xsl:attribute name="class">
           <xsl:text>toc</xsl:text>
-          <xsl:if test="not($autoHead='true') and not(tei:head or @n)"> headless</xsl:if>
+          <xsl:if
+					test="not($autoHead='true') and not(tei:head or @n)"> headless</xsl:if>
         </xsl:attribute>
-        <xsl:call-template name="header">
-          <xsl:with-param name="toc" select="$pointer"/>
-          <xsl:with-param name="minimal">false</xsl:with-param>
-          <xsl:with-param name="display">plain</xsl:with-param>
-        </xsl:call-template>
-        <xsl:if test="$thislevel &lt; $Depth">
-          <xsl:call-template name="continuedToc"/>
-        </xsl:if>
-      </li>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element ab</desc>
-  </doc>
-  <xsl:template match="tei:ab">
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:head or parent::tei:title or parent::tei:stage">
-        <xsl:apply-templates/>
-        <xsl:if test="following-sibling::tei:ab">
-          <br/>
-        </xsl:if>
-      </xsl:when>
-      <xsl:when test="parent::tei:sp">
-        <div>
-          <xsl:call-template name="rendToClass">
-            <xsl:with-param name="default">spProse</xsl:with-param>
-          </xsl:call-template>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:otherwise>
-        <div>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element addrLine</desc>
-  </doc>
-  <xsl:template match="tei:addrLine">
-    <xsl:apply-templates/>
-    <br/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element address</desc>
-  </doc>
-  <xsl:template match="tei:address">
-    <address>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:apply-templates/>
-    </address>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element argument</desc>
-  </doc>
-  <xsl:template match="tei:argument">
-    <div class="argument">
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element author</desc>
-  </doc>
-  <xsl:template match="tei:author">
-    <span>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:apply-imports/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element bibl</desc>
-  </doc>
-  <xsl:template match="tei:bibl">
-    <xsl:choose>
-      <xsl:when test="parent::tei:q/parent::tei:head or parent::tei:q[@rend='inline']">
-        <span class="citbibl">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:when test="parent::tei:cit | parent::tei:q">
-        <div class="citbibl">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="tei:blockContext(.)">
-        <div class="biblfree">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:otherwise>
-        <span>
-          <xsl:attribute name="class">
+				<xsl:call-template name="header">
+					<xsl:with-param name="toc" select="$pointer" />
+					<xsl:with-param name="minimal">
+						false
+					</xsl:with-param>
+					<xsl:with-param name="display">
+						plain
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if test="$thislevel &lt; $Depth">
+					<xsl:call-template name="continuedToc" />
+				</xsl:if>
+			</li>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element ab</desc>
+	</doc>
+	<xsl:template match="tei:ab">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor::tei:head or parent::tei:title or parent::tei:stage">
+				<xsl:apply-templates />
+				<xsl:if test="following-sibling::tei:ab">
+					<br />
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="parent::tei:sp">
+				<div>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default">
+							spProse
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:otherwise>
+				<div>
+					<xsl:call-template name="rendToClass" />
+					<xsl:apply-templates />
+				</div>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element addrLine</desc>
+	</doc>
+	<xsl:template match="tei:addrLine">
+		<xsl:apply-templates />
+		<br />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element address</desc>
+	</doc>
+	<xsl:template match="tei:address">
+		<address>
+			<xsl:call-template name="rendToClass" />
+			<xsl:apply-templates />
+		</address>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element argument</desc>
+	</doc>
+	<xsl:template match="tei:argument">
+		<div class="argument">
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element author</desc>
+	</doc>
+	<xsl:template match="tei:author">
+		<span>
+			<xsl:call-template name="rendToClass" />
+			<xsl:apply-imports />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element bibl</desc>
+	</doc>
+	<xsl:template match="tei:bibl">
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:q/parent::tei:head or parent::tei:q[@rend='inline']">
+				<span class="citbibl">
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:when test="parent::tei:cit | parent::tei:q">
+				<div class="citbibl">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="tei:blockContext(.)">
+				<div class="biblfree">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:otherwise>
+				<span>
+					<xsl:attribute name="class">
             <xsl:text>bibl</xsl:text>
             <xsl:if test="@type">
               <xsl:text> bibl-</xsl:text>
-              <xsl:value-of select="@type"/>
+              <xsl:value-of select="@type" />
             </xsl:if>
           </xsl:attribute>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element change</desc>
-  </doc>
-  <xsl:template match="tei:change">
-    <tr>
-      <td style="vertical-align:top;" width="15%">
-        <xsl:value-of select="tei:date"/>
-      </td>
-      <td width="85%">
-        <xsl:value-of select="tei:item"/>
-      </td>
-    </tr>
-  </xsl:template>
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element change</desc>
+	</doc>
+	<xsl:template match="tei:change">
+		<tr>
+			<td style="vertical-align:top;" width="15%">
+				<xsl:value-of select="tei:date" />
+			</td>
+			<td width="85%">
+				<xsl:value-of select="tei:item" />
+			</td>
+		</tr>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element choice</desc>
-  </doc>
-  <xsl:template match="tei:choice">
-    <xsl:choose>
-      <xsl:when test="tei:abbr and tei:expan">
-        <xsl:apply-templates select="tei:expan"/>
-        <xsl:text> (</xsl:text>
-        <xsl:apply-templates select="tei:abbr"/>
-        <xsl:text>)</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element choice in plain mode - selects "critical" reading.</desc>
-  </doc>
-  <xsl:template match="tei:choice" mode="plain">
-    <xsl:value-of select="tei:reg"/>
-    <xsl:value-of select="tei:expan"/>
-    <xsl:value-of select="tei:corr"/>
-    <xsl:apply-templates select="tei:choice"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element choice</desc>
-  </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process element cit</p>
-      <p>
-        <p xmlns="http://www.w3.org/1999/xhtml"> quoting </p>
-      </p>
-    </desc>
-  </doc>
-  <xsl:template match="tei:cit">
-    <xsl:choose>
-      <xsl:when test="@rend='display' and tei:quote">
-        <div>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:if test="@n">
-            <xsl:text>(</xsl:text>
-            <xsl:value-of select="@n"/>
-            <xsl:text>) </xsl:text>
-          </xsl:if>
-          <xsl:apply-templates select="tei:q|tei:quote"/>
-          <xsl:apply-templates select="tei:*[not(self::tei:q or self::tei:quote)]"/>
-        </div>
-      </xsl:when>
-      <xsl:when test="@rend='display'">
-        <blockquote>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:variable name="contents">
-            <xsl:if test="@n">
-              <xsl:text>(</xsl:text>
-              <xsl:value-of select="@n"/>
-              <xsl:text>) </xsl:text>
-            </xsl:if>
-            <xsl:apply-templates select="tei:q|tei:quote"/>
-            <xsl:apply-templates select="tei:*[not(self::tei:q or self::tei:quote)]"/>
-          </xsl:variable>
-          <xsl:choose>
-            <xsl:when test="$outputTarget='html5'">
-              <xsl:copy-of select="$contents"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <p>
-                <xsl:copy-of select="$contents"/>
-              </p>
-            </xsl:otherwise>
-          </xsl:choose>
-        </blockquote>
-      </xsl:when>
-      <xsl:when test="tei:bibl">
-        <div>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:if test="@n">
-            <xsl:text>(</xsl:text>
-            <xsl:value-of select="@n"/>
-            <xsl:text>) </xsl:text>
-          </xsl:if>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:otherwise>
-        <span>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:if test="@n">
-            <xsl:text>(</xsl:text>
-            <xsl:value-of select="@n"/>
-            <xsl:text>) </xsl:text>
-          </xsl:if>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element code</desc>
-  </doc>
-  <xsl:template match="tei:code">
-    <code>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:apply-templates/>
-    </code>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-    Does not do anything yet.
-  </desc>
-  </doc>
-  <xsl:template match="tei:corr">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Decorate date</desc>
-  </doc>
-  <xsl:template match="tei:date">
-    <span>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:apply-imports/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>The del element</desc>
-  </doc>
-  <xsl:template match="tei:del">
-    <del>
-      <xsl:apply-templates/>
-    </del>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element eg</desc>
-  </doc>
-  <xsl:template match="tei:eg">
-    <div>
-      <xsl:if test="$cssFile">
-        <xsl:attribute name="class">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element choice</desc>
+	</doc>
+	<xsl:template match="tei:choice">
+		<xsl:choose>
+			<xsl:when test="tei:abbr and tei:expan">
+				<xsl:apply-templates select="tei:expan" />
+				<xsl:text> (</xsl:text>
+				<xsl:apply-templates select="tei:abbr" />
+				<xsl:text>)</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element choice in plain mode - selects "critical"
+			reading.</desc>
+	</doc>
+	<xsl:template match="tei:choice" mode="plain">
+		<xsl:value-of select="tei:reg" />
+		<xsl:value-of select="tei:expan" />
+		<xsl:value-of select="tei:corr" />
+		<xsl:apply-templates select="tei:choice" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element choice</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element cit</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> quoting </p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:cit">
+		<xsl:choose>
+			<xsl:when test="@rend='display' and tei:quote">
+				<div>
+					<xsl:call-template name="rendToClass" />
+					<xsl:if test="@n">
+						<xsl:text>(</xsl:text>
+						<xsl:value-of select="@n" />
+						<xsl:text>) </xsl:text>
+					</xsl:if>
+					<xsl:apply-templates select="tei:q|tei:quote" />
+					<xsl:apply-templates
+						select="tei:*[not(self::tei:q or self::tei:quote)]" />
+				</div>
+			</xsl:when>
+			<xsl:when test="@rend='display'">
+				<blockquote>
+					<xsl:call-template name="rendToClass" />
+					<xsl:variable name="contents">
+						<xsl:if test="@n">
+							<xsl:text>(</xsl:text>
+							<xsl:value-of select="@n" />
+							<xsl:text>) </xsl:text>
+						</xsl:if>
+						<xsl:apply-templates select="tei:q|tei:quote" />
+						<xsl:apply-templates
+							select="tei:*[not(self::tei:q or self::tei:quote)]" />
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="$outputTarget='html5'">
+							<xsl:copy-of select="$contents" />
+						</xsl:when>
+						<xsl:otherwise>
+							<p>
+								<xsl:copy-of select="$contents" />
+							</p>
+						</xsl:otherwise>
+					</xsl:choose>
+				</blockquote>
+			</xsl:when>
+			<xsl:when test="tei:bibl">
+				<div>
+					<xsl:call-template name="rendToClass" />
+					<xsl:if test="@n">
+						<xsl:text>(</xsl:text>
+						<xsl:value-of select="@n" />
+						<xsl:text>) </xsl:text>
+					</xsl:if>
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:otherwise>
+				<span>
+					<xsl:call-template name="rendToClass" />
+					<xsl:if test="@n">
+						<xsl:text>(</xsl:text>
+						<xsl:value-of select="@n" />
+						<xsl:text>) </xsl:text>
+					</xsl:if>
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element code</desc>
+	</doc>
+	<xsl:template match="tei:code">
+		<code>
+			<xsl:call-template name="rendToClass" />
+			<xsl:apply-templates />
+		</code>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Does not do anything yet.
+		</desc>
+	</doc>
+	<xsl:template match="tei:corr">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Decorate date</desc>
+	</doc>
+	<xsl:template match="tei:date">
+		<span>
+			<xsl:call-template name="rendToClass" />
+			<xsl:apply-imports />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>The del element</desc>
+	</doc>
+	<xsl:template match="tei:del">
+		<del>
+			<xsl:apply-templates />
+		</del>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element eg</desc>
+	</doc>
+	<xsl:template match="tei:eg">
+		<div>
+			<xsl:if test="$cssFile">
+				<xsl:attribute name="class">
           <xsl:text>pre_eg</xsl:text>
           <xsl:if test="not(*)">
             <xsl:text> cdata</xsl:text>
           </xsl:if>
         </xsl:attribute>
-      </xsl:if>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element emph</desc>
-  </doc>
-  <xsl:template match="tei:emph">
-    <xsl:choose>
-      <xsl:when test="@rend">
-        <xsl:call-template name="rendering"/>
-      </xsl:when>
-      <xsl:when test="@rendition">
-        <span>
-	  <xsl:call-template name="applyRendition"/>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <em>
-          <xsl:apply-templates/>
-        </em>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element epigraph</desc>
-  </doc>
-  <xsl:template match="tei:epigraph">
-    <div>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element epigraph/lg</desc>
-  </doc>
-  <xsl:template match="tei:epigraph/tei:lg">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element foreign and unclear</desc>
-  </doc>
-  <xsl:template match="tei:foreign|tei:unclear">
-    <span>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:apply-templates/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element caesura</desc>
-  </doc>
-  <xsl:template match="tei:caesura">
-    <span class="caesura">    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element gap</desc>
-  </doc>
-  <xsl:template match="tei:gap">
-    <xsl:element name="{if (tei:blockContext(.)) then 'div' else 'span'}">
-      <xsl:attribute name="class">gap</xsl:attribute>
-      <xsl:if test="tei:desc">
-        <xsl:attribute name="title">
-          <xsl:value-of select="tei:desc"/>
+			</xsl:if>
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element emph</desc>
+	</doc>
+	<xsl:template match="tei:emph">
+		<xsl:choose>
+			<xsl:when test="@rend">
+				<xsl:call-template name="rendering" />
+			</xsl:when>
+			<xsl:when test="@rendition">
+				<span>
+					<xsl:call-template name="applyRendition" />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<em>
+					<xsl:apply-templates />
+				</em>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element epigraph</desc>
+	</doc>
+	<xsl:template match="tei:epigraph">
+		<div>
+			<xsl:call-template name="rendToClass" />
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element epigraph/lg</desc>
+	</doc>
+	<xsl:template match="tei:epigraph/tei:lg">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element foreign and unclear</desc>
+	</doc>
+	<xsl:template match="tei:foreign|tei:unclear">
+		<span>
+			<xsl:call-template name="rendToClass" />
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element caesura</desc>
+	</doc>
+	<xsl:template match="tei:caesura">
+		<span class="caesura">    </span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element gap</desc>
+	</doc>
+	<xsl:template match="tei:gap">
+		<xsl:element
+			name="{if (tei:blockContext(.)) then 'div' else 'span'}">
+			<xsl:attribute name="class">gap</xsl:attribute>
+			<xsl:if test="tei:desc">
+				<xsl:attribute name="title">
+          <xsl:value-of select="tei:desc" />
         </xsl:attribute>
-      </xsl:if>
-      <xsl:choose>
-        <xsl:when test="starts-with(@rend,'content:')">
-          <xsl:value-of select="substring-after(@rend,'content:')"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:text> [...]</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process element att</p>
-      <p>
-        <p xmlns="http://www.w3.org/1999/xhtml"> special purpose </p>
-      </p>
-    </desc>
-  </doc>
-  <xsl:template match="tei:att">
-    <span class="gi">
-      <b>@<xsl:apply-templates/>
-         </b>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process gloss element</desc>
-  </doc>
-  <xsl:template match="tei:gloss">
-    <span class="gloss">
-      <xsl:apply-templates/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process element head</p>
-      <p xmlns="http://www.w3.org/1999/xhtml"> headings etc </p>
-    </desc>
-  </doc>
-  <xsl:template match="tei:head">
-    <xsl:variable name="parent" select="local-name(..)"/>
-    <xsl:choose>
-      <xsl:when test="parent::tei:group or parent::tei:body or parent::tei:front or parent::tei:back">
-        <h1>
-          <xsl:apply-templates/>
-        </h1>
-      </xsl:when>
-      <xsl:when test="parent::tei:argument">
-        <div>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="not(starts-with($parent,'div'))">
-        <xsl:apply-templates/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element head in plain mode</desc>
-  </doc>
-  <xsl:template match="tei:head" mode="plain">
-    <xsl:if test="preceding-sibling::tei:head">
-      <xsl:text> </xsl:text>
-    </xsl:if>
-    <xsl:apply-templates mode="plain"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element head in heading mode</desc>
-  </doc>
-  <xsl:template match="tei:head" mode="makeheading">
-    <xsl:if test="preceding-sibling::tei:head">
-      <br/>
-    </xsl:if>
-    <span>
-      <xsl:call-template name="rendToClass">
-        <xsl:with-param name="id">false</xsl:with-param>
-      </xsl:call-template>
-      <xsl:apply-templates/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element hi</desc>
-  </doc>
-  <xsl:template match="tei:hi">
-    <xsl:choose>
-      <xsl:when test="@rend">
-        <xsl:call-template name="rendering"/>
-      </xsl:when>
-      <xsl:when test="@rendition">
-        <span>
-          <xsl:call-template name="applyRendition"/>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:when test="key('TAGREND','hi')">
-        <span>
-          <xsl:attribute name="class">
-            <xsl:for-each select="key('TAGREND',local-name())">
+			</xsl:if>
+			<xsl:choose>
+				<xsl:when test="starts-with(@rend,'content:')">
+					<xsl:value-of
+						select="substring-after(@rend,'content:')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text> [...]</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element att</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> special purpose </p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:att">
+		<span class="gi">
+			<b>
+				@
+				<xsl:apply-templates />
+			</b>
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process gloss element</desc>
+	</doc>
+	<xsl:template match="tei:gloss">
+		<span class="gloss">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element head</p>
+			<p xmlns="http://www.w3.org/1999/xhtml"> headings etc </p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:head">
+		<xsl:variable name="parent" select="local-name(..)" />
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:group or parent::tei:body or parent::tei:front or parent::tei:back">
+				<h1>
+					<xsl:apply-templates />
+				</h1>
+			</xsl:when>
+			<xsl:when test="parent::tei:argument">
+				<div>
+					<xsl:call-template name="rendToClass" />
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="not(starts-with($parent,'div'))">
+				<xsl:apply-templates />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element head in plain mode</desc>
+	</doc>
+	<xsl:template match="tei:head" mode="plain">
+		<xsl:if test="preceding-sibling::tei:head">
+			<xsl:text> </xsl:text>
+		</xsl:if>
+		<xsl:apply-templates mode="plain" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element head in heading mode</desc>
+	</doc>
+	<xsl:template match="tei:head" mode="makeheading">
+		<xsl:if test="preceding-sibling::tei:head">
+			<br />
+		</xsl:if>
+		<span>
+			<xsl:call-template name="rendToClass">
+				<xsl:with-param name="id">
+					false
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element hi</desc>
+	</doc>
+	<xsl:template match="tei:hi">
+		<xsl:choose>
+			<xsl:when test="@rend">
+				<xsl:call-template name="rendering" />
+			</xsl:when>
+			<xsl:when test="@rendition">
+				<span>
+					<xsl:call-template name="applyRendition" />
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:when test="key('TAGREND','hi')">
+				<span>
+					<xsl:attribute name="class">
+            <xsl:for-each
+						select="key('TAGREND',local-name())">
               <xsl:call-template name="findRendition">
                 <xsl:with-param name="value">
-                  <xsl:value-of select="@render"/>
+                  <xsl:value-of select="@render" />
                 </xsl:with-param>
               </xsl:call-template>
             </xsl:for-each>
           </xsl:attribute>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <span class="hi">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element item</desc>
-  </doc>
-  <xsl:template match="tei:item" mode="bibl">
-    <p>
-      <xsl:call-template name="makeAnchor"/>
-      <xsl:apply-templates/>
-    </p>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element item</desc>
-  </doc>
-  <xsl:template match="tei:item" mode="glosstable">
-    <tr>
-      <td style="vertical-align:top;">
-        <strong>
-          <xsl:apply-templates mode="print" select="preceding-sibling::tei:*[1]"/>
-        </strong>
-      </td>
-      <td>
-        <xsl:call-template name="makeAnchor"/>
-        <xsl:apply-templates/>
-      </td>
-    </tr>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element item</desc>
-  </doc>
-  <xsl:template match="tei:item" mode="gloss">
-    <dt>
-      <xsl:call-template name="makeAnchor"/>
-      <xsl:apply-templates mode="print" select="preceding-sibling::tei:label[1]"/>
-    </dt>
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element item</desc>
-  </doc>
-  <xsl:template match="tei:item">
-    <li>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:choose>
-        <xsl:when test="@xml:id">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name">
-              <xsl:value-of select="@xml:id"/>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:when>
-        <xsl:when test="$generateParagraphIDs='true'">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name">
-              <xsl:value-of select="generate-id()"/>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:when>
-      </xsl:choose>
-      <xsl:apply-templates/>
-    </li>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element item</desc>
-  </doc>
-  <xsl:template match="tei:item" mode="inline">
-    <xsl:if test="preceding-sibling::tei:item">, </xsl:if>
-    <xsl:if test="not(following-sibling::tei:item) and preceding-sibling::tei:item">
-      and </xsl:if>
-    <xsl:text>• </xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element item/tei:label</desc>
-  </doc>
-  <xsl:template match="tei:item/tei:label">
-    <xsl:choose>
-      <xsl:when test="@rend">
-        <xsl:call-template name="rendering"/>
-      </xsl:when>
-      <xsl:when test="@rendition">
-        <span>
-          <xsl:call-template name="applyRendition"/>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <strong>
-          <xsl:apply-templates/>
-        </strong>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element label</desc>
-  </doc>
-  <xsl:template match="tei:label">
-    <span>
-      <xsl:call-template name="makeAnchor"/>
-      <xsl:apply-templates/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element label</desc>
-  </doc>
-  <xsl:template match="tei:label" mode="print">
-    <span>
-      <xsl:call-template name="makeAnchor"/>
-      <xsl:choose>
-        <xsl:when test="@rend">
-          <xsl:call-template name="rendering"/>
-        </xsl:when>
-        <xsl:when test="@rendition">
-          <span>
-            <xsl:call-template name="applyRendition"/>
-            <xsl:apply-templates/>
-          </span>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element lb in plain mode</desc>
-  </doc>
-  <xsl:template match="tei:lb" mode="plain">
-    <xsl:text> </xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element lb</desc>
-  </doc>
-  <xsl:template match="tei:lb">
-    <xsl:choose>
-      <xsl:when test="parent::tei:body"/>
-      <xsl:when test="parent::tei:back"/>
-      <xsl:when test="parent::tei:front"/>
-      <xsl:when test="@type='hyphenInWord' and @rend='hidden'"/>
-      <xsl:when test="@rend='hidden'">
-        <xsl:text> </xsl:text>
-      </xsl:when>
-      <xsl:when test="@rend='-' or @type='hyphenInWord'">
-        <xsl:text>-</xsl:text>
-        <br/>
-      </xsl:when>
-      <xsl:when test="@rend='above'">
-        <xsl:text>⌜</xsl:text>
-      </xsl:when>
-      <xsl:when test="@rend='below'">
-        <xsl:text>⌞</xsl:text>
-      </xsl:when>
-      <xsl:when test="@rend">
-        <br class="{@rend}"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <br/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element l</desc>
-  </doc>
-  <xsl:template match="tei:l">
-    <xsl:element name="{if (ancestor::tei:head or ancestor::tei:hi) then 'span' else 'div'}">
-      <xsl:call-template name="rendToClass">
-        <xsl:with-param name="default">l</xsl:with-param>
-      </xsl:call-template>
-      <xsl:choose>
-        <xsl:when test="ancestor::tei:div[contains(@rend,'linenumber')]">
-          <xsl:variable name="n">
-            <xsl:number/>
-          </xsl:variable>
-          <div class="numbering">
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="hi">
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item</desc>
+	</doc>
+	<xsl:template match="tei:item" mode="bibl">
+		<p>
+			<xsl:call-template name="makeAnchor" />
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item</desc>
+	</doc>
+	<xsl:template match="tei:item" mode="glosstable">
+		<tr>
+			<td style="vertical-align:top;">
+				<strong>
+					<xsl:apply-templates mode="print"
+						select="preceding-sibling::tei:*[1]" />
+				</strong>
+			</td>
+			<td>
+				<xsl:call-template name="makeAnchor" />
+				<xsl:apply-templates />
+			</td>
+		</tr>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item</desc>
+	</doc>
+	<xsl:template match="tei:item" mode="gloss">
+		<dt>
+			<xsl:call-template name="makeAnchor" />
+			<xsl:apply-templates mode="print"
+				select="preceding-sibling::tei:label[1]" />
+		</dt>
+		<dd>
+			<xsl:apply-templates />
+		</dd>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item</desc>
+	</doc>
+	<xsl:template match="tei:item">
+		<li>
+			<xsl:call-template name="rendToClass" />
+			<xsl:choose>
+				<xsl:when test="@xml:id">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name">
+							<xsl:value-of select="@xml:id" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:when test="$generateParagraphIDs='true'">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name">
+							<xsl:value-of select="generate-id()" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:apply-templates />
+		</li>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item</desc>
+	</doc>
+	<xsl:template match="tei:item" mode="inline">
+		<xsl:if test="preceding-sibling::tei:item">
+			,
+		</xsl:if>
+		<xsl:if
+			test="not(following-sibling::tei:item) and preceding-sibling::tei:item">
+			and
+		</xsl:if>
+		<xsl:text>• </xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item/tei:label</desc>
+	</doc>
+	<xsl:template match="tei:item/tei:label">
+		<xsl:choose>
+			<xsl:when test="@rend">
+				<xsl:call-template name="rendering" />
+			</xsl:when>
+			<xsl:when test="@rendition">
+				<span>
+					<xsl:call-template name="applyRendition" />
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<strong>
+					<xsl:apply-templates />
+				</strong>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element label</desc>
+	</doc>
+	<xsl:template match="tei:label">
+		<span>
+			<xsl:call-template name="makeAnchor" />
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element label</desc>
+	</doc>
+	<xsl:template match="tei:label" mode="print">
+		<span>
+			<xsl:call-template name="makeAnchor" />
+			<xsl:choose>
+				<xsl:when test="@rend">
+					<xsl:call-template name="rendering" />
+				</xsl:when>
+				<xsl:when test="@rendition">
+					<span>
+						<xsl:call-template name="applyRendition" />
+						<xsl:apply-templates />
+					</span>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element lb in plain mode</desc>
+	</doc>
+	<xsl:template match="tei:lb" mode="plain">
+		<xsl:text> </xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element lb</desc>
+	</doc>
+	<xsl:template match="tei:lb">
+		<xsl:choose>
+			<xsl:when test="parent::tei:body" />
+			<xsl:when test="parent::tei:back" />
+			<xsl:when test="parent::tei:front" />
+			<xsl:when test="@type='hyphenInWord' and @rend='hidden'" />
+			<xsl:when test="@rend='hidden'">
+				<xsl:text> </xsl:text>
+			</xsl:when>
+			<xsl:when test="@rend='-' or @type='hyphenInWord'">
+				<xsl:text>-</xsl:text>
+				<br />
+			</xsl:when>
+			<xsl:when test="@rend='above'">
+				<xsl:text>⌜</xsl:text>
+			</xsl:when>
+			<xsl:when test="@rend='below'">
+				<xsl:text>⌞</xsl:text>
+			</xsl:when>
+			<xsl:when test="@rend">
+				<br class="{@rend}" />
+			</xsl:when>
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element l</desc>
+	</doc>
+	<xsl:template match="tei:l">
+		<xsl:element
+			name="{if (ancestor::tei:head or ancestor::tei:hi) then 'span' else 'div'}">
+			<xsl:call-template name="rendToClass">
+				<xsl:with-param name="default">
+					l
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:choose>
+				<xsl:when
+					test="ancestor::tei:div[contains(@rend,'linenumber')]">
+					<xsl:variable name="n">
+						<xsl:number />
+					</xsl:variable>
+					<div class="numbering">
+						<xsl:choose>
+							<xsl:when test="$n mod 5 = 0">
+								<xsl:value-of select="$n" />
+							</xsl:when>
+							<xsl:otherwise>
+								 
+							</xsl:otherwise>
+						</xsl:choose>
+					</div>
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element lg</desc>
+	</doc>
+	<xsl:template match="tei:lg">
+		<xsl:choose>
+			<xsl:when test="$filePerPage='true'">
+				<xsl:for-each-group select="node()"
+					group-starting-with="tei:pb">
+					<xsl:choose>
+						<xsl:when test="self::tei:pb">
+							<xsl:apply-templates select="." />
+							<div>
+								<xsl:for-each select="..">
+									<xsl:call-template name="rendToClass">
+										<xsl:with-param name="id">
+											<xsl:choose>
+												<xsl:when test="@xml:id">
+													<xsl:value-of select="@xml:id" />
+													<xsl:text>continued</xsl:text>
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:text>false</xsl:text>
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:for-each>
+								<xsl:apply-templates
+									select="current-group() except ." />
+							</div>
+						</xsl:when>
+						<xsl:otherwise>
+							<div>
+								<xsl:for-each select="..">
+									<xsl:call-template name="rendToClass" />
+								</xsl:for-each>
+								<xsl:apply-templates
+									select="current-group()" />
+							</div>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each-group>
+			</xsl:when>
+			<xsl:otherwise>
+				<div>
+					<xsl:call-template name="rendToClass" />
+					<xsl:apply-templates />
+				</div>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element lg/tei:l</desc>
+	</doc>
+	<xsl:template match="tei:lg/tei:l">
+		<div>
+			<xsl:choose>
+				<xsl:when test="@rend">
+					<xsl:attribute name="class">
             <xsl:choose>
-              <xsl:when test="$n mod 5 = 0">
-                <xsl:value-of select="$n"/>
-              </xsl:when>
-              <xsl:otherwise> </xsl:otherwise>
-            </xsl:choose>
-          </div>
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element lg</desc>
-  </doc>
-  <xsl:template match="tei:lg">
-    <xsl:choose>
-      <xsl:when test="$filePerPage='true'">
-        <xsl:for-each-group select="node()" group-starting-with="tei:pb">
-          <xsl:choose>
-            <xsl:when test="self::tei:pb">
-              <xsl:apply-templates select="."/>
-              <div>
-                <xsl:for-each select="..">
-                  <xsl:call-template name="rendToClass">
-                    <xsl:with-param name="id">
-                      <xsl:choose>
-                        <xsl:when test="@xml:id">
-                          <xsl:value-of select="@xml:id"/>
-                          <xsl:text>continued</xsl:text>
-                        </xsl:when>
-                        <xsl:otherwise>
-                          <xsl:text>false</xsl:text>
-                        </xsl:otherwise>
-                      </xsl:choose>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </xsl:for-each>
-                <xsl:apply-templates select="current-group() except ."/>
-              </div>
-            </xsl:when>
-            <xsl:otherwise>
-              <div>
-                <xsl:for-each select="..">
-                  <xsl:call-template name="rendToClass"/>
-                </xsl:for-each>
-                <xsl:apply-templates select="current-group()"/>
-              </div>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each-group>
-      </xsl:when>
-      <xsl:otherwise>
-        <div>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element lg/tei:l</desc>
-  </doc>
-  <xsl:template match="tei:lg/tei:l">
-    <div>
-      <xsl:choose>
-        <xsl:when test="@rend">
-          <xsl:attribute name="class">
-            <xsl:choose>
               <xsl:when test="@rend='Alignr'">
                 <xsl:text>right</xsl:text>
               </xsl:when>
@@ -782,1868 +835,2230 @@
               </xsl:when>
               <xsl:when test="starts-with(@rend,'indent(')">
                 <xsl:text>indent</xsl:text>
-                <xsl:value-of select="concat(substring-before(substring-after(@rend,'('),')'),'em')"/>
+                <xsl:value-of
+						select="concat(substring-before(substring-after(@rend,'('),')'),'em')" />
               </xsl:when>
               <xsl:when test="@rend='indent'">
                 <xsl:text>indent1</xsl:text>
               </xsl:when>
               <xsl:when test="@rend">
-                <xsl:value-of select="@rend"/>
+                <xsl:value-of select="@rend" />
               </xsl:when>
             </xsl:choose>
           </xsl:attribute>
-        </xsl:when>
-        <xsl:when test="@rendition">
-          <xsl:call-template name="applyRendition"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:attribute name="class">
-            <xsl:value-of select="local-name()"/>
+				</xsl:when>
+				<xsl:when test="@rendition">
+					<xsl:call-template name="applyRendition" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="class">
+            <xsl:value-of select="local-name()" />
           </xsl:attribute>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process element list</p>
-      <p>
-        <p xmlns="http://www.w3.org/1999/xhtml">Lists. Depending on the value of the 'type' attribute, various HTML
-        lists are generated: <dl><dt>bibl</dt><dd>Items are processed in mode 'bibl'</dd><dt>catalogue</dt><dd>A gloss list is created, inside a paragraph</dd><dt>gloss</dt><dd>A gloss list is created, expecting alternate label and item
-            elements</dd><dt>glosstable</dt><dd>Label and item pairs are laid out in a two-column table</dd><dt>inline</dt><dd>A comma-separate inline list</dd><dt>runin</dt><dd>An inline list with bullets between items</dd><dt>unordered</dt><dd>A simple unordered list</dd><dt>ordered</dt><dd>A simple ordered list</dd><dt>valList</dt><dd>(Identical to glosstable)</dd></dl>
-            </p>
-      </p>
-    </desc>
-  </doc>
-  <xsl:template match="tei:list">
-    <xsl:if test="tei:head">
-      <xsl:element name="{if (tei:blockContext(.)) then 'div' else 'span' }">
-        <xsl:attribute name="class">listhead</xsl:attribute>
-        <xsl:apply-templates select="tei:head"/>
-      </xsl:element>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="@type='catalogue'">
-        <p>
-          <dl>
-            <xsl:call-template name="rendToClass">
-              <xsl:with-param name="default"/>
-            </xsl:call-template>
-            <xsl:for-each select="tei:item">
-              <p/>
-              <xsl:apply-templates mode="gloss" select="."/>
-            </xsl:for-each>
-          </dl>
-        </p>
-      </xsl:when>
-      <xsl:when test="@type='gloss' and @rend='multicol'">
-        <xsl:variable name="nitems">
-          <xsl:value-of select="count(tei:item)div 2"/>
-        </xsl:variable>
-        <p>
-          <table>
-            <xsl:call-template name="rendToClass">
-              <xsl:with-param name="default"/>
-            </xsl:call-template>
-            <tr>
-              <td style="vertical-align:top;">
-                <dl>
-                  <xsl:apply-templates mode="gloss" select="tei:item[position()&lt;=$nitems ]"/>
-                </dl>
-              </td>
-              <td style="vertical-align:top;">
-                <dl>
-                  <xsl:apply-templates mode="gloss" select="tei:item[position() &gt;$nitems]"/>
-                </dl>
-              </td>
-            </tr>
-          </table>
-        </p>
-      </xsl:when>
-      <xsl:when test="@type='gloss' or  tei:label">
-        <dl>
-          <xsl:call-template name="rendToClass">
-            <xsl:with-param name="default"/>
-          </xsl:call-template>
-          <xsl:apply-templates mode="gloss" select="tei:item"/>
-        </dl>
-      </xsl:when>
-      <xsl:when test="@type='glosstable' or @type='valList'">
-        <table>
-          <xsl:call-template name="rendToClass">
-            <xsl:with-param name="default"/>
-          </xsl:call-template>
-          <xsl:apply-templates mode="glosstable" select="tei:item"/>
-        </table>
-      </xsl:when>
-      <xsl:when test="@type='inline' or ancestor::tei:head or parent::tei:label">
-        <!--<xsl:if test="not(tei:item)">None</xsl:if>-->
-        <xsl:apply-templates mode="inline" select="tei:item"/>
-      </xsl:when>
-      <xsl:when test="@type='runin'">
-        <p>
-          <xsl:apply-templates mode="runin" select="tei:item"/>
-        </p>
-      </xsl:when>
-      <xsl:when test="@type='unordered' or @type='simple'">
-        <ul>
-          <xsl:call-template name="rendToClass">
-            <xsl:with-param name="default"/>
-          </xsl:call-template>
-          <xsl:apply-templates select="tei:item"/>
-        </ul>
-      </xsl:when>
-      <xsl:when test="@type='bibl'">
-        <xsl:apply-templates mode="bibl" select="tei:item"/>
-      </xsl:when>
-      <xsl:when test="starts-with(@type,'ordered')">
-        <ol>
-          <xsl:call-template name="rendToClass">
-            <xsl:with-param name="default"/>
-          </xsl:call-template>
-          <xsl:if test="starts-with(@type,'ordered:')">
-            <xsl:attribute name="start">
-              <xsl:value-of select="substring-after(@type,':')"/>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element list</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml">
+					Lists. Depending on the value of the 'type' attribute, various HTML
+					lists are generated:
+					<dl>
+						<dt>bibl</dt>
+						<dd>Items are processed in mode 'bibl'</dd>
+						<dt>catalogue</dt>
+						<dd>A gloss list is created, inside a paragraph</dd>
+						<dt>gloss</dt>
+						<dd>A gloss list is created, expecting alternate label and item
+							elements</dd>
+						<dt>glosstable</dt>
+						<dd>Label and item pairs are laid out in a two-column table</dd>
+						<dt>inline</dt>
+						<dd>A comma-separate inline list</dd>
+						<dt>runin</dt>
+						<dd>An inline list with bullets between items</dd>
+						<dt>unordered</dt>
+						<dd>A simple unordered list</dd>
+						<dt>ordered</dt>
+						<dd>A simple ordered list</dd>
+						<dt>valList</dt>
+						<dd>(Identical to glosstable)</dd>
+					</dl>
+				</p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:list">
+		<xsl:if test="tei:head">
+			<xsl:element
+				name="{if (tei:blockContext(.)) then 'div' else 'span' }">
+				<xsl:attribute name="class">listhead</xsl:attribute>
+				<xsl:apply-templates select="tei:head" />
+			</xsl:element>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@type='catalogue'">
+				<p>
+					<dl>
+						<xsl:call-template name="rendToClass">
+							<xsl:with-param name="default" />
+						</xsl:call-template>
+						<xsl:for-each select="tei:item">
+							<p />
+							<xsl:apply-templates mode="gloss" select="." />
+						</xsl:for-each>
+					</dl>
+				</p>
+			</xsl:when>
+			<xsl:when test="@type='gloss' and @rend='multicol'">
+				<xsl:variable name="nitems">
+					<xsl:value-of select="count(tei:item)div 2" />
+				</xsl:variable>
+				<p>
+					<table>
+						<xsl:call-template name="rendToClass">
+							<xsl:with-param name="default" />
+						</xsl:call-template>
+						<tr>
+							<td style="vertical-align:top;">
+								<dl>
+									<xsl:apply-templates mode="gloss"
+										select="tei:item[position()&lt;=$nitems ]" />
+								</dl>
+							</td>
+							<td style="vertical-align:top;">
+								<dl>
+									<xsl:apply-templates mode="gloss"
+										select="tei:item[position() &gt;$nitems]" />
+								</dl>
+							</td>
+						</tr>
+					</table>
+				</p>
+			</xsl:when>
+			<xsl:when test="@type='gloss' or  tei:label">
+				<dl>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default" />
+					</xsl:call-template>
+					<xsl:apply-templates mode="gloss"
+						select="tei:item" />
+				</dl>
+			</xsl:when>
+			<xsl:when test="@type='glosstable' or @type='valList'">
+				<table>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default" />
+					</xsl:call-template>
+					<xsl:apply-templates mode="glosstable"
+						select="tei:item" />
+				</table>
+			</xsl:when>
+			<xsl:when
+				test="@type='inline' or ancestor::tei:head or parent::tei:label">
+				<!--<xsl:if test="not(tei:item)">None</xsl:if> -->
+				<xsl:apply-templates mode="inline"
+					select="tei:item" />
+			</xsl:when>
+			<xsl:when test="@type='runin'">
+				<p>
+					<xsl:apply-templates mode="runin"
+						select="tei:item" />
+				</p>
+			</xsl:when>
+			<xsl:when test="@type='unordered' or @type='simple'">
+				<ul>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default" />
+					</xsl:call-template>
+					<xsl:apply-templates select="tei:item" />
+				</ul>
+			</xsl:when>
+			<xsl:when test="@type='bibl'">
+				<xsl:apply-templates mode="bibl"
+					select="tei:item" />
+			</xsl:when>
+			<xsl:when test="starts-with(@type,'ordered')">
+				<ol>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default" />
+					</xsl:call-template>
+					<xsl:if test="starts-with(@type,'ordered:')">
+						<xsl:attribute name="start">
+              <xsl:value-of
+							select="substring-after(@type,':')" />
             </xsl:attribute>
-          </xsl:if>
-          <xsl:apply-templates select="tei:item"/>
-        </ol>
-      </xsl:when>
-      <xsl:otherwise>
-        <ul>
-          <xsl:call-template name="rendToClass">
-            <xsl:with-param name="default"/>
-          </xsl:call-template>
-          <xsl:apply-templates select="tei:item"/>
-        </ul>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element list/tei:label</desc>
-  </doc>
-  <xsl:template match="tei:list/tei:label"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element listBibl</desc>
-  </doc>
-  <xsl:template match="tei:listBibl">
-    <xsl:choose>
-      <xsl:when test="tei:biblStruct and $biblioStyle='mla'">
-	<div type="listBibl" xmlns="http://www.w3.org/1999/xhtml">	  
-	<xsl:for-each select="tei:biblStruct">
-	  <p class="hang" xmlns="http://www.w3.org/1999/xhtml">
-	    <xsl:apply-templates select="tei:analytic" mode="mla"/>
-	    <xsl:apply-templates select="tei:monogr" mode="mla"/>
-	    <xsl:apply-templates select="tei:relatedItem" mode="mla"/>
-	    <xsl:choose>
-	      <xsl:when test="tei:note">
-		<xsl:apply-templates select="tei:note"/>
-	      </xsl:when>
-	      <xsl:when test="*//tei:ref/@target and not(contains(*//tei:ref/@target, '#'))">
-		<xsl:text>Web.&#10;</xsl:text>
-		<xsl:if test="*//tei:imprint/tei:date/@type='access'">
-		  <xsl:value-of select="*//tei:imprint/tei:date[@type='access']"/>
-		  <xsl:text>.</xsl:text>
-		</xsl:if>
-	      </xsl:when>
-	      <xsl:when test="tei:analytic/tei:title[@level='u'] or tei:monogr/tei:title[@level='u']"/>
-	      <xsl:otherwise>Print.&#10;</xsl:otherwise>
-	    </xsl:choose>
-	    <xsl:if test="tei:monogr/tei:imprint/tei:extent"><xsl:value-of select="tei:monogr/tei:imprint/tei:extent"/>. </xsl:if>
-	    <xsl:if test="tei:series/tei:title[@level='s']">
-	      <xsl:apply-templates select="tei:series/tei:title[@level='s']"/>
-	      <xsl:text>. </xsl:text>
-	    </xsl:if>
-	  </p>
-	</xsl:for-each>
-	</div>
-      </xsl:when>
-      <xsl:when test="tei:biblStruct">
-        <ol class="listBibl">
-          <xsl:for-each select="tei:biblStruct">
-            <xsl:sort select="lower-case((tei:*/tei:author/tei:surname|tei:*[1]/tei:author/tei:orgName|tei:*[1]/tei:author/tei:name|tei:*[1]/tei:author|tei:*[1]/tei:editor/tei:surname|tei:*[1]/tei:editor/tei:name|tei:*[1]/tei:editor|tei:*[1]/tei:title[1])[1])"/>
-            <xsl:sort select="tei:monogr/tei:imprint/tei:date"/>
-            <li>
-              <xsl:call-template name="makeAnchor"/>
-              <xsl:apply-templates select="."/>
-            </li>
-          </xsl:for-each>
-        </ol>
-      </xsl:when>
-      <xsl:otherwise>
-        <ol class="listBibl">
-          <xsl:for-each select="tei:bibl|tei:biblItem">
-            <li>
-              <xsl:call-template name="makeAnchor">
-                <xsl:with-param name="name">
-                  <xsl:apply-templates mode="ident" select="."/>
-                </xsl:with-param>
-              </xsl:call-template>
-              <xsl:apply-templates select="."/>
-            </li>
-          </xsl:for-each>
-        </ol>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element mentioned</desc>
-  </doc>
-  <xsl:template match="tei:mentioned">
-    <span>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:apply-templates/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element name in mode "plain"</desc>
-  </doc>
-  <xsl:template match="tei:name" mode="plain">
-    <xsl:variable name="ident">
-      <xsl:apply-templates mode="ident" select="."/>
-    </xsl:variable>
-    <span>
-      <xsl:call-template name="makeAnchor">
-        <xsl:with-param name="name">
-          <xsl:value-of select="$ident"/>
-        </xsl:with-param>
-      </xsl:call-template>
-      <xsl:apply-templates/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element note</desc>
-  </doc>
-  <xsl:template match="tei:note">
-    <xsl:variable name="identifier">
-      <xsl:call-template name="noteID"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="@place='none'"/>
-      <xsl:when test="ancestor::tei:listBibl or ancestor::tei:biblFull         or ancestor::tei:biblStruct">
-        <xsl:text> [</xsl:text>
-        <xsl:apply-templates/>
-        <xsl:text>]</xsl:text>
-      </xsl:when>
-      <xsl:when test="@place='foot' or @place='bottom' or @place='end' or $autoEndNotes='true'">
-        <xsl:element name="{if (parent::tei:head or parent::tei:hi)  then 'span'           else if (parent::tei:l) then 'span'           else if (parent::tei:bibl/parent::tei:head) then 'span'           else if (parent::tei:stage/parent::tei:q) then 'span'           else if  (parent::tei:body or *[not(tei:is-inline(.))]) then 'div' else 'span' }">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="concat($identifier,'_return')"/>
-          </xsl:call-template>
-          <xsl:variable name="note-title">
-            <xsl:variable name="note-text">
-              <xsl:apply-templates mode="plain"/>
-            </xsl:variable>
-            <xsl:value-of select="substring($note-text,1,500)"/>
-            <xsl:if test="string-length($note-text) &gt; 500">
-              <xsl:text>…</xsl:text>
-            </xsl:if>
-          </xsl:variable>
-          <xsl:choose>
-            <xsl:when test="$footnoteFile='true'">
-              <a class="notelink" title="{normalize-space($note-title)}" href="{$masterFile}-notes.html#{$identifier}">
-		<xsl:element name="{if (@rend='nosup') then 'span' else 'sup'}">
-                  <xsl:call-template name="noteN"/>
-		</xsl:element>
-              </a>
-              <xsl:if test="following-sibling::node()[1][self::tei:note]">
-		<xsl:element name="{if (@rend='nosup') then 'span' else 'sup'}">
-                  <xsl:text>,</xsl:text>
-                </xsl:element>
-              </xsl:if>
-            </xsl:when>
-            <xsl:otherwise>
-              <a class="notelink" title="{normalize-space($note-title)}" href="#{$identifier}">
-		<xsl:element name="{if (@rend='nosup') then 'span' else 'sup'}">				  
-                  <xsl:call-template name="noteN"/>
-                </xsl:element>
-              </a>
-              <xsl:if test="following-sibling::node()[1][self::tei:note]">
-		<xsl:element name="{if (@rend='nosup') then 'span' else 'sup'}">
-                  <xsl:text>,</xsl:text>
-                </xsl:element>
-              </xsl:if>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:element>
-      </xsl:when>
-      <xsl:when test="parent::tei:head and @place='margin'">
-        <span class="margnote">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:when test="parent::tei:head">
-        <xsl:text> [</xsl:text>
-        <xsl:apply-templates/>
-        <xsl:text>]</xsl:text>
-      </xsl:when>
-      <xsl:when test="@type='footnote'">
-        <div class="note">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-          </xsl:call-template>
-          <span class="noteNumber">
-            <xsl:number/>
-          </span>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="(@place='display' or tei:q)          and (parent::tei:div or parent::tei:p or parent::tei:body)">
-        <div class="note">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-          </xsl:call-template>
-          <span class="noteLabel">
-            <xsl:choose>
-              <xsl:when test="@n">
-                <xsl:value-of select="@n"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Note</xsl:with-param>
-                </xsl:call-template>
-                <xsl:text>: </xsl:text>
-              </xsl:otherwise>
-            </xsl:choose>
-          </span>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="@place='display'">
-        <blockquote>
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-          </xsl:call-template>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:choose>
-            <xsl:when test="$outputTarget='html5'">
-              <xsl:apply-templates/>
-            </xsl:when>
-            <xsl:when test="tei:q">
-              <xsl:apply-templates/>
-            </xsl:when>
-            <xsl:otherwise>
-              <p>
-                <xsl:apply-templates/>
-              </p>
-            </xsl:otherwise>
-          </xsl:choose>
-        </blockquote>
-      </xsl:when>
-      <xsl:when test="@place='margin' and parent::tei:hi and not(*)">
-        <span class="margnote">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-          </xsl:call-template>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:when test="@place='margin' and *[not(tei:is-inline(.))]">
-        <div class="margnote">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-          </xsl:call-template>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="@place='margin'">
-        <span class="margnote">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-          </xsl:call-template>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:when test="@place='inline' or (parent::tei:p or parent::tei:hi or parent::tei:head)">
-        <span class="note">
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-          </xsl:call-template>
-          <xsl:text> [</xsl:text>
-          <xsl:apply-templates/>
-          <xsl:text>]</xsl:text>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <div>
-          <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-          </xsl:call-template>
-          <xsl:attribute name="class">
+					</xsl:if>
+					<xsl:apply-templates select="tei:item" />
+				</ol>
+			</xsl:when>
+			<xsl:otherwise>
+				<ul>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default" />
+					</xsl:call-template>
+					<xsl:apply-templates select="tei:item" />
+				</ul>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element list/tei:label</desc>
+	</doc>
+	<xsl:template match="tei:list/tei:label" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element listBibl</desc>
+	</doc>
+	<xsl:template match="tei:listBibl">
+		<xsl:choose>
+			<xsl:when test="tei:biblStruct and $biblioStyle='mla'">
+				<div type="listBibl" xmlns="http://www.w3.org/1999/xhtml">
+					<xsl:for-each select="tei:biblStruct">
+						<p class="hang" xmlns="http://www.w3.org/1999/xhtml">
+							<xsl:apply-templates select="tei:analytic"
+								mode="mla" />
+							<xsl:apply-templates select="tei:monogr"
+								mode="mla" />
+							<xsl:apply-templates select="tei:relatedItem"
+								mode="mla" />
+							<xsl:choose>
+								<xsl:when test="tei:note">
+									<xsl:apply-templates select="tei:note" />
+								</xsl:when>
+								<xsl:when
+									test="*//tei:ref/@target and not(contains(*//tei:ref/@target, '#'))">
+									<xsl:text>Web.&#10;</xsl:text>
+									<xsl:if test="*//tei:imprint/tei:date/@type='access'">
+										<xsl:value-of
+											select="*//tei:imprint/tei:date[@type='access']" />
+										<xsl:text>.</xsl:text>
+									</xsl:if>
+								</xsl:when>
+								<xsl:when
+									test="tei:analytic/tei:title[@level='u'] or tei:monogr/tei:title[@level='u']" />
+								<xsl:otherwise>
+									Print.&#10;
+								</xsl:otherwise>
+							</xsl:choose>
+							<xsl:if test="tei:monogr/tei:imprint/tei:extent">
+								<xsl:value-of
+									select="tei:monogr/tei:imprint/tei:extent" />
+								.
+							</xsl:if>
+							<xsl:if test="tei:series/tei:title[@level='s']">
+								<xsl:apply-templates
+									select="tei:series/tei:title[@level='s']" />
+								<xsl:text>. </xsl:text>
+							</xsl:if>
+						</p>
+					</xsl:for-each>
+				</div>
+			</xsl:when>
+			<xsl:when test="tei:biblStruct">
+				<ol class="listBibl">
+					<xsl:for-each select="tei:biblStruct">
+						<xsl:sort
+							select="lower-case((tei:*/tei:author/tei:surname|tei:*[1]/tei:author/tei:orgName|tei:*[1]/tei:author/tei:name|tei:*[1]/tei:author|tei:*[1]/tei:editor/tei:surname|tei:*[1]/tei:editor/tei:name|tei:*[1]/tei:editor|tei:*[1]/tei:title[1])[1])" />
+						<xsl:sort select="tei:monogr/tei:imprint/tei:date" />
+						<li>
+							<xsl:call-template name="makeAnchor" />
+							<xsl:apply-templates select="." />
+						</li>
+					</xsl:for-each>
+				</ol>
+			</xsl:when>
+			<xsl:otherwise>
+				<ol class="listBibl">
+					<xsl:for-each select="tei:bibl|tei:biblItem">
+						<li>
+							<xsl:call-template name="makeAnchor">
+								<xsl:with-param name="name">
+									<xsl:apply-templates mode="ident"
+										select="." />
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:apply-templates select="." />
+						</li>
+					</xsl:for-each>
+				</ol>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element mentioned</desc>
+	</doc>
+	<xsl:template match="tei:mentioned">
+		<span>
+			<xsl:call-template name="rendToClass" />
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element name in mode "plain"</desc>
+	</doc>
+	<xsl:template match="tei:name" mode="plain">
+		<xsl:variable name="ident">
+			<xsl:apply-templates mode="ident" select="." />
+		</xsl:variable>
+		<span>
+			<xsl:call-template name="makeAnchor">
+				<xsl:with-param name="name">
+					<xsl:value-of select="$ident" />
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element note</desc>
+	</doc>
+	<xsl:template match="tei:note">
+		<xsl:variable name="identifier">
+			<xsl:call-template name="noteID" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="@place='none'" />
+			<xsl:when
+				test="ancestor::tei:listBibl or ancestor::tei:biblFull         or ancestor::tei:biblStruct">
+				<xsl:text> [</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>]</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="@place='foot' or @place='bottom' or @place='end' or $autoEndNotes='true'">
+				<xsl:element
+					name="{if (parent::tei:head or parent::tei:hi)  then 'span'           else if (parent::tei:l) then 'span'           else if (parent::tei:bibl/parent::tei:head) then 'span'           else if (parent::tei:stage/parent::tei:q) then 'span'           else if  (parent::tei:body or *[not(tei:is-inline(.))]) then 'div' else 'span' }">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name"
+							select="concat($identifier,'_return')" />
+					</xsl:call-template>
+					<xsl:variable name="note-title">
+						<xsl:variable name="note-text">
+							<xsl:apply-templates mode="plain" />
+						</xsl:variable>
+						<xsl:value-of select="substring($note-text,1,500)" />
+						<xsl:if test="string-length($note-text) &gt; 500">
+							<xsl:text>…</xsl:text>
+						</xsl:if>
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="$footnoteFile='true'">
+							<a class="notelink" title="{normalize-space($note-title)}"
+								href="{$masterFile}-notes.html#{$identifier}">
+								<xsl:element
+									name="{if (@rend='nosup') then 'span' else 'sup'}">
+									<xsl:call-template name="noteN" />
+								</xsl:element>
+							</a>
+							<xsl:if
+								test="following-sibling::node()[1][self::tei:note]">
+								<xsl:element
+									name="{if (@rend='nosup') then 'span' else 'sup'}">
+									<xsl:text>,</xsl:text>
+								</xsl:element>
+							</xsl:if>
+						</xsl:when>
+						<xsl:otherwise>
+							<a class="notelink" title="{normalize-space($note-title)}"
+								href="#{$identifier}">
+								<xsl:element
+									name="{if (@rend='nosup') then 'span' else 'sup'}">
+									<xsl:call-template name="noteN" />
+								</xsl:element>
+							</a>
+							<xsl:if
+								test="following-sibling::node()[1][self::tei:note]">
+								<xsl:element
+									name="{if (@rend='nosup') then 'span' else 'sup'}">
+									<xsl:text>,</xsl:text>
+								</xsl:element>
+							</xsl:if>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="parent::tei:head and @place='margin'">
+				<span class="margnote">
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:when test="parent::tei:head">
+				<xsl:text> [</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>]</xsl:text>
+			</xsl:when>
+			<xsl:when test="@type='footnote'">
+				<div class="note">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name" select="$identifier" />
+					</xsl:call-template>
+					<span class="noteNumber">
+						<xsl:number />
+					</span>
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when
+				test="(@place='display' or tei:q)          and (parent::tei:div or parent::tei:p or parent::tei:body)">
+				<div class="note">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name" select="$identifier" />
+					</xsl:call-template>
+					<span class="noteLabel">
+						<xsl:choose>
+							<xsl:when test="@n">
+								<xsl:value-of select="@n" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Note
+									</xsl:with-param>
+								</xsl:call-template>
+								<xsl:text>: </xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</span>
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="@place='display'">
+				<blockquote>
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name" select="$identifier" />
+					</xsl:call-template>
+					<xsl:call-template name="rendToClass" />
+					<xsl:choose>
+						<xsl:when test="$outputTarget='html5'">
+							<xsl:apply-templates />
+						</xsl:when>
+						<xsl:when test="tei:q">
+							<xsl:apply-templates />
+						</xsl:when>
+						<xsl:otherwise>
+							<p>
+								<xsl:apply-templates />
+							</p>
+						</xsl:otherwise>
+					</xsl:choose>
+				</blockquote>
+			</xsl:when>
+			<xsl:when
+				test="@place='margin' and parent::tei:hi and not(*)">
+				<span class="margnote">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name" select="$identifier" />
+					</xsl:call-template>
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="@place='margin' and *[not(tei:is-inline(.))]">
+				<div class="margnote">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name" select="$identifier" />
+					</xsl:call-template>
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="@place='margin'">
+				<span class="margnote">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name" select="$identifier" />
+					</xsl:call-template>
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="@place='inline' or (parent::tei:p or parent::tei:hi or parent::tei:head)">
+				<span class="note">
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name" select="$identifier" />
+					</xsl:call-template>
+					<xsl:text> [</xsl:text>
+					<xsl:apply-templates />
+					<xsl:text>]</xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<div>
+					<xsl:call-template name="makeAnchor">
+						<xsl:with-param name="name" select="$identifier" />
+					</xsl:call-template>
+					<xsl:attribute name="class">
             <xsl:text>note </xsl:text>
-            <xsl:value-of select="@type"/>
+            <xsl:value-of select="@type" />
           </xsl:attribute>
-          <span class="noteLabel">
-            <xsl:choose>
-              <xsl:when test="@n">
-                <xsl:value-of select="@n"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Note</xsl:with-param>
-                </xsl:call-template>
-                <xsl:text>: </xsl:text>
-              </xsl:otherwise>
-            </xsl:choose>
-          </span>
-          <xsl:apply-templates/>
-        </div>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Check whether a note should be processed if we are at the top</desc>
-  </doc>
-  <xsl:template match="tei:note" mode="printallnotes">
-    <xsl:choose>
-      <xsl:when test="number($splitLevel)=-1">
-        <xsl:call-template name="makeaNote"/>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:group"/>
-      <xsl:when test="not(ancestor::tei:div or ancestor::tei:div1)">
-        <xsl:call-template name="makeaNote"/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Check whether a note should be processed. If we are
-    splitting, check that we are in the correct file</desc>
-  </doc>
-  <xsl:template match="tei:note" mode="printnotes">
-    <xsl:param name="whence" select="."/>
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:listBibl"/>
-      <xsl:when test="number($splitLevel)=-1"/>
-      <xsl:when test="@place='foot' or @place='bottom' or @place='end'         or $autoEndNotes='true'">
-        <xsl:variable name="parent">
-	  <xsl:for-each select="ancestor::tei:*[local-name()='div'
+					<span class="noteLabel">
+						<xsl:choose>
+							<xsl:when test="@n">
+								<xsl:value-of select="@n" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Note
+									</xsl:with-param>
+								</xsl:call-template>
+								<xsl:text>: </xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</span>
+					<xsl:apply-templates />
+				</div>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Check whether a note should be processed if we are at the top</desc>
+	</doc>
+	<xsl:template match="tei:note" mode="printallnotes">
+		<xsl:choose>
+			<xsl:when test="number($splitLevel)=-1">
+				<xsl:call-template name="makeaNote" />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:group" />
+			<xsl:when
+				test="not(ancestor::tei:div or ancestor::tei:div1)">
+				<xsl:call-template name="makeaNote" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Check whether a note should be processed. If we are
+			splitting, check that we are in the correct file</desc>
+	</doc>
+	<xsl:template match="tei:note" mode="printnotes">
+		<xsl:param name="whence" select="." />
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:listBibl" />
+			<xsl:when test="number($splitLevel)=-1" />
+			<xsl:when
+				test="@place='foot' or @place='bottom' or @place='end'         or $autoEndNotes='true'">
+				<xsl:variable name="parent">
+					<xsl:for-each
+						select="ancestor::tei:*[local-name()='div'
 	    or local-name()='div1'
 	    or local-name()='div2'
 	    or local-name()='div3'
 	    or local-name()='div4'
 	    or local-name()='div5'
 	    or local-name()='div6'][1]">
-	    <xsl:call-template name="locateParentDiv"/>
-	  </xsl:for-each>
-        </xsl:variable>
+						<xsl:call-template name="locateParentDiv" />
+					</xsl:for-each>
+				</xsl:variable>
 
-        <xsl:if test="$whence = $parent">
-          <xsl:call-template name="makeaNote"/>
-        </xsl:if>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element note</desc>
-  </doc>
-  <xsl:template name="makeaNote">
-    <xsl:variable name="identifier">
-      <xsl:call-template name="noteID"/>
-    </xsl:variable>
-    <xsl:if test="$verbose='true'">
-      <xsl:message>Make note <xsl:value-of select="$identifier"/></xsl:message>
-    </xsl:if>
-    <div class="note">
-      <xsl:call-template name="makeAnchor">
-        <xsl:with-param name="name" select="$identifier"/>
-      </xsl:call-template>
-      <span class="noteLabel">
-        <xsl:call-template name="noteN"/>
-        <xsl:if test="matches(@n,'[0-9]')">
-          <xsl:text>.</xsl:text>
-        </xsl:if>
-        <xsl:text> </xsl:text>
-      </span>
-      <div class="noteBody">
-        <xsl:apply-templates/>
-      </div>
-      <xsl:if test="$footnoteBackLink= 'true'">
-        <xsl:text> </xsl:text>
-        <a class="link_return" title="Go back to text" href="#{concat($identifier,'_return')}">↵</a>
-      </xsl:if>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element note[@type='action']</desc>
-  </doc>
-  <xsl:template match="tei:note[@type='action']">
-    <div class="right"><b>Action <xsl:number count="tei:note[@type='action']" level="any"/>
-         </b>: <i><xsl:apply-templates/></i></div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process element pb</p>
-      <p>Indication of a page break. For the purposes of HTML, we simply
-      make it an anchor if it has an ID.</p>
-    </desc>
-  </doc>
-  <xsl:template match="tei:pb" mode="ident">
-    <xsl:choose>
-      <xsl:when test="@xml:id">
-        <xsl:value-of select="@xml:id"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>page</xsl:text>
-        <!--
-	<xsl:for-each select="ancestor::tei:div[1]">
-	  <xsl:number level="multiple" format="1.1.1.1.1"/>
-	  <xsl:text>-</xsl:text>
-	</xsl:for-each>
--->
-        <xsl:number level="any"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:pb">
-    <xsl:choose>
-      <xsl:when test="$filePerPage='true'">
-        <PAGEBREAK>
-          <xsl:attribute name="name">
-            <xsl:apply-templates select="." mode="ident"/>
+				<xsl:if test="$whence = $parent">
+					<xsl:call-template name="makeaNote" />
+				</xsl:if>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element note</desc>
+	</doc>
+	<xsl:template name="makeaNote">
+		<xsl:variable name="identifier">
+			<xsl:call-template name="noteID" />
+		</xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Make note
+				<xsl:value-of select="$identifier" />
+			</xsl:message>
+		</xsl:if>
+		<div class="note">
+			<xsl:call-template name="makeAnchor">
+				<xsl:with-param name="name" select="$identifier" />
+			</xsl:call-template>
+			<span class="noteLabel">
+				<xsl:call-template name="noteN" />
+				<xsl:if test="matches(@n,'[0-9]')">
+					<xsl:text>.</xsl:text>
+				</xsl:if>
+				<xsl:text> </xsl:text>
+			</span>
+			<div class="noteBody">
+				<xsl:apply-templates />
+			</div>
+			<xsl:if test="$footnoteBackLink= 'true'">
+				<xsl:text> </xsl:text>
+				<a class="link_return" title="Go back to text"
+					href="#{concat($identifier,'_return')}">↵</a>
+			</xsl:if>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element note[@type='action']</desc>
+	</doc>
+	<xsl:template match="tei:note[@type='action']">
+		<div class="right">
+			<b>
+				Action
+				<xsl:number count="tei:note[@type='action']" level="any" />
+			</b>
+			:
+			<i>
+				<xsl:apply-templates />
+			</i>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element pb</p>
+			<p>Indication of a page break. For the purposes of HTML, we simply
+				make it an anchor if it has an ID.</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:pb" mode="ident">
+		<xsl:choose>
+			<xsl:when test="@xml:id">
+				<xsl:value-of select="@xml:id" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>page</xsl:text>
+				<!-- <xsl:for-each select="ancestor::tei:div[1]"> <xsl:number level="multiple" 
+					format="1.1.1.1.1"/> <xsl:text>-</xsl:text> </xsl:for-each> -->
+				<xsl:number level="any" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:pb">
+		<xsl:choose>
+			<xsl:when test="$filePerPage='true'">
+				<PAGEBREAK>
+					<xsl:attribute name="name">
+            <xsl:apply-templates select="."
+						mode="ident" />
           </xsl:attribute>
-          <xsl:copy-of select="@facs"/>
-        </PAGEBREAK>
-      </xsl:when>
-      <xsl:when test="@facs and not(@rend='none')">
-        <xsl:variable name="IMG">
-          <xsl:choose>
-            <xsl:when test="starts-with(@facs,'#')">
-              <xsl:for-each select="id(substring(@facs,2))">
-                <xsl:value-of select="tei:graphic[1]/@url"/>
-              </xsl:for-each>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@facs"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:element name="{if (tei:is-inline(..)) then 'span' else 'div'}">
-          <xsl:call-template name="rendToClass"/>
-          <img src="{$IMG}" alt="page image"/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:when test="$pagebreakStyle='active'">
-        <div class="pagebreak">
-          <xsl:call-template name="rendToClass"/>
-        </div>
-      </xsl:when>
-      <xsl:when test="$pagebreakStyle='visible' and (parent::tei:body         or parent::tei:front or parent::tei:back or parent::tei:group)">
-        <div class="pagebreak">
-          <xsl:call-template name="makeAnchor"/>
-          <xsl:text> [</xsl:text>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">page</xsl:with-param>
-          </xsl:call-template>
-          <xsl:if test="@n">
-            <xsl:text> </xsl:text>
-            <xsl:value-of select="@n"/>
-          </xsl:if>
-          <xsl:text>] </xsl:text>
-        </div>
-      </xsl:when>
-      <xsl:when test="$pagebreakStyle='visible'">
-        <span class="pagebreak">
-          <xsl:call-template name="makeAnchor"/>
-          <xsl:text> [</xsl:text>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">page</xsl:with-param>
-          </xsl:call-template>
-          <xsl:if test="@n">
-            <xsl:text> </xsl:text>
-            <xsl:value-of select="@n"/>
-          </xsl:if>
-          <xsl:text>] </xsl:text>
-        </span>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element p</desc>
-  </doc>
-  <xsl:template match="tei:p">
-    <xsl:variable name="wrapperElement">
-      <xsl:choose>
-        <xsl:when test="$outputTarget='html5'">p</xsl:when>
-        <xsl:when test="parent::tei:figure and (tei:q/tei:l or tei:figure or parent::tei:figure/parent::tei:div)">div</xsl:when>
-        <xsl:when test="parent::tei:figure">span</xsl:when>
-        <xsl:when test="parent::tei:head or    parent::tei:q/parent::tei:head or    parent::tei:note[@place='margin']/parent::tei:head">span</xsl:when>
-        <xsl:when test="ancestor::tei:notesStmt">div</xsl:when>
-        <xsl:when test="tei:table">div</xsl:when>
-        <xsl:when test="parent::tei:note[not(@place or @rend)]">span</xsl:when>
-        <xsl:when test="$outputTarget='epub' or $outputTarget='epub3'">div</xsl:when>
-        <xsl:when test="tei:eg">div</xsl:when>
-        <xsl:when test="tei:figure">div</xsl:when>
-        <xsl:when test="tei:floatingText">div</xsl:when>
-        <xsl:when test="tei:l">div</xsl:when>
-        <xsl:when test="tei:list">div</xsl:when>
-        <xsl:when test="tei:moduleSpec">div</xsl:when>
-        <xsl:when test="tei:note[@place='display']">div</xsl:when>
-        <xsl:when test="tei:note[@place='margin']">div</xsl:when>
-        <xsl:when test="tei:note[tei:q]">div</xsl:when>
-        <xsl:when test="tei:q/tei:figure">div</xsl:when>
-        <xsl:when test="tei:q/tei:list">div</xsl:when>
-        <xsl:when test="tei:q[@rend='display']">div</xsl:when>
-        <xsl:when test="tei:q[@rend='inline' and tei:note/@place]">div</xsl:when>
-        <xsl:when test="tei:q[tei:l]">div</xsl:when>
-        <xsl:when test="tei:q[tei:lg]">div</xsl:when>
-        <xsl:when test="tei:q[tei:p]">div</xsl:when>
-        <xsl:when test="tei:q[tei:sp]">div</xsl:when>
-        <xsl:when test="tei:q[tei:floatingText]">div</xsl:when>
-        <xsl:when test="tei:quote">div</xsl:when>
-        <xsl:when test="tei:specGrp">div</xsl:when>
-        <xsl:when test="tei:specGrpRef">div</xsl:when>
-        <xsl:when test="tei:specList">div</xsl:when>
-        <xsl:when test="tei:table">div</xsl:when>
-        <xsl:when test="teix:egXML">div</xsl:when>
-        <xsl:when test="ancestor::tei:floatingText">div</xsl:when>
-        <xsl:when test="ancestor::tei:closer">div</xsl:when>
-        <xsl:when test="parent::tei:p">div</xsl:when>
-        <xsl:when test="parent::tei:q">div</xsl:when>
-        <xsl:when test="parent::tei:note">div</xsl:when>
-        <xsl:when test="parent::tei:remarks">div</xsl:when>
-        <xsl:otherwise>
-          <xsl:text>p</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$filePerPage='true'">
-        <xsl:for-each-group select="node()" group-starting-with="tei:pb">
-          <xsl:choose>
-            <xsl:when test="self::tei:pb">
-              <xsl:apply-templates select="."/>
-              <xsl:element name="{$wrapperElement}">
-                <xsl:for-each select="..">
-                  <xsl:call-template name="rendToClass">
-                    <xsl:with-param name="id">
-                      <xsl:choose>
-                        <xsl:when test="@xml:id">
-                          <xsl:value-of select="@xml:id"/>
-                          <xsl:text>continued</xsl:text>
-                        </xsl:when>
-                        <xsl:otherwise>
-                          <xsl:text>false</xsl:text>
-                        </xsl:otherwise>
-                      </xsl:choose>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </xsl:for-each>
-                <xsl:apply-templates select="current-group() except ."/>
-              </xsl:element>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:element name="{$wrapperElement}">
-                <xsl:for-each select="..">
-                  <xsl:call-template name="rendToClass"/>
-                </xsl:for-each>
-                <xsl:apply-templates select="current-group()"/>
-              </xsl:element>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each-group>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:element name="{$wrapperElement}">
-          <xsl:call-template name="rendToClass">
-            <xsl:with-param name="default">
-              <xsl:if test="not($wrapperElement ='p')">
-                <xsl:text>p</xsl:text>
-              </xsl:if>
-            </xsl:with-param>
-          </xsl:call-template>
-          <xsl:if test="$numberParagraphs='true'">
-	    <xsl:call-template name="numberParagraph"/>
-          </xsl:if>
-          <xsl:apply-templates/>
-        </xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>How to number paragraphs</desc>
-  </doc>
-  <xsl:template name="numberParagraph">
-    <span class="numberParagraph">
-      <xsl:number/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element p[@rend='box']</desc>
-  </doc>
-  <xsl:template match="tei:p[@rend='box']">
-    <p class="box">
-      <xsl:apply-templates/>
-    </p>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element q and tei:said</desc>
-  </doc>
-  <xsl:template match="tei:q[@rend='inline margQuotes' or
-		       @rend='inline margSglQuotes']" priority="99">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:q[not(@place) and tei:l]">
-    <xsl:choose>
-      <xsl:when test="tei:blockContext(.)">
-        <div class="blockquote">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:q|tei:said">
-    <xsl:choose>
-      <xsl:when test="parent::tei:q/tei:note[@place='bottom']">
-        <span class="inlineq">
-          <xsl:call-template name="makeQuote"/>
-        </span>
-      </xsl:when>
-      <xsl:when test="parent::tei:note[@place='bottom'] and not(*)">
-        <span class="inlineq">
-          <xsl:call-template name="makeQuote"/>
-        </span>
-      </xsl:when>
-      <xsl:when test="tei:blockContext(.)">
-        <div class="blockquote {@rend}">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="parent::tei:q[@rend=current()/@rend] or parent::tei:hi or ancestor::tei:head">
-        <span class="inlineq {@rend}">
-          <xsl:call-template name="makeQuote"/>
-        </span>
-      </xsl:when>
-      <xsl:when test="not(tei:is-inline(.)) or *[not(tei:is-inline(.))]">
-        <div class="blockquote {@rend}">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="@rend='display'">
-        <p class="blockquote {@rend}">
-          <xsl:apply-templates/>
-        </p>
-      </xsl:when>
-      <xsl:when test="tei:lg">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:when test="@rendition">
-        <span>
-          <xsl:call-template name="applyRendition"/>
-        </span>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'PRE')">
-        <xsl:call-template name="makeQuote"/>
-      </xsl:when>
-      <xsl:when test="@rend">
-        <span class="q {@rend}">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="makeQuote"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element q[@rend='display']</desc>
-  </doc>
-  <xsl:template match="tei:q[@rend='display']">
-    <blockquote>
-      <xsl:call-template name="rendToClass"/>
-      <xsl:choose>
-        <xsl:when test="tei:p">
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:when test="$outputTarget='html5'">
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <p>
-            <xsl:apply-templates/>
-          </p>
-        </xsl:otherwise>
-      </xsl:choose>
-    </blockquote>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element q[@rend='eg']</desc>
-  </doc>
-  <xsl:template match="tei:q[@rend='eg']">
-    <div>
-      <xsl:if test="$cssFile">
-        <xsl:attribute name="class">eg</xsl:attribute>
-      </xsl:if>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element quote</desc>
-  </doc>
-  <xsl:template match="tei:quote">
-    <xsl:choose>
-      <xsl:when test="parent::tei:cit">
-        <div class="citquote">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="@rend='quoted'">
-        <span class="quote_inline">
-          <xsl:value-of select="$preQuote"/>
-          <xsl:apply-templates/>
-          <xsl:value-of select="$postQuote"/>
-        </span>
-      </xsl:when>
-      <xsl:when test="@rend='display' or @rend='block' or tei:lg or tei:lb or tei:p or tei:l or
+					<xsl:copy-of select="@facs" />
+				</PAGEBREAK>
+			</xsl:when>
+			<xsl:when test="@facs and not(@rend='none')">
+				<xsl:variable name="IMG">
+					<xsl:choose>
+						<xsl:when test="starts-with(@facs,'#')">
+							<xsl:for-each select="id(substring(@facs,2))">
+								<xsl:value-of select="tei:graphic[1]/@url" />
+							</xsl:for-each>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@facs" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:element
+					name="{if (tei:is-inline(..)) then 'span' else 'div'}">
+					<xsl:call-template name="rendToClass" />
+					<img src="{$IMG}" alt="page image" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="$pagebreakStyle='active'">
+				<div class="pagebreak">
+					<xsl:call-template name="rendToClass" />
+				</div>
+			</xsl:when>
+			<xsl:when
+				test="$pagebreakStyle='visible' and (parent::tei:body         or parent::tei:front or parent::tei:back or parent::tei:group)">
+				<div class="pagebreak">
+					<xsl:call-template name="makeAnchor" />
+					<xsl:text> [</xsl:text>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							page
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:if test="@n">
+						<xsl:text> </xsl:text>
+						<xsl:value-of select="@n" />
+					</xsl:if>
+					<xsl:text>] </xsl:text>
+				</div>
+			</xsl:when>
+			<xsl:when test="$pagebreakStyle='visible'">
+				<span class="pagebreak">
+					<xsl:call-template name="makeAnchor" />
+					<xsl:text> [</xsl:text>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							page
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:if test="@n">
+						<xsl:text> </xsl:text>
+						<xsl:value-of select="@n" />
+					</xsl:if>
+					<xsl:text>] </xsl:text>
+				</span>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element p</desc>
+	</doc>
+	<xsl:template match="tei:p">
+		<xsl:variable name="wrapperElement">
+			<xsl:choose>
+				<xsl:when test="$outputTarget='html5'">
+					p
+				</xsl:when>
+				<xsl:when
+					test="parent::tei:figure and (tei:q/tei:l or tei:figure or parent::tei:figure/parent::tei:div)">
+					div
+				</xsl:when>
+				<xsl:when test="parent::tei:figure">
+					span
+				</xsl:when>
+				<xsl:when
+					test="parent::tei:head or    parent::tei:q/parent::tei:head or    parent::tei:note[@place='margin']/parent::tei:head">
+					span
+				</xsl:when>
+				<xsl:when test="ancestor::tei:notesStmt">
+					div
+				</xsl:when>
+				<xsl:when test="tei:table">
+					div
+				</xsl:when>
+				<xsl:when test="parent::tei:note[not(@place or @rend)]">
+					span
+				</xsl:when>
+				<xsl:when
+					test="$outputTarget='epub' or $outputTarget='epub3'">
+					div
+				</xsl:when>
+				<xsl:when test="tei:eg">
+					div
+				</xsl:when>
+				<xsl:when test="tei:figure">
+					div
+				</xsl:when>
+				<xsl:when test="tei:floatingText">
+					div
+				</xsl:when>
+				<xsl:when test="tei:l">
+					div
+				</xsl:when>
+				<xsl:when test="tei:list">
+					div
+				</xsl:when>
+				<xsl:when test="tei:moduleSpec">
+					div
+				</xsl:when>
+				<xsl:when test="tei:note[@place='display']">
+					div
+				</xsl:when>
+				<xsl:when test="tei:note[@place='margin']">
+					div
+				</xsl:when>
+				<xsl:when test="tei:note[tei:q]">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q/tei:figure">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q/tei:list">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q[@rend='display']">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q[@rend='inline' and tei:note/@place]">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q[tei:l]">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q[tei:lg]">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q[tei:p]">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q[tei:sp]">
+					div
+				</xsl:when>
+				<xsl:when test="tei:q[tei:floatingText]">
+					div
+				</xsl:when>
+				<xsl:when test="tei:quote">
+					div
+				</xsl:when>
+				<xsl:when test="tei:specGrp">
+					div
+				</xsl:when>
+				<xsl:when test="tei:specGrpRef">
+					div
+				</xsl:when>
+				<xsl:when test="tei:specList">
+					div
+				</xsl:when>
+				<xsl:when test="tei:table">
+					div
+				</xsl:when>
+				<xsl:when test="teix:egXML">
+					div
+				</xsl:when>
+				<xsl:when test="ancestor::tei:floatingText">
+					div
+				</xsl:when>
+				<xsl:when test="ancestor::tei:closer">
+					div
+				</xsl:when>
+				<xsl:when test="parent::tei:p">
+					div
+				</xsl:when>
+				<xsl:when test="parent::tei:q">
+					div
+				</xsl:when>
+				<xsl:when test="parent::tei:note">
+					div
+				</xsl:when>
+				<xsl:when test="parent::tei:remarks">
+					div
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>p</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$filePerPage='true'">
+				<xsl:for-each-group select="node()"
+					group-starting-with="tei:pb">
+					<xsl:choose>
+						<xsl:when test="self::tei:pb">
+							<xsl:apply-templates select="." />
+							<xsl:element name="{$wrapperElement}">
+								<xsl:for-each select="..">
+									<xsl:call-template name="rendToClass">
+										<xsl:with-param name="id">
+											<xsl:choose>
+												<xsl:when test="@xml:id">
+													<xsl:value-of select="@xml:id" />
+													<xsl:text>continued</xsl:text>
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:text>false</xsl:text>
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:for-each>
+								<xsl:apply-templates
+									select="current-group() except ." />
+							</xsl:element>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:element name="{$wrapperElement}">
+								<xsl:for-each select="..">
+									<xsl:call-template name="rendToClass" />
+								</xsl:for-each>
+								<xsl:apply-templates
+									select="current-group()" />
+							</xsl:element>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each-group>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element name="{$wrapperElement}">
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default">
+							<xsl:if test="not($wrapperElement ='p')">
+								<xsl:text>p</xsl:text>
+							</xsl:if>
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:if test="$numberParagraphs='true'">
+						<xsl:call-template name="numberParagraph" />
+					</xsl:if>
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>How to number paragraphs</desc>
+	</doc>
+	<xsl:template name="numberParagraph">
+		<span class="numberParagraph">
+			<xsl:number />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element p[@rend='box']</desc>
+	</doc>
+	<xsl:template match="tei:p[@rend='box']">
+		<p class="box">
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element q and tei:said</desc>
+	</doc>
+	<xsl:template
+		match="tei:q[@rend='inline margQuotes' or
+		       @rend='inline margSglQuotes']"
+		priority="99">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:q[not(@place) and tei:l]">
+		<xsl:choose>
+			<xsl:when test="tei:blockContext(.)">
+				<div class="blockquote">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:q|tei:said">
+		<xsl:choose>
+			<xsl:when test="parent::tei:q/tei:note[@place='bottom']">
+				<span class="inlineq">
+					<xsl:call-template name="makeQuote" />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:note[@place='bottom'] and not(*)">
+				<span class="inlineq">
+					<xsl:call-template name="makeQuote" />
+				</span>
+			</xsl:when>
+			<xsl:when test="tei:blockContext(.)">
+				<div class="blockquote {@rend}">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:q[@rend=current()/@rend] or parent::tei:hi or ancestor::tei:head">
+				<span class="inlineq {@rend}">
+					<xsl:call-template name="makeQuote" />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="not(tei:is-inline(.)) or *[not(tei:is-inline(.))]">
+				<div class="blockquote {@rend}">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="@rend='display'">
+				<p class="blockquote {@rend}">
+					<xsl:apply-templates />
+				</p>
+			</xsl:when>
+			<xsl:when test="tei:lg">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@rendition">
+				<span>
+					<xsl:call-template name="applyRendition" />
+				</span>
+			</xsl:when>
+			<xsl:when test="contains(@rend,'PRE')">
+				<xsl:call-template name="makeQuote" />
+			</xsl:when>
+			<xsl:when test="@rend">
+				<span class="q {@rend}">
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="makeQuote" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element q[@rend='display']</desc>
+	</doc>
+	<xsl:template match="tei:q[@rend='display']">
+		<blockquote>
+			<xsl:call-template name="rendToClass" />
+			<xsl:choose>
+				<xsl:when test="tei:p">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:when test="$outputTarget='html5'">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<p>
+						<xsl:apply-templates />
+					</p>
+				</xsl:otherwise>
+			</xsl:choose>
+		</blockquote>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element q[@rend='eg']</desc>
+	</doc>
+	<xsl:template match="tei:q[@rend='eg']">
+		<div>
+			<xsl:if test="$cssFile">
+				<xsl:attribute name="class">eg</xsl:attribute>
+			</xsl:if>
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element quote</desc>
+	</doc>
+	<xsl:template match="tei:quote">
+		<xsl:choose>
+			<xsl:when test="parent::tei:cit">
+				<div class="citquote">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="@rend='quoted'">
+				<span class="quote_inline">
+					<xsl:value-of select="$preQuote" />
+					<xsl:apply-templates />
+					<xsl:value-of select="$postQuote" />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="@rend='display' or @rend='block' or tei:lg or tei:lb or tei:p or tei:l or
 		      ($autoBlockQuote='true' and string-length(.)&gt;$autoBlockQuoteLength)">
-        <blockquote>
-          <xsl:call-template name="rendToClass"/>
-          <xsl:choose>
-            <xsl:when test="$outputTarget='html5'">
-              <xsl:apply-templates/>
-            </xsl:when>
-            <xsl:when test="tei:p|tei:l|tei:lg">
-              <xsl:apply-templates/>
-            </xsl:when>
-            <xsl:otherwise>
-              <p>
-                <xsl:apply-templates/>
-              </p>
-            </xsl:otherwise>
-          </xsl:choose>
-        </blockquote>
-      </xsl:when>
-      <xsl:otherwise>
-        <span class="quote_inline">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element resp</desc>
-  </doc>
-  <xsl:template match="tei:resp">
-    <xsl:apply-templates/>
-    <xsl:text> </xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element respStmt</desc>
-  </doc>
-  <xsl:template match="tei:respStmt">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element salute</desc>
-  </doc>
-  <xsl:template match="tei:salute">
-    <xsl:choose>
-      <xsl:when test="parent::tei:closer">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-        <div class="left">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element seg, pass through @type and @rend as @class</desc>
-  </doc>
-  <xsl:template match="tei:seg">
-    <span>
-      <xsl:choose>
-        <xsl:when test="@type">
-          <xsl:attribute name="class">
-            <xsl:value-of select="@type"/>
+				<blockquote>
+					<xsl:call-template name="rendToClass" />
+					<xsl:choose>
+						<xsl:when test="$outputTarget='html5'">
+							<xsl:apply-templates />
+						</xsl:when>
+						<xsl:when test="tei:p|tei:l|tei:lg">
+							<xsl:apply-templates />
+						</xsl:when>
+						<xsl:otherwise>
+							<p>
+								<xsl:apply-templates />
+							</p>
+						</xsl:otherwise>
+					</xsl:choose>
+				</blockquote>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="quote_inline">
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element resp</desc>
+	</doc>
+	<xsl:template match="tei:resp">
+		<xsl:apply-templates />
+		<xsl:text> </xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element respStmt</desc>
+	</doc>
+	<xsl:template match="tei:respStmt">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element salute</desc>
+	</doc>
+	<xsl:template match="tei:salute">
+		<xsl:choose>
+			<xsl:when test="parent::tei:closer">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<div class="left">
+					<xsl:apply-templates />
+				</div>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element seg, pass through @type and @rend as @class</desc>
+	</doc>
+	<xsl:template match="tei:seg">
+		<span>
+			<xsl:choose>
+				<xsl:when test="@type">
+					<xsl:attribute name="class">
+            <xsl:value-of select="@type" />
           </xsl:attribute>
-        </xsl:when>
-        <xsl:when test="@rend">
-          <xsl:attribute name="class">
-            <xsl:value-of select="@rend"/>
+				</xsl:when>
+				<xsl:when test="@rend">
+					<xsl:attribute name="class">
+            <xsl:value-of select="@rend" />
           </xsl:attribute>
-        </xsl:when>
-      </xsl:choose>
-      <xsl:apply-templates/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-    put (sic) after text
-  </desc>
-  </doc>
-  <xsl:template match="tei:sic">
-    <xsl:apply-templates/>
-    <xsl:text> (sic)</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element signed</desc>
-  </doc>
-  <xsl:template match="tei:signed">
-    <div class="signed">
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element space</desc>
-  </doc>
-  <xsl:template match="tei:space">
-    <span style="display:inline-block">
-      <xsl:if test="@extent">
-        <xsl:variable name="unit">
-          <xsl:choose>
-            <xsl:when test="@unit='chars'">
-              <xsl:text>em</xsl:text>
-            </xsl:when>
-            <xsl:when test="@unit">
-              <xsl:value-of select="@unit"/>
-            </xsl:when>
-            <xsl:otherwise>em</xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:attribute name="width">
-          <xsl:value-of select="@extent"/>
-          <xsl:value-of select="$unit"/>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			put (sic) after text
+		</desc>
+	</doc>
+	<xsl:template match="tei:sic">
+		<xsl:apply-templates />
+		<xsl:text> (sic)</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element signed</desc>
+	</doc>
+	<xsl:template match="tei:signed">
+		<div class="signed">
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element space</desc>
+	</doc>
+	<xsl:template match="tei:space">
+		<span style="display:inline-block">
+			<xsl:if test="@extent">
+				<xsl:variable name="unit">
+					<xsl:choose>
+						<xsl:when test="@unit='chars'">
+							<xsl:text>em</xsl:text>
+						</xsl:when>
+						<xsl:when test="@unit">
+							<xsl:value-of select="@unit" />
+						</xsl:when>
+						<xsl:otherwise>
+							em
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:attribute name="width">
+          <xsl:value-of select="@extent" />
+          <xsl:value-of select="$unit" />
         </xsl:attribute>
-      </xsl:if>
-      <xsl:text> </xsl:text>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element term</desc>
-  </doc>
-  <xsl:template match="tei:term">
-    <xsl:choose>
-      <xsl:when test="@rend">
-        <xsl:call-template name="rendering"/>
-      </xsl:when>
-      <xsl:when test="@rendition">
-        <span>
-          <xsl:call-template name="applyRendition"/>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <span class="term">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element title in "withbr" mode</desc>
-  </doc>
-  <xsl:template match="tei:title" mode="withbr">
-    <xsl:value-of select="."/>
-    <br/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element title when it is a child of body</desc>
-  </doc>
-  <xsl:template match="tei:body/tei:title">
-    <div class="title">
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element witList</desc>
-  </doc>
-  <xsl:template match="tei:witList">
-    <xsl:apply-templates select="./witness"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element witness</desc>
-  </doc>
-  <xsl:template match="tei:witness">
-    <p id="{@sigil}">
-      <b>Sigle: <xsl:value-of select="@sigil"/>
-         </b>
-      <br/>
-      <xsl:value-of select="text()"/>
-      <br/>
-      <xsl:apply-templates select="tei:biblStruct"/>
-      <xsl:if test="child::tei:note"><br/>See: <xsl:apply-templates select="child::tei:note"/></xsl:if>
-    </p>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] Activate a value for @rendition<param name="value">value</param>
-      </desc>
-  </doc>
-  <xsl:template name="applyRendition">
-    <xsl:attribute name="class">
-      <xsl:for-each select="tokenize(normalize-space(@rendition),' ')">
+			</xsl:if>
+			<xsl:text> </xsl:text>
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element term</desc>
+	</doc>
+	<xsl:template match="tei:term">
+		<xsl:choose>
+			<xsl:when test="@rend">
+				<xsl:call-template name="rendering" />
+			</xsl:when>
+			<xsl:when test="@rendition">
+				<span>
+					<xsl:call-template name="applyRendition" />
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="term">
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element title in "withbr" mode</desc>
+	</doc>
+	<xsl:template match="tei:title" mode="withbr">
+		<xsl:value-of select="." />
+		<br />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element title when it is a child of body</desc>
+	</doc>
+	<xsl:template match="tei:body/tei:title">
+		<div class="title">
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element witList</desc>
+	</doc>
+	<xsl:template match="tei:witList">
+		<xsl:apply-templates select="./witness" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element witness</desc>
+	</doc>
+	<xsl:template match="tei:witness">
+		<p id="{@sigil}">
+			<b>
+				Sigle:
+				<xsl:value-of select="@sigil" />
+			</b>
+			<br />
+			<xsl:value-of select="text()" />
+			<br />
+			<xsl:apply-templates select="tei:biblStruct" />
+			<xsl:if test="child::tei:note">
+				<br />
+				See:
+				<xsl:apply-templates select="child::tei:note" />
+			</xsl:if>
+		</p>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Activate a value for @rendition
+			<param name="value">value</param>
+		</desc>
+	</doc>
+	<xsl:template name="applyRendition">
+		<xsl:attribute name="class">
+      <xsl:for-each
+			select="tokenize(normalize-space(@rendition),' ')">
         <xsl:call-template name="findRendition">
           <xsl:with-param name="value">
-            <xsl:value-of select="."/>
+            <xsl:value-of select="." />
           </xsl:with-param>
         </xsl:call-template>
       </xsl:for-each>
     </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] Look up rendition value <param name="value">value</param>
-      </desc>
-  </doc>
-  <xsl:template name="findRendition">
-    <xsl:param name="value"/>
-    <xsl:choose>
-      <xsl:when test="starts-with($value,'#')">
-        <xsl:value-of select="substring-after($value,'#')"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:for-each select="document($value)">
-          <xsl:apply-templates select="@xml:id"/>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:text> </xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] Active a value for @rend<param name="value">value</param>
-      </desc>
-  </doc>
-  <xsl:template name="applyRend">
-    <xsl:param name="value"/>
-    <xsl:choose>
-      <xsl:when test="not($value='')">
-        <xsl:variable name="thisparm" select="substring-before($value,$rendSeparator)"/>
-        <xsl:call-template name="renderingInner">
-          <xsl:with-param name="value" select="$thisparm"/>
-          <xsl:with-param name="rest" select="substring-after($value,$rendSeparator)"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] sections in mode for table of contents</desc>
-  </doc>
-  <xsl:template name="continuedToc">
-    <xsl:if test="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
-      <ul class="toc">
-        <xsl:apply-templates mode="maketoc" select="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"/>
-      </ul>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] How to identify a note</desc>
-  </doc>
-  <xsl:template name="noteID">
-    <xsl:choose>
-      <xsl:when test="@xml:id">
-        <xsl:value-of select="@xml:id"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>Note</xsl:text>
-        <xsl:number count="tei:note" level="any"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] How to label a note</desc>
-  </doc>
-  <xsl:template name="noteN">
-    <xsl:choose>
-      <xsl:when test="@n">
-        <xsl:value-of select="@n"/>
-      </xsl:when>
-      <xsl:when test="not(@place) and $consecutiveFNs='true'">
-        <xsl:number count="tei:note[not(@place)]" level="any"/>
-      </xsl:when>
-      <xsl:when test="not(@place)">
-        <xsl:choose>
-          <xsl:when test="ancestor::tei:front">
-            <xsl:number count="tei:note[not(@place)]" from="tei:front" level="any"/>
-          </xsl:when>
-          <xsl:when test="ancestor::tei:back">
-            <xsl:number count="tei:note[not(@place)]" from="tei:back" level="any"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:number count="tei:note[not(@place)]" from="tei:body" level="any"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="@place='end'">
-        <xsl:choose>
-          <xsl:when test="$consecutiveFNs = 'true'">
-            <xsl:number count="tei:note[./@place='end']" level="any"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:choose>
-              <xsl:when test="ancestor::tei:front">
-                <xsl:number count="tei:note[./@place='end' ]" from="tei:front" level="any"/>
-              </xsl:when>
-              <xsl:when test="ancestor::tei:back">
-                <xsl:number count="tei:note[./@place='end' ]" from="tei:back" level="any"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:number count="tei:note[./@place='end' ]" from="tei:body" level="any"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:choose>
-          <xsl:when test="$consecutiveFNs = 'true'">
-            <xsl:number count="tei:note[@place='foot' or @place='bottom']" level="any"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:choose>
-              <xsl:when test="ancestor::tei:front">
-                <xsl:number count="tei:note[@place='foot' or @place='bottom']" from="tei:front" level="any"/>
-              </xsl:when>
-              <xsl:when test="ancestor::tei:back">
-                <xsl:number count="tei:note[@place='foot' or @place='bottom']" from="tei:back" level="any"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:number count="tei:note[@place='foot' or @place='bottom']" from="tei:body" level="any"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] Show relevant footnotes <param name="currentID">currentID</param>
-      </desc>
-  </doc>
-  <xsl:template name="partialFootNotes">
-    <xsl:param name="currentID"/>
-    <xsl:choose>
-      <xsl:when test="$currentID='current'"/>
-      <xsl:when test="$currentID='' and number($splitLevel)=-1">
-        <xsl:call-template name="printNotes"/>
-      </xsl:when>
-      <xsl:when test="$currentID=''">
-        <xsl:for-each select="descendant::tei:text">
-          <xsl:call-template name="printNotes"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:choose>
-          <xsl:when test="count(id($currentID))&gt;0">
-            <xsl:for-each select="id($currentID)">
-              <xsl:call-template name="printNotes"/>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:apply-templates mode="xpath" select="ancestor-or-self::tei:TEI/descendant::tei:text">
-              <xsl:with-param name="xpath" select="$currentID"/>
-              <xsl:with-param name="action">notes</xsl:with-param>
-            </xsl:apply-templates>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] </desc>
-  </doc>
-  <xsl:template name="printNotes">
-    <xsl:if test="count(key('NOTES',1)) or ($autoEndNotes='true' and count(key('ALLNOTES',1)))">
-      <xsl:choose>
-        <xsl:when test="$footnoteFile='true'">
-          <xsl:variable name="BaseFile">
-            <xsl:value-of select="$masterFile"/>
-            <xsl:call-template name="addCorpusID"/>
-          </xsl:variable>
-          <xsl:variable name="outName">
-            <xsl:call-template name="outputChunkName">
-              <xsl:with-param name="ident">
-                <xsl:value-of select="concat($BaseFile,'-notes')"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:variable>
-          <xsl:if test="$verbose='true'">
-            <xsl:message>Opening file <xsl:value-of select="$outName"/>
-               </xsl:message>
-          </xsl:if>
-          <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}" encoding="{$outputEncoding}" href="{$outName}" method="{$outputMethod}">
-            <html>
-              <xsl:comment>THIS FILE IS GENERATED FROM AN XML MASTER. DO NOT EDIT (11)</xsl:comment>
-              <xsl:call-template name="addLangAtt"/>
-              <head>
-                <title>
-                  <xsl:apply-templates select="descendant-or-self::tei:text/tei:front//tei:docTitle//text()"/>
-                  <xsl:text>: </xsl:text>
-                  <xsl:call-template name="i18n">
-                    <xsl:with-param name="word">noteHeading</xsl:with-param>
-                  </xsl:call-template>
-                </title>
-                <xsl:call-template name="includeCSS"/>
-                <xsl:call-template name="cssHook"/>
-              </head>
-              <body>
-                <xsl:call-template name="bodyMicroData"/>
-                <xsl:call-template name="bodyJavascriptHook"/>
-                <xsl:call-template name="bodyHook"/>
-                <div class="stdheader">
-                  <xsl:call-template name="stdheader">
-                    <xsl:with-param name="title">
-                      <xsl:apply-templates select="descendant-or-self::tei:text/tei:front//tei:docTitle//text()"/>
-                      <xsl:text>: </xsl:text>
-                      <xsl:call-template name="i18n">
-                        <xsl:with-param name="word">noteHeading</xsl:with-param>
-                      </xsl:call-template>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </div>
-                <div class="notes">
-                  <div class="noteHeading">
-                    <xsl:call-template name="i18n">
-                      <xsl:with-param name="word">noteHeading</xsl:with-param>
-                    </xsl:call-template>
-                  </div>
-                  <xsl:choose>
-                    <xsl:when test="$autoEndNotes='true'">
-                      <xsl:apply-templates mode="printnotes" select="key('ALLNOTES',1)"/>
-                    </xsl:when>
-                    <xsl:otherwise>
-                      <xsl:apply-templates mode="printnotes" select="key('NOTES',1)"/>
-                    </xsl:otherwise>
-                  </xsl:choose>
-                </div>
-                <xsl:call-template name="stdfooter"/>
-                <xsl:call-template name="bodyEndHook"/>
-              </body>
-            </html>
-          </xsl:result-document>
-          <xsl:if test="$verbose='true'">
-            <xsl:message>Closing file <xsl:value-of select="$outName"/>
-               </xsl:message>
-          </xsl:if>
-        </xsl:when>
-        <xsl:otherwise>
-	  
-          <xsl:variable name="me">
-            <xsl:apply-templates select="." mode="ident"/>
-          </xsl:variable>
-          <xsl:variable name="NOTES">
-            <xsl:choose>
-              <xsl:when test="self::tei:TEI">
-                <xsl:choose>
-                  <xsl:when test="$autoEndNotes='true'">
-                    <xsl:apply-templates mode="printallnotes" select="key('ALLNOTES',1)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:apply-templates mode="printallnotes" select="key('NOTES',1)"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </xsl:when>
-              <xsl:when test="parent::tei:group and tei:group">
-	      </xsl:when>
-              <xsl:otherwise>
-                <xsl:apply-templates mode="printnotes" select=".//tei:note">
-                  <xsl:with-param name="whence" select="$me"/>
-                </xsl:apply-templates>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:variable>
-          <xsl:for-each select="$NOTES">
-            <xsl:if test="html:div">
-              <div class="notes">
-                <div class="noteHeading">
-                  <xsl:call-template name="i18n">
-                    <xsl:with-param name="word">noteHeading</xsl:with-param>
-                  </xsl:call-template>
-                </div>
-                <xsl:copy-of select="*"/>
-              </div>
-            </xsl:if>
-          </xsl:for-each>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:if>
-    <xsl:if test="ancestor-or-self::tei:TEI/tei:text/descendant::tei:app">
-      <div class="notes">
-        <div class="noteHeading">
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">noteHeading</xsl:with-param>
-          </xsl:call-template>
-        </div>
-        <xsl:apply-templates mode="printnotes" select="descendant::tei:app"/>
-      </div>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>[html] </p>
-      <p>
-        <p xmlns="http://www.w3.org/1999/xhtml"> rendering. support for multiple rendition elements added by Nick
-        Nicholas </p>
-      </p>
-    </desc>
-  </doc>
-  <xsl:template name="rendering">
-    <xsl:call-template name="applyRend">
-      <xsl:with-param name="value" select="concat(@rend,$rendSeparator)"/>
-    </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] <param name="value">the current segment of the value of the rend
-      attribute</param>
-         <param name="rest">the remainder of the attribute</param>
-      </desc>
-  </doc>
-  <xsl:template name="renderingInner">
-    <xsl:param name="value"/>
-    <xsl:param name="rest"/>
-    <xsl:choose>
-      <xsl:when test="$value='bold' or $value='bo'">
-        <b>
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </b>
-      </xsl:when>
-      <xsl:when test="$value='center'">
-        <span style="text-align:center">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-	</span>
-      </xsl:when>
-      <xsl:when test="$value='code'">
-        <b>
-          <code>
-            <xsl:call-template name="applyRend">
-              <xsl:with-param name="value" select="$rest"/>
-            </xsl:call-template>
-          </code>
-        </b>
-      </xsl:when>
-      <xsl:when test="$value='italics' or $value='italic' or $value='cursive' or         $value='it' or $value='ital'">
-        <i>
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </i>
-      </xsl:when>
-      <xsl:when test="$value='ro' or $value='roman'">
-        <span style="font-style: normal">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='sc' or $value='smcap'">
-        <span style="font-variant: small-caps">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='plain'">
-        <xsl:call-template name="applyRend">
-          <xsl:with-param name="value" select="$rest"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$value='quoted'">
-        <xsl:text>‘</xsl:text>
-        <xsl:call-template name="applyRend">
-          <xsl:with-param name="value" select="$rest"/>
-        </xsl:call-template>
-        <xsl:text>’</xsl:text>
-      </xsl:when>
-      <xsl:when test="$value='sub'">
-        <sub>
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </sub>
-      </xsl:when>
-      <xsl:when test="$value='sup'">
-        <sup>
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </sup>
-      </xsl:when>
-      <xsl:when test="$value='important'">
-        <span class="important">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='ul'">
-        <span style="text-decoration:underline">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='interlinMarks'">
-        <xsl:text>`</xsl:text>
-        <xsl:call-template name="applyRend">
-          <xsl:with-param name="value" select="$rest"/>
-        </xsl:call-template>
-        <xsl:text>´</xsl:text>
-      </xsl:when>
-      <xsl:when test="$value='overbar'">
-        <span style="text-decoration:overline">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='expanded'">
-        <span style="letter-spacing: 0.15em">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='strike'">
-        <span style="text-decoration: line-through">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='small'">
-        <span style="font-size: 75%">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='large'">
-        <span style="font-size: 150%">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='smaller'">
-        <span style="font-size: 50%">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='larger'">
-        <span style="font-size: 200%">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='calligraphic' or $value='cursive'">
-        <span style="font-family: cursive">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='gothic'">
-        <span style="font-family: Papyrus, fantasy">
-          <xsl:call-template name="applyRend">
-            <xsl:with-param name="value" select="$rest"/>
-          </xsl:call-template>
-        </span>
-      </xsl:when>
-      <xsl:when test="$value='noindex'">
-        <xsl:call-template name="applyRend">
-          <xsl:with-param name="value" select="$rest"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:choose>
-          <xsl:when test="local-name(.)='p'">
-            <xsl:call-template name="unknownRendBlock">
-              <xsl:with-param name="rest" select="$rest"/>
-              <xsl:with-param name="value" select="$value"/>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="unknownRendInline">
-              <xsl:with-param name="rest" select="$rest"/>
-              <xsl:with-param name="value" select="$value"/>
-            </xsl:call-template>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] Process unknown rend attribute by turning it into
-    an HTML class<param name="value">current value</param>
-         <param name="rest">remaining values</param>
-      </desc>
-  </doc>
-  <xsl:template name="unknownRendBlock">
-    <xsl:param name="value"/>
-    <xsl:param name="rest"/>
-    <xsl:if test="not($value='')">
-      <xsl:attribute name="class">
-        <xsl:value-of select="$value"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Look up rendition value
+			<param name="value">value</param>
+		</desc>
+	</doc>
+	<xsl:template name="findRendition">
+		<xsl:param name="value" />
+		<xsl:choose>
+			<xsl:when test="starts-with($value,'#')">
+				<xsl:value-of select="substring-after($value,'#')" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="document($value)">
+					<xsl:apply-templates select="@xml:id" />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text> </xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Active a value for @rend
+			<param name="value">value</param>
+		</desc>
+	</doc>
+	<xsl:template name="applyRend">
+		<xsl:param name="value" />
+		<xsl:choose>
+			<xsl:when test="not($value='')">
+				<xsl:variable name="thisparm"
+					select="substring-before($value,$rendSeparator)" />
+				<xsl:call-template name="renderingInner">
+					<xsl:with-param name="value" select="$thisparm" />
+					<xsl:with-param name="rest"
+						select="substring-after($value,$rendSeparator)" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] sections in mode for table of contents</desc>
+	</doc>
+	<xsl:template name="continuedToc">
+		<xsl:if
+			test="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
+			<ul class="toc">
+				<xsl:apply-templates mode="maketoc"
+					select="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" />
+			</ul>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] How to identify a note</desc>
+	</doc>
+	<xsl:template name="noteID">
+		<xsl:choose>
+			<xsl:when test="@xml:id">
+				<xsl:value-of select="@xml:id" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>Note</xsl:text>
+				<xsl:number count="tei:note" level="any" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] How to label a note</desc>
+	</doc>
+	<xsl:template name="noteN">
+		<xsl:choose>
+			<xsl:when test="@n">
+				<xsl:value-of select="@n" />
+			</xsl:when>
+			<xsl:when test="not(@place) and $consecutiveFNs='true'">
+				<xsl:number count="tei:note[not(@place)]" level="any" />
+			</xsl:when>
+			<xsl:when test="not(@place)">
+				<xsl:choose>
+					<xsl:when test="ancestor::tei:front">
+						<xsl:number count="tei:note[not(@place)]"
+							from="tei:front" level="any" />
+					</xsl:when>
+					<xsl:when test="ancestor::tei:back">
+						<xsl:number count="tei:note[not(@place)]"
+							from="tei:back" level="any" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:number count="tei:note[not(@place)]"
+							from="tei:body" level="any" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="@place='end'">
+				<xsl:choose>
+					<xsl:when test="$consecutiveFNs = 'true'">
+						<xsl:number count="tei:note[./@place='end']"
+							level="any" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:choose>
+							<xsl:when test="ancestor::tei:front">
+								<xsl:number count="tei:note[./@place='end' ]"
+									from="tei:front" level="any" />
+							</xsl:when>
+							<xsl:when test="ancestor::tei:back">
+								<xsl:number count="tei:note[./@place='end' ]"
+									from="tei:back" level="any" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:number count="tei:note[./@place='end' ]"
+									from="tei:body" level="any" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$consecutiveFNs = 'true'">
+						<xsl:number
+							count="tei:note[@place='foot' or @place='bottom']" level="any" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:choose>
+							<xsl:when test="ancestor::tei:front">
+								<xsl:number
+									count="tei:note[@place='foot' or @place='bottom']"
+									from="tei:front" level="any" />
+							</xsl:when>
+							<xsl:when test="ancestor::tei:back">
+								<xsl:number
+									count="tei:note[@place='foot' or @place='bottom']"
+									from="tei:back" level="any" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:number
+									count="tei:note[@place='foot' or @place='bottom']"
+									from="tei:body" level="any" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Show relevant footnotes
+			<param name="currentID">currentID</param>
+		</desc>
+	</doc>
+	<xsl:template name="partialFootNotes">
+		<xsl:param name="currentID" />
+		<xsl:choose>
+			<xsl:when test="$currentID='current'" />
+			<xsl:when test="$currentID='' and number($splitLevel)=-1">
+				<xsl:call-template name="printNotes" />
+			</xsl:when>
+			<xsl:when test="$currentID=''">
+				<xsl:for-each select="descendant::tei:text">
+					<xsl:call-template name="printNotes" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="count(id($currentID))&gt;0">
+						<xsl:for-each select="id($currentID)">
+							<xsl:call-template name="printNotes" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates mode="xpath"
+							select="ancestor-or-self::tei:TEI/descendant::tei:text">
+							<xsl:with-param name="xpath" select="$currentID" />
+							<xsl:with-param name="action">
+								notes
+							</xsl:with-param>
+						</xsl:apply-templates>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="printNotes">
+		<xsl:if
+			test="count(key('NOTES',1)) or ($autoEndNotes='true' and count(key('ALLNOTES',1)))">
+			<xsl:choose>
+				<xsl:when test="$footnoteFile='true'">
+					<xsl:variable name="BaseFile">
+						<xsl:value-of select="$masterFile" />
+						<xsl:call-template name="addCorpusID" />
+					</xsl:variable>
+					<xsl:variable name="outName">
+						<xsl:call-template name="outputChunkName">
+							<xsl:with-param name="ident">
+								<xsl:value-of select="concat($BaseFile,'-notes')" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:variable>
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Opening file
+							<xsl:value-of select="$outName" />
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document
+						doctype-public="{$doctypePublic}"
+						doctype-system="{$doctypeSystem}" encoding="{$outputEncoding}"
+						href="{$outName}" method="{$outputMethod}">
+						<html>
+							<xsl:comment>
+								THIS FILE IS GENERATED FROM AN XML MASTER. DO NOT EDIT (11)
+							</xsl:comment>
+							<xsl:call-template name="addLangAtt" />
+							<head>
+								<title>
+									<xsl:apply-templates
+										select="descendant-or-self::tei:text/tei:front//tei:docTitle//text()" />
+									<xsl:text>: </xsl:text>
+									<xsl:call-template name="i18n">
+										<xsl:with-param name="word">
+											noteHeading
+										</xsl:with-param>
+									</xsl:call-template>
+								</title>
+								<xsl:call-template name="includeCSS" />
+								<xsl:call-template name="cssHook" />
+							</head>
+							<body>
+								<xsl:call-template name="bodyMicroData" />
+								<xsl:call-template name="bodyJavascriptHook" />
+								<xsl:call-template name="bodyHook" />
+								<div class="stdheader">
+									<xsl:call-template name="stdheader">
+										<xsl:with-param name="title">
+											<xsl:apply-templates
+												select="descendant-or-self::tei:text/tei:front//tei:docTitle//text()" />
+											<xsl:text>: </xsl:text>
+											<xsl:call-template name="i18n">
+												<xsl:with-param name="word">
+													noteHeading
+												</xsl:with-param>
+											</xsl:call-template>
+										</xsl:with-param>
+									</xsl:call-template>
+								</div>
+								<div class="notes">
+									<div class="noteHeading">
+										<xsl:call-template name="i18n">
+											<xsl:with-param name="word">
+												noteHeading
+											</xsl:with-param>
+										</xsl:call-template>
+									</div>
+									<xsl:choose>
+										<xsl:when test="$autoEndNotes='true'">
+											<xsl:apply-templates mode="printnotes"
+												select="key('ALLNOTES',1)" />
+										</xsl:when>
+										<xsl:otherwise>
+											<xsl:apply-templates mode="printnotes"
+												select="key('NOTES',1)" />
+										</xsl:otherwise>
+									</xsl:choose>
+								</div>
+								<xsl:call-template name="stdfooter" />
+								<xsl:call-template name="bodyEndHook" />
+							</body>
+						</html>
+					</xsl:result-document>
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Closing file
+							<xsl:value-of select="$outName" />
+						</xsl:message>
+					</xsl:if>
+				</xsl:when>
+				<xsl:otherwise>
+
+					<xsl:variable name="me">
+						<xsl:apply-templates select="." mode="ident" />
+					</xsl:variable>
+					<xsl:variable name="NOTES">
+						<xsl:choose>
+							<xsl:when test="self::tei:TEI">
+								<xsl:choose>
+									<xsl:when test="$autoEndNotes='true'">
+										<xsl:apply-templates mode="printallnotes"
+											select="key('ALLNOTES',1)" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:apply-templates mode="printallnotes"
+											select="key('NOTES',1)" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:when>
+							<xsl:when test="parent::tei:group and tei:group">
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates mode="printnotes"
+									select=".//tei:note">
+									<xsl:with-param name="whence" select="$me" />
+								</xsl:apply-templates>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:for-each select="$NOTES">
+						<xsl:if test="html:div">
+							<div class="notes">
+								<div class="noteHeading">
+									<xsl:call-template name="i18n">
+										<xsl:with-param name="word">
+											noteHeading
+										</xsl:with-param>
+									</xsl:call-template>
+								</div>
+								<xsl:copy-of select="*" />
+							</div>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+		<xsl:if
+			test="ancestor-or-self::tei:TEI/tei:text/descendant::tei:app">
+			<div class="notes">
+				<div class="noteHeading">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							noteHeading
+						</xsl:with-param>
+					</xsl:call-template>
+				</div>
+				<xsl:apply-templates mode="printnotes"
+					select="descendant::tei:app" />
+			</div>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[html] </p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> rendering. support for multiple rendition elements added
+					by Nick
+					Nicholas
+				</p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template name="rendering">
+		<xsl:call-template name="applyRend">
+			<xsl:with-param name="value"
+				select="concat(@rend,$rendSeparator)" />
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="value">the current segment of the value of the rend
+				attribute</param>
+			<param name="rest">the remainder of the attribute</param>
+		</desc>
+	</doc>
+	<xsl:template name="renderingInner">
+		<xsl:param name="value" />
+		<xsl:param name="rest" />
+		<xsl:choose>
+			<xsl:when test="$value='bold' or $value='bo'">
+				<b>
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</b>
+			</xsl:when>
+			<xsl:when test="$value='center'">
+				<span style="text-align:center">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='code'">
+				<b>
+					<code>
+						<xsl:call-template name="applyRend">
+							<xsl:with-param name="value" select="$rest" />
+						</xsl:call-template>
+					</code>
+				</b>
+			</xsl:when>
+			<xsl:when
+				test="$value='italics' or $value='italic' or $value='cursive' or         $value='it' or $value='ital'">
+				<i>
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</i>
+			</xsl:when>
+			<xsl:when test="$value='ro' or $value='roman'">
+				<span style="font-style: normal">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='sc' or $value='smcap'">
+				<span style="font-variant: small-caps">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='plain'">
+				<xsl:call-template name="applyRend">
+					<xsl:with-param name="value" select="$rest" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$value='quoted'">
+				<xsl:text>‘</xsl:text>
+				<xsl:call-template name="applyRend">
+					<xsl:with-param name="value" select="$rest" />
+				</xsl:call-template>
+				<xsl:text>’</xsl:text>
+			</xsl:when>
+			<xsl:when test="$value='sub'">
+				<sub>
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</sub>
+			</xsl:when>
+			<xsl:when test="$value='sup'">
+				<sup>
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</sup>
+			</xsl:when>
+			<xsl:when test="$value='important'">
+				<span class="important">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='ul'">
+				<span style="text-decoration:underline">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='interlinMarks'">
+				<xsl:text>`</xsl:text>
+				<xsl:call-template name="applyRend">
+					<xsl:with-param name="value" select="$rest" />
+				</xsl:call-template>
+				<xsl:text>´</xsl:text>
+			</xsl:when>
+			<xsl:when test="$value='overbar'">
+				<span style="text-decoration:overline">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='expanded'">
+				<span style="letter-spacing: 0.15em">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='strike'">
+				<span style="text-decoration: line-through">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='small'">
+				<span style="font-size: 75%">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='large'">
+				<span style="font-size: 150%">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='smaller'">
+				<span style="font-size: 50%">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='larger'">
+				<span style="font-size: 200%">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='calligraphic' or $value='cursive'">
+				<span style="font-family: cursive">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='gothic'">
+				<span style="font-family: Papyrus, fantasy">
+					<xsl:call-template name="applyRend">
+						<xsl:with-param name="value" select="$rest" />
+					</xsl:call-template>
+				</span>
+			</xsl:when>
+			<xsl:when test="$value='noindex'">
+				<xsl:call-template name="applyRend">
+					<xsl:with-param name="value" select="$rest" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="local-name(.)='p'">
+						<xsl:call-template name="unknownRendBlock">
+							<xsl:with-param name="rest" select="$rest" />
+							<xsl:with-param name="value" select="$value" />
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="unknownRendInline">
+							<xsl:with-param name="rest" select="$rest" />
+							<xsl:with-param name="value" select="$value" />
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Process unknown rend attribute by turning it into
+			an HTML class
+			<param name="value">current value</param>
+			<param name="rest">remaining values</param>
+		</desc>
+	</doc>
+	<xsl:template name="unknownRendBlock">
+		<xsl:param name="value" />
+		<xsl:param name="rest" />
+		<xsl:if test="not($value='')">
+			<xsl:attribute name="class">
+        <xsl:value-of select="$value" />
       </xsl:attribute>
-      <xsl:call-template name="applyRend">
-        <xsl:with-param name="value" select="$rest"/>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html]  Process unknown rend attribute by turning it into
-    an HTML class<param name="value">value</param>
-         <param name="rest">rest</param>
-      </desc>
-  </doc>
-  <xsl:template name="unknownRendInline">
-    <xsl:param name="value"/>
-    <xsl:param name="rest"/>
-    <xsl:if test="not($value='')">
-      <span class="{$value}">
-        <xsl:call-template name="applyRend">
-          <xsl:with-param name="value" select="$rest"/>
-        </xsl:call-template>
-      </span>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] Create a point to which we can link in the HTML<param name="name">value for identifier</param>
-      </desc>
-  </doc>
-  <xsl:template name="makeAnchor">
-    <xsl:param name="name"/>
-    <xsl:choose>
-      <xsl:when test="self::tei:anchor and $name">
-        <a id="{$name}">
-          <xsl:comment>anchor</xsl:comment>
-        </a>
-      </xsl:when>
-      <xsl:when test="self::tei:anchor">
-        <a id="{@xml:id}">
-          <xsl:comment>anchor</xsl:comment>
-        </a>
-      </xsl:when>
-      <xsl:when test="self::tei:index and $name">
-        <a id="{$name}">
-          <xsl:comment>index</xsl:comment>
-        </a>
-      </xsl:when>
-      <xsl:when test="self::tei:index">
-        <a id="{@xml:id}">
-          <xsl:comment>index</xsl:comment>
-        </a>
-      </xsl:when>
-      <xsl:when test="$name">
-        <xsl:attribute name="id" select="$name"/>
-      </xsl:when>
-      <xsl:when test="@xml:id">
-        <xsl:attribute name="id" select="@xml:id"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="me"><xsl:value-of select="$masterFile"/>-<xsl:value-of select="local-name(.)"/>-<xsl:value-of select="generate-id()"/></xsl:variable>
-        <xsl:attribute name="id" select="$me"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element soCalled</desc>
-  </doc>
-  <xsl:template match="tei:soCalled">
-    <xsl:choose>
-      <xsl:when test="@rend">
-        <xsl:call-template name="rendering"/>
-      </xsl:when>
-      <xsl:when test="@rendition">
-        <span>
-          <xsl:call-template name="applyRendition"/>
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="$preQuote"/>
-        <xsl:apply-templates/>
-        <xsl:value-of select="$postQuote"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Copy all attributes in HTML namespace</desc>
-  </doc>
-  <xsl:template name="htmlAttributes">
-    <xsl:for-each select="@*">
-      <xsl:if test="namespace-uri(.)='http://www.w3.org/1999/xhtml'">
-        <xsl:attribute name="{local-name(.)}">
-          <xsl:value-of select="."/>
+			<xsl:call-template name="applyRend">
+				<xsl:with-param name="value" select="$rest" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Process unknown rend attribute by turning it into
+			an HTML class
+			<param name="value">value</param>
+			<param name="rest">rest</param>
+		</desc>
+	</doc>
+	<xsl:template name="unknownRendInline">
+		<xsl:param name="value" />
+		<xsl:param name="rest" />
+		<xsl:if test="not($value='')">
+			<span class="{$value}">
+				<xsl:call-template name="applyRend">
+					<xsl:with-param name="value" select="$rest" />
+				</xsl:call-template>
+			</span>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Create a point to which we can link in the HTML
+			<param name="name">value for identifier</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeAnchor">
+		<xsl:param name="name" />
+		<xsl:choose>
+			<xsl:when test="self::tei:anchor and $name">
+				<a id="{$name}">
+					<xsl:comment>
+						anchor
+					</xsl:comment>
+				</a>
+			</xsl:when>
+			<xsl:when test="self::tei:anchor">
+				<a id="{@xml:id}">
+					<xsl:comment>
+						anchor
+					</xsl:comment>
+				</a>
+			</xsl:when>
+			<xsl:when test="self::tei:index and $name">
+				<a id="{$name}">
+					<xsl:comment>
+						index
+					</xsl:comment>
+				</a>
+			</xsl:when>
+			<xsl:when test="self::tei:index">
+				<a id="{@xml:id}">
+					<xsl:comment>
+						index
+					</xsl:comment>
+				</a>
+			</xsl:when>
+			<xsl:when test="$name">
+				<xsl:attribute name="id" select="$name" />
+			</xsl:when>
+			<xsl:when test="@xml:id">
+				<xsl:attribute name="id" select="@xml:id" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="me">
+					<xsl:value-of select="$masterFile" />
+					-
+					<xsl:value-of select="local-name(.)" />
+					-
+					<xsl:value-of select="generate-id()" />
+				</xsl:variable>
+				<xsl:attribute name="id" select="$me" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element soCalled</desc>
+	</doc>
+	<xsl:template match="tei:soCalled">
+		<xsl:choose>
+			<xsl:when test="@rend">
+				<xsl:call-template name="rendering" />
+			</xsl:when>
+			<xsl:when test="@rendition">
+				<span>
+					<xsl:call-template name="applyRendition" />
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$preQuote" />
+				<xsl:apply-templates />
+				<xsl:value-of select="$postQuote" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Copy all attributes in HTML namespace</desc>
+	</doc>
+	<xsl:template name="htmlAttributes">
+		<xsl:for-each select="@*">
+			<xsl:if test="namespace-uri(.)='http://www.w3.org/1999/xhtml'">
+				<xsl:attribute name="{local-name(.)}">
+          <xsl:value-of select="." />
         </xsl:attribute>
-      </xsl:if>
-    </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] convert rend attribute to HTML class</desc>
-  </doc>
-  <xsl:template name="rendToClass">
-    <xsl:param name="id">true</xsl:param>
-    <xsl:param name="default">.</xsl:param>
-    <xsl:choose>
-      <xsl:when test="$id='false'"/>
-      <xsl:when test="$id=''"/>
-      <xsl:when test="$id='true' and @xml:id">
-        <xsl:attribute name="id">
-          <xsl:value-of select="@xml:id"/>
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] convert rend attribute to HTML class</desc>
+	</doc>
+	<xsl:template name="rendToClass">
+		<xsl:param name="id">
+			true
+		</xsl:param>
+		<xsl:param name="default">
+			.
+		</xsl:param>
+		<xsl:choose>
+			<xsl:when test="$id='false'" />
+			<xsl:when test="$id=''" />
+			<xsl:when test="$id='true' and @xml:id">
+				<xsl:attribute name="id">
+          <xsl:value-of select="@xml:id" />
         </xsl:attribute>
-      </xsl:when>
-      <xsl:when test="$id='true' and self::tei:p and $generateParagraphIDs='true'">
-        <xsl:attribute name="id">
-          <xsl:value-of select="generate-id()"/>
+			</xsl:when>
+			<xsl:when
+				test="$id='true' and self::tei:p and $generateParagraphIDs='true'">
+				<xsl:attribute name="id">
+          <xsl:value-of select="generate-id()" />
         </xsl:attribute>
-      </xsl:when>
-      <xsl:when test="$id='true'"/>
-      <xsl:otherwise>
-        <xsl:attribute name="id" select="$id"/>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:if test="$outputTarget='html5'">
-      <xsl:call-template name="microdata"/>
-    </xsl:if>
-    <xsl:variable name="class1">
-      <xsl:choose>
-        <xsl:when test="$default=''"/>
-        <xsl:when test="not($default='.')">
-          <xsl:value-of select="$default"/>
-        </xsl:when>
-        <xsl:when test="@type">
-          <xsl:value-of select="@type"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name()"/>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:call-template name="rendToClassHook"/>
-      <xsl:if test="tei:is-transcribable(.) and $mediaoverlay='true'">
-        <xsl:text> transcribable</xsl:text>
-      </xsl:if>
-    </xsl:variable>
-    <xsl:variable name="class2">
-      <xsl:choose>
-        <xsl:when test="@rend">
-          <xsl:value-of select="translate(@rend,'/','-')"/>
-        </xsl:when>
-        <xsl:when test="@rendition">
-          <xsl:call-template name="findRendition">
-            <xsl:with-param name="value">
-              <xsl:value-of select="@rendition"/>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:when>
-        <xsl:when test="key('TAGREND',local-name())">
-          <xsl:for-each select="key('TAGREND',local-name())">
-            <xsl:call-template name="findRendition">
-              <xsl:with-param name="value">
-                <xsl:value-of select="@render"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:for-each>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$class1='' and $class2=''"/>
-      <xsl:when test="$class2=''">
-        <xsl:attribute name="class">
-          <xsl:value-of select="normalize-space($class1)"/>
+			</xsl:when>
+			<xsl:when test="$id='true'" />
+			<xsl:otherwise>
+				<xsl:attribute name="id" select="$id" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if test="$outputTarget='html5'">
+			<xsl:call-template name="microdata" />
+		</xsl:if>
+		<xsl:variable name="class1">
+			<xsl:choose>
+				<xsl:when test="$default=''" />
+				<xsl:when test="not($default='.')">
+					<xsl:value-of select="$default" />
+				</xsl:when>
+				<xsl:when test="@type">
+					<xsl:value-of select="@type" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name()" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:call-template name="rendToClassHook" />
+			<xsl:if
+				test="tei:is-transcribable(.) and $mediaoverlay='true'">
+				<xsl:text> transcribable</xsl:text>
+			</xsl:if>
+		</xsl:variable>
+		<xsl:variable name="class2">
+			<xsl:choose>
+				<xsl:when test="@rend">
+					<xsl:value-of select="translate(@rend,'/','-')" />
+				</xsl:when>
+				<xsl:when test="@rendition">
+					<xsl:call-template name="findRendition">
+						<xsl:with-param name="value">
+							<xsl:value-of select="@rendition" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:when test="key('TAGREND',local-name())">
+					<xsl:for-each select="key('TAGREND',local-name())">
+						<xsl:call-template name="findRendition">
+							<xsl:with-param name="value">
+								<xsl:value-of select="@render" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$class1='' and $class2=''" />
+			<xsl:when test="$class2=''">
+				<xsl:attribute name="class">
+          <xsl:value-of select="normalize-space($class1)" />
         </xsl:attribute>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:attribute name="class">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:attribute name="class">
           <xsl:if test="not($class1='')">
-            <xsl:value-of select="$class1"/>
+            <xsl:value-of select="$class1" />
             <xsl:text> </xsl:text>
           </xsl:if>
-          <xsl:value-of select="$class2"/>
+          <xsl:value-of select="$class2" />
         </xsl:attribute>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:choose>
-      <xsl:when test="@rendition">
-        <xsl:call-template name="applyRendition"/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] allow for local extensions to rendToClass</desc>
-  </doc>
-  <xsl:template name="rendToClassHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] standard case of TEI element which produces a span</desc>
-  </doc>
-  <xsl:template name="makeSpan">
-    <xsl:element name="{if (tei:blockContext(.)) then 'div' else 'span'}">
-      <xsl:choose>
-        <xsl:when test="@rendition">
-          <xsl:call-template name="applyRendition"/>
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="rendToClass">
-            <xsl:with-param name="default">
-              <xsl:value-of select="local-name()"/>
-            </xsl:with-param>
-          </xsl:call-template>
-          <xsl:apply-templates/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:element>
-  </xsl:template>
-  <xsl:template name="microdata"/>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="@rendition">
+				<xsl:call-template name="applyRendition" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] allow for local extensions to rendToClass</desc>
+	</doc>
+	<xsl:template name="rendToClassHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] standard case of TEI element which produces a span</desc>
+	</doc>
+	<xsl:template name="makeSpan">
+		<xsl:element
+			name="{if (tei:blockContext(.)) then 'div' else 'span'}">
+			<xsl:choose>
+				<xsl:when test="@rendition">
+					<xsl:call-template name="applyRendition" />
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default">
+							<xsl:value-of select="local-name()" />
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+	<xsl:template name="microdata" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] processing analytic element as needed for MLA style (from Laura Mandell> </desc>
-  </doc>
-  <xsl:template match="tei:analytic" mode="mla">
-    <xsl:variable name="refIdwHash">
-      <xsl:value-of select="following-sibling::tei:monogr/tei:ref/@target"/>
-    </xsl:variable>
-    <xsl:variable name="refId">
-      <xsl:value-of select="substring-after($refIdwHash, '#')"/>
-    </xsl:variable>
-    <xsl:apply-templates/>
-    <xsl:if test="not(following-sibling::tei:monogr/tei:title[@level='m']) and $refId!=''">
-      <xsl:text> </xsl:text>
-      <xsl:if test="following-sibling::tei:monogr/tei:imprint/tei:date">
-	<xsl:value-of select="following-sibling::tei:monogr/tei:imprint/tei:date"/>
-	<xsl:text>. </xsl:text>
-      </xsl:if>
-      <xsl:choose>
-	<xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[1]">
-	  <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[1], ',')"/>
-	</xsl:when>
-	<xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][1]">
-	  <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][1], ',')"/>
-	</xsl:when>
-      </xsl:choose>
-      <xsl:choose>
-	<xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3]">
-	  <xsl:text>, </xsl:text>
-	  <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2], ',')"/>
-	  <xsl:text>, and </xsl:text>
-	</xsl:when>
-	<xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3]">
-	  <xsl:text>, </xsl:text>
-	  <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2], ',')"/>
-	  <xsl:text>, and </xsl:text>
-	</xsl:when>
-	<xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2]">
-	  <xsl:text> and </xsl:text>
-	  <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2], ',')"/>
-	</xsl:when>
-	<xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2]">
-	  <xsl:text> and </xsl:text>
-	  <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2], ',')"/>
-	</xsl:when>
-      </xsl:choose>
-      <xsl:if test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3]">
-	<xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3], ',')"/>
-      </xsl:if>
-      <xsl:if test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3]">
-	<xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3], ',')"/>
-      </xsl:if>
-      <xsl:text> </xsl:text>
-      <xsl:value-of select="following-sibling::tei:monogr/tei:imprint/tei:biblScope[@type='pp']"/>
-      <xsl:text>. </xsl:text>
-    </xsl:if>
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] processing monogr element as needed for MLA style (from Laura Mandell> </desc>
-  </doc>
-  <xsl:template match="tei:monogr" mode="mla">
-    <xsl:choose>
-      <xsl:when test="preceding-sibling::tei:analytic">
-	<xsl:choose>
-	  <xsl:when test="tei:author = parent::tei:biblStruct/tei:analytic/tei:author">
-	    <xsl:if test="tei:author[2]">
-	      <xsl:apply-templates select="tei:author"/>
-	    </xsl:if>
-	    <xsl:apply-templates select="tei:title"/>
-	    <xsl:if test="tei:edition"><xsl:apply-templates select="tei:edition"/></xsl:if>
-	    <xsl:apply-templates select="tei:editor[@role='editor']"/>
-	    <xsl:if test="tei:editor[@role='translator']">
-	      <xsl:apply-templates select="tei:editor[@role='translator']"/>
-	    </xsl:if>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:apply-templates select="tei:author"/>
-	    <xsl:apply-templates select="tei:title"/>
-	    <xsl:if test="tei:edition"><xsl:apply-templates select="tei:edition"/></xsl:if>
-	    <xsl:apply-templates select="tei:editor[@role='editor']"/>
-	    <xsl:if test="tei:editor[@role='translator']">
-	      <xsl:apply-templates select="tei:editor[@role='translator']"/>
-	    </xsl:if>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:when>
-      <xsl:when test="tei:editor[@role='editor'] and not(preceding-sibling::tei:analytic) and not(tei:author)">
-	<xsl:apply-templates select="tei:editor[@role='editor']"/>
-	<xsl:apply-templates select="tei:title"/>
-	<xsl:if test="tei:edition"><xsl:apply-templates select="tei:edition"/></xsl:if>
-	<xsl:if test="tei:editor[@role='translator']">
-	  <xsl:apply-templates select="tei:editor[@role='translator']"/>
-	</xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:apply-templates select="tei:author"/>
-	<xsl:apply-templates select="tei:title"/>
-	<xsl:if test="tei:edition"><xsl:apply-templates select="tei:edition"/></xsl:if>
-	<xsl:apply-templates select="tei:editor[@role='editor']"/>
-	<xsl:if test="tei:editor[@role='translator']">
-	  <xsl:apply-templates select="tei:editor[@role='translator']"/>
-	</xsl:if>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:choose>
-      <xsl:when test="*//tei:ref/@target and not(contains(*//tei:ref/@target, '#'))">
-	<xsl:if test="tei:imprint/tei:date[@type='update']"><xsl:value-of select="tei:imprint/tei:date[@type='update']"/></xsl:if>
-      </xsl:when>
-      <xsl:when test="ancestor-or-self::tei:biblStruct/*/tei:title/@level='u'">
-	<xsl:value-of select="tei:imprint"/>
-      </xsl:when>
-      <xsl:when test="tei:title/@level='m'">
-	<xsl:if test="tei:imprint/tei:biblScope/@type='vol'">
-	<xsl:value-of select="tei:imprint/tei:biblScope[@type='vol']"/>. </xsl:if>
-	<xsl:choose>
-	  <xsl:when test="tei:imprint/tei:pubPlace"><xsl:value-of select="tei:imprint/tei:pubPlace"/>: </xsl:when>
-	  <xsl:otherwise>[n.p.]: </xsl:otherwise>
-	</xsl:choose>
-	<xsl:choose>
-	  <xsl:when test="tei:imprint/tei:publisher"><xsl:value-of select="tei:imprint/tei:publisher"/>, </xsl:when>
-	  <xsl:otherwise>[n.p.], </xsl:otherwise>
-	</xsl:choose>
-	<xsl:choose>
-	  <xsl:when test="tei:imprint/tei:date"><xsl:value-of select="tei:imprint/tei:date"/>. </xsl:when>
-	  <xsl:otherwise>[n.d.]  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:when>
-      <xsl:when test="tei:title/@level='j'">
-	<xsl:if test="tei:imprint/tei:biblScope/@type='vol'"><xsl:value-of select="tei:imprint/tei:biblScope[@type='vol']"/></xsl:if>
-	<xsl:if test="tei:imprint/tei:biblScope/@type='no'"><xsl:text>.</xsl:text><xsl:value-of select="tei:imprint/tei:biblScope[@type='no']"/></xsl:if>
-	<xsl:if test="tei:imprint/tei:date"><xsl:text>&#10;</xsl:text>(<xsl:value-of select="tei:imprint/tei:date"/>)</xsl:if>
-	<xsl:if test="tei:imprint/tei:biblScope/@type='pp'">: <xsl:value-of select="tei:imprint/tei:biblScope[@type='pp']"/></xsl:if>
-	<xsl:text>. </xsl:text>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] processing relatedItem element as needed for MLA style (from Laura Mandell> </desc>
-  </doc>
-  
-  <xsl:template match="tei:relatedItem" mode="mla">
-    <xsl:if test="@type='otherEdition'"><xsl:text>Rpt. </xsl:text></xsl:if>
-    <xsl:if test="tei:biblStruct/tei:analytic"><xsl:apply-templates select="tei:biblStruct/tei:analytic" mode="mla"/></xsl:if>
-    <xsl:if test="tei:biblStruct/tei:monogr"><xsl:apply-templates select="tei:biblStruct/tei:monogr" mode="mla"/></xsl:if>
-  </xsl:template>
-  
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] processing analytic element as needed for MLA style (from
+			Laura Mandell> </desc>
+	</doc>
+	<xsl:template match="tei:analytic" mode="mla">
+		<xsl:variable name="refIdwHash">
+			<xsl:value-of
+				select="following-sibling::tei:monogr/tei:ref/@target" />
+		</xsl:variable>
+		<xsl:variable name="refId">
+			<xsl:value-of select="substring-after($refIdwHash, '#')" />
+		</xsl:variable>
+		<xsl:apply-templates />
+		<xsl:if
+			test="not(following-sibling::tei:monogr/tei:title[@level='m']) and $refId!=''">
+			<xsl:text> </xsl:text>
+			<xsl:if
+				test="following-sibling::tei:monogr/tei:imprint/tei:date">
+				<xsl:value-of
+					select="following-sibling::tei:monogr/tei:imprint/tei:date" />
+				<xsl:text>. </xsl:text>
+			</xsl:if>
+			<xsl:choose>
+				<xsl:when
+					test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[1]">
+					<xsl:value-of
+						select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[1], ',')" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][1]">
+					<xsl:value-of
+						select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][1], ',')" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when
+					test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3]">
+					<xsl:text>, </xsl:text>
+					<xsl:value-of
+						select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2], ',')" />
+					<xsl:text>, and </xsl:text>
+				</xsl:when>
+				<xsl:when
+					test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3]">
+					<xsl:text>, </xsl:text>
+					<xsl:value-of
+						select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2], ',')" />
+					<xsl:text>, and </xsl:text>
+				</xsl:when>
+				<xsl:when
+					test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2]">
+					<xsl:text> and </xsl:text>
+					<xsl:value-of
+						select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2], ',')" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2]">
+					<xsl:text> and </xsl:text>
+					<xsl:value-of
+						select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2], ',')" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:if
+				test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3]">
+				<xsl:value-of
+					select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3], ',')" />
+			</xsl:if>
+			<xsl:if
+				test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3]">
+				<xsl:value-of
+					select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3], ',')" />
+			</xsl:if>
+			<xsl:text> </xsl:text>
+			<xsl:value-of
+				select="following-sibling::tei:monogr/tei:imprint/tei:biblScope[@type='pp']" />
+			<xsl:text>. </xsl:text>
+		</xsl:if>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] processing monogr element as needed for MLA style (from
+			Laura Mandell> </desc>
+	</doc>
+	<xsl:template match="tei:monogr" mode="mla">
+		<xsl:choose>
+			<xsl:when test="preceding-sibling::tei:analytic">
+				<xsl:choose>
+					<xsl:when
+						test="tei:author = parent::tei:biblStruct/tei:analytic/tei:author">
+						<xsl:if test="tei:author[2]">
+							<xsl:apply-templates select="tei:author" />
+						</xsl:if>
+						<xsl:apply-templates select="tei:title" />
+						<xsl:if test="tei:edition">
+							<xsl:apply-templates select="tei:edition" />
+						</xsl:if>
+						<xsl:apply-templates
+							select="tei:editor[@role='editor']" />
+						<xsl:if test="tei:editor[@role='translator']">
+							<xsl:apply-templates
+								select="tei:editor[@role='translator']" />
+						</xsl:if>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates select="tei:author" />
+						<xsl:apply-templates select="tei:title" />
+						<xsl:if test="tei:edition">
+							<xsl:apply-templates select="tei:edition" />
+						</xsl:if>
+						<xsl:apply-templates
+							select="tei:editor[@role='editor']" />
+						<xsl:if test="tei:editor[@role='translator']">
+							<xsl:apply-templates
+								select="tei:editor[@role='translator']" />
+						</xsl:if>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when
+				test="tei:editor[@role='editor'] and not(preceding-sibling::tei:analytic) and not(tei:author)">
+				<xsl:apply-templates
+					select="tei:editor[@role='editor']" />
+				<xsl:apply-templates select="tei:title" />
+				<xsl:if test="tei:edition">
+					<xsl:apply-templates select="tei:edition" />
+				</xsl:if>
+				<xsl:if test="tei:editor[@role='translator']">
+					<xsl:apply-templates
+						select="tei:editor[@role='translator']" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="tei:author" />
+				<xsl:apply-templates select="tei:title" />
+				<xsl:if test="tei:edition">
+					<xsl:apply-templates select="tei:edition" />
+				</xsl:if>
+				<xsl:apply-templates
+					select="tei:editor[@role='editor']" />
+				<xsl:if test="tei:editor[@role='translator']">
+					<xsl:apply-templates
+						select="tei:editor[@role='translator']" />
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when
+				test="*//tei:ref/@target and not(contains(*//tei:ref/@target, '#'))">
+				<xsl:if test="tei:imprint/tei:date[@type='update']">
+					<xsl:value-of
+						select="tei:imprint/tei:date[@type='update']" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:biblStruct/*/tei:title/@level='u'">
+				<xsl:value-of select="tei:imprint" />
+			</xsl:when>
+			<xsl:when test="tei:title/@level='m'">
+				<xsl:if test="tei:imprint/tei:biblScope/@type='vol'">
+					<xsl:value-of
+						select="tei:imprint/tei:biblScope[@type='vol']" />
+					.
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="tei:imprint/tei:pubPlace">
+						<xsl:value-of select="tei:imprint/tei:pubPlace" />
+						:
+					</xsl:when>
+					<xsl:otherwise>
+						[n.p.]:
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:choose>
+					<xsl:when test="tei:imprint/tei:publisher">
+						<xsl:value-of select="tei:imprint/tei:publisher" />
+						,
+					</xsl:when>
+					<xsl:otherwise>
+						[n.p.],
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:choose>
+					<xsl:when test="tei:imprint/tei:date">
+						<xsl:value-of select="tei:imprint/tei:date" />
+						.
+					</xsl:when>
+					<xsl:otherwise>
+						[n.d.]
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="tei:title/@level='j'">
+				<xsl:if test="tei:imprint/tei:biblScope/@type='vol'">
+					<xsl:value-of
+						select="tei:imprint/tei:biblScope[@type='vol']" />
+				</xsl:if>
+				<xsl:if test="tei:imprint/tei:biblScope/@type='no'">
+					<xsl:text>.</xsl:text>
+					<xsl:value-of
+						select="tei:imprint/tei:biblScope[@type='no']" />
+				</xsl:if>
+				<xsl:if test="tei:imprint/tei:date">
+					<xsl:text>&#10;</xsl:text>
+					(
+					<xsl:value-of select="tei:imprint/tei:date" />
+					)
+				</xsl:if>
+				<xsl:if test="tei:imprint/tei:biblScope/@type='pp'">
+					:
+					<xsl:value-of
+						select="tei:imprint/tei:biblScope[@type='pp']" />
+				</xsl:if>
+				<xsl:text>. </xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] processing relatedItem element as needed for MLA style
+			(from Laura Mandell> </desc>
+	</doc>
+
+	<xsl:template match="tei:relatedItem" mode="mla">
+		<xsl:if test="@type='otherEdition'">
+			<xsl:text>Rpt. </xsl:text>
+		</xsl:if>
+		<xsl:if test="tei:biblStruct/tei:analytic">
+			<xsl:apply-templates
+				select="tei:biblStruct/tei:analytic" mode="mla" />
+		</xsl:if>
+		<xsl:if test="tei:biblStruct/tei:monogr">
+			<xsl:apply-templates
+				select="tei:biblStruct/tei:monogr" mode="mla" />
+		</xsl:if>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/header.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/header.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/header.xsl	(revision 2397)
@@ -1,120 +1,128 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:html="http://www.w3.org/1999/xhtml"
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
 
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="a fo rng tei teix">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the header module,
-      making HTML output. </p>
-         <p>This software is dual-licensed:
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="a fo rng tei teix">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the header module,
+				making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: header.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <xsl:key name="ALL-EXTRENDITION" match="@rendition[not(starts-with(.,'#'))]" use="1"/>
-  <xsl:key name="EXTRENDITION"     match="@rendition[not(starts-with(.,'#'))]" use="."/>
-  <xsl:key name="ALL-LOCALRENDITION" match="tei:rendition" use='1'/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element teiHeader</desc>
-   </doc>
-  <xsl:template match="tei:teiHeader"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: header.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>make a style section from rendition elements in the header</desc>
-   </doc>
-  
-  <xsl:template name="generateLocalCSS">
-      <xsl:if test="key('ALL-LOCALRENDITION',1)">
-         <style type="text/css">
-	   <xsl:for-each select="key('ALL-LOCALRENDITION',1)">
-	     <xsl:text>&#10;.</xsl:text>
-	     <xsl:value-of select="@xml:id"/>
-	     <xsl:text> {&#10;	</xsl:text>
-	     <xsl:value-of select="."/>
-	     <xsl:text>;&#10;}</xsl:text>
-	   </xsl:for-each>
-	   <xsl:text>&#10;</xsl:text>
-         </style>
-      </xsl:if>
-      <xsl:if test="key('ALL-EXTRENDITION',1)">
-         <style type="text/css">
-	   <xsl:for-each select="key('ALL-EXTRENDITION',1)">
-	     <xsl:variable name="pointer">
-	       <xsl:value-of select="."/>
-	     </xsl:variable>
-	     <xsl:for-each select="key('RENDITION',$pointer)[1]">
-	       <xsl:for-each select="document($pointer)">
-		 <xsl:text>&#10;.</xsl:text>
-		 <xsl:value-of select="@xml:id"/>
-		 <xsl:text> {&#10;</xsl:text>
-		 <xsl:value-of select="."/>
-		 <xsl:text>;&#10;}</xsl:text>
-	       </xsl:for-each>
-	     </xsl:for-each>
-	   </xsl:for-each>
-         </style>
-      </xsl:if>
-  </xsl:template>
+	<xsl:key name="ALL-EXTRENDITION"
+		match="@rendition[not(starts-with(.,'#'))]" use="1" />
+	<xsl:key name="EXTRENDITION"
+		match="@rendition[not(starts-with(.,'#'))]" use="." />
+	<xsl:key name="ALL-LOCALRENDITION" match="tei:rendition"
+		use='1' />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] processing licence</desc>
-  </doc>
-  <xsl:template match="tei:availability"  mode="copyrighttext">
-    <xsl:apply-templates mode="copyrighttext"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element teiHeader</desc>
+	</doc>
+	<xsl:template match="tei:teiHeader" />
 
-  <xsl:template match="tei:licence"  mode="copyrighttext">
-    <xsl:if test="@target">
-      <xsl:text>[</xsl:text>
-      <xsl:value-of select="@target"/>
-      <xsl:text>] </xsl:text>
-    </xsl:if>
-    <xsl:apply-templates/>
-  </xsl:template>
-  
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>make a style section from rendition elements in the header</desc>
+	</doc>
 
+	<xsl:template name="generateLocalCSS">
+		<xsl:if test="key('ALL-LOCALRENDITION',1)">
+			<style type="text/css">
+				<xsl:for-each select="key('ALL-LOCALRENDITION',1)">
+					<xsl:text>&#10;.</xsl:text>
+					<xsl:value-of select="@xml:id" />
+					<xsl:text> {&#10;	</xsl:text>
+					<xsl:value-of select="." />
+					<xsl:text>;&#10;}</xsl:text>
+				</xsl:for-each>
+				<xsl:text>&#10;</xsl:text>
+			</style>
+		</xsl:if>
+		<xsl:if test="key('ALL-EXTRENDITION',1)">
+			<style type="text/css">
+				<xsl:for-each select="key('ALL-EXTRENDITION',1)">
+					<xsl:variable name="pointer">
+						<xsl:value-of select="." />
+					</xsl:variable>
+					<xsl:for-each select="key('RENDITION',$pointer)[1]">
+						<xsl:for-each select="document($pointer)">
+							<xsl:text>&#10;.</xsl:text>
+							<xsl:value-of select="@xml:id" />
+							<xsl:text> {&#10;</xsl:text>
+							<xsl:value-of select="." />
+							<xsl:text>;&#10;}</xsl:text>
+						</xsl:for-each>
+					</xsl:for-each>
+				</xsl:for-each>
+			</style>
+		</xsl:if>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] processing licence</desc>
+	</doc>
+	<xsl:template match="tei:availability"
+		mode="copyrighttext">
+		<xsl:apply-templates mode="copyrighttext" />
+	</xsl:template>
+
+	<xsl:template match="tei:licence" mode="copyrighttext">
+		<xsl:if test="@target">
+			<xsl:text>[</xsl:text>
+			<xsl:value-of select="@target" />
+			<xsl:text>] </xsl:text>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
+
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/linking.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/linking.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/linking.xsl	(revision 2397)
@@ -1,560 +1,606 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-		xmlns:xs="http://www.w3.org/2001/XMLSchema"                
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="a fo rng tei html teix xs">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the linking module,
-      making HTML output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="a fo rng tei html teix xs">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the linking module,
+				making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: linking.xsl 10055 2012-01-20 18:46:11Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process any element and work out a unique identififying string</desc>
-   </doc>
-  <xsl:template match="*" mode="ident">
-      <xsl:variable name="BaseFile">
-         <xsl:value-of select="$masterFile"/>
-         <xsl:call-template name="addCorpusID"/>
-      </xsl:variable>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-      <xsl:choose>
-         <xsl:when test="@xml:id and $useIDs='true'">
-            <xsl:value-of select="@xml:id"/>
-         </xsl:when>
-         <xsl:when test="starts-with(local-name(.),'div') or
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: linking.xsl 10055 2012-01-20 18:46:11Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process any element and work out a unique identififying string</desc>
+	</doc>
+	<xsl:template match="*" mode="ident">
+		<xsl:variable name="BaseFile">
+			<xsl:value-of select="$masterFile" />
+			<xsl:call-template name="addCorpusID" />
+		</xsl:variable>
+
+		<xsl:choose>
+			<xsl:when test="@xml:id and $useIDs='true'">
+				<xsl:value-of select="@xml:id" />
+			</xsl:when>
+			<xsl:when
+				test="starts-with(local-name(.),'div') or
 			 self::tei:text">
-            <xsl:variable name="xpath">
-               <xsl:for-each select="ancestor-or-self::tei:*">
-	                 <xsl:value-of select="local-name()"/>
-	                 <xsl:text>.</xsl:text>
-	                 <xsl:number/>
-	                 <xsl:if test="not(position() = last())">
-	                    <xsl:text>_</xsl:text>
-	                 </xsl:if>
-	              </xsl:for-each>
-	           </xsl:variable>
-	           <xsl:value-of select="$BaseFile"/>
-	           <xsl:text>-</xsl:text>
-            <xsl:value-of select="substring-after(substring-after($xpath,'_text.'),'_')"/>
-         </xsl:when>
-         <xsl:when test="self::tei:TEI and parent::tei:teiCorpus">
-	   <xsl:value-of select="$masterFile"/>
-	   <xsl:call-template name="addCorpusID"/>
-	 </xsl:when>
-         <xsl:otherwise>
-	   <xsl:value-of select="$BaseFile"/>
-	   <xsl:text>-</xsl:text>
-	   <xsl:value-of select="local-name(.)"/>
-	   <xsl:text>-</xsl:text>
-	   <xsl:value-of select="generate-id()"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements *</desc>
-   </doc>
-  <xsl:template match="*" mode="generateLink">
-      <xsl:variable name="ident">
-         <xsl:apply-templates mode="ident" select="."/>
-      </xsl:variable>
-      <xsl:variable name="depth">
-         <xsl:apply-templates mode="depth" select="."/>
-      </xsl:variable>
-      <xsl:variable name="Hash">
-         <xsl:text>#</xsl:text>
-      </xsl:variable>
-      <xsl:variable name="result">
-      <xsl:choose>
-	<xsl:when test="$filePerPage='true'">
-	  <xsl:choose>
-	    <xsl:when test="preceding::tei:pb">
-	      <xsl:apply-templates select="preceding::tei:pb[1]"
-				   mode="ident"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:text>index</xsl:text>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	  <xsl:value-of select="$standardSuffix"/>
-	</xsl:when>
-         <xsl:when test="$STDOUT='true' and number($depth) &lt;= number($splitLevel)">
-            <xsl:value-of select="$masterFile"/>
-            <xsl:value-of select="$standardSuffix"/>
-            <xsl:value-of select="$urlChunkPrefix"/>
-            <xsl:value-of select="$ident"/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:elementSpec and not($STDOUT='true')">
-	           <xsl:text>ref-</xsl:text>
-	           <xsl:value-of select="ancestor::tei:elementSpec/@ident"/>
-            <xsl:value-of select="$standardSuffix"/>
-	           <xsl:value-of select="concat($Hash,$ident)"/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:classSpec and not($STDOUT='true')">
-	           <xsl:text>ref-</xsl:text>
-	           <xsl:value-of select="ancestor::tei:classSpec/@ident"/>
-            <xsl:value-of select="$standardSuffix"/>
-	           <xsl:value-of select="concat($Hash,$ident)"/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:back and not($splitBackmatter)">
-            <xsl:value-of select="concat($Hash,$ident)"/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:front and not($splitFrontmatter)">
-            <xsl:value-of select="concat($Hash,$ident)"/>
-         </xsl:when>
-	 <xsl:when test="self::tei:text and $splitLevel=0">
-	   <xsl:value-of select="$ident"/>
-	   <xsl:value-of select="$standardSuffix"/>
-	 </xsl:when>
-         <xsl:when test="number($splitLevel)= -1 and
+				<xsl:variable name="xpath">
+					<xsl:for-each select="ancestor-or-self::tei:*">
+						<xsl:value-of select="local-name()" />
+						<xsl:text>.</xsl:text>
+						<xsl:number />
+						<xsl:if test="not(position() = last())">
+							<xsl:text>_</xsl:text>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:value-of select="$BaseFile" />
+				<xsl:text>-</xsl:text>
+				<xsl:value-of
+					select="substring-after(substring-after($xpath,'_text.'),'_')" />
+			</xsl:when>
+			<xsl:when test="self::tei:TEI and parent::tei:teiCorpus">
+				<xsl:value-of select="$masterFile" />
+				<xsl:call-template name="addCorpusID" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$BaseFile" />
+				<xsl:text>-</xsl:text>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:text>-</xsl:text>
+				<xsl:value-of select="generate-id()" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements *</desc>
+	</doc>
+	<xsl:template match="*" mode="generateLink">
+		<xsl:variable name="ident">
+			<xsl:apply-templates mode="ident" select="." />
+		</xsl:variable>
+		<xsl:variable name="depth">
+			<xsl:apply-templates mode="depth" select="." />
+		</xsl:variable>
+		<xsl:variable name="Hash">
+			<xsl:text>#</xsl:text>
+		</xsl:variable>
+		<xsl:variable name="result">
+			<xsl:choose>
+				<xsl:when test="$filePerPage='true'">
+					<xsl:choose>
+						<xsl:when test="preceding::tei:pb">
+							<xsl:apply-templates
+								select="preceding::tei:pb[1]" mode="ident" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:text>index</xsl:text>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:value-of select="$standardSuffix" />
+				</xsl:when>
+				<xsl:when
+					test="$STDOUT='true' and number($depth) &lt;= number($splitLevel)">
+					<xsl:value-of select="$masterFile" />
+					<xsl:value-of select="$standardSuffix" />
+					<xsl:value-of select="$urlChunkPrefix" />
+					<xsl:value-of select="$ident" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor::tei:elementSpec and not($STDOUT='true')">
+					<xsl:text>ref-</xsl:text>
+					<xsl:value-of
+						select="ancestor::tei:elementSpec/@ident" />
+					<xsl:value-of select="$standardSuffix" />
+					<xsl:value-of select="concat($Hash,$ident)" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor::tei:classSpec and not($STDOUT='true')">
+					<xsl:text>ref-</xsl:text>
+					<xsl:value-of select="ancestor::tei:classSpec/@ident" />
+					<xsl:value-of select="$standardSuffix" />
+					<xsl:value-of select="concat($Hash,$ident)" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor::tei:back and not($splitBackmatter)">
+					<xsl:value-of select="concat($Hash,$ident)" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor::tei:front and not($splitFrontmatter)">
+					<xsl:value-of select="concat($Hash,$ident)" />
+				</xsl:when>
+				<xsl:when test="self::tei:text and $splitLevel=0">
+					<xsl:value-of select="$ident" />
+					<xsl:value-of select="$standardSuffix" />
+				</xsl:when>
+				<xsl:when
+					test="number($splitLevel)= -1 and
 			 ancestor::tei:teiCorpus">
-            <xsl:value-of select="$masterFile"/>
-            <xsl:call-template name="addCorpusID"/>
-            <xsl:value-of select="$standardSuffix"/>
-            <xsl:value-of select="concat($Hash,$ident)"/>
-         </xsl:when>
-         <xsl:when test="number($splitLevel)= -1">
-            <xsl:value-of select="concat($Hash,$ident)"/>
-         </xsl:when>
-         <xsl:when test="number($depth) &lt;= number($splitLevel)">
-            <xsl:value-of select="concat($ident,$standardSuffix)"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="parent">
-               <xsl:call-template name="locateParentDiv"/>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="$STDOUT='true'">
-                  <xsl:value-of select="$masterFile"/>
-                  <xsl:value-of select="$urlChunkPrefix"/>
-                  <xsl:value-of select="$parent"/>
-                  <xsl:text>#</xsl:text>
-                  <xsl:value-of select="$ident"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="$parent"/>
-                  <xsl:value-of select="concat($standardSuffix,'#')"/>
-                  <xsl:value-of select="$ident"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-</xsl:variable>
-<!--
-<xsl:message><xsl:value-of select="$ident"/>: <xsl:value-of
-select="$depth"/>: <xsl:value-of select="$splitLevel"/>: <xsl:value-of
-select="$result"/></xsl:message>
--->
-<xsl:value-of select="$result"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process element TEI in generateLink mode</p>
-         <p>
-            <p xmlns="http://www.w3.org/1999/xhtml"> when a &lt;div&gt; is referenced, see whether its plain
-        anchor, or needs a parent HTML name prepended </p>
-         </p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:TEI" mode="generateLink">
-      <xsl:variable name="BaseFile">
-	<xsl:apply-templates select="." mode="ident"/>
-      </xsl:variable>
-      <xsl:value-of select="concat($BaseFile,$standardSuffix)"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element anchor</desc>
-   </doc>
-  <xsl:template match="tei:anchor">
-      <xsl:call-template name="makeAnchor"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process extra elements in generateLink mode</desc>
-   </doc>
-  <xsl:template match="tei:label|tei:figure|tei:table|tei:item|tei:p|tei:bibl|tei:anchor|tei:cell|tei:lg|tei:list|tei:sp"
-                 mode="generateLink">
-      <xsl:variable name="ident">
-         <xsl:apply-templates mode="ident" select="."/>
-      </xsl:variable>
-      <xsl:variable name="file">
-         <xsl:apply-templates mode="generateLink"
-                              select="ancestor::tei:*[starts-with(local-name(),'div')][1]"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="starts-with($file,'#')">
-            <xsl:text>#</xsl:text>
-            <xsl:value-of select="$ident"/>
-         </xsl:when>
-         <xsl:when test="contains($file,'#')">
-            <xsl:value-of select="substring-before($file,'#')"/>
-            <xsl:text>#</xsl:text>
-            <xsl:value-of select="$ident"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="$file"/>
-            <xsl:text>#</xsl:text>
-            <xsl:value-of select="$ident"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element note</desc>
-   </doc>
-  <xsl:template match="tei:note" mode="generateLink">
-    <xsl:variable name="file">
-      <xsl:apply-templates mode="generateLink"
-			   select="ancestor::tei:*[starts-with(local-name(),'div')][1]"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="starts-with($file,'#')"/>
-      <xsl:when test="contains($file,'#')">
-            <xsl:value-of select="substring-before($file,'#')"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="$file"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>#</xsl:text>
-      <xsl:call-template name="noteID"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] <param name="where">where</param>
-      </desc>
-   </doc>
-  <xsl:template name="generateEndLink">
-      <xsl:param name="where"/>
-      <xsl:choose>
-	<xsl:when test="id($where)">
-	  <xsl:apply-templates mode="generateLink" select="id($where)"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:text>[[undefined </xsl:text>
-	  <xsl:value-of select="$where"/>
-	  <xsl:text>]]</xsl:text>
-	</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+					<xsl:value-of select="$masterFile" />
+					<xsl:call-template name="addCorpusID" />
+					<xsl:value-of select="$standardSuffix" />
+					<xsl:value-of select="concat($Hash,$ident)" />
+				</xsl:when>
+				<xsl:when test="number($splitLevel)= -1">
+					<xsl:value-of select="concat($Hash,$ident)" />
+				</xsl:when>
+				<xsl:when test="number($depth) &lt;= number($splitLevel)">
+					<xsl:value-of select="concat($ident,$standardSuffix)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="parent">
+						<xsl:call-template name="locateParentDiv" />
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="$STDOUT='true'">
+							<xsl:value-of select="$masterFile" />
+							<xsl:value-of select="$urlChunkPrefix" />
+							<xsl:value-of select="$parent" />
+							<xsl:text>#</xsl:text>
+							<xsl:value-of select="$ident" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$parent" />
+							<xsl:value-of select="concat($standardSuffix,'#')" />
+							<xsl:value-of select="$ident" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<!-- <xsl:message><xsl:value-of select="$ident"/>: <xsl:value-of select="$depth"/>: 
+			<xsl:value-of select="$splitLevel"/>: <xsl:value-of select="$result"/></xsl:message> -->
+		<xsl:value-of select="$result" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element TEI in generateLink mode</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> when a &lt;div&gt; is referenced, see whether its plain
+					anchor, or needs a parent HTML name prepended
+				</p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:TEI" mode="generateLink">
+		<xsl:variable name="BaseFile">
+			<xsl:apply-templates select="." mode="ident" />
+		</xsl:variable>
+		<xsl:value-of select="concat($BaseFile,$standardSuffix)" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element anchor</desc>
+	</doc>
+	<xsl:template match="tei:anchor">
+		<xsl:call-template name="makeAnchor" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process extra elements in generateLink mode</desc>
+	</doc>
+	<xsl:template
+		match="tei:label|tei:figure|tei:table|tei:item|tei:p|tei:bibl|tei:anchor|tei:cell|tei:lg|tei:list|tei:sp"
+		mode="generateLink">
+		<xsl:variable name="ident">
+			<xsl:apply-templates mode="ident" select="." />
+		</xsl:variable>
+		<xsl:variable name="file">
+			<xsl:apply-templates mode="generateLink"
+				select="ancestor::tei:*[starts-with(local-name(),'div')][1]" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="starts-with($file,'#')">
+				<xsl:text>#</xsl:text>
+				<xsl:value-of select="$ident" />
+			</xsl:when>
+			<xsl:when test="contains($file,'#')">
+				<xsl:value-of select="substring-before($file,'#')" />
+				<xsl:text>#</xsl:text>
+				<xsl:value-of select="$ident" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$file" />
+				<xsl:text>#</xsl:text>
+				<xsl:value-of select="$ident" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element note</desc>
+	</doc>
+	<xsl:template match="tei:note" mode="generateLink">
+		<xsl:variable name="file">
+			<xsl:apply-templates mode="generateLink"
+				select="ancestor::tei:*[starts-with(local-name(),'div')][1]" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="starts-with($file,'#')" />
+			<xsl:when test="contains($file,'#')">
+				<xsl:value-of select="substring-before($file,'#')" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$file" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>#</xsl:text>
+		<xsl:call-template name="noteID" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="where">where</param>
+		</desc>
+	</doc>
+	<xsl:template name="generateEndLink">
+		<xsl:param name="where" />
+		<xsl:choose>
+			<xsl:when test="id($where)">
+				<xsl:apply-templates mode="generateLink"
+					select="id($where)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>[[undefined </xsl:text>
+				<xsl:value-of select="$where" />
+				<xsl:text>]]</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Find the name of the outermost container for the
-      current object which would create an output file</desc>
-   </doc>
-  <xsl:template name="locateParentDiv">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] Find the name of the outermost container for the
+			current object which would create an output file</desc>
+	</doc>
+	<xsl:template name="locateParentDiv">
 
-      <xsl:choose>
+		<xsl:choose>
 
-	<xsl:when
-	     test="ancestor-or-self::tei:body/parent::tei:text/ancestor::tei:group">
-            <xsl:apply-templates mode="ident" select="ancestor::tei:text[1]"/>
-         </xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:body/parent::tei:text/ancestor::tei:group">
+				<xsl:apply-templates mode="ident"
+					select="ancestor::tei:text[1]" />
+			</xsl:when>
 
-	 <xsl:when test="ancestor-or-self::tei:front/parent::tei:text/ancestor::tei:group">
-            <xsl:apply-templates mode="ident" select="ancestor::tei:text[1]"/>
-         </xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:front/parent::tei:text/ancestor::tei:group">
+				<xsl:apply-templates mode="ident"
+					select="ancestor::tei:text[1]" />
+			</xsl:when>
 
-	 <xsl:when test="ancestor-or-self::tei:back/parent::tei:text/ancestor::tei:group">
-            <xsl:apply-templates mode="ident" select="ancestor::tei:text[1]"/>
-         </xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:back/parent::tei:text/ancestor::tei:group">
+				<xsl:apply-templates mode="ident"
+					select="ancestor::tei:text[1]" />
+			</xsl:when>
 
-         <xsl:when test="ancestor-or-self::tei:div and number($splitLevel) &lt; 0">
-            <xsl:apply-templates mode="ident" select="ancestor::tei:div[last()]"/>
-         </xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:div and number($splitLevel) &lt; 0">
+				<xsl:apply-templates mode="ident"
+					select="ancestor::tei:div[last()]" />
+			</xsl:when>
 
-         <xsl:when test="ancestor-or-self::tei:div">
-	   <xsl:variable name="ancestors" select="count(ancestor-or-self::tei:div)"/>
-	   <xsl:variable name="diff" select="$ancestors - number($splitLevel)"/>
-	   <xsl:variable name="what" select="if ($diff &lt;= 1) then 1
-					     else $diff "/>
-	   <xsl:apply-templates mode="ident" select="ancestor-or-self::tei:div[$what]"/>
-         </xsl:when>
+			<xsl:when test="ancestor-or-self::tei:div">
+				<xsl:variable name="ancestors"
+					select="count(ancestor-or-self::tei:div)" />
+				<xsl:variable name="diff"
+					select="$ancestors - number($splitLevel)" />
+				<xsl:variable name="what"
+					select="if ($diff &lt;= 1) then 1
+					     else $diff " />
+				<xsl:apply-templates mode="ident"
+					select="ancestor-or-self::tei:div[$what]" />
+			</xsl:when>
 
-         <xsl:otherwise>
-	   <xsl:variable name="ancestors" select="count(ancestor::tei:*[local-name()='div1'
+			<xsl:otherwise>
+				<xsl:variable name="ancestors"
+					select="count(ancestor::tei:*[local-name()='div1'
 				 or local-name()='div2'
 				 or local-name()='div3'
 				 or local-name()='div4'
 				 or local-name()='div5'
-				 or local-name()='div6'])"/>
-	   <xsl:variable name="what"
-			 select="if
+				 or local-name()='div6'])" />
+				<xsl:variable name="what"
+					select="if
 				 ($ancestors &lt; number($splitLevel)) then 1 else
-				 $ancestors - number($splitLevel) +1"/>
-            <xsl:apply-templates mode="ident"
-				 select="ancestor-or-self::tei:*[local-name()='div1'
+				 $ancestors - number($splitLevel) +1" />
+				<xsl:apply-templates mode="ident"
+					select="ancestor-or-self::tei:*[local-name()='div1'
 				 or local-name()='div2'
 				 or local-name()='div3'
 				 or local-name()='div4'
 				 or local-name()='div5'
-				 or local-name()='div6'][$what]"/>
-         </xsl:otherwise>
-      </xsl:choose>
+				 or local-name()='div6'][$what]" />
+			</xsl:otherwise>
+		</xsl:choose>
 
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] create external link<param name="ptr">ptr</param>
-         <param name="dest">dest</param>
-         <param name="class">class</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeExternalLink">
-      <xsl:param name="ptr" as="xs:boolean"  select="false()"/>
-      <xsl:param name="dest"/>
-      <xsl:param name="class">link_<xsl:value-of select="local-name(.)"/>
-      </xsl:param>
-      <a>
-        <xsl:choose>
-            <xsl:when test="@rend">
-	              <xsl:attribute name="class">
-	                 <xsl:value-of select="@rend"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] create external link
+			<param name="ptr">ptr</param>
+			<param name="dest">dest</param>
+			<param name="class">class</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeExternalLink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="dest" />
+		<xsl:param name="class">
+			link_
+			<xsl:value-of select="local-name(.)" />
+		</xsl:param>
+		<a>
+			<xsl:choose>
+				<xsl:when test="@rend">
+					<xsl:attribute name="class">
+	                 <xsl:value-of select="@rend" />
 	              </xsl:attribute>
-            </xsl:when>
-	           <xsl:when test="@rendition">
-	              <xsl:call-template name="applyRendition"/>
-	           </xsl:when>
-            <xsl:when test="parent::tei:item/parent::tei:list[@rend]">
-	              <xsl:attribute name="class">
-	                 <xsl:value-of select="parent::tei:item/parent::tei:list/@rend"/>
+				</xsl:when>
+				<xsl:when test="@rendition">
+					<xsl:call-template name="applyRendition" />
+				</xsl:when>
+				<xsl:when test="parent::tei:item/parent::tei:list[@rend]">
+					<xsl:attribute name="class">
+	                 <xsl:value-of
+						select="parent::tei:item/parent::tei:list/@rend" />
 	              </xsl:attribute>
-            </xsl:when>
-	           <xsl:when test="parent::tei:item[@rend]">
-	              <xsl:attribute name="class">
-	                 <xsl:value-of select="parent::tei:item/@rend"/>
+				</xsl:when>
+				<xsl:when test="parent::tei:item[@rend]">
+					<xsl:attribute name="class">
+	                 <xsl:value-of
+						select="parent::tei:item/@rend" />
 	              </xsl:attribute>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:attribute name="class">
-	                 <xsl:value-of select="$class"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="class">
+	                 <xsl:value-of select="$class" />
 	              </xsl:attribute>
-            </xsl:otherwise>
-        </xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
 
-         <xsl:if test="@type">
-            <xsl:attribute name="type">
-               <xsl:value-of select="@type"/>
+			<xsl:if test="@type">
+				<xsl:attribute name="type">
+               <xsl:value-of select="@type" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:attribute name="href">
-            <xsl:value-of select="$dest"/>
+			</xsl:if>
+			<xsl:attribute name="href">
+            <xsl:value-of select="$dest" />
             <xsl:if test="contains(@from,'id (')">
                <xsl:text>#</xsl:text>
-               <xsl:value-of select="substring(@from,5,string-length(normalize-space(@from))-1)"/>
+               <xsl:value-of
+				select="substring(@from,5,string-length(normalize-space(@from))-1)" />
             </xsl:if>
          </xsl:attribute>
-	 <xsl:choose>
-	   <xsl:when test="@n">
-	     <xsl:attribute name="title">
-	       <xsl:value-of select="@n"/>
+			<xsl:choose>
+				<xsl:when test="@n">
+					<xsl:attribute name="title">
+	       <xsl:value-of select="@n" />
 	     </xsl:attribute>
-	   </xsl:when>
-	 </xsl:choose>
-         <xsl:call-template name="xrefHook"/>
-         <xsl:choose>
-	   <xsl:when test="$dest=''">??</xsl:when>
-            <xsl:when test="$ptr">
-               <xsl:element name="{$urlMarkup}">
-                  <xsl:choose>
-                     <xsl:when test="starts-with($dest,'mailto:')">
-                        <xsl:value-of select="substring-after($dest,'mailto:')"/>
-                     </xsl:when>
-                     <xsl:when test="starts-with($dest,'file:')">
-                        <xsl:value-of select="substring-after($dest,'file:')"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="$dest"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:element>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:apply-templates/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </a>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] create an internal link<param name="target">target</param>
-         <param name="ptr">ptr</param>
-         <param name="dest">dest</param>
-         <param name="body">body</param>
-         <param name="class">class</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeInternalLink">
-      <xsl:param name="target"/>
-      <xsl:param name="ptr" as="xs:boolean" select="false()"/>
-      <xsl:param name="dest"/>
-      <xsl:param name="body"/>
-      <xsl:param name="class">
-         <xsl:text>link_</xsl:text>
-         <xsl:value-of select="local-name(.)"/>
-      </xsl:param>
-      <xsl:variable name="W">
-         <xsl:choose>
-            <xsl:when test="$target">
-               <xsl:value-of select="$target"/>
-            </xsl:when>
-            <xsl:when test="contains($dest,'#')">
-               <xsl:value-of select="substring-after($dest,'#')"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$dest"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:call-template name="xrefHook" />
+			<xsl:choose>
+				<xsl:when test="$dest=''">
+					??
+				</xsl:when>
+				<xsl:when test="$ptr">
+					<xsl:element name="{$urlMarkup}">
+						<xsl:choose>
+							<xsl:when test="starts-with($dest,'mailto:')">
+								<xsl:value-of
+									select="substring-after($dest,'mailto:')" />
+							</xsl:when>
+							<xsl:when test="starts-with($dest,'file:')">
+								<xsl:value-of
+									select="substring-after($dest,'file:')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="$dest" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:element>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</a>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] create an internal link
+			<param name="target">target</param>
+			<param name="ptr">ptr</param>
+			<param name="dest">dest</param>
+			<param name="body">body</param>
+			<param name="class">class</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeInternalLink">
+		<xsl:param name="target" />
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="dest" />
+		<xsl:param name="body" />
+		<xsl:param name="class">
+			<xsl:text>link_</xsl:text>
+			<xsl:value-of select="local-name(.)" />
+		</xsl:param>
+		<xsl:variable name="W">
+			<xsl:choose>
+				<xsl:when test="$target">
+					<xsl:value-of select="$target" />
+				</xsl:when>
+				<xsl:when test="contains($dest,'#')">
+					<xsl:value-of select="substring-after($dest,'#')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$dest" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <xsl:choose>
-         <xsl:when test="$dest=''">
-            <xsl:choose>
-               <xsl:when test="not($body='')">
-                  <xsl:value-of select="$body"/>
-               </xsl:when>
-               <xsl:when test="$ptr">
-                  <xsl:apply-templates mode="xref" select="id($W)">
-                     <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-                  </xsl:apply-templates>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:apply-templates/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>
-	   <xsl:variable name="eventualtarget">
-	     <xsl:choose>
-	       <xsl:when test="starts-with($dest,'#') or  contains($dest,$outputSuffix) or contains($dest,'ID=')">
-		 <xsl:value-of select="$dest"/>
-	       </xsl:when>
-	       <xsl:when test="id($W)"/>
-	       <xsl:otherwise>
-		 <xsl:apply-templates mode="generateLink" select="id($W)"/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:variable>
-	   <xsl:variable name="linktext">
-	     <xsl:choose>
-	       <xsl:when test="not($body='')">
-		 <xsl:value-of select="$body"/>
-	       </xsl:when>
-               <xsl:when test="$ptr and @type='footnote'">
-		 <xsl:text>[</xsl:text>
-		 <xsl:number level="any"/>
-		 <xsl:text>]</xsl:text>
-	       </xsl:when>
-	       <xsl:when test="$ptr and id($W)">
-		 <xsl:apply-templates mode="xref" select="id($W)">
-		   <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-		 </xsl:apply-templates>
-	       </xsl:when>
-	       <xsl:when test="$ptr">
-		 <xsl:value-of select="$dest"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:variable>
-	   <xsl:choose>
-	     <xsl:when test="$eventualtarget=''">
-	       <xsl:copy-of select="$linktext"/>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <a href="{$eventualtarget}">
-		 <xsl:call-template name="htmlAttributes"/>
-		 <xsl:choose>
-		   <xsl:when test="@rend">
-		     <xsl:attribute name="class">
-		       <xsl:value-of select="@rend"/>
+		<xsl:choose>
+			<xsl:when test="$dest=''">
+				<xsl:choose>
+					<xsl:when test="not($body='')">
+						<xsl:value-of select="$body" />
+					</xsl:when>
+					<xsl:when test="$ptr">
+						<xsl:apply-templates mode="xref"
+							select="id($W)">
+							<xsl:with-param name="minimal"
+								select="$minimalCrossRef" />
+						</xsl:apply-templates>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="eventualtarget">
+					<xsl:choose>
+						<xsl:when
+							test="starts-with($dest,'#') or  contains($dest,$outputSuffix) or contains($dest,'ID=')">
+							<xsl:value-of select="$dest" />
+						</xsl:when>
+						<xsl:when test="id($W)" />
+						<xsl:otherwise>
+							<xsl:apply-templates mode="generateLink"
+								select="id($W)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="linktext">
+					<xsl:choose>
+						<xsl:when test="not($body='')">
+							<xsl:value-of select="$body" />
+						</xsl:when>
+						<xsl:when test="$ptr and @type='footnote'">
+							<xsl:text>[</xsl:text>
+							<xsl:number level="any" />
+							<xsl:text>]</xsl:text>
+						</xsl:when>
+						<xsl:when test="$ptr and id($W)">
+							<xsl:apply-templates mode="xref"
+								select="id($W)">
+								<xsl:with-param name="minimal"
+									select="$minimalCrossRef" />
+							</xsl:apply-templates>
+						</xsl:when>
+						<xsl:when test="$ptr">
+							<xsl:value-of select="$dest" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$eventualtarget=''">
+						<xsl:copy-of select="$linktext" />
+					</xsl:when>
+					<xsl:otherwise>
+						<a href="{$eventualtarget}">
+							<xsl:call-template name="htmlAttributes" />
+							<xsl:choose>
+								<xsl:when test="@rend">
+									<xsl:attribute name="class">
+		       <xsl:value-of select="@rend" />
 		     </xsl:attribute>
-		   </xsl:when>
-		   <xsl:when test="@rendition">
-		     <xsl:call-template name="applyRendition"/>
-		   </xsl:when>
-		   <xsl:when test="string-length($class)=0"/>
-		   <xsl:otherwise>
-		     <xsl:attribute name="class">
-		       <xsl:value-of select="$class"/>
+								</xsl:when>
+								<xsl:when test="@rendition">
+									<xsl:call-template name="applyRendition" />
+								</xsl:when>
+								<xsl:when test="string-length($class)=0" />
+								<xsl:otherwise>
+									<xsl:attribute name="class">
+		       <xsl:value-of select="$class" />
 		     </xsl:attribute>
-		   </xsl:otherwise>
-		 </xsl:choose>
-		 
-		 <xsl:for-each select="id($W)">
-		     <xsl:choose>
-		       <xsl:when test="starts-with(local-name(.),'div')">
-			 <xsl:attribute name="title">
+								</xsl:otherwise>
+							</xsl:choose>
+
+							<xsl:for-each select="id($W)">
+								<xsl:choose>
+									<xsl:when test="starts-with(local-name(.),'div')">
+										<xsl:attribute name="title">
 			   <xsl:value-of
-			       select="translate(normalize-space(tei:head[1]),'&gt;&lt;','')"/>
+											select="translate(normalize-space(tei:head[1]),'&gt;&lt;','')" />
 			 </xsl:attribute>
-		       </xsl:when>
-		     </xsl:choose>
-		 </xsl:for-each>
-	       <xsl:copy-of select="$linktext"/>
-	       </a>
-	     </xsl:otherwise>
-	   </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+									</xsl:when>
+								</xsl:choose>
+							</xsl:for-each>
+							<xsl:copy-of select="$linktext" />
+						</a>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process cross-ref to note</desc>
-   </doc>
-  <xsl:template match="tei:note" mode="xref">
-      <xsl:number level="any"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process cross-ref to note</desc>
+	</doc>
+	<xsl:template match="tei:note" mode="xref">
+		<xsl:number level="any" />
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>formatting of the number part of a header</desc>
-   </doc>
-  <xsl:template name="formatHeadingNumber">
-      <xsl:param name="text"/>
-      <xsl:param name="toc"/>
-      <xsl:if test="not($text='')">
-	<span class="headingNumber">
-	  <xsl:copy-of select="$text"/>
-	</span>
-      </xsl:if>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>formatting of the number part of a header</desc>
+	</doc>
+	<xsl:template name="formatHeadingNumber">
+		<xsl:param name="text" />
+		<xsl:param name="toc" />
+		<xsl:if test="not($text='')">
+			<span class="headingNumber">
+				<xsl:copy-of select="$text" />
+			</span>
+		</xsl:if>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/oddprocessing.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/oddprocessing.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/oddprocessing.xsl	(revision 2397)
@@ -1,278 +1,363 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet version="2.0"
-  exclude-result-prefixes="#default s html a fo rng tei teix"
-  xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-  xmlns:fo="http://www.w3.org/1999/XSL/Format"
-  xmlns:html="http://www.w3.org/1999/xhtml"
-  xmlns:rng="http://relaxng.org/ns/structure/1.0"
-  xmlns:s="http://www.ascc.net/xml/schematron"
-  xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:teix="http://www.tei-c.org/ns/Examples"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns="http://www.w3.org/1999/xhtml" >
+	exclude-result-prefixes="#default s html a fo rng tei teix"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns="http://www.w3.org/1999/xhtml">
 
-  <xsl:param name="cssFile"/>
-  <xsl:param name="cssSecondaryFile"/>
-  <xsl:param name="summaryDoc">false</xsl:param>
-  <xsl:include href="../common2/tagdocs.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet dealing with elements from the tagdocs module,
-      making HTML output. </p>
-      <p>This software is dual-licensed:
+	<xsl:param name="cssFile" />
+	<xsl:param name="cssSecondaryFile" />
+	<xsl:param name="summaryDoc">
+		false
+	</xsl:param>
+	<xsl:include href="../common2/tagdocs.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the tagdocs module,
+				making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: oddprocessing.xsl 10030 2012-01-12 17:06:23Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:param name="oddmode">html</xsl:param>
-  <xsl:param name="xrefName">a</xsl:param>
-  <xsl:param name="urlName">href</xsl:param>
-  <xsl:param name="ulName">ul</xsl:param>
-  <xsl:param name="dlName">dl</xsl:param>
-  <xsl:param name="codeName">span</xsl:param>
-  <xsl:param name="colspan">colspan</xsl:param>
-  <xsl:param name="ddName">dd</xsl:param>
-  <xsl:param name="dtName">dt</xsl:param>
-  <xsl:param name="hiName">span</xsl:param>
-  <xsl:param name="itemName">li</xsl:param>
-  <xsl:param name="labelName">dt</xsl:param>
-  <xsl:param name="rendName">class</xsl:param>
-  <xsl:param name="rowName">tr</xsl:param>
-  <xsl:param name="tableName">table</xsl:param>
-  <xsl:param name="cellName">td</xsl:param>
-  <xsl:param name="divName">div</xsl:param>
-  <xsl:param name="sectionName">div</xsl:param>
-  <xsl:param name="segName">span</xsl:param>
-  <xsl:param name="outputNS">http://www.w3.org/1999/xhtml</xsl:param>
-  <xsl:key match="tei:*" name="NameToID" use="@ident"/>
-  <xsl:key name="MODEL-CLASS-MODULE" match="tei:classSpec[@type='model']" use="@module"/>
-  <xsl:key name="ATT-CLASS-MODULE" match="tei:classSpec[@type='atts']" use="@module"/>
-  <xsl:key name="ELEMENT-MODULE" match="tei:elementSpec" use="@module"/>
-  <xsl:key name="MACRO-MODULE" match="tei:macroSpec" use="@module"/>
-  <xsl:key name="ELEMENT-ALPHA" match="tei:elementSpec" use="substring(translate(@ident,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),1,1)"/>
-  <xsl:key name="MODEL-CLASS-ALPHA" match="tei:classSpec[@type='model']" use="substring(translate(@ident,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),7,1)"/>
-  <xsl:key name="ATT-CLASS-ALPHA" match="tei:classSpec[@type='atts']" use="substring(translate(@ident,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),5,1)"/>
-  <xsl:key match="tei:moduleSpec[@ident]" name="FILES" use="@ident"/>
-  <xsl:variable name="top" select="/"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[odds] Document an element, macro, or class</desc>
-  </doc>
-  <xsl:template name="refdoc">
-    <xsl:if test="$verbose='true'">
-      <xsl:message> refdoc for <xsl:value-of select="name(.)"/> - <xsl:value-of select="@ident"/>
-         </xsl:message>
-    </xsl:if>
-    <xsl:variable name="objectname">
-      <xsl:choose>
-        <xsl:when test="tei:altIdent">
-          <xsl:value-of select="tei:altIdent"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="name">
-      <xsl:value-of select="$objectname"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="self::tei:classSpec and not(@ident='att.global') and         count(key('CLASSMEMBERS',@ident))=0">
-        <xsl:if test="$verbose='true'">
-          <xsl:message> class <xsl:value-of select="@ident"/> omitted as it has no members
-      </xsl:message>
-        </xsl:if>
-      </xsl:when>
-      <xsl:when test="number($splitLevel)=-1 or $STDOUT='true'">
-        <xsl:apply-templates mode="weavebody" select="."/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="BaseFile">
-          <xsl:value-of select="$masterFile"/>
-          <xsl:if test="ancestor::tei:teiCorpus">
-            <xsl:text>-</xsl:text>
-            <xsl:choose>
-              <xsl:when test="@xml:id">
-                <xsl:value-of select="@xml:id"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:number/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:if>
-        </xsl:variable>
-        <xsl:variable name="outName">
-          <xsl:call-template name="outputChunkName">
-            <xsl:with-param name="ident">
-              <xsl:text>ref-</xsl:text>
-              <xsl:value-of select="@ident"/>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:variable>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Opening file <xsl:value-of select="$outName"/>
-               </xsl:message>
-        </xsl:if>
-        <xsl:variable name="documentationLanguage">
-          <xsl:call-template name="generateDoc"/>
-        </xsl:variable>
-        <xsl:variable name="langs">
-          <xsl:value-of select="concat(normalize-space($documentationLanguage),' ')"/>
-        </xsl:variable>
-        <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}" encoding="{$outputEncoding}" href="{$outName}" method="{$outputMethod}">
-          <xsl:element name="html" namespace="{$outputNamespace}">
-            <xsl:call-template name="addLangAtt"/>
-            <xsl:comment>THIS IS A GENERATED FILE. DO NOT EDIT (7) </xsl:comment>
-            <head>
-              <title>
-                <xsl:text>TEI </xsl:text>
-                <xsl:value-of select="substring-before(local-name(),'Spec')"/>
-                <xsl:text> </xsl:text>
-                <xsl:value-of select="$name"/>
-                <xsl:text> </xsl:text>
-                <xsl:call-template name="makeGloss">
-                  <xsl:with-param name="langs" select="$langs"/>
-                </xsl:call-template>
-              </title>
-              <xsl:call-template name="metaHTML">
-                <xsl:with-param name="title">
-                  <xsl:value-of select="substring-before(local-name(),'Spec')"/>
-                  <xsl:text> </xsl:text>
-                  <xsl:value-of select="@ident"/>
-                  <xsl:text> </xsl:text>
-                  <xsl:call-template name="makeGloss">
-                    <xsl:with-param name="langs" select="$langs"/>
-                  </xsl:call-template>
-                  <xsl:text> - </xsl:text>
-                  <xsl:call-template name="generateTitle"/>
-                </xsl:with-param>
-              </xsl:call-template>
-              <xsl:call-template name="includeCSS"/>
-              <xsl:call-template name="generateLocalCSS"/>
-              <xsl:call-template name="includeJavascript"/>
-              <xsl:call-template name="javascriptHook"/>
-            </head>
-            <body id="TOP">
-              <xsl:call-template name="bodyMicroData"/>
-              <xsl:call-template name="bodyHook"/>
-              <xsl:call-template name="guidelinesTop">
-                <xsl:with-param name="name">
-                  <xsl:value-of select="$name"/>
-                </xsl:with-param>
-              </xsl:call-template>
-              <div class="main-content">
-                <xsl:call-template name="startDivHook"/>
-                <xsl:apply-templates mode="weavebody" select="."/>
-              </div>
-              <xsl:call-template name="stdfooter">
-                <xsl:with-param name="file">
-                  <xsl:text>ref-</xsl:text>
-                  <xsl:value-of select="@ident"/>
-                </xsl:with-param>
-              </xsl:call-template>
-              <xsl:call-template name="bodyEndHook"/>
-            </body>
-          </xsl:element>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Closing file <xsl:value-of select="$outName"/>
-               </xsl:message>
-        </xsl:if>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] Provide a footer for each reference document</desc>
-  </doc>
-  <xsl:template name="refdocFooter">
-    <xsl:call-template name="preAddressHook"/>
-    <div style="margin: 20pt; font-weight: bold;">
-      <a href="{$refDocFooterURL}">
-        <xsl:value-of select="$refDocFooterText"/>
-      </a>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] <param name="text">text</param>
-      </desc>
-  </doc>
-  <xsl:template name="typewriter">
-    <xsl:param name="text"/>
-    <code>
-      <xsl:copy-of select="$text"/>
-    </code>
-  </xsl:template>
-  <xsl:template name="showRNC">
-    <xsl:param name="style"/>
-    <xsl:param name="contents"/>
-    <span class="{$style}">
-      <xsl:choose>
-        <xsl:when test="string-length($contents)&lt;50">
-          <xsl:value-of select="$contents"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="verbatim-reformatText">
-            <xsl:with-param name="sofar">0</xsl:with-param>
-            <xsl:with-param name="indent">
-              <xsl:text> </xsl:text>
-            </xsl:with-param>
-            <xsl:with-param name="text">
-              <xsl:value-of select="$contents"/>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:otherwise>
-      </xsl:choose>
-    </span>
-  </xsl:template>
-  <xsl:template name="emptySlash">
-    <xsl:param name="name"/>
-    <span class="emptySlash">
-      <xsl:value-of select="$name"/>
-    </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process elements teix:egXML</desc>
-  </doc>
-  <xsl:template match="teix:egXML">
-    <xsl:param name="simple">false</xsl:param>
-    <xsl:param name="highlight"/>
-    <div>
-      <xsl:attribute name="id">
-        <xsl:apply-templates mode="ident" select="."/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: oddprocessing.xsl 10030 2012-01-12 17:06:23Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:param name="oddmode">
+		html
+	</xsl:param>
+	<xsl:param name="xrefName">
+		a
+	</xsl:param>
+	<xsl:param name="urlName">
+		href
+	</xsl:param>
+	<xsl:param name="ulName">
+		ul
+	</xsl:param>
+	<xsl:param name="dlName">
+		dl
+	</xsl:param>
+	<xsl:param name="codeName">
+		span
+	</xsl:param>
+	<xsl:param name="colspan">
+		colspan
+	</xsl:param>
+	<xsl:param name="ddName">
+		dd
+	</xsl:param>
+	<xsl:param name="dtName">
+		dt
+	</xsl:param>
+	<xsl:param name="hiName">
+		span
+	</xsl:param>
+	<xsl:param name="itemName">
+		li
+	</xsl:param>
+	<xsl:param name="labelName">
+		dt
+	</xsl:param>
+	<xsl:param name="rendName">
+		class
+	</xsl:param>
+	<xsl:param name="rowName">
+		tr
+	</xsl:param>
+	<xsl:param name="tableName">
+		table
+	</xsl:param>
+	<xsl:param name="cellName">
+		td
+	</xsl:param>
+	<xsl:param name="divName">
+		div
+	</xsl:param>
+	<xsl:param name="sectionName">
+		div
+	</xsl:param>
+	<xsl:param name="segName">
+		span
+	</xsl:param>
+	<xsl:param name="outputNS">
+		http://www.w3.org/1999/xhtml
+	</xsl:param>
+	<xsl:key match="tei:*" name="NameToID" use="@ident" />
+	<xsl:key name="MODEL-CLASS-MODULE"
+		match="tei:classSpec[@type='model']" use="@module" />
+	<xsl:key name="ATT-CLASS-MODULE"
+		match="tei:classSpec[@type='atts']" use="@module" />
+	<xsl:key name="ELEMENT-MODULE" match="tei:elementSpec"
+		use="@module" />
+	<xsl:key name="MACRO-MODULE" match="tei:macroSpec"
+		use="@module" />
+	<xsl:key name="ELEMENT-ALPHA" match="tei:elementSpec"
+		use="substring(translate(@ident,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),1,1)" />
+	<xsl:key name="MODEL-CLASS-ALPHA"
+		match="tei:classSpec[@type='model']"
+		use="substring(translate(@ident,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),7,1)" />
+	<xsl:key name="ATT-CLASS-ALPHA"
+		match="tei:classSpec[@type='atts']"
+		use="substring(translate(@ident,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),5,1)" />
+	<xsl:key match="tei:moduleSpec[@ident]" name="FILES"
+		use="@ident" />
+	<xsl:variable name="top" select="/" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[odds] Document an element, macro, or class</desc>
+	</doc>
+	<xsl:template name="refdoc">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				refdoc for
+				<xsl:value-of select="name(.)" />
+				-
+				<xsl:value-of select="@ident" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:variable name="objectname">
+			<xsl:choose>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="name">
+			<xsl:value-of select="$objectname" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="self::tei:classSpec and not(@ident='att.global') and         count(key('CLASSMEMBERS',@ident))=0">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						class
+						<xsl:value-of select="@ident" />
+						omitted as it has no members
+					</xsl:message>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="number($splitLevel)=-1 or $STDOUT='true'">
+				<xsl:apply-templates mode="weavebody" select="." />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="BaseFile">
+					<xsl:value-of select="$masterFile" />
+					<xsl:if test="ancestor::tei:teiCorpus">
+						<xsl:text>-</xsl:text>
+						<xsl:choose>
+							<xsl:when test="@xml:id">
+								<xsl:value-of select="@xml:id" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:number />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:if>
+				</xsl:variable>
+				<xsl:variable name="outName">
+					<xsl:call-template name="outputChunkName">
+						<xsl:with-param name="ident">
+							<xsl:text>ref-</xsl:text>
+							<xsl:value-of select="@ident" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Opening file
+						<xsl:value-of select="$outName" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:variable name="documentationLanguage">
+					<xsl:call-template name="generateDoc" />
+				</xsl:variable>
+				<xsl:variable name="langs">
+					<xsl:value-of
+						select="concat(normalize-space($documentationLanguage),' ')" />
+				</xsl:variable>
+				<xsl:result-document
+					doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+					encoding="{$outputEncoding}" href="{$outName}"
+					method="{$outputMethod}">
+					<xsl:element name="html" namespace="{$outputNamespace}">
+						<xsl:call-template name="addLangAtt" />
+						<xsl:comment>
+							THIS IS A GENERATED FILE. DO NOT EDIT (7)
+						</xsl:comment>
+						<head>
+							<title>
+								<xsl:text>TEI </xsl:text>
+								<xsl:value-of
+									select="substring-before(local-name(),'Spec')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="$name" />
+								<xsl:text> </xsl:text>
+								<xsl:call-template name="makeGloss">
+									<xsl:with-param name="langs" select="$langs" />
+								</xsl:call-template>
+							</title>
+							<xsl:call-template name="metaHTML">
+								<xsl:with-param name="title">
+									<xsl:value-of
+										select="substring-before(local-name(),'Spec')" />
+									<xsl:text> </xsl:text>
+									<xsl:value-of select="@ident" />
+									<xsl:text> </xsl:text>
+									<xsl:call-template name="makeGloss">
+										<xsl:with-param name="langs" select="$langs" />
+									</xsl:call-template>
+									<xsl:text> - </xsl:text>
+									<xsl:call-template name="generateTitle" />
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:call-template name="includeCSS" />
+							<xsl:call-template name="generateLocalCSS" />
+							<xsl:call-template name="includeJavascript" />
+							<xsl:call-template name="javascriptHook" />
+						</head>
+						<body id="TOP">
+							<xsl:call-template name="bodyMicroData" />
+							<xsl:call-template name="bodyHook" />
+							<xsl:call-template name="guidelinesTop">
+								<xsl:with-param name="name">
+									<xsl:value-of select="$name" />
+								</xsl:with-param>
+							</xsl:call-template>
+							<div class="main-content">
+								<xsl:call-template name="startDivHook" />
+								<xsl:apply-templates mode="weavebody"
+									select="." />
+							</div>
+							<xsl:call-template name="stdfooter">
+								<xsl:with-param name="file">
+									<xsl:text>ref-</xsl:text>
+									<xsl:value-of select="@ident" />
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:call-template name="bodyEndHook" />
+						</body>
+					</xsl:element>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Closing file
+						<xsl:value-of select="$outName" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] Provide a footer for each reference document</desc>
+	</doc>
+	<xsl:template name="refdocFooter">
+		<xsl:call-template name="preAddressHook" />
+		<div style="margin: 20pt; font-weight: bold;">
+			<a href="{$refDocFooterURL}">
+				<xsl:value-of select="$refDocFooterText" />
+			</a>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="text">text</param>
+		</desc>
+	</doc>
+	<xsl:template name="typewriter">
+		<xsl:param name="text" />
+		<code>
+			<xsl:copy-of select="$text" />
+		</code>
+	</xsl:template>
+	<xsl:template name="showRNC">
+		<xsl:param name="style" />
+		<xsl:param name="contents" />
+		<span class="{$style}">
+			<xsl:choose>
+				<xsl:when test="string-length($contents)&lt;50">
+					<xsl:value-of select="$contents" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="verbatim-reformatText">
+						<xsl:with-param name="sofar">
+							0
+						</xsl:with-param>
+						<xsl:with-param name="indent">
+							<xsl:text> </xsl:text>
+						</xsl:with-param>
+						<xsl:with-param name="text">
+							<xsl:value-of select="$contents" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
+	<xsl:template name="emptySlash">
+		<xsl:param name="name" />
+		<span class="emptySlash">
+			<xsl:value-of select="$name" />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements teix:egXML</desc>
+	</doc>
+	<xsl:template match="teix:egXML">
+		<xsl:param name="simple">
+			false
+		</xsl:param>
+		<xsl:param name="highlight" />
+		<div>
+			<xsl:attribute name="id">
+        <xsl:apply-templates mode="ident"
+				select="." />
       </xsl:attribute>
-      <xsl:attribute name="class">
+			<xsl:attribute name="class">
 	<xsl:text>pre</xsl:text>
 	<xsl:if test="not(*)">
 	  <xsl:text> cdata</xsl:text>
@@ -289,656 +374,755 @@
 	  </xsl:otherwise>
 	</xsl:choose>
       </xsl:attribute>
-      <xsl:choose>
-        <xsl:when test="$simple='true'">
-          <xsl:apply-templates mode="verbatim">
-            <xsl:with-param name="highlight">
-              <xsl:value-of select="$highlight"/>
-            </xsl:with-param>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="egXMLStartHook"/>
-          <xsl:apply-templates mode="verbatim">
-            <xsl:with-param name="highlight">
-              <xsl:value-of select="$highlight"/>
-            </xsl:with-param>
-          </xsl:apply-templates>
-          <xsl:call-template name="egXMLEndHook"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[html] <param name="grammar">grammar</param>
-         <param name="content">content</param>
-         <param name="element">element</param>
-      </desc>
-  </doc>
-  <xsl:template name="bitOut">
-    <xsl:param name="grammar"/>
-    <xsl:param name="content"/>
-    <xsl:param name="element">pre</xsl:param>
-    <xsl:choose>
-      <xsl:when test="$displayMode='both'">
-        <div class="displayRelax">
-          <button class="displayRelaxButton">
-            <span class="RNG_Compact">
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Compact to XML format</xsl:with-param>
-              </xsl:call-template>
-            </span>
-            <span class="RNG_XML">
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">XML format to compact</xsl:with-param>
-              </xsl:call-template>
-            </span>
-          </button>
-          <pre class="RNG_XML">
-            <xsl:apply-templates mode="verbatim" select="$content/*/*"/>
-          </pre>
-          <pre class="RNG_Compact">
-            <xsl:call-template name="make-body-from-r-t-f">
-              <xsl:with-param name="schema">
-                <xsl:for-each select="$content/*">
-                  <xsl:call-template name="make-compact-schema"/>
-                </xsl:for-each>
-              </xsl:with-param>
-            </xsl:call-template>
-          </pre>
-        </div>
-      </xsl:when>
-      <xsl:when test="$displayMode='rng'">
-        <xsl:element name="{$element}">
-          <xsl:attribute name="class">eg</xsl:attribute>
-          <xsl:apply-templates mode="verbatim" select="$content/*/*"/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:when test="$displayMode='rnc'">
-        <xsl:element name="{$element}">
-          <xsl:attribute name="class">eg</xsl:attribute>
-          <xsl:call-template name="make-body-from-r-t-f">
-            <xsl:with-param name="schema">
-              <xsl:for-each select="$content/*">
-                <xsl:call-template name="make-compact-schema"/>
-              </xsl:for-each>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:element name="{$element}">
-          <xsl:attribute name="class">eg</xsl:attribute>
-          <xsl:for-each select="$content/*">
-            <xsl:apply-templates mode="literal"/>
-          </xsl:for-each>
-        </xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="showSpace">
-    <xsl:text> </xsl:text>
-  </xsl:template>
-  <xsl:template name="showSpaceBetweenItems">
-    <xsl:text> </xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:schemaSpec">
-    <xsl:choose>
-      <xsl:when test="tei:specGrpRef">
-        <xsl:variable name="SPECS">
-          <tei:schemaSpec>
-            <xsl:copy-of select="@*"/>
-            <xsl:apply-templates mode="expandSpecs"/>
-          </tei:schemaSpec>
-        </xsl:variable>
-        <xsl:for-each select="$SPECS/tei:schemaSpec">
-          <xsl:call-template name="schemaSpecWeave"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="schemaSpecWeave"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="schemaSpecWeave">
-    <xsl:if test="$verbose='true'">
-      <xsl:message>Processing schemaSpec <xsl:value-of select="@ident"/>, summaryDoc=<xsl:value-of select="$summaryDoc"/>
-         </xsl:message>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="$summaryDoc='true'">
-        <h2>Schema <xsl:value-of select="@ident"/>: changed components</h2>
-        <xsl:for-each select="tei:classSpec[@mode or @rend='change']        | tei:macroSpec[(@mode or @rend='change')]        | tei:elementSpec[(@mode or @rend='change')]">
-          <xsl:sort select="@ident"/>
-          <xsl:apply-templates mode="weave" select="."/>
-        </xsl:for-each>
-        <h2>Schema <xsl:value-of select="@ident"/>:  unchanged  components</h2>
-        <table>
-          <xsl:for-each select="tei:classSpec[not(@mode or @rend)]          | tei:macroSpec[not(@mode or  @rend)]          | tei:elementSpec[not(@mode or @rend)]">
-            <xsl:sort select="@ident"/>
-            <tr>
-              <td id="{@ident}"><a href="http://www.tei-c.org/release/doc/tei-p5-doc/{$documentationLanguage}/html/ref-{@ident}.html"><xsl:value-of select="@ident"/></a>:
-		     <xsl:call-template name="makeDescription"/></td>
-            </tr>
-          </xsl:for-each>
-        </table>
-      </xsl:when>
-      <xsl:otherwise>
-        <h2>Schema <xsl:value-of select="@ident"/>: Elements</h2>
-        <xsl:apply-templates mode="weave" select="tei:elementSpec">
-          <xsl:sort select="@ident"/>
-        </xsl:apply-templates>
-        <xsl:if test="tei:classSpec[@type='model']">
-          <h2>Schema <xsl:value-of select="@ident"/>: Model classes</h2>
-          <xsl:apply-templates mode="weave" select="tei:classSpec[@type='model']">
-            <xsl:sort select="@ident"/>
-          </xsl:apply-templates>
-        </xsl:if>
-        <xsl:if test="tei:classSpec[@type='atts']">
-          <h2>Schema <xsl:value-of select="@ident"/>: Attribute classes</h2>
-          <xsl:apply-templates mode="weave" select="tei:classSpec[@type='atts']">
-            <xsl:sort select="@ident"/>
-          </xsl:apply-templates>
-        </xsl:if>
-        <xsl:if test="tei:macroSpec">
-          <h2>Schema <xsl:value-of select="@ident"/>: Macros</h2>
-          <xsl:apply-templates mode="weave" select="tei:macroSpec">
-            <xsl:sort select="@ident"/>
-          </xsl:apply-templates>
-        </xsl:if>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[odds] make a link<param name="name">name</param>
-         <param name="id">id</param>
-      </desc>
-  </doc>
-  <xsl:template name="makeSectionHead">
-    <xsl:param name="name"/>
-    <xsl:param name="id"/>
-    <h3>
-      <xsl:attribute name="class">
+			<xsl:choose>
+				<xsl:when test="$simple='true'">
+					<xsl:apply-templates mode="verbatim">
+						<xsl:with-param name="highlight">
+							<xsl:value-of select="$highlight" />
+						</xsl:with-param>
+					</xsl:apply-templates>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="egXMLStartHook" />
+					<xsl:apply-templates mode="verbatim">
+						<xsl:with-param name="highlight">
+							<xsl:value-of select="$highlight" />
+						</xsl:with-param>
+					</xsl:apply-templates>
+					<xsl:call-template name="egXMLEndHook" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="grammar">grammar</param>
+			<param name="content">content</param>
+			<param name="element">element</param>
+		</desc>
+	</doc>
+	<xsl:template name="bitOut">
+		<xsl:param name="grammar" />
+		<xsl:param name="content" />
+		<xsl:param name="element">
+			pre
+		</xsl:param>
+		<xsl:choose>
+			<xsl:when test="$displayMode='both'">
+				<div class="displayRelax">
+					<button class="displayRelaxButton">
+						<span class="RNG_Compact">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Compact to XML format
+								</xsl:with-param>
+							</xsl:call-template>
+						</span>
+						<span class="RNG_XML">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									XML format to compact
+								</xsl:with-param>
+							</xsl:call-template>
+						</span>
+					</button>
+					<pre class="RNG_XML">
+						<xsl:apply-templates mode="verbatim"
+							select="$content/*/*" />
+					</pre>
+					<pre class="RNG_Compact">
+						<xsl:call-template name="make-body-from-r-t-f">
+							<xsl:with-param name="schema">
+								<xsl:for-each select="$content/*">
+									<xsl:call-template name="make-compact-schema" />
+								</xsl:for-each>
+							</xsl:with-param>
+						</xsl:call-template>
+					</pre>
+				</div>
+			</xsl:when>
+			<xsl:when test="$displayMode='rng'">
+				<xsl:element name="{$element}">
+					<xsl:attribute name="class">eg</xsl:attribute>
+					<xsl:apply-templates mode="verbatim"
+						select="$content/*/*" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="$displayMode='rnc'">
+				<xsl:element name="{$element}">
+					<xsl:attribute name="class">eg</xsl:attribute>
+					<xsl:call-template name="make-body-from-r-t-f">
+						<xsl:with-param name="schema">
+							<xsl:for-each select="$content/*">
+								<xsl:call-template name="make-compact-schema" />
+							</xsl:for-each>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element name="{$element}">
+					<xsl:attribute name="class">eg</xsl:attribute>
+					<xsl:for-each select="$content/*">
+						<xsl:apply-templates mode="literal" />
+					</xsl:for-each>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="showSpace">
+		<xsl:text> </xsl:text>
+	</xsl:template>
+	<xsl:template name="showSpaceBetweenItems">
+		<xsl:text> </xsl:text>
+	</xsl:template>
+	<xsl:template match="tei:schemaSpec">
+		<xsl:choose>
+			<xsl:when test="tei:specGrpRef">
+				<xsl:variable name="SPECS">
+					<tei:schemaSpec>
+						<xsl:copy-of select="@*" />
+						<xsl:apply-templates mode="expandSpecs" />
+					</tei:schemaSpec>
+				</xsl:variable>
+				<xsl:for-each select="$SPECS/tei:schemaSpec">
+					<xsl:call-template name="schemaSpecWeave" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="schemaSpecWeave" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="schemaSpecWeave">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Processing schemaSpec
+				<xsl:value-of select="@ident" />
+				, summaryDoc=
+				<xsl:value-of select="$summaryDoc" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="$summaryDoc='true'">
+				<h2>
+					Schema
+					<xsl:value-of select="@ident" />
+					: changed components
+				</h2>
+				<xsl:for-each
+					select="tei:classSpec[@mode or @rend='change']        | tei:macroSpec[(@mode or @rend='change')]        | tei:elementSpec[(@mode or @rend='change')]">
+					<xsl:sort select="@ident" />
+					<xsl:apply-templates mode="weave" select="." />
+				</xsl:for-each>
+				<h2>
+					Schema
+					<xsl:value-of select="@ident" />
+					: unchanged components
+				</h2>
+				<table>
+					<xsl:for-each
+						select="tei:classSpec[not(@mode or @rend)]          | tei:macroSpec[not(@mode or  @rend)]          | tei:elementSpec[not(@mode or @rend)]">
+						<xsl:sort select="@ident" />
+						<tr>
+							<td id="{@ident}">
+								<a
+									href="http://www.tei-c.org/release/doc/tei-p5-doc/{$documentationLanguage}/html/ref-{@ident}.html">
+									<xsl:value-of select="@ident" />
+								</a>
+								:
+								<xsl:call-template name="makeDescription" />
+							</td>
+						</tr>
+					</xsl:for-each>
+				</table>
+			</xsl:when>
+			<xsl:otherwise>
+				<h2>
+					Schema
+					<xsl:value-of select="@ident" />
+					: Elements
+				</h2>
+				<xsl:apply-templates mode="weave"
+					select="tei:elementSpec">
+					<xsl:sort select="@ident" />
+				</xsl:apply-templates>
+				<xsl:if test="tei:classSpec[@type='model']">
+					<h2>
+						Schema
+						<xsl:value-of select="@ident" />
+						: Model classes
+					</h2>
+					<xsl:apply-templates mode="weave"
+						select="tei:classSpec[@type='model']">
+						<xsl:sort select="@ident" />
+					</xsl:apply-templates>
+				</xsl:if>
+				<xsl:if test="tei:classSpec[@type='atts']">
+					<h2>
+						Schema
+						<xsl:value-of select="@ident" />
+						: Attribute classes
+					</h2>
+					<xsl:apply-templates mode="weave"
+						select="tei:classSpec[@type='atts']">
+						<xsl:sort select="@ident" />
+					</xsl:apply-templates>
+				</xsl:if>
+				<xsl:if test="tei:macroSpec">
+					<h2>
+						Schema
+						<xsl:value-of select="@ident" />
+						: Macros
+					</h2>
+					<xsl:apply-templates mode="weave"
+						select="tei:macroSpec">
+						<xsl:sort select="@ident" />
+					</xsl:apply-templates>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[odds] make a link
+			<param name="name">name</param>
+			<param name="id">id</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeSectionHead">
+		<xsl:param name="name" />
+		<xsl:param name="id" />
+		<h3>
+			<xsl:attribute name="class">
       <xsl:text>oddSpec</xsl:text>
       <xsl:if test="@status">
 	<xsl:text> status_</xsl:text>
-	<xsl:value-of select="@status"/>
+	<xsl:value-of select="@status" />
       </xsl:if>
       </xsl:attribute>
-      <xsl:call-template name="makeAnchor">
-        <xsl:with-param name="name">
-          <xsl:value-of select="$id"/>
-        </xsl:with-param>
-      </xsl:call-template>
-      <xsl:value-of select="$name"/>
-      <xsl:if test="@ns">
-	[<xsl:value-of select="@ns"/>]
-      </xsl:if>
-    </h3>
-  </xsl:template>
-  <xsl:template name="specHook">
-    <xsl:param name="name"/>
-  </xsl:template>
-  <xsl:template match="tei:ident">
-    <xsl:choose>
-      <xsl:when test="@type='class' and key('CLASSES',.)">
-        <xsl:call-template name="linkTogether">
-          <xsl:with-param name="name">
-            <xsl:value-of select="."/>
-          </xsl:with-param>
-          <xsl:with-param name="reftext">
-            <xsl:value-of select="."/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="@type">
-        <span class="ident-{@type}">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:when>
-      <xsl:otherwise>
-        <span class="ident">
-          <xsl:apply-templates/>
-        </span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:gi">
-    <xsl:variable name="lookup" select="."/>
-    <xsl:choose>
-      <xsl:when test="parent::tei:ref or parent::tei:head or string-length(@scheme)&gt;0">
-        <span class="gi">
-          <xsl:text>&lt;</xsl:text>
-          <xsl:apply-templates/>
-          <xsl:text>&gt;</xsl:text>
-        </span>
-      </xsl:when>
-      <xsl:when test="key('ELEMENTS',$lookup)">
-        <xsl:for-each select="key('ELEMENTS',$lookup)[last()]">
-          <xsl:call-template name="linkTogether">
-            <xsl:with-param name="class">gi</xsl:with-param>
-            <xsl:with-param name="name">
-              <xsl:value-of select="@ident"/>
-            </xsl:with-param>
-            <xsl:with-param name="reftext">
-              <xsl:choose>
-                <xsl:when test="tei:content/rng:empty">
-                  <span class="emptySlash">
-                    <xsl:value-of select="(tei:altIdent|@ident)[last()]"/>
-                  </span>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:value-of select="(tei:altIdent|@ident)[last()]"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <span class="gi">
-          <xsl:text>&lt;</xsl:text>
-          <xsl:apply-templates/>
-          <xsl:text>&gt;</xsl:text>
-        </span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="processSchemaFragment">
-    <xsl:param name="filename"/>
-    <div class="schemaFragment">
-      <xsl:if test="tei:elementSpec">
-        <h2>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Elements defined</xsl:with-param>
-          </xsl:call-template>
-        </h2>
-        <xsl:apply-templates mode="weave" select="tei:elementSpec">
-          <xsl:sort select="tei:altIdent|@ident"/>
-        </xsl:apply-templates>
-      </xsl:if>
-      <xsl:if test="tei:classSpec">
-        <h2>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Classes defined</xsl:with-param>
-          </xsl:call-template>
-        </h2>
-        <xsl:apply-templates mode="weave" select="tei:classSpec">
-          <xsl:sort select="tei:altIdent|@ident"/>
-        </xsl:apply-templates>
-      </xsl:if>
-      <xsl:if test="tei:macroSpec">
-        <h2>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Macros defined</xsl:with-param>
-          </xsl:call-template>
-        </h2>
-        <xsl:apply-templates mode="weave" select="tei:macroSpec">
-          <xsl:sort select="tei:altIdent|@ident"/>
-        </xsl:apply-templates>
-      </xsl:if>
-      <xsl:apply-templates select="tei:specGrpRef"/>
-    </div>
-  </xsl:template>
-  <xsl:template name="listSpecs">
-    <xsl:for-each select="..//tei:schemaSpec">
-      <hr/>
-      <xsl:for-each select="tei:classSpec">
-        <xsl:sort select="tei:altIdent"/>
-        <xsl:sort select="@ident"/>
-        <xsl:element name="{$tocElement}">
-          <xsl:attribute name="class">toclist0</xsl:attribute>
-          <a class="toclist" href="#{@ident}">
-            <xsl:choose>
-              <xsl:when test="tei:altIdent">
-                <xsl:value-of select="tei:altIdent"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="@ident"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </a>
-        </xsl:element>
-      </xsl:for-each>
-      <hr/>
-      <xsl:for-each select="tei:elementSpec">
-        <xsl:sort select="tei:altIdent"/>
-        <xsl:sort select="@ident"/>
-        <xsl:element name="{$tocElement}">
-          <xsl:attribute name="class">toclist0</xsl:attribute>
-          <a class="toclist" href="#{@ident}">
-            <xsl:choose>
-              <xsl:when test="tei:altIdent">
-                <xsl:value-of select="tei:altIdent"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="@ident"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </a>
-        </xsl:element>
-      </xsl:for-each>
-      <hr/>
-      <xsl:for-each select="tei:macroSpec">
-        <xsl:sort select="tei:altIdent"/>
-        <xsl:sort select="@ident"/>
-        <xsl:element name="{$tocElement}">
-          <xsl:attribute name="class">toclist0</xsl:attribute>
-          <a class="toclist" href="#{@ident}">
-            <xsl:choose>
-              <xsl:when test="tei:altIdent">
-                <xsl:value-of select="tei:altIdent"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="@ident"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </a>
-        </xsl:element>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="tei:elementSpec[@mode='delete']">
-    <dt>Element <xsl:value-of select="@ident"/>
-      </dt>
-    <dd>
-      <b>DELETED</b>
-    </dd>
-  </xsl:template>
-  <xsl:template name="verbatim-lineBreak">
-    <xsl:param name="id"/>
-    <xsl:text disable-output-escaping="yes">&lt;br/&gt;</xsl:text>
-  </xsl:template>
-  <xsl:template match="rng:ref/@name" mode="attributetext">
-    <xsl:variable name="me">
-      <xsl:choose>
-        <xsl:when test="contains(.,'.attributes')">
-          <xsl:value-of select="substring-before(.,'.attributes')"/>
-        </xsl:when>
-        <xsl:when test="contains(.,'.content')">
-          <xsl:value-of select="substring-before(.,'.content')"/>
-        </xsl:when>
-        <xsl:when test="contains(.,'.attribute.')">
-          <xsl:value-of select="substring-before(.,'.attribute.')"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="."/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="n" select="."/>
-    <xsl:choose>
-      <xsl:when test="contains(.,'.localattributes')">
-        <xsl:value-of select="$n"/>
-      </xsl:when>
-      <xsl:when test="contains(.,'.content')">
-        <xsl:value-of select="$n"/>
-      </xsl:when>
-      <xsl:when test="ancestor::teix:egXML">
-        <xsl:value-of select="$n"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:for-each select="$top">
-          <xsl:call-template name="linkTogether">
-            <xsl:with-param name="name">
-              <xsl:value-of select="$me"/>
-            </xsl:with-param>
-            <xsl:with-param name="reftext">
-              <xsl:value-of select="$n"/>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="rng:*">
-    <xsl:copy>
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates select="rng:*|tei:*|text()|comment()"/>
-    </xsl:copy>
-  </xsl:template>
-  <xsl:template match="rng:zeroOrMore">
-    <xsl:choose>
-      <xsl:when test="count(rng:*)=1 and rng:zeroOrMore">
-        <xsl:apply-templates select="rng:*|tei:*|text()|comment()"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <rng:zeroOrMore>
-          <xsl:copy-of select="@*"/>
-          <xsl:apply-templates select="rng:*|tei:*|text()|comment()"/>
-        </rng:zeroOrMore>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:listRef" mode="weave"/>
-  <xsl:template match="tei:elementSpec[@mode='delete']" mode="weave"/>
-  <xsl:template match="a:documentation" mode="verbatim"/>
-  <xsl:template match="tei:ptr[@type='cit']">
-    <a class="citlink">
-      <xsl:for-each select="id(substring(@target,2))">
-        <xsl:attribute name="href">
-          <xsl:apply-templates select="." mode="generateLink"/>
+			<xsl:call-template name="makeAnchor">
+				<xsl:with-param name="name">
+					<xsl:value-of select="$id" />
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:value-of select="$name" />
+			<xsl:if test="@ns">
+				[
+				<xsl:value-of select="@ns" />
+				]
+			</xsl:if>
+		</h3>
+	</xsl:template>
+	<xsl:template name="specHook">
+		<xsl:param name="name" />
+	</xsl:template>
+	<xsl:template match="tei:ident">
+		<xsl:choose>
+			<xsl:when test="@type='class' and key('CLASSES',.)">
+				<xsl:call-template name="linkTogether">
+					<xsl:with-param name="name">
+						<xsl:value-of select="." />
+					</xsl:with-param>
+					<xsl:with-param name="reftext">
+						<xsl:value-of select="." />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@type">
+				<span class="ident-{@type}">
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="ident">
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:gi">
+		<xsl:variable name="lookup" select="." />
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:ref or parent::tei:head or string-length(@scheme)&gt;0">
+				<span class="gi">
+					<xsl:text>&lt;</xsl:text>
+					<xsl:apply-templates />
+					<xsl:text>&gt;</xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:when test="key('ELEMENTS',$lookup)">
+				<xsl:for-each select="key('ELEMENTS',$lookup)[last()]">
+					<xsl:call-template name="linkTogether">
+						<xsl:with-param name="class">
+							gi
+						</xsl:with-param>
+						<xsl:with-param name="name">
+							<xsl:value-of select="@ident" />
+						</xsl:with-param>
+						<xsl:with-param name="reftext">
+							<xsl:choose>
+								<xsl:when test="tei:content/rng:empty">
+									<span class="emptySlash">
+										<xsl:value-of
+											select="(tei:altIdent|@ident)[last()]" />
+									</span>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of
+										select="(tei:altIdent|@ident)[last()]" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="gi">
+					<xsl:text>&lt;</xsl:text>
+					<xsl:apply-templates />
+					<xsl:text>&gt;</xsl:text>
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="processSchemaFragment">
+		<xsl:param name="filename" />
+		<div class="schemaFragment">
+			<xsl:if test="tei:elementSpec">
+				<h2>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Elements defined
+						</xsl:with-param>
+					</xsl:call-template>
+				</h2>
+				<xsl:apply-templates mode="weave"
+					select="tei:elementSpec">
+					<xsl:sort select="tei:altIdent|@ident" />
+				</xsl:apply-templates>
+			</xsl:if>
+			<xsl:if test="tei:classSpec">
+				<h2>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Classes defined
+						</xsl:with-param>
+					</xsl:call-template>
+				</h2>
+				<xsl:apply-templates mode="weave"
+					select="tei:classSpec">
+					<xsl:sort select="tei:altIdent|@ident" />
+				</xsl:apply-templates>
+			</xsl:if>
+			<xsl:if test="tei:macroSpec">
+				<h2>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Macros defined
+						</xsl:with-param>
+					</xsl:call-template>
+				</h2>
+				<xsl:apply-templates mode="weave"
+					select="tei:macroSpec">
+					<xsl:sort select="tei:altIdent|@ident" />
+				</xsl:apply-templates>
+			</xsl:if>
+			<xsl:apply-templates select="tei:specGrpRef" />
+		</div>
+	</xsl:template>
+	<xsl:template name="listSpecs">
+		<xsl:for-each select="..//tei:schemaSpec">
+			<hr />
+			<xsl:for-each select="tei:classSpec">
+				<xsl:sort select="tei:altIdent" />
+				<xsl:sort select="@ident" />
+				<xsl:element name="{$tocElement}">
+					<xsl:attribute name="class">toclist0</xsl:attribute>
+					<a class="toclist" href="#{@ident}">
+						<xsl:choose>
+							<xsl:when test="tei:altIdent">
+								<xsl:value-of select="tei:altIdent" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@ident" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</a>
+				</xsl:element>
+			</xsl:for-each>
+			<hr />
+			<xsl:for-each select="tei:elementSpec">
+				<xsl:sort select="tei:altIdent" />
+				<xsl:sort select="@ident" />
+				<xsl:element name="{$tocElement}">
+					<xsl:attribute name="class">toclist0</xsl:attribute>
+					<a class="toclist" href="#{@ident}">
+						<xsl:choose>
+							<xsl:when test="tei:altIdent">
+								<xsl:value-of select="tei:altIdent" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@ident" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</a>
+				</xsl:element>
+			</xsl:for-each>
+			<hr />
+			<xsl:for-each select="tei:macroSpec">
+				<xsl:sort select="tei:altIdent" />
+				<xsl:sort select="@ident" />
+				<xsl:element name="{$tocElement}">
+					<xsl:attribute name="class">toclist0</xsl:attribute>
+					<a class="toclist" href="#{@ident}">
+						<xsl:choose>
+							<xsl:when test="tei:altIdent">
+								<xsl:value-of select="tei:altIdent" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@ident" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</a>
+				</xsl:element>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="tei:elementSpec[@mode='delete']">
+		<dt>
+			Element
+			<xsl:value-of select="@ident" />
+		</dt>
+		<dd>
+			<b>DELETED</b>
+		</dd>
+	</xsl:template>
+	<xsl:template name="verbatim-lineBreak">
+		<xsl:param name="id" />
+		<xsl:text disable-output-escaping="yes">&lt;br/&gt;</xsl:text>
+	</xsl:template>
+	<xsl:template match="rng:ref/@name" mode="attributetext">
+		<xsl:variable name="me">
+			<xsl:choose>
+				<xsl:when test="contains(.,'.attributes')">
+					<xsl:value-of
+						select="substring-before(.,'.attributes')" />
+				</xsl:when>
+				<xsl:when test="contains(.,'.content')">
+					<xsl:value-of select="substring-before(.,'.content')" />
+				</xsl:when>
+				<xsl:when test="contains(.,'.attribute.')">
+					<xsl:value-of
+						select="substring-before(.,'.attribute.')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="n" select="." />
+		<xsl:choose>
+			<xsl:when test="contains(.,'.localattributes')">
+				<xsl:value-of select="$n" />
+			</xsl:when>
+			<xsl:when test="contains(.,'.content')">
+				<xsl:value-of select="$n" />
+			</xsl:when>
+			<xsl:when test="ancestor::teix:egXML">
+				<xsl:value-of select="$n" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="$top">
+					<xsl:call-template name="linkTogether">
+						<xsl:with-param name="name">
+							<xsl:value-of select="$me" />
+						</xsl:with-param>
+						<xsl:with-param name="reftext">
+							<xsl:value-of select="$n" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="rng:*">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates
+				select="rng:*|tei:*|text()|comment()" />
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template match="rng:zeroOrMore">
+		<xsl:choose>
+			<xsl:when test="count(rng:*)=1 and rng:zeroOrMore">
+				<xsl:apply-templates
+					select="rng:*|tei:*|text()|comment()" />
+			</xsl:when>
+			<xsl:otherwise>
+				<rng:zeroOrMore>
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates
+						select="rng:*|tei:*|text()|comment()" />
+				</rng:zeroOrMore>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:listRef" mode="weave" />
+	<xsl:template match="tei:elementSpec[@mode='delete']"
+		mode="weave" />
+	<xsl:template match="a:documentation" mode="verbatim" />
+	<xsl:template match="tei:ptr[@type='cit']">
+		<a class="citlink">
+			<xsl:for-each select="id(substring(@target,2))">
+				<xsl:attribute name="href">
+          <xsl:apply-templates select="."
+					mode="generateLink" />
         </xsl:attribute>
-        <xsl:apply-templates select="." mode="xref"/>
-      </xsl:for-each>
-    </a>
-  </xsl:template>
-  <xsl:template match="tei:divGen[@type='macrocat']" priority="100">
-    <h3>Alphabetical list</h3>
-    <xsl:for-each select="key('MACRODOCS',1)">
-      <xsl:sort select="@module"/>
-      <xsl:if test="generate-id(.)=generate-id(key('MACRO-MODULE',@module)[1])">
-        <div id="macro-{@module}">
-          <h3>
-            <xsl:for-each select="key('MODULES',@module)">
-              <xsl:text>[</xsl:text>
-              <xsl:value-of select="@ident"/>
-              <xsl:text>] </xsl:text>
-              <xsl:call-template name="makeDescription"/>
-            </xsl:for-each>
-          </h3>
-          <xsl:for-each select="key('MACRO-MODULE',@module)">
-            <xsl:sort select="@ident"/>
-            <xsl:call-template name="refDocLink"/>
-          </xsl:for-each>
-        </div>
-      </xsl:if>
-    </xsl:for-each>
-    <xsl:apply-templates mode="weave" select="key('MACRODOCS',1)">
-      <xsl:sort select="@ident"/>
-    </xsl:apply-templates>
-  </xsl:template>
-  <xsl:template match="tei:divGen[@type='elementcat']"  priority="100">
-    <div class="atozwrapper">
-      <xsl:call-template name="atozHeader">
-        <xsl:with-param name="Key">ELEMENT-ALPHA</xsl:with-param>
-      </xsl:call-template>
-      <xsl:for-each select="key('ELEMENTDOCS',1)">
-        <xsl:sort select="lower-case(@ident)"/>
-        <xsl:variable name="letter">
-          <xsl:value-of select="substring(@ident,1,1)"/>
-        </xsl:variable>
-        <xsl:if test="generate-id(.)=generate-id(key('ELEMENT-ALPHA',$letter)[1])">
-          <div id="element-{$letter}" class="atoz">
-            <span class="listhead">
-              <xsl:value-of select="$letter"/>
-            </span>
-            <ul class="atoz">
-              <xsl:for-each select="key('ELEMENT-ALPHA',$letter)">
-                <xsl:sort select="@ident"/>
-                <li>
-		  <xsl:call-template name="refDocLink"/>
-                </li>
-              </xsl:for-each>
-            </ul>
-          </div>
-        </xsl:if>
-      </xsl:for-each>
-    </div>
-    <div id="byMod">
-      <xsl:for-each select="key('ELEMENTDOCS',1)">
-        <xsl:sort select="@module"/>
-        <xsl:if test="generate-id(.)=generate-id(key('ELEMENT-MODULE',@module)[1])">
-          <div>
-            <h3>
-              <xsl:for-each select="key('MODULES',@module)">
-                <xsl:text>[</xsl:text>
-                <xsl:value-of select="@ident"/>
-                <xsl:text>] </xsl:text>
-                <xsl:call-template name="makeDescription"/>
-              </xsl:for-each>
-            </h3>
-            <xsl:for-each select="key('ELEMENT-MODULE',@module)">
-              <xsl:sort
-		  select="@ident"/>
-	      <xsl:call-template name="refDocLink"/>
-	    </xsl:for-each>
-          </div>
-        </xsl:if>
-      </xsl:for-each>
-    </div>
-    <xsl:for-each select="key('ELEMENTDOCS',1)">
-      <xsl:apply-templates mode="weave" select="."/>
-    </xsl:for-each>
-  </xsl:template>
+				<xsl:apply-templates select="." mode="xref" />
+			</xsl:for-each>
+		</a>
+	</xsl:template>
+	<xsl:template match="tei:divGen[@type='macrocat']"
+		priority="100">
+		<h3>Alphabetical list</h3>
+		<xsl:for-each select="key('MACRODOCS',1)">
+			<xsl:sort select="@module" />
+			<xsl:if
+				test="generate-id(.)=generate-id(key('MACRO-MODULE',@module)[1])">
+				<div id="macro-{@module}">
+					<h3>
+						<xsl:for-each select="key('MODULES',@module)">
+							<xsl:text>[</xsl:text>
+							<xsl:value-of select="@ident" />
+							<xsl:text>] </xsl:text>
+							<xsl:call-template name="makeDescription" />
+						</xsl:for-each>
+					</h3>
+					<xsl:for-each select="key('MACRO-MODULE',@module)">
+						<xsl:sort select="@ident" />
+						<xsl:call-template name="refDocLink" />
+					</xsl:for-each>
+				</div>
+			</xsl:if>
+		</xsl:for-each>
+		<xsl:apply-templates mode="weave"
+			select="key('MACRODOCS',1)">
+			<xsl:sort select="@ident" />
+		</xsl:apply-templates>
+	</xsl:template>
+	<xsl:template match="tei:divGen[@type='elementcat']"
+		priority="100">
+		<div class="atozwrapper">
+			<xsl:call-template name="atozHeader">
+				<xsl:with-param name="Key">
+					ELEMENT-ALPHA
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:for-each select="key('ELEMENTDOCS',1)">
+				<xsl:sort select="lower-case(@ident)" />
+				<xsl:variable name="letter">
+					<xsl:value-of select="substring(@ident,1,1)" />
+				</xsl:variable>
+				<xsl:if
+					test="generate-id(.)=generate-id(key('ELEMENT-ALPHA',$letter)[1])">
+					<div id="element-{$letter}" class="atoz">
+						<span class="listhead">
+							<xsl:value-of select="$letter" />
+						</span>
+						<ul class="atoz">
+							<xsl:for-each select="key('ELEMENT-ALPHA',$letter)">
+								<xsl:sort select="@ident" />
+								<li>
+									<xsl:call-template name="refDocLink" />
+								</li>
+							</xsl:for-each>
+						</ul>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+		</div>
+		<div id="byMod">
+			<xsl:for-each select="key('ELEMENTDOCS',1)">
+				<xsl:sort select="@module" />
+				<xsl:if
+					test="generate-id(.)=generate-id(key('ELEMENT-MODULE',@module)[1])">
+					<div>
+						<h3>
+							<xsl:for-each select="key('MODULES',@module)">
+								<xsl:text>[</xsl:text>
+								<xsl:value-of select="@ident" />
+								<xsl:text>] </xsl:text>
+								<xsl:call-template name="makeDescription" />
+							</xsl:for-each>
+						</h3>
+						<xsl:for-each select="key('ELEMENT-MODULE',@module)">
+							<xsl:sort select="@ident" />
+							<xsl:call-template name="refDocLink" />
+						</xsl:for-each>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+		</div>
+		<xsl:for-each select="key('ELEMENTDOCS',1)">
+			<xsl:apply-templates mode="weave" select="." />
+		</xsl:for-each>
+	</xsl:template>
 
 
-  <xsl:template name="refDocLink">
-    <span
-	class="refDocLink">
-      <a>
-	<xsl:attribute name="href">
+	<xsl:template name="refDocLink">
+		<span class="refDocLink">
+			<a>
+				<xsl:attribute name="href">
 	  <xsl:choose>
 	    <xsl:when test="number($splitLevel)=-1 or $STDOUT='true'">
 	      <xsl:text>#</xsl:text>
-	      <xsl:value-of select="@ident"/>
+	      <xsl:value-of select="@ident" />
 	    </xsl:when>
 	    <xsl:otherwise>
 	      <xsl:text>ref-</xsl:text>
-	      <xsl:value-of
-		  select="@ident"/>
-	      <xsl:value-of select="$outputSuffix"/>
+	      <xsl:value-of select="@ident" />
+	      <xsl:value-of select="$outputSuffix" />
 	    </xsl:otherwise>
 	  </xsl:choose>
 	</xsl:attribute>
-	<xsl:value-of select="@ident"/>
-      </a>
-      <xsl:text> </xsl:text>
-    </span>
-  </xsl:template>
+				<xsl:value-of select="@ident" />
+			</a>
+			<xsl:text> </xsl:text>
+		</span>
+	</xsl:template>
 
-  <xsl:template match="tei:divGen[@type='modelclasscat']"  priority="100">
-    <div class="atozwrapper">
-      <xsl:call-template name="atozHeader">
-        <xsl:with-param name="Key">MODEL-CLASS-ALPHA</xsl:with-param>
-      </xsl:call-template>
-      <xsl:for-each select="key('MODELCLASSDOCS',1)">
-        <xsl:sort select="lower-case(substring-after(@ident,'model.'))"/>
-        <xsl:variable name="letter">
-          <xsl:value-of select="substring(@ident,7,1)"/>
-        </xsl:variable>
-        <xsl:if test="generate-id(.)=generate-id(key('MODEL-CLASS-ALPHA',$letter)[1])">
-          <div id="element-{$letter}" class="atoz">
-            <span class="listhead">
-              <xsl:value-of select="$letter"/>
-            </span>
-            <ul class="atoz">
-              <xsl:for-each select="key('MODEL-CLASS-ALPHA',$letter)">
-                <xsl:sort select="lower-case(substring-after(@ident,'model.'))"/>
-                <li>
-		  <xsl:call-template name="refDocLink"/>
-                </li>
-              </xsl:for-each>
-            </ul>
-          </div>
-        </xsl:if>
-      </xsl:for-each>
-    </div>
-    <div id="byMod">
-      <xsl:for-each select="key('MODELCLASSDOCS',1)">
-        <xsl:sort select="@module"/>
-        <xsl:if test="generate-id(.)=generate-id(key('MODEL-CLASS-MODULE',@module)[1])">
-          <div>
-            <h3>
-              <xsl:for-each select="key('MODULES',@module)">
-                <xsl:text>[</xsl:text>
-                <xsl:value-of select="@ident"/>
-                <xsl:text>] </xsl:text>
-                <xsl:call-template name="makeDescription"/>
-              </xsl:for-each>
-            </h3>
-            <xsl:for-each select="key('MODEL-CLASS-MODULE',@module)">
-              <xsl:sort
-		  select="@ident"/>
-	      <xsl:call-template name="refDocLink"/>
-            </xsl:for-each>
-          </div>
-        </xsl:if>
-      </xsl:for-each>
-    </div>
-    <xsl:for-each select="key('MODELCLASSDOCS',1)">
-      <xsl:apply-templates select="." mode="weave"/>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="tei:divGen[@type='attclasscat']"  priority="100">
-    <div class="atozwrapper">
-      <xsl:call-template name="atozHeader">
-        <xsl:with-param name="Key">ATT-CLASS-ALPHA</xsl:with-param>
-      </xsl:call-template>
-      <xsl:for-each select="key('ATTCLASSDOCS',1)">
-        <xsl:sort select="lower-case(substring-after(@ident,'att.'))"/>
-        <xsl:variable name="letter">
-          <xsl:value-of select="substring(@ident,5,1)"/>
-        </xsl:variable>
-        <xsl:if test="generate-id(.)=generate-id(key('ATT-CLASS-ALPHA',$letter)[1])">
-          <div id="element-{$letter}" class="atoz">
-            <span class="listhead">
-              <xsl:value-of select="$letter"/>
-            </span>
-            <ul class="atoz">
-              <xsl:for-each select="key('ATT-CLASS-ALPHA',$letter)">
-                <xsl:sort select="lower-case(substring-after(@ident,'att.'))"/>
-                <li>
-		  <xsl:call-template name="refDocLink"/>
-		</li>
-              </xsl:for-each>
-            </ul>
-          </div>
-        </xsl:if>
-      </xsl:for-each>
-    </div>
-    <div id="byMod">
-      <xsl:for-each select="key('ATTCLASSDOCS',1)">
-        <xsl:sort select="@module"/>
-        <xsl:if test="generate-id(.)=generate-id(key('ATT-CLASS-MODULE',@module)[1])">
-          <div>
-            <h3>
-              <xsl:for-each select="key('MODULES',@module)">
-                <xsl:text>[</xsl:text>
-                <xsl:value-of select="@ident"/>
-                <xsl:text>] </xsl:text>
-                <xsl:call-template name="makeDescription"/>
-              </xsl:for-each>
-            </h3>
-            <xsl:for-each
-		select="key('ATT-CLASS-MODULE',@module)">
-	      <xsl:call-template name="refDocLink"/>
-            </xsl:for-each>
-          </div>
-        </xsl:if>
-      </xsl:for-each>
-    </div>
-    <xsl:apply-templates mode="weave" select="key('ATTCLASSDOCS',1)">
-      <xsl:sort select="@ident"/>
-    </xsl:apply-templates>
-  </xsl:template>
-  <xsl:template name="javascriptHook">
-    <xsl:call-template name="jsForOdds"/>
-  </xsl:template>
-  <xsl:template name="jsForOdds">
-    <script type="text/javascript">
-      <xsl:comment>
-        <xsl:text disable-output-escaping="yes">
+	<xsl:template match="tei:divGen[@type='modelclasscat']"
+		priority="100">
+		<div class="atozwrapper">
+			<xsl:call-template name="atozHeader">
+				<xsl:with-param name="Key">
+					MODEL-CLASS-ALPHA
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:for-each select="key('MODELCLASSDOCS',1)">
+				<xsl:sort
+					select="lower-case(substring-after(@ident,'model.'))" />
+				<xsl:variable name="letter">
+					<xsl:value-of select="substring(@ident,7,1)" />
+				</xsl:variable>
+				<xsl:if
+					test="generate-id(.)=generate-id(key('MODEL-CLASS-ALPHA',$letter)[1])">
+					<div id="element-{$letter}" class="atoz">
+						<span class="listhead">
+							<xsl:value-of select="$letter" />
+						</span>
+						<ul class="atoz">
+							<xsl:for-each
+								select="key('MODEL-CLASS-ALPHA',$letter)">
+								<xsl:sort
+									select="lower-case(substring-after(@ident,'model.'))" />
+								<li>
+									<xsl:call-template name="refDocLink" />
+								</li>
+							</xsl:for-each>
+						</ul>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+		</div>
+		<div id="byMod">
+			<xsl:for-each select="key('MODELCLASSDOCS',1)">
+				<xsl:sort select="@module" />
+				<xsl:if
+					test="generate-id(.)=generate-id(key('MODEL-CLASS-MODULE',@module)[1])">
+					<div>
+						<h3>
+							<xsl:for-each select="key('MODULES',@module)">
+								<xsl:text>[</xsl:text>
+								<xsl:value-of select="@ident" />
+								<xsl:text>] </xsl:text>
+								<xsl:call-template name="makeDescription" />
+							</xsl:for-each>
+						</h3>
+						<xsl:for-each
+							select="key('MODEL-CLASS-MODULE',@module)">
+							<xsl:sort select="@ident" />
+							<xsl:call-template name="refDocLink" />
+						</xsl:for-each>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+		</div>
+		<xsl:for-each select="key('MODELCLASSDOCS',1)">
+			<xsl:apply-templates select="." mode="weave" />
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="tei:divGen[@type='attclasscat']"
+		priority="100">
+		<div class="atozwrapper">
+			<xsl:call-template name="atozHeader">
+				<xsl:with-param name="Key">
+					ATT-CLASS-ALPHA
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:for-each select="key('ATTCLASSDOCS',1)">
+				<xsl:sort
+					select="lower-case(substring-after(@ident,'att.'))" />
+				<xsl:variable name="letter">
+					<xsl:value-of select="substring(@ident,5,1)" />
+				</xsl:variable>
+				<xsl:if
+					test="generate-id(.)=generate-id(key('ATT-CLASS-ALPHA',$letter)[1])">
+					<div id="element-{$letter}" class="atoz">
+						<span class="listhead">
+							<xsl:value-of select="$letter" />
+						</span>
+						<ul class="atoz">
+							<xsl:for-each
+								select="key('ATT-CLASS-ALPHA',$letter)">
+								<xsl:sort
+									select="lower-case(substring-after(@ident,'att.'))" />
+								<li>
+									<xsl:call-template name="refDocLink" />
+								</li>
+							</xsl:for-each>
+						</ul>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+		</div>
+		<div id="byMod">
+			<xsl:for-each select="key('ATTCLASSDOCS',1)">
+				<xsl:sort select="@module" />
+				<xsl:if
+					test="generate-id(.)=generate-id(key('ATT-CLASS-MODULE',@module)[1])">
+					<div>
+						<h3>
+							<xsl:for-each select="key('MODULES',@module)">
+								<xsl:text>[</xsl:text>
+								<xsl:value-of select="@ident" />
+								<xsl:text>] </xsl:text>
+								<xsl:call-template name="makeDescription" />
+							</xsl:for-each>
+						</h3>
+						<xsl:for-each
+							select="key('ATT-CLASS-MODULE',@module)">
+							<xsl:call-template name="refDocLink" />
+						</xsl:for-each>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+		</div>
+		<xsl:apply-templates mode="weave"
+			select="key('ATTCLASSDOCS',1)">
+			<xsl:sort select="@ident" />
+		</xsl:apply-templates>
+	</xsl:template>
+	<xsl:template name="javascriptHook">
+		<xsl:call-template name="jsForOdds" />
+	</xsl:template>
+	<xsl:template name="jsForOdds">
+		<script type="text/javascript">
+			<xsl:comment>
+				<xsl:text disable-output-escaping="yes">
 var displayXML=0;
 states=new Array()
 states[0]="element-a"
@@ -1008,182 +1192,188 @@
 }
 
 	</xsl:text>
-      </xsl:comment>
-    </script>
-  </xsl:template>
+			</xsl:comment>
+		</script>
+	</xsl:template>
 
-  <xsl:template name="identifyElement">
-    <xsl:param name="id"/>
-    <xsl:attribute name="id">
-      <xsl:value-of select="$id"/>
+	<xsl:template name="identifyElement">
+		<xsl:param name="id" />
+		<xsl:attribute name="id">
+      <xsl:value-of select="$id" />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template name="guidelinesTop">
-    <xsl:param name="name"/>
-    <div id="hdr">
-      <xsl:call-template name="stdheader">
-        <xsl:with-param name="title">
-          <xsl:value-of select="$name"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </div>
-  </xsl:template>
+	<xsl:template name="guidelinesTop">
+		<xsl:param name="name" />
+		<div id="hdr">
+			<xsl:call-template name="stdheader">
+				<xsl:with-param name="title">
+					<xsl:value-of select="$name" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</div>
+	</xsl:template>
 
-  <xsl:template name="atozHeader">
-    <xsl:param name="Key"/>
-    <div id="azindex">
-      <span>
-        <xsl:call-template name="i18n">
-          <xsl:with-param name="word">Sorted alphabetically</xsl:with-param>
-        </xsl:call-template>
-      </span>
-      <ul class="index">
-        <xsl:if test="count(key($Key,'a'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-a');" href="#">a</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'b'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-b');" href="#">b</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'c'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-c');" href="#">c</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'d'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-d');" href="#">d</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'e'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-e');" href="#">e</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'f'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-f');" href="#">f</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'g'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-g');" href="#">g</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'h'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-h');" href="#">h</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'i'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-i');" href="#">i</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'j'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-j');" href="#">j</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'k'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-k');" href="#">k</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'l'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-l');" href="#">l</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'m'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-m');" href="#">m</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'n'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-n');" href="#">n</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'o'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-o');" href="#">o</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'p'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-p');" href="#">p</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'q'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-q');" href="#">q</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'r'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-r');" href="#">r</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'s'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-s');" href="#">s</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'t'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-t');" href="#">t</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'u'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-u');" href="#">u</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'v'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-v');" href="#">v</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'w'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-w');" href="#">w</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'x'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-x');" href="#">x</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'y'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-y');" href="#">y</a>
-          </li>
-        </xsl:if>
-        <xsl:if test="count(key($Key,'z'))&gt;0">
-          <li>
-            <a onclick="hideallExcept('element-z');" href="#">z</a>
-          </li>
-        </xsl:if>
-        <li class="showall">
-          <a onclick="showall();" href="#">
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">Show all</xsl:with-param>
-            </xsl:call-template>
-          </a>
-        </li>
-        <li class="showall">
-          <a onclick="showByMod();" href="#">
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">Show by module</xsl:with-param>
-            </xsl:call-template>
-          </a>
-        </li>
-      </ul>
-    </div>
-  </xsl:template>
+	<xsl:template name="atozHeader">
+		<xsl:param name="Key" />
+		<div id="azindex">
+			<span>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						Sorted alphabetically
+					</xsl:with-param>
+				</xsl:call-template>
+			</span>
+			<ul class="index">
+				<xsl:if test="count(key($Key,'a'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-a');" href="#">a</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'b'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-b');" href="#">b</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'c'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-c');" href="#">c</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'d'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-d');" href="#">d</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'e'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-e');" href="#">e</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'f'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-f');" href="#">f</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'g'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-g');" href="#">g</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'h'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-h');" href="#">h</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'i'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-i');" href="#">i</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'j'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-j');" href="#">j</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'k'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-k');" href="#">k</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'l'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-l');" href="#">l</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'m'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-m');" href="#">m</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'n'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-n');" href="#">n</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'o'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-o');" href="#">o</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'p'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-p');" href="#">p</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'q'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-q');" href="#">q</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'r'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-r');" href="#">r</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'s'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-s');" href="#">s</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'t'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-t');" href="#">t</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'u'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-u');" href="#">u</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'v'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-v');" href="#">v</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'w'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-w');" href="#">w</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'x'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-x');" href="#">x</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'y'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-y');" href="#">y</a>
+					</li>
+				</xsl:if>
+				<xsl:if test="count(key($Key,'z'))&gt;0">
+					<li>
+						<a onclick="hideallExcept('element-z');" href="#">z</a>
+					</li>
+				</xsl:if>
+				<li class="showall">
+					<a onclick="showall();" href="#">
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								Show all
+							</xsl:with-param>
+						</xsl:call-template>
+					</a>
+				</li>
+				<li class="showall">
+					<a onclick="showByMod();" href="#">
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								Show by module
+							</xsl:with-param>
+						</xsl:call-template>
+					</a>
+				</li>
+			</ul>
+		</div>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/figures.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/figures.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/figures.xsl	(revision 2397)
@@ -1,537 +1,565 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:svg="http://www.w3.org/2000/svg"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/"                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="svg a fo html rng tei teidocx teix m"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the figures module,
-      making HTML output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:svg="http://www.w3.org/2000/svg"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="svg a fo html rng tei teidocx teix m"
+	version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the figures module,
+				making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: figures.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements m:*|@*|comment()|processing-instruction()|text()</desc>
-   </doc>
-  <xsl:template match="m:*|@*|comment()|processing-instruction()|text()" mode="math">
-      <xsl:copy>
-         <xsl:apply-templates mode="math" select="*|@*|processing-instruction()|text()"/>
-      </xsl:copy>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements m:math</desc>
-   </doc>
-  <xsl:template match="m:math">
-      <m:math>
-         <xsl:copy-of select="@*"/>
-         <xsl:apply-templates mode="math"/>
-      </m:math>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element cell</desc>
-   </doc>
-  <xsl:template match="tei:cell">
-    <xsl:variable name="cellname">
-      <xsl:choose>
-	<xsl:when test="parent::tei:row[@rend='thead']">th</xsl:when>
-	<xsl:otherwise>td</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element name="{$cellname}">
-      <xsl:for-each select="@*">
-	<xsl:choose>
-	  <xsl:when test="name(.) = 'width' or name(.) =
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: figures.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements
+			m:*|@*|comment()|processing-instruction()|text()</desc>
+	</doc>
+	<xsl:template
+		match="m:*|@*|comment()|processing-instruction()|text()" mode="math">
+		<xsl:copy>
+			<xsl:apply-templates mode="math"
+				select="*|@*|processing-instruction()|text()" />
+		</xsl:copy>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements m:math</desc>
+	</doc>
+	<xsl:template match="m:math">
+		<m:math>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates mode="math" />
+		</m:math>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element cell</desc>
+	</doc>
+	<xsl:template match="tei:cell">
+		<xsl:variable name="cellname">
+			<xsl:choose>
+				<xsl:when test="parent::tei:row[@rend='thead']">
+					th
+				</xsl:when>
+				<xsl:otherwise>
+					td
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element name="{$cellname}">
+			<xsl:for-each select="@*">
+				<xsl:choose>
+					<xsl:when
+						test="name(.) = 'width' or name(.) =
 			  'border' or name(.) = 'cellspacing'
 			  or name(.) = 'cellpadding'">
-	    <xsl:copy-of select="."/>
-	  </xsl:when>
-	  <xsl:when test="name(.)='rend' and starts-with(.,'width:')">
-	    <xsl:attribute name="width">
-	      <xsl:value-of select="substring-after(.,'width:')"/>
+						<xsl:copy-of select="." />
+					</xsl:when>
+					<xsl:when
+						test="name(.)='rend' and starts-with(.,'width:')">
+						<xsl:attribute name="width">
+	      <xsl:value-of select="substring-after(.,'width:')" />
 	    </xsl:attribute>
-	  </xsl:when>
-	  <xsl:when test="name(.)='rend' and starts-with(.,'class:')">
-	    <xsl:attribute name="class">
-	      <xsl:value-of select="substring-after(.,'class:')"/>
+					</xsl:when>
+					<xsl:when
+						test="name(.)='rend' and starts-with(.,'class:')">
+						<xsl:attribute name="class">
+	      <xsl:value-of select="substring-after(.,'class:')" />
 	    </xsl:attribute>
-	  </xsl:when>
-	  <xsl:when test="name(.)='rend' and starts-with(.,'style=')">
-	    <xsl:attribute name="style">
-	      <xsl:value-of select="substring-after(.,'style=')"/>
+					</xsl:when>
+					<xsl:when
+						test="name(.)='rend' and starts-with(.,'style=')">
+						<xsl:attribute name="style">
+	      <xsl:value-of select="substring-after(.,'style=')" />
 	    </xsl:attribute>
-	  </xsl:when>
-	  <xsl:when test="name(.)='rend'">
-	    <xsl:attribute name="class">
-	      <xsl:value-of select="."/>
+					</xsl:when>
+					<xsl:when test="name(.)='rend'">
+						<xsl:attribute name="class">
+	      <xsl:value-of select="." />
 	    </xsl:attribute>
-	  </xsl:when>
-	  <xsl:when test="name(.)='cols'">
-	    <xsl:attribute name="colspan">
-	      <xsl:value-of select="."/>
+					</xsl:when>
+					<xsl:when test="name(.)='cols'">
+						<xsl:attribute name="colspan">
+	      <xsl:value-of select="." />
 	    </xsl:attribute>
-	  </xsl:when>
-	  <xsl:when test="name(.)='rows'">
-	    <xsl:attribute name="rowspan">
-	      <xsl:value-of select="."/>
+					</xsl:when>
+					<xsl:when test="name(.)='rows'">
+						<xsl:attribute name="rowspan">
+	      <xsl:value-of select="." />
 	    </xsl:attribute>
-	  </xsl:when>
-	  <xsl:when test="name(.)='align'">
-	    <xsl:attribute name="align">
-	      <xsl:value-of select="."/>
+					</xsl:when>
+					<xsl:when test="name(.)='align'">
+						<xsl:attribute name="align">
+	      <xsl:value-of select="." />
 	    </xsl:attribute>
-	  </xsl:when>
-	</xsl:choose>
-      </xsl:for-each>
-      <xsl:choose>
-	<xsl:when test="@teidocx:align">
-	  <xsl:attribute name="align">
-	    <xsl:value-of select="@teidocx:align"/>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:for-each>
+			<xsl:choose>
+				<xsl:when test="@teidocx:align">
+					<xsl:attribute name="align">
+	    <xsl:value-of select="@teidocx:align" />
 	  </xsl:attribute>
-	</xsl:when>
-	<xsl:when test="@align"/>
-	<xsl:when test="not($cellAlign='left')">
-	  <xsl:attribute name="align">
-	    <xsl:value-of select="$cellAlign"/>
+				</xsl:when>
+				<xsl:when test="@align" />
+				<xsl:when test="not($cellAlign='left')">
+					<xsl:attribute name="align">
+	    <xsl:value-of select="$cellAlign" />
 	  </xsl:attribute>
-	</xsl:when>
-      </xsl:choose>
-      <xsl:if test="@role and not (@rend)">
-	<xsl:attribute name="class">
-	  <xsl:value-of select="@role"/>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:if test="@role and not (@rend)">
+				<xsl:attribute name="class">
+	  <xsl:value-of select="@role" />
 	</xsl:attribute>
-      </xsl:if>
-      <xsl:if test="@xml:id">	   
-	<xsl:call-template name="makeAnchor"/>
-      </xsl:if>
-      <xsl:apply-templates/>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element figDesc</desc>
-   </doc>
-  <xsl:template match="tei:figDesc"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element figure</desc>
-   </doc>
-  <xsl:template match="tei:figure">
-    <xsl:variable name="container">
-      <xsl:choose>
-	<xsl:when test="$outputTarget='html5'">figure</xsl:when>
-	<xsl:otherwise>div</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="parent::tei:head or @rend='inline' or @place='inline'">
-	<xsl:apply-templates/>
-      </xsl:when>
-      <xsl:when test="parent::tei:ref">
-	<xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:element name="{$container}">
-	  <xsl:choose>
-	    <xsl:when test="@rend">
-	      <xsl:attribute name="class">
+			</xsl:if>
+			<xsl:if test="@xml:id">
+				<xsl:call-template name="makeAnchor" />
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element figDesc</desc>
+	</doc>
+	<xsl:template match="tei:figDesc" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element figure</desc>
+	</doc>
+	<xsl:template match="tei:figure">
+		<xsl:variable name="container">
+			<xsl:choose>
+				<xsl:when test="$outputTarget='html5'">
+					figure
+				</xsl:when>
+				<xsl:otherwise>
+					div
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:head or @rend='inline' or @place='inline'">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="parent::tei:ref">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element name="{$container}">
+					<xsl:choose>
+						<xsl:when test="@rend">
+							<xsl:attribute name="class">
 		<xsl:text>figure </xsl:text>
-		<xsl:value-of select="@rend"/>
+		<xsl:value-of select="@rend" />
 	      </xsl:attribute>
-	    </xsl:when>
-	    <xsl:when test="@rendition">
-	      <xsl:call-template name="applyRendition"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:attribute name="class">
+						</xsl:when>
+						<xsl:when test="@rendition">
+							<xsl:call-template name="applyRendition" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:attribute name="class">
 		<xsl:text>figure</xsl:text>
 	      </xsl:attribute>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	  <xsl:if test="@xml:id">
-	    <xsl:attribute name="id">
-	      <xsl:value-of select="@xml:id"/>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:if test="@xml:id">
+						<xsl:attribute name="id">
+	      <xsl:value-of select="@xml:id" />
 	    </xsl:attribute>
-	  </xsl:if>
-	  <xsl:call-template name="figureHook"/>
-	  <xsl:apply-templates/>
-	</xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element figure/tei:head</desc>
-  </doc>
-  <xsl:template match="tei:figure/tei:head">
-    <xsl:variable name="captionlabel">
-      <xsl:for-each select="..">
-	<xsl:call-template name="calculateFigureNumber"/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$outputTarget='html5'">
-	<figcaption>
-	  <xsl:if test="@rend">
-	    <xsl:attribute name="class" select="@rend"/>
-	  </xsl:if>
-	  <xsl:call-template name="rendering"/>
-	  <xsl:text>. </xsl:text>
-	  <xsl:copy-of select="$captionlabel"/>
-	  <xsl:apply-templates/>
-	</figcaption>
-      </xsl:when>
-      <xsl:otherwise>
-	<span class="caption {@rend}">
-	  <xsl:copy-of select="$captionlabel"/>
-	  <xsl:text>. </xsl:text>
-	  <xsl:apply-templates/>
-	</span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+					</xsl:if>
+					<xsl:call-template name="figureHook" />
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element figure/tei:head</desc>
+	</doc>
+	<xsl:template match="tei:figure/tei:head">
+		<xsl:variable name="captionlabel">
+			<xsl:for-each select="..">
+				<xsl:call-template name="calculateFigureNumber" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$outputTarget='html5'">
+				<figcaption>
+					<xsl:if test="@rend">
+						<xsl:attribute name="class" select="@rend" />
+					</xsl:if>
+					<xsl:call-template name="rendering" />
+					<xsl:text>. </xsl:text>
+					<xsl:copy-of select="$captionlabel" />
+					<xsl:apply-templates />
+				</figcaption>
+			</xsl:when>
+			<xsl:otherwise>
+				<span class="caption {@rend}">
+					<xsl:copy-of select="$captionlabel" />
+					<xsl:text>. </xsl:text>
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element formula</desc>
-  </doc>
-  <xsl:template match="tei:formula" mode="xref">
-    <xsl:number/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element graphic</desc>
-   </doc>
-  <xsl:template match="tei:graphic">
-      <xsl:call-template name="showGraphic"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element row</desc>
-   </doc>
-  <xsl:template match="tei:row">
-      <tr>
-         <xsl:call-template name="rendToClass">
-	           <xsl:with-param name="default"/>
-         </xsl:call-template>
-         <xsl:if test="@role">
-            <xsl:attribute name="class">
-               <xsl:value-of select="@role"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element formula</desc>
+	</doc>
+	<xsl:template match="tei:formula" mode="xref">
+		<xsl:number />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element graphic</desc>
+	</doc>
+	<xsl:template match="tei:graphic">
+		<xsl:call-template name="showGraphic" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element row</desc>
+	</doc>
+	<xsl:template match="tei:row">
+		<tr>
+			<xsl:call-template name="rendToClass">
+				<xsl:with-param name="default" />
+			</xsl:call-template>
+			<xsl:if test="@role">
+				<xsl:attribute name="class">
+               <xsl:value-of select="@role" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:apply-templates/>
-      </tr>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element table</desc>
-   </doc>
-  <xsl:template match="tei:table">
-      <div>
-         <xsl:attribute name="class">
+			</xsl:if>
+			<xsl:apply-templates />
+		</tr>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element table</desc>
+	</doc>
+	<xsl:template match="tei:table">
+		<div>
+			<xsl:attribute name="class">
 	   <xsl:text>table</xsl:text>
 	   <xsl:if test="@align">
 	     <xsl:text> </xsl:text>
-	     <xsl:value-of select="@align"/>
+	     <xsl:value-of select="@align" />
 	   </xsl:if>
 	 </xsl:attribute>
-	 <xsl:if test="@xml:id">	   
-	   <xsl:call-template name="makeAnchor"/>
-	 </xsl:if>
-	 <table>
-	   <xsl:call-template name="rendToClass">
-	     <xsl:with-param name="id">false</xsl:with-param>
-	   </xsl:call-template>
-	   <xsl:if test="@rend='frame' or @rend='rules'">
-	     <xsl:attribute name="rules">all</xsl:attribute>
-	     <xsl:attribute name="border">1</xsl:attribute>
-	   </xsl:if>
-	   <xsl:for-each select="@*">
-	     <xsl:if test="name(.)='summary' or name(.) = 'width' or name(.) = 'border' or name(.) = 'frame' or name(.) = 'rules' or name(.) = 'cellspacing' or name(.) = 'cellpadding'">
-	       <xsl:copy-of select="."/>
-	     </xsl:if>
-	   </xsl:for-each>
-	   <xsl:if test="tei:head">
-	     <caption>
-	       <xsl:apply-templates select="tei:head"/>
-	     </caption>
-	   </xsl:if>
-	   <xsl:choose>
-	     <xsl:when test="tei:row[@rend='thead']">
-	       <thead>
-		 <xsl:apply-templates
-		     select="tei:row[@rend='thead']"/>
-	       </thead>
-	       <tbody>
-		 <xsl:apply-templates select="tei:row[not(@rend='thead')]"/>
-	       </tbody>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <xsl:apply-templates select="tei:row"/>
-	     </xsl:otherwise>
-	   </xsl:choose>
-	 </table>
-	 <xsl:apply-templates select="tei:note"/>
-      </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element table[@rend='simple']</desc>
-   </doc>
-  <xsl:template match="tei:table[@rend='simple']">
-      <table>
-         <xsl:choose>
-	           <xsl:when test="@rend">
-	              <xsl:attribute name="class">
-	                 <xsl:value-of select="@rend"/>
+			<xsl:if test="@xml:id">
+				<xsl:call-template name="makeAnchor" />
+			</xsl:if>
+			<table>
+				<xsl:call-template name="rendToClass">
+					<xsl:with-param name="id">
+						false
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if test="@rend='frame' or @rend='rules'">
+					<xsl:attribute name="rules">all</xsl:attribute>
+					<xsl:attribute name="border">1</xsl:attribute>
+				</xsl:if>
+				<xsl:for-each select="@*">
+					<xsl:if
+						test="name(.)='summary' or name(.) = 'width' or name(.) = 'border' or name(.) = 'frame' or name(.) = 'rules' or name(.) = 'cellspacing' or name(.) = 'cellpadding'">
+						<xsl:copy-of select="." />
+					</xsl:if>
+				</xsl:for-each>
+				<xsl:if test="tei:head">
+					<caption>
+						<xsl:apply-templates select="tei:head" />
+					</caption>
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="tei:row[@rend='thead']">
+						<thead>
+							<xsl:apply-templates
+								select="tei:row[@rend='thead']" />
+						</thead>
+						<tbody>
+							<xsl:apply-templates
+								select="tei:row[not(@rend='thead')]" />
+						</tbody>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates select="tei:row" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</table>
+			<xsl:apply-templates select="tei:note" />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element table[@rend='simple']</desc>
+	</doc>
+	<xsl:template match="tei:table[@rend='simple']">
+		<table>
+			<xsl:choose>
+				<xsl:when test="@rend">
+					<xsl:attribute name="class">
+	                 <xsl:value-of select="@rend" />
                </xsl:attribute>
-	           </xsl:when>
-	           <xsl:when test="@rendition">
-	              <xsl:call-template name="applyRendition"/>
-	           </xsl:when>
-         </xsl:choose>
-         <xsl:for-each select="@*">
-            <xsl:if test="name(.)='summary'    or name(.) = 'width'    or name(.) = 'border'    or name(.) = 'frame'    or name(.) = 'rules'    or name(.) = 'cellspacing'    or name(.) = 'cellpadding'">
-               <xsl:copy-of select="."/>
-            </xsl:if>
-         </xsl:for-each>
-	 <xsl:if test="@xml:id">
-	   <xsl:call-template name="makeAnchor"/>
-	 </xsl:if>
-         <xsl:apply-templates/>
-      </table>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] <param name="name">name</param>
-         <param name="value">value</param>
-      </desc>
-   </doc>
-  <xsl:template name="setDimension">
-      <xsl:param name="name"/>
-      <xsl:param name="value"/>
+				</xsl:when>
+				<xsl:when test="@rendition">
+					<xsl:call-template name="applyRendition" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:for-each select="@*">
+				<xsl:if
+					test="name(.)='summary'    or name(.) = 'width'    or name(.) = 'border'    or name(.) = 'frame'    or name(.) = 'rules'    or name(.) = 'cellspacing'    or name(.) = 'cellpadding'">
+					<xsl:copy-of select="." />
+				</xsl:if>
+			</xsl:for-each>
+			<xsl:if test="@xml:id">
+				<xsl:call-template name="makeAnchor" />
+			</xsl:if>
+			<xsl:apply-templates />
+		</table>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="name">name</param>
+			<param name="value">value</param>
+		</desc>
+	</doc>
+	<xsl:template name="setDimension">
+		<xsl:param name="name" />
+		<xsl:param name="value" />
 
-      <xsl:variable name="calcvalue">
-         <xsl:choose>
-            <xsl:when test="contains($value,'in')">
-               <xsl:value-of select="round($dpi * number(substring-before($value,'in')))"/>
-            </xsl:when>
-            <xsl:when test="contains($value,'pt')">
-               <xsl:value-of select="round($dpi * (number(substring-before($value,'pt')) div 72))"/>
-            </xsl:when>
-            <xsl:when test="contains($value,'cm')">
-               <xsl:value-of select="round($dpi * (number(substring-before($value,'cm')) div 2.54 ))"/>
-            </xsl:when>
-            <xsl:when test="contains($value,'px')">
-               <xsl:value-of select="substring-before($value,'px')"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$value"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:attribute name="{$name}">
-         <xsl:value-of select="$calcvalue"/>
+		<xsl:variable name="calcvalue">
+			<xsl:choose>
+				<xsl:when test="contains($value,'in')">
+					<xsl:value-of
+						select="round($dpi * number(substring-before($value,'in')))" />
+				</xsl:when>
+				<xsl:when test="contains($value,'pt')">
+					<xsl:value-of
+						select="round($dpi * (number(substring-before($value,'pt')) div 72))" />
+				</xsl:when>
+				<xsl:when test="contains($value,'cm')">
+					<xsl:value-of
+						select="round($dpi * (number(substring-before($value,'cm')) div 2.54 ))" />
+				</xsl:when>
+				<xsl:when test="contains($value,'px')">
+					<xsl:value-of select="substring-before($value,'px')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$value" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:attribute name="{$name}">
+         <xsl:value-of select="$calcvalue" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="showGraphic">
-      <xsl:variable name="File">
-         <xsl:choose>
-            <xsl:when test="@url">
-               <xsl:value-of select="@url"/>
-               <xsl:if test="not(contains(@url,'.'))">
-                  <xsl:value-of select="$graphicsSuffix"/>
-               </xsl:if>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:message terminate="yes">Cannot work out how to do a graphic
-          </xsl:message>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="Alt">
-         <xsl:choose>
-            <xsl:when test="tei:desc">
-               <xsl:for-each select="tei:desc">
-		 <xsl:apply-templates mode="plain"/>
-	       </xsl:for-each>
-            </xsl:when>
-            <xsl:when test="tei:figDesc">
-               <xsl:for-each select="tei:figDesc">
-	                 <xsl:apply-templates mode="plain"/>
-	              </xsl:for-each>
-            </xsl:when>
-            <xsl:when test="tei:head">
-               <xsl:value-of select="tei:head/text()"/>
-            </xsl:when>
-            <xsl:when test="parent::tei:figure/tei:figDesc">
-               <xsl:for-each select="parent::tei:figure/tei:figDesc">
-	                 <xsl:apply-templates mode="plain"/>
-	              </xsl:for-each>
-            </xsl:when>
-            <xsl:when test="parent::tei:figure/tei:head">
-               <xsl:value-of select="parent::tei:figure/tei:head/text()"/>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-	<xsl:when test="$showFigures='true'">
-	  <xsl:choose>
-	    <xsl:when test="@type='thumbnail'"/>
-	    <xsl:when test="starts-with(@mimeType, 'video')">
-	      <video src="{$graphicsPrefix}{$File}"
-		     controls="controls">
-		<xsl:if test="../tei:graphic[@type='thumbnail']">
-		  <xsl:attribute name="poster">
-		    <xsl:value-of select="../tei:graphic[@type='thumbnail']/@url"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="showGraphic">
+		<xsl:variable name="File">
+			<xsl:choose>
+				<xsl:when test="@url">
+					<xsl:value-of select="@url" />
+					<xsl:if test="not(contains(@url,'.'))">
+						<xsl:value-of select="$graphicsSuffix" />
+					</xsl:if>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:message terminate="yes">
+						Cannot work out how to do a graphic
+					</xsl:message>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="Alt">
+			<xsl:choose>
+				<xsl:when test="tei:desc">
+					<xsl:for-each select="tei:desc">
+						<xsl:apply-templates mode="plain" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="tei:figDesc">
+					<xsl:for-each select="tei:figDesc">
+						<xsl:apply-templates mode="plain" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="tei:head">
+					<xsl:value-of select="tei:head/text()" />
+				</xsl:when>
+				<xsl:when test="parent::tei:figure/tei:figDesc">
+					<xsl:for-each select="parent::tei:figure/tei:figDesc">
+						<xsl:apply-templates mode="plain" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="parent::tei:figure/tei:head">
+					<xsl:value-of
+						select="parent::tei:figure/tei:head/text()" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$showFigures='true'">
+				<xsl:choose>
+					<xsl:when test="@type='thumbnail'" />
+					<xsl:when test="starts-with(@mimeType, 'video')">
+						<video src="{$graphicsPrefix}{$File}" controls="controls">
+							<xsl:if test="../tei:graphic[@type='thumbnail']">
+								<xsl:attribute name="poster">
+		    <xsl:value-of
+									select="../tei:graphic[@type='thumbnail']/@url" />
 		  </xsl:attribute>
-		</xsl:if>
-	      </video>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <img src="{$graphicsPrefix}{$File}">
-		<xsl:attribute name="alt">
-		  <xsl:value-of select="$Alt"/>
+							</xsl:if>
+						</video>
+					</xsl:when>
+					<xsl:otherwise>
+						<img src="{$graphicsPrefix}{$File}">
+							<xsl:attribute name="alt">
+		  <xsl:value-of select="$Alt" />
 		</xsl:attribute>
-		<xsl:call-template name="imgHook"/>
-		<xsl:if test="@xml:id">
-		  <xsl:attribute name="id">
-		    <xsl:value-of select="@xml:id"/>
+							<xsl:call-template name="imgHook" />
+							<xsl:if test="@xml:id">
+								<xsl:attribute name="id">
+		    <xsl:value-of select="@xml:id" />
 		  </xsl:attribute>
-		</xsl:if>
-		<xsl:call-template name="rendToClass"/>
-		<xsl:if test="@width">
-		  <xsl:call-template name="setDimension">
-		    <xsl:with-param name="value">
-		      <xsl:value-of select="@width"/>
-		    </xsl:with-param>
-		    <xsl:with-param name="name">width</xsl:with-param>
-		  </xsl:call-template>
-		</xsl:if>
-		<xsl:if test="@height">
-		  <xsl:call-template name="setDimension">
-		    <xsl:with-param name="value">
-		      <xsl:value-of select="@height"/>
-		    </xsl:with-param>
-		    <xsl:with-param name="name">height</xsl:with-param>
-		  </xsl:call-template>
-		</xsl:if>
-	      </img>
-	    </xsl:otherwise>
-	  </xsl:choose>	  
-         </xsl:when>
-         <xsl:otherwise>
-            <div class="altfigure">
-	      <xsl:call-template name="i18n">
-		<xsl:with-param name="word">figureWord</xsl:with-param>
-	      </xsl:call-template>
-	      <xsl:text> </xsl:text>
-	      <xsl:for-each select="self::tei:figure|parent::tei:figure">
-		<xsl:number count="tei:figure[tei:head]" level="any"/>
-	      </xsl:for-each>
-	      <xsl:text> </xsl:text>
-	      <xsl:value-of select="$File"/>
-	      <xsl:text> [</xsl:text>
-	      <xsl:value-of select="$Alt"/>
-	      <xsl:text>] </xsl:text>
-	    </div>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:binaryObject">
-      <img>
-         <xsl:attribute name="src">
+							</xsl:if>
+							<xsl:call-template name="rendToClass" />
+							<xsl:if test="@width">
+								<xsl:call-template name="setDimension">
+									<xsl:with-param name="value">
+										<xsl:value-of select="@width" />
+									</xsl:with-param>
+									<xsl:with-param name="name">
+										width
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:if>
+							<xsl:if test="@height">
+								<xsl:call-template name="setDimension">
+									<xsl:with-param name="value">
+										<xsl:value-of select="@height" />
+									</xsl:with-param>
+									<xsl:with-param name="name">
+										height
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:if>
+						</img>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<div class="altfigure">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							figureWord
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:text> </xsl:text>
+					<xsl:for-each
+						select="self::tei:figure|parent::tei:figure">
+						<xsl:number count="tei:figure[tei:head]" level="any" />
+					</xsl:for-each>
+					<xsl:text> </xsl:text>
+					<xsl:value-of select="$File" />
+					<xsl:text> [</xsl:text>
+					<xsl:value-of select="$Alt" />
+					<xsl:text>] </xsl:text>
+				</div>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:binaryObject">
+		<img>
+			<xsl:attribute name="src">
             <xsl:text>data:</xsl:text>
-            <xsl:value-of select="@mimetype"/>
+            <xsl:value-of select="@mimetype" />
             <xsl:text>;base64,</xsl:text>
-            <xsl:copy-of select="text()"/>
+            <xsl:copy-of select="text()" />
          </xsl:attribute>
-         <xsl:if test="@width">
-            <xsl:call-template name="setDimension">
-               <xsl:with-param name="value">
-                  <xsl:value-of select="@width"/>
-               </xsl:with-param>
-               <xsl:with-param name="name">width</xsl:with-param>
-            </xsl:call-template>
-         </xsl:if>
-         <xsl:if test="@height">
-            <xsl:call-template name="setDimension">
-               <xsl:with-param name="value">
-                  <xsl:value-of select="@height"/>
-               </xsl:with-param>
-               <xsl:with-param name="name">height</xsl:with-param>
-            </xsl:call-template>
-         </xsl:if>
-      </img>
-      <!-- also alt -->
-    <!-- this is what we'll need for IE:
-<style type="text/css">
-   img {behavior: expression(fixBase64(this));}
-  </style>
-  <script type="text/javascript">
-  	// a regular expression to test for Base64 data
-	var BASE64_DATA = /^data:.*;base64/i;
-	// path to the PHP module that will decode the encoded data
-	var base64Path = "/my/base64.php";
-	function fixBase64(img) {
-		// stop the CSS expression from being endlessly evaluated
-		img.runtimeStyle.behavior = "none";
-		// check the image src
-		if (BASE64_DATA.test(img.src)) {
-		// pass the data to the PHP routine
-		img.src = base64Path + "?" + img.src.slice(5);
-		}
-	};
-  </script>
-  Dean Edwards http://dean.edwards.name/weblog/2005/06/base64-sexy/
-<?php
-$data = split(";", $_SERVER["REDIRECT_QUERY_STRING"]);
-$type = $data[0];
-$data = split(",", $data[1]);
-header("Content-type: ".$type);
-echo base64_decode($data[1]);
-?>
--->
-  </xsl:template>
+			<xsl:if test="@width">
+				<xsl:call-template name="setDimension">
+					<xsl:with-param name="value">
+						<xsl:value-of select="@width" />
+					</xsl:with-param>
+					<xsl:with-param name="name">
+						width
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:if>
+			<xsl:if test="@height">
+				<xsl:call-template name="setDimension">
+					<xsl:with-param name="value">
+						<xsl:value-of select="@height" />
+					</xsl:with-param>
+					<xsl:with-param name="name">
+						height
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:if>
+		</img>
+		<!-- also alt -->
+		<!-- this is what we'll need for IE: <style type="text/css"> img {behavior: 
+			expression(fixBase64(this));} </style> <script type="text/javascript"> // 
+			a regular expression to test for Base64 data var BASE64_DATA = /^data:.*;base64/i; 
+			// path to the PHP module that will decode the encoded data var base64Path 
+			= "/my/base64.php"; function fixBase64(img) { // stop the CSS expression 
+			from being endlessly evaluated img.runtimeStyle.behavior = "none"; // check 
+			the image src if (BASE64_DATA.test(img.src)) { // pass the data to the PHP 
+			routine img.src = base64Path + "?" + img.src.slice(5); } }; </script> Dean 
+			Edwards http://dean.edwards.name/weblog/2005/06/base64-sexy/ <?php $data 
+			= split(";", $_SERVER["REDIRECT_QUERY_STRING"]); $type = $data[0]; $data 
+			= split(",", $data[1]); header("Content-type: ".$type); echo base64_decode($data[1]); 
+			?> -->
+	</xsl:template>
 
-  <xsl:template match="svg:*">
-      <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="svg:*">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/textstructure.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/textstructure.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/textstructure.xsl	(revision 2397)
@@ -1,2935 +1,3330 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"  xmlns:xlink="http://www.w3.org/1999/xlink"
-		xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-		xmlns:its="http://www.w3.org/2005/11/its"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:dbk="http://docbook.org/ns/docbook"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fo dbk xlink rng tei html
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:its="http://www.w3.org/2005/11/its"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:dbk="http://docbook.org/ns/docbook"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo dbk xlink rng tei html
 					 teix its teidocx"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the textstructure
-      module, making HTML output. </p>
-         <p>This software is dual-licensed:
+	version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the textstructure
+				module, making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: textstructure.xsl 10109 2012-02-22 12:18:38Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements * in inner mode</desc>
-   </doc>
-  <xsl:template match="*" mode="innertext">
-      <xsl:apply-templates select="."/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements * in paging mode</desc>
-   </doc>
-  <xsl:template match="*" mode="paging">
-      <xsl:choose>
-         <xsl:when test="self::tei:divGen[@type='summary']">
-            <xsl:call-template name="summaryToc"/>
-         </xsl:when>
-         <xsl:when test="self::tei:divGen">
-            <xsl:apply-templates select="."/>
-         </xsl:when>
-         <xsl:when test="starts-with(local-name(),'div')">
-            <xsl:if test="not(preceding-sibling::tei:*) or preceding-sibling::tei:titlePage">
-               <xsl:call-template name="doDivBody">
-		 <xsl:with-param name="Depth">2</xsl:with-param>
-		 <xsl:with-param name="nav">true</xsl:with-param>
-	       </xsl:call-template>
-            </xsl:if>
-         </xsl:when>
-         <xsl:when test="local-name(..)='front'">
-            <xsl:apply-templates select="."/>
-            <xsl:apply-templates mode="paging" select="following-sibling::*[1]"/>
-            <xsl:apply-templates mode="paging" select="../../tei:body/*[1]"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates select="."/>
-            <xsl:apply-templates mode="paging" select="following-sibling::*[1]"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process root /</p>
-	 <p xmlns="http://www.w3.org/1999/xhtml"> processors must support `key' </p>
-      </desc>
-   </doc>
-  <xsl:template match="/">
-    <xsl:call-template name="processTEI"/>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process top-level elements /</p>
-      </desc>
-   </doc>
-   <xsl:template name="processTEI">
-     <xsl:choose>
-       <!-- there are various choices of how to proceed, driven by
-	    
-	    $pageLayout: Simple, CSS, Table
-	    
-	    $STDOUT: true or false
-	    
-	    $splitLevel: -1 to 3
-	    
-	    $requestedID: requests a particular page
-       -->
-       <!-- we are making a composite layout and there is a TEI or teiCorpus element -->
-       <xsl:when test="($pageLayout = 'CSS' or $pageLayout = 'Table') and (tei:TEI or tei:teiCorpus)">
-	 <xsl:if test="$verbose='true'">
-	   <xsl:message>case 1: pageLayout <xsl:value-of select="$pageLayout"/>
-	   </xsl:message>
-	 </xsl:if>
-	 <xsl:for-each select="tei:TEI|tei:teiCorpus">
-	   <xsl:call-template name="doPageTable">
-	     <xsl:with-param name="currentID" select="$requestedID"/>
-	   </xsl:call-template>
-	 </xsl:for-each>
-	 <xsl:if test="$STDOUT='false'">
-	   <xsl:call-template name="doDivs"/>
-	 </xsl:if>
-       </xsl:when>
-       <!-- we have been asked for a particular section of the document -->
-       <xsl:when test="not($requestedID='')">
-	 <xsl:if test="$verbose='true'">
-	   <xsl:message>case 3: ID <xsl:value-of select="$requestedID"/>, pageLayout
-	   <xsl:value-of select="$pageLayout"/>
-	   </xsl:message>
-	 </xsl:if>
-	 <xsl:choose>
-	   <xsl:when test="$requestedID='prelim___'">
-	     <xsl:apply-templates/>
-	   </xsl:when>
-	   <xsl:when test="count(id($requestedID))&gt;0">
-	     <xsl:for-each select="id($requestedID)">
-	       <xsl:call-template name="writeDiv"/>
-	     </xsl:for-each>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <!-- the passed ID is a pseudo-XPath expression
-		  which starts below TEI/text.
-		  The real XPath syntax is changed to avoid problems
-	     -->
-	     <xsl:apply-templates mode="xpath" select="tei:TEI/tei:text">
-	       <xsl:with-param name="xpath" select="$requestedID"/>
-	     </xsl:apply-templates>
-	   </xsl:otherwise>
-	 </xsl:choose>
-       </xsl:when>
-       <!-- we want HTML to just splurge out-->
-       <xsl:when test="$STDOUT='true'">
-	 <xsl:if test="$verbose='true'">
-	   <xsl:message>case 4: write to stdout, pageLayout <xsl:value-of select="$pageLayout"/>
-	   </xsl:message>
-	 </xsl:if>
-	 <xsl:apply-templates/>
-       </xsl:when>
-       <!-- we want the document split up into separate files -->
-       <xsl:when test="tei:TEI or tei:teiCorpus and number($splitLevel)&gt;-1">
-	 <xsl:if test="$verbose='true'">
-	   <xsl:message>case 5: split output, <xsl:value-of select="$splitLevel"/> pageLayout <xsl:value-of select="$pageLayout"/>
-	   </xsl:message>
-	 </xsl:if>
-	 <xsl:apply-templates mode="split"/>
-       </xsl:when>
-       <!-- we want the whole document, in an output file -->
-       <xsl:otherwise>
-	 <xsl:if test="$verbose='true'">
-	   <xsl:message>case 6: one document, pageLayout <xsl:value-of select="$pageLayout"/>
-	   </xsl:message>
-	 </xsl:if>
-	 <xsl:choose>
-	   <xsl:when test="$masterFile='' or $STDOUT='true'">
-	     <xsl:apply-templates/>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     
-	     <xsl:variable name="outName">
-	       <xsl:call-template name="outputChunkName">
-		 <xsl:with-param name="ident">
-		   <xsl:value-of select="$masterFile"/>
-		 </xsl:with-param>
-	       </xsl:call-template>
-	     </xsl:variable>
-	     
-	     <xsl:if test="$verbose='true'">
-	       <xsl:message>Opening file <xsl:value-of select="$outName"/>
-	       </xsl:message>
-	     </xsl:if>
-	     <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
-				  encoding="{$outputEncoding}"
-				  href="{$outName}"
-				  method="{$outputMethod}">
-	       <xsl:apply-templates/>
-	     </xsl:result-document>
-	     
-	     <xsl:if test="$verbose='true'">
-	       <xsl:message>Closing file <xsl:value-of select="$outName"/>
-	       </xsl:message>
-	     </xsl:if>
-	     
-	   </xsl:otherwise>
-	 </xsl:choose>
-       </xsl:otherwise>
-     </xsl:choose>
-   </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: textstructure.xsl 10109 2012-02-22 12:18:38Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements * in inner mode</desc>
+	</doc>
+	<xsl:template match="*" mode="innertext">
+		<xsl:apply-templates select="." />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements * in paging mode</desc>
+	</doc>
+	<xsl:template match="*" mode="paging">
+		<xsl:choose>
+			<xsl:when test="self::tei:divGen[@type='summary']">
+				<xsl:call-template name="summaryToc" />
+			</xsl:when>
+			<xsl:when test="self::tei:divGen">
+				<xsl:apply-templates select="." />
+			</xsl:when>
+			<xsl:when test="starts-with(local-name(),'div')">
+				<xsl:if
+					test="not(preceding-sibling::tei:*) or preceding-sibling::tei:titlePage">
+					<xsl:call-template name="doDivBody">
+						<xsl:with-param name="Depth">
+							2
+						</xsl:with-param>
+						<xsl:with-param name="nav">
+							true
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="local-name(..)='front'">
+				<xsl:apply-templates select="." />
+				<xsl:apply-templates mode="paging"
+					select="following-sibling::*[1]" />
+				<xsl:apply-templates mode="paging"
+					select="../../tei:body/*[1]" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="." />
+				<xsl:apply-templates mode="paging"
+					select="following-sibling::*[1]" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process root /</p>
+			<p xmlns="http://www.w3.org/1999/xhtml"> processors must support `key' </p>
+		</desc>
+	</doc>
+	<xsl:template match="/">
+		<xsl:call-template name="processTEI" />
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements processing-instruction()[name()='xmltex']</desc>
-   </doc>
-  <xsl:template match="processing-instruction()[name()='xmltex']">
-      <xsl:value-of select="."/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element *</desc>
-   </doc>
-  <xsl:template match="tei:*" mode="generateNextLink">
-      <span class="nextLink">
-         <xsl:text> </xsl:text>
-         <xsl:call-template name="i18n">
-	           <xsl:with-param name="word">nextWord</xsl:with-param>
-         </xsl:call-template>
-         <xsl:call-template name="navInterSep"/>
-      </span>
-      <a class="navigation">
-         <xsl:attribute name="href">
-	           <xsl:apply-templates mode="generateLink" select="."/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process top-level elements /</p>
+		</desc>
+	</doc>
+	<xsl:template name="processTEI">
+		<xsl:choose>
+			<!-- there are various choices of how to proceed, driven by $pageLayout: 
+				Simple, CSS, Table $STDOUT: true or false $splitLevel: -1 to 3 $requestedID: 
+				requests a particular page -->
+			<!-- we are making a composite layout and there is a TEI or teiCorpus 
+				element -->
+			<xsl:when
+				test="($pageLayout = 'CSS' or $pageLayout = 'Table') and (tei:TEI or tei:teiCorpus)">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						case 1: pageLayout
+						<xsl:value-of select="$pageLayout" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:for-each select="tei:TEI|tei:teiCorpus">
+					<xsl:call-template name="doPageTable">
+						<xsl:with-param name="currentID"
+							select="$requestedID" />
+					</xsl:call-template>
+				</xsl:for-each>
+				<xsl:if test="$STDOUT='false'">
+					<xsl:call-template name="doDivs" />
+				</xsl:if>
+			</xsl:when>
+			<!-- we have been asked for a particular section of the document -->
+			<xsl:when test="not($requestedID='')">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						case 3: ID
+						<xsl:value-of select="$requestedID" />
+						, pageLayout
+						<xsl:value-of select="$pageLayout" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="$requestedID='prelim___'">
+						<xsl:apply-templates />
+					</xsl:when>
+					<xsl:when test="count(id($requestedID))&gt;0">
+						<xsl:for-each select="id($requestedID)">
+							<xsl:call-template name="writeDiv" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- the passed ID is a pseudo-XPath expression which starts below 
+							TEI/text. The real XPath syntax is changed to avoid problems -->
+						<xsl:apply-templates mode="xpath"
+							select="tei:TEI/tei:text">
+							<xsl:with-param name="xpath" select="$requestedID" />
+						</xsl:apply-templates>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<!-- we want HTML to just splurge out -->
+			<xsl:when test="$STDOUT='true'">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						case 4: write to stdout, pageLayout
+						<xsl:value-of select="$pageLayout" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:apply-templates />
+			</xsl:when>
+			<!-- we want the document split up into separate files -->
+			<xsl:when
+				test="tei:TEI or tei:teiCorpus and number($splitLevel)&gt;-1">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						case 5: split output,
+						<xsl:value-of select="$splitLevel" />
+						pageLayout
+						<xsl:value-of select="$pageLayout" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:apply-templates mode="split" />
+			</xsl:when>
+			<!-- we want the whole document, in an output file -->
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						case 6: one document, pageLayout
+						<xsl:value-of select="$pageLayout" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="$masterFile='' or $STDOUT='true'">
+						<xsl:apply-templates />
+					</xsl:when>
+					<xsl:otherwise>
+
+						<xsl:variable name="outName">
+							<xsl:call-template name="outputChunkName">
+								<xsl:with-param name="ident">
+									<xsl:value-of select="$masterFile" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:variable>
+
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								Opening file
+								<xsl:value-of select="$outName" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:result-document
+							doctype-public="{$doctypePublic}"
+							doctype-system="{$doctypeSystem}" encoding="{$outputEncoding}"
+							href="{$outName}" method="{$outputMethod}">
+							<xsl:apply-templates />
+						</xsl:result-document>
+
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								Closing file
+								<xsl:value-of select="$outName" />
+							</xsl:message>
+						</xsl:if>
+
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements processing-instruction()[name()='xmltex']</desc>
+	</doc>
+	<xsl:template
+		match="processing-instruction()[name()='xmltex']">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element *</desc>
+	</doc>
+	<xsl:template match="tei:*" mode="generateNextLink">
+		<span class="nextLink">
+			<xsl:text> </xsl:text>
+			<xsl:call-template name="i18n">
+				<xsl:with-param name="word">
+					nextWord
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:call-template name="navInterSep" />
+		</span>
+		<a class="navigation">
+			<xsl:attribute name="href">
+	           <xsl:apply-templates
+				mode="generateLink" select="." />
          </xsl:attribute>
-         <xsl:call-template name="headerLink">
-	           <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-         </xsl:call-template>
-      </a>
-  </xsl:template>
+			<xsl:call-template name="headerLink">
+				<xsl:with-param name="minimal"
+					select="$minimalCrossRef" />
+			</xsl:call-template>
+		</a>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements looking for something to link to backwards</desc>
-   </doc>
-  <xsl:template match="tei:*" mode="generatePreviousLink">
-      <span class="previousLink">
-         <xsl:text> </xsl:text>
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">previousWord</xsl:with-param>
-         </xsl:call-template>
-         <xsl:call-template name="navInterSep"/>
-      </span>
-      <a class="navigation">
-         <xsl:attribute name="href">
-            <xsl:apply-templates mode="generateLink" select="."/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements looking for something to link to backwards</desc>
+	</doc>
+	<xsl:template match="tei:*" mode="generatePreviousLink">
+		<span class="previousLink">
+			<xsl:text> </xsl:text>
+			<xsl:call-template name="i18n">
+				<xsl:with-param name="word">
+					previousWord
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:call-template name="navInterSep" />
+		</span>
+		<a class="navigation">
+			<xsl:attribute name="href">
+            <xsl:apply-templates
+				mode="generateLink" select="." />
          </xsl:attribute>
-         <xsl:call-template name="headerLink">
-            <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-         </xsl:call-template>
-      </a>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process any element in xpath mode</p>
-         <p>
-            <p xmlns="http://www.w3.org/1999/xhtml"> This nice bit of code is from Jeni Tennison </p>
-         </p>
-         <param name="xpath">xpath</param>
-         <param name="action">action</param>
-      </desc>
-   </doc>
-  <xsl:template match="tei:*" mode="xpath">
-      <xsl:param name="xpath"/>
-      <xsl:param name="action"/>
-      <xsl:choose>
-      <!-- if there is a path -->
-      <xsl:when test="$xpath">
-        <!-- step is the part before the '_' (if there is one) -->
-        <xsl:variable name="step">
-               <xsl:choose>
-                  <xsl:when test="contains($xpath, '_')">
-                     <xsl:value-of select="substring-before($xpath, '_')"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$xpath"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
-            <!-- the child's name is the part before the '.' -->
-        <xsl:variable name="childName" select="substring-before($step, '.')"/>
-            <!-- and its index is the part after '.' -->
-        <xsl:variable name="childIndex" select="substring-after($step, '.')"/>
-            <!-- so apply templates to that child, passing in the $xpath
-	     left after the first step -->
-        <xsl:apply-templates mode="xpath" select="*[name() = $childName]          [number($childIndex)]">
-               <xsl:with-param name="xpath" select="substring-after($xpath, '_')"/>
-               <xsl:with-param name="action" select="$action"/>
-            </xsl:apply-templates>
-         </xsl:when>
-         <!-- if there's no path left, then this is the element we want -->
-      <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="$action='header'">
-                  <xsl:apply-templates mode="xref" select="."/>
-               </xsl:when>
-               <xsl:when test="$action='notes'">
-                  <xsl:call-template name="printNotes"/>
-               </xsl:when>
-               <xsl:when test="$action='toclist'">
-                  <xsl:call-template name="linkListContents">
-                     <xsl:with-param name="style" select="'toclist'"/>
-                  </xsl:call-template>
-               </xsl:when>
-               <xsl:when test="starts-with(local-name(),'div') and      $pageLayout='Table'      or      $pageLayout='CSS'">
-                  <xsl:call-template name="doDivBody">
-		    <xsl:with-param name="Depth">2</xsl:with-param>
-		    <xsl:with-param name="nav">true</xsl:with-param>
-		  </xsl:call-template>
-               </xsl:when>
-               <xsl:when test="self::tei:divGen[@type='summary']">
-                  <xsl:call-template name="summaryToc"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <html>
-                     <xsl:call-template name="addLangAtt"/>
-                     <xsl:call-template name="htmlFileTop"/>
-		     <body id="TOP">
-                        <xsl:call-template name="bodyMicroData"/>
-                        <xsl:call-template name="bodyJavascriptHook"/>
-			<xsl:call-template name="bodyHook"/>
-			<div class="stdheader">
-			  <xsl:call-template name="stdheader">
-			    <xsl:with-param name="title">
-			      <xsl:call-template name="generateTitle"/>
-                              </xsl:with-param>
-			  </xsl:call-template>
-			</div>
-                        <h2>
-                           <xsl:apply-templates mode="xref" select="."/>
-			   <xsl:call-template name="sectionHeadHook"/>
-                        </h2>
-                        <xsl:apply-templates/>
-                        <xsl:call-template name="printNotes"/>
-                        <xsl:call-template name="htmlFileBottom"/>
-			<xsl:call-template name="bodyEndHook"/>
-		     </body>
-		  </html>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process root element TEI</p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:TEI">
-      <xsl:call-template name="teiStartHook"/>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>TEI HTML in single document mode </xsl:message>
-      </xsl:if>
-      <html>
-         <xsl:call-template name="addLangAtt"/>
-         <head>
-            <xsl:variable name="pagetitle">
-               <xsl:call-template name="generateTitle"/>
-            </xsl:variable>
-            <title>
-               <xsl:value-of select="$pagetitle"/>
-            </title>
-            <xsl:call-template name="headHook"/>
-            <xsl:call-template name="metaHTML">
-               <xsl:with-param name="title" select="$pagetitle"/>
-            </xsl:call-template>
-            <xsl:call-template name="includeCSS"/>
-            <xsl:call-template name="cssHook"/>
-            <xsl:call-template name="includeJavascript"/>
-            <xsl:call-template name="javascriptHook"/>
-         </head>
-         <body class="simple" id="TOP">
-            <xsl:call-template name="bodyMicroData"/>
-            <xsl:call-template name="bodyJavascriptHook"/>
-	    <xsl:call-template name="bodyHook"/>
-            <xsl:if test="not(tei:text/tei:front/tei:titlePage)">
-	      <div class="stdheader">
-		<xsl:call-template name="stdheader">
-		  <xsl:with-param name="title">
-		    <xsl:call-template name="generateTitle"/>
-		  </xsl:with-param>
-		</xsl:call-template>
-	      </div>
-            </xsl:if>
-            <xsl:call-template name="startHook"/>
-            <xsl:call-template name="simpleBody"/>
-            <xsl:call-template name="stdfooter"/>
-            <xsl:call-template name="bodyEndHook"/>
-         </body>
-      </html>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>TEI HTML: run end hook template teiEndHook</xsl:message>
-      </xsl:if>
-      <xsl:call-template name="teiEndHook"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process root element TEI in splitting mode</p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:TEI" mode="split">
-      <xsl:variable name="BaseFile">
-         <xsl:value-of select="$masterFile"/>
-         <xsl:call-template name="addCorpusID"/>
-      </xsl:variable>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>TEI HTML: run start hook template teiStartHook</xsl:message>
-      </xsl:if>
-      <xsl:call-template name="teiStartHook"/>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>TEI HTML in splitting mode, base file is <xsl:value-of select="$BaseFile"/>
-         </xsl:message>
-      </xsl:if>
+			<xsl:call-template name="headerLink">
+				<xsl:with-param name="minimal"
+					select="$minimalCrossRef" />
+			</xsl:call-template>
+		</a>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process any element in xpath mode</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> This nice bit of code is from Jeni Tennison </p>
+			</p>
+			<param name="xpath">xpath</param>
+			<param name="action">action</param>
+		</desc>
+	</doc>
+	<xsl:template match="tei:*" mode="xpath">
+		<xsl:param name="xpath" />
+		<xsl:param name="action" />
+		<xsl:choose>
+			<!-- if there is a path -->
+			<xsl:when test="$xpath">
+				<!-- step is the part before the '_' (if there is one) -->
+				<xsl:variable name="step">
+					<xsl:choose>
+						<xsl:when test="contains($xpath, '_')">
+							<xsl:value-of select="substring-before($xpath, '_')" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$xpath" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<!-- the child's name is the part before the '.' -->
+				<xsl:variable name="childName"
+					select="substring-before($step, '.')" />
+				<!-- and its index is the part after '.' -->
+				<xsl:variable name="childIndex"
+					select="substring-after($step, '.')" />
+				<!-- so apply templates to that child, passing in the $xpath left after 
+					the first step -->
+				<xsl:apply-templates mode="xpath"
+					select="*[name() = $childName]          [number($childIndex)]">
+					<xsl:with-param name="xpath"
+						select="substring-after($xpath, '_')" />
+					<xsl:with-param name="action" select="$action" />
+				</xsl:apply-templates>
+			</xsl:when>
+			<!-- if there's no path left, then this is the element we want -->
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$action='header'">
+						<xsl:apply-templates mode="xref" select="." />
+					</xsl:when>
+					<xsl:when test="$action='notes'">
+						<xsl:call-template name="printNotes" />
+					</xsl:when>
+					<xsl:when test="$action='toclist'">
+						<xsl:call-template name="linkListContents">
+							<xsl:with-param name="style" select="'toclist'" />
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when
+						test="starts-with(local-name(),'div') and      $pageLayout='Table'      or      $pageLayout='CSS'">
+						<xsl:call-template name="doDivBody">
+							<xsl:with-param name="Depth">
+								2
+							</xsl:with-param>
+							<xsl:with-param name="nav">
+								true
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when test="self::tei:divGen[@type='summary']">
+						<xsl:call-template name="summaryToc" />
+					</xsl:when>
+					<xsl:otherwise>
+						<html>
+							<xsl:call-template name="addLangAtt" />
+							<xsl:call-template name="htmlFileTop" />
+							<body id="TOP">
+								<xsl:call-template name="bodyMicroData" />
+								<xsl:call-template name="bodyJavascriptHook" />
+								<xsl:call-template name="bodyHook" />
+								<div class="stdheader">
+									<xsl:call-template name="stdheader">
+										<xsl:with-param name="title">
+											<xsl:call-template name="generateTitle" />
+										</xsl:with-param>
+									</xsl:call-template>
+								</div>
+								<h2>
+									<xsl:apply-templates mode="xref" select="." />
+									<xsl:call-template name="sectionHeadHook" />
+								</h2>
+								<xsl:apply-templates />
+								<xsl:call-template name="printNotes" />
+								<xsl:call-template name="htmlFileBottom" />
+								<xsl:call-template name="bodyEndHook" />
+							</body>
+						</html>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process root element TEI</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:TEI">
+		<xsl:call-template name="teiStartHook" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				TEI HTML in single document mode
+			</xsl:message>
+		</xsl:if>
+		<html>
+			<xsl:call-template name="addLangAtt" />
+			<head>
+				<xsl:variable name="pagetitle">
+					<xsl:call-template name="generateTitle" />
+				</xsl:variable>
+				<title>
+					<xsl:value-of select="$pagetitle" />
+				</title>
+				<xsl:call-template name="headHook" />
+				<xsl:call-template name="metaHTML">
+					<xsl:with-param name="title" select="$pagetitle" />
+				</xsl:call-template>
+				<xsl:call-template name="includeCSS" />
+				<xsl:call-template name="cssHook" />
+				<xsl:call-template name="includeJavascript" />
+				<xsl:call-template name="javascriptHook" />
+			</head>
+			<body class="simple" id="TOP">
+				<xsl:call-template name="bodyMicroData" />
+				<xsl:call-template name="bodyJavascriptHook" />
+				<xsl:call-template name="bodyHook" />
+				<xsl:if test="not(tei:text/tei:front/tei:titlePage)">
+					<div class="stdheader">
+						<xsl:call-template name="stdheader">
+							<xsl:with-param name="title">
+								<xsl:call-template name="generateTitle" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</div>
+				</xsl:if>
+				<xsl:call-template name="startHook" />
+				<xsl:call-template name="simpleBody" />
+				<xsl:call-template name="stdfooter" />
+				<xsl:call-template name="bodyEndHook" />
+			</body>
+		</html>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				TEI HTML: run end hook template teiEndHook
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="teiEndHook" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process root element TEI in splitting mode</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:TEI" mode="split">
+		<xsl:variable name="BaseFile">
+			<xsl:value-of select="$masterFile" />
+			<xsl:call-template name="addCorpusID" />
+		</xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				TEI HTML: run start hook template teiStartHook
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="teiStartHook" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				TEI HTML in splitting mode, base file is
+				<xsl:value-of select="$BaseFile" />
+			</xsl:message>
+		</xsl:if>
 
-      <xsl:variable name="outName">
-         <xsl:call-template name="outputChunkName">
-	           <xsl:with-param name="ident">
-	              <xsl:choose>
-	                 <xsl:when test="parent::tei:teiCorpus">
-	                    <xsl:apply-templates select="." mode="ident"/>
-	                 </xsl:when>
-	                 <xsl:otherwise>
-	                    <xsl:value-of select="$BaseFile"/>
-	                 </xsl:otherwise>
-	              </xsl:choose>
-	           </xsl:with-param>
-         </xsl:call-template>
-      </xsl:variable>
-    
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Opening file <xsl:value-of select="$outName"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
-                           encoding="{$outputEncoding}"
-                           href="{$outName}"
-                           method="{$outputMethod}">
-    
-        <xsl:call-template name="pageLayoutSimple"/>
-      </xsl:result-document>
-    
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Closing file <xsl:value-of select="$outName"/>
-         </xsl:message>
-      </xsl:if>
+		<xsl:variable name="outName">
+			<xsl:call-template name="outputChunkName">
+				<xsl:with-param name="ident">
+					<xsl:choose>
+						<xsl:when test="parent::tei:teiCorpus">
+							<xsl:apply-templates select="." mode="ident" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$BaseFile" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
 
-      <xsl:if test="$verbose='true'">
-         <xsl:message>TEI HTML: run end hook template teiEndHook</xsl:message>
-      </xsl:if>
-      <xsl:call-template name="teiEndHook"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements front, body or back in splitting mode</desc>
-   </doc>
-  <xsl:template match="tei:front|tei:body|tei:back" mode="split">
-      <xsl:for-each select="*">
-         <xsl:choose>
-            <xsl:when test="starts-with(local-name(.),'div')">
-               <xsl:apply-templates mode="split" select="."/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:apply-templates select="."/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element body in inner mode</desc>
-   </doc>
-  <xsl:template match="tei:body" mode="inner">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element closer</desc>
-   </doc>
-  <xsl:template match="tei:closer">
-	<xsl:choose>
-	  <xsl:when test="tei:signed">
-	    <div class="closer">
-	      <xsl:apply-templates/>
-	    </div>
-	  </xsl:when>
-	  <xsl:when test="tei:postscript">
-	    <div class="closer">
-	      <xsl:apply-templates/>
-	    </div>
-	  </xsl:when>
-	  <xsl:when test="tei:p">
-	    <blockquote class="closer">
-	      <xsl:apply-templates/>
-	    </blockquote>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <blockquote class="closer">
-	      <p>
-		<xsl:apply-templates/>
-	      </p>
-	    </blockquote>
-	  </xsl:otherwise>
-	</xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element dateline</desc>
-   </doc>
-  <xsl:template match="tei:dateline">
-      <span class="dateline">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element divGen[@type='actions']</desc>
-   </doc>
-  <xsl:template match="tei:divGen[@type='actions']">
-      <h3>Actions arising</h3>
-      <dl>
-         <xsl:for-each select="/tei:TEI/tei:text//tei:note[@type='action']">
-            <dt>
-               <b>
-                  <xsl:number count="tei:note[@type='action']" level="any"/>
-               </b>
-            </dt>
-            <dd>
-               <xsl:apply-templates/>
-            </dd>
-         </xsl:for-each>
-      </dl>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process element divGen[@type='toc']</p>
-         <p>
-            <p xmlns="http://www.w3.org/1999/xhtml"> table of contents </p>
-         </p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:divGen[@type='toc']">
-    <div class="tei_toc">
-      <h2>
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">tocWords</xsl:with-param>
-         </xsl:call-template>
-      </h2>
-      <xsl:call-template name="mainTOC"/>
-    </div>
-  </xsl:template>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Opening file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+			encoding="{$outputEncoding}" href="{$outName}"
+			method="{$outputMethod}">
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>index element, by default does nothing, unless it has an xml:id</p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:index">
-    <xsl:if test="@xml:id">
-      <span>
-	<xsl:attribute name="id" select="@xml:id"/>
-	<span style="display:none">
-	  <xsl:value-of select="normalize-space(tei:term)"/>
-	</span>
-      </span>
-    </xsl:if>
-  </xsl:template>
+			<xsl:call-template name="pageLayoutSimple" />
+		</xsl:result-document>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Simplistic processing of element divGen[@type='index']</p>
-         <p>
-            <p xmlns="http://www.w3.org/1999/xhtml">make an index;
-	    does not take indexName or nested index into account </p>
-         </p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:divGen[@type='index']">
-    <div class="tei_index">
-      <h2>Index</h2>
-      <xsl:variable name="index">
-	<xsl:for-each select="key('INDEX',1)">
-	  <tei:REF>
-	    <tei:SORT>
-	      <xsl:value-of select="lower-case(normalize-unicode(tei:term,'NFD'))"/>
-	    </tei:SORT>	    
-	    <tei:TERM>
-	      <xsl:value-of select="tei:term"/>
-	    </tei:TERM>	    
-	    <xsl:for-each select="ancestor-or-self::*[tei:is-identifiable(.)][1]">
-	      <tei:LINK>
-		  <xsl:apply-templates mode="generateLink"
-				       select="."/>
-	      </tei:LINK>
-	      <tei:TARGET>
-		<xsl:call-template name="header"/>
-	      </tei:TARGET>
-	    </xsl:for-each>
-	  </tei:REF>
-	</xsl:for-each>
-      </xsl:variable>
-      <dl>
-	<xsl:for-each-group select="$index/tei:REF" group-by="tei:TERM">
-	  <xsl:sort select="tei:SORT" lang="{$doclang}"/>
-	  <dt><xsl:value-of select="current-grouping-key()"/></dt>
-	  <dd>
-	    <xsl:for-each-group select="current-group()" group-by="tei:LINK">
-	      <xsl:for-each select="current-group()[1]">
-		<a href="{tei:LINK}">
-		  <xsl:value-of select="tei:TARGET"/>
-		</a>
-	      </xsl:for-each>
-	      <xsl:value-of select="$spaceCharacter"/>
-	    </xsl:for-each-group>
-	  </dd>
-	</xsl:for-each-group>
-      </dl>
-    </div>
-  </xsl:template>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Closing file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process elements
-      tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6</desc>
-   </doc>
-  <xsl:template match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
-      <xsl:variable name="depth">
-         <xsl:apply-templates mode="depth" select="."/>
-      </xsl:variable>
-      <!-- depending on depth and splitting level, 
-	 we may do one of two things: -->
-    <xsl:choose>
-      <!-- -1. Override at top level -->
-      <xsl:when test="ancestor::tei:floatingText">
-	  <xsl:call-template name="doDivBody">
-	    <xsl:with-param name="Depth" select="$depth"/>
-	  </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:TEI/@rend='all'">
-	  <xsl:call-template name="doDivBody">
-	    <xsl:with-param name="Depth" select="$depth"/>
-	  </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:TEI/@rend='frontpage'">
-	  <xsl:call-template name="doDivBody">
-	    <xsl:with-param name="Depth" select="$depth"/>
-	  </xsl:call-template>
-      </xsl:when>
-      <!-- 0. We have gone far enough -->
-      <xsl:when test="$depth = $splitLevel and $STDOUT='true'">
-      </xsl:when>
-      <!-- 1. our section depth is below the splitting level -->
-      <xsl:when test="number($depth) &gt; number($splitLevel) or         @rend='nosplit' or ancestor::tei:TEI/@rend='all' or         ancestor::tei:TEI/@rend='frontpage' or         ancestor::tei:TEI/@rend='nosplit'">
-	  <xsl:call-template name="doDivBody">
-	    <xsl:with-param name="Depth" select="$depth"/>
-	  </xsl:call-template>
-      </xsl:when>
-      <!-- 2. we are at or above splitting level, 
-	   so start a new page  -->
-      <xsl:when test="number($depth) &lt;= number($splitLevel) and ancestor::tei:front and $splitFrontmatter='true'">
-	<xsl:call-template name="makeDivPage">
-	  <xsl:with-param name="depth" select="$depth"/>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:when test="number($depth) &lt;= number($splitLevel) and ancestor::tei:back and $splitBackmatter='true'">
-	<xsl:call-template name="makeDivPage">
-	  <xsl:with-param name="depth" select="$depth"/>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:when test="number($depth) &lt;= number($splitLevel) and ancestor::tei:body">
-	<xsl:call-template name="makeDivPage">
-	  <xsl:with-param name="depth" select="$depth"/>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-	  <xsl:call-template name="doDivBody">
-	    <xsl:with-param name="Depth" select="$depth"/>
-	  </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				TEI HTML: run end hook template teiEndHook
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="teiEndHook" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements front, body or back in splitting mode</desc>
+	</doc>
+	<xsl:template match="tei:front|tei:body|tei:back"
+		mode="split">
+		<xsl:for-each select="*">
+			<xsl:choose>
+				<xsl:when test="starts-with(local-name(.),'div')">
+					<xsl:apply-templates mode="split" select="." />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element body in inner mode</desc>
+	</doc>
+	<xsl:template match="tei:body" mode="inner">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element closer</desc>
+	</doc>
+	<xsl:template match="tei:closer">
+		<xsl:choose>
+			<xsl:when test="tei:signed">
+				<div class="closer">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="tei:postscript">
+				<div class="closer">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="tei:p">
+				<blockquote class="closer">
+					<xsl:apply-templates />
+				</blockquote>
+			</xsl:when>
+			<xsl:otherwise>
+				<blockquote class="closer">
+					<p>
+						<xsl:apply-templates />
+					</p>
+				</blockquote>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element dateline</desc>
+	</doc>
+	<xsl:template match="tei:dateline">
+		<span class="dateline">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element divGen[@type='actions']</desc>
+	</doc>
+	<xsl:template match="tei:divGen[@type='actions']">
+		<h3>Actions arising</h3>
+		<dl>
+			<xsl:for-each
+				select="/tei:TEI/tei:text//tei:note[@type='action']">
+				<dt>
+					<b>
+						<xsl:number count="tei:note[@type='action']"
+							level="any" />
+					</b>
+				</dt>
+				<dd>
+					<xsl:apply-templates />
+				</dd>
+			</xsl:for-each>
+		</dl>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element divGen[@type='toc']</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> table of contents </p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:divGen[@type='toc']">
+		<div class="tei_toc">
+			<h2>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						tocWords
+					</xsl:with-param>
+				</xsl:call-template>
+			</h2>
+			<xsl:call-template name="mainTOC" />
+		</div>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Create a new output page for a section
-      <param name="depth">depth of section (1, 2 3, 4 etc)</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeDivPage">
-      <xsl:param name="depth"/>
-      <xsl:variable name="outName">
-	<xsl:call-template name="outputChunkName">
-	  <xsl:with-param name="ident">
-	    <xsl:apply-templates mode="ident" select="."/>
-	  </xsl:with-param>
-	</xsl:call-template>
-      </xsl:variable>
-      
-      <xsl:if test="$verbose='true'">
-	<xsl:message>Opening file <xsl:value-of select="$outName"/>
-	</xsl:message>
-      </xsl:if>
-      <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
-			   encoding="{$outputEncoding}"
-			   href="{$outName}"
-			   method="{$outputMethod}">	     
-	<xsl:choose>
-	  <xsl:when test="$pageLayout='CSS'">
-	    <xsl:call-template name="pageLayoutCSS">
-	      <xsl:with-param name="currentID">
-		<xsl:apply-templates mode="ident" select="."/>
-	      </xsl:with-param>
-	    </xsl:call-template>
-	  </xsl:when>
-	  <xsl:when test="$pageLayout='Table'">
-	    <xsl:call-template name="pageLayoutTable">
-	      <xsl:with-param name="currentID">
-		<xsl:apply-templates mode="ident" select="."/>
-	      </xsl:with-param>
-	    </xsl:call-template>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:call-template name="writeDiv"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-	
-      </xsl:result-document>
-      
-      <xsl:if test="$verbose='true'">
-	<xsl:message>Closing file <xsl:value-of select="$outName"/>
-	</xsl:message>
-      </xsl:if>
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element docAuthor in "author" mode"</desc>
-   </doc>
-  <xsl:template match="tei:docAuthor" mode="author">
-      <xsl:if test="preceding-sibling::tei:docAuthor">
-         <xsl:text>, </xsl:text>
-      </xsl:if>
-      <xsl:apply-templates/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>index element, by default does nothing, unless it has an xml:id</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:index">
+		<xsl:if test="@xml:id">
+			<span>
+				<xsl:attribute name="id" select="@xml:id" />
+				<span style="display:none">
+					<xsl:value-of select="normalize-space(tei:term)" />
+				</span>
+			</span>
+		</xsl:if>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process element docTitle, docAuthor, docImprint and
-	 tei:docDate</p>
-         <p>
-            <p xmlns="http://www.w3.org/1999/xhtml"> Translate these to a corresponding HTML div </p>
-         </p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:docTitle|tei:docAuthor|tei:docImprint|tei:titlePage/tei:titlePart|tei:docDate">
-    <xsl:variable name="container">
-      <xsl:choose>
-	<xsl:when test="parent::tei:titlePage">
-	 <xsl:text>div</xsl:text>
-	</xsl:when>
-	<xsl:otherwise>
-	 <xsl:text>span</xsl:text>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element name="{$container}">
-      <xsl:call-template name="microdata"/>
-      <xsl:choose>
-	<xsl:when test="@rendition">
-	  <xsl:call-template name="applyRendition"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:call-template name="rendToClass">
-	    <xsl:with-param name="default">
-	      <xsl:value-of select="local-name()"/>
-	    </xsl:with-param>
-	  </xsl:call-template>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:apply-templates/>
-    </xsl:element>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Simplistic processing of element divGen[@type='index']</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml">make an index;
+					does not take indexName or nested index into account
+				</p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:divGen[@type='index']">
+		<div class="tei_index">
+			<h2>Index</h2>
+			<xsl:variable name="index">
+				<xsl:for-each select="key('INDEX',1)">
+					<tei:REF>
+						<tei:SORT>
+							<xsl:value-of
+								select="lower-case(normalize-unicode(tei:term,'NFD'))" />
+						</tei:SORT>
+						<tei:TERM>
+							<xsl:value-of select="tei:term" />
+						</tei:TERM>
+						<xsl:for-each
+							select="ancestor-or-self::*[tei:is-identifiable(.)][1]">
+							<tei:LINK>
+								<xsl:apply-templates mode="generateLink"
+									select="." />
+							</tei:LINK>
+							<tei:TARGET>
+								<xsl:call-template name="header" />
+							</tei:TARGET>
+						</xsl:for-each>
+					</tei:REF>
+				</xsl:for-each>
+			</xsl:variable>
+			<dl>
+				<xsl:for-each-group select="$index/tei:REF"
+					group-by="tei:TERM">
+					<xsl:sort select="tei:SORT" lang="{$doclang}" />
+					<dt>
+						<xsl:value-of select="current-grouping-key()" />
+					</dt>
+					<dd>
+						<xsl:for-each-group select="current-group()"
+							group-by="tei:LINK">
+							<xsl:for-each select="current-group()[1]">
+								<a href="{tei:LINK}">
+									<xsl:value-of select="tei:TARGET" />
+								</a>
+							</xsl:for-each>
+							<xsl:value-of select="$spaceCharacter" />
+						</xsl:for-each-group>
+					</dd>
+				</xsl:for-each-group>
+			</dl>
+		</div>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements
+			tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6</desc>
+	</doc>
+	<xsl:template
+		match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
+		<xsl:variable name="depth">
+			<xsl:apply-templates mode="depth" select="." />
+		</xsl:variable>
+		<!-- depending on depth and splitting level, we may do one of two things: -->
+		<xsl:choose>
+			<!-- -1. Override at top level -->
+			<xsl:when test="ancestor::tei:floatingText">
+				<xsl:call-template name="doDivBody">
+					<xsl:with-param name="Depth" select="$depth" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="ancestor::tei:TEI/@rend='all'">
+				<xsl:call-template name="doDivBody">
+					<xsl:with-param name="Depth" select="$depth" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="ancestor::tei:TEI/@rend='frontpage'">
+				<xsl:call-template name="doDivBody">
+					<xsl:with-param name="Depth" select="$depth" />
+				</xsl:call-template>
+			</xsl:when>
+			<!-- 0. We have gone far enough -->
+			<xsl:when test="$depth = $splitLevel and $STDOUT='true'">
+			</xsl:when>
+			<!-- 1. our section depth is below the splitting level -->
+			<xsl:when
+				test="number($depth) &gt; number($splitLevel) or         @rend='nosplit' or ancestor::tei:TEI/@rend='all' or         ancestor::tei:TEI/@rend='frontpage' or         ancestor::tei:TEI/@rend='nosplit'">
+				<xsl:call-template name="doDivBody">
+					<xsl:with-param name="Depth" select="$depth" />
+				</xsl:call-template>
+			</xsl:when>
+			<!-- 2. we are at or above splitting level, so start a new page -->
+			<xsl:when
+				test="number($depth) &lt;= number($splitLevel) and ancestor::tei:front and $splitFrontmatter='true'">
+				<xsl:call-template name="makeDivPage">
+					<xsl:with-param name="depth" select="$depth" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when
+				test="number($depth) &lt;= number($splitLevel) and ancestor::tei:back and $splitBackmatter='true'">
+				<xsl:call-template name="makeDivPage">
+					<xsl:with-param name="depth" select="$depth" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when
+				test="number($depth) &lt;= number($splitLevel) and ancestor::tei:body">
+				<xsl:call-template name="makeDivPage">
+					<xsl:with-param name="depth" select="$depth" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="doDivBody">
+					<xsl:with-param name="Depth" select="$depth" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element opener</desc>
-   </doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Create a new output page for a section
+			<param name="depth">depth of section (1, 2 3, 4 etc)</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeDivPage">
+		<xsl:param name="depth" />
+		<xsl:variable name="outName">
+			<xsl:call-template name="outputChunkName">
+				<xsl:with-param name="ident">
+					<xsl:apply-templates mode="ident" select="." />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
 
-  <xsl:template match="tei:opener">
-    <xsl:choose>
-      <xsl:when test="tei:signed|tei:salute">
-	<div class="opener">
-	  <xsl:apply-templates/>
-	</div>
-      </xsl:when>
-      <xsl:when test="tei:p">
-	<blockquote class="opener">
-	  <xsl:apply-templates/>
-	</blockquote>
-      </xsl:when>
-      <xsl:otherwise>
-	<blockquote class="opener">
-	  <p>
-	    <xsl:apply-templates/>
-	  </p>
-	</blockquote>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Opening file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+			encoding="{$outputEncoding}" href="{$outName}"
+			method="{$outputMethod}">
+			<xsl:choose>
+				<xsl:when test="$pageLayout='CSS'">
+					<xsl:call-template name="pageLayoutCSS">
+						<xsl:with-param name="currentID">
+							<xsl:apply-templates mode="ident" select="." />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:when test="$pageLayout='Table'">
+					<xsl:call-template name="pageLayoutTable">
+						<xsl:with-param name="currentID">
+							<xsl:apply-templates mode="ident" select="." />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="writeDiv" />
+				</xsl:otherwise>
+			</xsl:choose>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element text</desc>
-   </doc>
-  <xsl:template match="tei:text">
-      <xsl:choose>
-         <xsl:when test="parent::tei:TEI">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:group and $splitLevel=0">
-	   <xsl:call-template name="makeDivPage">
-	     <xsl:with-param name="depth">-1</xsl:with-param>
-	   </xsl:call-template>
-         </xsl:when>
-	 <xsl:otherwise>
-	   <xsl:call-template name="doDivBody"/>
-	 </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		</xsl:result-document>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element titlePage</desc>
-   </doc>
-  <xsl:template match="tei:titlePage">
-      <div class="titlePage">
-         <xsl:apply-templates/>
-      </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] <param name="crumbBody">crumbBody</param>
-      </desc>
-   </doc>
-  <xsl:template name="aCrumb">
-      <xsl:param name="crumbBody"/>
-      <li class="breadcrumb">
-         <xsl:copy-of select="$crumbBody"/>
-      </li>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="addCorpusID">
-      <xsl:if test="ancestor-or-self::tei:teiCorpus">
-         <xsl:for-each select="ancestor-or-self::tei:TEI">
-            <xsl:text>-</xsl:text>
-            <xsl:choose>
-               <xsl:when test="@xml:id">
-                  <xsl:value-of select="@xml:id"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:number/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:for-each>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="addLangAtt">
-      <xsl:variable name="documentationLanguage">
-         <xsl:choose>
-            <xsl:when test="string-length($doclang)&gt;0">
-	      <xsl:value-of select="$doclang"/>
-            </xsl:when>
-            <xsl:when test="ancestor-or-self::tei:schemaSpec/@docLang">
-	      <xsl:value-of select="//tei:schemaSpec[1]/@docLang"/>
-            </xsl:when>
-            <xsl:otherwise>
-	      <xsl:text>en</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Closing file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
+	</xsl:template>
 
-      <xsl:variable name="supplied">
-	<xsl:choose>
-	  <xsl:when test="ancestor-or-self::tei:*[@xml:lang]">
-	    <xsl:value-of select="ancestor-or-self::tei:*[@xml:lang][1]/@xml:lang"/>
-	  </xsl:when>
-	  <xsl:when test="ancestor-or-self::tei:*[@lang]">
-	    <xsl:value-of select="ancestor-or-self::tei:*[@lang][1]/@lang"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:value-of select="$documentationLanguage"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-	<xsl:when test="$outputTarget='html'">
-	  <xsl:attribute name="xml:lang">
-	    <xsl:value-of select="$supplied"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element docAuthor in "author" mode"</desc>
+	</doc>
+	<xsl:template match="tei:docAuthor" mode="author">
+		<xsl:if test="preceding-sibling::tei:docAuthor">
+			<xsl:text>, </xsl:text>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element docTitle, docAuthor, docImprint and
+				tei:docDate</p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> Translate these to a corresponding HTML div </p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template
+		match="tei:docTitle|tei:docAuthor|tei:docImprint|tei:titlePage/tei:titlePart|tei:docDate">
+		<xsl:variable name="container">
+			<xsl:choose>
+				<xsl:when test="parent::tei:titlePage">
+					<xsl:text>div</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>span</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element name="{$container}">
+			<xsl:call-template name="microdata" />
+			<xsl:choose>
+				<xsl:when test="@rendition">
+					<xsl:call-template name="applyRendition" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="rendToClass">
+						<xsl:with-param name="default">
+							<xsl:value-of select="local-name()" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element opener</desc>
+	</doc>
+
+	<xsl:template match="tei:opener">
+		<xsl:choose>
+			<xsl:when test="tei:signed|tei:salute">
+				<div class="opener">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="tei:p">
+				<blockquote class="opener">
+					<xsl:apply-templates />
+				</blockquote>
+			</xsl:when>
+			<xsl:otherwise>
+				<blockquote class="opener">
+					<p>
+						<xsl:apply-templates />
+					</p>
+				</blockquote>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element text</desc>
+	</doc>
+	<xsl:template match="tei:text">
+		<xsl:choose>
+			<xsl:when test="parent::tei:TEI">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:group and $splitLevel=0">
+				<xsl:call-template name="makeDivPage">
+					<xsl:with-param name="depth">
+						-1
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="doDivBody" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element titlePage</desc>
+	</doc>
+	<xsl:template match="tei:titlePage">
+		<div class="titlePage">
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="crumbBody">crumbBody</param>
+		</desc>
+	</doc>
+	<xsl:template name="aCrumb">
+		<xsl:param name="crumbBody" />
+		<li class="breadcrumb">
+			<xsl:copy-of select="$crumbBody" />
+		</li>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="addCorpusID">
+		<xsl:if test="ancestor-or-self::tei:teiCorpus">
+			<xsl:for-each select="ancestor-or-self::tei:TEI">
+				<xsl:text>-</xsl:text>
+				<xsl:choose>
+					<xsl:when test="@xml:id">
+						<xsl:value-of select="@xml:id" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:number />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="addLangAtt">
+		<xsl:variable name="documentationLanguage">
+			<xsl:choose>
+				<xsl:when test="string-length($doclang)&gt;0">
+					<xsl:value-of select="$doclang" />
+				</xsl:when>
+				<xsl:when test="ancestor-or-self::tei:schemaSpec/@docLang">
+					<xsl:value-of select="//tei:schemaSpec[1]/@docLang" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>en</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+
+		<xsl:variable name="supplied">
+			<xsl:choose>
+				<xsl:when test="ancestor-or-self::tei:*[@xml:lang]">
+					<xsl:value-of
+						select="ancestor-or-self::tei:*[@xml:lang][1]/@xml:lang" />
+				</xsl:when>
+				<xsl:when test="ancestor-or-self::tei:*[@lang]">
+					<xsl:value-of
+						select="ancestor-or-self::tei:*[@lang][1]/@lang" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$documentationLanguage" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$outputTarget='html'">
+				<xsl:attribute name="xml:lang">
+	    <xsl:value-of select="$supplied" />
 	  </xsl:attribute>
-	</xsl:when>
-	<xsl:when test="$outputTarget='html5'">
-	  <xsl:attribute name="lang">
-	    <xsl:value-of select="$supplied"/>
+			</xsl:when>
+			<xsl:when test="$outputTarget='html5'">
+				<xsl:attribute name="lang">
+	    <xsl:value-of select="$supplied" />
 	  </xsl:attribute>
-	</xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[html] </p>
-         <p>where to start the path from</p>
-         <param name="crumbRoot">/</param>
-      </desc>
-   </doc>
-  <xsl:template name="crumbPath">
-      <xsl:param name="crumbRoot">/</xsl:param>
-      <div class="breadcrumb">
-         <xsl:call-template name="preBreadCrumbPath"/>
-         <ul class="breadcrumb">
-            <li class="breadcrumb-first">
-               <a class="breadcrumb" href="{$homeURL}">
-                  <xsl:value-of select="$homeLabel"/>
-               </a>
-            </li>
-            <xsl:call-template name="walkTree">
-               <xsl:with-param name="path">
-                  <xsl:value-of select="substring-after($REQUEST,$crumbRoot)"/>
-               </xsl:with-param>
-               <xsl:with-param name="whole">
-                  <xsl:value-of select="$crumbRoot"/>
-               </xsl:with-param>
-               <xsl:with-param name="class">breadcrumb</xsl:with-param>
-            </xsl:call-template>
-         </ul>
-      </div>
-  </xsl:template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[html] </p>
+			<p>where to start the path from</p>
+			<param name="crumbRoot">/</param>
+		</desc>
+	</doc>
+	<xsl:template name="crumbPath">
+		<xsl:param name="crumbRoot">
+			/
+		</xsl:param>
+		<div class="breadcrumb">
+			<xsl:call-template name="preBreadCrumbPath" />
+			<ul class="breadcrumb">
+				<li class="breadcrumb-first">
+					<a class="breadcrumb" href="{$homeURL}">
+						<xsl:value-of select="$homeLabel" />
+					</a>
+				</li>
+				<xsl:call-template name="walkTree">
+					<xsl:with-param name="path">
+						<xsl:value-of
+							select="substring-after($REQUEST,$crumbRoot)" />
+					</xsl:with-param>
+					<xsl:with-param name="whole">
+						<xsl:value-of select="$crumbRoot" />
+					</xsl:with-param>
+					<xsl:with-param name="class">
+						breadcrumb
+					</xsl:with-param>
+				</xsl:call-template>
+			</ul>
+		</div>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Make a section heading
-      <param name="Depth">which head level to make</param>
-      </desc>
-   </doc>
-  <xsl:template name="doDivBody">
-      <xsl:param name="Depth"/>
-      <xsl:param name="nav">false</xsl:param>
-      <xsl:variable name="container">
-	<xsl:choose>
-	  <xsl:when test="$outputTarget='html5'">section</xsl:when>
-	  <xsl:otherwise>div</xsl:otherwise>
-	</xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-	<xsl:when test="$filePerPage='true'">
-	    <xsl:call-template name="startDivHook"/>
-	    <xsl:call-template name="divContents">
-	      <xsl:with-param name="Depth" select="$Depth"/>
-	      <xsl:with-param name="nav" select="$nav"/>
-	    </xsl:call-template>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:element name="{$container}">
-	    <xsl:call-template name="microdata"/>
-	    <xsl:call-template name="divClassAttribute">
-	      <xsl:with-param name="depth" select="$Depth"/>
-	    </xsl:call-template>	
-	    <xsl:call-template name="startDivHook"/>
-	    <xsl:call-template name="divContents">
-	      <xsl:with-param name="Depth" select="$Depth"/>
-	      <xsl:with-param name="nav" select="$nav"/>
-	    </xsl:call-template>
-	  </xsl:element>
-	</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Make a section heading
+			<param name="Depth">which head level to make</param>
+		</desc>
+	</doc>
+	<xsl:template name="doDivBody">
+		<xsl:param name="Depth" />
+		<xsl:param name="nav">
+			false
+		</xsl:param>
+		<xsl:variable name="container">
+			<xsl:choose>
+				<xsl:when test="$outputTarget='html5'">
+					section
+				</xsl:when>
+				<xsl:otherwise>
+					div
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$filePerPage='true'">
+				<xsl:call-template name="startDivHook" />
+				<xsl:call-template name="divContents">
+					<xsl:with-param name="Depth" select="$Depth" />
+					<xsl:with-param name="nav" select="$nav" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element name="{$container}">
+					<xsl:call-template name="microdata" />
+					<xsl:call-template name="divClassAttribute">
+						<xsl:with-param name="depth" select="$Depth" />
+					</xsl:call-template>
+					<xsl:call-template name="startDivHook" />
+					<xsl:call-template name="divContents">
+						<xsl:with-param name="Depth" select="$Depth" />
+						<xsl:with-param name="nav" select="$nav" />
+					</xsl:call-template>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] doing the contents of a div</desc>
-   </doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] doing the contents of a div</desc>
+	</doc>
 
-  <xsl:template name="divContents">
-      <xsl:param name="Depth"/>
-      <xsl:param name="nav">false</xsl:param>
-      <xsl:variable name="ident">
-	<xsl:apply-templates mode="ident" select="."/>
-      </xsl:variable>
-      
-	<xsl:choose>
-	  <xsl:when test="parent::tei:*/@rend='multicol'">
-	    <td style="vertical-align:top;">
-	      <xsl:if test="not($Depth = '')">
-		<xsl:element name="h{$Depth + $divOffset}">
-		  <xsl:for-each select="tei:head[1]">		
-		    <xsl:call-template name="rendToClass">
-		      <xsl:with-param name="default"/>
-		    </xsl:call-template>
-		 </xsl:for-each>
-		 <xsl:call-template name="header">
-		   <xsl:with-param name="display">full</xsl:with-param>
-		 </xsl:call-template>
-		 <xsl:call-template name="sectionHeadHook"/>
-	       </xsl:element>
-	     </xsl:if>
-	     <xsl:apply-templates/>
-	   </td>
-         </xsl:when>
-         <xsl:when test="@rend='multicol'">
-            <xsl:apply-templates select="*[not(local-name(.)='div')]"/>
-            <table>
-               <tr>
-                  <xsl:apply-templates select="tei:div"/>
-               </tr>
-            </table>
-         </xsl:when>
-	 <xsl:when test="@rend='nohead'">
-	   <xsl:apply-templates/>
-	 </xsl:when>
-         <xsl:otherwise>
-	   <xsl:if test="not($Depth = '')">
-	     <xsl:variable name="Heading">
-	       <xsl:element name="{if (number($Depth)+$divOffset &gt;6) then 'div'
+	<xsl:template name="divContents">
+		<xsl:param name="Depth" />
+		<xsl:param name="nav">
+			false
+		</xsl:param>
+		<xsl:variable name="ident">
+			<xsl:apply-templates mode="ident" select="." />
+		</xsl:variable>
+
+		<xsl:choose>
+			<xsl:when test="parent::tei:*/@rend='multicol'">
+				<td style="vertical-align:top;">
+					<xsl:if test="not($Depth = '')">
+						<xsl:element name="h{$Depth + $divOffset}">
+							<xsl:for-each select="tei:head[1]">
+								<xsl:call-template name="rendToClass">
+									<xsl:with-param name="default" />
+								</xsl:call-template>
+							</xsl:for-each>
+							<xsl:call-template name="header">
+								<xsl:with-param name="display">
+									full
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:call-template name="sectionHeadHook" />
+						</xsl:element>
+					</xsl:if>
+					<xsl:apply-templates />
+				</td>
+			</xsl:when>
+			<xsl:when test="@rend='multicol'">
+				<xsl:apply-templates
+					select="*[not(local-name(.)='div')]" />
+				<table>
+					<tr>
+						<xsl:apply-templates select="tei:div" />
+					</tr>
+				</table>
+			</xsl:when>
+			<xsl:when test="@rend='nohead'">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="not($Depth = '')">
+					<xsl:variable name="Heading">
+						<xsl:element
+							name="{if (number($Depth)+$divOffset &gt;6) then 'div'
 				  else concat('h',number($Depth) + $divOffset)}">
-		 <xsl:choose>
-		   <xsl:when test="@rend">
-		     <xsl:call-template name="rendToClass">
-		       <xsl:with-param
-			   name="id">false</xsl:with-param>
-		     </xsl:call-template>
-		   </xsl:when>
-		   <xsl:otherwise>
-		     <xsl:for-each select="tei:head[1]">
-		       <xsl:call-template name="rendToClass">
-			 <xsl:with-param name="default">
-			   <xsl:if test="number($Depth)&gt;5">
-			     <xsl:text>div</xsl:text>
-			     <xsl:value-of select="$Depth"/>
-			   </xsl:if>
-			 </xsl:with-param>
-		       </xsl:call-template>
-		     </xsl:for-each>
-		   </xsl:otherwise>
-		 </xsl:choose>
-		 <xsl:call-template name="header">
-		   <xsl:with-param name="display">full</xsl:with-param>
-		 </xsl:call-template>
-		 <xsl:call-template name="sectionHeadHook"/>
-	       </xsl:element>
-	     </xsl:variable>
-	     <xsl:choose>
-	       <xsl:when test="$outputTarget='html5'">
-		 <header>
-		   <xsl:copy-of select="$Heading"/>
-		 </header>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:copy-of select="$Heading"/>
-	       </xsl:otherwise>
-	     </xsl:choose>
+							<xsl:choose>
+								<xsl:when test="@rend">
+									<xsl:call-template name="rendToClass">
+										<xsl:with-param name="id">
+											false
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each select="tei:head[1]">
+										<xsl:call-template name="rendToClass">
+											<xsl:with-param name="default">
+												<xsl:if test="number($Depth)&gt;5">
+													<xsl:text>div</xsl:text>
+													<xsl:value-of select="$Depth" />
+												</xsl:if>
+											</xsl:with-param>
+										</xsl:call-template>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+							<xsl:call-template name="header">
+								<xsl:with-param name="display">
+									full
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:call-template name="sectionHeadHook" />
+						</xsl:element>
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="$outputTarget='html5'">
+							<header>
+								<xsl:copy-of select="$Heading" />
+							</header>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:copy-of select="$Heading" />
+						</xsl:otherwise>
+					</xsl:choose>
 
-	     <xsl:if test="$topNavigationPanel='true' and
+					<xsl:if
+						test="$topNavigationPanel='true' and
 			   $nav='true'">
-	       <xsl:element name="{if ($outputTarget='html5') then 'nav'
+						<xsl:element
+							name="{if ($outputTarget='html5') then 'nav'
 				  else 'div'}">
-		 <xsl:call-template name="xrefpanel">
-		   <xsl:with-param name="homepage" select="concat($masterFile,$standardSuffix)"/>
-		   <xsl:with-param name="mode" select="local-name(.)"/>
-		 </xsl:call-template>
-	       </xsl:element>
-	     </xsl:if>
-	   </xsl:if>
-	   <xsl:apply-templates/>
-	   <xsl:if test="$bottomNavigationPanel='true' and
+							<xsl:call-template name="xrefpanel">
+								<xsl:with-param name="homepage"
+									select="concat($masterFile,$standardSuffix)" />
+								<xsl:with-param name="mode"
+									select="local-name(.)" />
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:if>
+				</xsl:if>
+				<xsl:apply-templates />
+				<xsl:if
+					test="$bottomNavigationPanel='true' and
 			 $nav='true'">
-	     <xsl:element name="{if ($outputTarget='html5') then 'nav' else
-				'div'}">	       
-	       <xsl:call-template name="xrefpanel">
-		 <xsl:with-param name="homepage" select="concat($masterFile,$standardSuffix)"/>
-		 <xsl:with-param name="mode" select="local-name(.)"/>
-	       </xsl:call-template>
-	     </xsl:element>
-	   </xsl:if>
-         </xsl:otherwise>
-	</xsl:choose>
-  </xsl:template>
+					<xsl:element
+						name="{if ($outputTarget='html5') then 'nav' else
+				'div'}">
+						<xsl:call-template name="xrefpanel">
+							<xsl:with-param name="homepage"
+								select="concat($masterFile,$standardSuffix)" />
+							<xsl:with-param name="mode" select="local-name(.)" />
+						</xsl:call-template>
+					</xsl:element>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] process divisions</desc>
-   </doc>
-  <xsl:template name="doDivs">
-      <xsl:for-each select="tei:TEI/tei:text">
-         <xsl:for-each select="tei:front|tei:body|tei:back">
-            <xsl:for-each select="tei:div|tei:div1">
-               <xsl:variable name="currentID">
-                  <xsl:apply-templates mode="ident" select="."/>
-               </xsl:variable>
-               <xsl:call-template name="doPageTable">
-                  <xsl:with-param name="currentID" select="$currentID"/>
-               </xsl:call-template>
-            </xsl:for-each>
-         </xsl:for-each>
-      </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] <param name="currentID">currentID</param>
-      </desc>
-   </doc>
-  <xsl:template name="doPageTable">
-      <xsl:param name="currentID"/>
-      <xsl:variable name="BaseFile">
-         <xsl:value-of select="$masterFile"/>
-         <xsl:call-template name="addCorpusID"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$STDOUT='true'">
-	           <xsl:choose>
-	              <xsl:when test="$pageLayout='CSS'">
-                  <xsl:call-template name="pageLayoutCSS">
-                     <xsl:with-param name="currentID" select="$currentID"/>
-                  </xsl:call-template>
-               </xsl:when>
-               <xsl:when test="$pageLayout='Table'">
-                  <xsl:call-template name="pageLayoutTable">
-                     <xsl:with-param name="currentID" select="$currentID"/>
-                  </xsl:call-template>
-               </xsl:when>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] process divisions</desc>
+	</doc>
+	<xsl:template name="doDivs">
+		<xsl:for-each select="tei:TEI/tei:text">
+			<xsl:for-each select="tei:front|tei:body|tei:back">
+				<xsl:for-each select="tei:div|tei:div1">
+					<xsl:variable name="currentID">
+						<xsl:apply-templates mode="ident" select="." />
+					</xsl:variable>
+					<xsl:call-template name="doPageTable">
+						<xsl:with-param name="currentID"
+							select="$currentID" />
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="currentID">currentID</param>
+		</desc>
+	</doc>
+	<xsl:template name="doPageTable">
+		<xsl:param name="currentID" />
+		<xsl:variable name="BaseFile">
+			<xsl:value-of select="$masterFile" />
+			<xsl:call-template name="addCorpusID" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$STDOUT='true'">
+				<xsl:choose>
+					<xsl:when test="$pageLayout='CSS'">
+						<xsl:call-template name="pageLayoutCSS">
+							<xsl:with-param name="currentID"
+								select="$currentID" />
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when test="$pageLayout='Table'">
+						<xsl:call-template name="pageLayoutTable">
+							<xsl:with-param name="currentID"
+								select="$currentID" />
+						</xsl:call-template>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
 
 
-	           <xsl:variable name="outName">
-	              <xsl:call-template name="outputChunkName">
-	                 <xsl:with-param name="ident">
-	                    <xsl:choose>
-		                      <xsl:when test="not($currentID='')">
-		                         <xsl:value-of select="$currentID"/>
-		                      </xsl:when>
-		                      <xsl:otherwise>
-		                         <xsl:value-of select="$BaseFile"/>
-	                       </xsl:otherwise>
-	                    </xsl:choose>
-	                 </xsl:with-param>
-	              </xsl:call-template>
-	           </xsl:variable>
-	
-	           <xsl:if test="$verbose='true'">
-	              <xsl:message>Opening file <xsl:value-of select="$outName"/>
-               </xsl:message>
-	           </xsl:if>
-	           <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
-                                 encoding="{$outputEncoding}"
-                                 href="{$outName}"
-                                 method="{$outputMethod}">
-	              <xsl:choose>
-	                 <xsl:when test="$pageLayout='CSS'">
-		                   <xsl:call-template name="pageLayoutCSS">
-		                      <xsl:with-param name="currentID" select="$currentID"/>
-		                   </xsl:call-template>
-	                 </xsl:when>
-	                 <xsl:when test="$pageLayout='Table'">
-		                   <xsl:call-template name="pageLayoutTable">
-		                      <xsl:with-param name="currentID" select="$currentID"/>
-		                   </xsl:call-template>
-	                 </xsl:when>
-	              </xsl:choose>
-	           </xsl:result-document>
-	
-	           <xsl:if test="$verbose='true'">
-	              <xsl:message>Closing file <xsl:value-of select="$outName"/>
-               </xsl:message>
-	           </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+				<xsl:variable name="outName">
+					<xsl:call-template name="outputChunkName">
+						<xsl:with-param name="ident">
+							<xsl:choose>
+								<xsl:when test="not($currentID='')">
+									<xsl:value-of select="$currentID" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="$BaseFile" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:variable>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>plain text version of title for div [html] </desc>
-   </doc>
-  <xsl:template name="generateDivtitle">
-      <xsl:apply-templates select="tei:head" mode="plain"/>
-  </xsl:template>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Opening file
+						<xsl:value-of select="$outName" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+					encoding="{$outputEncoding}" href="{$outName}"
+					method="{$outputMethod}">
+					<xsl:choose>
+						<xsl:when test="$pageLayout='CSS'">
+							<xsl:call-template name="pageLayoutCSS">
+								<xsl:with-param name="currentID"
+									select="$currentID" />
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:when test="$pageLayout='Table'">
+							<xsl:call-template name="pageLayoutTable">
+								<xsl:with-param name="currentID"
+									select="$currentID" />
+							</xsl:call-template>
+						</xsl:when>
+					</xsl:choose>
+				</xsl:result-document>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>link to level above[html] </desc>
-   </doc>
-  <xsl:template name="generateUpLink">
-      <xsl:variable name="myName">
-         <xsl:value-of select="local-name(.)"/>
-      </xsl:variable>
-      <xsl:variable name="BaseFile">
-         <xsl:value-of select="$masterFile"/>
-         <xsl:value-of select="$standardSuffix"/>
-         <xsl:call-template name="addCorpusID"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$myName = 'div' and not(ancestor::tei:div)">
-            <xsl:call-template name="upLink">
-	              <xsl:with-param name="up" select="$BaseFile"/>
-	              <xsl:with-param name="title" select="$homeLabel"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$myName = 'div'">
-            <xsl:call-template name="upLink">
-               <xsl:with-param name="up" select="ancestor::tei:div[1]"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$myName='div1'">
-	           <xsl:call-template name="upLink">
-	              <xsl:with-param name="up" select="$BaseFile"/>
-	              <xsl:with-param name="title" select="$homeLabel"/>
-	           </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$myName='div2'">
-	           <xsl:call-template name="upLink">
-	              <xsl:with-param name="up" select="ancestor::tei:div1"/>
-	           </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$myName='div3'">
-	           <xsl:call-template name="upLink">
-	              <xsl:with-param name="up" select="ancestor::tei:div2"/>
-	           </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$myName='div4'">
-	           <xsl:call-template name="upLink">
-	              <xsl:with-param name="up" select="ancestor::tei:div3"/>
-	           </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$myName='div5'">
-	           <xsl:call-template name="upLink">
-	              <xsl:with-param name="up" select="ancestor::tei:div4"/>
-	           </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-	           <xsl:call-template name="upLink">
-	              <xsl:with-param name="up" select="(ancestor::tei:div1|ancestor::tei:div)[1]"/>
-	           </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>What happens at the end of an HTML file [html] </p>
-      </desc>
-   </doc>
-  <xsl:template name="htmlFileBottom">
-      <xsl:call-template name="topNavigation"/>
-      <xsl:call-template name="stdfooter"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="htmlFileTop">
-      <xsl:comment>THIS FILE IS GENERATED FROM AN XML MASTER. DO NOT EDIT (6)</xsl:comment>
-      <xsl:variable name="pagetitle">
-         <xsl:call-template name="generateTitle"/>
-      </xsl:variable>
-      <head>
-         <title>
-            <xsl:value-of select="$pagetitle"/>
-         </title>
-         <xsl:call-template name="headHook"/>
-         <xsl:call-template name="metaHTML">
-            <xsl:with-param name="title" select="$pagetitle"/>
-         </xsl:call-template>
-         <xsl:call-template name="includeCSS"/>
-         <xsl:call-template name="cssHook"/>
-         <xsl:call-template name="includeJavascript"/>
-         <xsl:call-template name="javascriptHook"/>
-      </head>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="includeCSS">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Closing file
+						<xsl:value-of select="$outName" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-      <xsl:if test="string-length($cssFile)&gt;0">
-	<link href="{$cssFile}" rel="stylesheet" type="text/css"/>
-      </xsl:if>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>plain text version of title for div [html] </desc>
+	</doc>
+	<xsl:template name="generateDivtitle">
+		<xsl:apply-templates select="tei:head"
+			mode="plain" />
+	</xsl:template>
 
-      <xsl:if test="string-length($cssSecondaryFile)&gt;0">
-	<link href="{$cssSecondaryFile}" rel="stylesheet" type="text/css"/>
-      </xsl:if>
-      
-      <xsl:if test="string-length($cssPrintFile)&gt;0">
-	<link rel="stylesheet" media="print" type="text/css">
-	  <xsl:attribute name="href" select="$cssPrintFile"/>
-	</link>
-      </xsl:if>
-      
-      <xsl:if test="$cssInlineFile">
-	<style type="text/css" title="inline_css">
-	  <xsl:for-each select="tokenize(unparsed-text($cssInlineFile),
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>link to level above[html] </desc>
+	</doc>
+	<xsl:template name="generateUpLink">
+		<xsl:variable name="myName">
+			<xsl:value-of select="local-name(.)" />
+		</xsl:variable>
+		<xsl:variable name="BaseFile">
+			<xsl:value-of select="$masterFile" />
+			<xsl:value-of select="$standardSuffix" />
+			<xsl:call-template name="addCorpusID" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$myName = 'div' and not(ancestor::tei:div)">
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up" select="$BaseFile" />
+					<xsl:with-param name="title" select="$homeLabel" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$myName = 'div'">
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up"
+						select="ancestor::tei:div[1]" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$myName='div1'">
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up" select="$BaseFile" />
+					<xsl:with-param name="title" select="$homeLabel" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$myName='div2'">
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up"
+						select="ancestor::tei:div1" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$myName='div3'">
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up"
+						select="ancestor::tei:div2" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$myName='div4'">
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up"
+						select="ancestor::tei:div3" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$myName='div5'">
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up"
+						select="ancestor::tei:div4" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up"
+						select="(ancestor::tei:div1|ancestor::tei:div)[1]" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>What happens at the end of an HTML file [html] </p>
+		</desc>
+	</doc>
+	<xsl:template name="htmlFileBottom">
+		<xsl:call-template name="topNavigation" />
+		<xsl:call-template name="stdfooter" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="htmlFileTop">
+		<xsl:comment>
+			THIS FILE IS GENERATED FROM AN XML MASTER. DO NOT EDIT (6)
+		</xsl:comment>
+		<xsl:variable name="pagetitle">
+			<xsl:call-template name="generateTitle" />
+		</xsl:variable>
+		<head>
+			<title>
+				<xsl:value-of select="$pagetitle" />
+			</title>
+			<xsl:call-template name="headHook" />
+			<xsl:call-template name="metaHTML">
+				<xsl:with-param name="title" select="$pagetitle" />
+			</xsl:call-template>
+			<xsl:call-template name="includeCSS" />
+			<xsl:call-template name="cssHook" />
+			<xsl:call-template name="includeJavascript" />
+			<xsl:call-template name="javascriptHook" />
+		</head>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="includeCSS">
+
+		<xsl:if test="string-length($cssFile)&gt;0">
+			<link href="{$cssFile}" rel="stylesheet" type="text/css" />
+		</xsl:if>
+
+		<xsl:if test="string-length($cssSecondaryFile)&gt;0">
+			<link href="{$cssSecondaryFile}" rel="stylesheet"
+				type="text/css" />
+		</xsl:if>
+
+		<xsl:if test="string-length($cssPrintFile)&gt;0">
+			<link rel="stylesheet" media="print" type="text/css">
+				<xsl:attribute name="href" select="$cssPrintFile" />
+			</link>
+		</xsl:if>
+
+		<xsl:if test="$cssInlineFile">
+			<style type="text/css" title="inline_css">
+				<xsl:for-each
+					select="tokenize(unparsed-text($cssInlineFile),
 				'\r?\n')">
-	    <xsl:value-of select="normalize-space(.)"/>
-	    <xsl:text>&#10;</xsl:text>
-	  </xsl:for-each>
-	</style>
-      </xsl:if>
+					<xsl:value-of select="normalize-space(.)" />
+					<xsl:text>&#10;</xsl:text>
+				</xsl:for-each>
+			</style>
+		</xsl:if>
 
-      <xsl:call-template name="generateLocalCSS"/>
-      
-  </xsl:template>
+		<xsl:call-template name="generateLocalCSS" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Javascript functions to be declared in HTML header</desc>
-   </doc>
-   <xsl:template name="includeJavascript">
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[html] Write out some Javascript into the HTML</p>
-         <p>Note that it does not have to commented if the output is
-    XHTML</p>
-         <param name="content">The code</param>
-      </desc>
-   </doc>
-  <xsl:template name="writeJavascript">
-      <xsl:param name="content"/>
-      <script type="text/javascript">
-	<xsl:value-of select="$content"/>
-      </script>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Make contents of left-hand column<param name="currentID">currentID</param>
-      </desc>
-   </doc>
-  <xsl:template name="leftHandFrame">
-      <xsl:param name="currentID"/>
-      <xsl:call-template name="makeSidebar"/>
-      <xsl:choose>
-         <xsl:when test="$currentID=''">
-            <xsl:call-template name="linkListContents">
-               <xsl:with-param name="style" select="'toclist'"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="count(id($currentID))&gt;0">
-                  <xsl:for-each select="id($currentID)">
-                     <xsl:call-template name="linkListContents">
-                        <xsl:with-param name="style" select="'toclist'"/>
-                     </xsl:call-template>
-                  </xsl:for-each>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:apply-templates mode="xpath" select="ancestor-or-self::tei:TEI/tei:text">
-                     <xsl:with-param name="xpath" select="$currentID"/>
-                     <xsl:with-param name="action" select="'toclist'"/>
-                  </xsl:apply-templates>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] bypass sidebar lists in normal mode</desc>
-   </doc>
-  <xsl:template match="tei:list[@type='sidebar']"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Summary links in left-hand column</desc>
-   </doc>
-  <xsl:template name="makeSidebar">
-      <xsl:for-each select="ancestor-or-self::tei:TEI/tei:text/tei:body/tei:list[@type='sidebar']">
-         <xsl:for-each select=".//tei:ref">
-            <p class="sidebar">
-               <a class="toclist" href="{@url}">
-                  <xsl:apply-templates/>
-               </a>
-            </p>
-         </xsl:for-each>
-      </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Summary table of contents in left-hand column<param name="style">style</param>
-      </desc>
-   </doc>
-  <xsl:template name="linkListContents">
-      <xsl:param name="style" select="'toc'"/>
-      <xsl:variable name="BaseFile">
-         <xsl:value-of select="$masterFile"/>
-         <xsl:call-template name="addCorpusID"/>
-      </xsl:variable>
-      <xsl:variable name="thisOne">
-         <xsl:value-of select="generate-id()"/>
-      </xsl:variable>
-      <xsl:for-each select="ancestor-or-self::tei:TEI/tei:text">
-      <!-- front matter -->
-      <xsl:for-each select="tei:front">
-	           <xsl:if test="tei:div1|tei:div">
-	              <div class="tocFront">
-	                 <xsl:element name="{$tocContainerElement}">
-	                    <xsl:attribute name="class">
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] Javascript functions to be declared in HTML header</desc>
+	</doc>
+	<xsl:template name="includeJavascript">
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[html] Write out some Javascript into the HTML</p>
+			<p>Note that it does not have to commented if the output is
+				XHTML</p>
+			<param name="content">The code</param>
+		</desc>
+	</doc>
+	<xsl:template name="writeJavascript">
+		<xsl:param name="content" />
+		<script type="text/javascript">
+			<xsl:value-of select="$content" />
+		</script>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Make contents of left-hand column
+			<param name="currentID">currentID</param>
+		</desc>
+	</doc>
+	<xsl:template name="leftHandFrame">
+		<xsl:param name="currentID" />
+		<xsl:call-template name="makeSidebar" />
+		<xsl:choose>
+			<xsl:when test="$currentID=''">
+				<xsl:call-template name="linkListContents">
+					<xsl:with-param name="style" select="'toclist'" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="count(id($currentID))&gt;0">
+						<xsl:for-each select="id($currentID)">
+							<xsl:call-template name="linkListContents">
+								<xsl:with-param name="style" select="'toclist'" />
+							</xsl:call-template>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates mode="xpath"
+							select="ancestor-or-self::tei:TEI/tei:text">
+							<xsl:with-param name="xpath" select="$currentID" />
+							<xsl:with-param name="action" select="'toclist'" />
+						</xsl:apply-templates>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] bypass sidebar lists in normal mode</desc>
+	</doc>
+	<xsl:template match="tei:list[@type='sidebar']" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] Summary links in left-hand column</desc>
+	</doc>
+	<xsl:template name="makeSidebar">
+		<xsl:for-each
+			select="ancestor-or-self::tei:TEI/tei:text/tei:body/tei:list[@type='sidebar']">
+			<xsl:for-each select=".//tei:ref">
+				<p class="sidebar">
+					<a class="toclist" href="{@url}">
+						<xsl:apply-templates />
+					</a>
+				</p>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Summary table of contents in left-hand column
+			<param name="style">style</param>
+		</desc>
+	</doc>
+	<xsl:template name="linkListContents">
+		<xsl:param name="style" select="'toc'" />
+		<xsl:variable name="BaseFile">
+			<xsl:value-of select="$masterFile" />
+			<xsl:call-template name="addCorpusID" />
+		</xsl:variable>
+		<xsl:variable name="thisOne">
+			<xsl:value-of select="generate-id()" />
+		</xsl:variable>
+		<xsl:for-each select="ancestor-or-self::tei:TEI/tei:text">
+			<!-- front matter -->
+			<xsl:for-each select="tei:front">
+				<xsl:if test="tei:div1|tei:div">
+					<div class="tocFront">
+						<xsl:element name="{$tocContainerElement}">
+							<xsl:attribute name="class">
 		                      <xsl:text>tocContainer</xsl:text>
 	                    </xsl:attribute>
-	                    <xsl:call-template name="tocSection">
-		                      <xsl:with-param name="id" select="$thisOne"/>
-		                      <xsl:with-param name="style" select="$style"/>
-	                    </xsl:call-template>
-	                 </xsl:element>
-	              </div>
-	           </xsl:if>
-         </xsl:for-each>
-         <!-- body matter -->
-      <xsl:for-each select="tei:body">
-	           <xsl:if test="tei:div1|tei:div">
-	              <div class="tocBody">
-	                 <xsl:comment>start TOC</xsl:comment>
-	                 <xsl:element name="{$tocContainerElement}">
-	                    <xsl:attribute name="class">
+							<xsl:call-template name="tocSection">
+								<xsl:with-param name="id" select="$thisOne" />
+								<xsl:with-param name="style" select="$style" />
+							</xsl:call-template>
+						</xsl:element>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+			<!-- body matter -->
+			<xsl:for-each select="tei:body">
+				<xsl:if test="tei:div1|tei:div">
+					<div class="tocBody">
+						<xsl:comment>
+							start TOC
+						</xsl:comment>
+						<xsl:element name="{$tocContainerElement}">
+							<xsl:attribute name="class">
 		                      <xsl:text>tocContainer</xsl:text>
 	                    </xsl:attribute>
-	                    <xsl:comment>TOC components</xsl:comment>
-	                    <xsl:call-template name="tocSection">
-		                      <xsl:with-param name="id" select="$thisOne"/>
-		                      <xsl:with-param name="style" select="$style"/>
-	                    </xsl:call-template>
-	                 </xsl:element>
-	              </div>
-	           </xsl:if>
-         </xsl:for-each>
-         <!-- back matter -->
-      <xsl:for-each select="tei:back">
-	           <xsl:if test="tei:div1|tei:div">
-	              <div class="tocBack">
-	                 <xsl:element name="{$tocContainerElement}">
-	                    <xsl:attribute name="class">
+							<xsl:comment>
+								TOC components
+							</xsl:comment>
+							<xsl:call-template name="tocSection">
+								<xsl:with-param name="id" select="$thisOne" />
+								<xsl:with-param name="style" select="$style" />
+							</xsl:call-template>
+						</xsl:element>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+			<!-- back matter -->
+			<xsl:for-each select="tei:back">
+				<xsl:if test="tei:div1|tei:div">
+					<div class="tocBack">
+						<xsl:element name="{$tocContainerElement}">
+							<xsl:attribute name="class">
 		                      <xsl:text>tocContainer</xsl:text>
 	                    </xsl:attribute>
-	                    <xsl:call-template name="tocSection">
-		                      <xsl:with-param name="id" select="$thisOne"/>
-		                      <xsl:with-param name="style" select="$style"/>
-	                    </xsl:call-template>
-	                 </xsl:element>
-	              </div>
-	           </xsl:if>
-         </xsl:for-each>
-      </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Main page in right-hand column<param name="currentID">currentID</param>
-      </desc>
-   </doc>
-  <xsl:template name="mainFrame">
-      <xsl:param name="currentID"/>
-      <xsl:param name="minimal">false</xsl:param>
-      <xsl:choose>
-         <xsl:when test="$currentID='current'">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="$currentID='' and number($splitLevel)=-1">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="self::teiCorpus.2">
-            <xsl:call-template name="corpusBody"/>
-         </xsl:when>
-         <xsl:when test="$currentID=''">
-        <!-- we need to locate the first interesting object in the file, ie
-	     the first grandchild of <text > -->
-        <xsl:for-each select=" descendant-or-self::tei:TEI/tei:text/tei:*[1]/*[1]">
-               <xsl:apply-templates mode="paging" select="."/>
-               <xsl:if test="$autoToc='true'">
-                  <xsl:if test="following-sibling::tei:div/tei:head">
-                     <xsl:call-template name="contentsHeading"/>
-                     <ul class="toc">
-                        <xsl:apply-templates mode="maketoc" select="following-sibling::tei:div">
-                           <xsl:with-param name="forcedepth" select="'0'"/>
-                        </xsl:apply-templates>
-                     </ul>
-                  </xsl:if>
-               </xsl:if>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="count(id($currentID))&gt;0">
-                  <xsl:for-each select="id($currentID)">
-                     <h2>
-                        <xsl:apply-templates mode="xref" select="."/>
-			<xsl:call-template name="sectionHeadHook"/>
-                     </h2>
-		     <xsl:if test="$topNavigationPanel='true'">
-		       <xsl:element name="{if ($outputTarget='html5') then 'nav' else 'div'}">
-			 <xsl:call-template name="xrefpanel">
-			   <xsl:with-param name="homepage" select="concat($masterFile,$standardSuffix)"/>
-			   <xsl:with-param name="mode" select="local-name(.)"/>
-			 </xsl:call-template>
-		       </xsl:element>
-		     </xsl:if>
-                     <xsl:call-template name="doDivBody"/>
-                     <xsl:if test="$bottomNavigationPanel='true'">
-		       <xsl:element name="{if ($outputTarget='html5') then 'nav' else 'div'}">
-			 <xsl:call-template name="xrefpanel">
-			   <xsl:with-param name="homepage" select="concat($masterFile,$standardSuffix)"/>
-			   <xsl:with-param name="mode" select="local-name(.)"/>
-                        </xsl:call-template>
-		       </xsl:element>
-                     </xsl:if>
-                  </xsl:for-each>
-               </xsl:when>
-               <xsl:otherwise>
-            <!-- the passed ID is a pseudo-XPath expression
-		 which starts below TEI/tei:text.
-		 The real XPath syntax is changed to avoid problems
-	    -->
-            <xsl:choose>
-                     <xsl:when test="ancestor-or-self::tei:TEI/tei:group/tei:text">
-                        <xsl:apply-templates mode="xpath" select="ancestor-or-self::tei:TEI/tei:group/tei:text">
-                           <xsl:with-param name="xpath" select="$currentID"/>
-                        </xsl:apply-templates>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:apply-templates mode="xpath" select="ancestor-or-self::tei:TEI/tei:text">
-                           <xsl:with-param name="xpath" select="$currentID"/>
-                        </xsl:apply-templates>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
+							<xsl:call-template name="tocSection">
+								<xsl:with-param name="id" select="$thisOne" />
+								<xsl:with-param name="style" select="$style" />
+							</xsl:call-template>
+						</xsl:element>
+					</div>
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Main page in right-hand column
+			<param name="currentID">currentID</param>
+		</desc>
+	</doc>
+	<xsl:template name="mainFrame">
+		<xsl:param name="currentID" />
+		<xsl:param name="minimal">
+			false
+		</xsl:param>
+		<xsl:choose>
+			<xsl:when test="$currentID='current'">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="$currentID='' and number($splitLevel)=-1">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="self::teiCorpus.2">
+				<xsl:call-template name="corpusBody" />
+			</xsl:when>
+			<xsl:when test="$currentID=''">
+				<!-- we need to locate the first interesting object in the file, ie the 
+					first grandchild of <text > -->
+				<xsl:for-each
+					select=" descendant-or-self::tei:TEI/tei:text/tei:*[1]/*[1]">
+					<xsl:apply-templates mode="paging" select="." />
+					<xsl:if test="$autoToc='true'">
+						<xsl:if test="following-sibling::tei:div/tei:head">
+							<xsl:call-template name="contentsHeading" />
+							<ul class="toc">
+								<xsl:apply-templates mode="maketoc"
+									select="following-sibling::tei:div">
+									<xsl:with-param name="forcedepth" select="'0'" />
+								</xsl:apply-templates>
+							</ul>
+						</xsl:if>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="count(id($currentID))&gt;0">
+						<xsl:for-each select="id($currentID)">
+							<h2>
+								<xsl:apply-templates mode="xref" select="." />
+								<xsl:call-template name="sectionHeadHook" />
+							</h2>
+							<xsl:if test="$topNavigationPanel='true'">
+								<xsl:element
+									name="{if ($outputTarget='html5') then 'nav' else 'div'}">
+									<xsl:call-template name="xrefpanel">
+										<xsl:with-param name="homepage"
+											select="concat($masterFile,$standardSuffix)" />
+										<xsl:with-param name="mode"
+											select="local-name(.)" />
+									</xsl:call-template>
+								</xsl:element>
+							</xsl:if>
+							<xsl:call-template name="doDivBody" />
+							<xsl:if test="$bottomNavigationPanel='true'">
+								<xsl:element
+									name="{if ($outputTarget='html5') then 'nav' else 'div'}">
+									<xsl:call-template name="xrefpanel">
+										<xsl:with-param name="homepage"
+											select="concat($masterFile,$standardSuffix)" />
+										<xsl:with-param name="mode"
+											select="local-name(.)" />
+									</xsl:call-template>
+								</xsl:element>
+							</xsl:if>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- the passed ID is a pseudo-XPath expression which starts below 
+							TEI/tei:text. The real XPath syntax is changed to avoid problems -->
+						<xsl:choose>
+							<xsl:when
+								test="ancestor-or-self::tei:TEI/tei:group/tei:text">
+								<xsl:apply-templates mode="xpath"
+									select="ancestor-or-self::tei:TEI/tei:group/tei:text">
+									<xsl:with-param name="xpath" select="$currentID" />
+								</xsl:apply-templates>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates mode="xpath"
+									select="ancestor-or-self::tei:TEI/tei:text">
+									<xsl:with-param name="xpath" select="$currentID" />
+								</xsl:apply-templates>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
 
-      <xsl:if test="$minimal='false'">
-	<xsl:call-template name="partialFootNotes">
-	  <xsl:with-param name="currentID" select="$currentID"/>
-	</xsl:call-template>
-	<xsl:call-template name="stdfooter"/>
-      </xsl:if>
-  </xsl:template>
+		<xsl:if test="$minimal='false'">
+			<xsl:call-template name="partialFootNotes">
+				<xsl:with-param name="currentID" select="$currentID" />
+			</xsl:call-template>
+			<xsl:call-template name="stdfooter" />
+		</xsl:if>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Table of contents       </desc>
-   </doc>
-  <xsl:template name="mainTOC">
-      <xsl:choose>
-	<xsl:when test="self::tei:teiCorpus">
-	  <ul class="toc toc_corpus">
-	    <xsl:for-each select="tei:TEI">
-	      <li>
-		<a>
-                  <xsl:attribute name="href">
-		    <xsl:apply-templates mode="generateLink" select="."/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] Table of contents       </desc>
+	</doc>
+	<xsl:template name="mainTOC">
+		<xsl:choose>
+			<xsl:when test="self::tei:teiCorpus">
+				<ul class="toc toc_corpus">
+					<xsl:for-each select="tei:TEI">
+						<li>
+							<a>
+								<xsl:attribute name="href">
+		    <xsl:apply-templates mode="generateLink"
+									select="." />
                   </xsl:attribute>
-                  <xsl:call-template name="header">
-		    <xsl:with-param name="minimal">false</xsl:with-param>
-		    <xsl:with-param name="display">plain</xsl:with-param>
-                  </xsl:call-template>
-		</a>
-	      </li>
-	    </xsl:for-each>
-	  </ul>
-	</xsl:when>
-	<xsl:when
-	    test="ancestor-or-self::tei:TEI/tei:text/tei:group and
+								<xsl:call-template name="header">
+									<xsl:with-param name="minimal">
+										false
+									</xsl:with-param>
+									<xsl:with-param name="display">
+										plain
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+					</xsl:for-each>
+				</ul>
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:text/tei:group and
 		  $splitLevel=0">
-	  <xsl:for-each
-	      select="ancestor-or-self::tei:TEI/tei:text/tei:front">
-	       <xsl:call-template name="partTOC">
-		 <xsl:with-param name="part">front</xsl:with-param>
-	       </xsl:call-template>
-	  </xsl:for-each>
-	  
-	  <xsl:for-each
-	      select="ancestor-or-self::tei:TEI/tei:text/tei:group">
-	    <xsl:call-template name="groupTOC"/>
-	  </xsl:for-each>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:text/tei:front">
+					<xsl:call-template name="partTOC">
+						<xsl:with-param name="part">
+							front
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
 
-	  <xsl:for-each
-	      select="ancestor-or-self::tei:TEI/tei:text/tei:back">
-	    <xsl:call-template name="partTOC">
-	      <xsl:with-param name="part">back</xsl:with-param>
-	    </xsl:call-template>
-	  </xsl:for-each>
-	</xsl:when>
-	
-	<xsl:when
-	    test="ancestor-or-self::tei:TEI/tei:text/tei:group">	  
-	  <xsl:for-each
-	      select="ancestor-or-self::tei:TEI/tei:text/tei:group/tei:text">
-	    <h3>
-	      <xsl:number/>
-	      <xsl:choose>
-		<xsl:when test="tei:body/tei:head">
-		  <xsl:text>. </xsl:text>
-		  <xsl:apply-templates select="tei:body/tei:head" mode="plain"/>
-		</xsl:when>
-		<xsl:when
-		    test="tei:front/tei:titlePage//tei:title">
-		  <xsl:apply-templates select="tei:front/tei:titlePage//tei:title[1]" mode="plain"/>
-		</xsl:when>
-	      </xsl:choose>
-	    </h3>
-	    <xsl:for-each select="tei:front">
-	      <xsl:call-template name="partTOC">
-		<xsl:with-param name="part">front</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:for-each>
-	    
-	    <xsl:for-each select="tei:body">
-	      <xsl:call-template name="partTOC">
-		<xsl:with-param name="part">body</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:for-each>
-	    
-	    <xsl:for-each select="tei:back">
-	      <xsl:call-template name="partTOC">
-		<xsl:with-param name="part">back</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:for-each>
-	    
-	  </xsl:for-each>
-	  
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:if test="$tocFront">
-	    <xsl:for-each select="ancestor-or-self::tei:TEI/tei:text/tei:front">
-	      <xsl:call-template name="partTOC">
-		<xsl:with-param name="part">front</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:for-each>
-	  </xsl:if>
-	  
-	  <xsl:for-each select="ancestor-or-self::tei:TEI/tei:text/tei:body">
-	    <xsl:call-template name="partTOC">
-	      <xsl:with-param name="part">body</xsl:with-param>
-	    </xsl:call-template>
-	  </xsl:for-each>
-	  
-	  <xsl:if test="$tocBack">
-	    <xsl:for-each select="ancestor-or-self::tei:TEI/tei:text/tei:back">
-	      <xsl:call-template name="partTOC">
-		<xsl:with-param name="part">back</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:for-each>
-	  </xsl:if>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:text/tei:group">
+					<xsl:call-template name="groupTOC" />
+				</xsl:for-each>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[html] </p>
-	 <p xmlns="http://www.w3.org/1999/xhtml"> make table of
-	 contents for nested texts/groups</p>
-      </desc>
-   </doc>
-    <xsl:template name="groupTOC">
-      <xsl:variable name="gDepth"
-		    select="count(ancestor::tei:group)"/>
-      <ul class="toc toc_group{$gDepth}">	    	   
-	<li>
-	  <xsl:if test="not($autoHead='true') and not(tei:head or tei:body/tei:head or @n)">
-	    <xsl:attribute
-		name="class">headless</xsl:attribute>
-	  </xsl:if>
-	  <ul>
-	    <xsl:for-each select="tei:text">
-	      <li>
-		
-		<xsl:call-template name="header">
-		  <xsl:with-param name="toc">
-		    <xsl:apply-templates mode="generateLink" select="."/>
-		  </xsl:with-param>
-		  <xsl:with-param name="minimal">false</xsl:with-param>
-		  <xsl:with-param name="display">plain</xsl:with-param>
-		</xsl:call-template>
-		
-		<xsl:for-each select="tei:front">
-		  <xsl:if
-		      test="tei:titlePage/tei:docTitle/tei:titlePart">
-		    <span>
-		      <xsl:apply-templates
-			  select="tei:titlePage/tei:docTitle/tei:titlePart"
-			  mode="plain"/>
-		    </span>
-		  </xsl:if>
-		  <xsl:call-template name="partTOC">
-		    <xsl:with-param name="part">front</xsl:with-param>
-		  </xsl:call-template>
-		</xsl:for-each>
-		
-		<xsl:for-each select="tei:group">
-		  <xsl:call-template name="groupTOC"/>
-		</xsl:for-each>
-		
-		<xsl:for-each select="tei:body">
-		  <xsl:call-template name="partTOC">
-		    <xsl:with-param name="part">body</xsl:with-param>
-		  </xsl:call-template>
-		</xsl:for-each>
-		
-		<xsl:for-each select="tei:back">
-		  <xsl:call-template name="partTOC">
-		    <xsl:with-param name="part">back</xsl:with-param>
-		  </xsl:call-template>
-		</xsl:for-each>
-	      </li>
-	    </xsl:for-each>
-	    <xsl:for-each select="tei:group">
-	      <li>
-		<xsl:call-template name="groupTOC"/>
-	      </li>
-	    </xsl:for-each>
-	</ul>
-      </li>
-      </ul>
-    </xsl:template>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:text/tei:back">
+					<xsl:call-template name="partTOC">
+						<xsl:with-param name="part">
+							back
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:when>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[html] </p>
-	 <p xmlns="http://www.w3.org/1999/xhtml"> make partial
-	    table of contents         </p>
-      </desc>
-   </doc>
-  <xsl:template name="partTOC">
-      <xsl:param name="part"/>
-      <xsl:param name="force"/>
-      <xsl:if test="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
-         <ul class="toc{$force} toc_{$part}">
-	   <xsl:apply-templates mode="maketoc"
-				select="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
-	              <xsl:with-param name="forcedepth" select="$force"/>
-	   </xsl:apply-templates>
-         </ul>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[html] </p>
-         <p>
-            <p xmlns="http://www.w3.org/1999/xhtml"> xref to previous and last sections </p>
-         </p>
-      </desc>
-   </doc>
-  <xsl:template name="nextLink">
-      <xsl:variable name="myName">
-         <xsl:value-of select="local-name(.)"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="following-sibling::tei:TEI">
-            <xsl:apply-templates mode="generateNextLink" select="following-sibling::tei:TEI[1]"/>
-         </xsl:when>
-         <xsl:when test="following-sibling::tei:div[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink" select="following-sibling::tei:div[1]"/>
-         </xsl:when>
-         <xsl:when test="parent::tei:body/following-sibling::tei:back/tei:div[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink"
-                                 select="parent::tei:body/following-sibling::tei:back/tei:div[1]"/>
-         </xsl:when>
-         <xsl:when test="parent::tei:front/following-sibling::tei:body/tei:div[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink"
-                                 select="parent::tei:front/following-sibling::tei:body/tei:div[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div1' and following-sibling::tei:div1[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink" select="following-sibling::tei:div1[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div2' and following-sibling::tei:div2[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink" select="following-sibling::tei:div2[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div3' and following-sibling::tei:div3[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink" select="following-sibling::tei:div3[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div4' and following-sibling::tei:div4[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink" select="following-sibling::tei:div4[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div5' and following-sibling::tei:div5[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink" select="following-sibling::tei:div5[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div6' and following-sibling::tei:div6[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generateNextLink" select="following-sibling::tei:div6[1]"/>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Generate name for a chunk of output<param name="ident">ident</param>
-      </desc>
-   </doc>
-  <xsl:template name="outputChunkName">
-      <xsl:param name="ident"/>
-      <xsl:choose>
-        <xsl:when test="not($outputDir ='')">
-            <xsl:value-of select="$outputDir"/>
-            <xsl:if test="not(substring($outputDir,string-length($outputDir),string-length($outputDir))='/')">
-               <xsl:text>/</xsl:text>
-            </xsl:if>
-        </xsl:when>
-      </xsl:choose>
-      <xsl:value-of select="$ident"/>
-      <xsl:value-of select="$outputSuffix"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Make a new page using CSS layout <param name="currentID">current ID</param>
-      </desc>
-   </doc>
-  <xsl:template name="pageLayoutCSS">
-      <xsl:param name="currentID"/>
-      <html>
-         <xsl:call-template name="addLangAtt"/>
-         <xsl:comment>THIS FILE IS GENERATED FROM AN XML MASTER. DO NOT EDIT (4)</xsl:comment>
-         <xsl:text>&#10;</xsl:text>
-         <head>
-	   <xsl:variable name="pagetitle">
-	     <xsl:choose>
-	       <xsl:when test="$currentID=''">
-		 <xsl:call-template name="generateTitle"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:choose>
-		   <xsl:when test="$currentID='current'">
-		     <xsl:apply-templates mode="xref" select="."/>
-		   </xsl:when>
-		   <xsl:when test="count(id($currentID))&gt;0">
-		     <xsl:for-each select="id($currentID)">
-		       <xsl:apply-templates mode="xref" select="."/>
-		     </xsl:for-each>
-		   </xsl:when>
-		   <xsl:otherwise>
-		     <xsl:apply-templates mode="xpath" select="descendant::text">
-		       <xsl:with-param name="xpath" select="$currentID"/>
-		       <xsl:with-param name="action" select="'header'"/>
-		     </xsl:apply-templates>
-		   </xsl:otherwise>
-		 </xsl:choose>
-		 <xsl:text> - </xsl:text>
-		 <xsl:call-template name="generateTitle"/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:variable>
-	   <title>
-	     <xsl:value-of select="$htmlTitlePrefix"/>
-	     <xsl:text> </xsl:text>
-	     <xsl:value-of select="$pagetitle"/>
-	   </title>
-	   <link href="/favicon.ico" rel="icon" type="image/x-icon"/>
-	   <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"/>
-	   <xsl:call-template name="headHook"/>
-	   <xsl:call-template name="metaHTML">
-	     <xsl:with-param name="title" select="$pagetitle"/>
-	   </xsl:call-template>
-	   <xsl:call-template name="includeCSS"/>
-	   <xsl:call-template name="cssHook"/>
-	   <xsl:call-template name="includeJavascript"/>
-	   <xsl:call-template name="javascriptHook"/>
-         </head>
-         <body>
-	   <xsl:copy-of select="tei:text/tei:body/@unload"/>
-	   <xsl:copy-of select="tei:text/tei:body/@onunload"/>
-	   <xsl:call-template name="bodyMicroData"/>
-	   <xsl:call-template name="bodyJavascriptHook"/>
-	   <xsl:call-template name="bodyHook"/>
-	   <xsl:call-template name="mainPage">
-	     <xsl:with-param name="currentID">
-	       <xsl:value-of select="$currentID"/>
-	     </xsl:with-param>
-	   </xsl:call-template>
-	   <xsl:call-template name="bodyEndHook"/>
-         </body>
-      </html>
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] the main page structure</desc>
-   </doc>
-  <xsl:template name="mainPage">
-      <xsl:param name="currentID"/>
-      <!-- header -->
-    <div id="hdr">
-         <xsl:call-template name="hdr"/>
-      </div>
-      <div id="accessibility">
-         <span class="tocontent">
-            <a href="{$REQUEST}?style=text">Text only</a>
-      | <a class="skiplinks" href="#rh-col" title="Go to main page content">Skip links</a>
-         </span>
-      </div>
-      <div id="hdr2">
-         <xsl:call-template name="hdr2"/>
-      </div>
-      <xsl:if test="not($contentStructure='all' or @rend='all')">
-         <div id="hdr3">
-	           <xsl:call-template name="hdr3"/>
-         </div>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="$contentStructure='all' or @rend='all'">
-	           <div class="column-wrapper">
-	              <xsl:call-template name="col1"/>
-	              <xsl:call-template name="col2"/>
-	              <xsl:call-template name="col3"/>
-	           </div>
-         </xsl:when>
-         <xsl:when test="@rend='frontpage'">
-	           <div class="column-wrapper">
-	              <div id="rh-col">
-	                 <xsl:for-each select="descendant-or-self::tei:TEI/tei:text/tei:body">
-	                    <xsl:apply-templates/>
-	                 </xsl:for-each>
-	              </div>
-	              <div id="lh-col">
-	                 <xsl:for-each select="descendant-or-self::tei:TEI/tei:text/tei:front">
-	                    <xsl:apply-templates/>
-	                 </xsl:for-each>
-	              </div>
-	           </div>
-         </xsl:when>
-         <xsl:when test="$contentStructure='body'">
-	           <xsl:call-template name="bodyLayout">
-	              <xsl:with-param name="currentID" select="$currentID"/>
-	           </xsl:call-template>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:text/tei:group">
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:text/tei:group/tei:text">
+					<h3>
+						<xsl:number />
+						<xsl:choose>
+							<xsl:when test="tei:body/tei:head">
+								<xsl:text>. </xsl:text>
+								<xsl:apply-templates
+									select="tei:body/tei:head" mode="plain" />
+							</xsl:when>
+							<xsl:when test="tei:front/tei:titlePage//tei:title">
+								<xsl:apply-templates
+									select="tei:front/tei:titlePage//tei:title[1]" mode="plain" />
+							</xsl:when>
+						</xsl:choose>
+					</h3>
+					<xsl:for-each select="tei:front">
+						<xsl:call-template name="partTOC">
+							<xsl:with-param name="part">
+								front
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] what to do in column 1 of 3 column arrangement </desc>
-   </doc>
-  <xsl:template name="col1">
-      <div id="col1">
-         <xsl:for-each select="descendant-or-self::tei:TEI/tei:text/tei:front">
-            <xsl:apply-templates/>
-         </xsl:for-each>
-      </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] what to do in column 2 of 3 column arrangement </desc>
-   </doc>
-  <xsl:template name="col2">
-      <div id="col2">
-         <xsl:for-each select="descendant-or-self::tei:TEI/tei:text/tei:body">
-            <xsl:apply-templates/>
-         </xsl:for-each>
-      </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] what to do in column 3 of 3 column arrangement </desc>
-   </doc>
-  <xsl:template name="col3">
-      <div id="col3">
-         <xsl:for-each select="descendant-or-self::tei:TEI/tei:text/tei:back">
-            <xsl:apply-templates/>
-         </xsl:for-each>
-      </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] arrangment of page as HTML divs <param name="currentID">currentID</param>
-      </desc>
-   </doc>
-  <xsl:template name="bodyLayout">
-      <xsl:param name="currentID"/>
-      <div class="column-wrapper">
-         <div id="lh-col">
-            <div id="lh-col-top">
-               <xsl:comment>top of left-hand column</xsl:comment>
-               <xsl:call-template name="lh-col-top"/>
-            </div>
-            <div id="lh-col-bottom">
-               <xsl:comment>bottom of left-hand column</xsl:comment>
-               <xsl:call-template name="lh-col-bottom">
-                  <xsl:with-param name="currentID" select="$currentID"/>
-               </xsl:call-template>
-            </div>
-         </div>
-         <div id="rh-col">
-	   <div id="rh-col-top">
-	     <xsl:comment>top of right-hand column</xsl:comment>
-	     <xsl:call-template name="rh-col-top"/>
-            </div>
-            <div id="rh-col-bottom">
-               <xsl:comment>bottom of right-hand column</xsl:comment>
-               <xsl:call-template name="rh-col-bottom">
-                  <xsl:with-param name="currentID" select="$currentID"/>
-               </xsl:call-template>
-            </div>
-         </div>
-      </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Generate a page using simple layout </desc>
-   </doc>
-  <xsl:template name="pageLayoutSimple">
-      <html>
-         <xsl:call-template name="addLangAtt"/>
-         <xsl:call-template name="htmlFileTop"/>
-         <body class="simple" id="TOP">
-	   <xsl:copy-of select="tei:text/tei:body/@unload"/>
-	   <xsl:copy-of select="tei:text/tei:body/@onunload"/>
-	   <xsl:call-template name="bodyMicroData"/>
-	   <xsl:call-template name="bodyJavascriptHook"/>
-	   <xsl:call-template name="bodyHook"/>
-	   <xsl:if test="not(tei:text/tei:front/tei:titlePage)">
-	     <div class="stdheader">
-	       <xsl:call-template name="stdheader">
-		 <xsl:with-param name="title">
-		   <xsl:call-template name="generateTitle"/>
-		 </xsl:with-param>
-	       </xsl:call-template>
-	     </div>
-	   </xsl:if>
-	    <xsl:comment> front matter </xsl:comment>
-	    <xsl:apply-templates select="tei:text/tei:front"/>
-	    <xsl:if test="$autoToc='true' and (descendant::tei:div or descendant::tei:div1) and not(descendant::tei:divGen[@type='toc'])">
-	      <h2>
-		<xsl:call-template name="i18n">
-		  <xsl:with-param name="word">tocWords</xsl:with-param>
-		</xsl:call-template>
-	      </h2>
-	      <xsl:call-template name="mainTOC"/>
-	    </xsl:if>
-	    <xsl:choose>
-	      <xsl:when test="tei:text/tei:group">
-		<xsl:apply-templates select="tei:text/tei:group"/>
-	      </xsl:when>
-	      <xsl:when test="@rend='multicol'">
+					<xsl:for-each select="tei:body">
+						<xsl:call-template name="partTOC">
+							<xsl:with-param name="part">
+								body
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+
+					<xsl:for-each select="tei:back">
+						<xsl:call-template name="partTOC">
+							<xsl:with-param name="part">
+								back
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+
+				</xsl:for-each>
+
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$tocFront">
+					<xsl:for-each
+						select="ancestor-or-self::tei:TEI/tei:text/tei:front">
+						<xsl:call-template name="partTOC">
+							<xsl:with-param name="part">
+								front
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:if>
+
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:text/tei:body">
+					<xsl:call-template name="partTOC">
+						<xsl:with-param name="part">
+							body
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+
+				<xsl:if test="$tocBack">
+					<xsl:for-each
+						select="ancestor-or-self::tei:TEI/tei:text/tei:back">
+						<xsl:call-template name="partTOC">
+							<xsl:with-param name="part">
+								back
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[html] </p>
+			<p xmlns="http://www.w3.org/1999/xhtml"> make table of
+				contents for nested texts/groups</p>
+		</desc>
+	</doc>
+	<xsl:template name="groupTOC">
+		<xsl:variable name="gDepth"
+			select="count(ancestor::tei:group)" />
+		<ul class="toc toc_group{$gDepth}">
+			<li>
+				<xsl:if
+					test="not($autoHead='true') and not(tei:head or tei:body/tei:head or @n)">
+					<xsl:attribute name="class">headless</xsl:attribute>
+				</xsl:if>
+				<ul>
+					<xsl:for-each select="tei:text">
+						<li>
+
+							<xsl:call-template name="header">
+								<xsl:with-param name="toc">
+									<xsl:apply-templates mode="generateLink"
+										select="." />
+								</xsl:with-param>
+								<xsl:with-param name="minimal">
+									false
+								</xsl:with-param>
+								<xsl:with-param name="display">
+									plain
+								</xsl:with-param>
+							</xsl:call-template>
+
+							<xsl:for-each select="tei:front">
+								<xsl:if test="tei:titlePage/tei:docTitle/tei:titlePart">
+									<span>
+										<xsl:apply-templates
+											select="tei:titlePage/tei:docTitle/tei:titlePart"
+											mode="plain" />
+									</span>
+								</xsl:if>
+								<xsl:call-template name="partTOC">
+									<xsl:with-param name="part">
+										front
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+
+							<xsl:for-each select="tei:group">
+								<xsl:call-template name="groupTOC" />
+							</xsl:for-each>
+
+							<xsl:for-each select="tei:body">
+								<xsl:call-template name="partTOC">
+									<xsl:with-param name="part">
+										body
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+
+							<xsl:for-each select="tei:back">
+								<xsl:call-template name="partTOC">
+									<xsl:with-param name="part">
+										back
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+						</li>
+					</xsl:for-each>
+					<xsl:for-each select="tei:group">
+						<li>
+							<xsl:call-template name="groupTOC" />
+						</li>
+					</xsl:for-each>
+				</ul>
+			</li>
+		</ul>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[html] </p>
+			<p xmlns="http://www.w3.org/1999/xhtml"> make partial
+				table of contents
+			</p>
+		</desc>
+	</doc>
+	<xsl:template name="partTOC">
+		<xsl:param name="part" />
+		<xsl:param name="force" />
+		<xsl:if
+			test="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
+			<ul class="toc{$force} toc_{$part}">
+				<xsl:apply-templates mode="maketoc"
+					select="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
+					<xsl:with-param name="forcedepth" select="$force" />
+				</xsl:apply-templates>
+			</ul>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[html] </p>
+			<p>
+				<p xmlns="http://www.w3.org/1999/xhtml"> xref to previous and last sections </p>
+			</p>
+		</desc>
+	</doc>
+	<xsl:template name="nextLink">
+		<xsl:variable name="myName">
+			<xsl:value-of select="local-name(.)" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="following-sibling::tei:TEI">
+				<xsl:apply-templates mode="generateNextLink"
+					select="following-sibling::tei:TEI[1]" />
+			</xsl:when>
+			<xsl:when
+				test="following-sibling::tei:div[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="following-sibling::tei:div[1]" />
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:body/following-sibling::tei:back/tei:div[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="parent::tei:body/following-sibling::tei:back/tei:div[1]" />
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:front/following-sibling::tei:body/tei:div[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="parent::tei:front/following-sibling::tei:body/tei:div[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div1' and following-sibling::tei:div1[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="following-sibling::tei:div1[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div2' and following-sibling::tei:div2[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="following-sibling::tei:div2[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div3' and following-sibling::tei:div3[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="following-sibling::tei:div3[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div4' and following-sibling::tei:div4[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="following-sibling::tei:div4[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div5' and following-sibling::tei:div5[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="following-sibling::tei:div5[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div6' and following-sibling::tei:div6[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generateNextLink"
+					select="following-sibling::tei:div6[1]" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Generate name for a chunk of output
+			<param name="ident">ident</param>
+		</desc>
+	</doc>
+	<xsl:template name="outputChunkName">
+		<xsl:param name="ident" />
+		<xsl:choose>
+			<xsl:when test="not($outputDir ='')">
+				<xsl:value-of select="$outputDir" />
+				<xsl:if
+					test="not(substring($outputDir,string-length($outputDir),string-length($outputDir))='/')">
+					<xsl:text>/</xsl:text>
+				</xsl:if>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:value-of select="$ident" />
+		<xsl:value-of select="$outputSuffix" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Make a new page using CSS layout
+			<param name="currentID">current ID</param>
+		</desc>
+	</doc>
+	<xsl:template name="pageLayoutCSS">
+		<xsl:param name="currentID" />
+		<html>
+			<xsl:call-template name="addLangAtt" />
+			<xsl:comment>
+				THIS FILE IS GENERATED FROM AN XML MASTER. DO NOT EDIT (4)
+			</xsl:comment>
+			<xsl:text>&#10;</xsl:text>
+			<head>
+				<xsl:variable name="pagetitle">
+					<xsl:choose>
+						<xsl:when test="$currentID=''">
+							<xsl:call-template name="generateTitle" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:choose>
+								<xsl:when test="$currentID='current'">
+									<xsl:apply-templates mode="xref" select="." />
+								</xsl:when>
+								<xsl:when test="count(id($currentID))&gt;0">
+									<xsl:for-each select="id($currentID)">
+										<xsl:apply-templates mode="xref"
+											select="." />
+									</xsl:for-each>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:apply-templates mode="xpath"
+										select="descendant::text">
+										<xsl:with-param name="xpath"
+											select="$currentID" />
+										<xsl:with-param name="action" select="'header'" />
+									</xsl:apply-templates>
+								</xsl:otherwise>
+							</xsl:choose>
+							<xsl:text> - </xsl:text>
+							<xsl:call-template name="generateTitle" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<title>
+					<xsl:value-of select="$htmlTitlePrefix" />
+					<xsl:text> </xsl:text>
+					<xsl:value-of select="$pagetitle" />
+				</title>
+				<link href="/favicon.ico" rel="icon" type="image/x-icon" />
+				<link href="/favicon.ico" rel="shortcut icon"
+					type="image/x-icon" />
+				<xsl:call-template name="headHook" />
+				<xsl:call-template name="metaHTML">
+					<xsl:with-param name="title" select="$pagetitle" />
+				</xsl:call-template>
+				<xsl:call-template name="includeCSS" />
+				<xsl:call-template name="cssHook" />
+				<xsl:call-template name="includeJavascript" />
+				<xsl:call-template name="javascriptHook" />
+			</head>
+			<body>
+				<xsl:copy-of select="tei:text/tei:body/@unload" />
+				<xsl:copy-of select="tei:text/tei:body/@onunload" />
+				<xsl:call-template name="bodyMicroData" />
+				<xsl:call-template name="bodyJavascriptHook" />
+				<xsl:call-template name="bodyHook" />
+				<xsl:call-template name="mainPage">
+					<xsl:with-param name="currentID">
+						<xsl:value-of select="$currentID" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="bodyEndHook" />
+			</body>
+		</html>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] the main page structure</desc>
+	</doc>
+	<xsl:template name="mainPage">
+		<xsl:param name="currentID" />
+		<!-- header -->
+		<div id="hdr">
+			<xsl:call-template name="hdr" />
+		</div>
+		<div id="accessibility">
+			<span class="tocontent">
+				<a href="{$REQUEST}?style=text">Text only</a>
+				|
+				<a class="skiplinks" href="#rh-col"
+					title="Go to main page content">Skip links</a>
+			</span>
+		</div>
+		<div id="hdr2">
+			<xsl:call-template name="hdr2" />
+		</div>
+		<xsl:if test="not($contentStructure='all' or @rend='all')">
+			<div id="hdr3">
+				<xsl:call-template name="hdr3" />
+			</div>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="$contentStructure='all' or @rend='all'">
+				<div class="column-wrapper">
+					<xsl:call-template name="col1" />
+					<xsl:call-template name="col2" />
+					<xsl:call-template name="col3" />
+				</div>
+			</xsl:when>
+			<xsl:when test="@rend='frontpage'">
+				<div class="column-wrapper">
+					<div id="rh-col">
+						<xsl:for-each
+							select="descendant-or-self::tei:TEI/tei:text/tei:body">
+							<xsl:apply-templates />
+						</xsl:for-each>
+					</div>
+					<div id="lh-col">
+						<xsl:for-each
+							select="descendant-or-self::tei:TEI/tei:text/tei:front">
+							<xsl:apply-templates />
+						</xsl:for-each>
+					</div>
+				</div>
+			</xsl:when>
+			<xsl:when test="$contentStructure='body'">
+				<xsl:call-template name="bodyLayout">
+					<xsl:with-param name="currentID" select="$currentID" />
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] what to do in column 1 of 3 column arrangement </desc>
+	</doc>
+	<xsl:template name="col1">
+		<div id="col1">
+			<xsl:for-each
+				select="descendant-or-self::tei:TEI/tei:text/tei:front">
+				<xsl:apply-templates />
+			</xsl:for-each>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] what to do in column 2 of 3 column arrangement </desc>
+	</doc>
+	<xsl:template name="col2">
+		<div id="col2">
+			<xsl:for-each
+				select="descendant-or-self::tei:TEI/tei:text/tei:body">
+				<xsl:apply-templates />
+			</xsl:for-each>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] what to do in column 3 of 3 column arrangement </desc>
+	</doc>
+	<xsl:template name="col3">
+		<div id="col3">
+			<xsl:for-each
+				select="descendant-or-self::tei:TEI/tei:text/tei:back">
+				<xsl:apply-templates />
+			</xsl:for-each>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] arrangment of page as HTML divs
+			<param name="currentID">currentID</param>
+		</desc>
+	</doc>
+	<xsl:template name="bodyLayout">
+		<xsl:param name="currentID" />
+		<div class="column-wrapper">
+			<div id="lh-col">
+				<div id="lh-col-top">
+					<xsl:comment>
+						top of left-hand column
+					</xsl:comment>
+					<xsl:call-template name="lh-col-top" />
+				</div>
+				<div id="lh-col-bottom">
+					<xsl:comment>
+						bottom of left-hand column
+					</xsl:comment>
+					<xsl:call-template name="lh-col-bottom">
+						<xsl:with-param name="currentID"
+							select="$currentID" />
+					</xsl:call-template>
+				</div>
+			</div>
+			<div id="rh-col">
+				<div id="rh-col-top">
+					<xsl:comment>
+						top of right-hand column
+					</xsl:comment>
+					<xsl:call-template name="rh-col-top" />
+				</div>
+				<div id="rh-col-bottom">
+					<xsl:comment>
+						bottom of right-hand column
+					</xsl:comment>
+					<xsl:call-template name="rh-col-bottom">
+						<xsl:with-param name="currentID"
+							select="$currentID" />
+					</xsl:call-template>
+				</div>
+			</div>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] Generate a page using simple layout </desc>
+	</doc>
+	<xsl:template name="pageLayoutSimple">
+		<html>
+			<xsl:call-template name="addLangAtt" />
+			<xsl:call-template name="htmlFileTop" />
+			<body class="simple" id="TOP">
+				<xsl:copy-of select="tei:text/tei:body/@unload" />
+				<xsl:copy-of select="tei:text/tei:body/@onunload" />
+				<xsl:call-template name="bodyMicroData" />
+				<xsl:call-template name="bodyJavascriptHook" />
+				<xsl:call-template name="bodyHook" />
+				<xsl:if test="not(tei:text/tei:front/tei:titlePage)">
+					<div class="stdheader">
+						<xsl:call-template name="stdheader">
+							<xsl:with-param name="title">
+								<xsl:call-template name="generateTitle" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</div>
+				</xsl:if>
+				<xsl:comment>
+					front matter
+				</xsl:comment>
+				<xsl:apply-templates select="tei:text/tei:front" />
+				<xsl:if
+					test="$autoToc='true' and (descendant::tei:div or descendant::tei:div1) and not(descendant::tei:divGen[@type='toc'])">
+					<h2>
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								tocWords
+							</xsl:with-param>
+						</xsl:call-template>
+					</h2>
+					<xsl:call-template name="mainTOC" />
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="tei:text/tei:group">
+						<xsl:apply-templates
+							select="tei:text/tei:group" />
+					</xsl:when>
+					<xsl:when test="@rend='multicol'">
+						<table>
+							<tr>
+								<xsl:apply-templates
+									select="tei:text/tei:body" />
+							</tr>
+						</table>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:comment>
+							body matter
+						</xsl:comment>
+						<xsl:call-template name="startHook" />
+						<xsl:variable name="ident">
+							<xsl:apply-templates mode="ident" select="." />
+						</xsl:variable>
+						<xsl:apply-templates
+							select="tei:text/tei:body" />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:comment>
+					back matter
+				</xsl:comment>
+				<xsl:apply-templates select="tei:text/tei:back" />
+				<xsl:call-template name="printNotes" />
+				<xsl:call-template name="htmlFileBottom" />
+				<xsl:call-template name="bodyEndHook" />
+			</body>
+		</html>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Generate a page using table layout
+			<param name="currentID">currentID</param>
+		</desc>
+	</doc>
+	<xsl:template name="pageLayoutTable">
+		<xsl:param name="currentID" />
+		<html>
+			<xsl:call-template name="addLangAtt" />
+			<xsl:comment>
+				THIS FILE IS GENERATED FROM AN XML MASTER. DO NOT EDIT (1)
+			</xsl:comment>
+			<xsl:text>&#10;</xsl:text>
+			<head>
+				<xsl:variable name="pagetitle">
+					<xsl:choose>
+						<xsl:when test="$currentID=''">
+							<xsl:call-template name="generateTitle" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template name="generateTitle" />
+							:
+							<xsl:choose>
+								<xsl:when test="count(id($currentID))&gt;0">
+									<xsl:for-each select="id($currentID)">
+										<xsl:apply-templates mode="xref"
+											select="." />
+									</xsl:for-each>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:apply-templates mode="xpath"
+										select="descendant-or-self::tei:TEI/tei:text">
+										<xsl:with-param name="xpath"
+											select="$currentID" />
+										<xsl:with-param name="action" select="'header'" />
+									</xsl:apply-templates>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<title>
+					<xsl:value-of select="$htmlTitlePrefix" />
+					<xsl:value-of select="$pagetitle" />
+				</title>
+				<link href="/favicon.ico" rel="icon" type="image/x-icon" />
+				<link href="/favicon.ico" rel="shortcut icon"
+					type="image/x-icon" />
+				<xsl:call-template name="headHook" />
+				<xsl:call-template name="metaHTML">
+					<xsl:with-param name="title" select="$pagetitle" />
+				</xsl:call-template>
+				<xsl:call-template name="includeCSS" />
+				<xsl:call-template name="cssHook" />
+				<xsl:call-template name="includeJavascript" />
+				<xsl:call-template name="javascriptHook" />
+			</head>
+			<body class="pagetable">
+				<xsl:call-template name="bodyMicroData" />
+				<xsl:call-template name="bodyJavascriptHook" />
+				<xsl:call-template name="bodyHook" />
+				<xsl:call-template name="pageHeader">
+					<xsl:with-param name="mode">
+						table
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="pageLayoutTableBody">
+					<xsl:with-param name="currentID" select="$currentID" />
+				</xsl:call-template>
+				<xsl:call-template name="bodyEndHook" />
+			</body>
+		</html>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] The page body, when using table layout
+			<param name="currentID">currentID</param>
+		</desc>
+	</doc>
+	<xsl:template name="pageLayoutTableBody">
+		<xsl:param name="currentID" />
 		<table>
-		  <tr>
-		    <xsl:apply-templates select="tei:text/tei:body"/>
-		  </tr>
+			<tr>
+				<td class="hdr" colspan="2">
+					<xsl:call-template name="hdr" />
+				</td>
+			</tr>
+			<tr>
+				<td class="hdr2" colspan="2">
+					<xsl:call-template name="hdr2" />
+				</td>
+			</tr>
+			<tr>
+				<td class="hdr3" colspan="2">
+					<xsl:call-template name="hdr3" />
+				</td>
+			</tr>
+			<tr>
+				<td align="left" class="sidetext" rowspan="2"
+					style="vertical-align:top;" width="{$linksWidth}">
+					<xsl:call-template name="searchbox" />
+					<xsl:call-template name="leftHandFrame">
+						<xsl:with-param name="currentID"
+							select="$requestedID" />
+					</xsl:call-template>
+				</td>
+			</tr>
+			<tr>
+				<td class="maintext" colspan="2" style="vertical-align:top;">
+					<xsl:call-template name="mainFrame">
+						<xsl:with-param name="currentID"
+							select="$currentID" />
+					</xsl:call-template>
+				</td>
+			</tr>
 		</table>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:comment>body matter </xsl:comment>
-		<xsl:call-template name="startHook"/>
-		<xsl:variable name="ident">
-		  <xsl:apply-templates mode="ident" select="."/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="previousLink">
+		<xsl:variable name="myName">
+			<xsl:value-of select="local-name(.)" />
 		</xsl:variable>
-		<xsl:apply-templates select="tei:text/tei:body"/>
-	      </xsl:otherwise>
-	    </xsl:choose>
-	    <xsl:comment>back matter </xsl:comment>
-	    <xsl:apply-templates select="tei:text/tei:back"/>
-            <xsl:call-template name="printNotes"/>
-            <xsl:call-template name="htmlFileBottom"/>
-            <xsl:call-template name="bodyEndHook"/>
-         </body>
-      </html>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Generate a page using table layout<param name="currentID">currentID</param>
-      </desc>
-   </doc>
-  <xsl:template name="pageLayoutTable">
-      <xsl:param name="currentID"/>
-      <html>
-         <xsl:call-template name="addLangAtt"/>
-         <xsl:comment>THIS FILE IS GENERATED FROM AN XML MASTER. DO NOT EDIT (1)</xsl:comment>
-         <xsl:text>&#10;</xsl:text>
-         <head>
-            <xsl:variable name="pagetitle">
-               <xsl:choose>
-                  <xsl:when test="$currentID=''">
-                     <xsl:call-template name="generateTitle"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:call-template name="generateTitle"/>: <xsl:choose>
-                        <xsl:when test="count(id($currentID))&gt;0">
-                           <xsl:for-each select="id($currentID)">
-                              <xsl:apply-templates mode="xref" select="."/>
-                           </xsl:for-each>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:apply-templates mode="xpath" select="descendant-or-self::tei:TEI/tei:text">
-                              <xsl:with-param name="xpath" select="$currentID"/>
-                              <xsl:with-param name="action" select="'header'"/>
-                           </xsl:apply-templates>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
-            <title>
-               <xsl:value-of select="$htmlTitlePrefix"/>
-               <xsl:value-of select="$pagetitle"/>
-            </title>
-            <link href="/favicon.ico" rel="icon" type="image/x-icon"/>
-            <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"/>
-            <xsl:call-template name="headHook"/>
-            <xsl:call-template name="metaHTML">
-               <xsl:with-param name="title" select="$pagetitle"/>
-            </xsl:call-template>
-            <xsl:call-template name="includeCSS"/>
-            <xsl:call-template name="cssHook"/>
-            <xsl:call-template name="includeJavascript"/>
-            <xsl:call-template name="javascriptHook"/>
-         </head>
-         <body class="pagetable">
-            <xsl:call-template name="bodyMicroData"/>
-            <xsl:call-template name="bodyJavascriptHook"/>
-	    <xsl:call-template name="bodyHook"/>
-            <xsl:call-template name="pageHeader">
-               <xsl:with-param name="mode">table</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="pageLayoutTableBody">
-               <xsl:with-param name="currentID" select="$currentID"/>
-            </xsl:call-template>
-            <xsl:call-template name="bodyEndHook"/>
-         </body>
-      </html>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] The page body, when using table layout<param name="currentID">currentID</param>
-      </desc>
-   </doc>
-  <xsl:template name="pageLayoutTableBody">
-      <xsl:param name="currentID"/>
-      <table>
-         <tr>
-            <td class="hdr" colspan="2">
-               <xsl:call-template name="hdr"/>
-            </td>
-         </tr>
-         <tr>
-            <td class="hdr2" colspan="2">
-               <xsl:call-template name="hdr2"/>
-            </td>
-         </tr>
-         <tr>
-            <td class="hdr3" colspan="2">
-               <xsl:call-template name="hdr3"/>
-            </td>
-         </tr>
-         <tr>
-            <td align="left" class="sidetext" rowspan="2" style="vertical-align:top;" width="{$linksWidth}">
-               <xsl:call-template name="searchbox"/>
-               <xsl:call-template name="leftHandFrame">
-                  <xsl:with-param name="currentID" select="$requestedID"/>
-               </xsl:call-template>
-            </td>
-         </tr>
-         <tr>
-            <td class="maintext" colspan="2" style="vertical-align:top;">
-               <xsl:call-template name="mainFrame">
-                  <xsl:with-param name="currentID" select="$currentID"/>
-               </xsl:call-template>
-            </td>
-         </tr>
-      </table>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="previousLink">
-      <xsl:variable name="myName">
-         <xsl:value-of select="local-name(.)"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="preceding-sibling::tei:TEI">
-            <xsl:apply-templates mode="generatePreviousLink" select="preceding-sibling::tei:TEI[1]"/>
-         </xsl:when>
-         <xsl:when test="preceding-sibling::tei:div[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink" select="preceding-sibling::tei:div[1]"/>
-         </xsl:when>
-         <xsl:when test="parent::tei:body/preceding-sibling::tei:front/tei:div[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink"
-                                 select="parent::tei:body/preceding-sibling::tei:front/tei:div[last()]"/>
-         </xsl:when>
-         <xsl:when test="parent::tei:back/preceding-sibling::tei:body/tei:div[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink"
-                                 select="parent::tei:body/preceding-sibling::tei:body/tei:div[last()]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div1' and preceding-sibling::tei:div1[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink" select="preceding-sibling::tei:div1[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div2' and preceding-sibling::tei:div2[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink" select="preceding-sibling::tei:div2[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div3' and preceding-sibling::tei:div3[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink" select="preceding-sibling::tei:div3[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div4' and preceding-sibling::tei:div4[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink" select="preceding-sibling::tei:div4[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div5' and preceding-sibling::tei:div5[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink" select="preceding-sibling::tei:div5[1]"/>
-         </xsl:when>
-         <xsl:when test="$myName='div6' and preceding-sibling::tei:div6[tei:head or $autoHead='true']">
-            <xsl:apply-templates mode="generatePreviousLink" select="preceding-sibling::tei:div6[1]"/>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="simpleBody">
-    <xsl:choose>
-      <xsl:when test="tei:text/tei:group">
-	<xsl:apply-templates select="tei:text/tei:group"/>
-      </xsl:when>
-       <xsl:when test="$filePerPage='true'">
-	 <xsl:variable name="pass1">	 
-	   <xsl:apply-templates select="tei:text/*"/>
-	 </xsl:variable>
-	 <xsl:choose>
-	   <xsl:when test="not($pass1/html:PAGEBREAK)">
-	     <xsl:for-each-group select="$pass1/*"
-				 group-ending-with="*[(position() mod 40) = 0]">
-	       <xsl:call-template name="pageperfile">
-		 <xsl:with-param name="page">
-		   <xsl:text>page</xsl:text>
-		   <xsl:value-of select="position()"/>
-		 </xsl:with-param>
-	       </xsl:call-template>
-	     </xsl:for-each-group>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:for-each-group select="$pass1/*"
-				 group-starting-with="html:PAGEBREAK">
-	       <xsl:choose>
-		 <xsl:when test="self::html:PAGEBREAK">
-		   <xsl:call-template name="pageperfile">
-		     <xsl:with-param name="page" select="self::html:PAGEBREAK/@name"/>
-		   </xsl:call-template>
-		 </xsl:when>
-		 <xsl:otherwise>
-		   <xsl:copy-of select="current-group()"/>
-		 </xsl:otherwise>
-	       </xsl:choose>
-	     </xsl:for-each-group>
-	   </xsl:otherwise>
-	 </xsl:choose>
-       </xsl:when>
-      <xsl:otherwise>
-    <!-- front matter -->
-    <xsl:apply-templates select="tei:text/tei:front"/>
-      <xsl:if test="$autoToc='true' and (descendant::tei:div or descendant::tei:div1) and not(descendant::tei:divGen[@type='toc'])">
-         <h2>
-            <xsl:call-template name="i18n">
-               <xsl:with-param name="word">tocWords</xsl:with-param>
-            </xsl:call-template>
-         </h2>
-         <xsl:call-template name="mainTOC"/>
-      </xsl:if>
-      <!-- main text -->
-	<xsl:apply-templates select="tei:text/tei:body"/>
-      </xsl:otherwise>
-    </xsl:choose>
-    <!-- back matter -->
-    <xsl:apply-templates select="tei:text/tei:back"/>
-      <xsl:call-template name="printNotes"/>
-  </xsl:template>
+		<xsl:choose>
+			<xsl:when test="preceding-sibling::tei:TEI">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="preceding-sibling::tei:TEI[1]" />
+			</xsl:when>
+			<xsl:when
+				test="preceding-sibling::tei:div[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="preceding-sibling::tei:div[1]" />
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:body/preceding-sibling::tei:front/tei:div[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="parent::tei:body/preceding-sibling::tei:front/tei:div[last()]" />
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:back/preceding-sibling::tei:body/tei:div[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="parent::tei:body/preceding-sibling::tei:body/tei:div[last()]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div1' and preceding-sibling::tei:div1[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="preceding-sibling::tei:div1[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div2' and preceding-sibling::tei:div2[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="preceding-sibling::tei:div2[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div3' and preceding-sibling::tei:div3[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="preceding-sibling::tei:div3[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div4' and preceding-sibling::tei:div4[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="preceding-sibling::tei:div4[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div5' and preceding-sibling::tei:div5[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="preceding-sibling::tei:div5[1]" />
+			</xsl:when>
+			<xsl:when
+				test="$myName='div6' and preceding-sibling::tei:div6[tei:head or $autoHead='true']">
+				<xsl:apply-templates mode="generatePreviousLink"
+					select="preceding-sibling::tei:div6[1]" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="simpleBody">
+		<xsl:choose>
+			<xsl:when test="tei:text/tei:group">
+				<xsl:apply-templates select="tei:text/tei:group" />
+			</xsl:when>
+			<xsl:when test="$filePerPage='true'">
+				<xsl:variable name="pass1">
+					<xsl:apply-templates select="tei:text/*" />
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="not($pass1/html:PAGEBREAK)">
+						<xsl:for-each-group select="$pass1/*"
+							group-ending-with="*[(position() mod 40) = 0]">
+							<xsl:call-template name="pageperfile">
+								<xsl:with-param name="page">
+									<xsl:text>page</xsl:text>
+									<xsl:value-of select="position()" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:for-each-group>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:for-each-group select="$pass1/*"
+							group-starting-with="html:PAGEBREAK">
+							<xsl:choose>
+								<xsl:when test="self::html:PAGEBREAK">
+									<xsl:call-template name="pageperfile">
+										<xsl:with-param name="page"
+											select="self::html:PAGEBREAK/@name" />
+									</xsl:call-template>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:copy-of select="current-group()" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:for-each-group>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- front matter -->
+				<xsl:apply-templates select="tei:text/tei:front" />
+				<xsl:if
+					test="$autoToc='true' and (descendant::tei:div or descendant::tei:div1) and not(descendant::tei:divGen[@type='toc'])">
+					<h2>
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								tocWords
+							</xsl:with-param>
+						</xsl:call-template>
+					</h2>
+					<xsl:call-template name="mainTOC" />
+				</xsl:if>
+				<!-- main text -->
+				<xsl:apply-templates select="tei:text/tei:body" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<!-- back matter -->
+		<xsl:apply-templates select="tei:text/tei:back" />
+		<xsl:call-template name="printNotes" />
+	</xsl:template>
 
-  <xsl:template name="pageperfile">
-    <xsl:param name="page"/>
-    <xsl:variable name="outName">
-      <xsl:call-template name="outputChunkName">
-	<xsl:with-param name="ident">
-	  <xsl:value-of select="$page"/>
-	</xsl:with-param>
-      </xsl:call-template>
-    </xsl:variable>
-    <xsl:if test="$verbose='true'">
-      <xsl:message>Opening file <xsl:value-of select="$outName"/></xsl:message>
-    </xsl:if>
-    
-    <xsl:result-document href="{$outName}">
-      <html>
-	<xsl:call-template name="addLangAtt"/>
-	<head>
-	  <xsl:variable name="pagetitle">
-	    <xsl:call-template name="generateTitle"/>
-	    <xsl:text> page </xsl:text>
-	    <xsl:value-of select="$page"/>
-	  </xsl:variable>
-	  <title>
-	    <xsl:value-of select="$pagetitle"/>
-	  </title>
-	  <xsl:call-template name="headHook"/>
-	  <xsl:call-template name="metaHTML">
-	    <xsl:with-param name="title" select="$pagetitle"/>
-	  </xsl:call-template>
-	  <xsl:call-template name="includeCSS"/>
-	  <xsl:call-template name="cssHook"/>
-	  <xsl:call-template name="includeJavascript"/>
-	  <xsl:call-template name="javascriptHook"/>
-	</head>
-	<body>
-	  <xsl:apply-templates select="current-group()" mode="copy"/>
-	</body>
-      </html>
-    </xsl:result-document>
-    <xsl:if test="@facs">
-      <xsl:variable name="outNameFacs">
-	<xsl:call-template name="outputChunkName">
-	  <xsl:with-param name="ident">
-	    <xsl:value-of select="$page"/>
-	    <xsl:text>-facs</xsl:text>
-	  </xsl:with-param>
-	</xsl:call-template>
-      </xsl:variable>
-      <xsl:result-document href="{$outNameFacs}">
-	<html>
-	  <xsl:call-template name="addLangAtt"/>
-	  <head>
-	    <xsl:variable name="pagetitle">
-	      <xsl:call-template name="generateTitle"/>
-	      <xsl:text> page </xsl:text>
-	      <xsl:value-of select="$page"/>
-	      <xsl:text> (facsimile) </xsl:text>
-	    </xsl:variable>
-	    <title>
-	      <xsl:value-of select="$pagetitle"/>
-	    </title>
-	    <xsl:call-template name="headHook"/>
-	    <xsl:call-template name="metaHTML">
-	      <xsl:with-param name="title" select="$pagetitle"/>
-	    </xsl:call-template>
-	    <xsl:call-template name="includeCSS"/>
-	    <xsl:call-template name="cssHook"/>
-	    <xsl:call-template name="includeJavascript"/>
-	    <xsl:call-template name="javascriptHook"/>
-	  </head>
-	  <body style="margin:0;padding:0">
-	    <p><img src="{@facs}" class="fullpage" alt="page facsimile"/></p>
-	  </body>
-	</html>
-      </xsl:result-document>      
-    </xsl:if>
-  </xsl:template>
+	<xsl:template name="pageperfile">
+		<xsl:param name="page" />
+		<xsl:variable name="outName">
+			<xsl:call-template name="outputChunkName">
+				<xsl:with-param name="ident">
+					<xsl:value-of select="$page" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Opening file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
 
-  <xsl:template match="html:PAGEBREAK" mode="copy"/>
-  <xsl:template match="html:*" mode="copy">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+		<xsl:result-document href="{$outName}">
+			<html>
+				<xsl:call-template name="addLangAtt" />
+				<head>
+					<xsl:variable name="pagetitle">
+						<xsl:call-template name="generateTitle" />
+						<xsl:text> page </xsl:text>
+						<xsl:value-of select="$page" />
+					</xsl:variable>
+					<title>
+						<xsl:value-of select="$pagetitle" />
+					</title>
+					<xsl:call-template name="headHook" />
+					<xsl:call-template name="metaHTML">
+						<xsl:with-param name="title" select="$pagetitle" />
+					</xsl:call-template>
+					<xsl:call-template name="includeCSS" />
+					<xsl:call-template name="cssHook" />
+					<xsl:call-template name="includeJavascript" />
+					<xsl:call-template name="javascriptHook" />
+				</head>
+				<body>
+					<xsl:apply-templates select="current-group()"
+						mode="copy" />
+				</body>
+			</html>
+		</xsl:result-document>
+		<xsl:if test="@facs">
+			<xsl:variable name="outNameFacs">
+				<xsl:call-template name="outputChunkName">
+					<xsl:with-param name="ident">
+						<xsl:value-of select="$page" />
+						<xsl:text>-facs</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:variable>
+			<xsl:result-document href="{$outNameFacs}">
+				<html>
+					<xsl:call-template name="addLangAtt" />
+					<head>
+						<xsl:variable name="pagetitle">
+							<xsl:call-template name="generateTitle" />
+							<xsl:text> page </xsl:text>
+							<xsl:value-of select="$page" />
+							<xsl:text> (facsimile) </xsl:text>
+						</xsl:variable>
+						<title>
+							<xsl:value-of select="$pagetitle" />
+						</title>
+						<xsl:call-template name="headHook" />
+						<xsl:call-template name="metaHTML">
+							<xsl:with-param name="title" select="$pagetitle" />
+						</xsl:call-template>
+						<xsl:call-template name="includeCSS" />
+						<xsl:call-template name="cssHook" />
+						<xsl:call-template name="includeJavascript" />
+						<xsl:call-template name="javascriptHook" />
+					</head>
+					<body style="margin:0;padding:0">
+						<p>
+							<img src="{@facs}" class="fullpage" alt="page facsimile" />
+						</p>
+					</body>
+				</html>
+			</xsl:result-document>
+		</xsl:if>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="stdfooter">
-      <xsl:param name="style" select="'plain'"/>
-      <xsl:param name="file"/>
-      <xsl:variable name="date">
-         <xsl:call-template name="generateDate"/>
-      </xsl:variable>
-      <xsl:variable name="author">
-         <xsl:call-template name="generateAuthor"/>
-      </xsl:variable>
-      <div class="stdfooter">
-         <xsl:if test="$linkPanel='true'">
-            <div class="footer">
-               <xsl:if test="not($parentURL='')">
-                  <a class="{$style}" href="{$parentURL}">
-                     <xsl:value-of select="$parentWords"/>
-                  </a> | </xsl:if>
-               <a class="{$style}" href="{$homeURL}">
-                  <xsl:value-of select="$homeWords"/>
-               </a>
-               <xsl:if test="$searchURL">
-		 <xsl:text>| </xsl:text>
-		 <a class="{$style}" href="{$searchURL}">
-		   <xsl:call-template name="i18n">
-		     <xsl:with-param name="word">searchWords</xsl:with-param>
-		   </xsl:call-template>            
-		 </a>
-               </xsl:if>
-               <xsl:if test="$feedbackURL"> | <a class="{$style}" href="{$feedbackURL}">
-	       <xsl:call-template name="i18n">
-		 <xsl:with-param name="word">feedbackWords</xsl:with-param>
-	       </xsl:call-template>
-	     </a>
-               </xsl:if>
-            </div>
-         </xsl:if>
-         <xsl:call-template name="preAddressHook"/>
-         <address>
-            <xsl:if test="not($author='')">
-               <xsl:text> </xsl:text>
-               <xsl:value-of select="$author"/>.
-      </xsl:if>
-            <xsl:call-template name="i18n">
-               <xsl:with-param name="word">dateWord</xsl:with-param>
-            </xsl:call-template>
-            <xsl:text>: </xsl:text>
-            <xsl:value-of select="$date"/>
-            <br/>
-            <xsl:call-template name="copyrightStatement"/>
-            <xsl:comment>
-               <xsl:text>
+	<xsl:template match="html:PAGEBREAK" mode="copy" />
+	<xsl:template match="html:*" mode="copy">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="stdfooter">
+		<xsl:param name="style" select="'plain'" />
+		<xsl:param name="file" />
+		<xsl:variable name="date">
+			<xsl:call-template name="generateDate" />
+		</xsl:variable>
+		<xsl:variable name="author">
+			<xsl:call-template name="generateAuthor" />
+		</xsl:variable>
+		<div class="stdfooter">
+			<xsl:if test="$linkPanel='true'">
+				<div class="footer">
+					<xsl:if test="not($parentURL='')">
+						<a class="{$style}" href="{$parentURL}">
+							<xsl:value-of select="$parentWords" />
+						</a>
+						|
+					</xsl:if>
+					<a class="{$style}" href="{$homeURL}">
+						<xsl:value-of select="$homeWords" />
+					</a>
+					<xsl:if test="$searchURL">
+						<xsl:text>| </xsl:text>
+						<a class="{$style}" href="{$searchURL}">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									searchWords
+								</xsl:with-param>
+							</xsl:call-template>
+						</a>
+					</xsl:if>
+					<xsl:if test="$feedbackURL">
+						|
+						<a class="{$style}" href="{$feedbackURL}">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									feedbackWords
+								</xsl:with-param>
+							</xsl:call-template>
+						</a>
+					</xsl:if>
+				</div>
+			</xsl:if>
+			<xsl:call-template name="preAddressHook" />
+			<address>
+				<xsl:if test="not($author='')">
+					<xsl:text> </xsl:text>
+					<xsl:value-of select="$author" />
+					.
+				</xsl:if>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						dateWord
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>: </xsl:text>
+				<xsl:value-of select="$date" />
+				<br />
+				<xsl:call-template name="copyrightStatement" />
+				<xsl:comment>
+					<xsl:text>
 	  Generated </xsl:text>
-               <xsl:if test="not($masterFile='index')">
-                  <xsl:text>from </xsl:text>
-                  <xsl:value-of select="$masterFile"/>
-               </xsl:if>
-               <xsl:text> using an XSLT version </xsl:text>
-               <xsl:value-of select="system-property('xsl:version')"/> stylesheet
-	  based on <xsl:value-of select="$teixslHome"/>
-	  processed using <xsl:value-of select="system-property('xsl:vendor')"/>
-	  on <xsl:call-template name="whatsTheDate"/>
-            </xsl:comment>
-         </address>
-      </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] <param name="title">title</param>
-      </desc>
-   </doc>
-  <xsl:template name="stdheader">
-      <xsl:param name="title">(no title)</xsl:param>
-      <xsl:choose>
-         <xsl:when test="$pageLayout='Simple'">
-	   <xsl:if test="not($institution='')">
-            <h2 class="institution">
-               <xsl:value-of select="$institution"/>
-            </h2>
-	   </xsl:if>
-	   <xsl:if test="not($department='')">
-            <h2 class="department">
-               <xsl:value-of select="$department"/>
-            </h2>
-	   </xsl:if>
-	   
-	   <xsl:call-template name="makeHTMLHeading">
-	     <xsl:with-param name="class">maintitle</xsl:with-param>
-	     <xsl:with-param name="text">
-	       <xsl:copy-of select="$title"/>
-	     </xsl:with-param>
-	     <xsl:with-param name="level">1</xsl:with-param>
-	   </xsl:call-template>
-	   
-	   <xsl:call-template name="makeHTMLHeading">
-	     <xsl:with-param name="class">subtitle</xsl:with-param>
-	     <xsl:with-param name="text">
-	       <xsl:call-template name="generateSubTitle"/>
-	     </xsl:with-param>
-	     <xsl:with-param name="level">2</xsl:with-param>
-	   </xsl:call-template>
-	   
+					<xsl:if test="not($masterFile='index')">
+						<xsl:text>from </xsl:text>
+						<xsl:value-of select="$masterFile" />
+					</xsl:if>
+					<xsl:text> using an XSLT version </xsl:text>
+					<xsl:value-of select="system-property('xsl:version')" />
+					stylesheet
+					based on
+					<xsl:value-of select="$teixslHome" />
+					processed using
+					<xsl:value-of select="system-property('xsl:vendor')" />
+					on
+					<xsl:call-template name="whatsTheDate" />
+				</xsl:comment>
+			</address>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="title">title</param>
+		</desc>
+	</doc>
+	<xsl:template name="stdheader">
+		<xsl:param name="title">
+			(no title)
+		</xsl:param>
+		<xsl:choose>
+			<xsl:when test="$pageLayout='Simple'">
+				<xsl:if test="not($institution='')">
+					<h2 class="institution">
+						<xsl:value-of select="$institution" />
+					</h2>
+				</xsl:if>
+				<xsl:if test="not($department='')">
+					<h2 class="department">
+						<xsl:value-of select="$department" />
+					</h2>
+				</xsl:if>
 
-	   <xsl:if test="$showTitleAuthor='true'">
-	     <xsl:if test="$verbose='true'">
-	       <xsl:message>displaying author and date</xsl:message>
-	     </xsl:if>
-	     <xsl:call-template name="generateAuthorList"/>
-	     <xsl:call-template name="generateDate"/>
-	     <xsl:call-template name="generateEdition"/>
-	   </xsl:if>
-	 </xsl:when>
-	 <xsl:otherwise>
-	   <xsl:call-template name="makeHTMLHeading">
-	     <xsl:with-param name="class">maintitle</xsl:with-param>
-	     <xsl:with-param name="text">
-	       <xsl:value-of select="$title"/>
-	     </xsl:with-param>
-	     <xsl:with-param name="level">1</xsl:with-param>
-	   </xsl:call-template>
-	   
-	   <xsl:call-template name="makeHTMLHeading">
-	     <xsl:with-param name="class">subtitle</xsl:with-param>
-	     <xsl:with-param name="text">
-	       <xsl:call-template name="generateTitle"/>
-	     </xsl:with-param>
-	     <xsl:with-param name="level">2</xsl:with-param>
-	   </xsl:call-template>
-	   
-	   <xsl:if test="$showTitleAuthor='true'">
-	     <xsl:if test="$verbose='true'">
-	       <xsl:message>displaying author and date</xsl:message>
-	     </xsl:if>
-	     <xsl:call-template name="generateAuthorList"/>
-	     <xsl:call-template name="generateDate"/>
-	     <xsl:call-template name="generateEdition"/>
-	   </xsl:if>
-	 </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+				<xsl:call-template name="makeHTMLHeading">
+					<xsl:with-param name="class">
+						maintitle
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:copy-of select="$title" />
+					</xsl:with-param>
+					<xsl:with-param name="level">
+						1
+					</xsl:with-param>
+				</xsl:call-template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="subtoc">
-      <xsl:if test="child::tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
-         <xsl:variable name="parent">
-            <xsl:choose>
-               <xsl:when test="ancestor::tei:div">
-                  <xsl:apply-templates mode="ident" select="ancestor::tei:div[last()]"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:apply-templates mode="ident" select="."/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:variable>
-         <xsl:variable name="depth">
-            <xsl:apply-templates mode="depth" select="."/>
-         </xsl:variable>
-         <p>
-            <span class="subtochead">
-               <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">tocWords</xsl:with-param>
-               </xsl:call-template>
-            </span>
-         </p>
-         <div class="subtoc">
-            <ul class="subtoc">
-               <xsl:for-each select="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
-                  <xsl:variable name="innerdent">
-                     <xsl:apply-templates mode="generateLink" select="."/>
-                  </xsl:variable>
-                  <li class="subtoc">
-                     <xsl:call-template name="makeInternalLink">
-                        <xsl:with-param name="dest">
-                           <xsl:value-of select="$innerdent"/>
-                        </xsl:with-param>
-                        <xsl:with-param name="class">
-                           <xsl:value-of select="$class_subtoc"/>
-                        </xsl:with-param>
-                        <xsl:with-param name="body">
-                           <xsl:call-template name="header">
-		                            <xsl:with-param name="display">simple</xsl:with-param>
-		                         </xsl:call-template>
-                        </xsl:with-param>
-                     </xsl:call-template>
-                  </li>
-               </xsl:for-each>
-            </ul>
-         </div>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="summaryToc">
-      <div class="teidiv">
-         <p>Select headings on the left-hand side to see more explanation of the
-        links on the right.</p>
-         <table cellspacing="7">
-            <thead>
-               <tr>
-                  <th nowrap="nowrap"/>
-                  <th/>
-               </tr>
-            </thead>
-	    <tbody>
-            <xsl:for-each select="//tei:body/tei:div">
-               <xsl:text>&#10;</xsl:text>
-               <tr class="summaryline">
-                  <td align="right" class="summarycell" style="vertical-align:top;">
-                     <b>
-                        <a class="nolink">
-                           <xsl:attribute name="href">
-                              <xsl:apply-templates mode="generateLink" select="."/>
+				<xsl:call-template name="makeHTMLHeading">
+					<xsl:with-param name="class">
+						subtitle
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:call-template name="generateSubTitle" />
+					</xsl:with-param>
+					<xsl:with-param name="level">
+						2
+					</xsl:with-param>
+				</xsl:call-template>
+
+
+				<xsl:if test="$showTitleAuthor='true'">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							displaying author and date
+						</xsl:message>
+					</xsl:if>
+					<xsl:call-template name="generateAuthorList" />
+					<xsl:call-template name="generateDate" />
+					<xsl:call-template name="generateEdition" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="makeHTMLHeading">
+					<xsl:with-param name="class">
+						maintitle
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of select="$title" />
+					</xsl:with-param>
+					<xsl:with-param name="level">
+						1
+					</xsl:with-param>
+				</xsl:call-template>
+
+				<xsl:call-template name="makeHTMLHeading">
+					<xsl:with-param name="class">
+						subtitle
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:call-template name="generateTitle" />
+					</xsl:with-param>
+					<xsl:with-param name="level">
+						2
+					</xsl:with-param>
+				</xsl:call-template>
+
+				<xsl:if test="$showTitleAuthor='true'">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							displaying author and date
+						</xsl:message>
+					</xsl:if>
+					<xsl:call-template name="generateAuthorList" />
+					<xsl:call-template name="generateDate" />
+					<xsl:call-template name="generateEdition" />
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="subtoc">
+		<xsl:if
+			test="child::tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
+			<xsl:variable name="parent">
+				<xsl:choose>
+					<xsl:when test="ancestor::tei:div">
+						<xsl:apply-templates mode="ident"
+							select="ancestor::tei:div[last()]" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates mode="ident" select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:variable name="depth">
+				<xsl:apply-templates mode="depth" select="." />
+			</xsl:variable>
+			<p>
+				<span class="subtochead">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							tocWords
+						</xsl:with-param>
+					</xsl:call-template>
+				</span>
+			</p>
+			<div class="subtoc">
+				<ul class="subtoc">
+					<xsl:for-each
+						select="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
+						<xsl:variable name="innerdent">
+							<xsl:apply-templates mode="generateLink"
+								select="." />
+						</xsl:variable>
+						<li class="subtoc">
+							<xsl:call-template name="makeInternalLink">
+								<xsl:with-param name="dest">
+									<xsl:value-of select="$innerdent" />
+								</xsl:with-param>
+								<xsl:with-param name="class">
+									<xsl:value-of select="$class_subtoc" />
+								</xsl:with-param>
+								<xsl:with-param name="body">
+									<xsl:call-template name="header">
+										<xsl:with-param name="display">
+											simple
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:with-param>
+							</xsl:call-template>
+						</li>
+					</xsl:for-each>
+				</ul>
+			</div>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="summaryToc">
+		<div class="teidiv">
+			<p>Select headings on the left-hand side to see more explanation of
+				the
+				links on the right.</p>
+			<table cellspacing="7">
+				<thead>
+					<tr>
+						<th nowrap="nowrap" />
+						<th />
+					</tr>
+				</thead>
+				<tbody>
+					<xsl:for-each select="//tei:body/tei:div">
+						<xsl:text>&#10;</xsl:text>
+						<tr class="summaryline">
+							<td align="right" class="summarycell"
+								style="vertical-align:top;">
+								<b>
+									<a class="nolink">
+										<xsl:attribute name="href">
+                              <xsl:apply-templates
+											mode="generateLink" select="." />
                            </xsl:attribute>
-                           <xsl:value-of select="tei:head"/>
-                        </a>
-                     </b>
-                  </td>
-                  <td class="link" style="vertical-align:top;">
-                     <xsl:for-each select=".//xref|.//xptr">
-                        <xsl:if test="position() &gt; 1">
-                           <xsl:text>&#160;</xsl:text>
-                           <img alt="*" src="/images/dbluball.gif"/>
-                           <xsl:text> </xsl:text>
-                        </xsl:if>
-                        <span class="nowrap">
-                           <xsl:apply-templates select="."/>
-                        </span>
-                     </xsl:for-each>
-                  </td>
-               </tr>
-            </xsl:for-each>
-	    </tbody>
-         </table>
-      </div>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Make a TOC section <param name="style">CSS style to use</param>
-         <param name="id">ID to link to</param>
-         <param name="force">whether to force a TOC entry even if other rules
-      would normally prevent it</param>
-      </desc>
-   </doc>
-  <xsl:template name="tocSection">
-      <xsl:param name="style"/>
-      <xsl:param name="id"/>
-      <xsl:param name="force">false</xsl:param>
-      <xsl:choose>
-         <xsl:when test="tei:div1">
-            <xsl:for-each select="tei:div1[tei:head or $autoHead='true']">
-               <xsl:call-template name="tocEntry">
-                  <xsl:with-param name="style" select="$style"/>
-                  <xsl:with-param name="id" select="$id"/>
-               </xsl:call-template>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:when test="tei:div2 and (number($splitLevel) &gt;=1 or $force='true')">
-            <xsl:for-each select="tei:div2[tei:head or $autoHead='true']">
-               <xsl:call-template name="tocEntry">
-                  <xsl:with-param name="style" select="$style"/>
-                  <xsl:with-param name="id" select="$id"/>
-               </xsl:call-template>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:when test="tei:div3 and (number($splitLevel) &gt;=2 or $force='true')">
-            <xsl:for-each select="tei:div3[tei:head or $autoHead='true']">
-               <xsl:call-template name="tocEntry">
-                  <xsl:with-param name="style" select="$style"/>
-                  <xsl:with-param name="id" select="$id"/>
-               </xsl:call-template>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:when test="self::tei:div">
-            <xsl:variable name="depth">
-               <xsl:apply-templates mode="depth" select="."/>
-            </xsl:variable>
-            <xsl:if test="(number($splitLevel)&gt;number($depth)  or $force='true' or ancestor::tei:TEI/@rend='nosplit')">
-               <xsl:for-each select="tei:div[tei:head or $autoHead='true']">
-                  <xsl:call-template name="tocEntry">
-                     <xsl:with-param name="style" select="$style"/>
-                     <xsl:with-param name="id" select="$id"/>
-                  </xsl:call-template>
-               </xsl:for-each>
-            </xsl:if>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:for-each select="tei:div[tei:head or $autoHead='true']">
-               <xsl:call-template name="tocEntry">
-                  <xsl:with-param name="style" select="$style"/>
-                  <xsl:with-param name="id" select="$id"/>
-               </xsl:call-template>
-            </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] Make a TOC entry <param name="style">style</param>
-         <param name="id">id</param>
-      </desc>
-   </doc>
-  <xsl:template name="tocEntry">
-      <xsl:param name="style"/>
-      <xsl:param name="id"/>
-      <xsl:element name="{$tocElement}">
-         <xsl:attribute name="class">
-            <xsl:value-of select="$style"/>
-            <xsl:apply-templates mode="depth" select="."/>
+										<xsl:value-of select="tei:head" />
+									</a>
+								</b>
+							</td>
+							<td class="link" style="vertical-align:top;">
+								<xsl:for-each select=".//xref|.//xptr">
+									<xsl:if test="position() &gt; 1">
+										<xsl:text>&#160;</xsl:text>
+										<img alt="*" src="/images/dbluball.gif" />
+										<xsl:text> </xsl:text>
+									</xsl:if>
+									<span class="nowrap">
+										<xsl:apply-templates select="." />
+									</span>
+								</xsl:for-each>
+							</td>
+						</tr>
+					</xsl:for-each>
+				</tbody>
+			</table>
+		</div>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Make a TOC section
+			<param name="style">CSS style to use</param>
+			<param name="id">ID to link to</param>
+			<param name="force">whether to force a TOC entry even if other rules
+				would normally prevent it</param>
+		</desc>
+	</doc>
+	<xsl:template name="tocSection">
+		<xsl:param name="style" />
+		<xsl:param name="id" />
+		<xsl:param name="force">
+			false
+		</xsl:param>
+		<xsl:choose>
+			<xsl:when test="tei:div1">
+				<xsl:for-each
+					select="tei:div1[tei:head or $autoHead='true']">
+					<xsl:call-template name="tocEntry">
+						<xsl:with-param name="style" select="$style" />
+						<xsl:with-param name="id" select="$id" />
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when
+				test="tei:div2 and (number($splitLevel) &gt;=1 or $force='true')">
+				<xsl:for-each
+					select="tei:div2[tei:head or $autoHead='true']">
+					<xsl:call-template name="tocEntry">
+						<xsl:with-param name="style" select="$style" />
+						<xsl:with-param name="id" select="$id" />
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when
+				test="tei:div3 and (number($splitLevel) &gt;=2 or $force='true')">
+				<xsl:for-each
+					select="tei:div3[tei:head or $autoHead='true']">
+					<xsl:call-template name="tocEntry">
+						<xsl:with-param name="style" select="$style" />
+						<xsl:with-param name="id" select="$id" />
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="self::tei:div">
+				<xsl:variable name="depth">
+					<xsl:apply-templates mode="depth" select="." />
+				</xsl:variable>
+				<xsl:if
+					test="(number($splitLevel)&gt;number($depth)  or $force='true' or ancestor::tei:TEI/@rend='nosplit')">
+					<xsl:for-each
+						select="tei:div[tei:head or $autoHead='true']">
+						<xsl:call-template name="tocEntry">
+							<xsl:with-param name="style" select="$style" />
+							<xsl:with-param name="id" select="$id" />
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each
+					select="tei:div[tei:head or $autoHead='true']">
+					<xsl:call-template name="tocEntry">
+						<xsl:with-param name="style" select="$style" />
+						<xsl:with-param name="id" select="$id" />
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html] Make a TOC entry
+			<param name="style">style</param>
+			<param name="id">id</param>
+		</desc>
+	</doc>
+	<xsl:template name="tocEntry">
+		<xsl:param name="style" />
+		<xsl:param name="id" />
+		<xsl:element name="{$tocElement}">
+			<xsl:attribute name="class">
+            <xsl:value-of select="$style" />
+            <xsl:apply-templates mode="depth"
+				select="." />
          </xsl:attribute>
-         <xsl:choose>
-            <xsl:when test="generate-id(.)=$id">
-               <span class="toclist-this">
-                  <xsl:call-template name="header">
-	                    <xsl:with-param name="display">simple</xsl:with-param>
-	                 </xsl:call-template>
-               </span>
-            </xsl:when>
-            <xsl:otherwise>
-               <a>
-                  <xsl:attribute name="class">
-                     <xsl:value-of select="$style"/>
+			<xsl:choose>
+				<xsl:when test="generate-id(.)=$id">
+					<span class="toclist-this">
+						<xsl:call-template name="header">
+							<xsl:with-param name="display">
+								simple
+							</xsl:with-param>
+						</xsl:call-template>
+					</span>
+				</xsl:when>
+				<xsl:otherwise>
+					<a>
+						<xsl:attribute name="class">
+                     <xsl:value-of select="$style" />
                   </xsl:attribute>
-                  <xsl:attribute name="href">
-                     <xsl:apply-templates mode="generateLink" select="."/>
+						<xsl:attribute name="href">
+                     <xsl:apply-templates
+							mode="generateLink" select="." />
                   </xsl:attribute>
-                  <xsl:call-template name="header">
-		    <xsl:with-param name="display">simple</xsl:with-param>
-		  </xsl:call-template>
-               </a>
-            </xsl:otherwise>
-         </xsl:choose>
-         <xsl:text>&#10;</xsl:text>
-         <xsl:call-template name="tocSection">
-            <xsl:with-param name="style" select="$style"/>
-            <xsl:with-param name="id" select="$id"/>
-            <xsl:with-param name="force">
-               <xsl:if test="generate-id(.)=$id">true</xsl:if>
-            </xsl:with-param>
-         </xsl:call-template>
-      </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="topNavigation">
-      <xsl:if test="ancestor::teiCorpus">
-	<xsl:element name="{if ($outputTarget='html5') then 'nav' else 'div'}">	  
-	  <xsl:attribute name="class" select="$alignNavigationPanel"/>
-	    <xsl:call-template name="nextLink"/>
-	    <xsl:call-template name="previousLink"/>
-	    <xsl:call-template name="upLink">
-	      <xsl:with-param name="up" select="concat($masterFile,$standardSuffix)"/>
-	      <xsl:with-param name="title">
-		<xsl:call-template name="contentsWord"/>
-	      </xsl:with-param>
-	    </xsl:call-template>
-	</xsl:element>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] <param name="up">the link to which "Up" goes</param>
-         <param name="title">the text of the link</param>
-      </desc>
-   </doc>
-  <xsl:template name="upLink">
-      <xsl:param name="up"/>
-      <xsl:param name="title"/>
-      <xsl:if test="$up">
-         <span class="upLink">
-	           <xsl:text> </xsl:text>
-	           <xsl:call-template name="i18n">
-               <xsl:with-param name="word">upWord</xsl:with-param>
-            </xsl:call-template>
-	           <xsl:call-template name="navInterSep"/>
-         </span>
-         <a class="navigation">
-	           <xsl:choose>
-	              <xsl:when test="$title">
-	                 <xsl:attribute name="href">
-	                    <xsl:value-of select="$up"/>
+						<xsl:call-template name="header">
+							<xsl:with-param name="display">
+								simple
+							</xsl:with-param>
+						</xsl:call-template>
+					</a>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>&#10;</xsl:text>
+			<xsl:call-template name="tocSection">
+				<xsl:with-param name="style" select="$style" />
+				<xsl:with-param name="id" select="$id" />
+				<xsl:with-param name="force">
+					<xsl:if test="generate-id(.)=$id">
+						true
+					</xsl:if>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="topNavigation">
+		<xsl:if test="ancestor::teiCorpus">
+			<xsl:element
+				name="{if ($outputTarget='html5') then 'nav' else 'div'}">
+				<xsl:attribute name="class"
+					select="$alignNavigationPanel" />
+				<xsl:call-template name="nextLink" />
+				<xsl:call-template name="previousLink" />
+				<xsl:call-template name="upLink">
+					<xsl:with-param name="up"
+						select="concat($masterFile,$standardSuffix)" />
+					<xsl:with-param name="title">
+						<xsl:call-template name="contentsWord" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="up">the link to which "Up" goes</param>
+			<param name="title">the text of the link</param>
+		</desc>
+	</doc>
+	<xsl:template name="upLink">
+		<xsl:param name="up" />
+		<xsl:param name="title" />
+		<xsl:if test="$up">
+			<span class="upLink">
+				<xsl:text> </xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						upWord
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="navInterSep" />
+			</span>
+			<a class="navigation">
+				<xsl:choose>
+					<xsl:when test="$title">
+						<xsl:attribute name="href">
+	                    <xsl:value-of select="$up" />
 	                 </xsl:attribute>
-	                 <xsl:value-of select="$title"/>
-	              </xsl:when>
-	              <xsl:otherwise>
-	                 <xsl:attribute name="href">
-	                    <xsl:apply-templates mode="generateLink" select="$up"/>
+						<xsl:value-of select="$title" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:attribute name="href">
+	                    <xsl:apply-templates
+							mode="generateLink" select="$up" />
 	                 </xsl:attribute>
-	                 <xsl:for-each select="$up">
-	                    <xsl:call-template name="headerLink">
-		                      <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-	                    </xsl:call-template>
-	                 </xsl:for-each>
-	              </xsl:otherwise>
-	           </xsl:choose>
-         </a>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] <param name="path">path</param>
-         <param name="class">class</param>
-         <param name="whole">whole</param>
-      </desc>
-   </doc>
-  <xsl:template name="walkTree">
-      <xsl:param name="path"/>
-      <xsl:param name="class"/>
-      <xsl:param name="whole"/>
-      <xsl:choose>
-         <xsl:when test="contains($path,'/')">
-            <xsl:variable name="current">
-               <xsl:value-of select="substring-before($path,'/')"/>
-            </xsl:variable>
-            <xsl:variable name="rest">
-               <xsl:value-of select="substring-after($path,'/')"/>
-            </xsl:variable>
-            <xsl:call-template name="aCrumb">
-               <xsl:with-param name="crumbBody">
-                  <xsl:choose>
-                     <xsl:when test="$rest='index.xsp' and $requestedID=''">
-                        <xsl:value-of select="$current"/>
-                     </xsl:when>
-                     <xsl:when test="$rest='index.xml' and $requestedID=''">
-                        <xsl:value-of select="$current"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <a class="{$class}">
-			  <xsl:attribute name="href">
-			    <xsl:value-of select="$whole"/>
-			    <xsl:value-of select="$current"/>
+						<xsl:for-each select="$up">
+							<xsl:call-template name="headerLink">
+								<xsl:with-param name="minimal"
+									select="$minimalCrossRef" />
+							</xsl:call-template>
+						</xsl:for-each>
+					</xsl:otherwise>
+				</xsl:choose>
+			</a>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="path">path</param>
+			<param name="class">class</param>
+			<param name="whole">whole</param>
+		</desc>
+	</doc>
+	<xsl:template name="walkTree">
+		<xsl:param name="path" />
+		<xsl:param name="class" />
+		<xsl:param name="whole" />
+		<xsl:choose>
+			<xsl:when test="contains($path,'/')">
+				<xsl:variable name="current">
+					<xsl:value-of select="substring-before($path,'/')" />
+				</xsl:variable>
+				<xsl:variable name="rest">
+					<xsl:value-of select="substring-after($path,'/')" />
+				</xsl:variable>
+				<xsl:call-template name="aCrumb">
+					<xsl:with-param name="crumbBody">
+						<xsl:choose>
+							<xsl:when test="$rest='index.xsp' and $requestedID=''">
+								<xsl:value-of select="$current" />
+							</xsl:when>
+							<xsl:when test="$rest='index.xml' and $requestedID=''">
+								<xsl:value-of select="$current" />
+							</xsl:when>
+							<xsl:otherwise>
+								<a class="{$class}">
+									<xsl:attribute name="href">
+			    <xsl:value-of select="$whole" />
+			    <xsl:value-of select="$current" />
 			    <xsl:text>/</xsl:text>
 			  </xsl:attribute>
-			  <xsl:value-of select="$current"/>
-                        </a>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="walkTree">
-               <xsl:with-param name="class">
-                  <xsl:value-of select="$class"/>
-               </xsl:with-param>
-               <xsl:with-param name="path" select="$rest"/>
-               <xsl:with-param name="whole">
-	                 <xsl:value-of select="$whole"/>
-	                 <xsl:value-of select="$current"/>
-	                 <xsl:text>/</xsl:text>
-	              </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:if test="not($path='index.xsp' or $path='index.xml')">
-               <xsl:call-template name="aCrumb">
-                  <xsl:with-param name="crumbBody">
-                     <a class="{$class}">
-		       <xsl:attribute name="href">
-			 <xsl:value-of select="$whole"/>
-			 <xsl:value-of select="$path"/>
+									<xsl:value-of select="$current" />
+								</a>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="walkTree">
+					<xsl:with-param name="class">
+						<xsl:value-of select="$class" />
+					</xsl:with-param>
+					<xsl:with-param name="path" select="$rest" />
+					<xsl:with-param name="whole">
+						<xsl:value-of select="$whole" />
+						<xsl:value-of select="$current" />
+						<xsl:text>/</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="not($path='index.xsp' or $path='index.xml')">
+					<xsl:call-template name="aCrumb">
+						<xsl:with-param name="crumbBody">
+							<a class="{$class}">
+								<xsl:attribute name="href">
+			 <xsl:value-of select="$whole" />
+			 <xsl:value-of select="$path" />
 		       </xsl:attribute>
-		       <xsl:value-of select="$path"/>
-                     </a>
-                  </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template name="writeDiv">
-      <xsl:variable name="BaseFile">
-         <xsl:value-of select="$masterFile"/>
-         <xsl:call-template name="addCorpusID"/>
-      </xsl:variable>
-      <html>
-         <xsl:call-template name="addLangAtt"/>
-         <xsl:comment>THIS IS A GENERATED FILE. DO NOT EDIT (2)</xsl:comment>
-         <head>
-            <xsl:variable name="pagetitle">
-               <xsl:call-template name="generateDivtitle"/>
-            </xsl:variable>
-            <title>
-               <xsl:value-of select="$pagetitle"/>
-            </title>
-            <xsl:call-template name="headHook"/>
-            <xsl:call-template name="metaHTML">
-               <xsl:with-param name="title" select="$pagetitle"/>
-            </xsl:call-template>
-            <xsl:call-template name="includeCSS"/>
-            <xsl:call-template name="cssHook"/>
-            <xsl:call-template name="includeJavascript"/>
-            <xsl:call-template name="javascriptHook"/>
-         </head>
-         <body id="TOP">
-            <xsl:call-template name="bodyMicroData"/>
-            <xsl:call-template name="bodyJavascriptHook"/>
-	    <xsl:call-template name="bodyHook"/>
-            <div class="teidiv">
-               <xsl:call-template name="stdheader">
-                  <xsl:with-param name="title">
-		    <xsl:call-template name="header"/>
-                  </xsl:with-param>
-               </xsl:call-template>
-               <xsl:if test="$topNavigationPanel='true'">
-		 <xsl:element name="{if ($outputTarget='html5') then 'nav' else 'div'}">
-		   <xsl:call-template name="xrefpanel">
-		     <xsl:with-param name="homepage" select="concat($BaseFile,$standardSuffix)"/>
-                     <xsl:with-param name="mode" select="local-name(.)"/>
-                  </xsl:call-template>
-		 </xsl:element>
-               </xsl:if>
-               <xsl:if test="$subTocDepth &gt;= 0">
-                  <xsl:call-template name="subtoc"/>
-               </xsl:if>
-               <xsl:call-template name="startHook"/>
-               <xsl:call-template name="doDivBody"/>
-               <xsl:call-template name="printNotes"/>
-               <xsl:if test="$bottomNavigationPanel='true'">
-		 <xsl:element name="{if ($outputTarget='html5') then 'nav' else 'div'}">
-                  <xsl:call-template name="xrefpanel">
-                     <xsl:with-param name="homepage" select="concat($BaseFile,$standardSuffix)"/>
-                     <xsl:with-param name="mode" select="local-name(.)"/>
-                  </xsl:call-template>
-		 </xsl:element>
-               </xsl:if>
-               <xsl:call-template name="stdfooter"/>
-	              <xsl:call-template name="bodyEndHook"/>
-            </div>
-         </body>
-      </html>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html]provide a class attribute and/or ID for each div <param name="depth">depth of section (1, 2 3, 4 etc)</param>
-      </desc>
-   </doc>
-  <xsl:template name="divClassAttribute">
-      <xsl:param name="depth"/>
-      <xsl:if test="@its:dir">
-	<xsl:attribute name="dir" select="@its:dir"/>
-      </xsl:if>
-      <xsl:attribute name="class">
+								<xsl:value-of select="$path" />
+							</a>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template name="writeDiv">
+		<xsl:variable name="BaseFile">
+			<xsl:value-of select="$masterFile" />
+			<xsl:call-template name="addCorpusID" />
+		</xsl:variable>
+		<html>
+			<xsl:call-template name="addLangAtt" />
+			<xsl:comment>
+				THIS IS A GENERATED FILE. DO NOT EDIT (2)
+			</xsl:comment>
+			<head>
+				<xsl:variable name="pagetitle">
+					<xsl:call-template name="generateDivtitle" />
+				</xsl:variable>
+				<title>
+					<xsl:value-of select="$pagetitle" />
+				</title>
+				<xsl:call-template name="headHook" />
+				<xsl:call-template name="metaHTML">
+					<xsl:with-param name="title" select="$pagetitle" />
+				</xsl:call-template>
+				<xsl:call-template name="includeCSS" />
+				<xsl:call-template name="cssHook" />
+				<xsl:call-template name="includeJavascript" />
+				<xsl:call-template name="javascriptHook" />
+			</head>
+			<body id="TOP">
+				<xsl:call-template name="bodyMicroData" />
+				<xsl:call-template name="bodyJavascriptHook" />
+				<xsl:call-template name="bodyHook" />
+				<div class="teidiv">
+					<xsl:call-template name="stdheader">
+						<xsl:with-param name="title">
+							<xsl:call-template name="header" />
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:if test="$topNavigationPanel='true'">
+						<xsl:element
+							name="{if ($outputTarget='html5') then 'nav' else 'div'}">
+							<xsl:call-template name="xrefpanel">
+								<xsl:with-param name="homepage"
+									select="concat($BaseFile,$standardSuffix)" />
+								<xsl:with-param name="mode"
+									select="local-name(.)" />
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:if>
+					<xsl:if test="$subTocDepth &gt;= 0">
+						<xsl:call-template name="subtoc" />
+					</xsl:if>
+					<xsl:call-template name="startHook" />
+					<xsl:call-template name="doDivBody" />
+					<xsl:call-template name="printNotes" />
+					<xsl:if test="$bottomNavigationPanel='true'">
+						<xsl:element
+							name="{if ($outputTarget='html5') then 'nav' else 'div'}">
+							<xsl:call-template name="xrefpanel">
+								<xsl:with-param name="homepage"
+									select="concat($BaseFile,$standardSuffix)" />
+								<xsl:with-param name="mode"
+									select="local-name(.)" />
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:if>
+					<xsl:call-template name="stdfooter" />
+					<xsl:call-template name="bodyEndHook" />
+				</div>
+			</body>
+		</html>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]provide a class attribute and/or ID for each div
+			<param name="depth">depth of section (1, 2 3, 4 etc)</param>
+		</desc>
+	</doc>
+	<xsl:template name="divClassAttribute">
+		<xsl:param name="depth" />
+		<xsl:if test="@its:dir">
+			<xsl:attribute name="dir" select="@its:dir" />
+		</xsl:if>
+		<xsl:attribute name="class">
          <xsl:choose>
 	   <xsl:when test="@type">
-	     <xsl:value-of select="@type"/>
+	     <xsl:value-of select="@type" />
 	   </xsl:when>
 	   <xsl:otherwise>
 	     <xsl:text>teidiv</xsl:text>
-	     <xsl:value-of select="$depth"/>
+	     <xsl:value-of select="$depth" />
 	   </xsl:otherwise>
          </xsl:choose>
          <xsl:if test="@rend">
 	   <xsl:text> </xsl:text>
-	   <xsl:value-of select="@rend"/>
+	   <xsl:value-of select="@rend" />
          </xsl:if>
       </xsl:attribute>
-      <xsl:variable name="ident">
-         <xsl:apply-templates mode="ident" select="."/>
-      </xsl:variable>
-      <xsl:attribute name="id">
-         <xsl:value-of select="$ident"/>
+		<xsl:variable name="ident">
+			<xsl:apply-templates mode="ident" select="." />
+		</xsl:variable>
+		<xsl:attribute name="id">
+         <xsl:value-of select="$ident" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] <param name="homepage">homepage</param>
-         <param name="mode">mode</param>
-      </desc>
-   </doc>
-  <xsl:template name="xrefpanel">
-      <xsl:param name="homepage"/>
-      <xsl:param name="mode"/>
-      <xsl:attribute name="class" select="$alignNavigationPanel"/>
-      <xsl:call-template name="generateUpLink"/>
-      <xsl:if test="not(ancestor-or-self::tei:TEI[@rend='nomenu'])">
-	<xsl:call-template name="previousLink"/>
-	<xsl:call-template name="nextLink"/>
-      </xsl:if>
-  </xsl:template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[html]
+			<param name="homepage">homepage</param>
+			<param name="mode">mode</param>
+		</desc>
+	</doc>
+	<xsl:template name="xrefpanel">
+		<xsl:param name="homepage" />
+		<xsl:param name="mode" />
+		<xsl:attribute name="class"
+			select="$alignNavigationPanel" />
+		<xsl:call-template name="generateUpLink" />
+		<xsl:if test="not(ancestor-or-self::tei:TEI[@rend='nomenu'])">
+			<xsl:call-template name="previousLink" />
+			<xsl:call-template name="nextLink" />
+		</xsl:if>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[html] </desc>
-   </doc>
-  <xsl:template match="tei:floatingText">
-      <div class="floatingText">
-	        <xsl:for-each select="tei:front">
-	           <div class="floatingText_front">
-	              <xsl:apply-templates/>
-	           </div>
-	        </xsl:for-each>
-	        <xsl:for-each select="tei:body">
-	           <div class="floatingText_body">
-	              <xsl:apply-templates/>
-	           </div>
-	        </xsl:for-each>
-	        <xsl:for-each select="tei:back">
-	           <div class="floatingText_back">
-	              <xsl:apply-templates/>
-	           </div>
-	        </xsl:for-each>
-      </div>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[html] </desc>
+	</doc>
+	<xsl:template match="tei:floatingText">
+		<div class="floatingText">
+			<xsl:for-each select="tei:front">
+				<div class="floatingText_front">
+					<xsl:apply-templates />
+				</div>
+			</xsl:for-each>
+			<xsl:for-each select="tei:body">
+				<div class="floatingText_body">
+					<xsl:apply-templates />
+				</div>
+			</xsl:for-each>
+			<xsl:for-each select="tei:back">
+				<div class="floatingText_back">
+					<xsl:apply-templates />
+				</div>
+			</xsl:for-each>
+		</div>
+	</xsl:template>
 
-  <xsl:template match="tei:trailer">
-      <div class="trailer">
-	<xsl:apply-templates/>
-      </div>
-  </xsl:template>
+	<xsl:template match="tei:trailer">
+		<div class="trailer">
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/textcrit.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/textcrit.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xhtml2/textcrit.xsl	(revision 2397)
@@ -1,139 +1,145 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"  xmlns:xlink="http://www.w3.org/1999/xlink"
-                xmlns:dbk="http://docbook.org/ns/docbook"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xhtml="http://www.w3.org/1999/xhtml"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:html="http://www.w3.org/1999/xhtml"
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:dbk="http://docbook.org/ns/docbook"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
 
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fo dbk xlink xhtml rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the textcrit
-      module, making HTML output. </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo dbk xlink xhtml rng tei teix"
+	version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the textcrit
+				module, making HTML output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: textcrit.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-   <xsl:template name="appReading">
-     <xsl:param name="lemma"/>
-     <xsl:param name="lemmawitness"/>
-     <xsl:param name="readings"/>
-     <xsl:value-of select="$lemma"/>
-      <xsl:variable name="identifier">
-         <xsl:text>App</xsl:text>
-         <xsl:choose>
-	   <xsl:when test="@xml:id">
-	     <xsl:value-of select="@xml:id"/>
-	   </xsl:when>
-	   <xsl:when test="@n">
-	     <xsl:value-of select="@n"/>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:number count="tei:app" level="any"/>
-	   </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-      <xsl:choose>
-       <xsl:when test="$footnoteFile='true'">
-	 <a class="notelink" href="{$masterFile}-notes.html#{$identifier}">
-	   <sup>
-	     <xsl:call-template name="appN"/>
-	   </sup>
-	 </a>
-       </xsl:when>
-       <xsl:otherwise>
-	 <a class="notelink" href="#{$identifier}">
-	   <sup>
-	     <xsl:call-template name="appN"/>
-	   </sup>
-	 </a>
-       </xsl:otherwise>
-      </xsl:choose>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: textcrit.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  </xsl:template>
+	<xsl:template name="appReading">
+		<xsl:param name="lemma" />
+		<xsl:param name="lemmawitness" />
+		<xsl:param name="readings" />
+		<xsl:value-of select="$lemma" />
+		<xsl:variable name="identifier">
+			<xsl:text>App</xsl:text>
+			<xsl:choose>
+				<xsl:when test="@xml:id">
+					<xsl:value-of select="@xml:id" />
+				</xsl:when>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:number count="tei:app" level="any" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
+		<xsl:choose>
+			<xsl:when test="$footnoteFile='true'">
+				<a class="notelink" href="{$masterFile}-notes.html#{$identifier}">
+					<sup>
+						<xsl:call-template name="appN" />
+					</sup>
+				</a>
+			</xsl:when>
+			<xsl:otherwise>
+				<a class="notelink" href="#{$identifier}">
+					<sup>
+						<xsl:call-template name="appN" />
+					</sup>
+				</a>
+			</xsl:otherwise>
+		</xsl:choose>
 
-   <xsl:template name="appN">
-      <xsl:choose>
-         <xsl:when test="@n">
-            <xsl:value-of select="@n"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:number from="tei:text" level="any"/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	</xsl:template>
 
-   <xsl:template match="tei:app" mode="printnotes">
-      <xsl:variable name="identifier">
-         <xsl:text>App</xsl:text>
-         <xsl:choose>
-            <xsl:when test="@xml:id">
-	              <xsl:value-of select="@xml:id"/>
-            </xsl:when>
-            <xsl:when test="@n">
-	              <xsl:value-of select="@n"/>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:number count="tei:app" level="any"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <div class="note">
-         <xsl:call-template name="makeAnchor">
-            <xsl:with-param name="name" select="$identifier"/>
-         </xsl:call-template>
-         <span class="noteLabel">
-            <xsl:call-template name="appN"/>
-            <xsl:text>. </xsl:text>
-         </span>
-         <span class="noteBody">
-            <xsl:apply-templates/>
-         </span>
-      </div>
-  
-   </xsl:template>
 
+	<xsl:template name="appN">
+		<xsl:choose>
+			<xsl:when test="@n">
+				<xsl:value-of select="@n" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:number from="tei:text" level="any" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="tei:app" mode="printnotes">
+		<xsl:variable name="identifier">
+			<xsl:text>App</xsl:text>
+			<xsl:choose>
+				<xsl:when test="@xml:id">
+					<xsl:value-of select="@xml:id" />
+				</xsl:when>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:number count="tei:app" level="any" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<div class="note">
+			<xsl:call-template name="makeAnchor">
+				<xsl:with-param name="name" select="$identifier" />
+			</xsl:call-template>
+			<span class="noteLabel">
+				<xsl:call-template name="appN" />
+				<xsl:text>. </xsl:text>
+			</span>
+			<span class="noteBody">
+				<xsl:apply-templates />
+			</span>
+		</div>
+
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/txt/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/txt/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/txt/build-to.xml	(revision 2397)
@@ -1,75 +1,70 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitotext">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9319 2011-09-14 15:25:52Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into HTML files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the outputfile will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="odd2text"   value="../profiles/${profile}/txt/to.xsl"/>
-  <property name="odd2oddxsl" value="../odds2/odd2odd.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9319 2011-09-14 15:25:52Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into HTML files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the outputfile will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="odd2text"
+		value="../profiles/${profile}/txt/to.xsl" />
+	<property name="odd2oddxsl" value="../odds2/odd2odd.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
 
-  <target name="dist" depends="setup,convert,cleanup"/>
+	<target name="dist" depends="setup,convert,cleanup" />
 
-  <target name="convert">
-    <!-- Recreate temporary output directory -->
-    <!-- The transformation for HTML output. -->
-    <echo level="info">XSLT generate text file</echo>
-    <xslt force="yes" style="${odd2text}" in="${inputFile}" out="${outputFile}" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
+	<target name="convert">
+		<!-- Recreate temporary output directory -->
+		<!-- The transformation for HTML output. -->
+		<echo level="info">XSLT generate text file</echo>
+		<xslt force="yes" style="${odd2text}" in="${inputFile}"
+			out="${outputFile}" classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/txt/tei-to-text.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/txt/tei-to-text.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/txt/tei-to-text.xsl	(revision 2397)
@@ -1,113 +1,122 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xpath-default-namespace="http://www.tei-c.org/ns/1.0"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    version="2.0">
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei-to-text.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-   <xsl:output method="text"/>
-   <xsl:param name="makeCSV">false</xsl:param>
-   <xsl:variable name="q">"</xsl:variable>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-to-text.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-   <xsl:template match="/">
-     <xsl:apply-templates select="tei:preflight(*)"/>
-   </xsl:template>
+	<xsl:output method="text" />
+	<xsl:param name="makeCSV">
+		false
+	</xsl:param>
+	<xsl:variable name="q">
+		"
+	</xsl:variable>
 
-   <xsl:template match="teiHeader"/>
+	<xsl:template match="/">
+		<xsl:apply-templates select="tei:preflight(*)" />
+	</xsl:template>
 
-   <xsl:template match="figDesc"/>
+	<xsl:template match="teiHeader" />
 
-   <xsl:template match="gap/desc"/>
+	<xsl:template match="figDesc" />
 
-   <xsl:template match="choice">
-     <xsl:apply-templates select="*[1]"/>
-   </xsl:template>
+	<xsl:template match="gap/desc" />
 
-   <xsl:template match="speaker"/>
+	<xsl:template match="choice">
+		<xsl:apply-templates select="*[1]" />
+	</xsl:template>
 
-   <xsl:template match="facsimile"/>
+	<xsl:template match="speaker" />
 
-   <!-- for when we need some context -->
-   <xsl:template match="text()">
-     <xsl:choose>
-       <xsl:when test="normalize-space()=''"/>
-       <xsl:when test="$makeCSV='true'">
-	 <xsl:text>"</xsl:text>
-	 <xsl:value-of select="replace(normalize-space(),'$q','$q$q')"/>
-	 <xsl:text>","</xsl:text>
-	 <xsl:for-each select="ancestor::*">
-	   <xsl:value-of select="name()"/>
-	   <xsl:text>[</xsl:text>
-	   <xsl:number/>
-	   <xsl:text>]/</xsl:text>
-	 </xsl:for-each>
-	 <xsl:text>"&#10;</xsl:text>
-       </xsl:when>
-       <xsl:otherwise>
-	 <xsl:value-of select="normalize-space()"/>
-	 <xsl:text>&#10;</xsl:text>
-       </xsl:otherwise>
-       </xsl:choose>
-   </xsl:template>
+	<xsl:template match="facsimile" />
 
-   
-   <xsl:function name="tei:preflight" as="element()+">
-     <xsl:param name="n" as="element()"/>
-     <xsl:apply-templates select="$n" mode="preflight"/>
-   </xsl:function>
-   
-   <xsl:template match="@*|text()" mode="preflight">
-     <xsl:copy-of select="."/>
-   </xsl:template>
-   
-   <xsl:template match="lb|pb" mode="preflight"/>
+	<!-- for when we need some context -->
+	<xsl:template match="text()">
+		<xsl:choose>
+			<xsl:when test="normalize-space()=''" />
+			<xsl:when test="$makeCSV='true'">
+				<xsl:text>"</xsl:text>
+				<xsl:value-of
+					select="replace(normalize-space(),'$q','$q$q')" />
+				<xsl:text>","</xsl:text>
+				<xsl:for-each select="ancestor::*">
+					<xsl:value-of select="name()" />
+					<xsl:text>[</xsl:text>
+					<xsl:number />
+					<xsl:text>]/</xsl:text>
+				</xsl:for-each>
+				<xsl:text>"&#10;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="normalize-space()" />
+				<xsl:text>&#10;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="*" mode="preflight">
-     <xsl:copy>
-       <xsl:apply-templates select="@*|*|text()" mode="preflight"/>
-     </xsl:copy>
-   </xsl:template>
-   
+
+	<xsl:function name="tei:preflight" as="element()+">
+		<xsl:param name="n" as="element()" />
+		<xsl:apply-templates select="$n" mode="preflight" />
+	</xsl:function>
+
+	<xsl:template match="@*|text()" mode="preflight">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="lb|pb" mode="preflight" />
+
+	<xsl:template match="*" mode="preflight">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|*|text()"
+				mode="preflight" />
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docbook/build-from.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docbook/build-from.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docbook/build-from.xml	(revision 2397)
@@ -1,62 +1,56 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitohtml">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9886 2011-12-04 22:50:41Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert Docbook documents into TEI files.
- -->
-  <!-- Path to Docbook XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output TEI file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="docbook2tei"
-	    value="../profiles/${profile}/docbook/from.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <target name="dist" depends="convert"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9886 2011-12-04 22:50:41Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert Docbook documents into TEI files. -->
+	<!-- Path to Docbook XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output TEI file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="docbook2tei"
+		value="../profiles/${profile}/docbook/from.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<target name="dist" depends="convert" />
 
-  <target name="convert">
-    <echo level="info">XSLT generate TEI files</echo>
-    <xslt force="yes" style="${docbook2tei}" in="${inputFile}" out="${outputFile}" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
+	<target name="convert">
+		<echo level="info">XSLT generate TEI files</echo>
+		<xslt force="yes" style="${docbook2tei}" in="${inputFile}"
+			out="${outputFile}" classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
 
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/slides-common.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/slides-common.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/slides-common.xsl	(revision 2397)
@@ -1,206 +1,245 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the core module. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module. </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: slides-common.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template match="text()" mode="verbatim">
-      <xsl:choose>
-         <xsl:when test="normalize-space(.)=''">
-            <xsl:for-each select="following-sibling::*[1]">
-               <xsl:call-template name="lineBreak">
-                  <xsl:with-param name="id">7</xsl:with-param>
-               </xsl:call-template>
-               <xsl:call-template name="makeIndent"/>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="wraptext">
-               <xsl:with-param name="indent">
-                  <xsl:for-each select="parent::*">
-                     <xsl:call-template name="makeIndent"/>
-                  </xsl:for-each>
-               </xsl:with-param>
-               <xsl:with-param name="text">
-                  <xsl:value-of select="."/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="wraptext">
-      <xsl:param name="indent"/>
-      <xsl:param name="text"/>
-      <xsl:choose>
-         <xsl:when test="$text='&#xA;'"/>
-         <xsl:when test="contains($text,'&#xA;')">
-            <xsl:value-of select="substring-before($text,'&#xA;')"/>
-            <xsl:call-template name="lineBreak">
-               <xsl:with-param name="id">6</xsl:with-param>
-            </xsl:call-template>
-            <xsl:value-of select="$indent"/>
-            <xsl:call-template name="wraptext">
-               <xsl:with-param name="indent">
-                  <xsl:value-of select="$indent"/>
-               </xsl:with-param>
-               <xsl:with-param name="text">
-                  <xsl:value-of select="substring-after($text,'&#xA;')"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="$text"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="*" mode="verbatim">
-      <xsl:choose>
-         <xsl:when test="not(preceding-sibling::node())">
-            <xsl:call-template name="lineBreak">
-               <xsl:with-param name="id">2</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="makeIndent"/>
-         </xsl:when>
-         <xsl:when test="preceding-sibling::node()[1]/self::*">
-            <xsl:call-template name="lineBreak">
-               <xsl:with-param name="id">1</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="makeIndent"/>
-         </xsl:when>
-         <xsl:when test="preceding-sibling::node()[1]/self::text()">
-    </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="lineBreak">
-               <xsl:with-param name="id">9</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="makeIndent"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>&lt;</xsl:text>
-      <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
-      <xsl:choose>
-         <xsl:when test="namespace-uri()='http://relaxng.org/ns/structure/1.0'">
-            <xsl:text>rng:</xsl:text>
-            <xsl:value-of select="local-name(.)"/>
-         </xsl:when>
-         <xsl:when test="namespace-uri()='http://www.w3.org/1999/XSL/Transform'">
-            <xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-            <xsl:text>xsl:</xsl:text>
-            <xsl:value-of select="local-name(.)"/>
-            <xsl:value-of disable-output-escaping="yes" select="$endNamespace"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="local-name(.)"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-      <xsl:for-each select="@*">
-         <xsl:text>&#160;</xsl:text>
-         <xsl:value-of disable-output-escaping="yes" select="$startAttribute"/>
-         <xsl:if test="namespace-uri()='http://relaxng.org/ns/structure/1.0'">
-            <xsl:text>xml:</xsl:text>
-         </xsl:if>
-         <xsl:value-of select="local-name(.)"/>
-         <xsl:value-of disable-output-escaping="yes" select="$endAttribute"/>
-         <xsl:text>="</xsl:text>
-         <xsl:value-of disable-output-escaping="yes" select="$startAttributeValue"/>
-         <xsl:value-of select="."/>
-         <xsl:value-of disable-output-escaping="yes" select="$endAttributeValue"/>
-         <xsl:text>"</xsl:text>
-      </xsl:for-each>
-      <xsl:choose>
-         <xsl:when test="child::node()">
-            <xsl:text>&gt;</xsl:text>
-            <xsl:apply-templates mode="verbatim"/>
-            <xsl:choose>
-               <xsl:when test="child::node()[last()]/self::text()[normalize-space(.)='']">
-                  <xsl:call-template name="lineBreak">
-                     <xsl:with-param name="id">3</xsl:with-param>
-                  </xsl:call-template>
-                  <xsl:call-template name="makeIndent"/>
-               </xsl:when>
-               <xsl:when test="child::node()[last()]/self::comment()">
-                  <xsl:call-template name="lineBreak">
-                     <xsl:with-param name="id">4</xsl:with-param>
-                  </xsl:call-template>
-                  <xsl:call-template name="makeIndent"/>
-               </xsl:when>
-               <xsl:when test="child::node()[last()]/self::*">
-                  <xsl:call-template name="lineBreak">
-                     <xsl:with-param name="id">5</xsl:with-param>
-                  </xsl:call-template>
-                  <xsl:call-template name="makeIndent"/>
-               </xsl:when>
-            </xsl:choose>
-            <xsl:text>&lt;/</xsl:text>
-            <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
-            <xsl:choose>
-               <xsl:when test="namespace-uri()='http://relaxng.org/ns/structure/1.0'">
-                  <xsl:text>rng:</xsl:text>
-                  <xsl:value-of select="local-name(.)"/>
-               </xsl:when>
-               <xsl:when test="namespace-uri()='http://www.w3.org/1999/XSL/Transform'">
-                  <xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-                  <xsl:text>xsl:</xsl:text>
-                  <xsl:value-of select="local-name(.)"/>
-                  <xsl:value-of disable-output-escaping="yes" select="$endNamesapce"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="local-name(.)"/>
-               </xsl:otherwise>
-            </xsl:choose>
-            <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-            <xsl:text>&gt;</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>/&gt;</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="makeIndent">
-      <xsl:for-each select="ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')]">
-         <xsl:value-of select="$spaceCharacter"/>
-      </xsl:for-each>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: slides-common.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:template match="text()" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="normalize-space(.)=''">
+				<xsl:for-each select="following-sibling::*[1]">
+					<xsl:call-template name="lineBreak">
+						<xsl:with-param name="id">
+							7
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:call-template name="makeIndent" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="wraptext">
+					<xsl:with-param name="indent">
+						<xsl:for-each select="parent::*">
+							<xsl:call-template name="makeIndent" />
+						</xsl:for-each>
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of select="." />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="wraptext">
+		<xsl:param name="indent" />
+		<xsl:param name="text" />
+		<xsl:choose>
+			<xsl:when test="$text='&#xA;'" />
+			<xsl:when test="contains($text,'&#xA;')">
+				<xsl:value-of select="substring-before($text,'&#xA;')" />
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						6
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of select="$indent" />
+				<xsl:call-template name="wraptext">
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of select="substring-after($text,'&#xA;')" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$text" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="*" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="not(preceding-sibling::node())">
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						2
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="makeIndent" />
+			</xsl:when>
+			<xsl:when test="preceding-sibling::node()[1]/self::*">
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						1
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="makeIndent" />
+			</xsl:when>
+			<xsl:when test="preceding-sibling::node()[1]/self::text()">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						9
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="makeIndent" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>&lt;</xsl:text>
+		<xsl:value-of disable-output-escaping="yes"
+			select="$startElement" />
+		<xsl:choose>
+			<xsl:when
+				test="namespace-uri()='http://relaxng.org/ns/structure/1.0'">
+				<xsl:text>rng:</xsl:text>
+				<xsl:value-of select="local-name(.)" />
+			</xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/1999/XSL/Transform'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>xsl:</xsl:text>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="local-name(.)" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:value-of disable-output-escaping="yes"
+			select="$endElement" />
+		<xsl:for-each select="@*">
+			<xsl:text>&#160;</xsl:text>
+			<xsl:value-of disable-output-escaping="yes"
+				select="$startAttribute" />
+			<xsl:if
+				test="namespace-uri()='http://relaxng.org/ns/structure/1.0'">
+				<xsl:text>xml:</xsl:text>
+			</xsl:if>
+			<xsl:value-of select="local-name(.)" />
+			<xsl:value-of disable-output-escaping="yes"
+				select="$endAttribute" />
+			<xsl:text>="</xsl:text>
+			<xsl:value-of disable-output-escaping="yes"
+				select="$startAttributeValue" />
+			<xsl:value-of select="." />
+			<xsl:value-of disable-output-escaping="yes"
+				select="$endAttributeValue" />
+			<xsl:text>"</xsl:text>
+		</xsl:for-each>
+		<xsl:choose>
+			<xsl:when test="child::node()">
+				<xsl:text>&gt;</xsl:text>
+				<xsl:apply-templates mode="verbatim" />
+				<xsl:choose>
+					<xsl:when
+						test="child::node()[last()]/self::text()[normalize-space(.)='']">
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								3
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="makeIndent" />
+					</xsl:when>
+					<xsl:when test="child::node()[last()]/self::comment()">
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								4
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="makeIndent" />
+					</xsl:when>
+					<xsl:when test="child::node()[last()]/self::*">
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								5
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="makeIndent" />
+					</xsl:when>
+				</xsl:choose>
+				<xsl:text>&lt;/</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElement" />
+				<xsl:choose>
+					<xsl:when
+						test="namespace-uri()='http://relaxng.org/ns/structure/1.0'">
+						<xsl:text>rng:</xsl:text>
+						<xsl:value-of select="local-name(.)" />
+					</xsl:when>
+					<xsl:when
+						test="namespace-uri()='http://www.w3.org/1999/XSL/Transform'">
+						<xsl:value-of disable-output-escaping="yes"
+							select="$startNamespace" />
+						<xsl:text>xsl:</xsl:text>
+						<xsl:value-of select="local-name(.)" />
+						<xsl:value-of disable-output-escaping="yes"
+							select="$endNamesapce" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="local-name(.)" />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+				<xsl:text>&gt;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>/&gt;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="makeIndent">
+		<xsl:for-each
+			select="ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')]">
+			<xsl:value-of select="$spaceCharacter" />
+		</xsl:for-each>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teilatex-slides.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teilatex-slides.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teilatex-slides.xsl	(revision 2397)
@@ -1,392 +1,435 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-This software is dual-licensed:
+<!-- This software is dual-licensed: 1. Distributed under a Creative Commons 
+	Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution 
+	and use in source and binary forms, with or without modification, are permitted 
+	provided that the following conditions are met: * Redistributions of source 
+	code must retain the above copyright notice, this list of conditions and 
+	the following disclaimer. * Redistributions in binary form must reproduce 
+	the above copyright notice, this list of conditions and the following disclaimer 
+	in the documentation and/or other materials provided with the distribution. 
+	This software is provided by the copyright holders and contributors "as is" 
+	and any express or implied warranties, including, but not limited to, the 
+	implied warranties of merchantability and fitness for a particular purpose 
+	are disclaimed. In no event shall the copyright holder or contributors be 
+	liable for any direct, indirect, incidental, special, exemplary, or consequential 
+	damages (including, but not limited to, procurement of substitute goods or 
+	services; loss of use, data, or profits; or business interruption) however 
+	caused and on any theory of liability, whether in contract, strict liability, 
+	or tort (including negligence or otherwise) arising in any way out of the 
+	use of this software, even if advised of the possibility of such damage. -->
+<!-- TEI XSLT stylesheet family $Date: 2011-11-07 19:17:54 +0000 (Mon, 07 
+	Nov 2011) $, $Revision: 9669 $, $Author: rahtz $ XSL LaTeX stylesheet to 
+	make slides -->
+<xsl:stylesheet
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	xmlns:atom="http://www.w3.org/2005/Atom"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:map="http://apache.org/cocoon/sitemap/1.0"
+	exclude-result-prefixes="a s map atom xhtml teix tei xsl rng"
+	version="2.0">
+	<xsl:import href="../latex2/tei.xsl" />
+	<xsl:strip-space
+		elements="teix:* rng:* xsl:* xhtml:* atom:*" />
+	<xsl:output method="text" encoding="utf-8" />
+	<xsl:variable name="docClass">
+		beamer
+	</xsl:variable>
+	<xsl:param name="startNamespace">
+		\color{black}
+	</xsl:param>
+	<xsl:param name="startElement">
+		{\color{blue}
+	</xsl:param>
+	<xsl:param name="startElementName">
+		\textbf{\color{blue}
+	</xsl:param>
+	<xsl:param name="startAttribute">
+		{\color{blue}
+	</xsl:param>
+	<xsl:param name="startAttributeValue">
+		{\color{blue}
+	</xsl:param>
+	<xsl:param name="startComment">
+		\textit{
+	</xsl:param>
+	<xsl:param name="endElement">
+		}
+	</xsl:param>
+	<xsl:param name="endElementName">
+		}
+	</xsl:param>
+	<xsl:param name="endComment">
+		}
+	</xsl:param>
+	<xsl:param name="endAttribute">
+		}
+	</xsl:param>
+	<xsl:param name="endAttributeValue">
+		}
+	</xsl:param>
+	<xsl:param name="endNamespace" />
+	<xsl:param name="spaceCharacter">
+		\hspace*{1em}
+	</xsl:param>
+	<xsl:param name="classParameters" />
+	<xsl:param name="beamerClass">
+		PaloAlto
+	</xsl:param>
+	<xsl:param name="pause">
+		true
+	</xsl:param>
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:template name="verbatim-lineBreak">
+		<xsl:param name="id" />
+		<xsl:text>\mbox{}\newline &#10;</xsl:text>
+	</xsl:template>
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<xsl:template name="latexPackages">
+		\usepackage{framed}
+		\definecolor{shadecolor}{gray}{0.95}
+		\usepackage{colortbl}
+		\usepackage{longtable}
+		\usetheme{
+		<xsl:value-of select="$beamerClass" />
+		}
+		\usepackage{times}
+		\usepackage{fancyvrb}
+		\usepackage{fancyhdr}
+		\def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}
+		\setbeamercovered{transparent}
+		\let\mainmatter\relax
+		\let\frontmatter\relax
+		\let\backmatter\relax
+		\let\endfoot\relax
+		\let\endlastfoot\relax
+	</xsl:template>
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<xsl:template name="latexBegin" />
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+	<xsl:template name="latexLayout">
+		\date{
+		<xsl:value-of
+			select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition/tei:date" />
+		}
+		\institute{
+		<xsl:apply-templates
+			select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:authority" />
+		}
+		<xsl:if test="not($latexLogo='')">
+			<xsl:text>\pgfdeclareimage[height=1cm]{logo}{</xsl:text>
+			<xsl:choose>
+				<xsl:when test="$realFigures='true'">
+					<xsl:value-of select="$latexLogo" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>FIG0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>}</xsl:text>
+			\logo{\pgfuseimage{logo}}
+		</xsl:if>
+	</xsl:template>
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+	<xsl:template
+		match="tei:authority/tei:address/tei:addrLine">
+		\newline
+		<xsl:apply-templates />
+	</xsl:template>
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
--->
-<!-- 
-TEI XSLT stylesheet family
-$Date: 2011-11-07 19:17:54 +0000 (Mon, 07 Nov 2011) $, $Revision: 9669 $, $Author: rahtz $
+	<xsl:template name="printTitleAndLogo">
+		\frame{\maketitle}
+	</xsl:template>
 
-XSL LaTeX stylesheet to make slides
+	<xsl:template match="tei:divGen[@type='toc']">
+		\begin{frame}
+		\frametitle{Outline}
+		\tableofcontents
+		\end{frame}
+	</xsl:template>
 
-   
---><xsl:stylesheet xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:atom="http://www.w3.org/2005/Atom"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:s="http://www.ascc.net/xml/schematron"
-                xmlns:map="http://apache.org/cocoon/sitemap/1.0"
-                exclude-result-prefixes="a s map atom xhtml teix tei xsl rng"
-                version="2.0">
-  <xsl:import href="../latex2/tei.xsl"/>
-  <xsl:strip-space elements="teix:* rng:* xsl:* xhtml:* atom:*"/>
-  <xsl:output method="text" encoding="utf-8"/>
-  <xsl:variable name="docClass">beamer</xsl:variable>
-  <xsl:param name="startNamespace">\color{black}</xsl:param>
-  <xsl:param name="startElement">{\color{blue}</xsl:param>
-  <xsl:param name="startElementName">\textbf{\color{blue}</xsl:param>
-  <xsl:param name="startAttribute">{\color{blue}</xsl:param>
-  <xsl:param name="startAttributeValue">{\color{blue}</xsl:param>
-  <xsl:param name="startComment">\textit{</xsl:param>
-  <xsl:param name="endElement">}</xsl:param>
-  <xsl:param name="endElementName">}</xsl:param>
-  <xsl:param name="endComment">}</xsl:param>
-  <xsl:param name="endAttribute">}</xsl:param>
-  <xsl:param name="endAttributeValue">}</xsl:param>
-  <xsl:param name="endNamespace"/>
-  <xsl:param name="spaceCharacter">\hspace*{1em}</xsl:param>
-  <xsl:param name="classParameters"/>
-  <xsl:param name="beamerClass">PaloAlto</xsl:param>
-  <xsl:param name="pause">true</xsl:param>
+	<xsl:template match="tei:div/tei:head" />
+	<xsl:template match="tei:div1/tei:head" />
+	<xsl:template match="tei:div2/tei:head" />
 
-  <xsl:template name="verbatim-lineBreak">
-      <xsl:param name="id"/>
-      <xsl:text>\mbox{}\newline &#10;</xsl:text>
-  </xsl:template>
+	<xsl:template match="tei:div1">
+		<xsl:choose>
+			<xsl:when test="tei:div2">
+				<xsl:call-template name="makeOuterFrame" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="makeFrame" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="latexPackages">
-\usepackage{framed}
-\definecolor{shadecolor}{gray}{0.95}
-\usepackage{colortbl}
-\usepackage{longtable}
-\usetheme{<xsl:value-of select="$beamerClass"/>}
-\usepackage{times}
-\usepackage{fancyvrb}
-\usepackage{fancyhdr}
-\def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}
-\setbeamercovered{transparent}
-\let\mainmatter\relax
-\let\frontmatter\relax
-\let\backmatter\relax
-\let\endfoot\relax
-\let\endlastfoot\relax
-</xsl:template>
+	<xsl:template match="tei:div2|tei:div3">
+		<xsl:call-template name="makeFrame" />
+	</xsl:template>
 
-   <xsl:template name="latexBegin"/>
+	<xsl:template match="tei:div">
+		<xsl:choose>
+			<xsl:when test="tei:div and parent::tei:body">
+				<xsl:call-template name="makeOuterFrame" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="makeFrame" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="latexLayout">
-\date{<xsl:value-of select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition/tei:date"/>}
-\institute{<xsl:apply-templates select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:authority"/>}
-<xsl:if test="not($latexLogo='')">
-         <xsl:text>\pgfdeclareimage[height=1cm]{logo}{</xsl:text>
-         <xsl:choose>
-            <xsl:when test="$realFigures='true'">
-               <xsl:value-of select="$latexLogo"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:text>FIG0</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-         <xsl:text>}</xsl:text>
-\logo{\pgfuseimage{logo}}
-</xsl:if>
-   </xsl:template>
+	<xsl:template name="makeOuterFrame">
+		<xsl:text>&#10;\section{</xsl:text>
+		<xsl:for-each select="tei:head">
+			<xsl:apply-templates />
+		</xsl:for-each>
+		<xsl:text>}</xsl:text>
+		<xsl:text>&#10;\begin{frame}&#10;\frametitle{</xsl:text>
+		<xsl:for-each select="tei:head">
+			<xsl:apply-templates />
+		</xsl:for-each>
+		<xsl:text>}</xsl:text>
+		<xsl:choose>
+			<xsl:when
+				test="tei:*[not(starts-with(local-name(.),'div'))]">
+				<xsl:apply-templates
+					select="tei:*[not(starts-with(local-name(.),'div'))]" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>{\Huge…}</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>&#10;\end{frame}&#10;</xsl:text>
+		<xsl:apply-templates
+			select="tei:div1|tei:div2|tei:div" />
+	</xsl:template>
 
-   <xsl:template match="tei:authority/tei:address/tei:addrLine">
- \newline <xsl:apply-templates/>
-   </xsl:template> 
+	<xsl:template name="makeFrame">
+		<xsl:text>&#10;\begin{frame}</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@rend='fragile'">
+				<xsl:text>[fragile]</xsl:text>
+			</xsl:when>
+			<xsl:when test=".//tei:eg">
+				<xsl:text>[fragile]</xsl:text>
+			</xsl:when>
+			<xsl:when test=".//tei:Output">
+				<xsl:text>[fragile]</xsl:text>
+			</xsl:when>
+			<xsl:when test=".//tei:Screen">
+				<xsl:text>[fragile]</xsl:text>
+			</xsl:when>
+			<xsl:when test=".//teix:egXML">
+				<xsl:text>[fragile]</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:text>&#10;\frametitle{</xsl:text>
+		<xsl:for-each select="tei:head">
+			<xsl:apply-templates />
+		</xsl:for-each>
+		<xsl:text>}</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>&#10;\end{frame}&#10;</xsl:text>
+	</xsl:template>
 
-   <xsl:template name="printTitleAndLogo">
-     \frame{\maketitle}
-   </xsl:template>
+	<xsl:template name="makePic">
+		<xsl:if test="@xml:id">
+			<xsl:text>\hypertarget{</xsl:text>
+			<xsl:value-of select="@xml:id" />
+			<xsl:text>}{}</xsl:text>
+		</xsl:if>
+		<xsl:if test="@rend='centre'">
+			<xsl:text>\centerline{</xsl:text>
+		</xsl:if>
+		<xsl:text>\includegraphics[</xsl:text>
+		<xsl:call-template name="graphicsAttributes">
+			<xsl:with-param name="mode">
+				latex
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:if test="not(@width) and not (@height) and not(@scale)">
+			<xsl:text>width=\textwidth</xsl:text>
+		</xsl:if>
+		<xsl:text>]{</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@url">
+				<xsl:value-of select="@url" />
+			</xsl:when>
+			<xsl:when test="@entity">
+				<xsl:value-of select="unparsed-entity-uri(@entity)" />
+			</xsl:when>
+		</xsl:choose>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="@rend='centre'">
+			<xsl:text>}</xsl:text>
+		</xsl:if>
+	</xsl:template>
 
-   <xsl:template match="tei:divGen[@type='toc']">
-  \begin{frame} 
-  \frametitle{Outline} 
-  \tableofcontents
-  \end{frame}
-</xsl:template>
+	<xsl:template match="tei:hi[not(@rend)]">
+		<xsl:text>\alert{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-   <xsl:template match="tei:div/tei:head"/>
-   <xsl:template match="tei:div1/tei:head"/>
-   <xsl:template match="tei:div2/tei:head"/>
+	<xsl:template
+		match="tei:item[@rend='pause' or parent::tei:list/@rend='pause']">
+		<xsl:if test="$pause='true'">
+			<xsl:text>\pause </xsl:text>
+		</xsl:if>
+		<xsl:text>\item </xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:div1">
-      <xsl:choose>
-         <xsl:when test="tei:div2">
-            <xsl:call-template name="makeOuterFrame"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="makeFrame"/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="tei:eg">
+		<xsl:text>\begin{Verbatim}[fontsize=\scriptsize,frame=single,fillcolor=\color{yellow}]&#10;</xsl:text>
+		<xsl:apply-templates mode="eg" />
+		<xsl:text>\end{Verbatim}&#10;</xsl:text>
+	</xsl:template>
 
-   <xsl:template match="tei:div2|tei:div3">
-      <xsl:call-template name="makeFrame"/>
-   </xsl:template>
+	<xsl:template match="text()" mode="eg">
+		<xsl:choose>
+			<xsl:when test="starts-with(.,'&#xA;')">
+				<xsl:value-of select="substring-after(.,'&#xA;')" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:div">
-      <xsl:choose>
-         <xsl:when test="tei:div and parent::tei:body">
-            <xsl:call-template name="makeOuterFrame"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="makeFrame"/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="teix:egXML">
+		<xsl:param name="simple">
+			false
+		</xsl:param>
+		<xsl:param name="highlight" />
+		<xsl:variable name="fontsize">
+			<xsl:choose>
+				<xsl:when test="@rend='teeny'">
+					<xsl:text>{5.5pt}{6pt}</xsl:text>
+				</xsl:when>
+				<xsl:when test="@rend='tiny'">
+					<xsl:text>{6.5pt}{7pt}</xsl:text>
+				</xsl:when>
+				<xsl:when test="@rend='small'">
+					<xsl:text>{7pt}{8pt}</xsl:text>
+				</xsl:when>
+				<xsl:when test="@rend='smaller'">
+					<xsl:text>{7.5pt}{8pt}</xsl:text>
+				</xsl:when>
+				<xsl:when test="@rend='larger'">
+					<xsl:text>{9.5pt}{10.5pt}</xsl:text>
+				</xsl:when>
+				<xsl:when test="@rend='large'">
+					<xsl:text>{10.5pt}{11.5pt}</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>{8.5pt}{9pt}</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		\bgroup\ttfamily\fontsize
+		<xsl:value-of select="$fontsize" />
+		\selectfont\par
+		\begin{exampleblock}{}
+		<xsl:text>\noindent\ttfamily\mbox{}</xsl:text>
+		<xsl:apply-templates mode="verbatim">
+			<xsl:with-param name="highlight">
+				<xsl:value-of select="$highlight" />
+			</xsl:with-param>
+		</xsl:apply-templates>
+		\end{exampleblock}
+		\par\egroup
+	</xsl:template>
 
-   <xsl:template name="makeOuterFrame">
-      <xsl:text>&#10;\section{</xsl:text>
-      <xsl:for-each select="tei:head">
-         <xsl:apply-templates/>
-      </xsl:for-each>
-      <xsl:text>}</xsl:text>
-      <xsl:text>&#10;\begin{frame}&#10;\frametitle{</xsl:text>
-      <xsl:for-each select="tei:head">
-         <xsl:apply-templates/>
-      </xsl:for-each>
-      <xsl:text>}</xsl:text>
-      <xsl:choose>
-	        <xsl:when test="tei:*[not(starts-with(local-name(.),'div'))]">
-	           <xsl:apply-templates select="tei:*[not(starts-with(local-name(.),'div'))]"/>
-	        </xsl:when>
-	        <xsl:otherwise>
-	           <xsl:text>{\Huge…}</xsl:text>
-	        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>&#10;\end{frame}&#10;</xsl:text>
-      <xsl:apply-templates select="tei:div1|tei:div2|tei:div"/>
-  </xsl:template>
+	<xsl:template match="tei:p[@rend='box']">
+		<xsl:text>\par\begin{exampleblock}{}&#10;</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>\end{exampleblock}\par&#10;</xsl:text>
+	</xsl:template>
 
-   <xsl:template name="makeFrame">
-      <xsl:text>&#10;\begin{frame}</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@rend='fragile'">
-            <xsl:text>[fragile]</xsl:text>
-         </xsl:when>
-         <xsl:when test=".//tei:eg">
-            <xsl:text>[fragile]</xsl:text>
-         </xsl:when>
-         <xsl:when test=".//tei:Output">
-            <xsl:text>[fragile]</xsl:text>
-         </xsl:when>
-         <xsl:when test=".//tei:Screen">
-            <xsl:text>[fragile]</xsl:text>
-         </xsl:when>
-         <xsl:when test=".//teix:egXML">
-            <xsl:text>[fragile]</xsl:text>
-         </xsl:when>
-      </xsl:choose>
-      <xsl:text>&#10;\frametitle{</xsl:text>
-      <xsl:for-each select="tei:head">
-         <xsl:apply-templates/>
-      </xsl:for-each>
-      <xsl:text>}</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>&#10;\end{frame}&#10;</xsl:text>
-   </xsl:template>
 
-   <xsl:template name="makePic">
-      <xsl:if test="@xml:id">
-         <xsl:text>\hypertarget{</xsl:text>
-         <xsl:value-of select="@xml:id"/>
-         <xsl:text>}{}</xsl:text>
-      </xsl:if>
-      <xsl:if test="@rend='centre'">
-         <xsl:text>\centerline{</xsl:text>
-      </xsl:if>
-      <xsl:text>\includegraphics[</xsl:text>
-      <xsl:call-template name="graphicsAttributes">
-         <xsl:with-param name="mode">latex</xsl:with-param>
-      </xsl:call-template>
-      <xsl:if test="not(@width) and not (@height) and not(@scale)">
-         <xsl:text>width=\textwidth</xsl:text>
-      </xsl:if>
-      <xsl:text>]{</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@url">
-            <xsl:value-of select="@url"/>
-         </xsl:when>
-         <xsl:when test="@entity">
-            <xsl:value-of select="unparsed-entity-uri(@entity)"/>
-         </xsl:when>
-      </xsl:choose>
-      <xsl:text>}</xsl:text>
-      <xsl:if test="@rend='centre'">
-         <xsl:text>}</xsl:text>
-      </xsl:if>
-   </xsl:template>
-
-   <xsl:template match="tei:hi[not(@rend)]">
-      <xsl:text>\alert{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-   </xsl:template>
-
-   <xsl:template match="tei:item[@rend='pause' or parent::tei:list/@rend='pause']">
-      <xsl:if test="$pause='true'">
-         <xsl:text>\pause </xsl:text>
-      </xsl:if>
-      <xsl:text>\item </xsl:text>
-      <xsl:apply-templates/>
-   </xsl:template>
-
-   <xsl:template match="tei:eg">
-      <xsl:text>\begin{Verbatim}[fontsize=\scriptsize,frame=single,fillcolor=\color{yellow}]&#10;</xsl:text>
-      <xsl:apply-templates mode="eg"/>
-      <xsl:text>\end{Verbatim}&#10;</xsl:text>
-   </xsl:template>
-
-  <xsl:template match="text()" mode="eg">
-      <xsl:choose>
-         <xsl:when test="starts-with(.,'&#xA;')">
-            <xsl:value-of select="substring-after(.,'&#xA;')"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="."/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-
-  <xsl:template match="teix:egXML">
-      <xsl:param name="simple">false</xsl:param>
-      <xsl:param name="highlight"/>
-      <xsl:variable name="fontsize">
-         <xsl:choose>
-            <xsl:when test="@rend='teeny'">
-	              <xsl:text>{5.5pt}{6pt}</xsl:text>
-            </xsl:when>
-            <xsl:when test="@rend='tiny'">
-	              <xsl:text>{6.5pt}{7pt}</xsl:text>
-            </xsl:when>
-            <xsl:when test="@rend='small'">
-	              <xsl:text>{7pt}{8pt}</xsl:text>
-            </xsl:when>
-            <xsl:when test="@rend='smaller'">
-	              <xsl:text>{7.5pt}{8pt}</xsl:text>
-            </xsl:when>
-            <xsl:when test="@rend='larger'">
-	              <xsl:text>{9.5pt}{10.5pt}</xsl:text>
-            </xsl:when>
-            <xsl:when test="@rend='large'">
-	              <xsl:text>{10.5pt}{11.5pt}</xsl:text>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:text>{8.5pt}{9pt}</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-\bgroup\ttfamily\fontsize<xsl:value-of select="$fontsize"/>\selectfont\par
-\begin{exampleblock}{}
-<xsl:text>\noindent\ttfamily\mbox{}</xsl:text>
-      <xsl:apply-templates mode="verbatim">
-         <xsl:with-param name="highlight">
-            <xsl:value-of select="$highlight"/>
-         </xsl:with-param>
-      </xsl:apply-templates>
-\end{exampleblock}
-\par\egroup
-  </xsl:template>
-
-  <xsl:template match="tei:p[@rend='box']">
-      <xsl:text>\par\begin{exampleblock}{}&#10;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>\end{exampleblock}\par&#10;</xsl:text>
-  </xsl:template>
-
-
-   <xsl:template match="tei:table">
-      <xsl:text>\par  
+	<xsl:template match="tei:table">
+		<xsl:text>\par  
   \begin{scriptsize}
   \begin{longtable}</xsl:text>
-      <xsl:call-template name="makeTable"/>
-      <xsl:text>\end{longtable}
+		<xsl:call-template name="makeTable" />
+		<xsl:text>\end{longtable}
   \end{scriptsize}</xsl:text>
-   </xsl:template>
+	</xsl:template>
 
-  <xsl:template name="makeFigureStart">
-    \noindent
-  </xsl:template>
+	<xsl:template name="makeFigureStart">
+		\noindent
+	</xsl:template>
 
-  <xsl:template name="makeFigureEnd">
-      <xsl:choose>
-         <xsl:when test="tei:head">
-            <xsl:text>&#10;\par\noindent\textit{</xsl:text>
-            <xsl:if test="@xml:id">\label{<xsl:value-of select="@xml:id"/>}</xsl:if>
-            <xsl:for-each select="tei:head">
-	      <xsl:apply-templates/>
-	    </xsl:for-each>
-            <xsl:text>}\par</xsl:text>
-         </xsl:when>
-      </xsl:choose>
+	<xsl:template name="makeFigureEnd">
+		<xsl:choose>
+			<xsl:when test="tei:head">
+				<xsl:text>&#10;\par\noindent\textit{</xsl:text>
+				<xsl:if test="@xml:id">
+					\label{
+					<xsl:value-of select="@xml:id" />
+					}
+				</xsl:if>
+				<xsl:for-each select="tei:head">
+					<xsl:apply-templates />
+				</xsl:for-each>
+				<xsl:text>}\par</xsl:text>
+			</xsl:when>
+		</xsl:choose>
 
-  </xsl:template>
+	</xsl:template>
 
-   <xsl:template name="tableHline">
-      <xsl:text> \hline </xsl:text>
-   </xsl:template>
+	<xsl:template name="tableHline">
+		<xsl:text> \hline </xsl:text>
+	</xsl:template>
 
-   <xsl:template match="tei:att">
-      <xsl:text>\emph{@</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
+	<xsl:template match="tei:att">
+		<xsl:text>\emph{@</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
 
-   </xsl:template>
+	</xsl:template>
 
 
-  <xsl:template name="Text">
-      <xsl:param name="words"/>
-      <xsl:analyze-string select="$words" regex="(&amp;)">
-	<xsl:matching-substring>
-            <xsl:text>&amp;amp;</xsl:text>
-	</xsl:matching-substring>
-	<xsl:non-matching-substring>
-	  <xsl:value-of select="tei:escapeChars(.)"/>
-	</xsl:non-matching-substring>
-      </xsl:analyze-string>
-  </xsl:template>
+	<xsl:template name="Text">
+		<xsl:param name="words" />
+		<xsl:analyze-string select="$words" regex="(&amp;)">
+			<xsl:matching-substring>
+				<xsl:text>&amp;amp;</xsl:text>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:value-of select="tei:escapeChars(.)" />
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
 
 
-   <xsl:template match="@*" mode="attributetext">
-      <xsl:choose>
-         <xsl:when test="string-length(.)&gt;$attLength and contains(.,' ')">
-            <xsl:call-template name="verbatim-reformatText">
-	              <xsl:with-param name="sofar">0</xsl:with-param>
-	              <xsl:with-param name="indent">
-	                 <xsl:text> </xsl:text>
-	              </xsl:with-param>
-	              <xsl:with-param name="text">
-	                 <xsl:value-of select="normalize-space(tei:escapeChars(.))"/>
-	              </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-	           <xsl:value-of select="tei:escapeChars(.)"/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="@*" mode="attributetext">
+		<xsl:choose>
+			<xsl:when
+				test="string-length(.)&gt;$attLength and contains(.,' ')">
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="sofar">
+						0
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of
+							select="normalize-space(tei:escapeChars(.))" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="tei:escapeChars(.)" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teihtml-slides.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teihtml-slides.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teihtml-slides.xsl	(revision 2397)
@@ -1,299 +1,362 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
-		xmlns:atom="http://www.w3.org/2005/Atom"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xlink="http://www.w3.org/1999/xlink"
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:xhtml="http://www.w3.org/1999/xhtml"
-                exclude-result-prefixes="tei xlink xhtml m"
-                version="2.0">
-  <xsl:import href="../xhtml2/tei.xsl"/>
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:atom="http://www.w3.org/2005/Atom"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	exclude-result-prefixes="tei xlink xhtml m" version="2.0">
+	<xsl:import href="../xhtml2/tei.xsl" />
 
-  <xsl:strip-space elements="teix:* rng:* xsl:* xhtml:* atom:* m:*"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-      TEI stylesheet for making HTML presentations from TEI documents
-      </p>
-         <p>This software is dual-licensed:
+	<xsl:strip-space
+		elements="teix:* rng:* xsl:* xhtml:* atom:* m:*" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet for making HTML presentations from TEI documents
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: teihtml-slides.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:output encoding="utf-8" method="xml" doctype-public="-//W3C//DTD XHTML 1.1//EN"/>
-  <xsl:param name="outputEncoding">utf-8</xsl:param>
-  <xsl:param name="outputMethod">xml</xsl:param>
-  <xsl:param name="outputSuffix">.xhtml</xsl:param>
-  <xsl:param name="doctypePublic">-//W3C//DTD XHTML 1.1//EN</xsl:param>
-  <xsl:param name="doctypeSystem">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</xsl:param>
-  <xsl:param name="cssFile">http://www.tei-c.org/stylesheet/teislides.css</xsl:param>
-  <xsl:param name="logoFile">logo.png</xsl:param>
-  <xsl:param name="logoWidth">60</xsl:param>
-  <xsl:param name="logoHeight">60</xsl:param>
-  <xsl:param name="spaceCharacter">&#160;</xsl:param>
-  <xsl:template name="lineBreak">
-      <xsl:param name="id"/>
-      <xhtml:br/>
-  </xsl:template>
-   <!--
-<xsl:text>(</xsl:text>
-<xsl:value-of select="$id"/>
-<xsl:text>)</xsl:text>
--->
-  <xsl:param name="numberHeadings"/>
-  <xsl:param name="splitLevel">0</xsl:param>
-  <xsl:param name="STDOUT">false</xsl:param>
-  <xsl:param name="subTocDepth">-1</xsl:param>
-  <xsl:param name="topNavigationPanel"/>
-  <xsl:param name="bottomNavigationPanel">true</xsl:param>
-  <xsl:param name="linkPanel"/>
-  <xsl:template name="copyrightStatement"/>
-  <xsl:param name="makingSlides">true</xsl:param>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template match="tei:div" mode="number">
-      <xsl:number level="any"/>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: teihtml-slides.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output encoding="utf-8" method="xml"
+		doctype-public="-//W3C//DTD XHTML 1.1//EN" />
+	<xsl:param name="outputEncoding">
+		utf-8
+	</xsl:param>
+	<xsl:param name="outputMethod">
+		xml
+	</xsl:param>
+	<xsl:param name="outputSuffix">
+		.xhtml
+	</xsl:param>
+	<xsl:param name="doctypePublic">
+		-//W3C//DTD XHTML 1.1//EN
+	</xsl:param>
+	<xsl:param name="doctypeSystem">
+		http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
+	</xsl:param>
+	<xsl:param name="cssFile">
+		http://www.tei-c.org/stylesheet/teislides.css
+	</xsl:param>
+	<xsl:param name="logoFile">
+		logo.png
+	</xsl:param>
+	<xsl:param name="logoWidth">
+		60
+	</xsl:param>
+	<xsl:param name="logoHeight">
+		60
+	</xsl:param>
+	<xsl:param name="spaceCharacter">
+		&#160;
+	</xsl:param>
+	<xsl:template name="lineBreak">
+		<xsl:param name="id" />
+		<xhtml:br />
+	</xsl:template>
+	<!-- <xsl:text>(</xsl:text> <xsl:value-of select="$id"/> <xsl:text>)</xsl:text> -->
+	<xsl:param name="numberHeadings" />
+	<xsl:param name="splitLevel">
+		0
+	</xsl:param>
+	<xsl:param name="STDOUT">
+		false
+	</xsl:param>
+	<xsl:param name="subTocDepth">
+		-1
+	</xsl:param>
+	<xsl:param name="topNavigationPanel" />
+	<xsl:param name="bottomNavigationPanel">
+		true
+	</xsl:param>
+	<xsl:param name="linkPanel" />
+	<xsl:template name="copyrightStatement" />
+	<xsl:param name="makingSlides">
+		true
+	</xsl:param>
 
+	<xsl:template match="tei:div" mode="number">
+		<xsl:number level="any" />
+	</xsl:template>
 
-  <xsl:template name="locateParentDiv">
-    <xsl:choose>
-      <xsl:when test="ancestor-or-self::tei:div">
-	<xsl:apply-templates mode="genid" select="ancestor::tei:div[last()]"/>
-      </xsl:when>
-      <xsl:when test="ancestor-or-self::tei:div1">
-	<xsl:apply-templates mode="genid" select="ancestor::tei:div1"/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
 
-  <xsl:template match="tei:*" mode="genid">
-    <xsl:value-of select="$masterFile"/>
-    <xsl:apply-templates select="ancestor-or-self::tei:div1|ancestor-or-self::tei:div[1]" mode="number"/>
-  </xsl:template>
+	<xsl:template name="locateParentDiv">
+		<xsl:choose>
+			<xsl:when test="ancestor-or-self::tei:div">
+				<xsl:apply-templates mode="genid"
+					select="ancestor::tei:div[last()]" />
+			</xsl:when>
+			<xsl:when test="ancestor-or-self::tei:div1">
+				<xsl:apply-templates mode="genid"
+					select="ancestor::tei:div1" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:docAuthor">
-      <div class="docAuthor">
-         <xsl:apply-templates/>
-      </div>
-  </xsl:template>
+	<xsl:template match="tei:*" mode="genid">
+		<xsl:value-of select="$masterFile" />
+		<xsl:apply-templates
+			select="ancestor-or-self::tei:div1|ancestor-or-self::tei:div[1]"
+			mode="number" />
+	</xsl:template>
 
-  <xsl:template match="tei:docDate">
-      <div class="docDate">
-         <xsl:apply-templates/>
-      </div>
-  </xsl:template>
+	<xsl:template match="tei:docAuthor">
+		<div class="docAuthor">
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
 
-  <xsl:template match="/tei:TEI">
-      <xsl:param name="slidenum">
-         <xsl:value-of select="$masterFile"/>0</xsl:param>
+	<xsl:template match="tei:docDate">
+		<div class="docDate">
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
 
-      <xsl:variable name="outName">
-         <xsl:call-template name="outputChunkName">
-	           <xsl:with-param name="ident">
-	              <xsl:value-of select="$slidenum"/>
-	           </xsl:with-param>
-         </xsl:call-template>
-      </xsl:variable>
+	<xsl:template match="/tei:TEI">
+		<xsl:param name="slidenum">
+			<xsl:value-of select="$masterFile" />
+			0
+		</xsl:param>
 
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Opening file <xsl:value-of select="$outName"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
-                           encoding="{$outputEncoding}"
-                           href="{$outName}"
-                           method="{$outputMethod}">
-         <xsl:call-template name="mainslide"/>
-      </xsl:result-document>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Closing file <xsl:value-of select="$outName"/>
-         </xsl:message>
-      </xsl:if>
+		<xsl:variable name="outName">
+			<xsl:call-template name="outputChunkName">
+				<xsl:with-param name="ident">
+					<xsl:value-of select="$slidenum" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
 
-      <xsl:for-each select="tei:text/tei:body">
-         <xsl:apply-templates select="tei:div|tei:div1"/>
-      </xsl:for-each>
-  </xsl:template>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Opening file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+			encoding="{$outputEncoding}" href="{$outName}"
+			method="{$outputMethod}">
+			<xsl:call-template name="mainslide" />
+		</xsl:result-document>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Closing file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
 
-  <xsl:template name="xrefpanel">
-      <xsl:param name="homepage"/>
-      <xsl:param name="mode"/>
-      <xsl:variable name="first">
-         <xsl:value-of select="$masterFile"/>0</xsl:variable>
-      <xsl:variable name="prev">
-         <xsl:choose>
-            <xsl:when test="preceding-sibling::tei:div">
-               <xsl:apply-templates select="preceding-sibling::tei:div[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:when test="preceding::tei:div">
-               <xsl:apply-templates select="preceding::tei:div[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:when test="preceding::tei:div1">
-               <xsl:apply-templates select="preceding::tei:div1[1]" mode="genid"/>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:if test="not($prev='')">
-         <a class="xreflink" accesskey="p" href="{concat($prev,$outputSuffix)}">
-            <span class="button">«</span>
-         </a>
-      </xsl:if>
-      <xsl:text>  </xsl:text>
-      <a class="xreflink" accesskey="f" href="{concat($first,$outputSuffix)}">
-         <span class="button">^</span>
-      </a>
-      <xsl:variable name="next">
-         <xsl:choose>
-            <xsl:when test="tei:div">
-               <xsl:apply-templates select="tei:div[1]" mode="genid"/>
-	           </xsl:when>
-            <xsl:when test="following-sibling::tei:div">
-               <xsl:apply-templates select="following-sibling::tei:div[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:when test="following::tei:div">
-               <xsl:apply-templates select="following::tei:div[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:when test="following::tei:div1">
-               <xsl:apply-templates select="following::tei:div1[1]" mode="genid"/>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:if test="not($next='')">
-         <a class="xreflink" accesskey="n" href="{concat($next,$outputSuffix)}">
-            <span class="button">»</span>
-         </a>
-      </xsl:if>
-      <xsl:text> </xsl:text>
-      <xsl:apply-templates select="." mode="number"/>
-  </xsl:template>
+		<xsl:for-each select="tei:text/tei:body">
+			<xsl:apply-templates select="tei:div|tei:div1" />
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="mainslide">
-      <html>
-         <xsl:call-template name="addLangAtt"/>
-         <head>
-            <title>
-               <xsl:call-template name="generateTitle"/>
-            </title>
-            <xsl:call-template name="includeCSS"/>
-            <xsl:call-template name="cssHook"/>
-            <xsl:call-template name="javascriptHook"/>
-         </head>
-         <body>
-            <div class="slidetitle" style="font-size: 36pt;">
-               <xsl:call-template name="generateTitle"/>
-            </div>
-            <div class="slidemain">
-               <xsl:apply-templates select="tei:text/tei:front//tei:docAuthor"/>
-               <xsl:apply-templates select="tei:text/tei:front//tei:docDate"/>
-               <ul class="slidetoc">
-                  <xsl:for-each select="tei:text/tei:body">
-                     <xsl:for-each select="tei:div|tei:div1">
-                        <xsl:variable name="n">
-                           <xsl:apply-templates select="." mode="genid"/>
-                        </xsl:variable>
-                        <li class="slidetoc">
-                           <a href="{$n}.xhtml">
-                              <xsl:value-of select="tei:head"/>
-                           </a>
-                        </li>
-                     </xsl:for-each>
-                  </xsl:for-each>
-               </ul>
-            </div>
-            <div class="slidebottom">
-	              <div class="slidebottom-image">
-	                 <img id="logo" src="{$logoFile}" width="{$logoWidth}" height="{$logoHeight}"
-                       alt="logo"/>
-	              </div>
-	              <div class="slidebottom-text">
-	                 <xsl:variable name="next">
-	                    <xsl:value-of select="$masterFile"/>
-	                    <xsl:text>1</xsl:text>
-	                 </xsl:variable>
-	                 <a accesskey="n" href="{concat($next,$outputSuffix)}">Start</a>
-	              </div>
-            </div>
-         </body>
-      </html>
-  </xsl:template>
+	<xsl:template name="xrefpanel">
+		<xsl:param name="homepage" />
+		<xsl:param name="mode" />
+		<xsl:variable name="first">
+			<xsl:value-of select="$masterFile" />
+			0
+		</xsl:variable>
+		<xsl:variable name="prev">
+			<xsl:choose>
+				<xsl:when test="preceding-sibling::tei:div">
+					<xsl:apply-templates
+						select="preceding-sibling::tei:div[1]" mode="genid" />
+				</xsl:when>
+				<xsl:when test="preceding::tei:div">
+					<xsl:apply-templates
+						select="preceding::tei:div[1]" mode="genid" />
+				</xsl:when>
+				<xsl:when test="preceding::tei:div1">
+					<xsl:apply-templates
+						select="preceding::tei:div1[1]" mode="genid" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:if test="not($prev='')">
+			<a class="xreflink" accesskey="p"
+				href="{concat($prev,$outputSuffix)}">
+				<span class="button">«</span>
+			</a>
+		</xsl:if>
+		<xsl:text>  </xsl:text>
+		<a class="xreflink" accesskey="f"
+			href="{concat($first,$outputSuffix)}">
+			<span class="button">^</span>
+		</a>
+		<xsl:variable name="next">
+			<xsl:choose>
+				<xsl:when test="tei:div">
+					<xsl:apply-templates select="tei:div[1]"
+						mode="genid" />
+				</xsl:when>
+				<xsl:when test="following-sibling::tei:div">
+					<xsl:apply-templates
+						select="following-sibling::tei:div[1]" mode="genid" />
+				</xsl:when>
+				<xsl:when test="following::tei:div">
+					<xsl:apply-templates
+						select="following::tei:div[1]" mode="genid" />
+				</xsl:when>
+				<xsl:when test="following::tei:div1">
+					<xsl:apply-templates
+						select="following::tei:div1[1]" mode="genid" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:if test="not($next='')">
+			<a class="xreflink" accesskey="n"
+				href="{concat($next,$outputSuffix)}">
+				<span class="button">»</span>
+			</a>
+		</xsl:if>
+		<xsl:text> </xsl:text>
+		<xsl:apply-templates select="." mode="number" />
+	</xsl:template>
 
-   <xsl:template name="includeJavascript">
-      <xsl:variable name="prev">
-         <xsl:choose>	
-            <xsl:when test="preceding-sibling::tei:div">
-	              <xsl:apply-templates select="preceding-sibling::tei:div[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:when test="preceding::tei:div1">
-	              <xsl:apply-templates select="preceding::tei:div1[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:when test="preceding::tei:div">
-	              <xsl:apply-templates select="preceding::tei:div[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:value-of select="$masterFile"/>
-	              <xsl:text>0</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="next">
-         <xsl:choose>
-            <xsl:when test="tei:div">
-               <xsl:apply-templates select="tei:div[1]" mode="genid"/>
-	           </xsl:when>
+	<xsl:template name="mainslide">
+		<html>
+			<xsl:call-template name="addLangAtt" />
+			<head>
+				<title>
+					<xsl:call-template name="generateTitle" />
+				</title>
+				<xsl:call-template name="includeCSS" />
+				<xsl:call-template name="cssHook" />
+				<xsl:call-template name="javascriptHook" />
+			</head>
+			<body>
+				<div class="slidetitle" style="font-size: 36pt;">
+					<xsl:call-template name="generateTitle" />
+				</div>
+				<div class="slidemain">
+					<xsl:apply-templates
+						select="tei:text/tei:front//tei:docAuthor" />
+					<xsl:apply-templates
+						select="tei:text/tei:front//tei:docDate" />
+					<ul class="slidetoc">
+						<xsl:for-each select="tei:text/tei:body">
+							<xsl:for-each select="tei:div|tei:div1">
+								<xsl:variable name="n">
+									<xsl:apply-templates select="."
+										mode="genid" />
+								</xsl:variable>
+								<li class="slidetoc">
+									<a href="{$n}.xhtml">
+										<xsl:value-of select="tei:head" />
+									</a>
+								</li>
+							</xsl:for-each>
+						</xsl:for-each>
+					</ul>
+				</div>
+				<div class="slidebottom">
+					<div class="slidebottom-image">
+						<img id="logo" src="{$logoFile}" width="{$logoWidth}"
+							height="{$logoHeight}" alt="logo" />
+					</div>
+					<div class="slidebottom-text">
+						<xsl:variable name="next">
+							<xsl:value-of select="$masterFile" />
+							<xsl:text>1</xsl:text>
+						</xsl:variable>
+						<a accesskey="n" href="{concat($next,$outputSuffix)}">Start</a>
+					</div>
+				</div>
+			</body>
+		</html>
+	</xsl:template>
 
-            <xsl:when test="following-sibling::tei:div">
-	              <xsl:apply-templates select="following-sibling::tei:div[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:when test="following::tei:div1">
-	              <xsl:apply-templates select="following::tei:div1[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:when test="following::tei:div">
-	              <xsl:apply-templates select="following::tei:div[1]" mode="genid"/>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:value-of select="$masterFile"/>
-	              <xsl:text>0</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:call-template name="writeJavascript">
-         <xsl:with-param name="content">
-            <xsl:text>
+	<xsl:template name="includeJavascript">
+		<xsl:variable name="prev">
+			<xsl:choose>
+				<xsl:when test="preceding-sibling::tei:div">
+					<xsl:apply-templates
+						select="preceding-sibling::tei:div[1]" mode="genid" />
+				</xsl:when>
+				<xsl:when test="preceding::tei:div1">
+					<xsl:apply-templates
+						select="preceding::tei:div1[1]" mode="genid" />
+				</xsl:when>
+				<xsl:when test="preceding::tei:div">
+					<xsl:apply-templates
+						select="preceding::tei:div[1]" mode="genid" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$masterFile" />
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="next">
+			<xsl:choose>
+				<xsl:when test="tei:div">
+					<xsl:apply-templates select="tei:div[1]"
+						mode="genid" />
+				</xsl:when>
+
+				<xsl:when test="following-sibling::tei:div">
+					<xsl:apply-templates
+						select="following-sibling::tei:div[1]" mode="genid" />
+				</xsl:when>
+				<xsl:when test="following::tei:div1">
+					<xsl:apply-templates
+						select="following::tei:div1[1]" mode="genid" />
+				</xsl:when>
+				<xsl:when test="following::tei:div">
+					<xsl:apply-templates
+						select="following::tei:div[1]" mode="genid" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$masterFile" />
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:call-template name="writeJavascript">
+			<xsl:with-param name="content">
+				<xsl:text>
     var isOp = navigator.userAgent.indexOf('Opera') &gt; -1 ? 1 : 0;
     function keys(key) {
     if (!key) {
@@ -308,16 +371,16 @@
     // case 40: 
     // downkey
     document.location = "</xsl:text>
-            <xsl:value-of select="$next"/>
-            <xsl:text>.xhtml";
+				<xsl:value-of select="$next" />
+				<xsl:text>.xhtml";
     break;
     case 33: // page up
     case 37: // leftkey
     //case 38: 
     // upkey
     document.location = "</xsl:text>
-            <xsl:value-of select="$prev"/>
-            <xsl:text>.xhtml";
+				<xsl:value-of select="$prev" />
+				<xsl:text>.xhtml";
     break;
 	}
 	}
@@ -337,196 +400,208 @@
 	if (target.href != null ) return true;
 	if (!e.which || e.which == 1) 
 	document.location = "</xsl:text>
-	           <xsl:value-of select="$next"/>
-	           <xsl:text>.xhtml";
+				<xsl:value-of select="$next" />
+				<xsl:text>.xhtml";
 	}
 	
 	window.onload = startup;
   </xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-  <xsl:template match="tei:body/tei:div[tei:div]">
-      <xsl:variable name="slidenum">
-         <xsl:value-of select="$masterFile"/>
-         <xsl:number/>
-      </xsl:variable>
-      <xsl:variable name="outName">
-         <xsl:call-template name="outputChunkName">
-	           <xsl:with-param name="ident">
-	              <xsl:value-of select="$slidenum"/>
-	           </xsl:with-param>
-         </xsl:call-template>
-      </xsl:variable>
+	<xsl:template match="tei:body/tei:div[tei:div]">
+		<xsl:variable name="slidenum">
+			<xsl:value-of select="$masterFile" />
+			<xsl:number />
+		</xsl:variable>
+		<xsl:variable name="outName">
+			<xsl:call-template name="outputChunkName">
+				<xsl:with-param name="ident">
+					<xsl:value-of select="$slidenum" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
 
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Opening file <xsl:value-of select="$outName"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
-                           encoding="{$outputEncoding}"
-                           href="{$outName}"
-                           method="{$outputMethod}">
-        <html>
-            <xsl:call-template name="addLangAtt"/>
-            <head>
-               <title>
-                  <xsl:value-of select="tei:head"/>
-               </title>
-               <xsl:call-template name="includeCSS"/>
-               <xsl:call-template name="cssHook"/>
-               <xsl:call-template name="includeJavascript"/>
-               <xsl:call-template name="javascriptHook"/>
-            </head>
-            <body>
-               <h1>
-                  <xsl:value-of select="tei:head"/>
-               </h1>
-            </body>
-        </html>
-      </xsl:result-document>
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Closing file <xsl:value-of select="$outName"/>
-         </xsl:message>
-      </xsl:if>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Opening file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+			encoding="{$outputEncoding}" href="{$outName}"
+			method="{$outputMethod}">
+			<html>
+				<xsl:call-template name="addLangAtt" />
+				<head>
+					<title>
+						<xsl:value-of select="tei:head" />
+					</title>
+					<xsl:call-template name="includeCSS" />
+					<xsl:call-template name="cssHook" />
+					<xsl:call-template name="includeJavascript" />
+					<xsl:call-template name="javascriptHook" />
+				</head>
+				<body>
+					<h1>
+						<xsl:value-of select="tei:head" />
+					</h1>
+				</body>
+			</html>
+		</xsl:result-document>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Closing file
+				<xsl:value-of select="$outName" />
+			</xsl:message>
+		</xsl:if>
 
-      <xsl:apply-templates select="tei:div"/>
-  </xsl:template>
+		<xsl:apply-templates select="tei:div" />
+	</xsl:template>
 
 
-  <xsl:template match="tei:body/tei:div|tei:div">
-      <xsl:choose>
-         <xsl:when test="$splitLevel&gt;-1">
-	           <xsl:variable name="slidenum">
-	              <xsl:apply-templates select="." mode="genid"/>
-	           </xsl:variable>
-	
-	           <xsl:variable name="outName">
-	              <xsl:call-template name="outputChunkName">
-	                 <xsl:with-param name="ident">
-	                    <xsl:value-of select="$slidenum"/>
-	                 </xsl:with-param>
-	              </xsl:call-template>
-	           </xsl:variable>
-	
-	           <xsl:if test="$verbose='true'">
-	              <xsl:message>Opening file <xsl:value-of select="$outName"/>
-               </xsl:message>
-	           </xsl:if>
-	           <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
-                                 encoding="{$outputEncoding}"
-                                 href="{$outName}"
-                                 method="{$outputMethod}">
-	              <xsl:call-template name="slideout"/>
-	           </xsl:result-document>
-	           <xsl:if test="$verbose='true'">
-	              <xsl:message>Closing file <xsl:value-of select="$outName"/>
-               </xsl:message>
-	           </xsl:if>
-         </xsl:when>
-         <xsl:otherwise>
-	           <xsl:call-template name="slidebody"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:body/tei:div|tei:div">
+		<xsl:choose>
+			<xsl:when test="$splitLevel&gt;-1">
+				<xsl:variable name="slidenum">
+					<xsl:apply-templates select="." mode="genid" />
+				</xsl:variable>
 
+				<xsl:variable name="outName">
+					<xsl:call-template name="outputChunkName">
+						<xsl:with-param name="ident">
+							<xsl:value-of select="$slidenum" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:variable>
 
-  <xsl:template name="slideout">
-      <html>
-         <xsl:call-template name="addLangAtt"/>
-         <head>
-            <title>
-               <xsl:value-of select="tei:head"/>
-            </title>
-            <xsl:call-template name="includeCSS"/>
-            <xsl:call-template name="cssHook"/>
-            <xsl:call-template name="includeJavascript"/>
-            <xsl:call-template name="javascriptHook"/>
-         </head>
-         <body>
-            <xsl:call-template name="slidebody"/>
-         </body>
-      </html>
-  </xsl:template>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Opening file
+						<xsl:value-of select="$outName" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+					encoding="{$outputEncoding}" href="{$outName}"
+					method="{$outputMethod}">
+					<xsl:call-template name="slideout" />
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Closing file
+						<xsl:value-of select="$outName" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="slidebody" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="slidebody">
-      <div class="slidetop">
-         <div class="slidetitle">
-            <xsl:call-template name="header">
-	              <xsl:with-param name="display">full</xsl:with-param>
-	           </xsl:call-template>
-         </div>
-         <xsl:if test="$splitLevel &gt;-1">
-            <div class="xref">
-               <xsl:call-template name="xrefpanel"/>
-            </div>
-         </xsl:if>
-      </div>
-      <div class="slidemain">
-         <xsl:apply-templates/>
-      </div>
-      <div class="slidebottom">
-         <xsl:call-template name="slideBottom"/>
-      </div>
-  </xsl:template>
 
+	<xsl:template name="slideout">
+		<html>
+			<xsl:call-template name="addLangAtt" />
+			<head>
+				<title>
+					<xsl:value-of select="tei:head" />
+				</title>
+				<xsl:call-template name="includeCSS" />
+				<xsl:call-template name="cssHook" />
+				<xsl:call-template name="includeJavascript" />
+				<xsl:call-template name="javascriptHook" />
+			</head>
+			<body>
+				<xsl:call-template name="slidebody" />
+			</body>
+		</html>
+	</xsl:template>
 
-  <xsl:template name="slideBottom">
-      <div class="slidebottom">
-         <div class="slidebottom-image">
-	           <img id="logo" src="{$logoFile}" width="{$logoWidth}" height="${logoHeight}"
-                 alt="logo"/>
-         </div>
-         <div class="slidebottom-text">
-	           <xsl:call-template name="generateTitle"/>
-         </div>
-      </div>
-  </xsl:template>
+	<xsl:template name="slidebody">
+		<div class="slidetop">
+			<div class="slidetitle">
+				<xsl:call-template name="header">
+					<xsl:with-param name="display">
+						full
+					</xsl:with-param>
+				</xsl:call-template>
+			</div>
+			<xsl:if test="$splitLevel &gt;-1">
+				<div class="xref">
+					<xsl:call-template name="xrefpanel" />
+				</div>
+			</xsl:if>
+		</div>
+		<div class="slidemain">
+			<xsl:apply-templates />
+		</div>
+		<div class="slidebottom">
+			<xsl:call-template name="slideBottom" />
+		</div>
+	</xsl:template>
 
-  <xsl:template match="tei:row">
-	     <xsl:variable name="c">
-	        <xsl:number/>
-	     </xsl:variable>
-	     <xsl:variable name="class">
-	        <xsl:choose>
-	           <xsl:when test="@role">
-		             <xsl:value-of select="@role"/>
-	           </xsl:when>
-	           <xsl:when test="$c mod 2=0">
-	              <xsl:text>Even</xsl:text>
-	           </xsl:when>
-	           <xsl:otherwise>
-	              <xsl:text>Odd</xsl:text>
-	           </xsl:otherwise>
-	        </xsl:choose>
-	     </xsl:variable>
-	     <tr class="{$class}">
-	        <xsl:apply-templates/>
-	     </tr>
-  </xsl:template>
 
-  <xsl:template match="teix:egXML">
-      <xsl:param name="simple">false</xsl:param>
-      <xsl:param name="highlight"/>
-    
-      <div class="pre">
-	        <xsl:apply-templates mode="verbatim">
-	           <xsl:with-param name="highlight">
-	              <xsl:value-of select="$highlight"/>
-	           </xsl:with-param>
-	        </xsl:apply-templates>
-      </div>
-  </xsl:template>
+	<xsl:template name="slideBottom">
+		<div class="slidebottom">
+			<div class="slidebottom-image">
+				<img id="logo" src="{$logoFile}" width="{$logoWidth}"
+					height="${logoHeight}" alt="logo" />
+			</div>
+			<div class="slidebottom-text">
+				<xsl:call-template name="generateTitle" />
+			</div>
+		</div>
+	</xsl:template>
 
-  <xsl:template match="xhtml:*">
-      <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="tei:row">
+		<xsl:variable name="c">
+			<xsl:number />
+		</xsl:variable>
+		<xsl:variable name="class">
+			<xsl:choose>
+				<xsl:when test="@role">
+					<xsl:value-of select="@role" />
+				</xsl:when>
+				<xsl:when test="$c mod 2=0">
+					<xsl:text>Even</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>Odd</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<tr class="{$class}">
+			<xsl:apply-templates />
+		</tr>
+	</xsl:template>
 
-  <xsl:template match="tei:att">
-      <span class="att">
-         <xsl:apply-templates/>
-      </span>
-  </xsl:template>
+	<xsl:template match="teix:egXML">
+		<xsl:param name="simple">
+			false
+		</xsl:param>
+		<xsl:param name="highlight" />
 
+		<div class="pre">
+			<xsl:apply-templates mode="verbatim">
+				<xsl:with-param name="highlight">
+					<xsl:value-of select="$highlight" />
+				</xsl:with-param>
+			</xsl:apply-templates>
+		</div>
+	</xsl:template>
+
+	<xsl:template match="xhtml:*">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="tei:att">
+		<span class="att">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teislides.css
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teislides.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/slides/teislides.css	(revision 2397)
@@ -1,252 +1,239 @@
 /* teislides.css */
-
-body
-{
-    background: white;
-    font-family: Helvetica;
-    font-size: 24pt; 
-    color: black;
+body {
+	background: white;
+	font-family: Helvetica;
+	font-size: 24pt;
+	color: black;
 }
 
-
 p {
-  margin-top: 6px;
-  margin-bottom: 6px;
-  }
+	margin-top: 6px;
+	margin-bottom: 6px;
+}
 
 li {
-   margin-bottom: 6px;
-   margin-top: 4px;
+	margin-bottom: 6px;
+	margin-top: 4px;
 }
 
 pre.eg {
-    background: #ffffcc;
-    padding: 6pt;
-    font-style: roman;
-    font-size: 16pt;
-    color: blue
-    margin-left: 1em;
-    margin-top: 6pt;
-    border-style: inset
+	background: #ffffcc;
+	padding: 6pt;
+	font-style: roman;
+	font-size: 16pt;
+	color: blue margin-left: 1em;
+	margin-top: 6pt;
+	border-style: inset
 }
 
 div.docAuthor {
-    padding: 12pt;
-    font-size: 34pt;
-    color: green;
+	padding: 12pt;
+	font-size: 34pt;
+	color: green;
 }
 
 div.docDate {
-    padding: 12pt;
-    font-size:34pt;
-    color: blue;
+	padding: 12pt;
+	font-size: 34pt;
+	color: blue;
 }
 
-tr,p,ul,ol,li {
-    font-size: 24pt;
-    }
+tr, p, ul, ol, li {
+	font-size: 24pt;
+}
 
 p.box {
-    background: blue; color: white ;
-    padding: 10pt;
-    margin-left: 5%;
-    font-size: 24pt;
-    font-style: bold;
-    margin-right: 5%;
-    margin-top: 12pt;
-    border-style: outset;
+	background: blue;
+	color: white;
+	padding: 10pt;
+	margin-left: 5%;
+	font-size: 24pt;
+	font-style: bold;
+	margin-right: 5%;
+	margin-top: 12pt;
+	border-style: outset;
 }
 
-
-td
-{
-    color: black;
-    margin-left: 5%;
-    margin-right: 5%;
-    margin-top: 3%;
+td {
+	color: black;
+	margin-left: 5%;
+	margin-right: 5%;
+	margin-top: 3%;
 }
 
-pre, code, tt, Code
-{
-    font-family:  monospace;
-    color: blue;
-    font-size: 20pt;
+pre, code, tt, Code {
+	font-family: monospace;
+	color: blue;
+	font-size: 20pt;
 }
 
 tt.url {
-    font-family:  sans-serif;
-    }
+	font-family: sans-serif;
+}
 
+h2 {
+	margin-top: 24pt;
+	font-size: 32pt;
+	font-family: serif;
+	color: green;
+	background: white;
+	text-align: center;
+	border-width: 5pt;
+	border-color: white;
+	padding: 0pt;
+	margin: 0pt;
+}
 
-h2 {    margin-top: 24pt;
-    font-size: 32pt;
-    font-family: serif;
-    color: green;
-    background: white;
-        text-align: center;
-    border-width: 5pt;
-    border-color: white;
-    padding: 0pt;
-    margin: 0pt;
-    }
+ul, dl, ol {
+	font-size: 24pt;
+}
 
+li.lower {
+	font-style: normal;
+}
 
-ul,dl,ol {    
-    font-size: 24pt;
-     }
-
-li.lower {     font-style: normal; }
-
-
-
-blockquote
-{
-    margin-left: 5%;
-    margin-right: 5%;
-    margin-top: 0.5em;
-    margin-bottom: 1.5em;
-/*    color: gray; */
-    color: teal;
-    text-align: justify;
-    font-size: smaller;
+blockquote {
+	margin-left: 5%;
+	margin-right: 5%;
+	margin-top: 0.5em;
+	margin-bottom: 1.5em;
+	/*    color: gray; */
+	color: teal;
+	text-align: justify;
+	font-size: smaller;
 }
 
-address
-{
-    font-style:  normal;
-    font-family: cursive;
-    letter-spacing: .1em;
-    font-size: x-small;
+address {
+	font-style: normal;
+	font-family: cursive;
+	letter-spacing: .1em;
+	font-size: x-small;
 }
 
-a:link
-{
-    color:  blue;
+a:link {
+	color: blue;
 }
 
-
-a:visited
-{
-    color:  navy;
+a:visited {
+	color: navy;
 }
 
-
-a:active
-{
-    color:  purple;
-    background: yellow;
+a:active {
+	color: purple;
+	background: yellow;
 }
 
-
-a:hover
-{
-    color:  blue;
-    background:     silver;
+a:hover {
+	color: blue;
+	background: silver;
 }
 
-.titlebar
-{
-    color: white;
-    background: navy;
+.titlebar {
+	color: white;
+	background: navy;
 }
 
-
-
 div.slidemain {
-      clear: both;
-      height: 75%;
-      border-top: 2px;
-      border-left: 0;
-      border-bottom: 0;
-      border-right: 0;
-      border-style: solid;
-      border-color: blue;
-      padding-left: 5%;
-      padding-right: 5%;
-	      }
+	clear: both;
+	height: 75%;
+	border-top: 2px;
+	border-left: 0;
+	border-bottom: 0;
+	border-right: 0;
+	border-style: solid;
+	border-color: blue;
+	padding-left: 5%;
+	padding-right: 5%;
+}
 
 div.slidebottom-text {
-      font-style: italic;
-      font-size: 12pt;
-      float: right;
+	font-style: italic;
+	font-size: 12pt;
+	float: right;
 }
+
 div.slidebottom-image {
-      float: left;
+	float: left;
 }
+
 div.slidebottom {
-      clear:both;
-      height: 2%;
-      margin-top: 10pt;
-      border-top: 2px;
-      border-left: 0;
-      border-bottom: 0;
-      border-right: 0;
-	      }
+	clear: both;
+	height: 2%;
+	margin-top: 10pt;
+	border-top: 2px;
+	border-left: 0;
+	border-bottom: 0;
+	border-right: 0;
+}
 
 div.slidetop {
-      padding-top: 2%;
+	padding-top: 2%;
 }
 
 div.slidetitle {
-    height: 10%;
-    float: left;
-    color:red;
-    font-size: 42pt;
-    font-weight: bold;
-    font-family: sans-serif;
-    text-align: left;
-    margin-bottom: 12pt;
-    padding-left: 5%;
+	height: 10%;
+	float: left;
+	color: red;
+	font-size: 42pt;
+	font-weight: bold;
+	font-family: sans-serif;
+	text-align: left;
+	margin-bottom: 12pt;
+	padding-left: 5%;
 }
+
 div.xref {
-    height: 10%;
-    float: right;
-    font-size: 12pt;
-    font-weight: bold;
-    margin-bottom: 12pt;
+	height: 10%;
+	float: right;
+	font-size: 12pt;
+	font-weight: bold;
+	margin-bottom: 12pt;
 }
 
-span.bottomright{
-    float: right;
-    margin-top:0;
-    margin-bottom: 8pt;
+span.bottomright {
+	float: right;
+	margin-top: 0;
+	margin-bottom: 8pt;
 }
 
-
 li.slidetoc {
- display: inline;
-}	      
+	display: inline;
+}
 
 li.slidetoc:before {
-  content: " * ";
-  font-style: italic;
+	content: " * ";
+	font-style: italic;
 }
 
-
-
 img.simple {
-	   border-style: none;
-	   }
+	border-style: none;
+}
+
 img.inline {
-	   border-style: none;
-	   }
+	border-style: none;
+}
+
 img.right {
-	   float:right
-	   }
+	float: right
+}
+
 img.left {
-	   float:left
-	   }
+	float: left
+}
+
 .button {
-    font-family: Symbol;
-    padding: 2px;
-    font-style: bold;
-    border-style: outset;
-    background: blue; 
-    color: white ;
+	font-family: Symbol;
+	padding: 2px;
+	font-style: bold;
+	border-style: outset;
+	background: blue;
+	color: white;
 }
+
 a.xreflink:link {
-		        text-decoration: none;		 	    
-	    }		 
+	text-decoration: none;
+}
+
 a.xreflink:visited {
-		        text-decoration: none;		 	    
-	    }		 
+	text-decoration: none;
+}
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/teiCustom.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/teiCustom.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/teiCustom.xsl	(revision 2397)
@@ -1,58 +1,57 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                version="1.0">
-    <xsl:import href="tei.xsl"/>
-    
-    <!-- oXygen begin change -->
-    <!--
-        The default value of the 'tableAlign' param set in common/ tei-param.xsl is 
-        'leftTable' which is not a standard XSL-FO value for this param. It is reported 
-        as error by both Apache FOP and XEP. We set the default value to a 
-        standard one.
-    -->
-    <xsl:param name="tableAlign">left</xsl:param>
-    <!-- oXygen end change -->
-    
-    <xsl:template match="tei:table">
-        <xsl:choose>
-            <xsl:when test="@rend='eqnarray' and $foEngine='passivetex'">
-                <fotex:eqnarray>
-                    <xsl:apply-templates select=".//tei:formula"/>
-                </fotex:eqnarray>
-            </xsl:when>
-            <xsl:when test=".//tei:formula[@type='subeqn'] and $foEngine='passivetex'">
-                <fotex:eqnarray>
-                    <xsl:apply-templates select=".//tei:formula"/>
-                </fotex:eqnarray>
-            </xsl:when>
-            <xsl:when test="$inlineTables or @rend='inline'">
-                <xsl:if test="tei:head">
-                    <block>
-                        <xsl:call-template name="tableCaptionstyle"/>
-                        <!-- oXygen begin change -->
-                        <!-- 
-                            The same ID attribute value generated from the same node of the XML
-                            source cannot be added to two different elements of the XSL-FO result,
-                            that is an fo:block and a child element fo:table. Here we skip adding the ID
-                            attribute for the child element.
-                        -->
-                        <!-- <xsl:call-template name="addID"/> -->
-                        <!-- oXygen end change -->
-                        <xsl:if test="$makeTableCaption='true'">
-                            <xsl:call-template name="calculateTableNumber"/>
-                            <xsl:text>. </xsl:text>
-                        </xsl:if>
-                        <xsl:apply-templates select="tei:head"/>
-                    </block>
-                </xsl:if>
-                <xsl:call-template name="blockTable"/>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:call-template name="floatTable"/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:fotex="http://www.tug.org/fotex"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" version="1.0">
+	<xsl:import href="tei.xsl" />
+
+	<!-- oXygen begin change -->
+	<!-- The default value of the 'tableAlign' param set in common/ tei-param.xsl 
+		is 'leftTable' which is not a standard XSL-FO value for this param. It is 
+		reported as error by both Apache FOP and XEP. We set the default value to 
+		a standard one. -->
+	<xsl:param name="tableAlign">
+		left
+	</xsl:param>
+	<!-- oXygen end change -->
+
+	<xsl:template match="tei:table">
+		<xsl:choose>
+			<xsl:when test="@rend='eqnarray' and $foEngine='passivetex'">
+				<fotex:eqnarray>
+					<xsl:apply-templates select=".//tei:formula" />
+				</fotex:eqnarray>
+			</xsl:when>
+			<xsl:when
+				test=".//tei:formula[@type='subeqn'] and $foEngine='passivetex'">
+				<fotex:eqnarray>
+					<xsl:apply-templates select=".//tei:formula" />
+				</fotex:eqnarray>
+			</xsl:when>
+			<xsl:when test="$inlineTables or @rend='inline'">
+				<xsl:if test="tei:head">
+					<block>
+						<xsl:call-template name="tableCaptionstyle" />
+						<!-- oXygen begin change -->
+						<!-- The same ID attribute value generated from the same node of the 
+							XML source cannot be added to two different elements of the XSL-FO result, 
+							that is an fo:block and a child element fo:table. Here we skip adding the 
+							ID attribute for the child element. -->
+						<!-- <xsl:call-template name="addID"/> -->
+						<!-- oXygen end change -->
+						<xsl:if test="$makeTableCaption='true'">
+							<xsl:call-template name="calculateTableNumber" />
+							<xsl:text>. </xsl:text>
+						</xsl:if>
+						<xsl:apply-templates select="tei:head" />
+					</block>
+				</xsl:if>
+				<xsl:call-template name="blockTable" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="floatTable" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/transcr.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/transcr.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/transcr.xsl	(revision 2397)
@@ -1,59 +1,62 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes=" a  rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-    transcr module, making XSL FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes=" a  rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				transcr module, making XSL FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: transcr.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template match="tei:facsimile"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: transcr.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
+	<xsl:template match="tei:facsimile" />
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei-param.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei-param.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei-param.xsl	(revision 2397)
@@ -1,858 +1,1154 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    customization module for 
-      fo output.</p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				customization module for
+				fo output.</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei-param.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="string">
-      <desc>
-How to scale figures if no width and height specified (pass to XSL FO content-width)
-</desc>
-   </doc>
-  <xsl:param name="autoScaleFigures"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="boolean">
-      <desc>
-Put captions on inline figures
-</desc>
-   </doc>
-  <xsl:param name="captionInlineFigures">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures">
-      <desc>[fo] Set attributes for display of figures</desc>
-   </doc>
-  <xsl:template name="figureCaptionstyle">
-      <xsl:attribute name="text-align">center</xsl:attribute>
-      <xsl:attribute name="font-style">italic</xsl:attribute>
-      <xsl:attribute name="end-indent">
-         <xsl:value-of select="$exampleMargin"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-param.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="string">
+		<desc>
+			How to scale figures if no width and height specified (pass to XSL FO
+			content-width)
+		</desc>
+	</doc>
+	<xsl:param name="autoScaleFigures" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="boolean">
+		<desc>
+			Put captions on inline figures
+		</desc>
+	</doc>
+	<xsl:param name="captionInlineFigures">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures">
+		<desc>[fo] Set attributes for display of figures</desc>
+	</doc>
+	<xsl:template name="figureCaptionstyle">
+		<xsl:attribute name="text-align">center</xsl:attribute>
+		<xsl:attribute name="font-style">italic</xsl:attribute>
+		<xsl:attribute name="end-indent">
+         <xsl:value-of select="$exampleMargin" />
       </xsl:attribute>
-      <xsl:attribute name="start-indent">
-         <xsl:value-of select="$exampleMargin"/>
+		<xsl:attribute name="start-indent">
+         <xsl:value-of select="$exampleMargin" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="boolean">
-      <desc>
-Show the contents of &lt;head&gt; in a cross-reference to table or figure
-</desc>
-   </doc>
-  <xsl:param name="showFloatHead">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="boolean">
-      <desc>
-Show a title for figures or tables (eg Table or Figure) in a cross-reference
-</desc>
-   </doc>
-  <xsl:param name="showFloatLabel">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="boolean">
-      <desc>
-Show the page number in a cross-reference to table or figure
-</desc>
-   </doc>
-  <xsl:param name="xrefShowPage">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[fo] Hook where extra material can be inserted after the
-    &lt;body&gt; has been processed</desc>
-   </doc>
-  <xsl:template name="afterBodyHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[fo] Hook where work can be done at the start of each block</desc>
-   </doc>
-  <xsl:template name="blockStartHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[fo] Hook where extra page masters can be defined</desc>
-   </doc>
-  <xsl:template name="pageMasterHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>
-Put back matter in multiple columns
-</desc>
-   </doc>
-  <xsl:param name="backMulticolumns">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Margin at bottom of text body
-</desc>
-   </doc>
-  <xsl:param name="bodyMarginBottom">24pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Margin at top of text body
-</desc>
-   </doc>
-  <xsl:param name="bodyMarginTop">24pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>
-Put body matter in multiple columns
-</desc>
-   </doc>
-  <xsl:param name="bodyMulticolumns">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Symbol for 4th level itemized list
-</desc>
-   </doc>
-  <xsl:param name="bulletFour">+</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Symbol for top-level itemized list
-</desc>
-   </doc>
-  <xsl:param name="bulletOne">•</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Symbol for 3rd level itemized list
-</desc>
-   </doc>
-  <xsl:param name="bulletThree">*</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Symbol for 2nd level itemized list
-</desc>
-   </doc>
-  <xsl:param name="bulletTwo">–</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="integer">
-      <desc>
-Number of columns, when multiple-column work is requested
-</desc>
-   </doc>
-  <xsl:param name="columnCount">1</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-XSL FO "provisional-distance-between starts"
-</desc>
-   </doc>
-  <xsl:param name="betweenStarts">18pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-XSL FO "provisional-distance-between starts" for gloss lists
-</desc>
-   </doc>
-  <xsl:param name="betweenGlossStarts">42pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-XSL FO "provisional-distance-between starts" for bibliographies
-</desc>
-   </doc>
-  <xsl:param name="betweenBiblStarts">14pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>
-Display section headings in running heads
-</desc>
-   </doc>
-  <xsl:param name="divRunningheads">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space below examples
-</desc>
-   </doc>
-  <xsl:param name="exampleAfter">4pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space above examples
-</desc>
-   </doc>
-  <xsl:param name="exampleBefore">4pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Left margin for examples
-</desc>
-   </doc>
-  <xsl:param name="exampleMargin">12pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Left margin of flow
-</desc>
-   </doc>
-  <xsl:param name="flowMarginLeft"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Which named page master name to use
-</desc>
-   </doc>
-  <xsl:param name="forcePageMaster"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-How to format page numbers in back matter (use XSLT number format)
-</desc>
-   </doc>
-  <xsl:param name="formatBackpage">1</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-How to format page numbers in main matter (use XSLT number format)
-</desc>
-   </doc>
-  <xsl:param name="formatBodypage">1</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-How to format page numbers in front matter (use XSLT number format)
-</desc>
-   </doc>
-  <xsl:param name="formatFrontpage">i</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>
-Put front matter in multiple columns
-</desc>
-   </doc>
-  <xsl:param name="frontMulticolumns">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-XSL FO "provisional-label-separation"
-</desc>
-   </doc>
-  <xsl:param name="labelSeparation">6pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space above lists at top level
-</desc>
-   </doc>
-  <xsl:param name="listAbove-1">6pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space above lists at 2nd level
-</desc>
-   </doc>
-  <xsl:param name="listAbove-2">4pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space above lists at 3rd level
-</desc>
-   </doc>
-  <xsl:param name="listAbove-3">0pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space above lists at 4th level
-</desc>
-   </doc>
-  <xsl:param name="listAbove-4">0pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space below lists at top level
-</desc>
-   </doc>
-  <xsl:param name="listBelow-1">6pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space below lists at 2nd level
-</desc>
-   </doc>
-  <xsl:param name="listBelow-2">4pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space below lists at 3rd level
-</desc>
-   </doc>
-  <xsl:param name="listBelow-3">0pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space below lists at 4th level
-</desc>
-   </doc>
-  <xsl:param name="listBelow-4">0pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Spacing between list items
-</desc>
-   </doc>
-  <xsl:param name="listItemsep">4pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Left margin for gloss lists
-</desc>
-   </doc>
-  <xsl:param name="listLeftGlossIndent">0.5in</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Left margin for nested gloss lists
-</desc>
-   </doc>
-  <xsl:param name="listLeftGlossInnerIndent">0.25in</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Indentation for lists
-</desc>
-   </doc>
-  <xsl:param name="listLeftIndent">0pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Right margin for lists
-</desc>
-   </doc>
-  <xsl:param name="listRightMargin">10pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Paper height
-</desc>
-   </doc>
-  <xsl:param name="pageHeight">297mm</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Margin at bottom of text area
-</desc>
-   </doc>
-  <xsl:param name="pageMarginBottom">100pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Left margin
-</desc>
-   </doc>
-  <xsl:param name="pageMarginLeft">80pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Right margin
-</desc>
-   </doc>
-  <xsl:param name="pageMarginRight">150pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Margin at top of text area
-</desc>
-   </doc>
-  <xsl:param name="pageMarginTop">75pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Paper width
-</desc>
-   </doc>
-  <xsl:param name="pageWidth">211mm</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Maximum space allowed between paragraphs
-</desc>
-   </doc>
-  <xsl:param name="parSkipmax">12pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="anyURI">
-      <desc>
-External XML file containing specifications for column sizes for
-tables in document
-</desc>
-   </doc>
-  <xsl:param name="readColSpecFile"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Region after
-</desc>
-   </doc>
-  <xsl:param name="regionAfterExtent">14pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Region before
-</desc>
-   </doc>
-  <xsl:param name="regionBeforeExtent">14pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>
-Construct running headers from page number and section headings
-</desc>
-   </doc>
-  <xsl:param name="sectionHeaders">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space after bibliography
-</desc>
-   </doc>
-  <xsl:param name="spaceAfterBibl">0pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space above and below a table
-</desc>
-   </doc>
-  <xsl:param name="spaceAroundTable">8pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space above bibliography
-</desc>
-   </doc>
-  <xsl:param name="spaceBeforeBibl">4pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Space below caption of figure or table
-</desc>
-   </doc>
-  <xsl:param name="spaceBelowCaption">4pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>
-Make title page
-</desc>
-   </doc>
-  <xsl:param name="titlePage">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>
-Make 2-page spreads
-</desc>
-   </doc>
-  <xsl:param name="twoSided">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>
-Language (for hyphenation)
-</desc>
-   </doc>
-  <xsl:param name="language">en_US</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>
-         <p>Name of intended XSL FO engine</p>
-         <p>This is used to tailor the result for different XSL FO processors.
-By default, no special measures are taken, so
-there are no bookmarks or other such features. Possible values are
-<ul xmlns="http://www.w3.org/1999/XSL/Format">
-               <li>passivetex (the TeX-based PassiveTeX processor</li>
-               <li>xep   (XEP)</li>
-               <li>fop (FOP)</li>
-               <li>antenna  (Antenna House)</li>
-            </ul>
-         </p>
-      </desc>
-   </doc>
-  <xsl:param name="foEngine"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="boolean">
-      <desc>
-Make &lt;lb&gt; active (ie cause a line break)
-</desc>
-   </doc>
-  <xsl:param name="activeLinebreaks">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Alignment of text (ie justified or ragged)
-</desc>
-   </doc>
-  <xsl:param name="alignment">justify</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font size for display of author name 
-</desc>
-   </doc>
-  <xsl:param name="authorSize">14pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font size for bibliography
-</desc>
-   </doc>
-  <xsl:param name="biblSize">16pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Default font for body
-</desc>
-   </doc>
-  <xsl:param name="bodyFont">Times</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Default font size for body (without dimension)
-</desc>
-   </doc>
-  <xsl:param name="bodyMaster">10</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Calculation of normal body font size (add dimension)
-</desc>
-   </doc>
-  <xsl:param name="bodySize">
-      <xsl:value-of select="$bodyMaster"/>
-      <xsl:text>pt</xsl:text>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font size for display of date
-</desc>
-   </doc>
-  <xsl:param name="dateSize">14pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font for section headings
-</desc>
-   </doc>
-  <xsl:param name="divFont">Times</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] How to display section headings in a cross-reference <param name="head">section title</param>
-      </desc>
-   </doc>
-  <xsl:template name="divXRefHeading">
-      <xsl:param name="head">
-         <xsl:apply-templates mode="section" select="tei:head"/>
-      </xsl:param>
-      <xsl:text> (</xsl:text>
-      <xsl:value-of select="normalize-space($head)"/>
-      <xsl:text>)</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Colour for display of &lt;eg&gt; blocks.
-</desc>
-   </doc>
-  <xsl:param name="exampleColor">black</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Colour for background display of &lt;eg&gt; blocks.
-</desc>
-   </doc>
-  <xsl:param name="exampleBackgroundColor">gray</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Calculation of font size for examples (add dimension)
-</desc>
-   </doc>
-  <xsl:param name="exampleSize">
-      <xsl:value-of select="$bodyMaster * 0.6"/>
-      <xsl:text>pt</xsl:text>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Calculation of font size for quotations
-</desc>
-   </doc>
-  <xsl:param name="quoteSize">
-      <xsl:value-of select="$bodyMaster * 0.9"/>
-      <xsl:text>pt</xsl:text>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font size for footnotes
-</desc>
-   </doc>
-  <xsl:param name="footnoteSize">
-      <xsl:value-of select="$bodyMaster * 0.8.0"/>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font size for footnote numbers
-</desc>
-   </doc>
-  <xsl:param name="footnotenumSize">
-    <xsl:value-of select="$bodyMaster * 0.7"/>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Colour for display of element names
-</desc>
-   </doc>
-  <xsl:param name="giColor">black</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Indentation of headings
-</desc>
-   </doc>
-  <xsl:param name="headingOutdent">0em</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="boolean">
-      <desc>
-Hyphenate text
-</desc>
-   </doc>
-  <xsl:param name="hyphenate">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Colour for display of &lt;ident&gt; values
-    Customization parameter.
-</desc>
-   </doc>
-  <xsl:param name="identColor">black</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] Set attributes for display of links</desc>
-   </doc>
-  <xsl:template name="linkStyle">
-      <xsl:attribute name="text-decoration">underline</xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font family for running header and footer
-</desc>
-   </doc>
-  <xsl:param name="runFont">sans-serif</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font size for running header and footer
-</desc>
-   </doc>
-  <xsl:param name="runSize">9pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Sans-serif font
-</desc>
-   </doc>
-  <xsl:param name="sansFont">Helvetica</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] Set attributes for display of heading for chapters (level 0)</desc>
-   </doc>
-  <xsl:template name="setupDiv0">
-      <xsl:attribute name="font-size">18pt</xsl:attribute>
-      <xsl:attribute name="text-align">left</xsl:attribute>
-      <xsl:attribute name="font-weight">bold</xsl:attribute>
-      <xsl:attribute name="space-after">6pt</xsl:attribute>
-      <xsl:attribute name="space-before.optimum">12pt</xsl:attribute>
-      <xsl:attribute name="text-indent">
-         <xsl:value-of select="$headingOutdent"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="boolean">
+		<desc>
+			Show the contents of &lt;head&gt; in a cross-reference to table or figure
+		</desc>
+	</doc>
+	<xsl:param name="showFloatHead">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="boolean">
+		<desc>
+			Show a title for figures or tables (eg Table or Figure) in a
+			cross-reference
+		</desc>
+	</doc>
+	<xsl:param name="showFloatLabel">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="boolean">
+		<desc>
+			Show the page number in a cross-reference to table or figure
+		</desc>
+	</doc>
+	<xsl:param name="xrefShowPage">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[fo] Hook where extra material can be inserted after the
+			&lt;body&gt; has been processed</desc>
+	</doc>
+	<xsl:template name="afterBodyHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[fo] Hook where work can be done at the start of each block</desc>
+	</doc>
+	<xsl:template name="blockStartHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[fo] Hook where extra page masters can be defined</desc>
+	</doc>
+	<xsl:template name="pageMasterHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Put back matter in multiple columns
+		</desc>
+	</doc>
+	<xsl:param name="backMulticolumns">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Margin at bottom of text body
+		</desc>
+	</doc>
+	<xsl:param name="bodyMarginBottom">
+		24pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Margin at top of text body
+		</desc>
+	</doc>
+	<xsl:param name="bodyMarginTop">
+		24pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Put body matter in multiple columns
+		</desc>
+	</doc>
+	<xsl:param name="bodyMulticolumns">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Symbol for 4th level itemized list
+		</desc>
+	</doc>
+	<xsl:param name="bulletFour">
+		+
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Symbol for top-level itemized list
+		</desc>
+	</doc>
+	<xsl:param name="bulletOne">
+		•
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Symbol for 3rd level itemized list
+		</desc>
+	</doc>
+	<xsl:param name="bulletThree">
+		*
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Symbol for 2nd level itemized list
+		</desc>
+	</doc>
+	<xsl:param name="bulletTwo">
+		–
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="integer">
+		<desc>
+			Number of columns, when multiple-column work is requested
+		</desc>
+	</doc>
+	<xsl:param name="columnCount">
+		1
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			XSL FO "provisional-distance-between starts"
+		</desc>
+	</doc>
+	<xsl:param name="betweenStarts">
+		18pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			XSL FO "provisional-distance-between starts" for gloss lists
+		</desc>
+	</doc>
+	<xsl:param name="betweenGlossStarts">
+		42pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			XSL FO "provisional-distance-between starts" for bibliographies
+		</desc>
+	</doc>
+	<xsl:param name="betweenBiblStarts">
+		14pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Display section headings in running heads
+		</desc>
+	</doc>
+	<xsl:param name="divRunningheads">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space below examples
+		</desc>
+	</doc>
+	<xsl:param name="exampleAfter">
+		4pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space above examples
+		</desc>
+	</doc>
+	<xsl:param name="exampleBefore">
+		4pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Left margin for examples
+		</desc>
+	</doc>
+	<xsl:param name="exampleMargin">
+		12pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Left margin of flow
+		</desc>
+	</doc>
+	<xsl:param name="flowMarginLeft" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Which named page master name to use
+		</desc>
+	</doc>
+	<xsl:param name="forcePageMaster" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			How to format page numbers in back matter (use XSLT number format)
+		</desc>
+	</doc>
+	<xsl:param name="formatBackpage">
+		1
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			How to format page numbers in main matter (use XSLT number format)
+		</desc>
+	</doc>
+	<xsl:param name="formatBodypage">
+		1
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			How to format page numbers in front matter (use XSLT number format)
+		</desc>
+	</doc>
+	<xsl:param name="formatFrontpage">
+		i
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Put front matter in multiple columns
+		</desc>
+	</doc>
+	<xsl:param name="frontMulticolumns">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			XSL FO "provisional-label-separation"
+		</desc>
+	</doc>
+	<xsl:param name="labelSeparation">
+		6pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space above lists at top level
+		</desc>
+	</doc>
+	<xsl:param name="listAbove-1">
+		6pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space above lists at 2nd level
+		</desc>
+	</doc>
+	<xsl:param name="listAbove-2">
+		4pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space above lists at 3rd level
+		</desc>
+	</doc>
+	<xsl:param name="listAbove-3">
+		0pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space above lists at 4th level
+		</desc>
+	</doc>
+	<xsl:param name="listAbove-4">
+		0pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space below lists at top level
+		</desc>
+	</doc>
+	<xsl:param name="listBelow-1">
+		6pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space below lists at 2nd level
+		</desc>
+	</doc>
+	<xsl:param name="listBelow-2">
+		4pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space below lists at 3rd level
+		</desc>
+	</doc>
+	<xsl:param name="listBelow-3">
+		0pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space below lists at 4th level
+		</desc>
+	</doc>
+	<xsl:param name="listBelow-4">
+		0pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Spacing between list items
+		</desc>
+	</doc>
+	<xsl:param name="listItemsep">
+		4pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Left margin for gloss lists
+		</desc>
+	</doc>
+	<xsl:param name="listLeftGlossIndent">
+		0.5in
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Left margin for nested gloss lists
+		</desc>
+	</doc>
+	<xsl:param name="listLeftGlossInnerIndent">
+		0.25in
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Indentation for lists
+		</desc>
+	</doc>
+	<xsl:param name="listLeftIndent">
+		0pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Right margin for lists
+		</desc>
+	</doc>
+	<xsl:param name="listRightMargin">
+		10pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Paper height
+		</desc>
+	</doc>
+	<xsl:param name="pageHeight">
+		297mm
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Margin at bottom of text area
+		</desc>
+	</doc>
+	<xsl:param name="pageMarginBottom">
+		100pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Left margin
+		</desc>
+	</doc>
+	<xsl:param name="pageMarginLeft">
+		80pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Right margin
+		</desc>
+	</doc>
+	<xsl:param name="pageMarginRight">
+		150pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Margin at top of text area
+		</desc>
+	</doc>
+	<xsl:param name="pageMarginTop">
+		75pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Paper width
+		</desc>
+	</doc>
+	<xsl:param name="pageWidth">
+		211mm
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Maximum space allowed between paragraphs
+		</desc>
+	</doc>
+	<xsl:param name="parSkipmax">
+		12pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="anyURI">
+		<desc>
+			External XML file containing specifications for column sizes for
+			tables in document
+		</desc>
+	</doc>
+	<xsl:param name="readColSpecFile" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Region after
+		</desc>
+	</doc>
+	<xsl:param name="regionAfterExtent">
+		14pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Region before
+		</desc>
+	</doc>
+	<xsl:param name="regionBeforeExtent">
+		14pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Construct running headers from page number and section headings
+		</desc>
+	</doc>
+	<xsl:param name="sectionHeaders">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space after bibliography
+		</desc>
+	</doc>
+	<xsl:param name="spaceAfterBibl">
+		0pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space above and below a table
+		</desc>
+	</doc>
+	<xsl:param name="spaceAroundTable">
+		8pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space above bibliography
+		</desc>
+	</doc>
+	<xsl:param name="spaceBeforeBibl">
+		4pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Space below caption of figure or table
+		</desc>
+	</doc>
+	<xsl:param name="spaceBelowCaption">
+		4pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Make title page
+		</desc>
+	</doc>
+	<xsl:param name="titlePage">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Make 2-page spreads
+		</desc>
+	</doc>
+	<xsl:param name="twoSided">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>
+			Language (for hyphenation)
+		</desc>
+	</doc>
+	<xsl:param name="language">
+		en_US
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>
+			<p>Name of intended XSL FO engine</p>
+			<p>
+				This is used to tailor the result for different XSL FO processors.
+				By default, no special measures are taken, so
+				there are no bookmarks or other such features. Possible values are
+				<ul xmlns="http://www.w3.org/1999/XSL/Format">
+					<li>passivetex (the TeX-based PassiveTeX processor</li>
+					<li>xep (XEP)</li>
+					<li>fop (FOP)</li>
+					<li>antenna (Antenna House)</li>
+				</ul>
+			</p>
+		</desc>
+	</doc>
+	<xsl:param name="foEngine" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="boolean">
+		<desc>
+			Make &lt;lb&gt; active (ie cause a line break)
+		</desc>
+	</doc>
+	<xsl:param name="activeLinebreaks">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Alignment of text (ie justified or ragged)
+		</desc>
+	</doc>
+	<xsl:param name="alignment">
+		justify
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font size for display of author name
+		</desc>
+	</doc>
+	<xsl:param name="authorSize">
+		14pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font size for bibliography
+		</desc>
+	</doc>
+	<xsl:param name="biblSize">
+		16pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Default font for body
+		</desc>
+	</doc>
+	<xsl:param name="bodyFont">
+		Times
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Default font size for body (without dimension)
+		</desc>
+	</doc>
+	<xsl:param name="bodyMaster">
+		10
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Calculation of normal body font size (add dimension)
+		</desc>
+	</doc>
+	<xsl:param name="bodySize">
+		<xsl:value-of select="$bodyMaster" />
+		<xsl:text>pt</xsl:text>
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font size for display of date
+		</desc>
+	</doc>
+	<xsl:param name="dateSize">
+		14pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font for section headings
+		</desc>
+	</doc>
+	<xsl:param name="divFont">
+		Times
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>
+			[fo] How to display section headings in a cross-reference
+			<param name="head">section title</param>
+		</desc>
+	</doc>
+	<xsl:template name="divXRefHeading">
+		<xsl:param name="head">
+			<xsl:apply-templates mode="section"
+				select="tei:head" />
+		</xsl:param>
+		<xsl:text> (</xsl:text>
+		<xsl:value-of select="normalize-space($head)" />
+		<xsl:text>)</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Colour for display of &lt;eg&gt; blocks.
+		</desc>
+	</doc>
+	<xsl:param name="exampleColor">
+		black
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Colour for background display of &lt;eg&gt; blocks.
+		</desc>
+	</doc>
+	<xsl:param name="exampleBackgroundColor">
+		gray
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Calculation of font size for examples (add dimension)
+		</desc>
+	</doc>
+	<xsl:param name="exampleSize">
+		<xsl:value-of select="$bodyMaster * 0.6" />
+		<xsl:text>pt</xsl:text>
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Calculation of font size for quotations
+		</desc>
+	</doc>
+	<xsl:param name="quoteSize">
+		<xsl:value-of select="$bodyMaster * 0.9" />
+		<xsl:text>pt</xsl:text>
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font size for footnotes
+		</desc>
+	</doc>
+	<xsl:param name="footnoteSize">
+		<xsl:value-of select="$bodyMaster * 0.8.0" />
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font size for footnote numbers
+		</desc>
+	</doc>
+	<xsl:param name="footnotenumSize">
+		<xsl:value-of select="$bodyMaster * 0.7" />
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Colour for display of element names
+		</desc>
+	</doc>
+	<xsl:param name="giColor">
+		black
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Indentation of headings
+		</desc>
+	</doc>
+	<xsl:param name="headingOutdent">
+		0em
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="boolean">
+		<desc>
+			Hyphenate text
+		</desc>
+	</doc>
+	<xsl:param name="hyphenate">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Colour for display of &lt;ident&gt; values
+			Customization parameter.
+		</desc>
+	</doc>
+	<xsl:param name="identColor">
+		black
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo] Set attributes for display of links</desc>
+	</doc>
+	<xsl:template name="linkStyle">
+		<xsl:attribute name="text-decoration">underline</xsl:attribute>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font family for running header and footer
+		</desc>
+	</doc>
+	<xsl:param name="runFont">
+		sans-serif
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font size for running header and footer
+		</desc>
+	</doc>
+	<xsl:param name="runSize">
+		9pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Sans-serif font
+		</desc>
+	</doc>
+	<xsl:param name="sansFont">
+		Helvetica
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo] Set attributes for display of heading for chapters (level
+			0)</desc>
+	</doc>
+	<xsl:template name="setupDiv0">
+		<xsl:attribute name="font-size">18pt</xsl:attribute>
+		<xsl:attribute name="text-align">left</xsl:attribute>
+		<xsl:attribute name="font-weight">bold</xsl:attribute>
+		<xsl:attribute name="space-after">6pt</xsl:attribute>
+		<xsl:attribute name="space-before.optimum">12pt</xsl:attribute>
+		<xsl:attribute name="text-indent">
+         <xsl:value-of select="$headingOutdent" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] Set attributes for display of heading for 1st level sections</desc>
-   </doc>
-  <xsl:template name="setupDiv1">
-      <xsl:attribute name="font-size">14pt</xsl:attribute>
-      <xsl:attribute name="text-align">left</xsl:attribute>
-      <xsl:attribute name="font-weight">bold</xsl:attribute>
-      <xsl:attribute name="space-after">3pt</xsl:attribute>
-      <xsl:attribute name="space-before.optimum">9pt</xsl:attribute>
-      <xsl:attribute name="text-indent">
-         <xsl:value-of select="$headingOutdent"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo] Set attributes for display of heading for 1st level
+			sections</desc>
+	</doc>
+	<xsl:template name="setupDiv1">
+		<xsl:attribute name="font-size">14pt</xsl:attribute>
+		<xsl:attribute name="text-align">left</xsl:attribute>
+		<xsl:attribute name="font-weight">bold</xsl:attribute>
+		<xsl:attribute name="space-after">3pt</xsl:attribute>
+		<xsl:attribute name="space-before.optimum">9pt</xsl:attribute>
+		<xsl:attribute name="text-indent">
+         <xsl:value-of select="$headingOutdent" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] Set attributes for display of heading for 2nd level sections </desc>
-   </doc>
-  <xsl:template name="setupDiv2">
-      <xsl:attribute name="font-size">12pt</xsl:attribute>
-      <xsl:attribute name="text-align">left</xsl:attribute>
-      <xsl:attribute name="font-weight">bold</xsl:attribute>
-      <xsl:attribute name="font-style">italic</xsl:attribute>
-      <xsl:attribute name="space-after">2pt</xsl:attribute>
-      <xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
-      <xsl:attribute name="text-indent">
-         <xsl:value-of select="$headingOutdent"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo] Set attributes for display of heading for 2nd level
+			sections </desc>
+	</doc>
+	<xsl:template name="setupDiv2">
+		<xsl:attribute name="font-size">12pt</xsl:attribute>
+		<xsl:attribute name="text-align">left</xsl:attribute>
+		<xsl:attribute name="font-weight">bold</xsl:attribute>
+		<xsl:attribute name="font-style">italic</xsl:attribute>
+		<xsl:attribute name="space-after">2pt</xsl:attribute>
+		<xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
+		<xsl:attribute name="text-indent">
+         <xsl:value-of select="$headingOutdent" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo]Set attributes for display of heading for 3rd level sections </desc>
-   </doc>
-  <xsl:template name="setupDiv3">
-      <xsl:attribute name="font-size">10pt</xsl:attribute>
-      <xsl:attribute name="text-align">left</xsl:attribute>
-      <xsl:attribute name="font-style">italic</xsl:attribute>
-      <xsl:attribute name="space-after">0pt</xsl:attribute>
-      <xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
-      <xsl:attribute name="text-indent">
-         <xsl:value-of select="$headingOutdent"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo]Set attributes for display of heading for 3rd level sections </desc>
+	</doc>
+	<xsl:template name="setupDiv3">
+		<xsl:attribute name="font-size">10pt</xsl:attribute>
+		<xsl:attribute name="text-align">left</xsl:attribute>
+		<xsl:attribute name="font-style">italic</xsl:attribute>
+		<xsl:attribute name="space-after">0pt</xsl:attribute>
+		<xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
+		<xsl:attribute name="text-indent">
+         <xsl:value-of select="$headingOutdent" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] Set attributes for display of heading for 4th level sections </desc>
-   </doc>
-  <xsl:template name="setupDiv4">
-      <xsl:attribute name="font-size">10pt</xsl:attribute>
-      <xsl:attribute name="text-align">left</xsl:attribute>
-      <xsl:attribute name="font-style">italic</xsl:attribute>
-      <xsl:attribute name="space-after">0pt</xsl:attribute>
-      <xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
-      <xsl:attribute name="text-indent">
-         <xsl:value-of select="$headingOutdent"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo] Set attributes for display of heading for 4th level
+			sections </desc>
+	</doc>
+	<xsl:template name="setupDiv4">
+		<xsl:attribute name="font-size">10pt</xsl:attribute>
+		<xsl:attribute name="text-align">left</xsl:attribute>
+		<xsl:attribute name="font-style">italic</xsl:attribute>
+		<xsl:attribute name="space-after">0pt</xsl:attribute>
+		<xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
+		<xsl:attribute name="text-indent">
+         <xsl:value-of select="$headingOutdent" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] Set attributes for display of heading for 5th level sections </desc>
-   </doc>
-  <xsl:template name="setupDiv5">
-      <xsl:attribute name="font-size">10pt</xsl:attribute>
-      <xsl:attribute name="text-align">left</xsl:attribute>
-      <xsl:attribute name="font-style">italic</xsl:attribute>
-      <xsl:attribute name="space-after">0pt</xsl:attribute>
-      <xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
-      <xsl:attribute name="text-indent">
-         <xsl:value-of select="$headingOutdent"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo] Set attributes for display of heading for 5th level
+			sections </desc>
+	</doc>
+	<xsl:template name="setupDiv5">
+		<xsl:attribute name="font-size">10pt</xsl:attribute>
+		<xsl:attribute name="text-align">left</xsl:attribute>
+		<xsl:attribute name="font-style">italic</xsl:attribute>
+		<xsl:attribute name="space-after">0pt</xsl:attribute>
+		<xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
+		<xsl:attribute name="text-indent">
+         <xsl:value-of select="$headingOutdent" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] Set attributes for display of heading for 6th level sections </desc>
-   </doc>
-  <xsl:template name="setupDiv6">
-      <xsl:attribute name="font-size">10pt</xsl:attribute>
-      <xsl:attribute name="text-align">left</xsl:attribute>
-      <xsl:attribute name="font-style">italic</xsl:attribute>
-      <xsl:attribute name="space-after">0pt</xsl:attribute>
-      <xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
-      <xsl:attribute name="text-indent">
-         <xsl:value-of select="$headingOutdent"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo] Set attributes for display of heading for 6th level
+			sections </desc>
+	</doc>
+	<xsl:template name="setupDiv6">
+		<xsl:attribute name="font-size">10pt</xsl:attribute>
+		<xsl:attribute name="text-align">left</xsl:attribute>
+		<xsl:attribute name="font-style">italic</xsl:attribute>
+		<xsl:attribute name="space-after">0pt</xsl:attribute>
+		<xsl:attribute name="space-before.optimum">4pt</xsl:attribute>
+		<xsl:attribute name="text-indent">
+         <xsl:value-of select="$headingOutdent" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
-      <desc>[fo] How to display the link text of a &lt;ptr&gt;<param name="dest">the URL being linked to</param>
-      </desc>
-   </doc>
-  <xsl:template name="showXrefURL">
-      <xsl:param name="dest"/>
-      <xsl:value-of select="$dest"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Calculation of small font size (add dimension)
-</desc>
-   </doc>
-  <xsl:param name="smallSize">
-      <xsl:value-of select="$bodyMaster * 0.9"/>
-      <xsl:text>pt</xsl:text>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Create font size for tables, by reference to $bodyMaster
-</desc>
-   </doc>
-  <xsl:param name="tableSize">
-      <xsl:value-of select="$bodyMaster * 0.9"/>
-      <xsl:text>pt</xsl:text>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font size for display of title
-</desc>
-   </doc>
-  <xsl:param name="titleSize">16pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font size for TOC heading
-</desc>
-   </doc>
-  <xsl:param name="tocSize">16pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-      <desc>
-Font for literal code
-</desc>
-   </doc>
-  <xsl:param name="typewriterFont">Courier</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables" type="string">
-      <desc>
-Default colour for background of table cells which are labelling rows
-or columns</desc>
-   </doc>
-  <xsl:param name="defaultCellLabelBackground">silver</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables" type="boolean">
-      <desc>
-Force tables to appear inline
-</desc>
-   </doc>
-  <xsl:param name="inlineTables">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables" type="boolean">
-      <desc>
-Put a caption on tables  
-</desc>
-   </doc>
-  <xsl:param name="makeTableCaption">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables" type="string">
-      <desc>
-Alignment of table captions
-</desc>
-   </doc>
-  <xsl:param name="tableCaptionAlign">center</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables">
-      <desc>[fo] Set attributes for display of table </desc>
-   </doc>
-  <xsl:template name="tableCaptionstyle">
-      <xsl:attribute name="text-align">center</xsl:attribute>
-      <xsl:attribute name="font-style">italic</xsl:attribute>
-      <xsl:attribute name="end-indent">
-         <xsl:value-of select="$exampleMargin"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style">
+		<desc>[fo]
+			How to display the link text of a &lt;ptr&gt;
+			<param name="dest">the URL being linked to</param>
+		</desc>
+	</doc>
+	<xsl:template name="showXrefURL">
+		<xsl:param name="dest" />
+		<xsl:value-of select="$dest" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Calculation of small font size (add dimension)
+		</desc>
+	</doc>
+	<xsl:param name="smallSize">
+		<xsl:value-of select="$bodyMaster * 0.9" />
+		<xsl:text>pt</xsl:text>
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Create font size for tables, by reference to $bodyMaster
+		</desc>
+	</doc>
+	<xsl:param name="tableSize">
+		<xsl:value-of select="$bodyMaster * 0.9" />
+		<xsl:text>pt</xsl:text>
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font size for display of title
+		</desc>
+	</doc>
+	<xsl:param name="titleSize">
+		16pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font size for TOC heading
+		</desc>
+	</doc>
+	<xsl:param name="tocSize">
+		16pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>
+			Font for literal code
+		</desc>
+	</doc>
+	<xsl:param name="typewriterFont">
+		Courier
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables"
+		type="string">
+		<desc>
+			Default colour for background of table cells which are labelling rows
+			or columns</desc>
+	</doc>
+	<xsl:param name="defaultCellLabelBackground">
+		silver
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables"
+		type="boolean">
+		<desc>
+			Force tables to appear inline
+		</desc>
+	</doc>
+	<xsl:param name="inlineTables">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables"
+		type="boolean">
+		<desc>
+			Put a caption on tables
+		</desc>
+	</doc>
+	<xsl:param name="makeTableCaption">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables"
+		type="string">
+		<desc>
+			Alignment of table captions
+		</desc>
+	</doc>
+	<xsl:param name="tableCaptionAlign">
+		center
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables">
+		<desc>[fo] Set attributes for display of table </desc>
+	</doc>
+	<xsl:template name="tableCaptionstyle">
+		<xsl:attribute name="text-align">center</xsl:attribute>
+		<xsl:attribute name="font-style">italic</xsl:attribute>
+		<xsl:attribute name="end-indent">
+         <xsl:value-of select="$exampleMargin" />
       </xsl:attribute>
-      <xsl:attribute name="start-indent">
-         <xsl:value-of select="$exampleMargin"/>
+		<xsl:attribute name="start-indent">
+         <xsl:value-of select="$exampleMargin" />
       </xsl:attribute>
-      <xsl:attribute name="space-before">
-         <xsl:value-of select="$spaceAroundTable"/>
+		<xsl:attribute name="space-before">
+         <xsl:value-of select="$spaceAroundTable" />
       </xsl:attribute>
-      <xsl:attribute name="space-after">
-         <xsl:value-of select="$spaceBelowCaption"/>
+		<xsl:attribute name="space-after">
+         <xsl:value-of select="$spaceBelowCaption" />
       </xsl:attribute>
-      <xsl:attribute name="keep-with-next">always</xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables" type="string">
-      <desc>
-Default padding on table cells
-</desc>
-   </doc>
-  <xsl:param name="tableCellPadding">2pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>
-Indentation for level 0 TOC entries
-</desc>
-   </doc>
-  <xsl:param name="div0Tocindent">0in</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>
-Indentation for level 1 TOC entries
-</desc>
-   </doc>
-  <xsl:param name="div1Tocindent">0.25in</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>
-Indentation for level 2 TOC entries
-</desc>
-   </doc>
-  <xsl:param name="div2Tocindent">0.5in</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>
-Indentation for level 3 TOC entries
-</desc>
-   </doc>
-  <xsl:param name="div3Tocindent">0.75in</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>
-Indentation for level 4 TOC entries
-</desc>
-   </doc>
-  <xsl:param name="div4Tocindent">1in</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>
-    Indentation for level 5 TOC entries
-  </desc>
-   </doc>
-  <xsl:param name="div5Tocindent">1.25in</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="boolean">
-      <desc>
-Make TOC for sections in &lt;back&gt;
-</desc>
-   </doc>
-  <xsl:param name="tocBack">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="boolean">
-      <desc>
-Make TOC for sections in &lt;front&gt;
-</desc>
-   </doc>
-  <xsl:param name="tocFront">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="string">
-      <desc>
-Punctuation to insert after a section number in a TOC
-</desc>
-   </doc>
-  <xsl:param name="tocNumberSuffix">. </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc" type="integer">
-      <desc>
-Page number on which TOC should start
-</desc>
-   </doc>
-  <xsl:param name="tocStartPage">1</xsl:param>
+		<xsl:attribute name="keep-with-next">always</xsl:attribute>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables"
+		type="string">
+		<desc>
+			Default padding on table cells
+		</desc>
+	</doc>
+	<xsl:param name="tableCellPadding">
+		2pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>
+			Indentation for level 0 TOC entries
+		</desc>
+	</doc>
+	<xsl:param name="div0Tocindent">
+		0in
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>
+			Indentation for level 1 TOC entries
+		</desc>
+	</doc>
+	<xsl:param name="div1Tocindent">
+		0.25in
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>
+			Indentation for level 2 TOC entries
+		</desc>
+	</doc>
+	<xsl:param name="div2Tocindent">
+		0.5in
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>
+			Indentation for level 3 TOC entries
+		</desc>
+	</doc>
+	<xsl:param name="div3Tocindent">
+		0.75in
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>
+			Indentation for level 4 TOC entries
+		</desc>
+	</doc>
+	<xsl:param name="div4Tocindent">
+		1in
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>
+			Indentation for level 5 TOC entries
+		</desc>
+	</doc>
+	<xsl:param name="div5Tocindent">
+		1.25in
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="boolean">
+		<desc>
+			Make TOC for sections in &lt;back&gt; </desc>
+	</doc>
+	<xsl:param name="tocBack">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="boolean">
+		<desc>
+			Make TOC for sections in &lt;front&gt; </desc>
+	</doc>
+	<xsl:param name="tocFront">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="string">
+		<desc>
+			Punctuation to insert after a section number in a TOC
+		</desc>
+	</doc>
+	<xsl:param name="tocNumberSuffix">
+		.
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="toc"
+		type="integer">
+		<desc>
+			Page number on which TOC should start
+		</desc>
+	</doc>
+	<xsl:param name="tocStartPage">
+		1
+	</xsl:param>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei.xsl	(revision 2397)
@@ -1,93 +1,96 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei fotex m"
-                version="2.0">
-  <xsl:import href="../common2/tei.xsl"/>
-  <xsl:import href="tei-param.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:fotex="http://www.tug.org/fotex"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei fotex m" version="2.0">
+	<xsl:import href="../common2/tei.xsl" />
+	<xsl:import href="tei-param.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" type="string">
-      <desc>
-    Stylesheet constant for the input document.
-  </desc>
-   </doc>
-  <xsl:variable name="top" select="/"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" type="string">
-      <desc>
-    Stylesheet constant for table specifications
-  </desc>
-   </doc>
-  <xsl:variable name="tableSpecs">
-      <xsl:choose>
-         <xsl:when test="$readColSpecFile">
-            <xsl:copy-of select="document($readColSpecFile,$top)/Info"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <Info/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:variable>
-  <xsl:output indent="no" encoding="utf-8"/>
-  <xsl:strip-space elements="tei:cell"/>
-  <xsl:key name="DIVS"
-            match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5"
-            use="'1'"/>
-  <xsl:include href="tei-makecolspec.xsl"/>
-  <xsl:include href="core.xsl"/>
-  <xsl:include href="corpus.xsl"/>
-  <xsl:include href="drama.xsl"/>
-  <xsl:include href="figures.xsl"/>
-  <xsl:include href="header.xsl"/>
-  <xsl:include href="linking.xsl"/>
-  <xsl:include href="namesdates.xsl"/>
-  <xsl:include href="tagdocs.xsl"/>
-  <xsl:include href="textcrit.xsl"/>
-  <xsl:include href="textstructure.xsl"/>
-  <xsl:include href="transcr.xsl"/>
-  <xsl:include href="verse.xsl"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" type="string">
+		<desc>
+			Stylesheet constant for the input document.
+		</desc>
+	</doc>
+	<xsl:variable name="top" select="/" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" type="string">
+		<desc>
+			Stylesheet constant for table specifications
+		</desc>
+	</doc>
+	<xsl:variable name="tableSpecs">
+		<xsl:choose>
+			<xsl:when test="$readColSpecFile">
+				<xsl:copy-of
+					select="document($readColSpecFile,$top)/Info" />
+			</xsl:when>
+			<xsl:otherwise>
+				<Info />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	<xsl:output indent="no" encoding="utf-8" />
+	<xsl:strip-space elements="tei:cell" />
+	<xsl:key name="DIVS"
+		match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5" use="'1'" />
+	<xsl:include href="tei-makecolspec.xsl" />
+	<xsl:include href="core.xsl" />
+	<xsl:include href="corpus.xsl" />
+	<xsl:include href="drama.xsl" />
+	<xsl:include href="figures.xsl" />
+	<xsl:include href="header.xsl" />
+	<xsl:include href="linking.xsl" />
+	<xsl:include href="namesdates.xsl" />
+	<xsl:include href="tagdocs.xsl" />
+	<xsl:include href="textcrit.xsl" />
+	<xsl:include href="textstructure.xsl" />
+	<xsl:include href="transcr.xsl" />
+	<xsl:include href="verse.xsl" />
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/drama.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/drama.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/drama.xsl	(revision 2397)
@@ -1,243 +1,268 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      drama module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				drama module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:actor">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('normal')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:camera">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('normal')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:caption">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('normal')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:castGroup">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:castItem">
-      <xsl:call-template name="makeItem"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements castItem (when @type is 'list')</desc>
-   </doc>
-  <xsl:template match="tei:castItem[@type='list']">
-      <list-item>
-         <xsl:attribute name="space-before.optimum">
-            <xsl:value-of select="$listItemsep"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:actor">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('normal')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:camera">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('normal')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:caption">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('normal')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:castGroup">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:castItem">
+		<xsl:call-template name="makeItem" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements castItem (when @type is 'list')</desc>
+	</doc>
+	<xsl:template match="tei:castItem[@type='list']">
+		<list-item>
+			<xsl:attribute name="space-before.optimum">
+            <xsl:value-of select="$listItemsep" />
          </xsl:attribute>
-         <list-item-label end-indent="label-end()">
-            <xsl:if test="@xml:id">
-               <xsl:attribute name="id">
-                  <xsl:value-of select="@xml:id"/>
+			<list-item-label end-indent="label-end()">
+				<xsl:if test="@xml:id">
+					<xsl:attribute name="id">
+                  <xsl:value-of select="@xml:id" />
                </xsl:attribute>
-            </xsl:if>
-            <xsl:text>&#10;</xsl:text>
-            <block/>
-         </list-item-label>
-         <list-item-body start-indent="body-start()">
-            <block>
-               <xsl:call-template name="rend">
-                  <xsl:with-param name="defaultvalue" select="string('italic')"/>
-                  <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-               </xsl:call-template>
-               <xsl:text>(</xsl:text>
-               <xsl:apply-templates/>
-               <xsl:text>)</xsl:text>
-            </block>
-         </list-item-body>
-      </list-item>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:castList">
-      <xsl:if test="child::tei:head">
-         <block font-style="italic" text-align="start" space-before.optimum="4pt">
-            <xsl:for-each select="tei:head">
-               <xsl:apply-templates/>
-            </xsl:for-each>
-         </block>
-      </xsl:if>
-      <list-block>
-         <xsl:call-template name="setListIndents"/>
-         <xsl:apply-templates/>
-      </list-block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:sp">
-      <block text-align="justify" start-indent="1em" text-indent="-1em" space-before="3pt">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    
-         <p xmlns="http://www.w3.org/1999/XSL/Format"> paragraphs inside speeches do very little</p>
-    
-      </desc>
-   </doc>
-  <xsl:template match="tei:sp/tei:p">
-      <inline>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:speaker">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('italic')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-         <xsl:text> </xsl:text>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:stage">
-      <block>
-         <xsl:attribute name="text-indent">1em</xsl:attribute>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('italic')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:p/tei:stage">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('italic')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:sp/tei:stage">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('italic')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:tech">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('italic')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:view">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('italic')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
+				</xsl:if>
+				<xsl:text>&#10;</xsl:text>
+				<block />
+			</list-item-label>
+			<list-item-body start-indent="body-start()">
+				<block>
+					<xsl:call-template name="rend">
+						<xsl:with-param name="defaultvalue"
+							select="string('italic')" />
+						<xsl:with-param name="defaultstyle"
+							select="string('font-style')" />
+					</xsl:call-template>
+					<xsl:text>(</xsl:text>
+					<xsl:apply-templates />
+					<xsl:text>)</xsl:text>
+				</block>
+			</list-item-body>
+		</list-item>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:castList">
+		<xsl:if test="child::tei:head">
+			<block font-style="italic" text-align="start"
+				space-before.optimum="4pt">
+				<xsl:for-each select="tei:head">
+					<xsl:apply-templates />
+				</xsl:for-each>
+			</block>
+		</xsl:if>
+		<list-block>
+			<xsl:call-template name="setListIndents" />
+			<xsl:apply-templates />
+		</list-block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:sp">
+		<block text-align="justify" start-indent="1em"
+			text-indent="-1em" space-before="3pt">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			<p xmlns="http://www.w3.org/1999/XSL/Format"> paragraphs inside speeches do very little</p>
+
+		</desc>
+	</doc>
+	<xsl:template match="tei:sp/tei:p">
+		<inline>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:speaker">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('italic')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+			<xsl:text> </xsl:text>
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:stage">
+		<block>
+			<xsl:attribute name="text-indent">1em</xsl:attribute>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('italic')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:p/tei:stage">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('italic')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:sp/tei:stage">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('italic')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:tech">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('italic')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:view">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('italic')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/namesdates.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/namesdates.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/namesdates.xsl	(revision 2397)
@@ -1,55 +1,58 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes=" a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      namesdates module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes=" a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				namesdates module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: namesdates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: namesdates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tagdocs.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tagdocs.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tagdocs.xsl	(revision 2397)
@@ -1,61 +1,64 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes=" a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      tagdocs module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes=" a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				tagdocs module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tagdocs.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template name="specHook">
-      <xsl:param name="name"/>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tagdocs.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
+	<xsl:template name="specHook">
+		<xsl:param name="name" />
+	</xsl:template>
 
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/verse.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/verse.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/verse.xsl	(revision 2397)
@@ -1,55 +1,58 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes=" a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      verse module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes=" a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				verse module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: verse.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: verse.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/core.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/core.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/core.xsl	(revision 2397)
@@ -1,1339 +1,1375 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fotex rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet dealing  with elements from the core module, making XSL-FO output.
-      </p>
-         <p>
-This software is dual-licensed:
+<xsl:stylesheet xmlns:fotex="http://www.tug.org/fotex"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fotex rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet dealing with elements from the core module, making
+				XSL-FO output.
+			</p>
+			<p>
+				This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-      </p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: core.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements  processing-instruction()[name()='xmltex']</desc>
-   </doc>
-  <xsl:template match="processing-instruction()[name()='xmltex']">
-      <xsl:message>xmltex pi <xsl:value-of select="."/>
-      </xsl:message>
-      <xsl:copy-of select="."/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:ab">
-      <block>
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:abbr">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:add">
-      <xsl:choose>
-         <xsl:when test="@place='sup' or @place='above'">
-            <inline vertical-align="super">
-               <xsl:apply-templates/>
-            </inline>
-         </xsl:when>
-         <xsl:when test="@place='sub' or @place='below'">
-            <inline vertical-align="sub">
-               <xsl:apply-templates/>
-            </inline>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:byline">
-      <block text-align="center">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:cell//tei:lb">
-      <xsl:choose>
-         <xsl:when test="$foEngine='passivetex'">&#8232;</xsl:when>
-         <xsl:otherwise>
-            <inline linefeed-treatment="preserve">
-               <xsl:text>&#10;</xsl:text>
-            </inline>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:code">
-      <inline font-family="{$typewriterFont}">
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:corr">
-      <xsl:text>[</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>]</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@sic">
-            <footnote>
-               <footnote-citation>
-                  <inline font-size="8pt" vertical-align="super">
-                     <xsl:number format="a" level="any" count="tei:corr"/>
-                  </inline>
-               </footnote-citation>
-               <list-block>
-                  <xsl:attribute name="provisional-distance-between-starts">
-                     <xsl:value-of select="$betweenStarts"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: core.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements processing-instruction()[name()='xmltex']</desc>
+	</doc>
+	<xsl:template
+		match="processing-instruction()[name()='xmltex']">
+		<xsl:message>
+			xmltex pi
+			<xsl:value-of select="." />
+		</xsl:message>
+		<xsl:copy-of select="." />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:ab">
+		<block>
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:abbr">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:add">
+		<xsl:choose>
+			<xsl:when test="@place='sup' or @place='above'">
+				<inline vertical-align="super">
+					<xsl:apply-templates />
+				</inline>
+			</xsl:when>
+			<xsl:when test="@place='sub' or @place='below'">
+				<inline vertical-align="sub">
+					<xsl:apply-templates />
+				</inline>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:byline">
+		<block text-align="center">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:cell//tei:lb">
+		<xsl:choose>
+			<xsl:when test="$foEngine='passivetex'">&#8232;
+			</xsl:when>
+			<xsl:otherwise>
+				<inline linefeed-treatment="preserve">
+					<xsl:text>&#10;</xsl:text>
+				</inline>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:code">
+		<inline font-family="{$typewriterFont}">
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:corr">
+		<xsl:text>[</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>]</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@sic">
+				<footnote>
+					<footnote-citation>
+						<inline font-size="8pt" vertical-align="super">
+							<xsl:number format="a" level="any" count="tei:corr" />
+						</inline>
+					</footnote-citation>
+					<list-block>
+						<xsl:attribute
+							name="provisional-distance-between-starts">
+                     <xsl:value-of select="$betweenStarts" />
                   </xsl:attribute>
-                  <xsl:attribute name="provisional-label-separation">
-                     <xsl:value-of select="$labelSeparation"/>
+						<xsl:attribute name="provisional-label-separation">
+                     <xsl:value-of
+							select="$labelSeparation" />
                   </xsl:attribute>
-                  <list-item>
-                     <list-item-label end-indent="label-end()">
-                        <block>
-                           <inline font-size="{$footnoteSize}" vertical-align="super">
-                              <xsl:number format="a" level="any" count="tei:corr"/>
-                           </inline>
-                        </block>
-                     </list-item-label>
-                     <list-item-body start-indent="body-start()">
-                        <block font-size="{$footnoteSize}">
-                           <xsl:value-of select="@sic"/>
-                        </block>
-                     </list-item-body>
-                  </list-item>
-               </list-block>
-            </footnote>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:del">
-      <inline text-decoration="line-through">
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:eg">
-      <block font-family="{$typewriterFont}" background-color="{$exampleBackgroundColor}"
-             color="{$exampleColor}"
-             white-space-treatment="preserve"
-             linefeed-treatment="preserve"
-             white-space-collapse="false"
-             wrap-option="no-wrap"
-             text-indent="0em"
-             hyphenate="false"
-             start-indent="{$exampleMargin}"
-             text-align="start"
-             font-size="{$exampleSize}"
-             space-before.optimum="4pt"
-             space-after.optimum="4pt">
-         <xsl:if test="not($flowMarginLeft='')">
-            <xsl:attribute name="padding-start">
-               <xsl:value-of select="$exampleMargin"/>
+						<list-item>
+							<list-item-label end-indent="label-end()">
+								<block>
+									<inline font-size="{$footnoteSize}"
+										vertical-align="super">
+										<xsl:number format="a" level="any" count="tei:corr" />
+									</inline>
+								</block>
+							</list-item-label>
+							<list-item-body start-indent="body-start()">
+								<block font-size="{$footnoteSize}">
+									<xsl:value-of select="@sic" />
+								</block>
+							</list-item-body>
+						</list-item>
+					</list-block>
+				</footnote>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:del">
+		<inline text-decoration="line-through">
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:eg">
+		<block font-family="{$typewriterFont}"
+			background-color="{$exampleBackgroundColor}" color="{$exampleColor}"
+			white-space-treatment="preserve" linefeed-treatment="preserve"
+			white-space-collapse="false" wrap-option="no-wrap" text-indent="0em"
+			hyphenate="false" start-indent="{$exampleMargin}" text-align="start"
+			font-size="{$exampleSize}" space-before.optimum="4pt"
+			space-after.optimum="4pt">
+			<xsl:if test="not($flowMarginLeft='')">
+				<xsl:attribute name="padding-start">
+               <xsl:value-of select="$exampleMargin" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:if test="parent::tei:exemplum">
-            <xsl:text>&#10;</xsl:text>
-         </xsl:if>
-         <xsl:value-of select="translate(.,' ','&#160;')"/>
-      </block>
-  </xsl:template>
+			</xsl:if>
+			<xsl:if test="parent::tei:exemplum">
+				<xsl:text>&#10;</xsl:text>
+			</xsl:if>
+			<xsl:value-of select="translate(.,' ','&#160;')" />
+		</block>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="teix:egXML">
-      <xsl:param name="simple">false</xsl:param>
-      <xsl:param name="highlight"/>
-      <block font-family="{$typewriterFont}" background-color="{$exampleBackgroundColor}"
-             color="{$exampleColor}"
-             white-space-treatment="preserve"
-             linefeed-treatment="preserve"
-             white-space-collapse="false"
-             wrap-option="no-wrap"
-             text-indent="0em"
-             hyphenate="false"
-             start-indent="{$exampleMargin}"
-             text-align="start"
-             font-size="{$exampleSize}"
-             space-before.optimum="4pt"
-             space-after.optimum="4pt">
-         <xsl:if test="not($flowMarginLeft='')">
-            <xsl:attribute name="padding-start">
-               <xsl:value-of select="$exampleMargin"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="teix:egXML">
+		<xsl:param name="simple">
+			false
+		</xsl:param>
+		<xsl:param name="highlight" />
+		<block font-family="{$typewriterFont}"
+			background-color="{$exampleBackgroundColor}" color="{$exampleColor}"
+			white-space-treatment="preserve" linefeed-treatment="preserve"
+			white-space-collapse="false" wrap-option="no-wrap" text-indent="0em"
+			hyphenate="false" start-indent="{$exampleMargin}" text-align="start"
+			font-size="{$exampleSize}" space-before.optimum="4pt"
+			space-after.optimum="4pt">
+			<xsl:if test="not($flowMarginLeft='')">
+				<xsl:attribute name="padding-start">
+               <xsl:value-of select="$exampleMargin" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:apply-templates mode="verbatim">
-	           <xsl:with-param name="highlight">
-	              <xsl:value-of select="$highlight"/>
-	           </xsl:with-param>
-         </xsl:apply-templates>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:eg[@rend='kwic']/tei:lb"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:emph">
-      <inline font-style="italic">
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:epigraph">
-      <block text-align="center" space-before.optimum="4pt" space-after.optimum="4pt"
-             start-indent="{$exampleMargin}">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:epigraph/tei:lg">
-      <block text-align="center" space-before.optimum="4pt" space-after.optimum="4pt">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:epigraph/tei:q">
-      <block space-before.optimum="4pt" space-after.optimum="4pt"
-             start-indent="{$exampleMargin}">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:foreign">
-      <inline font-style="italic">
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:gap">
-      <inline border-style="solid">
-         <xsl:text>[</xsl:text>
-         <xsl:value-of select="@reason"/>
-         <xsl:text>]</xsl:text>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:gi">
-      <inline hyphenate="false" color="{$giColor}" font-family="{$typewriterFont}">
-         <xsl:text>&lt;</xsl:text>
-         <xsl:apply-templates/>
-         <xsl:text>&gt;</xsl:text>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:att">
-      <inline hyphenate="false" color="{$giColor}" font-family="{$typewriterFont}"
-              font-weight="bold">
-         <xsl:text>@</xsl:text>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:gloss">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:hi">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('bold')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-weight')"/>
-            <xsl:with-param name="rend" select="@rend"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:ident">
-      <inline color="{$identColor}" font-family="{$sansFont}">
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:index"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:interp">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:interpGrp">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:item" mode="catalogue">
-      <table-cell>
-         <block>
-            <xsl:choose>
-               <xsl:when test="tei:label">
-                  <inline font-weight="bold">
-                     <xsl:apply-templates select="tei:label" mode="print"/>
-                  </inline>
-               </xsl:when>
-               <xsl:otherwise>
-                  <inline font-weight="bold">
-                     <xsl:apply-templates mode="print" select="preceding-sibling::tei:*[1]"/>
-                  </inline>
-               </xsl:otherwise>
-            </xsl:choose>
-         </block>
-      </table-cell>
-      <table-cell>
-         <block>
-            <xsl:apply-templates/>
-         </block>
-      </table-cell>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:item|tei:biblStruct">
-      <xsl:call-template name="makeItem"/>
-  </xsl:template>
-  <xsl:template match="tei:item" mode="xref">
-      <xsl:variable name="listdepth" select="count(ancestor::tei:list)"/>
-      <xsl:if test="parent::tei:list[@type='bibliography']">
-         <xsl:text> [</xsl:text>
-      </xsl:if>
-      <xsl:variable name="listNFormat">
-         <xsl:choose>
-            <xsl:when test="$listdepth=1">
-               <xsl:text>1</xsl:text>
-            </xsl:when>
-            <xsl:when test="$listdepth=2">
-               <xsl:text>i</xsl:text>
-            </xsl:when>
-            <xsl:when test="$listdepth=3">
-               <xsl:text>a</xsl:text>
-            </xsl:when>
-            <xsl:when test="$listdepth=4">
-               <xsl:text>I</xsl:text>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:number format="{$listNFormat}"/>
-      <xsl:if test="parent::tei:list[@type='bibliography']">
-         <xsl:text>]</xsl:text>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:kw">
-      <inline font-style="italic">
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:l">
-      <block space-before.optimum="0pt" space-after.optimum="0pt">
-         <xsl:choose>
-            <xsl:when test="starts-with(@rend,'indent(')">
-               <xsl:attribute name="text-indent">
-                  <xsl:value-of select="concat(substring-before(substring-after(@rend,'('),')'),'em')"/>
+			</xsl:if>
+			<xsl:apply-templates mode="verbatim">
+				<xsl:with-param name="highlight">
+					<xsl:value-of select="$highlight" />
+				</xsl:with-param>
+			</xsl:apply-templates>
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:eg[@rend='kwic']/tei:lb" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:emph">
+		<inline font-style="italic">
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:epigraph">
+		<block text-align="center" space-before.optimum="4pt"
+			space-after.optimum="4pt" start-indent="{$exampleMargin}">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:epigraph/tei:lg">
+		<block text-align="center" space-before.optimum="4pt"
+			space-after.optimum="4pt">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:epigraph/tei:q">
+		<block space-before.optimum="4pt" space-after.optimum="4pt"
+			start-indent="{$exampleMargin}">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:foreign">
+		<inline font-style="italic">
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:gap">
+		<inline border-style="solid">
+			<xsl:text>[</xsl:text>
+			<xsl:value-of select="@reason" />
+			<xsl:text>]</xsl:text>
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:gi">
+		<inline hyphenate="false" color="{$giColor}"
+			font-family="{$typewriterFont}">
+			<xsl:text>&lt;</xsl:text>
+			<xsl:apply-templates />
+			<xsl:text>&gt;</xsl:text>
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:att">
+		<inline hyphenate="false" color="{$giColor}"
+			font-family="{$typewriterFont}" font-weight="bold">
+			<xsl:text>@</xsl:text>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:gloss">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:hi">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('bold')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-weight')" />
+				<xsl:with-param name="rend" select="@rend" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:ident">
+		<inline color="{$identColor}" font-family="{$sansFont}">
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:index" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:interp">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:interpGrp">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:item" mode="catalogue">
+		<table-cell>
+			<block>
+				<xsl:choose>
+					<xsl:when test="tei:label">
+						<inline font-weight="bold">
+							<xsl:apply-templates select="tei:label"
+								mode="print" />
+						</inline>
+					</xsl:when>
+					<xsl:otherwise>
+						<inline font-weight="bold">
+							<xsl:apply-templates mode="print"
+								select="preceding-sibling::tei:*[1]" />
+						</inline>
+					</xsl:otherwise>
+				</xsl:choose>
+			</block>
+		</table-cell>
+		<table-cell>
+			<block>
+				<xsl:apply-templates />
+			</block>
+		</table-cell>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:item|tei:biblStruct">
+		<xsl:call-template name="makeItem" />
+	</xsl:template>
+	<xsl:template match="tei:item" mode="xref">
+		<xsl:variable name="listdepth"
+			select="count(ancestor::tei:list)" />
+		<xsl:if test="parent::tei:list[@type='bibliography']">
+			<xsl:text> [</xsl:text>
+		</xsl:if>
+		<xsl:variable name="listNFormat">
+			<xsl:choose>
+				<xsl:when test="$listdepth=1">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:when test="$listdepth=2">
+					<xsl:text>i</xsl:text>
+				</xsl:when>
+				<xsl:when test="$listdepth=3">
+					<xsl:text>a</xsl:text>
+				</xsl:when>
+				<xsl:when test="$listdepth=4">
+					<xsl:text>I</xsl:text>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:number format="{$listNFormat}" />
+		<xsl:if test="parent::tei:list[@type='bibliography']">
+			<xsl:text>]</xsl:text>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:kw">
+		<inline font-style="italic">
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:l">
+		<block space-before.optimum="0pt" space-after.optimum="0pt">
+			<xsl:choose>
+				<xsl:when test="starts-with(@rend,'indent(')">
+					<xsl:attribute name="text-indent">
+                  <xsl:value-of
+						select="concat(substring-before(substring-after(@rend,'('),')'),'em')" />
                </xsl:attribute>
-            </xsl:when>
-            <xsl:when test="starts-with(@rend,'indent')">
-               <xsl:attribute name="text-indent">1em</xsl:attribute>
-            </xsl:when>
-         </xsl:choose>
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:label" mode="print">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:label"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:lb">
-      <xsl:choose>
-	<xsl:when test="$activeLinebreaks='true'">
-	  <xsl:choose>
-	    <!-- this is a *visible* linebreak character 
-		 PassiveTeX implements it as a real line break
-	    -->
-	    <xsl:when test="$foEngine='passivetex'">&#8232;</xsl:when>
-	    <xsl:when test="parent::tei:list">
-	      <list-item>
-		<list-item-label>
-		  <block/>
-		</list-item-label>
-		<list-item-body>
-		  <block/>
-		</list-item-body>
-	      </list-item>
-	    </xsl:when>
-	    <xsl:when test="parent::tei:hi">
-	      <inline
-		  white-space-treatment="preserve"
-		  white-space-collapse="false">&#xA;</inline>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <block/>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</xsl:when>
-	<xsl:otherwise>
-	  <inline font-size="8pt">
-	    <xsl:text>❡</xsl:text>
-	  </inline>
-	</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:list|tei:listBibl">
-      <xsl:if test="child::tei:head">
-         <block font-style="italic" text-align="start" space-before.optimum="4pt">
-            <xsl:for-each select="tei:head">
-               <xsl:apply-templates/>
-            </xsl:for-each>
-         </block>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="@type='runin'">
-            <block>
-               <xsl:apply-templates mode="runin"/>
-            </block>
-         </xsl:when>
-         <xsl:otherwise>
-            <list-block>
-               <xsl:call-template name="setListIndents"/>
-               <xsl:apply-templates/>
-            </list-block>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>cit element</desc>
-   </doc>
-  <xsl:template match="tei:cit">
-    <xsl:choose>
-      <xsl:when test="@rend='display'">
-	<block font-size="8pt">
-	  <xsl:apply-templates/>
-	</block>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Bibl elements</desc>
-   </doc>
-  <xsl:template match="tei:bibl">
-    <xsl:choose>
-      <xsl:when test="parent::tei:listBibl">
-	<xsl:call-template name="makeItem"/>
-      </xsl:when>
-      <xsl:otherwise>
-	<block>
-	  <xsl:apply-templates/>
-	</block>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:list[@type='catalogue']">
-      <block space-before="{$spaceAroundTable}" space-after="{$spaceAroundTable}">
-         <table>
-            <table-column column-number="1" column-width="20%">
-               <xsl:if test="$foEngine='passivetex'">
-                  <xsl:attribute name="column-align" namespace="http://www.tug.org/fotex">p</xsl:attribute>
-               </xsl:if>
-            </table-column>
-            <table-column column-number="2" column-width="80%">
-               <xsl:if test="$foEngine='passivetex'">
-                  <xsl:attribute name="column-align" namespace="http://www.tug.org/fotex">p</xsl:attribute>
-               </xsl:if>
-            </table-column>
-            <table-body>
-               <xsl:for-each select="tei:item">
-                  <table-row>
-                     <xsl:apply-templates select="." mode="catalogue"/>
-                  </table-row>
-               </xsl:for-each>
-            </table-body>
-         </table>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:lg">
-      <block start-indent="{$exampleMargin}" text-align="start" space-before.optimum="4pt"
-             space-after.optimum="4pt">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:mentioned">
-      <inline>
-         <xsl:call-template name="rend">
-            <xsl:with-param name="defaultvalue" select="string('italic')"/>
-            <xsl:with-param name="defaultstyle" select="string('font-style')"/>
-         </xsl:call-template>
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:milestone">
-      <block>
-         <xsl:text>******************</xsl:text>
-         <xsl:value-of select="@unit"/>
-         <xsl:text> </xsl:text>
-         <xsl:value-of select="@n"/>
-         <xsl:text>******************</xsl:text>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:name">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:note" mode="endnote">
-      <block id="{generate-id()}">
-         <xsl:call-template name="calculateEndNoteNumber"/>
-         <xsl:text>. </xsl:text>
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:note">
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:p or ancestor::tei:item or ancestor::tei:cit">
-            <xsl:apply-templates select="." mode="real"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <block>
-               <xsl:apply-templates select="." mode="real"/>
-            </block>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:note" mode="real">
-      <xsl:choose>
-         <xsl:when test="@place='end'">
-            <basic-link>
-               <xsl:attribute name="internal-destination">
-                  <xsl:value-of select="generate-id()"/>
+				</xsl:when>
+				<xsl:when test="starts-with(@rend,'indent')">
+					<xsl:attribute name="text-indent">1em</xsl:attribute>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:label" mode="print">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:label" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:lb">
+		<xsl:choose>
+			<xsl:when test="$activeLinebreaks='true'">
+				<xsl:choose>
+					<!-- this is a *visible* linebreak character PassiveTeX implements it 
+						as a real line break -->
+					<xsl:when test="$foEngine='passivetex'">&#8232;
+					</xsl:when>
+					<xsl:when test="parent::tei:list">
+						<list-item>
+							<list-item-label>
+								<block />
+							</list-item-label>
+							<list-item-body>
+								<block />
+							</list-item-body>
+						</list-item>
+					</xsl:when>
+					<xsl:when test="parent::tei:hi">
+						<inline white-space-treatment="preserve"
+							white-space-collapse="false">&#xA;
+						</inline>
+					</xsl:when>
+					<xsl:otherwise>
+						<block />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<inline font-size="8pt">
+					<xsl:text>❡</xsl:text>
+				</inline>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:list|tei:listBibl">
+		<xsl:if test="child::tei:head">
+			<block font-style="italic" text-align="start"
+				space-before.optimum="4pt">
+				<xsl:for-each select="tei:head">
+					<xsl:apply-templates />
+				</xsl:for-each>
+			</block>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@type='runin'">
+				<block>
+					<xsl:apply-templates mode="runin" />
+				</block>
+			</xsl:when>
+			<xsl:otherwise>
+				<list-block>
+					<xsl:call-template name="setListIndents" />
+					<xsl:apply-templates />
+				</list-block>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>cit element</desc>
+	</doc>
+	<xsl:template match="tei:cit">
+		<xsl:choose>
+			<xsl:when test="@rend='display'">
+				<block font-size="8pt">
+					<xsl:apply-templates />
+				</block>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Bibl elements</desc>
+	</doc>
+	<xsl:template match="tei:bibl">
+		<xsl:choose>
+			<xsl:when test="parent::tei:listBibl">
+				<xsl:call-template name="makeItem" />
+			</xsl:when>
+			<xsl:otherwise>
+				<block>
+					<xsl:apply-templates />
+				</block>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:list[@type='catalogue']">
+		<block space-before="{$spaceAroundTable}"
+			space-after="{$spaceAroundTable}">
+			<table>
+				<table-column column-number="1" column-width="20%">
+					<xsl:if test="$foEngine='passivetex'">
+						<xsl:attribute name="column-align"
+							namespace="http://www.tug.org/fotex">p</xsl:attribute>
+					</xsl:if>
+				</table-column>
+				<table-column column-number="2" column-width="80%">
+					<xsl:if test="$foEngine='passivetex'">
+						<xsl:attribute name="column-align"
+							namespace="http://www.tug.org/fotex">p</xsl:attribute>
+					</xsl:if>
+				</table-column>
+				<table-body>
+					<xsl:for-each select="tei:item">
+						<table-row>
+							<xsl:apply-templates select="."
+								mode="catalogue" />
+						</table-row>
+					</xsl:for-each>
+				</table-body>
+			</table>
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:lg">
+		<block start-indent="{$exampleMargin}" text-align="start"
+			space-before.optimum="4pt" space-after.optimum="4pt">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:mentioned">
+		<inline>
+			<xsl:call-template name="rend">
+				<xsl:with-param name="defaultvalue"
+					select="string('italic')" />
+				<xsl:with-param name="defaultstyle"
+					select="string('font-style')" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:milestone">
+		<block>
+			<xsl:text>******************</xsl:text>
+			<xsl:value-of select="@unit" />
+			<xsl:text> </xsl:text>
+			<xsl:value-of select="@n" />
+			<xsl:text>******************</xsl:text>
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:name">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:note" mode="endnote">
+		<block id="{generate-id()}">
+			<xsl:call-template name="calculateEndNoteNumber" />
+			<xsl:text>. </xsl:text>
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:note">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor::tei:p or ancestor::tei:item or ancestor::tei:cit">
+				<xsl:apply-templates select="." mode="real" />
+			</xsl:when>
+			<xsl:otherwise>
+				<block>
+					<xsl:apply-templates select="." mode="real" />
+				</block>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:note" mode="real">
+		<xsl:choose>
+			<xsl:when test="@place='end'">
+				<basic-link>
+					<xsl:attribute name="internal-destination">
+                  <xsl:value-of select="generate-id()" />
                </xsl:attribute>
-               <inline font-size="{$footnotenumSize}" vertical-align="super">
-                  <xsl:choose>
-                     <xsl:when test="@n">
-                        <xsl:value-of select="@n"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:call-template name="calculateEndNoteNumber"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </inline>
-            </basic-link>
-         </xsl:when>
-         <xsl:when test="@place='inline'">
-            <inline>
-               <xsl:text> (</xsl:text>
-               <xsl:apply-templates/>
-               <xsl:text>)</xsl:text>
-            </inline>
-         </xsl:when>
-         <xsl:when test="@place='display'">
-            <block text-indent="0pt" end-indent="{$exampleMargin}" start-indent="{$exampleMargin}"
-                   font-size="{$exampleSize}"
-                   space-before.optimum="{$exampleBefore}"
-                   space-after.optimum="{$exampleAfter}">
-               <xsl:apply-templates/>
-            </block>
-         </xsl:when>
-         <xsl:when test="@place='divtop'">
-            <block text-indent="0pt" end-indent="{$exampleMargin}" start-indent="{$exampleMargin}"
-                   font-style="italic"
-                   font-size="{$exampleSize}"
-                   space-before.optimum="{$exampleBefore}"
-                   space-after.optimum="{$exampleAfter}">
-               <xsl:apply-templates/>
-            </block>
-         </xsl:when>
-         <xsl:otherwise>
-	           <xsl:choose>
-	              <xsl:when test="parent::tei:item">
-	                 <block>
-	                    <xsl:call-template name="makeFootnote"/>
-	                 </block>
-	              </xsl:when>
-	              <xsl:otherwise>
-	                 <xsl:call-template name="makeFootnote"/>
-	              </xsl:otherwise>
-	           </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+					<inline font-size="{$footnotenumSize}"
+						vertical-align="super">
+						<xsl:choose>
+							<xsl:when test="@n">
+								<xsl:value-of select="@n" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="calculateEndNoteNumber" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</inline>
+				</basic-link>
+			</xsl:when>
+			<xsl:when test="@place='inline'">
+				<inline>
+					<xsl:text> (</xsl:text>
+					<xsl:apply-templates />
+					<xsl:text>)</xsl:text>
+				</inline>
+			</xsl:when>
+			<xsl:when test="@place='display'">
+				<block text-indent="0pt" end-indent="{$exampleMargin}"
+					start-indent="{$exampleMargin}" font-size="{$exampleSize}"
+					space-before.optimum="{$exampleBefore}"
+					space-after.optimum="{$exampleAfter}">
+					<xsl:apply-templates />
+				</block>
+			</xsl:when>
+			<xsl:when test="@place='divtop'">
+				<block text-indent="0pt" end-indent="{$exampleMargin}"
+					start-indent="{$exampleMargin}" font-style="italic"
+					font-size="{$exampleSize}" space-before.optimum="{$exampleBefore}"
+					space-after.optimum="{$exampleAfter}">
+					<xsl:apply-templates />
+				</block>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="parent::tei:item">
+						<block>
+							<xsl:call-template name="makeFootnote" />
+						</block>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="makeFootnote" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Create a footnote</desc>
-   </doc>
-    
-  <xsl:template name="makeFootnote">
-        <xsl:variable name="FootID">
-          <xsl:choose>
-            <xsl:when test="@n">
-              <xsl:value-of select="@n"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:call-template name="calculateFootnoteNumber"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <footnote>
-          <inline>
-            <xsl:if test="not(@target)">
-              <xsl:attribute name="font-size">
-                  <xsl:value-of select="$footnotenumSize"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Create a footnote</desc>
+	</doc>
+
+	<xsl:template name="makeFootnote">
+		<xsl:variable name="FootID">
+			<xsl:choose>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="calculateFootnoteNumber" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<footnote>
+			<inline>
+				<xsl:if test="not(@target)">
+					<xsl:attribute name="font-size">
+                  <xsl:value-of select="$footnotenumSize" />
               </xsl:attribute>
-              <xsl:attribute name="vertical-align">super</xsl:attribute>
-              <xsl:value-of select="$FootID"/>
-            </xsl:if>
-          </inline>
-          <footnote-body>
-            <block end-indent="0pt" start-indent="0pt" text-align="start" font-style="normal"
-                   text-indent="{$parIndent}"
-                   font-size="{$footnoteSize}">
-              <xsl:if test="@xml:id">
-                  <xsl:attribute name="id">
-                     <xsl:value-of select="@xml:id"/>
+					<xsl:attribute name="vertical-align">super</xsl:attribute>
+					<xsl:value-of select="$FootID" />
+				</xsl:if>
+			</inline>
+			<footnote-body>
+				<block end-indent="0pt" start-indent="0pt" text-align="start"
+					font-style="normal" text-indent="{$parIndent}"
+					font-size="{$footnoteSize}">
+					<xsl:if test="@xml:id">
+						<xsl:attribute name="id">
+                     <xsl:value-of select="@xml:id" />
                   </xsl:attribute>
-              </xsl:if>
-              <xsl:if test="not(@target)">
-                  <inline font-size="{$footnotenumSize}" vertical-align="super">
-                     <xsl:value-of select="$FootID"/>
-                  </inline>
-                  <xsl:text> </xsl:text>
-              </xsl:if>
-              <xsl:apply-templates/>
-            </block>
-          </footnote-body>
-        </footnote>
-   </xsl:template>
+					</xsl:if>
+					<xsl:if test="not(@target)">
+						<inline font-size="{$footnotenumSize}"
+							vertical-align="super">
+							<xsl:value-of select="$FootID" />
+						</inline>
+						<xsl:text> </xsl:text>
+					</xsl:if>
+					<xsl:apply-templates />
+				</block>
+			</footnote-body>
+		</footnote>
+	</xsl:template>
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element tei:p</desc>
-   </doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element tei:p</desc>
+	</doc>
 
-  <xsl:template match="tei:p">
-      <block>
-         <xsl:if test="preceding-sibling::tei:p">
-            <xsl:attribute name="text-indent">
-               <xsl:value-of select="$parIndent"/>
+	<xsl:template match="tei:p">
+		<block>
+			<xsl:if test="preceding-sibling::tei:p">
+				<xsl:attribute name="text-indent">
+               <xsl:value-of select="$parIndent" />
             </xsl:attribute>
-            <xsl:attribute name="space-before.optimum">
-               <xsl:value-of select="$parSkip"/>
+				<xsl:attribute name="space-before.optimum">
+               <xsl:value-of select="$parSkip" />
             </xsl:attribute>
-            <xsl:attribute name="space-before.maximum">
-               <xsl:value-of select="$parSkipmax"/>
+				<xsl:attribute name="space-before.maximum">
+               <xsl:value-of select="$parSkipmax" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:if test="@xml:lang">
-            <xsl:attribute name="country">
-               <xsl:value-of select="substring-before(@xml:lang,'-')"/>
+			</xsl:if>
+			<xsl:if test="@xml:lang">
+				<xsl:attribute name="country">
+               <xsl:value-of
+					select="substring-before(@xml:lang,'-')" />
             </xsl:attribute>
-            <xsl:attribute name="language">
-               <xsl:value-of select="substring-after(@xml:lang,'-')"/>
+				<xsl:attribute name="language">
+               <xsl:value-of
+					select="substring-after(@xml:lang,'-')" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:pb">
-      <xsl:variable name="e">
-         <xsl:choose>
-	   <xsl:when test="parent::tei:body or parent::tei:front or    parent::tei:back or parent::tei:div">
-	     <xsl:text>block</xsl:text>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:text>inline</xsl:text>
-	   </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="parent::tei:list"/>
-         <xsl:when test="$pagebreakStyle='active'">
-	           <xsl:element name="{$e}">
-	              <xsl:attribute name="break-before">page</xsl:attribute>
-	              <xsl:if test="@xml:id">
-	                 <xsl:attribute name="id">
-	                    <xsl:value-of select="@xml:id"/>
+			</xsl:if>
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:pb">
+		<xsl:variable name="e">
+			<xsl:choose>
+				<xsl:when
+					test="parent::tei:body or parent::tei:front or    parent::tei:back or parent::tei:div">
+					<xsl:text>block</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>inline</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="parent::tei:list" />
+			<xsl:when test="$pagebreakStyle='active'">
+				<xsl:element name="{$e}">
+					<xsl:attribute name="break-before">page</xsl:attribute>
+					<xsl:if test="@xml:id">
+						<xsl:attribute name="id">
+	                    <xsl:value-of select="@xml:id" />
 	                 </xsl:attribute>
-	              </xsl:if>
-	           </xsl:element>
-         </xsl:when>
-         <xsl:when test="$pagebreakStyle='visible'">
-	           <xsl:element name="{$e}">
-	              <xsl:if test="@xml:id">
-	                 <xsl:attribute name="id">
-	                    <xsl:value-of select="@xml:id"/>
+					</xsl:if>
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="$pagebreakStyle='visible'">
+				<xsl:element name="{$e}">
+					<xsl:if test="@xml:id">
+						<xsl:attribute name="id">
+	                    <xsl:value-of select="@xml:id" />
 	                 </xsl:attribute>
-	              </xsl:if>
-	              <xsl:text>✁[</xsl:text>
-	              <xsl:value-of select="@unit"/>
-	              <xsl:text> Page </xsl:text>
-	              <xsl:value-of select="@n"/>
-	              <xsl:text>]✁</xsl:text>
-	           </xsl:element>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
+					</xsl:if>
+					<xsl:text>✁[</xsl:text>
+					<xsl:value-of select="@unit" />
+					<xsl:text> Page </xsl:text>
+					<xsl:value-of select="@n" />
+					<xsl:text>]✁</xsl:text>
+				</xsl:element>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:quote">
-      <block text-align="start" text-indent="0pt" end-indent="{$exampleMargin}"
-             start-indent="{$exampleMargin}"
-             font-size="{$quoteSize}"
-             space-before.optimum="{$exampleBefore}"
-             space-after.optimum="{$exampleAfter}">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:quote">
+		<block text-align="start" text-indent="0pt"
+			end-indent="{$exampleMargin}" start-indent="{$exampleMargin}"
+			font-size="{$quoteSize}" space-before.optimum="{$exampleBefore}"
+			space-after.optimum="{$exampleAfter}">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:q">
-      <xsl:choose>
-         <xsl:when test="tei:text">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="@rend='display' or tei:p or tei:lg">
-            <block text-align="start" text-indent="0pt" end-indent="{$exampleMargin}"
-                   start-indent="{$exampleMargin}"
-                   font-size="{$quoteSize}"
-                   space-before.optimum="{$exampleBefore}"
-                   space-after.optimum="{$exampleAfter}">
-               <xsl:apply-templates/>
-            </block>
-         </xsl:when>
-         <xsl:when test="@rend='eg'">
-            <block text-align="start" font-size="{$exampleSize}" space-before.optimum="4pt"
-                   text-indent="0pt"
-                   space-after.optimum="4pt"
-                   start-indent="{$exampleMargin}"
-                   font-family="{$typewriterFont}">
-               <xsl:apply-templates/>
-            </block>
-         </xsl:when>
-         <xsl:when test="@rend = 'qwic'">
-            <block space-before="{$spaceAroundTable}" space-after="{$spaceAroundTable}">
-               <inline-container>
-                  <table font-size="{$exampleSize}" font-family="{$typewriterFont}"
-                         start-indent="{$exampleMargin}">
-                     <table-column column-number="1" column-width="">
-                        <xsl:if test="$foEngine='passivetex'">
-                           <xsl:attribute name="column-align" namespace="http://www.tug.org/fotex">p</xsl:attribute>
-                        </xsl:if>
-                     </table-column>
-                     <table-column column-number="2" column-width="">
-                        <xsl:if test="$foEngine='passivetex'">
-                           <xsl:attribute name="column-align" namespace="http://www.tug.org/fotex">l</xsl:attribute>
-                        </xsl:if>
-                     </table-column>
-                     <table-body>
-                        <xsl:for-each select="tei:q">
-                           <xsl:for-each select="tei:term">
-                              <table-row>
-                                 <table-cell>
-                                    <block>
-                                       <xsl:apply-templates select="preceding-sibling::node()"/>
-                                    </block>
-                                 </table-cell>
-                                 <table-cell>
-                                    <block>
-                                       <xsl:apply-templates/>
-                                       <xsl:apply-templates select="following-sibling::node()"/>
-                                    </block>
-                                 </table-cell>
-                              </table-row>
-                           </xsl:for-each>
-                        </xsl:for-each>
-                     </table-body>
-                  </table>
-               </inline-container>
-            </block>
-         </xsl:when>
-         <xsl:when test="starts-with(@rend,'kwic')">
-            <block space-before="{$spaceAroundTable}" space-after="{$spaceAroundTable}">
-               <inline-container>
-                  <table font-size="{$exampleSize}" start-indent="{$exampleMargin}"
-                         font-family="{$typewriterFont}">
-                     <table-column column-number="1" column-width="">
-                        <xsl:if test="$foEngine='passivetex'">
-                           <xsl:attribute name="column-align" namespace="http://www.tug.org/fotex">r</xsl:attribute>
-                        </xsl:if>
-                     </table-column>
-                     <table-column column-number="2" column-width="">
-                        <xsl:if test="$foEngine='passivetex'">
-                           <xsl:attribute name="column-align" namespace="http://www.tug.org/fotex">l</xsl:attribute>
-                        </xsl:if>
-                     </table-column>
-                     <table-body>
-                        <xsl:for-each select="tei:term">
-                           <table-row>
-                              <table-cell>
-                                 <block>
-                                    <xsl:value-of select="preceding-sibling::node()[1]"/>
-                                 </block>
-                              </table-cell>
-                              <table-cell>
-                                 <block>
-                                    <xsl:apply-templates/>
-                                    <xsl:value-of select="following-sibling::node()[1]"/>
-                                 </block>
-                              </table-cell>
-                           </table-row>
-                        </xsl:for-each>
-                     </table-body>
-                  </table>
-               </inline-container>
-            </block>
-         </xsl:when>
-         <xsl:when test="@rend='literal'">
-            <block white-space-collapse="false" wrap-option="no-wrap" font-size="{$exampleSize}"
-                   space-before.optimum="4pt"
-                   space-after.optimum="4pt"
-                   start-indent="{$exampleMargin}"
-                   font-family="{$typewriterFont}">
-               <xsl:apply-templates/>
-            </block>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>“</xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>”</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:reg">
-    <xsl:choose>
-      <xsl:when test="parent::tei:p">
-	<inline font-family="{$sansFont}">
-	  <xsl:apply-templates/>
-	</inline>
-      </xsl:when>
-      <xsl:otherwise>
-	<block font-family="{$sansFont}">
-	  <xsl:apply-templates/>
-	</block>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:rs">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:s">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:salute">
-      <block text-align="left">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:seg">
-      <block font-family="{$typewriterFont}" background-color="yellow"
-             white-space-collapse="false"
-             wrap-option="no-wrap"
-             text-indent="0em"
-             start-indent="{$exampleMargin}"
-             text-align="start"
-             font-size="{$exampleSize}"
-             padding-before="8pt"
-             padding-after="8pt"
-             space-before.optimum="4pt"
-             space-after.optimum="4pt">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:sic">
-      <xsl:apply-templates/>
-      <xsl:text> (sic)</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:signed">
-      <block text-align="left">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:term">
-      <inline font-style="italic">
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:unclear">
-      <inline text-decoration="blink">
-         <xsl:apply-templates/>
-      </inline>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="addID">
-      <xsl:attribute name="id">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:q">
+		<xsl:choose>
+			<xsl:when test="tei:text">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@rend='display' or tei:p or tei:lg">
+				<block text-align="start" text-indent="0pt"
+					end-indent="{$exampleMargin}" start-indent="{$exampleMargin}"
+					font-size="{$quoteSize}" space-before.optimum="{$exampleBefore}"
+					space-after.optimum="{$exampleAfter}">
+					<xsl:apply-templates />
+				</block>
+			</xsl:when>
+			<xsl:when test="@rend='eg'">
+				<block text-align="start" font-size="{$exampleSize}"
+					space-before.optimum="4pt" text-indent="0pt"
+					space-after.optimum="4pt" start-indent="{$exampleMargin}"
+					font-family="{$typewriterFont}">
+					<xsl:apply-templates />
+				</block>
+			</xsl:when>
+			<xsl:when test="@rend = 'qwic'">
+				<block space-before="{$spaceAroundTable}"
+					space-after="{$spaceAroundTable}">
+					<inline-container>
+						<table font-size="{$exampleSize}"
+							font-family="{$typewriterFont}" start-indent="{$exampleMargin}">
+							<table-column column-number="1" column-width="">
+								<xsl:if test="$foEngine='passivetex'">
+									<xsl:attribute name="column-align"
+										namespace="http://www.tug.org/fotex">p</xsl:attribute>
+								</xsl:if>
+							</table-column>
+							<table-column column-number="2" column-width="">
+								<xsl:if test="$foEngine='passivetex'">
+									<xsl:attribute name="column-align"
+										namespace="http://www.tug.org/fotex">l</xsl:attribute>
+								</xsl:if>
+							</table-column>
+							<table-body>
+								<xsl:for-each select="tei:q">
+									<xsl:for-each select="tei:term">
+										<table-row>
+											<table-cell>
+												<block>
+													<xsl:apply-templates
+														select="preceding-sibling::node()" />
+												</block>
+											</table-cell>
+											<table-cell>
+												<block>
+													<xsl:apply-templates />
+													<xsl:apply-templates
+														select="following-sibling::node()" />
+												</block>
+											</table-cell>
+										</table-row>
+									</xsl:for-each>
+								</xsl:for-each>
+							</table-body>
+						</table>
+					</inline-container>
+				</block>
+			</xsl:when>
+			<xsl:when test="starts-with(@rend,'kwic')">
+				<block space-before="{$spaceAroundTable}"
+					space-after="{$spaceAroundTable}">
+					<inline-container>
+						<table font-size="{$exampleSize}"
+							start-indent="{$exampleMargin}" font-family="{$typewriterFont}">
+							<table-column column-number="1" column-width="">
+								<xsl:if test="$foEngine='passivetex'">
+									<xsl:attribute name="column-align"
+										namespace="http://www.tug.org/fotex">r</xsl:attribute>
+								</xsl:if>
+							</table-column>
+							<table-column column-number="2" column-width="">
+								<xsl:if test="$foEngine='passivetex'">
+									<xsl:attribute name="column-align"
+										namespace="http://www.tug.org/fotex">l</xsl:attribute>
+								</xsl:if>
+							</table-column>
+							<table-body>
+								<xsl:for-each select="tei:term">
+									<table-row>
+										<table-cell>
+											<block>
+												<xsl:value-of
+													select="preceding-sibling::node()[1]" />
+											</block>
+										</table-cell>
+										<table-cell>
+											<block>
+												<xsl:apply-templates />
+												<xsl:value-of
+													select="following-sibling::node()[1]" />
+											</block>
+										</table-cell>
+									</table-row>
+								</xsl:for-each>
+							</table-body>
+						</table>
+					</inline-container>
+				</block>
+			</xsl:when>
+			<xsl:when test="@rend='literal'">
+				<block white-space-collapse="false" wrap-option="no-wrap"
+					font-size="{$exampleSize}" space-before.optimum="4pt"
+					space-after.optimum="4pt" start-indent="{$exampleMargin}"
+					font-family="{$typewriterFont}">
+					<xsl:apply-templates />
+				</block>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>“</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>”</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:reg">
+		<xsl:choose>
+			<xsl:when test="parent::tei:p">
+				<inline font-family="{$sansFont}">
+					<xsl:apply-templates />
+				</inline>
+			</xsl:when>
+			<xsl:otherwise>
+				<block font-family="{$sansFont}">
+					<xsl:apply-templates />
+				</block>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:rs">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:s">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:salute">
+		<block text-align="left">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:seg">
+		<block font-family="{$typewriterFont}" background-color="yellow"
+			white-space-collapse="false" wrap-option="no-wrap" text-indent="0em"
+			start-indent="{$exampleMargin}" text-align="start"
+			font-size="{$exampleSize}" padding-before="8pt" padding-after="8pt"
+			space-before.optimum="4pt" space-after.optimum="4pt">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:sic">
+		<xsl:apply-templates />
+		<xsl:text> (sic)</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:signed">
+		<block text-align="left">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:term">
+		<inline font-style="italic">
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:unclear">
+		<inline text-decoration="blink">
+			<xsl:apply-templates />
+		</inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="addID">
+		<xsl:attribute name="id">
          <xsl:choose>
             <xsl:when test="@xml:id">
-               <xsl:value-of select="@xml:id"/>
+               <xsl:value-of select="@xml:id" />
             </xsl:when>
             <xsl:otherwise>
-               <xsl:value-of select="generate-id()"/>
+               <xsl:value-of select="generate-id()" />
             </xsl:otherwise>
          </xsl:choose>
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] process "rend" attribute<param name="value">value of "rend" attribute</param>
-      </desc>
-   </doc>
-  <xsl:template name="applyRend">
-      <xsl:param name="value"/>
-      <xsl:choose>
-         <xsl:when test="$value='gothic'">
-            <xsl:attribute name="font-family">fantasy</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='calligraphic'">
-            <xsl:attribute name="font-family">cursive</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='ital' or $value='italic' or $value='it' or $value='i' or $value='italics'">
-            <xsl:attribute name="font-style">italic</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='sc'">
-            <xsl:attribute name="font-variant">small-caps</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='code'">
-            <xsl:attribute name="font-family">
-               <xsl:value-of select="$typewriterFont"/>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo] process "rend" attribute
+			<param name="value">value of "rend" attribute</param>
+		</desc>
+	</doc>
+	<xsl:template name="applyRend">
+		<xsl:param name="value" />
+		<xsl:choose>
+			<xsl:when test="$value='gothic'">
+				<xsl:attribute name="font-family">fantasy</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='calligraphic'">
+				<xsl:attribute name="font-family">cursive</xsl:attribute>
+			</xsl:when>
+			<xsl:when
+				test="$value='ital' or $value='italic' or $value='it' or $value='i' or $value='italics'">
+				<xsl:attribute name="font-style">italic</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='sc'">
+				<xsl:attribute name="font-variant">small-caps</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='code'">
+				<xsl:attribute name="font-family">
+               <xsl:value-of select="$typewriterFont" />
             </xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='bo' or $value='bold'">
-            <xsl:attribute name="font-weight">bold</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='BO'">
-            <xsl:attribute name="font-style">italic</xsl:attribute>
-            <xsl:attribute name="text-decoration">underline</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='UL' or $value='ul'">
-            <xsl:attribute name="text-decoration">underline</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='sub'">
-            <xsl:attribute name="vertical-align">sub</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='small'">
-            <xsl:attribute name="font-size">small</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='strike'">
-            <xsl:attribute name="text-decoration">line-through</xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$value='sup'">
-            <xsl:attribute name="vertical-align">super</xsl:attribute>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="calculateEndNoteNumber">
-      <xsl:number level="any" format="i" count="tei:note[@place='end']"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="calculateFootnoteNumber">
-      <xsl:number from="tei:text" level="any" count="tei:note"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="makeItem">
-<!-- item behaviour depends on the type attribute of our parent:
-simple, bullets, ordered, gloss, unordered, or bibliography
--->
-    <xsl:variable name="listdepth" select="count(ancestor::tei:list)"/>
-      <list-item>
-         <xsl:if test="not(parent::tei:note[@place='foot' or @place='bottom' ])">
-            <xsl:attribute name="space-before.optimum">
-               <xsl:value-of select="$listItemsep"/>
+			</xsl:when>
+			<xsl:when test="$value='bo' or $value='bold'">
+				<xsl:attribute name="font-weight">bold</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='BO'">
+				<xsl:attribute name="font-style">italic</xsl:attribute>
+				<xsl:attribute name="text-decoration">underline</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='UL' or $value='ul'">
+				<xsl:attribute name="text-decoration">underline</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='sub'">
+				<xsl:attribute name="vertical-align">sub</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='small'">
+				<xsl:attribute name="font-size">small</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='strike'">
+				<xsl:attribute name="text-decoration">line-through</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$value='sup'">
+				<xsl:attribute name="vertical-align">super</xsl:attribute>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="calculateEndNoteNumber">
+		<xsl:number level="any" format="i"
+			count="tei:note[@place='end']" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="calculateFootnoteNumber">
+		<xsl:number from="tei:text" level="any" count="tei:note" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="makeItem">
+		<!-- item behaviour depends on the type attribute of our parent: simple, 
+			bullets, ordered, gloss, unordered, or bibliography -->
+		<xsl:variable name="listdepth"
+			select="count(ancestor::tei:list)" />
+		<list-item>
+			<xsl:if
+				test="not(parent::tei:note[@place='foot' or @place='bottom' ])">
+				<xsl:attribute name="space-before.optimum">
+               <xsl:value-of select="$listItemsep" />
             </xsl:attribute>
-         </xsl:if>
-         <list-item-label end-indent="label-end()">
-            <xsl:if test="@xml:id">
-               <xsl:attribute name="id">
-                  <xsl:value-of select="@xml:id"/>
+			</xsl:if>
+			<list-item-label end-indent="label-end()">
+				<xsl:if test="@xml:id">
+					<xsl:attribute name="id">
+                  <xsl:value-of select="@xml:id" />
                </xsl:attribute>
-            </xsl:if>
-            <xsl:text>&#10;</xsl:text>
-            <block>
-               <xsl:choose>
-                  <xsl:when test="@n">
-                     <xsl:attribute name="text-align">end</xsl:attribute>
-                     <xsl:value-of select="@n"/>
-                  </xsl:when>
-                  <xsl:when test="../@type='bibliography'">
-                     <xsl:attribute name="text-align">end</xsl:attribute>
-                     <xsl:apply-templates mode="xref" select="."/>
-                  </xsl:when>
-                  <xsl:when test="../@type='ordered' or self::tei:bibl">
-                     <xsl:attribute name="text-align">end</xsl:attribute>
-                     <xsl:apply-templates mode="xref" select="."/>
-                     <xsl:text>.</xsl:text>
-                  </xsl:when>
-                  <xsl:when test="../@type='gloss'">
-                     <xsl:attribute name="text-align">start</xsl:attribute>
-                     <xsl:attribute name="font-weight">bold</xsl:attribute>
-                     <xsl:choose>
-		       <xsl:when test="tei:label">
-			 <xsl:apply-templates mode="print" select="tei:label"/>
-		       </xsl:when>
-		       <xsl:otherwise>
-			 <xsl:apply-templates mode="print" select="preceding-sibling::tei:*[1]"/>
-		       </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:when test="../@type='numbered' or
+				</xsl:if>
+				<xsl:text>&#10;</xsl:text>
+				<block>
+					<xsl:choose>
+						<xsl:when test="@n">
+							<xsl:attribute name="text-align">end</xsl:attribute>
+							<xsl:value-of select="@n" />
+						</xsl:when>
+						<xsl:when test="../@type='bibliography'">
+							<xsl:attribute name="text-align">end</xsl:attribute>
+							<xsl:apply-templates mode="xref" select="." />
+						</xsl:when>
+						<xsl:when test="../@type='ordered' or self::tei:bibl">
+							<xsl:attribute name="text-align">end</xsl:attribute>
+							<xsl:apply-templates mode="xref" select="." />
+							<xsl:text>.</xsl:text>
+						</xsl:when>
+						<xsl:when test="../@type='gloss'">
+							<xsl:attribute name="text-align">start</xsl:attribute>
+							<xsl:attribute name="font-weight">bold</xsl:attribute>
+							<xsl:choose>
+								<xsl:when test="tei:label">
+									<xsl:apply-templates mode="print"
+										select="tei:label" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:apply-templates mode="print"
+										select="preceding-sibling::tei:*[1]" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:when
+							test="../@type='numbered' or
 				  self::tei:biblStruct or self::tei:bibl">
-		    <!-- numbered support added rbl 26.3.2005 -->
-		    <xsl:attribute name="text-align">end</xsl:attribute>
-                     <xsl:number/>
-                     <xsl:text>.</xsl:text>
-                  </xsl:when>
-                  <xsl:when test="../@type='ordered'">
-		    <!-- numbered support added rbl 26.3.2005 -->
-		    <xsl:attribute name="text-align">end</xsl:attribute>
-		    <xsl:number/>
-		    <xsl:text>.</xsl:text>
-                  </xsl:when>
-                  <xsl:otherwise>
-		    <xsl:attribute name="text-align">end</xsl:attribute>
-		    <xsl:choose>
-		      <xsl:when test="$listdepth=0">
-			<xsl:value-of select="$bulletOne"/>
-		      </xsl:when>
-		      <xsl:when test="$listdepth=1">
-			<xsl:value-of select="$bulletOne"/>
-		      </xsl:when>
-		      <xsl:when test="$listdepth=2">
-			<xsl:value-of select="$bulletTwo"/>
-		      </xsl:when>
-		      <xsl:when test="$listdepth=3">
-			<xsl:value-of select="$bulletThree"/>
-		      </xsl:when>
-		      <xsl:when test="$listdepth=4">
-			<xsl:value-of select="$bulletFour"/>
-		      </xsl:when>
-		    </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </block>
-         </list-item-label>
-         <list-item-body start-indent="body-start()">
-	   <xsl:choose>
-	     <xsl:when test="* and tei:list">
-	       <xsl:for-each select="*">
-		 <xsl:choose>
-		   <xsl:when test="self::tei:list">
-		     <xsl:apply-templates select="."/>
-		   </xsl:when>
-		   <xsl:otherwise>
-		     <block font-weight="normal">
-		       <xsl:apply-templates/>
-		     </block>
-		   </xsl:otherwise>
-		 </xsl:choose>
-	       </xsl:for-each>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <block font-weight="normal">
-		 <xsl:apply-templates/>
-	       </block>
-	     </xsl:otherwise>
-	   </xsl:choose>
-         </list-item-body>
-      </list-item>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="defaultvalue">defaultvalue</param>
-         <param name="defaultstyle">defaultstyle</param>
-         <param name="rend">rend</param>
-      </desc>
-   </doc>
-  <xsl:template name="rend">
-      <xsl:param name="defaultvalue"/>
-      <xsl:param name="defaultstyle"/>
-      <xsl:param name="rend"/>
-      <xsl:choose>
-         <xsl:when test="$rend=''">
-            <xsl:attribute name="{$defaultstyle}">
-               <xsl:value-of select="$defaultvalue"/>
+							<!-- numbered support added rbl 26.3.2005 -->
+							<xsl:attribute name="text-align">end</xsl:attribute>
+							<xsl:number />
+							<xsl:text>.</xsl:text>
+						</xsl:when>
+						<xsl:when test="../@type='ordered'">
+							<!-- numbered support added rbl 26.3.2005 -->
+							<xsl:attribute name="text-align">end</xsl:attribute>
+							<xsl:number />
+							<xsl:text>.</xsl:text>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:attribute name="text-align">end</xsl:attribute>
+							<xsl:choose>
+								<xsl:when test="$listdepth=0">
+									<xsl:value-of select="$bulletOne" />
+								</xsl:when>
+								<xsl:when test="$listdepth=1">
+									<xsl:value-of select="$bulletOne" />
+								</xsl:when>
+								<xsl:when test="$listdepth=2">
+									<xsl:value-of select="$bulletTwo" />
+								</xsl:when>
+								<xsl:when test="$listdepth=3">
+									<xsl:value-of select="$bulletThree" />
+								</xsl:when>
+								<xsl:when test="$listdepth=4">
+									<xsl:value-of select="$bulletFour" />
+								</xsl:when>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</block>
+			</list-item-label>
+			<list-item-body start-indent="body-start()">
+				<xsl:choose>
+					<xsl:when test="* and tei:list">
+						<xsl:for-each select="*">
+							<xsl:choose>
+								<xsl:when test="self::tei:list">
+									<xsl:apply-templates select="." />
+								</xsl:when>
+								<xsl:otherwise>
+									<block font-weight="normal">
+										<xsl:apply-templates />
+									</block>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<block font-weight="normal">
+							<xsl:apply-templates />
+						</block>
+					</xsl:otherwise>
+				</xsl:choose>
+			</list-item-body>
+		</list-item>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="defaultvalue">defaultvalue</param>
+			<param name="defaultstyle">defaultstyle</param>
+			<param name="rend">rend</param>
+		</desc>
+	</doc>
+	<xsl:template name="rend">
+		<xsl:param name="defaultvalue" />
+		<xsl:param name="defaultstyle" />
+		<xsl:param name="rend" />
+		<xsl:choose>
+			<xsl:when test="$rend=''">
+				<xsl:attribute name="{$defaultstyle}">
+               <xsl:value-of select="$defaultvalue" />
             </xsl:attribute>
-         </xsl:when>
-         <xsl:when test="contains($rend,';')">
-            <xsl:call-template name="applyRend">
-               <xsl:with-param name="value" select="substring-before($rend,';')"/>
-            </xsl:call-template>
-            <xsl:call-template name="rend">
-               <xsl:with-param name="rend" select="substring-after($rend,';')"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="applyRend">
-               <xsl:with-param name="value" select="$rend"/>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] Spacing setup for list blocks</desc>
-   </doc>
-  <xsl:template name="setListIndents">
-      <xsl:attribute name="provisional-distance-between-starts">
+			</xsl:when>
+			<xsl:when test="contains($rend,';')">
+				<xsl:call-template name="applyRend">
+					<xsl:with-param name="value"
+						select="substring-before($rend,';')" />
+				</xsl:call-template>
+				<xsl:call-template name="rend">
+					<xsl:with-param name="rend"
+						select="substring-after($rend,';')" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="applyRend">
+					<xsl:with-param name="value" select="$rend" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] Spacing setup for list blocks</desc>
+	</doc>
+	<xsl:template name="setListIndents">
+		<xsl:attribute
+			name="provisional-distance-between-starts">
          <xsl:choose>
-            <xsl:when test="self::tei:listBibl[tei:biblStruct]">
-               <xsl:value-of select="$betweenBiblStarts"/>
+            <xsl:when
+			test="self::tei:listBibl[tei:biblStruct]">
+               <xsl:value-of select="$betweenBiblStarts" />
             </xsl:when>
             <xsl:when test="@type='gloss'">
-               <xsl:value-of select="$betweenGlossStarts"/>
+               <xsl:value-of select="$betweenGlossStarts" />
             </xsl:when>
             <xsl:otherwise>
-               <xsl:value-of select="$betweenStarts"/>
+               <xsl:value-of select="$betweenStarts" />
             </xsl:otherwise>
          </xsl:choose>
       </xsl:attribute>
-      <xsl:attribute name="provisional-label-separation">
-         <xsl:value-of select="$labelSeparation"/>
+		<xsl:attribute name="provisional-label-separation">
+         <xsl:value-of select="$labelSeparation" />
       </xsl:attribute>
-      <xsl:attribute name="text-indent">0em</xsl:attribute>
-      <xsl:attribute name="margin-right">
-         <xsl:value-of select="$listRightMargin"/>
+		<xsl:attribute name="text-indent">0em</xsl:attribute>
+		<xsl:attribute name="margin-right">
+         <xsl:value-of select="$listRightMargin" />
       </xsl:attribute>
-      <xsl:variable name="listdepth" select="count(ancestor::tei:list)"/>
-      <xsl:choose>
-         <xsl:when test="$listdepth=0">
-            <xsl:attribute name="space-before">
-               <xsl:value-of select="$listAbove-1"/>
+		<xsl:variable name="listdepth"
+			select="count(ancestor::tei:list)" />
+		<xsl:choose>
+			<xsl:when test="$listdepth=0">
+				<xsl:attribute name="space-before">
+               <xsl:value-of select="$listAbove-1" />
             </xsl:attribute>
-            <xsl:attribute name="space-after">
-               <xsl:value-of select="$listBelow-1"/>
+				<xsl:attribute name="space-after">
+               <xsl:value-of select="$listBelow-1" />
             </xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$listdepth=1">
-            <xsl:attribute name="space-before">
-               <xsl:value-of select="$listAbove-2"/>
+			</xsl:when>
+			<xsl:when test="$listdepth=1">
+				<xsl:attribute name="space-before">
+               <xsl:value-of select="$listAbove-2" />
             </xsl:attribute>
-            <xsl:attribute name="space-after">
-               <xsl:value-of select="$listBelow-2"/>
+				<xsl:attribute name="space-after">
+               <xsl:value-of select="$listBelow-2" />
             </xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$listdepth=2">
-            <xsl:attribute name="space-before">
-               <xsl:value-of select="$listAbove-3"/>
+			</xsl:when>
+			<xsl:when test="$listdepth=2">
+				<xsl:attribute name="space-before">
+               <xsl:value-of select="$listAbove-3" />
             </xsl:attribute>
-            <xsl:attribute name="space-after">
-               <xsl:value-of select="$listBelow-3"/>
+				<xsl:attribute name="space-after">
+               <xsl:value-of select="$listBelow-3" />
             </xsl:attribute>
-         </xsl:when>
-         <xsl:when test="$listdepth=3">
-            <xsl:attribute name="space-before">
-               <xsl:value-of select="$listAbove-4"/>
+			</xsl:when>
+			<xsl:when test="$listdepth=3">
+				<xsl:attribute name="space-before">
+               <xsl:value-of select="$listAbove-4" />
             </xsl:attribute>
-            <xsl:attribute name="space-after">
-               <xsl:value-of select="$listBelow-4"/>
+				<xsl:attribute name="space-after">
+               <xsl:value-of select="$listBelow-4" />
             </xsl:attribute>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element soCalled</desc>
-   </doc>
-  <xsl:template match="tei:soCalled">
-      <xsl:value-of select="$preQuote"/>
-      <xsl:apply-templates/>
-      <xsl:value-of select="$postQuote"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element soCalled</desc>
+	</doc>
+	<xsl:template match="tei:soCalled">
+		<xsl:value-of select="$preQuote" />
+		<xsl:apply-templates />
+		<xsl:value-of select="$postQuote" />
+	</xsl:template>
 
-   <xsl:template name="emphasize">
-      <xsl:param name="class"/>
-      <xsl:param name="content"/>
-      <xsl:choose>
-         <xsl:when test="$class='titlem'">
-            <inline>
-	      <xsl:attribute name="font-style">italic</xsl:attribute>
-	      <xsl:copy-of select="$content"/>
-            </inline>
-         </xsl:when>
-         <xsl:when test="$class='titlea'">
-            <xsl:text>‘</xsl:text>
-	    <xsl:copy-of select="$content"/>
-            <xsl:text>’</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:copy-of select="$content"/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template name="emphasize">
+		<xsl:param name="class" />
+		<xsl:param name="content" />
+		<xsl:choose>
+			<xsl:when test="$class='titlem'">
+				<inline>
+					<xsl:attribute name="font-style">italic</xsl:attribute>
+					<xsl:copy-of select="$content" />
+				</inline>
+			</xsl:when>
+			<xsl:when test="$class='titlea'">
+				<xsl:text>‘</xsl:text>
+				<xsl:copy-of select="$content" />
+				<xsl:text>’</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="$content" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="applyRendition"/>
+	<xsl:template name="applyRendition" />
 
-  <xsl:template name="makeSpan">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template name="makeSpan">
+		<xsl:apply-templates />
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/header.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/header.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/header.xsl	(revision 2397)
@@ -1,109 +1,114 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      header module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				header module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: header.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:docAuthor">
-      <block font-size="{$authorSize}">
-         <inline font-style="italic">
-            <xsl:apply-templates/>
-         </inline>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:docDate">
-      <block font-size="{$dateSize}">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:docTitle">
-      <block text-align="left" font-size="{$titleSize}">
-         <xsl:if test="ancestor::tei:group/tei:text/tei:front">
-            <xsl:attribute name="id">
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: header.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:docAuthor">
+		<block font-size="{$authorSize}">
+			<inline font-style="italic">
+				<xsl:apply-templates />
+			</inline>
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:docDate">
+		<block font-size="{$dateSize}">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:docTitle">
+		<block text-align="left" font-size="{$titleSize}">
+			<xsl:if test="ancestor::tei:group/tei:text/tei:front">
+				<xsl:attribute name="id">
                <xsl:choose>
-                  <xsl:when test="ancestor::tei:text[1]/@xml:id">
-                     <xsl:value-of select="translate(ancestor::tei:text[1]/@xml:id,'_','-')"/>
+                  <xsl:when
+					test="ancestor::tei:text[1]/@xml:id">
+                     <xsl:value-of
+					select="translate(ancestor::tei:text[1]/@xml:id,'_','-')" />
                   </xsl:when>
                   <xsl:otherwise>
-                     <xsl:value-of select="generate-id()"/>
+                     <xsl:value-of select="generate-id()" />
                   </xsl:otherwise>
                </xsl:choose>
             </xsl:attribute>
-         </xsl:if>
-         <xsl:apply-templates select="tei:titlePart"/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    
-         <p xmlns="http://www.w3.org/1999/XSL/Format"> Ignore the header </p>
-    
-      </desc>
-   </doc>
-  <xsl:template match="tei:teiHeader">
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="textTitle">
-      <xsl:param name="N"/>
-      <xsl:apply-templates select="tei:front"/>
-  </xsl:template>
+			</xsl:if>
+			<xsl:apply-templates select="tei:titlePart" />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			<p xmlns="http://www.w3.org/1999/XSL/Format"> Ignore the header </p>
+
+		</desc>
+	</doc>
+	<xsl:template match="tei:teiHeader">
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="textTitle">
+		<xsl:param name="N" />
+		<xsl:apply-templates select="tei:front" />
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/linking.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/linking.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/linking.xsl	(revision 2397)
@@ -1,131 +1,142 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-		xmlns:xs="http://www.w3.org/2001/XMLSchema"                
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix xs"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      linking module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix xs" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				linking module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: linking.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="where">target of link</param>
-      </desc>
-   </doc>
-  <xsl:template name="generateEndLink">
-      <xsl:param name="where"/>
-      <xsl:value-of select="$where"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="ptr">whether the destination URL is also the body
-    of the link</param>
-         <param name="dest">destination URL</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeExternalLink">
-      <xsl:param name="ptr" as="xs:boolean" select="false()"/>
-      <xsl:param name="dest"/>
-      <basic-link external-destination="url({$dest})">
-         <xsl:choose>
-            <xsl:when test="$ptr">
-               <xsl:call-template name="showXrefURL">
-                  <xsl:with-param name="dest">
-                     <xsl:value-of select="$dest"/>
-                  </xsl:with-param>
-               </xsl:call-template>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:apply-templates/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </basic-link>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="ptr">ptr</param>
-         <param name="target">target</param>
-         <param name="dest">destination</param>
-         <param name="body">body</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeInternalLink">
-      <xsl:param name="ptr" as="xs:boolean" select="false()"/>
-      <xsl:param name="class"/>
-      <xsl:param name="target"/>
-      <xsl:param name="dest"/>
-      <xsl:param name="body"/>
-      <xsl:variable name="W">
-         <xsl:choose>
-            <xsl:when test="$target">
-               <xsl:value-of select="$target"/>
-            </xsl:when>
-            <xsl:when test="contains($dest,'#')">
-               <xsl:value-of select="substring($dest,2)"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$dest"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <basic-link internal-destination="{$W}">
-         <xsl:call-template name="linkStyle"/>
-         <xsl:choose>
-            <xsl:when test="not($body='')">
-               <xsl:value-of select="$body"/>
-            </xsl:when>
-            <xsl:when test="$ptr">
-               <xsl:apply-templates mode="xref" select="id($W)">
-                  <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-               </xsl:apply-templates>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:apply-templates/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </basic-link>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: linking.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="where">target of link</param>
+		</desc>
+	</doc>
+	<xsl:template name="generateEndLink">
+		<xsl:param name="where" />
+		<xsl:value-of select="$where" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="ptr">whether the destination URL is also the body
+				of the link</param>
+			<param name="dest">destination URL</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeExternalLink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="dest" />
+		<basic-link external-destination="url({$dest})">
+			<xsl:choose>
+				<xsl:when test="$ptr">
+					<xsl:call-template name="showXrefURL">
+						<xsl:with-param name="dest">
+							<xsl:value-of select="$dest" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</basic-link>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="ptr">ptr</param>
+			<param name="target">target</param>
+			<param name="dest">destination</param>
+			<param name="body">body</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeInternalLink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="class" />
+		<xsl:param name="target" />
+		<xsl:param name="dest" />
+		<xsl:param name="body" />
+		<xsl:variable name="W">
+			<xsl:choose>
+				<xsl:when test="$target">
+					<xsl:value-of select="$target" />
+				</xsl:when>
+				<xsl:when test="contains($dest,'#')">
+					<xsl:value-of select="substring($dest,2)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$dest" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<basic-link internal-destination="{$W}">
+			<xsl:call-template name="linkStyle" />
+			<xsl:choose>
+				<xsl:when test="not($body='')">
+					<xsl:value-of select="$body" />
+				</xsl:when>
+				<xsl:when test="$ptr">
+					<xsl:apply-templates mode="xref"
+						select="id($W)">
+						<xsl:with-param name="minimal"
+							select="$minimalCrossRef" />
+					</xsl:apply-templates>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</basic-link>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/figures.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/figures.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/figures.xsl	(revision 2397)
@@ -1,472 +1,495 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes=" a fotex rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      figures module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns:fotex="http://www.tug.org/fotex"
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes=" a fotex rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				figures module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: figures.xsl 10042 2012-01-13 15:23:16Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Deal with elements in math mode (just copy them)</desc>
-   </doc>
-  <xsl:template match="m:*|@*|comment()|processing-instruction()|text()" mode="math">
-      <xsl:copy>
-         <xsl:apply-templates mode="math" select="*|@*|processing-instruction()|text()"/>
-      </xsl:copy>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process math elements</desc>
-   </doc>
-  <xsl:template match="m:math">
-      <m:math>
-         <xsl:copy-of select="@*"/>
-         <xsl:apply-templates mode="math"/>
-      </m:math>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:cell">
-      <table-cell>
-         <xsl:if test="@cols &gt; 1">
-            <xsl:attribute name="number-columns-spanned">
-               <xsl:value-of select="@cols"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: figures.xsl 10042 2012-01-13 15:23:16Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Deal with elements in math mode (just copy them)</desc>
+	</doc>
+	<xsl:template
+		match="m:*|@*|comment()|processing-instruction()|text()" mode="math">
+		<xsl:copy>
+			<xsl:apply-templates mode="math"
+				select="*|@*|processing-instruction()|text()" />
+		</xsl:copy>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process math elements</desc>
+	</doc>
+	<xsl:template match="m:math">
+		<m:math>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates mode="math" />
+		</m:math>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:cell">
+		<table-cell>
+			<xsl:if test="@cols &gt; 1">
+				<xsl:attribute name="number-columns-spanned">
+               <xsl:value-of select="@cols" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:if test="@rows &gt; 1">
-            <xsl:attribute name="number-rows-spanned">
-               <xsl:value-of select="@rows"/>
+			</xsl:if>
+			<xsl:if test="@rows &gt; 1">
+				<xsl:attribute name="number-rows-spanned">
+               <xsl:value-of select="@rows" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:call-template name="cellProperties"/>
-         <block>
-            <xsl:choose>
-               <xsl:when test="@role='label' or parent::tei:row[@role='label' or parent::tei:row[@role='header']]">
-                  <xsl:attribute name="font-weight">bold</xsl:attribute>
-               </xsl:when>
-            </xsl:choose>
-            <xsl:apply-templates/>
-         </block>
-      </table-cell>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:figDesc"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:figure">
-      <xsl:choose>
-         <xsl:when test="@rend='display' or tei:head or tei:p">
-            <float>
-               <xsl:call-template name="addID"/>
-               <block text-align="center">
-                  <xsl:choose>
-                     <xsl:when test="@url or @entity">
-                        <xsl:call-template name="makePic"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:apply-templates/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </block>
-               <block>
-                  <xsl:call-template name="figureCaptionstyle"/>
-                  <xsl:call-template name="calculateFigureNumber"/>
-                  <xsl:text>. </xsl:text>
-                  <xsl:apply-templates select="tei:head"/>
-               </block>
-            </float>
-         </xsl:when>
-         <xsl:otherwise>
-	           <block>
-	              <xsl:choose>
-	                 <xsl:when test="@url or @entity">
-	                    <xsl:call-template name="makePic"/>
-	                 </xsl:when>
-	                 <xsl:otherwise>
-	                    <xsl:apply-templates/>
-	                 </xsl:otherwise>
-	              </xsl:choose>
-	           </block>
-            <xsl:choose>
-               <xsl:when test="$captionInlineFigures='true'">
-                  <block>
-                     <xsl:call-template name="figureCaptionstyle"/>
-                     <xsl:call-template name="calculateFigureNumber"/>
-                     <xsl:text>. </xsl:text>
-                     <xsl:apply-templates select="tei:head"/>
-                  </block>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:if test="tei:head">
-                     <block text-align="center">
-                        <xsl:apply-templates select="tei:head"/>
-                     </block>
-                  </xsl:if>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:figure" mode="xref">
-      <xsl:if test="$showFloatLabel">
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">figureWord</xsl:with-param>
-         </xsl:call-template>
-         <xsl:text> </xsl:text>
-      </xsl:if>
-      <xsl:call-template name="calculateFigureNumber"/>
-      <xsl:if test="$showFloatHead='true' and tei:head">
-         <xsl:text> (</xsl:text>
-         <xsl:apply-templates select="tei:head"/>
-         <xsl:text>)</xsl:text>
-      </xsl:if>
-      <xsl:if test="$xrefShowPage='true'">
-    on page
-    <page-number-citation>
-            <xsl:attribute name="ref-id">
+			</xsl:if>
+			<xsl:call-template name="cellProperties" />
+			<block>
+				<xsl:choose>
+					<xsl:when
+						test="@role='label' or parent::tei:row[@role='label' or parent::tei:row[@role='header']]">
+						<xsl:attribute name="font-weight">bold</xsl:attribute>
+					</xsl:when>
+				</xsl:choose>
+				<xsl:apply-templates />
+			</block>
+		</table-cell>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:figDesc" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:figure">
+		<xsl:choose>
+			<xsl:when test="@rend='display' or tei:head or tei:p">
+				<float>
+					<xsl:call-template name="addID" />
+					<block text-align="center">
+						<xsl:choose>
+							<xsl:when test="@url or @entity">
+								<xsl:call-template name="makePic" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+					</block>
+					<block>
+						<xsl:call-template name="figureCaptionstyle" />
+						<xsl:call-template name="calculateFigureNumber" />
+						<xsl:text>. </xsl:text>
+						<xsl:apply-templates select="tei:head" />
+					</block>
+				</float>
+			</xsl:when>
+			<xsl:otherwise>
+				<block>
+					<xsl:choose>
+						<xsl:when test="@url or @entity">
+							<xsl:call-template name="makePic" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates />
+						</xsl:otherwise>
+					</xsl:choose>
+				</block>
+				<xsl:choose>
+					<xsl:when test="$captionInlineFigures='true'">
+						<block>
+							<xsl:call-template name="figureCaptionstyle" />
+							<xsl:call-template name="calculateFigureNumber" />
+							<xsl:text>. </xsl:text>
+							<xsl:apply-templates select="tei:head" />
+						</block>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:if test="tei:head">
+							<block text-align="center">
+								<xsl:apply-templates select="tei:head" />
+							</block>
+						</xsl:if>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:figure" mode="xref">
+		<xsl:if test="$showFloatLabel">
+			<xsl:call-template name="i18n">
+				<xsl:with-param name="word">
+					figureWord
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:text> </xsl:text>
+		</xsl:if>
+		<xsl:call-template name="calculateFigureNumber" />
+		<xsl:if test="$showFloatHead='true' and tei:head">
+			<xsl:text> (</xsl:text>
+			<xsl:apply-templates select="tei:head" />
+			<xsl:text>)</xsl:text>
+		</xsl:if>
+		<xsl:if test="$xrefShowPage='true'">
+			on page
+			<page-number-citation>
+				<xsl:attribute name="ref-id">
                <xsl:choose>
                   <xsl:when test="@xml:id">
-                     <xsl:value-of select="@xml:id"/>
+                     <xsl:value-of select="@xml:id" />
                   </xsl:when>
                   <xsl:otherwise>
-                     <xsl:value-of select="generate-id()"/>
+                     <xsl:value-of select="generate-id()" />
                   </xsl:otherwise>
                </xsl:choose>
             </xsl:attribute>
-         </page-number-citation> 
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:formula">
-      <wrapper>
-         <xsl:if test="@xml:id">
-            <xsl:attribute name="id">
-               <xsl:value-of select="@xml:id"/>
+			</page-number-citation>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:formula">
+		<wrapper>
+			<xsl:if test="@xml:id">
+				<xsl:attribute name="id">
+               <xsl:value-of select="@xml:id" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:apply-templates/>
-      </wrapper>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:formula" mode="xref">
-      <xsl:number/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:formula[@type='display']/m:math">
-      <m:math display="block">
-         <xsl:copy-of select="@*"/>
-         <xsl:apply-templates mode="math"/>
-      </m:math>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:formula[@type='subeqn']/m:math">
-      <xsl:apply-templates mode="math"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:graphic">
-      <xsl:call-template name="makePic"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:row[@role='header']">
-      <xsl:text>&#10;</xsl:text>
-      <table-header>
-         <xsl:apply-templates select="tei:cell"/>
-      </table-header>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:table" mode="xref">
-      <xsl:if test="$showFloatLabel">
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">tableWord</xsl:with-param>
-         </xsl:call-template>
-         <xsl:text> </xsl:text>
-      </xsl:if>
-      <xsl:if test="$showFloatHead='true' and tei:head">
-         <xsl:text> (</xsl:text>
-         <xsl:apply-templates select="tei:head"/>
-         <xsl:text>)</xsl:text>
-      </xsl:if>
-      <xsl:call-template name="calculateTableNumber"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:table">
-      <xsl:choose>
-         <xsl:when test="@rend='eqnarray' and $foEngine='passivetex'">
-            <fotex:eqnarray>
-               <xsl:apply-templates select=".//tei:formula"/>
-            </fotex:eqnarray>
-         </xsl:when>
-         <xsl:when test=".//tei:formula[@type='subeqn'] and $foEngine='passivetex'">
-            <fotex:eqnarray>
-               <xsl:apply-templates select=".//tei:formula"/>
-            </fotex:eqnarray>
-         </xsl:when>
-         <xsl:when test="$inlineTables or @rend='inline'">
-            <xsl:if test="tei:head">
-               <block>
-                  <xsl:call-template name="tableCaptionstyle"/>
-                  <xsl:call-template name="addID"/>
-                  <xsl:if test="$makeTableCaption='true'">
-		    <xsl:call-template name="calculateTableNumber"/>
-                     <xsl:text>. </xsl:text>
-                  </xsl:if>
-                  <xsl:apply-templates select="tei:head"/>
-               </block>
-            </xsl:if>
-            <xsl:call-template name="blockTable"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="floatTable"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:table[@rend='eqnarray']">
-      <xsl:choose>
-         <xsl:when test="$foEngine='passivetex'">
-            <fotex:eqnarray>
-               <xsl:for-each select="tei:row">
-                  <xsl:apply-templates select=".//tei:formula"/>
-                  <xsl:if test="following-sibling::tei:row">
-<!--        <character character="&#x2028;"/>-->
-              <xsl:processing-instruction name="xmltex">\\</xsl:processing-instruction>
-                  </xsl:if>
-               </xsl:for-each>
-            </fotex:eqnarray>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="blockTable">
-      <table text-align="{$tableAlign}" font-size="{$tableSize}">
-         <xsl:call-template name="addID"/>
-         <xsl:call-template name="deriveColSpecs"/>
-         <xsl:apply-templates select="tei:row[@role='header']"/>
-         <table-body text-indent="0pt">
-            <xsl:for-each select="tei:row[not(@role='header')]">
-               <xsl:text>&#10;</xsl:text>
-               <table-row>
-                  <xsl:apply-templates select="tei:cell"/>
-               </table-row>
-            </xsl:for-each>
-         </table-body>
-      </table>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] table cell properties</desc>
-   </doc>
-  <xsl:template name="cellProperties">
-      <xsl:if test="@role='hi' or @role='label' or   parent::tei:row/@role='label'  or parent::tei:row/@role='header'">
-         <xsl:attribute name="background-color">
-            <xsl:value-of select="$defaultCellLabelBackground"/>
+			</xsl:if>
+			<xsl:apply-templates />
+		</wrapper>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:formula" mode="xref">
+		<xsl:number />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:formula[@type='display']/m:math">
+		<m:math display="block">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates mode="math" />
+		</m:math>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:formula[@type='subeqn']/m:math">
+		<xsl:apply-templates mode="math" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:graphic">
+		<xsl:call-template name="makePic" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:row[@role='header']">
+		<xsl:text>&#10;</xsl:text>
+		<table-header>
+			<xsl:apply-templates select="tei:cell" />
+		</table-header>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:table" mode="xref">
+		<xsl:if test="$showFloatLabel">
+			<xsl:call-template name="i18n">
+				<xsl:with-param name="word">
+					tableWord
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:text> </xsl:text>
+		</xsl:if>
+		<xsl:if test="$showFloatHead='true' and tei:head">
+			<xsl:text> (</xsl:text>
+			<xsl:apply-templates select="tei:head" />
+			<xsl:text>)</xsl:text>
+		</xsl:if>
+		<xsl:call-template name="calculateTableNumber" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:table">
+		<xsl:choose>
+			<xsl:when test="@rend='eqnarray' and $foEngine='passivetex'">
+				<fotex:eqnarray>
+					<xsl:apply-templates select=".//tei:formula" />
+				</fotex:eqnarray>
+			</xsl:when>
+			<xsl:when
+				test=".//tei:formula[@type='subeqn'] and $foEngine='passivetex'">
+				<fotex:eqnarray>
+					<xsl:apply-templates select=".//tei:formula" />
+				</fotex:eqnarray>
+			</xsl:when>
+			<xsl:when test="$inlineTables or @rend='inline'">
+				<xsl:if test="tei:head">
+					<block>
+						<xsl:call-template name="tableCaptionstyle" />
+						<xsl:call-template name="addID" />
+						<xsl:if test="$makeTableCaption='true'">
+							<xsl:call-template name="calculateTableNumber" />
+							<xsl:text>. </xsl:text>
+						</xsl:if>
+						<xsl:apply-templates select="tei:head" />
+					</block>
+				</xsl:if>
+				<xsl:call-template name="blockTable" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="floatTable" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:table[@rend='eqnarray']">
+		<xsl:choose>
+			<xsl:when test="$foEngine='passivetex'">
+				<fotex:eqnarray>
+					<xsl:for-each select="tei:row">
+						<xsl:apply-templates select=".//tei:formula" />
+						<xsl:if test="following-sibling::tei:row">
+							<!-- <character character="&#x2028;"/> -->
+							<xsl:processing-instruction
+								name="xmltex">
+								\\
+							</xsl:processing-instruction>
+						</xsl:if>
+					</xsl:for-each>
+				</fotex:eqnarray>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="blockTable">
+		<table text-align="{$tableAlign}" font-size="{$tableSize}">
+			<xsl:call-template name="addID" />
+			<xsl:call-template name="deriveColSpecs" />
+			<xsl:apply-templates
+				select="tei:row[@role='header']" />
+			<table-body text-indent="0pt">
+				<xsl:for-each select="tei:row[not(@role='header')]">
+					<xsl:text>&#10;</xsl:text>
+					<table-row>
+						<xsl:apply-templates select="tei:cell" />
+					</table-row>
+				</xsl:for-each>
+			</table-body>
+		</table>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] table cell properties</desc>
+	</doc>
+	<xsl:template name="cellProperties">
+		<xsl:if
+			test="@role='hi' or @role='label' or   parent::tei:row/@role='label'  or parent::tei:row/@role='header'">
+			<xsl:attribute name="background-color">
+            <xsl:value-of
+				select="$defaultCellLabelBackground" />
          </xsl:attribute>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:table[1][@rend='frame']">
-            <xsl:if test="not(parent::tei:row/preceding-sibling::tei:row)">
-               <xsl:attribute name="border-before-style">solid</xsl:attribute>
-            </xsl:if>
-            <xsl:attribute name="border-after-style">solid</xsl:attribute>
-            <xsl:if test="not(following-sibling::tei:cell)">
-               <xsl:attribute name="border-end-style">solid</xsl:attribute>
-            </xsl:if>
-            <xsl:attribute name="border-start-style">solid</xsl:attribute>
-         </xsl:when>
-         <xsl:otherwise>
-  </xsl:otherwise>
-      </xsl:choose>
-      <xsl:if test="not(ancestor::tei:table/@rend='tight')">
-         <xsl:attribute name="padding">
-            <xsl:value-of select="$tableCellPadding"/>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:table[1][@rend='frame']">
+				<xsl:if
+					test="not(parent::tei:row/preceding-sibling::tei:row)">
+					<xsl:attribute name="border-before-style">solid</xsl:attribute>
+				</xsl:if>
+				<xsl:attribute name="border-after-style">solid</xsl:attribute>
+				<xsl:if test="not(following-sibling::tei:cell)">
+					<xsl:attribute name="border-end-style">solid</xsl:attribute>
+				</xsl:if>
+				<xsl:attribute name="border-start-style">solid</xsl:attribute>
+			</xsl:when>
+			<xsl:otherwise>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if test="not(ancestor::tei:table/@rend='tight')">
+			<xsl:attribute name="padding">
+            <xsl:value-of select="$tableCellPadding" />
          </xsl:attribute>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="@align">
-            <xsl:attribute name="text-align">
-               <xsl:value-of select="@align"/>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@align">
+				<xsl:attribute name="text-align">
+               <xsl:value-of select="@align" />
             </xsl:attribute>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="thiscol">
-               <xsl:value-of select="position()"/>
-            </xsl:variable>
-            <xsl:variable name="tid">
-               <xsl:value-of select="ancestor::tei:table/@xml:id"/>
-            </xsl:variable>
-            <xsl:variable name="align">
-               <xsl:value-of select="$tableSpecs/Info/TableSpec[@xml:id=$tid]/table-column[@column-number=$thiscol]/@fotex:column-align"/>
-            </xsl:variable>
-            <!--
-    <xsl:message>    Cell: whats my position: <xsl:value-of select="$thiscol"/>, <xsl:value-of select="$align"/>, <xsl:value-of select="$tid"/>
-</xsl:message>
--->
-        <xsl:choose>
-               <xsl:when test="$align='R'">
-                  <xsl:attribute name="text-align">right</xsl:attribute>
-               </xsl:when>
-               <xsl:when test="$align='L'">
-                  <xsl:attribute name="text-align">left</xsl:attribute>
-               </xsl:when>
-               <xsl:when test="$align='C'">
-                  <xsl:attribute name="text-align">center</xsl:attribute>
-               </xsl:when>
-               <xsl:when test="not($align='')">
-                  <xsl:attribute name="text-align">
-                     <xsl:value-of select="$align"/>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="thiscol">
+					<xsl:value-of select="position()" />
+				</xsl:variable>
+				<xsl:variable name="tid">
+					<xsl:value-of select="ancestor::tei:table/@xml:id" />
+				</xsl:variable>
+				<xsl:variable name="align">
+					<xsl:value-of
+						select="$tableSpecs/Info/TableSpec[@xml:id=$tid]/table-column[@column-number=$thiscol]/@fotex:column-align" />
+				</xsl:variable>
+				<!-- <xsl:message> Cell: whats my position: <xsl:value-of select="$thiscol"/>, 
+					<xsl:value-of select="$align"/>, <xsl:value-of select="$tid"/> </xsl:message> -->
+				<xsl:choose>
+					<xsl:when test="$align='R'">
+						<xsl:attribute name="text-align">right</xsl:attribute>
+					</xsl:when>
+					<xsl:when test="$align='L'">
+						<xsl:attribute name="text-align">left</xsl:attribute>
+					</xsl:when>
+					<xsl:when test="$align='C'">
+						<xsl:attribute name="text-align">center</xsl:attribute>
+					</xsl:when>
+					<xsl:when test="not($align='')">
+						<xsl:attribute name="text-align">
+                     <xsl:value-of select="$align" />
                   </xsl:attribute>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:attribute name="text-align">
-                     <xsl:value-of select="$cellAlign"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:attribute name="text-align">
+                     <xsl:value-of select="$cellAlign" />
                   </xsl:attribute>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="floatTable">
-      <table-and-caption>
-         <xsl:if test="rend='landscape'">
-            <xsl:attribute name="reference-direction">-90</xsl:attribute>
-         </xsl:if>
-         <xsl:call-template name="addID"/>
-         <table-caption>
-            <block text-align="{$tableCaptionAlign}" space-after="{$spaceBelowCaption}">
-               <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">tableWord</xsl:with-param>
-               </xsl:call-template>
-               <xsl:call-template name="calculateTableNumber"/>
-               <xsl:text>. </xsl:text>
-               <xsl:apply-templates select="tei:head"/>
-            </block>
-         </table-caption>
-         <xsl:call-template name="blockTable"/>
-      </table-and-caption>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] Insert reference to graphics file </desc>
-   </doc>
-  <xsl:template name="makePic">
-      <xsl:variable name="File">
-         <xsl:choose>
-            <xsl:when test="@url">
-               <xsl:value-of select="@url"/>
-            </xsl:when>
-            <xsl:when test="@entity">
-               <xsl:value-of select="unparsed-entity-uri(@entity)"/>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:variable>
-      <external-graphic>
-         <xsl:call-template name="addID"/>
-         <xsl:attribute name="src">
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="floatTable">
+		<table-and-caption>
+			<xsl:if test="rend='landscape'">
+				<xsl:attribute name="reference-direction">-90</xsl:attribute>
+			</xsl:if>
+			<xsl:call-template name="addID" />
+			<table-caption>
+				<block text-align="{$tableCaptionAlign}"
+					space-after="{$spaceBelowCaption}">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							tableWord
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:call-template name="calculateTableNumber" />
+					<xsl:text>. </xsl:text>
+					<xsl:apply-templates select="tei:head" />
+				</block>
+			</table-caption>
+			<xsl:call-template name="blockTable" />
+		</table-and-caption>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] Insert reference to graphics file </desc>
+	</doc>
+	<xsl:template name="makePic">
+		<xsl:variable name="File">
+			<xsl:choose>
+				<xsl:when test="@url">
+					<xsl:value-of select="@url" />
+				</xsl:when>
+				<xsl:when test="@entity">
+					<xsl:value-of select="unparsed-entity-uri(@entity)" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<external-graphic>
+			<xsl:call-template name="addID" />
+			<xsl:attribute name="src">
             <xsl:text>url(</xsl:text>
             <xsl:if test="not(starts-with($File,'./'))">
-               <xsl:value-of select="$graphicsPrefix"/>
+               <xsl:value-of select="$graphicsPrefix" />
             </xsl:if>
-            <xsl:value-of select="$File"/>
+            <xsl:value-of select="$File" />
             <xsl:if test="not(contains($File,'.'))">
-               <xsl:value-of select="$graphicsSuffix"/>
+               <xsl:value-of select="$graphicsSuffix" />
             </xsl:if>
             <xsl:text>)</xsl:text>
          </xsl:attribute>
-         <xsl:call-template name="graphicsAttributes">
-            <xsl:with-param name="mode">fo</xsl:with-param>
-         </xsl:call-template>
-      </external-graphic>
-  </xsl:template>
+			<xsl:call-template name="graphicsAttributes">
+				<xsl:with-param name="mode">
+					fo
+				</xsl:with-param>
+			</xsl:call-template>
+		</external-graphic>
+	</xsl:template>
 
-  <xsl:template match="tei:binaryObject">
-    <external-graphic>
-      <xsl:attribute name="src">
+	<xsl:template match="tei:binaryObject">
+		<external-graphic>
+			<xsl:attribute name="src">
 	<xsl:text>url('data:image/auto;base64,</xsl:text>
-	<xsl:value-of select="."/>
+	<xsl:value-of select="." />
 	<xsl:text>')</xsl:text>
       </xsl:attribute>
-      <xsl:call-template name="graphicsAttributes">
-	<xsl:with-param name="mode">fo</xsl:with-param>
-      </xsl:call-template>
-    </external-graphic>  
-  </xsl:template>
+			<xsl:call-template name="graphicsAttributes">
+				<xsl:with-param name="mode">
+					fo
+				</xsl:with-param>
+			</xsl:call-template>
+		</external-graphic>
+	</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei-makecolspec.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei-makecolspec.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/tei-makecolspec.xsl	(revision 2397)
@@ -1,139 +1,142 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes=" a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet for making table specifications, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns:fotex="http://www.tug.org/fotex"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes=" a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet for making table specifications, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei-makecolspec.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="calculateTableSpecs">
-      <xsl:variable name="tds">
-         <xsl:for-each select=".//tei:cell">
-            <xsl:variable name="stuff">
-               <xsl:apply-templates/>
-            </xsl:variable>
-            <cell>
-               <xsl:attribute name="col">
-                  <xsl:number/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-makecolspec.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="calculateTableSpecs">
+		<xsl:variable name="tds">
+			<xsl:for-each select=".//tei:cell">
+				<xsl:variable name="stuff">
+					<xsl:apply-templates />
+				</xsl:variable>
+				<cell>
+					<xsl:attribute name="col">
+                  <xsl:number />
                </xsl:attribute>
-               <xsl:value-of select="string-length($stuff)"/>
-            </cell>
-         </xsl:for-each>
-      </xsl:variable>
-      <xsl:variable name="total">
-         <xsl:value-of select="sum($tds/cell)"/>
-      </xsl:variable>
-      <xsl:for-each select="$tds/cell">
-         <xsl:sort select="@col" data-type="number"/>
-         <xsl:variable name="c" select="@col"/>
-         <xsl:if test="not(preceding-sibling::cell[$c=@col])">
-            <xsl:variable name="len">
-               <xsl:value-of select="sum(following-sibling::cell[$c=@col]) + current()"/>
-            </xsl:variable>
-            <xsl:text>&#10;</xsl:text>
-            <table-column column-number="{@col}" column-width="{$len div $total * 100}%">
-               <xsl:if test="$foEngine='passivetex'">
-                  <xsl:attribute name="column-align" namespace="http://www.tug.org/fotex">L</xsl:attribute>
-               </xsl:if>
-            </table-column>
-         </xsl:if>
-      </xsl:for-each>
-      <xsl:text>&#10;</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="deriveColSpecs">
-      <xsl:variable name="no">
-         <xsl:call-template name="generateTableID"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$readColSpecFile">
-            <xsl:variable name="specs">
-               <xsl:value-of select="count($tableSpecs/Info/TableSpec[$no=@xml:id])"/>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="$specs &gt; 0">
-                  <xsl:for-each select="$tableSpecs/Info/TableSpec[$no=@xml:id]/table-column">
-                     <xsl:copy-of select="."/>
-                  </xsl:for-each>
-               </xsl:when>
-               <xsl:otherwise>
-<!--
- <xsl:message>Build specs for Table <xsl:value-of select="$no"/></xsl:message>
--->
-            <xsl:call-template name="calculateTableSpecs"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>
-<!--
- <xsl:message>Build specs for Table <xsl:value-of select="$no"/></xsl:message>
--->
-        <xsl:call-template name="calculateTableSpecs"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="generateTableID">
-      <xsl:choose>
-         <xsl:when test="@xml:id">
-            <xsl:value-of select="@xml:id"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>Table-</xsl:text>
-            <xsl:number level="any"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+					<xsl:value-of select="string-length($stuff)" />
+				</cell>
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:variable name="total">
+			<xsl:value-of select="sum($tds/cell)" />
+		</xsl:variable>
+		<xsl:for-each select="$tds/cell">
+			<xsl:sort select="@col" data-type="number" />
+			<xsl:variable name="c" select="@col" />
+			<xsl:if test="not(preceding-sibling::cell[$c=@col])">
+				<xsl:variable name="len">
+					<xsl:value-of
+						select="sum(following-sibling::cell[$c=@col]) + current()" />
+				</xsl:variable>
+				<xsl:text>&#10;</xsl:text>
+				<table-column column-number="{@col}"
+					column-width="{$len div $total * 100}%">
+					<xsl:if test="$foEngine='passivetex'">
+						<xsl:attribute name="column-align"
+							namespace="http://www.tug.org/fotex">L</xsl:attribute>
+					</xsl:if>
+				</table-column>
+			</xsl:if>
+		</xsl:for-each>
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="deriveColSpecs">
+		<xsl:variable name="no">
+			<xsl:call-template name="generateTableID" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$readColSpecFile">
+				<xsl:variable name="specs">
+					<xsl:value-of
+						select="count($tableSpecs/Info/TableSpec[$no=@xml:id])" />
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$specs &gt; 0">
+						<xsl:for-each
+							select="$tableSpecs/Info/TableSpec[$no=@xml:id]/table-column">
+							<xsl:copy-of select="." />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- <xsl:message>Build specs for Table <xsl:value-of select="$no"/></xsl:message> -->
+						<xsl:call-template name="calculateTableSpecs" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- <xsl:message>Build specs for Table <xsl:value-of select="$no"/></xsl:message> -->
+				<xsl:call-template name="calculateTableSpecs" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="generateTableID">
+		<xsl:choose>
+			<xsl:when test="@xml:id">
+				<xsl:value-of select="@xml:id" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>Table-</xsl:text>
+				<xsl:number level="any" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/textstructure.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/textstructure.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/textstructure.xsl	(revision 2397)
@@ -1,1442 +1,1558 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="fotex a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      textstructure module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns:fotex="http://www.tug.org/fotex"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="fotex a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				textstructure module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: textstructure.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements  * in inner mode</desc>
-   </doc>
-  <xsl:template match="*" mode="innertext">
-      <xsl:apply-templates select="."/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:*" mode="heading">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:TEI">
-      <root>
-         <xsl:call-template name="setupPagemasters"/>
-         <xsl:call-template name="mainAction"/>
-      </root>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:back">
-      <xsl:comment>Back matter</xsl:comment>
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:group">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-            <page-sequence format="{$formatBackpage}" text-align="{$alignment}" hyphenate="{$hyphenate}"
-                           language="{$language}">
-               <xsl:call-template name="choosePageMaster">
-                  <xsl:with-param name="where">
-                     <xsl:value-of select="$backMulticolumns"/>
-                  </xsl:with-param>
-               </xsl:call-template>
-               <!-- static areas -->
-          <xsl:choose>
-                  <xsl:when test="$twoSided='true'">
-                     <xsl:call-template name="headers-footers-twoside-back"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:call-template name="headers-footers-oneside-back"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-               <!-- now start the main flow -->
-          <flow flow-name="xsl-region-body" font-family="{$bodyFont}" font-size="{$bodySize}">
-                  <xsl:apply-templates/>
-                  <xsl:call-template name="afterBodyHook"/>
-               </flow>
-            </page-sequence>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:body">
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:floatingText">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:p">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:group">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-<!-- start page sequence -->
-        <page-sequence format="{$formatBodypage}" text-align="{$alignment}" hyphenate="{$hyphenate}"
-                           language="{$language}"
-                           initial-page-number="1">
-               <xsl:call-template name="choosePageMaster">
-                  <xsl:with-param name="where">
-                     <xsl:value-of select="$bodyMulticolumns"/>
-                  </xsl:with-param>
-               </xsl:call-template>
-               <!-- static areas -->
-          <xsl:choose>
-                  <xsl:when test="$twoSided='true'">
-                     <xsl:call-template name="headers-footers-twoside"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:call-template name="headers-footers-oneside"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-               <!-- now start the main  flow -->
-          <flow flow-name="xsl-region-body" font-family="{$bodyFont}" font-size="{$bodySize}">
-                  <xsl:if test="not($flowMarginLeft='')">
-                     <xsl:attribute name="margin-left">
-                        <xsl:value-of select="$flowMarginLeft"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: textstructure.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements * in inner mode</desc>
+	</doc>
+	<xsl:template match="*" mode="innertext">
+		<xsl:apply-templates select="." />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:*" mode="heading">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:TEI">
+		<root>
+			<xsl:call-template name="setupPagemasters" />
+			<xsl:call-template name="mainAction" />
+		</root>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:back">
+		<xsl:comment>
+			Back matter
+		</xsl:comment>
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:group">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<page-sequence format="{$formatBackpage}"
+					text-align="{$alignment}" hyphenate="{$hyphenate}"
+					language="{$language}">
+					<xsl:call-template name="choosePageMaster">
+						<xsl:with-param name="where">
+							<xsl:value-of select="$backMulticolumns" />
+						</xsl:with-param>
+					</xsl:call-template>
+					<!-- static areas -->
+					<xsl:choose>
+						<xsl:when test="$twoSided='true'">
+							<xsl:call-template
+								name="headers-footers-twoside-back" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template
+								name="headers-footers-oneside-back" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- now start the main flow -->
+					<flow flow-name="xsl-region-body" font-family="{$bodyFont}"
+						font-size="{$bodySize}">
+						<xsl:apply-templates />
+						<xsl:call-template name="afterBodyHook" />
+					</flow>
+				</page-sequence>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:body">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:floatingText">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:p">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:group">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- start page sequence -->
+				<page-sequence format="{$formatBodypage}"
+					text-align="{$alignment}" hyphenate="{$hyphenate}"
+					language="{$language}" initial-page-number="1">
+					<xsl:call-template name="choosePageMaster">
+						<xsl:with-param name="where">
+							<xsl:value-of select="$bodyMulticolumns" />
+						</xsl:with-param>
+					</xsl:call-template>
+					<!-- static areas -->
+					<xsl:choose>
+						<xsl:when test="$twoSided='true'">
+							<xsl:call-template
+								name="headers-footers-twoside" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template
+								name="headers-footers-oneside" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- now start the main flow -->
+					<flow flow-name="xsl-region-body" font-family="{$bodyFont}"
+						font-size="{$bodySize}">
+						<xsl:if test="not($flowMarginLeft='')">
+							<xsl:attribute name="margin-left">
+                        <xsl:value-of
+								select="$flowMarginLeft" />
                      </xsl:attribute>
-                  </xsl:if>
-                  <!--include front matter if there is no separate titlepage -->
-            <xsl:if test="not($titlePage='true') and not(preceding-sibling::tei:front)">
-                     <xsl:call-template name="Header"/>
-                  </xsl:if>
-                  <xsl:apply-templates/>
-                  <xsl:if test=".//tei:note[@place='end']">
-                     <block>
-                        <xsl:call-template name="setupDiv2"/>
-                        <xsl:text>Notes</xsl:text>
-                     </block>
-                     <xsl:apply-templates select=".//tei:note[@place='end']" mode="endnote"/>
-                  </xsl:if>
-               </flow>
-            </page-sequence>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:closer">
-      <block space-before.optimum="4pt" space-after.optimum="4pt"
-             end-indent="{$exampleMargin}"
-             start-indent="{$exampleMargin}">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:dateline">
-      <block text-align="end">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    
-         <p xmlns="http://www.w3.org/1999/XSL/Format"> Normal headings </p>
-    
-      </desc>
-   </doc>
-  <xsl:template match="tei:div">
-      <xsl:text>&#10;</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@type='bibliog'">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="@type='abstract'">
-            <block keep-with-next.within-page="always" end-indent="{$exampleMargin}"
-                   start-indent="{$exampleMargin}">
-               <xsl:attribute name="text-align">center</xsl:attribute>
-               <xsl:call-template name="setupDiv2"/>
-               <inline font-style="italic">Abstract</inline>
-            </block>
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="@type='ack'">
-            <block keep-with-next.within-page="always">
-               <xsl:attribute name="text-align">start</xsl:attribute>
-               <xsl:call-template name="setupDiv3"/>
-               <inline font-style="italic">Acknowledgements</inline>
-            </block>
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-<!-- behaviour depends on the nesting level of <div> elements -->
-        <xsl:variable name="divlevel" select="count(ancestor::tei:div)"/>
-            <xsl:call-template name="NumberedHeading">
-               <xsl:with-param name="level">
-                  <xsl:value-of select="$divlevel"/>
-               </xsl:with-param>
-            </xsl:call-template>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    
-         <p xmlns="http://www.w3.org/1999/XSL/Format"> headings in TOC </p>
-    
-      </desc>
-   </doc>
-  <xsl:template match="tei:div" mode="toc">
-      <xsl:variable name="divlevel">
-         <xsl:value-of select="count(ancestor::tei:div)"/>
-      </xsl:variable>
-      <xsl:call-template name="tocheading">
-         <xsl:with-param name="level">
-            <xsl:value-of select="$divlevel"/>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:div" mode="xref">
-      <xsl:variable name="divlevel" select="count(ancestor::tei:div)"/>
-      <xsl:call-template name="xheading">
-         <xsl:with-param name="level">div<xsl:value-of select="$divlevel"/>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
-    <xsl:call-template name="NumberedHeading">
-      <xsl:with-param name="level">
-	<xsl:value-of select="substring-after(local-name(),'div')"/>
-      </xsl:with-param>
-    </xsl:call-template>
-    <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements
-      tei:div1|tei:div2|tei:div3|tei:div4|tei:div5 (toc mode)</desc>
-   </doc>
-  <xsl:template match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5" mode="toc">
-      <xsl:call-template name="tocheading">
-         <xsl:with-param name="level">
-            <xsl:value-of select="substring-after(local-name(),'div')"/>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template mode="xref" match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
-      <xsl:call-template name="xheading">
-         <xsl:with-param name="level">
-            <xsl:value-of select="local-name()"/>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:div[@type='canto']">
-      <xsl:variable name="divlevel" select="count(ancestor::tei:div)"/>
-      <xsl:call-template name="NumberedHeading">
-         <xsl:with-param name="level">
-            <xsl:value-of select="$divlevel"/>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:apply-templates/>
-  </xsl:template>
+						</xsl:if>
+						<!--include front matter if there is no separate titlepage -->
+						<xsl:if
+							test="not($titlePage='true') and not(preceding-sibling::tei:front)">
+							<xsl:call-template name="Header" />
+						</xsl:if>
+						<xsl:apply-templates />
+						<xsl:if test=".//tei:note[@place='end']">
+							<block>
+								<xsl:call-template name="setupDiv2" />
+								<xsl:text>Notes</xsl:text>
+							</block>
+							<xsl:apply-templates
+								select=".//tei:note[@place='end']" mode="endnote" />
+						</xsl:if>
+					</flow>
+				</page-sequence>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:closer">
+		<block space-before.optimum="4pt" space-after.optimum="4pt"
+			end-indent="{$exampleMargin}" start-indent="{$exampleMargin}">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:dateline">
+		<block text-align="end">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>    
-         <p xmlns="http://www.w3.org/1999/XSL/Format">Table of contents </p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:divGen">
-      <xsl:choose>
-         <xsl:when test="@type='toc' and ancestor::tei:text/tei:group">
-            <xsl:call-template name="bookTOC"/>
-         </xsl:when>
-         <xsl:when test="@type='toc'">
-            <xsl:call-template name="mainTOC"/>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:front">
-      <xsl:comment>Front matter</xsl:comment>
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:floatingText">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:p">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:group">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:if test="$titlePage='true'">
-               <page-sequence format="{$formatFrontpage}" force-page-count="end-on-even"
-                              hyphenate="{$hyphenate}"
-                              language="{$language}">
-                  <xsl:call-template name="choosePageMaster">
-                     <xsl:with-param name="where">
-                        <xsl:value-of select="$frontMulticolumns"/>
-                     </xsl:with-param>
-                  </xsl:call-template>
-                  <static-content flow-name="xsl-region-before">
-                     <block/>
-                  </static-content>
-                  <static-content flow-name="xsl-region-after">
-                     <block/>
-                  </static-content>
-                  <flow flow-name="xsl-region-body" font-family="{$bodyFont}">
-                     <xsl:call-template name="Header"/>
-                  </flow>
-               </page-sequence>
-            </xsl:if>
-            <page-sequence format="{$formatFrontpage}" text-align="{$alignment}" hyphenate="{$hyphenate}"
-                           language="{$language}"
-                           initial-page-number="1">
-               <xsl:call-template name="choosePageMaster">
-                  <xsl:with-param name="where">
-                     <xsl:value-of select="$frontMulticolumns"/>
-                  </xsl:with-param>
-               </xsl:call-template>
-               <!-- static areas -->
-          <xsl:choose>
-                  <xsl:when test="$twoSided='true'">
-                     <xsl:call-template name="headers-footers-twoside"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:call-template name="headers-footers-oneside"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-               <!-- now start the main flow -->
-          <flow flow-name="xsl-region-body" font-family="{$bodyFont}" font-size="{$bodySize}">
-                  <xsl:for-each select="tei:*">
-                     <xsl:comment>Start <xsl:value-of select="name(.)"/>
-                     </xsl:comment>
-                     <xsl:apply-templates select="."/>
-                     <xsl:comment>End <xsl:value-of select="name(.)"/>
-                     </xsl:comment>
-                  </xsl:for-each>
-               </flow>
-            </page-sequence>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:group/tei:text">
-      <xsl:variable name="N">
-         <xsl:number/>
-      </xsl:variable>
-      <page-sequence format="1" text-align="{$alignment}" hyphenate="{$hyphenate}"
-                     language="{$language}"
-                     master-reference="twoside1">
-         <xsl:attribute name="initial-page-number">
+			<p xmlns="http://www.w3.org/1999/XSL/Format"> Normal headings </p>
+
+		</desc>
+	</doc>
+	<xsl:template match="tei:div">
+		<xsl:text>&#10;</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@type='bibliog'">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@type='abstract'">
+				<block keep-with-next.within-page="always"
+					end-indent="{$exampleMargin}" start-indent="{$exampleMargin}">
+					<xsl:attribute name="text-align">center</xsl:attribute>
+					<xsl:call-template name="setupDiv2" />
+					<inline font-style="italic">Abstract</inline>
+				</block>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@type='ack'">
+				<block keep-with-next.within-page="always">
+					<xsl:attribute name="text-align">start</xsl:attribute>
+					<xsl:call-template name="setupDiv3" />
+					<inline font-style="italic">Acknowledgements</inline>
+				</block>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- behaviour depends on the nesting level of <div> elements -->
+				<xsl:variable name="divlevel"
+					select="count(ancestor::tei:div)" />
+				<xsl:call-template name="NumberedHeading">
+					<xsl:with-param name="level">
+						<xsl:value-of select="$divlevel" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			<p xmlns="http://www.w3.org/1999/XSL/Format"> headings in TOC </p>
+
+		</desc>
+	</doc>
+	<xsl:template match="tei:div" mode="toc">
+		<xsl:variable name="divlevel">
+			<xsl:value-of select="count(ancestor::tei:div)" />
+		</xsl:variable>
+		<xsl:call-template name="tocheading">
+			<xsl:with-param name="level">
+				<xsl:value-of select="$divlevel" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:div" mode="xref">
+		<xsl:variable name="divlevel"
+			select="count(ancestor::tei:div)" />
+		<xsl:call-template name="xheading">
+			<xsl:with-param name="level">
+				div
+				<xsl:value-of select="$divlevel" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template
+		match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
+		<xsl:call-template name="NumberedHeading">
+			<xsl:with-param name="level">
+				<xsl:value-of
+					select="substring-after(local-name(),'div')" />
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements
+			tei:div1|tei:div2|tei:div3|tei:div4|tei:div5 (toc mode)</desc>
+	</doc>
+	<xsl:template
+		match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5" mode="toc">
+		<xsl:call-template name="tocheading">
+			<xsl:with-param name="level">
+				<xsl:value-of
+					select="substring-after(local-name(),'div')" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template mode="xref"
+		match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
+		<xsl:call-template name="xheading">
+			<xsl:with-param name="level">
+				<xsl:value-of select="local-name()" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:div[@type='canto']">
+		<xsl:variable name="divlevel"
+			select="count(ancestor::tei:div)" />
+		<xsl:call-template name="NumberedHeading">
+			<xsl:with-param name="level">
+				<xsl:value-of select="$divlevel" />
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p xmlns="http://www.w3.org/1999/XSL/Format">Table of contents </p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:divGen">
+		<xsl:choose>
+			<xsl:when
+				test="@type='toc' and ancestor::tei:text/tei:group">
+				<xsl:call-template name="bookTOC" />
+			</xsl:when>
+			<xsl:when test="@type='toc'">
+				<xsl:call-template name="mainTOC" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:front">
+		<xsl:comment>
+			Front matter
+		</xsl:comment>
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:floatingText">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:p">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:group">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$titlePage='true'">
+					<page-sequence format="{$formatFrontpage}"
+						force-page-count="end-on-even" hyphenate="{$hyphenate}"
+						language="{$language}">
+						<xsl:call-template name="choosePageMaster">
+							<xsl:with-param name="where">
+								<xsl:value-of select="$frontMulticolumns" />
+							</xsl:with-param>
+						</xsl:call-template>
+						<static-content flow-name="xsl-region-before">
+							<block />
+						</static-content>
+						<static-content flow-name="xsl-region-after">
+							<block />
+						</static-content>
+						<flow flow-name="xsl-region-body" font-family="{$bodyFont}">
+							<xsl:call-template name="Header" />
+						</flow>
+					</page-sequence>
+				</xsl:if>
+				<page-sequence format="{$formatFrontpage}"
+					text-align="{$alignment}" hyphenate="{$hyphenate}"
+					language="{$language}" initial-page-number="1">
+					<xsl:call-template name="choosePageMaster">
+						<xsl:with-param name="where">
+							<xsl:value-of select="$frontMulticolumns" />
+						</xsl:with-param>
+					</xsl:call-template>
+					<!-- static areas -->
+					<xsl:choose>
+						<xsl:when test="$twoSided='true'">
+							<xsl:call-template
+								name="headers-footers-twoside" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template
+								name="headers-footers-oneside" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- now start the main flow -->
+					<flow flow-name="xsl-region-body" font-family="{$bodyFont}"
+						font-size="{$bodySize}">
+						<xsl:for-each select="tei:*">
+							<xsl:comment>
+								Start
+								<xsl:value-of select="name(.)" />
+							</xsl:comment>
+							<xsl:apply-templates select="." />
+							<xsl:comment>
+								End
+								<xsl:value-of select="name(.)" />
+							</xsl:comment>
+						</xsl:for-each>
+					</flow>
+				</page-sequence>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:group/tei:text">
+		<xsl:variable name="N">
+			<xsl:number />
+		</xsl:variable>
+		<page-sequence format="1" text-align="{$alignment}"
+			hyphenate="{$hyphenate}" language="{$language}"
+			master-reference="twoside1">
+			<xsl:attribute name="initial-page-number">
             <xsl:choose>
                <xsl:when test="$N = 1">1</xsl:when>
                <xsl:otherwise>auto-odd</xsl:otherwise>
             </xsl:choose>
          </xsl:attribute>
-         <xsl:call-template name="grouptextStatic"/>
-         <flow flow-name="xsl-region-body" font-family="{$bodyFont}">
-            <xsl:call-template name="textTitle">
-               <xsl:with-param name="N" select="$N"/>
-            </xsl:call-template>
-            <xsl:apply-templates select="tei:body"/>
-            <xsl:apply-templates select="tei:back"/>
-         </flow>
-      </page-sequence>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:group/tei:text/tei:body">
-      <xsl:apply-templates/>
-      <xsl:if test=".//tei:note[@place='end']">
-         <block>
-            <xsl:call-template name="setupDiv2"/>
-            <xsl:text>Notes</xsl:text>
-         </block>
-         <xsl:apply-templates select=".//tei:note[@place='end']" mode="endnote"/>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    
-         <p xmlns="http://www.w3.org/1999/XSL/Format"> Simple head </p>
-    
-      </desc>
-   </doc>
-  <xsl:template match="tei:head" mode="section">
-<!-- if we have multiple <head> elements together, 
-  separate by spaces -->
-<!--
-   <xsl:if test="preceding-sibling::tei:head">
-	<xsl:text> </xsl:text>
-     </xsl:if>
--->
-    <xsl:apply-templates/>
-  </xsl:template>
+			<xsl:call-template name="grouptextStatic" />
+			<flow flow-name="xsl-region-body" font-family="{$bodyFont}">
+				<xsl:call-template name="textTitle">
+					<xsl:with-param name="N" select="$N" />
+				</xsl:call-template>
+				<xsl:apply-templates select="tei:body" />
+				<xsl:apply-templates select="tei:back" />
+			</flow>
+		</page-sequence>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:group/tei:text/tei:body">
+		<xsl:apply-templates />
+		<xsl:if test=".//tei:note[@place='end']">
+			<block>
+				<xsl:call-template name="setupDiv2" />
+				<xsl:text>Notes</xsl:text>
+			</block>
+			<xsl:apply-templates
+				select=".//tei:note[@place='end']" mode="endnote" />
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element head in heading mode</desc>
-   </doc>
-  <xsl:template match="tei:head" mode="makeheading">
-      <xsl:apply-templates/>
-  </xsl:template>
+			<p xmlns="http://www.w3.org/1999/XSL/Format"> Simple head </p>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    
-         <p xmlns="http://www.w3.org/1999/XSL/Format"> unqualified &lt;head&gt; </p>
-    
-      </desc>
-   </doc>
-  <xsl:template match="tei:head"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:opener">
-      <block space-before.optimum="4pt" space-after.optimum="4pt"
-             end-indent="{$exampleMargin}"
-             start-indent="{$exampleMargin}">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    
-         <p xmlns="http://www.w3.org/1999/XSL/Format"> headings when cross-referenced </p>
-    
-      </desc>
-   </doc>
-  <xsl:template match="tei:text" mode="xref">
-      <xsl:choose>
-         <xsl:when test="@n">
-            <xsl:value-of select="@n"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:number/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:text">
-      <xsl:choose>
-         <xsl:when test="parent::tei:TEI">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="parent::tei:group">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-            <block text-align="start" text-indent="0pt" end-indent="{$exampleMargin}"
-                   start-indent="{$exampleMargin}"
-                   font-size="{$exampleSize}"
-                   border-top-style="solid"
-                   border-bottom-style="solid"
-                   space-before.optimum="{$exampleBefore}"
-                   space-after.optimum="{$exampleAfter}">
-               <xsl:apply-templates mode="innertext"/>
-            </block>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:text" mode="toc">
-      <block>
-         <xsl:attribute name="font-weight">bold</xsl:attribute>
-         <xsl:number/>
-         <xsl:text> </xsl:text>
-         <inline>
-            <xsl:choose>
-               <xsl:when test="tei:front/tei:docTitle[@n]">
-                  <xsl:value-of select="tei:front/tei:docTitle/@n"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="tei:front/tei:docTitle"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </inline>
-         <leader rule-thickness="0pt"/>
-         <inline>
-            <xsl:call-template name="linkStyle"/>
-            <xsl:variable name="pagref">
-               <xsl:choose>
-                  <xsl:when test="@xml:id">
-                     <xsl:value-of select="@xml:id"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="generate-id()"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
-            <basic-link internal-destination="{$pagref}">
-               <page-number-citation ref-id="{$pagref}"/>
-            </basic-link>
-         </inline>
-      </block>
-      <block font-style="italic" space-after="10pt" space-before="6pt">
-         <xsl:apply-templates select="tei:front//tei:docAuthor" mode="heading"/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:titlePage">
-      <block text-align="center">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:titlePage//tei:titlePart[@type='main']">
-      <block font-size="{$titleSize}" space-after="8pt" text-align="center">
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:titlePage//tei:titlePart[@type='sub']">
-      <block>
-         <block font-size="{$authorSize}" space-after="8pt" text-align="center">
-            <xsl:apply-templates/>
-         </block>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:titlePart">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:titlePart[@type='running']"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:trailer">
-      <block>
-         <xsl:apply-templates/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements  text()</desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="Header">
-      <block font-size="12pt" padding-before="6pt">
-         <inline>
-	           <xsl:value-of select="$institution"/>
-         </inline>
-      </block>
-    
-      <block font-size="12pt" font-weight="bold">
-         <xsl:call-template name="generateTitle"/>
-      </block>
-    
-      <block>
-         <xsl:call-template name="generateAuthor"/>
-      </block>
-    
-      <block padding-after="6pt">
-         <xsl:call-template name="generateDate"/>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="level">level</param>
-      </desc>
-   </doc>
-  <xsl:template name="NumberedHeading">
-      <xsl:param name="level"/>
-      <block keep-with-next.within-page="always">
-         <xsl:variable name="divid">
-            <xsl:choose>
-               <xsl:when test="@xml:id">
-                  <xsl:value-of select="@xml:id"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="generate-id()"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:variable>
-         <xsl:attribute name="id">
-            <xsl:value-of select="$divid"/>
+		</desc>
+	</doc>
+	<xsl:template match="tei:head" mode="section">
+		<!-- if we have multiple <head> elements together, separate by spaces -->
+		<!-- <xsl:if test="preceding-sibling::tei:head"> <xsl:text> </xsl:text> 
+			</xsl:if> -->
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element head in heading mode</desc>
+	</doc>
+	<xsl:template match="tei:head" mode="makeheading">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			<p xmlns="http://www.w3.org/1999/XSL/Format"> unqualified &lt;head&gt; </p>
+
+		</desc>
+	</doc>
+	<xsl:template match="tei:head" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:opener">
+		<block space-before.optimum="4pt" space-after.optimum="4pt"
+			end-indent="{$exampleMargin}" start-indent="{$exampleMargin}">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			<p xmlns="http://www.w3.org/1999/XSL/Format"> headings when cross-referenced </p>
+
+		</desc>
+	</doc>
+	<xsl:template match="tei:text" mode="xref">
+		<xsl:choose>
+			<xsl:when test="@n">
+				<xsl:value-of select="@n" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:number />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:text">
+		<xsl:choose>
+			<xsl:when test="parent::tei:TEI">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="parent::tei:group">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<block text-align="start" text-indent="0pt"
+					end-indent="{$exampleMargin}" start-indent="{$exampleMargin}"
+					font-size="{$exampleSize}" border-top-style="solid"
+					border-bottom-style="solid" space-before.optimum="{$exampleBefore}"
+					space-after.optimum="{$exampleAfter}">
+					<xsl:apply-templates mode="innertext" />
+				</block>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:text" mode="toc">
+		<block>
+			<xsl:attribute name="font-weight">bold</xsl:attribute>
+			<xsl:number />
+			<xsl:text> </xsl:text>
+			<inline>
+				<xsl:choose>
+					<xsl:when test="tei:front/tei:docTitle[@n]">
+						<xsl:value-of select="tei:front/tei:docTitle/@n" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="tei:front/tei:docTitle" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</inline>
+			<leader rule-thickness="0pt" />
+			<inline>
+				<xsl:call-template name="linkStyle" />
+				<xsl:variable name="pagref">
+					<xsl:choose>
+						<xsl:when test="@xml:id">
+							<xsl:value-of select="@xml:id" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="generate-id()" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<basic-link internal-destination="{$pagref}">
+					<page-number-citation ref-id="{$pagref}" />
+				</basic-link>
+			</inline>
+		</block>
+		<block font-style="italic" space-after="10pt" space-before="6pt">
+			<xsl:apply-templates
+				select="tei:front//tei:docAuthor" mode="heading" />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:titlePage">
+		<block text-align="center">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template
+		match="tei:titlePage//tei:titlePart[@type='main']">
+		<block font-size="{$titleSize}" space-after="8pt"
+			text-align="center">
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template
+		match="tei:titlePage//tei:titlePart[@type='sub']">
+		<block>
+			<block font-size="{$authorSize}" space-after="8pt"
+				text-align="center">
+				<xsl:apply-templates />
+			</block>
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:titlePart">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:titlePart[@type='running']" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:trailer">
+		<block>
+			<xsl:apply-templates />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements text()</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="Header">
+		<block font-size="12pt" padding-before="6pt">
+			<inline>
+				<xsl:value-of select="$institution" />
+			</inline>
+		</block>
+
+		<block font-size="12pt" font-weight="bold">
+			<xsl:call-template name="generateTitle" />
+		</block>
+
+		<block>
+			<xsl:call-template name="generateAuthor" />
+		</block>
+
+		<block padding-after="6pt">
+			<xsl:call-template name="generateDate" />
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="level">level</param>
+		</desc>
+	</doc>
+	<xsl:template name="NumberedHeading">
+		<xsl:param name="level" />
+		<block keep-with-next.within-page="always">
+			<xsl:variable name="divid">
+				<xsl:choose>
+					<xsl:when test="@xml:id">
+						<xsl:value-of select="@xml:id" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="generate-id()" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:attribute name="id">
+            <xsl:value-of select="$divid" />
          </xsl:attribute>
-         <xsl:attribute name="text-align">start</xsl:attribute>
-         <xsl:attribute name="font-family">
-            <xsl:value-of select="$divFont"/>
+			<xsl:attribute name="text-align">start</xsl:attribute>
+			<xsl:attribute name="font-family">
+            <xsl:value-of select="$divFont" />
          </xsl:attribute>
-         <xsl:choose>
-            <xsl:when test="$level=0">
-               <xsl:call-template name="setupDiv0"/>
-            </xsl:when>
-            <xsl:when test="$level=1">
-               <xsl:call-template name="setupDiv1"/>
-            </xsl:when>
-            <xsl:when test="$level=2">
-               <xsl:call-template name="setupDiv2"/>
-            </xsl:when>
-            <xsl:when test="$level=3">
-               <xsl:call-template name="setupDiv3"/>
-            </xsl:when>
-            <xsl:when test="$level=4">
-               <xsl:call-template name="setupDiv4"/>
-            </xsl:when>
-            <xsl:when test="$level=5">
-               <xsl:call-template name="setupDiv5"/>
-            </xsl:when>
-            <xsl:when test="$level=6">
-               <xsl:call-template name="setupDiv6"/>
-            </xsl:when>
-         </xsl:choose>
-         <xsl:call-template name="blockStartHook"/>
-         <xsl:variable name="Number">
-            <xsl:if test="$numberHeadings='true' and $numberHeadingsDepth &gt; $level">
-               <xsl:call-template name="calculateNumber">
-                  <xsl:with-param name="numbersuffix">
-	                    <xsl:call-template name="headingNumberSuffix"/>
-	                 </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:variable>
-         <!--
-<xsl:message>**  Calculated   [<xsl:value-of select="$Number"/>] [<xsl:value-of select="$headingNumberSuffix"/>] for <xsl:value-of select="@xml:id"/></xsl:message>
--->
-      <xsl:value-of select="$Number"/>
-         <xsl:apply-templates mode="section" select="tei:head"/>
-         <xsl:if test="$divRunningheads='true'">
-<!-- markers for use in running heads -->
-        <xsl:choose>
-               <xsl:when test="$level=0">
-                  <marker marker-class-name="section1"/>
-                  <marker marker-class-name="section2"/>
-                  <marker marker-class-name="section3"/>
-                  <marker marker-class-name="section4"/>
-                  <marker marker-class-name="section5"/>
-               </xsl:when>
-               <xsl:when test="$level=1">
-                  <marker marker-class-name="section2"/>
-                  <marker marker-class-name="section3"/>
-                  <marker marker-class-name="section4"/>
-                  <marker marker-class-name="section5"/>
-               </xsl:when>
-               <xsl:when test="$level=2">
-                  <marker marker-class-name="section3"/>
-                  <marker marker-class-name="section4"/>
-                  <marker marker-class-name="section5"/>
-               </xsl:when>
-               <xsl:when test="$level=3">
-                  <marker marker-class-name="section4"/>
-                  <marker marker-class-name="section5"/>
-               </xsl:when>
-               <xsl:when test="$level=4">
-                  <marker marker-class-name="section5"/>
-               </xsl:when>
-               <xsl:when test="$level=5"/>                     
-            </xsl:choose>
-            <marker marker-class-name="section{$level}">
-               <xsl:if test="$numberHeadings='true'">
-                  <xsl:value-of select="$Number"/>
-                  <xsl:call-template name="headingNumberSuffix"/>
-               </xsl:if>
-               <xsl:value-of select="tei:head"/>
-            </marker>
-         </xsl:if>
-         <xsl:choose>
-            <xsl:when test="$foEngine='passivetex'">
-<!-- Passive TeX extension, to get PDF bookmarks -->
-          <fotex:bookmark fotex-bookmark-level="{$level}" fotex-bookmark-label="{$divid}">
-                  <xsl:if test="$numberHeadings='true'">
-                     <xsl:value-of select="$Number"/>
-                  </xsl:if>
-                  <xsl:value-of select="tei:head"/>
-               </fotex:bookmark>
-            </xsl:when>
-         </xsl:choose>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="bookTOC">
-      <page-sequence format="1" initial-page-number="{$tocStartPage}" master-reference="twoside1">
-         <xsl:call-template name="headers-footers-twoside">
-            <xsl:with-param name="runeven">even page running head</xsl:with-param>
-            <xsl:with-param name="runodd">&#160;odd page running head</xsl:with-param>
-         </xsl:call-template>
-         <flow flow-name="xsl-region-body" font-family="{$bodyFont}">
-            <block text-align="center">
-               <xsl:attribute name="font-size">
-                  <xsl:value-of select="$tocSize"/>
+			<xsl:choose>
+				<xsl:when test="$level=0">
+					<xsl:call-template name="setupDiv0" />
+				</xsl:when>
+				<xsl:when test="$level=1">
+					<xsl:call-template name="setupDiv1" />
+				</xsl:when>
+				<xsl:when test="$level=2">
+					<xsl:call-template name="setupDiv2" />
+				</xsl:when>
+				<xsl:when test="$level=3">
+					<xsl:call-template name="setupDiv3" />
+				</xsl:when>
+				<xsl:when test="$level=4">
+					<xsl:call-template name="setupDiv4" />
+				</xsl:when>
+				<xsl:when test="$level=5">
+					<xsl:call-template name="setupDiv5" />
+				</xsl:when>
+				<xsl:when test="$level=6">
+					<xsl:call-template name="setupDiv6" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:call-template name="blockStartHook" />
+			<xsl:variable name="Number">
+				<xsl:if
+					test="$numberHeadings='true' and $numberHeadingsDepth &gt; $level">
+					<xsl:call-template name="calculateNumber">
+						<xsl:with-param name="numbersuffix">
+							<xsl:call-template name="headingNumberSuffix" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:variable>
+			<!-- <xsl:message>** Calculated [<xsl:value-of select="$Number"/>] [<xsl:value-of 
+				select="$headingNumberSuffix"/>] for <xsl:value-of select="@xml:id"/></xsl:message> -->
+			<xsl:value-of select="$Number" />
+			<xsl:apply-templates mode="section"
+				select="tei:head" />
+			<xsl:if test="$divRunningheads='true'">
+				<!-- markers for use in running heads -->
+				<xsl:choose>
+					<xsl:when test="$level=0">
+						<marker marker-class-name="section1" />
+						<marker marker-class-name="section2" />
+						<marker marker-class-name="section3" />
+						<marker marker-class-name="section4" />
+						<marker marker-class-name="section5" />
+					</xsl:when>
+					<xsl:when test="$level=1">
+						<marker marker-class-name="section2" />
+						<marker marker-class-name="section3" />
+						<marker marker-class-name="section4" />
+						<marker marker-class-name="section5" />
+					</xsl:when>
+					<xsl:when test="$level=2">
+						<marker marker-class-name="section3" />
+						<marker marker-class-name="section4" />
+						<marker marker-class-name="section5" />
+					</xsl:when>
+					<xsl:when test="$level=3">
+						<marker marker-class-name="section4" />
+						<marker marker-class-name="section5" />
+					</xsl:when>
+					<xsl:when test="$level=4">
+						<marker marker-class-name="section5" />
+					</xsl:when>
+					<xsl:when test="$level=5" />
+				</xsl:choose>
+				<marker marker-class-name="section{$level}">
+					<xsl:if test="$numberHeadings='true'">
+						<xsl:value-of select="$Number" />
+						<xsl:call-template name="headingNumberSuffix" />
+					</xsl:if>
+					<xsl:value-of select="tei:head" />
+				</marker>
+			</xsl:if>
+			<xsl:choose>
+				<xsl:when test="$foEngine='passivetex'">
+					<!-- Passive TeX extension, to get PDF bookmarks -->
+					<fotex:bookmark fotex-bookmark-level="{$level}"
+						fotex-bookmark-label="{$divid}">
+						<xsl:if test="$numberHeadings='true'">
+							<xsl:value-of select="$Number" />
+						</xsl:if>
+						<xsl:value-of select="tei:head" />
+					</fotex:bookmark>
+				</xsl:when>
+			</xsl:choose>
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="bookTOC">
+		<page-sequence format="1"
+			initial-page-number="{$tocStartPage}" master-reference="twoside1">
+			<xsl:call-template name="headers-footers-twoside">
+				<xsl:with-param name="runeven">
+					even page running head
+				</xsl:with-param>
+				<xsl:with-param name="runodd">
+					&#160;odd page running head
+				</xsl:with-param>
+			</xsl:call-template>
+			<flow flow-name="xsl-region-body" font-family="{$bodyFont}">
+				<block text-align="center">
+					<xsl:attribute name="font-size">
+                  <xsl:value-of select="$tocSize" />
                </xsl:attribute>
-               <xsl:attribute name="text-indent">
-                  <xsl:value-of select="$headingOutdent"/>
+					<xsl:attribute name="text-indent">
+                  <xsl:value-of select="$headingOutdent" />
                </xsl:attribute>
-               <xsl:attribute name="font-weight">bold</xsl:attribute>
-               <xsl:attribute name="space-after">24pt</xsl:attribute>
-               <xsl:attribute name="space-before.optimum">24pt</xsl:attribute>
-               <xsl:text>Contents</xsl:text>
-            </block>
-            <xsl:for-each select="ancestor::tei:text/tei:group/tei:text">
-               <xsl:apply-templates select="." mode="toc"/>
-            </xsl:for-each>
-         </flow>
-      </page-sequence>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="where">where</param>
-         <param name="force">force</param>
-      </desc>
-   </doc>
-  <xsl:template name="choosePageMaster">
-      <xsl:param name="where"/>
-      <xsl:param name="force"/>
-      <xsl:variable name="mn">
-         <xsl:choose>
-            <xsl:when test="$forcePageMaster">
-               <xsl:value-of select="$forcePageMaster"/>
-            </xsl:when>
-            <xsl:when test="not($where='')">
-               <xsl:choose>
-                  <xsl:when test="$twoSided='true'">twoside2</xsl:when>
-                  <xsl:otherwise>oneside2</xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:choose>
-                  <xsl:when test="$twoSided='true'">twoside1</xsl:when>
-                  <xsl:otherwise>oneside1</xsl:otherwise>
-               </xsl:choose>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:attribute name="master-reference">
-         <xsl:value-of select="$mn"/>
+					<xsl:attribute name="font-weight">bold</xsl:attribute>
+					<xsl:attribute name="space-after">24pt</xsl:attribute>
+					<xsl:attribute name="space-before.optimum">24pt</xsl:attribute>
+					<xsl:text>Contents</xsl:text>
+				</block>
+				<xsl:for-each
+					select="ancestor::tei:text/tei:group/tei:text">
+					<xsl:apply-templates select="." mode="toc" />
+				</xsl:for-each>
+			</flow>
+		</page-sequence>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="where">where</param>
+			<param name="force">force</param>
+		</desc>
+	</doc>
+	<xsl:template name="choosePageMaster">
+		<xsl:param name="where" />
+		<xsl:param name="force" />
+		<xsl:variable name="mn">
+			<xsl:choose>
+				<xsl:when test="$forcePageMaster">
+					<xsl:value-of select="$forcePageMaster" />
+				</xsl:when>
+				<xsl:when test="not($where='')">
+					<xsl:choose>
+						<xsl:when test="$twoSided='true'">
+							twoside2
+						</xsl:when>
+						<xsl:otherwise>
+							oneside2
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:choose>
+						<xsl:when test="$twoSided='true'">
+							twoside1
+						</xsl:when>
+						<xsl:otherwise>
+							oneside1
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:attribute name="master-reference">
+         <xsl:value-of select="$mn" />
       </xsl:attribute>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="grouptextStatic">
-      <static-content flow-name="xsl-region-after-right">
-         <block text-align="end" font-size="{$bodySize}">
-            <page-number/>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-after-left">
-         <block text-align="start" font-size="{$bodySize}">
-            <page-number/>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-before-left">
-         <block text-indent="0em" background-color="blue" font-weight="bold" padding="3pt"
-                color="white"
-                font-family="{$runFont}"
-                text-align="justify"
-                font-size="{$runSize}">
-            <inline>
-               <xsl:number/>
-            </inline>
-            <leader rule-thickness="0pt"/>
-            <inline>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="grouptextStatic">
+		<static-content flow-name="xsl-region-after-right">
+			<block text-align="end" font-size="{$bodySize}">
+				<page-number />
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-after-left">
+			<block text-align="start" font-size="{$bodySize}">
+				<page-number />
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-before-left">
+			<block text-indent="0em" background-color="blue"
+				font-weight="bold" padding="3pt" color="white"
+				font-family="{$runFont}" text-align="justify" font-size="{$runSize}">
+				<inline>
+					<xsl:number />
+				</inline>
+				<leader rule-thickness="0pt" />
+				<inline>
+					<xsl:choose>
+						<xsl:when test="front/tei:docTitle[@n]">
+							<xsl:value-of select="tei:front/tei:docTitle[@n]" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="tei:front/tei:docTitle" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</inline>
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-before-right">
+			<block background-color="blue" text-indent="0em"
+				font-weight="bold" padding="3pt" color="white" text-align="left"
+				font-family="{$runFont}" font-size="{$runSize}">
+				<xsl:value-of select="tei:front//tei:docAuthor" />
+			</block>
+		</static-content>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="runhead">runhead</param>
+		</desc>
+	</doc>
+	<xsl:template name="headers-footers-oneside">
+		<xsl:param name="runhead" />
+		<static-content flow-name="xsl-region-before">
+			<block font-size="{$bodySize}">
+				<xsl:choose>
+					<xsl:when test="$runhead='true'">
+						<xsl:value-of select="$runhead" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="runninghead-author" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-after">
+			<block text-align="center" font-size="{$bodySize}">
+				<page-number />
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-before-first">
+		</static-content>
+		<static-content flow-name="xsl-region-after-first">
+			<block text-align="center" font-size="{$bodySize}">
+				<page-number />
+			</block>
+		</static-content>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="runhead">runhead</param>
+		</desc>
+	</doc>
+	<xsl:template name="headers-footers-oneside-back">
+		<xsl:param name="runhead" />
+		<xsl:call-template name="headers-footers-oneside">
+			<xsl:with-param name="runhead">
+				<xsl:value-of select="$runhead" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="runodd">odd page running head</param>
+			<param name="runeven">even page running head</param>
+		</desc>
+	</doc>
+	<xsl:template name="headers-footers-twoside">
+		<xsl:param name="runodd" />
+		<xsl:param name="runeven" />
+		<static-content flow-name="xsl-region-before-right">
+			<block text-align="justify" text-align-last="justify"
+				font-size="{$bodySize}">
+				<xsl:choose>
+					<xsl:when test="$runodd">
+						<xsl:value-of select="$runodd" />
+					</xsl:when>
+					<xsl:when test="$sectionHeaders='true'">
+						<block>
+							<xsl:if test="$divRunningheads='true'">
+								<inline>
+									<retrieve-marker retrieve-class-name="section2" />
+								</inline>
+							</xsl:if>
+							<leader rule-thickness="0pt" />
+							<inline>
+								<page-number />
+							</inline>
+						</block>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="runninghead-title" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-before-left">
+			<block text-align="justify" font-size="{$bodySize}">
+				<xsl:choose>
+					<xsl:when test="$runeven">
+						<xsl:value-of select="$runeven" />
+					</xsl:when>
+					<xsl:when test="$sectionHeaders='true'">
+						<block>
+							<inline>
+								<page-number />
+							</inline>
+							<leader rule-thickness="0pt" />
+							<xsl:if test="$divRunningheads='true'">
+								<inline>
+									<retrieve-marker retrieve-class-name="section1" />
+								</inline>
+							</xsl:if>
+						</block>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="runninghead-author" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-before-first">
+			<block />
+		</static-content>
+		<static-content flow-name="xsl-region-after-right">
+			<block text-align="end" font-size="{$bodySize}">
+				<page-number />
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-after-left">
+			<block text-align="start" font-size="{$bodySize}">
+				<page-number />
+			</block>
+		</static-content>
+		<static-content flow-name="xsl-region-after-first">
+			<block font-size="{$bodySize}" text-align="end">
+				<page-number />
+			</block>
+		</static-content>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="runodd">odd page running head</param>
+			<param name="runeven">even page running head</param>
+		</desc>
+	</doc>
+	<xsl:template name="headers-footers-twoside-back">
+		<xsl:param name="runodd" />
+		<xsl:param name="runeven" />
+		<xsl:call-template name="headers-footers-twoside">
+			<xsl:with-param name="runeven">
+				<xsl:value-of select="$runeven" />
+			</xsl:with-param>
+			<xsl:with-param name="runodd">
+				<xsl:value-of select="$runodd" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="mainAction">
+		<xsl:choose>
+			<xsl:when test="tei:text/tei:group">
+				<xsl:apply-templates select="tei:text/tei:front" />
+				<xsl:apply-templates select="tei:text/tei:group" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="tei:text/tei:front" />
+				<xsl:apply-templates select="tei:text/tei:body" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:apply-templates select="tei:text/tei:back" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="mainTOC">
+		<block>
+			<xsl:call-template name="setupDiv1" />
+			<xsl:call-template name="i18n">
+				<xsl:with-param name="word">
+					contentsWord
+				</xsl:with-param>
+			</xsl:call-template>
+		</block>
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:text/tei:group">
+				<xsl:for-each select="ancestor::tei:text/tei:group">
+					<xsl:apply-templates select="tei:text"
+						mode="toc" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="ancestor::tei:text/tei:body/tei:div1">
+				<xsl:if test="$tocFront='true'">
+					<xsl:for-each
+						select="ancestor::tei:text/tei:front/tei:div1|ancestor::tei:text/tei:front//tei:div2|ancestor::tei:text/tei:front//tei:div3">
+						<xsl:apply-templates mode="toc" select="(.)" />
+					</xsl:for-each>
+				</xsl:if>
+				<xsl:for-each
+					select="ancestor::tei:text/tei:body/tei:div1|ancestor::tei:text/tei:body//tei:div2|ancestor::tei:text/tei:body//tei:div3">
+					<xsl:apply-templates mode="toc" select="(.)" />
+				</xsl:for-each>
+				<xsl:if test="$tocBack='true'">
+					<xsl:for-each
+						select="ancestor::tei:text/tei:back/tei:div1|ancestor::tei:text/tei:back//tei:div2|ancestor::tei:text/tei:back//tei:div3">
+						<xsl:apply-templates mode="toc" select="(.)" />
+					</xsl:for-each>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="tocBits" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="runninghead-author">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor::tei:text[1]/tei:front//tei:docAuthor[@type='running']">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:text[1]/tei:front//tei:docAuthor[@type='running']"
+					mode="heading" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:text[1]/tei:front//tei:docAuthor"
+					mode="heading" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="runninghead-title">
+		<xsl:comment>
+			Running Head: title
+		</xsl:comment>
+		<xsl:choose>
+			<xsl:when
+				test="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart[@type='running']">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart[@type='running']"
+					mode="heading" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart"
+					mode="heading" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="setupPagemasters">
+		<layout-master-set>
+			<!-- one sided, single column -->
+			<simple-page-master master-name="simple1"
+				page-width="{$pageWidth}" page-height="{$pageHeight}"
+				margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}"
+				margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
+				<region-body margin-bottom="{$bodyMarginBottom}"
+					margin-top="{$bodyMarginTop}" />
+				<region-before extent="{$regionBeforeExtent}" />
+				<region-after extent="{$regionAfterExtent}" />
+			</simple-page-master>
+			<!-- for left-hand/tei:even pages in twosided mode, single column -->
+			<simple-page-master master-name="left1"
+				page-width="{$pageWidth}" page-height="{$pageHeight}"
+				margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}"
+				margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
+				<region-body margin-bottom="{$bodyMarginBottom}"
+					margin-top="{$bodyMarginTop}" />
+				<region-before region-name="xsl-region-before-left"
+					extent="{$regionBeforeExtent}" />
+				<region-after region-name="xsl-region-after-left"
+					extent="{$regionAfterExtent}" />
+			</simple-page-master>
+			<!-- for right-hand/tei:odd pages in twosided mode, single column -->
+			<simple-page-master master-name="right1"
+				page-width="{$pageWidth}" page-height="{$pageHeight}"
+				margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}"
+				margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
+				<region-body margin-bottom="{$bodyMarginBottom}"
+					margin-top="{$bodyMarginTop}" />
+				<region-before region-name="xsl-region-before-right"
+					extent="{$regionBeforeExtent}" />
+				<region-after region-name="xsl-region-after-right"
+					extent="{$regionAfterExtent}" />
+			</simple-page-master>
+			<!-- special case of first page in either mode, single column -->
+			<simple-page-master master-name="first1"
+				page-width="{$pageWidth}" page-height="{$pageHeight}"
+				margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}"
+				margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
+				<region-body margin-bottom="{$bodyMarginBottom}"
+					margin-top="{$bodyMarginTop}" />
+				<region-before region-name="xsl-region-before-first"
+					extent="{$regionBeforeExtent}" />
+				<region-after region-name="xsl-region-after-first"
+					extent="{$regionAfterExtent}" />
+			</simple-page-master>
+			<!-- for pages in one-side mode, 2 column -->
+			<simple-page-master master-name="simple2"
+				page-width="{$pageWidth}" page-height="{$pageHeight}"
+				margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}"
+				margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
+				<region-body column-count="{$columnCount}"
+					margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}" />
+				<region-before extent="{$regionBeforeExtent}" />
+				<region-after extent="{$regionAfterExtent}" />
+			</simple-page-master>
+			<!-- for left-hand/tei:even pages in twosided mode, 2 column -->
+			<simple-page-master master-name="left2"
+				page-width="{$pageWidth}" page-height="{$pageHeight}"
+				margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}"
+				margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
+				<region-body column-count="{$columnCount}"
+					margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}" />
+				<region-before region-name="xsl-region-before-left"
+					extent="{$regionBeforeExtent}" />
+				<region-after region-name="xsl-region-after-left"
+					extent="{$regionAfterExtent}" />
+			</simple-page-master>
+			<!-- for right-hand/tei:odd pages in twosided mode, 2 column -->
+			<simple-page-master master-name="right2"
+				page-width="{$pageWidth}" page-height="{$pageHeight}"
+				margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}"
+				margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
+				<region-body column-count="{$columnCount}"
+					margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}" />
+				<region-before region-name="xsl-region-before-right"
+					extent="{$regionBeforeExtent}" />
+				<region-after region-name="xsl-region-after-right"
+					extent="{$regionAfterExtent}" />
+			</simple-page-master>
+			<!-- special case of first page in either mode -->
+			<simple-page-master master-name="first2"
+				page-width="{$pageWidth}" page-height="{$pageHeight}"
+				margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}"
+				margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
+				<region-body column-count="{$columnCount}"
+					margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}" />
+				<region-before region-name="xsl-region-before-first"
+					extent="{$regionBeforeExtent}" />
+				<region-after region-name="xsl-region-after-first"
+					extent="{$regionAfterExtent}" />
+			</simple-page-master>
+			<!-- setup for double-sided, 1 column, no first page -->
+			<page-sequence-master
+				master-name="twoside1nofirst">
+				<repeatable-page-master-alternatives>
+					<conditional-page-master-reference
+						master-reference="right1" odd-or-even="odd" />
+					<conditional-page-master-reference
+						master-reference="left1" odd-or-even="even" />
+				</repeatable-page-master-alternatives>
+			</page-sequence-master>
+			<!-- setup for double-sided, 1 column -->
+			<page-sequence-master master-name="twoside1">
+				<repeatable-page-master-alternatives>
+					<conditional-page-master-reference
+						master-reference="first1" page-position="first" />
+					<conditional-page-master-reference
+						master-reference="right1" odd-or-even="odd" />
+					<conditional-page-master-reference
+						master-reference="left1" odd-or-even="even" />
+				</repeatable-page-master-alternatives>
+			</page-sequence-master>
+			<!-- setup for single-sided, 1 column -->
+			<page-sequence-master master-name="oneside1">
+				<repeatable-page-master-alternatives>
+					<conditional-page-master-reference
+						master-reference="first1" page-position="first" />
+					<conditional-page-master-reference
+						master-reference="simple1" />
+				</repeatable-page-master-alternatives>
+			</page-sequence-master>
+			<!-- setup for double-sided, 2 column -->
+			<page-sequence-master master-name="twoside2">
+				<repeatable-page-master-alternatives>
+					<conditional-page-master-reference
+						master-reference="first2" page-position="first" />
+					<conditional-page-master-reference
+						master-reference="right2" odd-or-even="odd" />
+					<conditional-page-master-reference
+						master-reference="left2" odd-or-even="even" />
+				</repeatable-page-master-alternatives>
+			</page-sequence-master>
+			<!-- setup for single-sided, 2 column -->
+			<page-sequence-master master-name="oneside2">
+				<repeatable-page-master-alternatives>
+					<conditional-page-master-reference
+						master-reference="first2" page-position="first" />
+					<conditional-page-master-reference
+						master-reference="simple2" />
+				</repeatable-page-master-alternatives>
+			</page-sequence-master>
+			<xsl:call-template name="pageMasterHook" />
+		</layout-master-set>
+		<xsl:if test="$foEngine='xep'">
+			<!-- PDF bookmarks using XEP -->
+			<outline xmlns="http://www.renderx.com/XSL/Extensions">
+				<xsl:for-each
+					select="/tei:TEI/tei:text/tei:front/tei:div">
+					<xsl:call-template name="makeBookMark" />
+				</xsl:for-each>
+				<xsl:for-each
+					select="/tei:TEI/tei:text/tei:body/tei:div">
+					<xsl:call-template name="makeBookMark" />
+				</xsl:for-each>
+				<xsl:for-each
+					select="/tei:TEI/tei:text/tei:back/tei:div">
+					<xsl:call-template name="makeBookMark" />
+				</xsl:for-each>
+				<!-- now try numbered divs -->
+				<xsl:for-each
+					select="/tei:TEI/tei:text/tei:front/tei:div1">
+					<xsl:call-template name="makeBookMarkN" />
+				</xsl:for-each>
+				<xsl:for-each
+					select="/tei:TEI/tei:text/tei:body/tei:div1">
+					<xsl:call-template name="makeBookMarkN" />
+				</xsl:for-each>
+				<xsl:for-each
+					select="/tei:TEI/tei:text/tei:back/tei:div1">
+					<xsl:call-template name="makeBookMarkN" />
+				</xsl:for-each>
+			</outline>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] Make an XEP bookmark</desc>
+	</doc>
+	<xsl:template name="makeBookMark">
+		<xsl:if test="tei:head">
+			<bookmark xmlns="http://www.renderx.com/XSL/Extensions">
+				<xsl:variable name="depth"
+					select="count(ancestor::tei:div)" />
+				<xsl:attribute name="internal-destination">
                <xsl:choose>
-                  <xsl:when test="front/tei:docTitle[@n]">
-                     <xsl:value-of select="tei:front/tei:docTitle[@n]"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="tei:front/tei:docTitle"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </inline>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-before-right">
-         <block background-color="blue" text-indent="0em" font-weight="bold" padding="3pt"
-                color="white"
-                text-align="left"
-                font-family="{$runFont}"
-                font-size="{$runSize}">
-            <xsl:value-of select="tei:front//tei:docAuthor"/>
-         </block>
-      </static-content>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="runhead">runhead</param>
-      </desc>
-   </doc>
-  <xsl:template name="headers-footers-oneside">
-      <xsl:param name="runhead"/>
-      <static-content flow-name="xsl-region-before">
-         <block font-size="{$bodySize}">
-            <xsl:choose>
-               <xsl:when test="$runhead='true'">
-                  <xsl:value-of select="$runhead"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:call-template name="runninghead-author"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-after">
-         <block text-align="center" font-size="{$bodySize}">
-            <page-number/>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-before-first">
-        </static-content>
-      <static-content flow-name="xsl-region-after-first">
-         <block text-align="center" font-size="{$bodySize}">
-            <page-number/>
-         </block>
-      </static-content>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="runhead">runhead</param>
-      </desc>
-   </doc>
-  <xsl:template name="headers-footers-oneside-back">
-      <xsl:param name="runhead"/>
-      <xsl:call-template name="headers-footers-oneside">
-         <xsl:with-param name="runhead">
-            <xsl:value-of select="$runhead"/>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="runodd">odd page running head</param>
-         <param name="runeven">even page running head</param>
-      </desc>
-   </doc>
-  <xsl:template name="headers-footers-twoside">
-      <xsl:param name="runodd"/>
-      <xsl:param name="runeven"/>
-      <static-content flow-name="xsl-region-before-right">
-         <block text-align="justify" text-align-last="justify" font-size="{$bodySize}">
-            <xsl:choose>
-               <xsl:when test="$runodd">
-                  <xsl:value-of select="$runodd"/>
-               </xsl:when>
-               <xsl:when test="$sectionHeaders='true'">
-                  <block>
-                     <xsl:if test="$divRunningheads='true'">
-                        <inline>
-                           <retrieve-marker retrieve-class-name="section2"/>
-                        </inline>
-                     </xsl:if>
-                     <leader rule-thickness="0pt"/>
-                     <inline>
-                        <page-number/>
-                     </inline>
-                  </block>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:call-template name="runninghead-title"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-before-left">
-         <block text-align="justify" font-size="{$bodySize}">
-            <xsl:choose>
-               <xsl:when test="$runeven">
-                  <xsl:value-of select="$runeven"/>
-               </xsl:when>
-               <xsl:when test="$sectionHeaders='true'">
-                  <block>
-                     <inline>
-                        <page-number/>
-                     </inline>
-                     <leader rule-thickness="0pt"/>
-                     <xsl:if test="$divRunningheads='true'">
-                        <inline>
-                           <retrieve-marker retrieve-class-name="section1"/>
-                        </inline>
-                     </xsl:if>
-                  </block>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:call-template name="runninghead-author"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-before-first">
-         <block/>
-      </static-content>
-      <static-content flow-name="xsl-region-after-right">
-         <block text-align="end" font-size="{$bodySize}">
-            <page-number/>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-after-left">
-         <block text-align="start" font-size="{$bodySize}">
-            <page-number/>
-         </block>
-      </static-content>
-      <static-content flow-name="xsl-region-after-first">
-         <block font-size="{$bodySize}" text-align="end">
-            <page-number/>
-         </block>
-      </static-content>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="runodd">odd page running head</param>
-         <param name="runeven">even page running head</param>
-      </desc>
-   </doc>
-  <xsl:template name="headers-footers-twoside-back">
-      <xsl:param name="runodd"/>
-      <xsl:param name="runeven"/>
-      <xsl:call-template name="headers-footers-twoside">
-         <xsl:with-param name="runeven">
-            <xsl:value-of select="$runeven"/>
-         </xsl:with-param>
-         <xsl:with-param name="runodd">
-            <xsl:value-of select="$runodd"/>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="mainAction">
-      <xsl:choose>
-         <xsl:when test="tei:text/tei:group">
-            <xsl:apply-templates select="tei:text/tei:front"/>
-            <xsl:apply-templates select="tei:text/tei:group"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates select="tei:text/tei:front"/>
-            <xsl:apply-templates select="tei:text/tei:body"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:apply-templates select="tei:text/tei:back"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="mainTOC">
-      <block>
-         <xsl:call-template name="setupDiv1"/>
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">contentsWord</xsl:with-param>
-         </xsl:call-template>
-      </block>
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:text/tei:group">
-            <xsl:for-each select="ancestor::tei:text/tei:group">
-               <xsl:apply-templates select="tei:text" mode="toc"/>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:text/tei:body/tei:div1">
-            <xsl:if test="$tocFront='true'">
-               <xsl:for-each select="ancestor::tei:text/tei:front/tei:div1|ancestor::tei:text/tei:front//tei:div2|ancestor::tei:text/tei:front//tei:div3">
-                  <xsl:apply-templates mode="toc" select="(.)"/>
-               </xsl:for-each>
-            </xsl:if>
-            <xsl:for-each select="ancestor::tei:text/tei:body/tei:div1|ancestor::tei:text/tei:body//tei:div2|ancestor::tei:text/tei:body//tei:div3">
-               <xsl:apply-templates mode="toc" select="(.)"/>
-            </xsl:for-each>
-            <xsl:if test="$tocBack='true'">
-               <xsl:for-each select="ancestor::tei:text/tei:back/tei:div1|ancestor::tei:text/tei:back//tei:div2|ancestor::tei:text/tei:back//tei:div3">
-                  <xsl:apply-templates mode="toc" select="(.)"/>
-               </xsl:for-each>
-            </xsl:if>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="tocBits"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="runninghead-author">
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:text[1]/tei:front//tei:docAuthor[@type='running']">
-            <xsl:apply-templates select="ancestor-or-self::tei:text[1]/tei:front//tei:docAuthor[@type='running']"
-                                 mode="heading"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates select="ancestor-or-self::tei:text[1]/tei:front//tei:docAuthor" mode="heading"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="runninghead-title">
-      <xsl:comment>Running Head: title</xsl:comment>
-      <xsl:choose>
-         <xsl:when test="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart[@type='running']">
-            <xsl:apply-templates select="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart[@type='running']"
-                                 mode="heading"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates select="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart"
-                                 mode="heading"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="setupPagemasters">
-      <layout-master-set>
-<!-- one sided, single column -->
-      <simple-page-master master-name="simple1" page-width="{$pageWidth}" page-height="{$pageHeight}"
-                             margin-top="{$pageMarginTop}"
-                             margin-bottom="{$pageMarginBottom}"
-                             margin-left="{$pageMarginLeft}"
-                             margin-right="{$pageMarginRight}">
-            <region-body margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
-            <region-before extent="{$regionBeforeExtent}"/>
-            <region-after extent="{$regionAfterExtent}"/>
-         </simple-page-master>
-         <!-- for left-hand/tei:even pages in twosided mode, single column -->
-      <simple-page-master master-name="left1" page-width="{$pageWidth}" page-height="{$pageHeight}"
-                             margin-top="{$pageMarginTop}"
-                             margin-bottom="{$pageMarginBottom}"
-                             margin-left="{$pageMarginLeft}"
-                             margin-right="{$pageMarginRight}">
-            <region-body margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
-            <region-before region-name="xsl-region-before-left" extent="{$regionBeforeExtent}"/>
-            <region-after region-name="xsl-region-after-left" extent="{$regionAfterExtent}"/>
-         </simple-page-master>
-         <!-- for right-hand/tei:odd pages in twosided mode, single column -->
-      <simple-page-master master-name="right1" page-width="{$pageWidth}" page-height="{$pageHeight}"
-                             margin-top="{$pageMarginTop}"
-                             margin-bottom="{$pageMarginBottom}"
-                             margin-left="{$pageMarginLeft}"
-                             margin-right="{$pageMarginRight}">
-            <region-body margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
-            <region-before region-name="xsl-region-before-right" extent="{$regionBeforeExtent}"/>
-            <region-after region-name="xsl-region-after-right" extent="{$regionAfterExtent}"/>
-         </simple-page-master>
-         <!-- special case of first page in either mode, single column -->
-      <simple-page-master master-name="first1" page-width="{$pageWidth}" page-height="{$pageHeight}"
-                             margin-top="{$pageMarginTop}"
-                             margin-bottom="{$pageMarginBottom}"
-                             margin-left="{$pageMarginLeft}"
-                             margin-right="{$pageMarginRight}">
-            <region-body margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
-            <region-before region-name="xsl-region-before-first" extent="{$regionBeforeExtent}"/>
-            <region-after region-name="xsl-region-after-first" extent="{$regionAfterExtent}"/>
-         </simple-page-master>
-         <!-- for pages in one-side mode, 2 column -->
-      <simple-page-master master-name="simple2" page-width="{$pageWidth}" page-height="{$pageHeight}"
-                             margin-top="{$pageMarginTop}"
-                             margin-bottom="{$pageMarginBottom}"
-                             margin-left="{$pageMarginLeft}"
-                             margin-right="{$pageMarginRight}">
-            <region-body column-count="{$columnCount}" margin-bottom="{$bodyMarginBottom}"
-                         margin-top="{$bodyMarginTop}"/>
-            <region-before extent="{$regionBeforeExtent}"/>
-            <region-after extent="{$regionAfterExtent}"/>
-         </simple-page-master>
-         <!-- for left-hand/tei:even pages in twosided mode, 2 column -->
-      <simple-page-master master-name="left2" page-width="{$pageWidth}" page-height="{$pageHeight}"
-                             margin-top="{$pageMarginTop}"
-                             margin-bottom="{$pageMarginBottom}"
-                             margin-left="{$pageMarginLeft}"
-                             margin-right="{$pageMarginRight}">
-            <region-body column-count="{$columnCount}" margin-bottom="{$bodyMarginBottom}"
-                         margin-top="{$bodyMarginTop}"/>
-            <region-before region-name="xsl-region-before-left" extent="{$regionBeforeExtent}"/>
-            <region-after region-name="xsl-region-after-left" extent="{$regionAfterExtent}"/>
-         </simple-page-master>
-         <!-- for right-hand/tei:odd pages in twosided mode, 2 column -->
-      <simple-page-master master-name="right2" page-width="{$pageWidth}" page-height="{$pageHeight}"
-                             margin-top="{$pageMarginTop}"
-                             margin-bottom="{$pageMarginBottom}"
-                             margin-left="{$pageMarginLeft}"
-                             margin-right="{$pageMarginRight}">
-            <region-body column-count="{$columnCount}" margin-bottom="{$bodyMarginBottom}"
-                         margin-top="{$bodyMarginTop}"/>
-            <region-before region-name="xsl-region-before-right" extent="{$regionBeforeExtent}"/>
-            <region-after region-name="xsl-region-after-right" extent="{$regionAfterExtent}"/>
-         </simple-page-master>
-         <!-- special case of first page in either mode -->
-      <simple-page-master master-name="first2" page-width="{$pageWidth}" page-height="{$pageHeight}"
-                             margin-top="{$pageMarginTop}"
-                             margin-bottom="{$pageMarginBottom}"
-                             margin-left="{$pageMarginLeft}"
-                             margin-right="{$pageMarginRight}">
-            <region-body column-count="{$columnCount}" margin-bottom="{$bodyMarginBottom}"
-                         margin-top="{$bodyMarginTop}"/>
-            <region-before region-name="xsl-region-before-first" extent="{$regionBeforeExtent}"/>
-            <region-after region-name="xsl-region-after-first" extent="{$regionAfterExtent}"/>
-         </simple-page-master>
-         <!-- setup for double-sided, 1 column, no first page -->
-      <page-sequence-master master-name="twoside1nofirst">
-            <repeatable-page-master-alternatives>
-               <conditional-page-master-reference master-reference="right1" odd-or-even="odd"/>
-               <conditional-page-master-reference master-reference="left1" odd-or-even="even"/>
-            </repeatable-page-master-alternatives>
-         </page-sequence-master>
-         <!-- setup for double-sided, 1 column -->
-      <page-sequence-master master-name="twoside1">
-            <repeatable-page-master-alternatives>
-               <conditional-page-master-reference master-reference="first1" page-position="first"/>
-               <conditional-page-master-reference master-reference="right1" odd-or-even="odd"/>
-               <conditional-page-master-reference master-reference="left1" odd-or-even="even"/>
-            </repeatable-page-master-alternatives>
-         </page-sequence-master>
-         <!-- setup for single-sided, 1 column -->
-      <page-sequence-master master-name="oneside1">
-            <repeatable-page-master-alternatives>
-               <conditional-page-master-reference master-reference="first1" page-position="first"/>
-               <conditional-page-master-reference master-reference="simple1"/>
-            </repeatable-page-master-alternatives>
-         </page-sequence-master>
-         <!-- setup for double-sided, 2 column -->
-      <page-sequence-master master-name="twoside2">
-            <repeatable-page-master-alternatives>
-               <conditional-page-master-reference master-reference="first2" page-position="first"/>
-               <conditional-page-master-reference master-reference="right2" odd-or-even="odd"/>
-               <conditional-page-master-reference master-reference="left2" odd-or-even="even"/>
-            </repeatable-page-master-alternatives>
-         </page-sequence-master>
-         <!-- setup for single-sided, 2 column -->
-      <page-sequence-master master-name="oneside2">
-            <repeatable-page-master-alternatives>
-               <conditional-page-master-reference master-reference="first2" page-position="first"/>
-               <conditional-page-master-reference master-reference="simple2"/>
-            </repeatable-page-master-alternatives>
-         </page-sequence-master>
-         <xsl:call-template name="pageMasterHook"/>
-      </layout-master-set>
-      <xsl:if test="$foEngine='xep'">
-<!-- PDF bookmarks using XEP -->
-      <outline xmlns="http://www.renderx.com/XSL/Extensions">
-            <xsl:for-each select="/tei:TEI/tei:text/tei:front/tei:div">
-               <xsl:call-template name="makeBookMark"/>
-            </xsl:for-each>
-            <xsl:for-each select="/tei:TEI/tei:text/tei:body/tei:div">
-               <xsl:call-template name="makeBookMark"/>
-            </xsl:for-each>
-            <xsl:for-each select="/tei:TEI/tei:text/tei:back/tei:div">
-               <xsl:call-template name="makeBookMark"/>
-            </xsl:for-each>
-            <!-- now try numbered divs -->
-        <xsl:for-each select="/tei:TEI/tei:text/tei:front/tei:div1">
-               <xsl:call-template name="makeBookMarkN"/>
-            </xsl:for-each>
-            <xsl:for-each select="/tei:TEI/tei:text/tei:body/tei:div1">
-               <xsl:call-template name="makeBookMarkN"/>
-            </xsl:for-each>
-            <xsl:for-each select="/tei:TEI/tei:text/tei:back/tei:div1">
-               <xsl:call-template name="makeBookMarkN"/>
-            </xsl:for-each>
-         </outline>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] Make an XEP bookmark</desc>
-   </doc>
-  <xsl:template name="makeBookMark">
-      <xsl:if test="tei:head">
-         <bookmark xmlns="http://www.renderx.com/XSL/Extensions">
-            <xsl:variable name="depth" select="count(ancestor::tei:div)"/>
-            <xsl:attribute name="internal-destination">
-               <xsl:choose>
                   <xsl:when test="@xml:id">
-                     <xsl:value-of select="@xml:id"/>
+                     <xsl:value-of select="@xml:id" />
                   </xsl:when>
                   <xsl:otherwise>
-                     <xsl:value-of select="generate-id()"/>
+                     <xsl:value-of select="generate-id()" />
                   </xsl:otherwise>
                </xsl:choose>
             </xsl:attribute>
-            <bookmark-label>
-               <xsl:if test="$numberHeadings='true' and $numberHeadingsDepth &gt; $depth">
-                  <xsl:call-template name="calculateNumber">
-                     <xsl:with-param name="numbersuffix">
-		                      <xsl:call-template name="headingNumberSuffix"/>
-	                    </xsl:with-param>
-                  </xsl:call-template>
-                  <xsl:text> </xsl:text>
-               </xsl:if>
-               <xsl:value-of select="tei:head"/>
-            </bookmark-label>
-            <xsl:for-each select="tei:div">
-               <xsl:call-template name="makeBookMark"/>
-            </xsl:for-each>
-         </bookmark>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] Make an XEP bookmark for numbered divs</desc>
-   </doc>
-  <xsl:template name="makeBookMarkN">
-      <xsl:if test="tei:head">
-         <xsl:variable name="depth" select="substring-after(local-name(.),'div')"/>
-         <bookmark xmlns="http://www.renderx.com/XSL/Extensions">
-            <xsl:attribute name="internal-destination">
+				<bookmark-label>
+					<xsl:if
+						test="$numberHeadings='true' and $numberHeadingsDepth &gt; $depth">
+						<xsl:call-template name="calculateNumber">
+							<xsl:with-param name="numbersuffix">
+								<xsl:call-template name="headingNumberSuffix" />
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:text> </xsl:text>
+					</xsl:if>
+					<xsl:value-of select="tei:head" />
+				</bookmark-label>
+				<xsl:for-each select="tei:div">
+					<xsl:call-template name="makeBookMark" />
+				</xsl:for-each>
+			</bookmark>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] Make an XEP bookmark for numbered divs</desc>
+	</doc>
+	<xsl:template name="makeBookMarkN">
+		<xsl:if test="tei:head">
+			<xsl:variable name="depth"
+				select="substring-after(local-name(.),'div')" />
+			<bookmark xmlns="http://www.renderx.com/XSL/Extensions">
+				<xsl:attribute name="internal-destination">
                <xsl:choose>
                   <xsl:when test="@xml:id">
-                     <xsl:value-of select="@xml:id"/>
+                     <xsl:value-of select="@xml:id" />
                   </xsl:when>
                   <xsl:otherwise>
-                     <xsl:value-of select="generate-id()"/>
+                     <xsl:value-of select="generate-id()" />
                   </xsl:otherwise>
                </xsl:choose>
             </xsl:attribute>
-            <bookmark-label>
-               <xsl:if test="$numberHeadings='true' and $numberHeadingsDepth &gt; $depth">
-                  <xsl:call-template name="calculateNumber">
-                     <xsl:with-param name="numbersuffix">
-		                      <xsl:call-template name="headingNumberSuffix"/>
-	                    </xsl:with-param>
-                  </xsl:call-template>
-                  <xsl:text> </xsl:text>
-               </xsl:if>
-               <xsl:value-of select="tei:head"/>
-            </bookmark-label>
-            <xsl:choose>
-               <xsl:when test="$depth='0'">
-                  <xsl:for-each select="tei:div1">
-                     <xsl:call-template name="makeBookMarkN"/>
-                  </xsl:for-each>
-               </xsl:when>
-               <xsl:when test="$depth='1'">
-                  <xsl:for-each select="tei:div2">
-                     <xsl:call-template name="makeBookMarkN"/>
-                  </xsl:for-each>
-               </xsl:when>
-               <xsl:when test="$depth='2'">
-                  <xsl:for-each select="tei:div3">
-                     <xsl:call-template name="makeBookMarkN"/>
-                  </xsl:for-each>
-               </xsl:when>
-               <xsl:when test="$depth='3'">
-                  <xsl:for-each select="tei:div4">
-                     <xsl:call-template name="makeBookMarkN"/>
-                  </xsl:for-each>
-               </xsl:when>
-               <xsl:when test="$depth='4'">
-                  <xsl:for-each select="tei:div5">
-                     <xsl:call-template name="makeBookMarkN"/>
-                  </xsl:for-each>
-               </xsl:when>
-               <xsl:when test="$depth='5'">
-                  <xsl:for-each select="tei:div6">
-                     <xsl:call-template name="makeBookMarkN"/>
-                  </xsl:for-each>
-               </xsl:when>
-            </xsl:choose>
-         </bookmark>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] </desc>
-   </doc>
-  <xsl:template name="tocBits">
-      <xsl:if test="$tocFront='true'">
-         <xsl:for-each select="ancestor::tei:text/tei:front//tei:div">
-            <xsl:apply-templates mode="toc" select="(.)"/>
-         </xsl:for-each>
-      </xsl:if>
-      <xsl:for-each select="ancestor::tei:text/tei:body//tei:div">
-         <xsl:apply-templates mode="toc" select="(.)"/>
-      </xsl:for-each>
-      <xsl:if test="$tocBack='true'">
-         <xsl:for-each select="ancestor::tei:text/tei:back//tei:div">
-            <xsl:apply-templates mode="toc" select="(.)"/>
-         </xsl:for-each>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="level">level</param>
-      </desc>
-   </doc>
-  <xsl:template name="tocheading">
-      <xsl:param name="level"/>
-      <xsl:variable name="tocindent">
-         <xsl:choose>
-            <xsl:when test="$level='0'">
-               <xsl:value-of select="$div0Tocindent"/>
-            </xsl:when>
-            <xsl:when test="$level='1'">
-               <xsl:value-of select="$div1Tocindent"/>
-            </xsl:when>
-            <xsl:when test="$level='2'">
-               <xsl:value-of select="$div2Tocindent"/>
-            </xsl:when>
-            <xsl:when test="$level='3'">
-               <xsl:value-of select="$div3Tocindent"/>
-            </xsl:when>
-            <xsl:when test="$level='4'">
-               <xsl:value-of select="$div4Tocindent"/>
-            </xsl:when>
-            <xsl:when test="$level='5'">
-               <xsl:value-of select="$div5Tocindent"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$div1Tocindent"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <block>
-         <xsl:if test="$level='0'">
-            <xsl:attribute name="font-weight">bold</xsl:attribute>
-         </xsl:if>
-         <xsl:attribute name="text-indent">
-            <xsl:value-of select="$tocindent"/>
+				<bookmark-label>
+					<xsl:if
+						test="$numberHeadings='true' and $numberHeadingsDepth &gt; $depth">
+						<xsl:call-template name="calculateNumber">
+							<xsl:with-param name="numbersuffix">
+								<xsl:call-template name="headingNumberSuffix" />
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:text> </xsl:text>
+					</xsl:if>
+					<xsl:value-of select="tei:head" />
+				</bookmark-label>
+				<xsl:choose>
+					<xsl:when test="$depth='0'">
+						<xsl:for-each select="tei:div1">
+							<xsl:call-template name="makeBookMarkN" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="$depth='1'">
+						<xsl:for-each select="tei:div2">
+							<xsl:call-template name="makeBookMarkN" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="$depth='2'">
+						<xsl:for-each select="tei:div3">
+							<xsl:call-template name="makeBookMarkN" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="$depth='3'">
+						<xsl:for-each select="tei:div4">
+							<xsl:call-template name="makeBookMarkN" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="$depth='4'">
+						<xsl:for-each select="tei:div5">
+							<xsl:call-template name="makeBookMarkN" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="$depth='5'">
+						<xsl:for-each select="tei:div6">
+							<xsl:call-template name="makeBookMarkN" />
+						</xsl:for-each>
+					</xsl:when>
+				</xsl:choose>
+			</bookmark>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[fo] </desc>
+	</doc>
+	<xsl:template name="tocBits">
+		<xsl:if test="$tocFront='true'">
+			<xsl:for-each
+				select="ancestor::tei:text/tei:front//tei:div">
+				<xsl:apply-templates mode="toc" select="(.)" />
+			</xsl:for-each>
+		</xsl:if>
+		<xsl:for-each
+			select="ancestor::tei:text/tei:body//tei:div">
+			<xsl:apply-templates mode="toc" select="(.)" />
+		</xsl:for-each>
+		<xsl:if test="$tocBack='true'">
+			<xsl:for-each
+				select="ancestor::tei:text/tei:back//tei:div">
+				<xsl:apply-templates mode="toc" select="(.)" />
+			</xsl:for-each>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="level">level</param>
+		</desc>
+	</doc>
+	<xsl:template name="tocheading">
+		<xsl:param name="level" />
+		<xsl:variable name="tocindent">
+			<xsl:choose>
+				<xsl:when test="$level='0'">
+					<xsl:value-of select="$div0Tocindent" />
+				</xsl:when>
+				<xsl:when test="$level='1'">
+					<xsl:value-of select="$div1Tocindent" />
+				</xsl:when>
+				<xsl:when test="$level='2'">
+					<xsl:value-of select="$div2Tocindent" />
+				</xsl:when>
+				<xsl:when test="$level='3'">
+					<xsl:value-of select="$div3Tocindent" />
+				</xsl:when>
+				<xsl:when test="$level='4'">
+					<xsl:value-of select="$div4Tocindent" />
+				</xsl:when>
+				<xsl:when test="$level='5'">
+					<xsl:value-of select="$div5Tocindent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$div1Tocindent" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<block>
+			<xsl:if test="$level='0'">
+				<xsl:attribute name="font-weight">bold</xsl:attribute>
+			</xsl:if>
+			<xsl:attribute name="text-indent">
+            <xsl:value-of select="$tocindent" />
          </xsl:attribute>
-         <xsl:variable name="Number">
-            <xsl:if test="$numberHeadings='true' and $numberHeadingsDepth &gt; $level">
-               <xsl:call-template name="calculateNumber">
-                  <xsl:with-param name="numbersuffix" select="$tocNumberSuffix"/>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:variable>
-         <xsl:value-of select="$Number"/>
-         <xsl:text> </xsl:text>
-         <inline>
-            <xsl:apply-templates mode="section" select="tei:head"/>
-         </inline>
-         <leader rule-thickness="0pt"/>
-         <inline>
-            <xsl:call-template name="linkStyle"/>
-            <xsl:variable name="pagref">
-               <xsl:choose>
-                  <xsl:when test="@xml:id">
-                     <xsl:value-of select="@xml:id"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="generate-id()"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
-            <basic-link internal-destination="{$pagref}">
-               <page-number-citation ref-id="{$pagref}"/>
-            </basic-link>
-         </inline>
-      </block>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] <param name="level">level</param>
-      </desc>
-   </doc>
-  <xsl:template name="xheading">
-      <xsl:param name="level"/>
-      <xsl:if test="$numberHeadings='true'">
-         <xsl:call-template name="calculateNumber"/>
-      </xsl:if>
-      <xsl:call-template name="divXRefHeading"/>
-  </xsl:template>
+			<xsl:variable name="Number">
+				<xsl:if
+					test="$numberHeadings='true' and $numberHeadingsDepth &gt; $level">
+					<xsl:call-template name="calculateNumber">
+						<xsl:with-param name="numbersuffix"
+							select="$tocNumberSuffix" />
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:variable>
+			<xsl:value-of select="$Number" />
+			<xsl:text> </xsl:text>
+			<inline>
+				<xsl:apply-templates mode="section"
+					select="tei:head" />
+			</inline>
+			<leader rule-thickness="0pt" />
+			<inline>
+				<xsl:call-template name="linkStyle" />
+				<xsl:variable name="pagref">
+					<xsl:choose>
+						<xsl:when test="@xml:id">
+							<xsl:value-of select="@xml:id" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="generate-id()" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<basic-link internal-destination="{$pagref}">
+					<page-number-citation ref-id="{$pagref}" />
+				</basic-link>
+			</inline>
+		</block>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo]
+			<param name="level">level</param>
+		</desc>
+	</doc>
+	<xsl:template name="xheading">
+		<xsl:param name="level" />
+		<xsl:if test="$numberHeadings='true'">
+			<xsl:call-template name="calculateNumber" />
+		</xsl:if>
+		<xsl:call-template name="divXRefHeading" />
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[fo] Work out the number of a section <param name="numbersuffix">suffix to add after number (typically ". ")</param>
-      </desc>
-   </doc>
-  <xsl:template name="calculateNumber">
-      <xsl:param name="numbersuffix"/>
-      <xsl:choose>
-         <xsl:when test="$prenumberedHeadings='true' and @n">
-            <xsl:value-of select="@n"/>
-            <xsl:value-of select="$numbersuffix"/>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:front">
-            <xsl:if test="not($numberFrontHeadings='')">
-               <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4"
-                           format="{$numberFrontHeadings}"
-                           from="tei:front"
-                           level="multiple"/>
-               <xsl:value-of select="$numbersuffix"/>
-            </xsl:if>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:back">
-            <xsl:if test="not($numberBackHeadings='')">
-               <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">appendixWords</xsl:with-param>
-               </xsl:call-template>
-               <xsl:text> </xsl:text>
-               <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4"
-                           format="{$numberBackHeadings}"
-                           from="tei:back"
-                           level="multiple"/>
-               <xsl:value-of select="$numbersuffix"/>
-            </xsl:if>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4" from="tei:body"
-                        level="multiple"/>
-	           <xsl:value-of select="$numbersuffix"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[fo] Work out the number of a section
+			<param name="numbersuffix">suffix to add after number (typically ". ")</param>
+		</desc>
+	</doc>
+	<xsl:template name="calculateNumber">
+		<xsl:param name="numbersuffix" />
+		<xsl:choose>
+			<xsl:when test="$prenumberedHeadings='true' and @n">
+				<xsl:value-of select="@n" />
+				<xsl:value-of select="$numbersuffix" />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:front">
+				<xsl:if test="not($numberFrontHeadings='')">
+					<xsl:number
+						count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4"
+						format="{$numberFrontHeadings}" from="tei:front" level="multiple" />
+					<xsl:value-of select="$numbersuffix" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="ancestor::tei:back">
+				<xsl:if test="not($numberBackHeadings='')">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							appendixWords
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:text> </xsl:text>
+					<xsl:number
+						count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4"
+						format="{$numberBackHeadings}" from="tei:back" level="multiple" />
+					<xsl:value-of select="$numbersuffix" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:number
+					count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4" from="tei:body"
+					level="multiple" />
+				<xsl:value-of select="$numbersuffix" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/textcrit.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/textcrit.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/textcrit.xsl	(revision 2397)
@@ -1,90 +1,94 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a fotex rng tei teix"
-                version="2.0">
+<xsl:stylesheet xmlns:fotex="http://www.tug.org/fotex"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fotex rng tei teix" version="2.0">
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the textcrit
-      module, making FO output. </p>
-         <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the textcrit
+				module, making FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: textcrit.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-   <xsl:template name="appReading">
-     <xsl:param name="lemma"/>
-     <xsl:param name="lemmawitness"/>
-     <xsl:param name="readings"/>
-     <footnote>
-       <footnote-citation>
-	 <inline font-size="8pt" vertical-align="super">
-	 </inline>
-       </footnote-citation>
-       <list-block>
-	 <xsl:attribute name="provisional-distance-between-starts">
-	   <xsl:value-of select="$betweenStarts"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: textcrit.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:template name="appReading">
+		<xsl:param name="lemma" />
+		<xsl:param name="lemmawitness" />
+		<xsl:param name="readings" />
+		<footnote>
+			<footnote-citation>
+				<inline font-size="8pt" vertical-align="super">
+				</inline>
+			</footnote-citation>
+			<list-block>
+				<xsl:attribute
+					name="provisional-distance-between-starts">
+	   <xsl:value-of select="$betweenStarts" />
 	 </xsl:attribute>
-	 <xsl:attribute name="provisional-label-separation">
-	   <xsl:value-of select="$labelSeparation"/>
+				<xsl:attribute name="provisional-label-separation">
+	   <xsl:value-of select="$labelSeparation" />
 	 </xsl:attribute>
-	 <list-item>
-	   <list-item-label end-indent="label-end()">
-	     <block>
-	       <inline font-size="{$footnoteSize}" vertical-align="super">
-	       </inline>
-	     </block>
-	   </list-item-label>
-	   <list-item-body start-indent="body-start()">
-	     <block font-size="{$footnoteSize}">
-	       <xsl:copy-of select="$readings"/>
-	     </block>
-	   </list-item-body>
-	 </list-item>
-       </list-block>
-     </footnote>
+				<list-item>
+					<list-item-label end-indent="label-end()">
+						<block>
+							<inline font-size="{$footnoteSize}" vertical-align="super">
+							</inline>
+						</block>
+					</list-item-label>
+					<list-item-body start-indent="body-start()">
+						<block font-size="{$footnoteSize}">
+							<xsl:copy-of select="$readings" />
+						</block>
+					</list-item-body>
+				</list-item>
+			</list-block>
+		</footnote>
 
-  </xsl:template>
+	</xsl:template>
 
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/corpus.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/corpus.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/fo2/corpus.xsl	(revision 2397)
@@ -1,55 +1,58 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      corpus module, making XSL-FO output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				corpus module, making XSL-FO output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: corpus.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: corpus.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/microdata.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/microdata.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/microdata.xsl	(revision 2397)
@@ -1,34 +1,33 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    version="2.0"
-    xpath-default-namespace="http://www.tei-c.org/ns/1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0">
 
-  <xsl:template name="microdata">
-    <xsl:choose>
-      <xsl:when test="self::p"/>
-      <xsl:when test="starts-with(local-name(),'div')">
-	<xsl:attribute name="itemscope">itemscope</xsl:attribute>
-	<xsl:attribute name="itemtype">http://www.tei-c.org/ns/1.0/</xsl:attribute>
-      </xsl:when>
-      <xsl:when test="self::docDate|self::date">
-	<xsl:attribute name="itemprop">date</xsl:attribute>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:attribute name="itemprop" select="local-name()"/>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:if test="@when">
-      <xsl:attribute name="data-when">
-	<xsl:value-of select="@when"/>
+	<xsl:template name="microdata">
+		<xsl:choose>
+			<xsl:when test="self::p" />
+			<xsl:when test="starts-with(local-name(),'div')">
+				<xsl:attribute name="itemscope">itemscope</xsl:attribute>
+				<xsl:attribute name="itemtype">http://www.tei-c.org/ns/1.0/</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="self::docDate|self::date">
+				<xsl:attribute name="itemprop">date</xsl:attribute>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:attribute name="itemprop" select="local-name()" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if test="@when">
+			<xsl:attribute name="data-when">
+	<xsl:value-of select="@when" />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template name="bodyMicroData">
-    <xsl:attribute name="itemscope">itemscope</xsl:attribute>
-    <xsl:attribute name="itemtype">http://www.tei-c.org/ns/1.0/</xsl:attribute>
-    <xsl:attribute name="itemprop">TEI</xsl:attribute>
-  </xsl:template>
+	<xsl:template name="bodyMicroData">
+		<xsl:attribute name="itemscope">itemscope</xsl:attribute>
+		<xsl:attribute name="itemtype">http://www.tei-c.org/ns/1.0/</xsl:attribute>
+		<xsl:attribute name="itemprop">TEI</xsl:attribute>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/textstructure.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/textstructure.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/textstructure.xsl	(revision 2397)
@@ -1,14 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    version="2.0"
-    xmlns="http://www.w3.org/1999/xhtml"
-    xpath-default-namespace="http://www.tei-c.org/ns/1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0">
 
-  <xsl:template match="front|body|back">
-    <div class="tei_{local-name()}">
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
+	<xsl:template match="front|body|back">
+		<div class="tei_{local-name()}">
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/build-to.xml	(revision 2397)
@@ -1,80 +1,78 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitohtml">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9703 2011-11-09 11:16:42Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into HTML files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output ePUB file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="stylesheetFile"  value="../profiles/${profile}/html5/to.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <import file="../odds2/build-to.xml"/>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9703 2011-11-09 11:16:42Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into HTML files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output ePUB file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="stylesheetFile"
+		value="../profiles/${profile}/html5/to.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<import file="../odds2/build-to.xml" />
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
 
- 
-  <target name="transform">
-    <echo level="info">XSLT generate HTML5 files</echo>
-    <xslt force="yes" style="${stylesheetFile}" in="${outputTempDir}/tmp2.xml" out="${outputFile}" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <param name="inputDir" expression="${inputFileDir}/"/>
-      <param name="cssFile" expression="${cssFile}" if="cssFile"/>
-      <!-- name of media overlay file -->
-      <param name="mediaoverlay" expression="${mediaoverlay}" if="mediaoverlay"/>
-      <!-- file per page -->
-      <param name="filePerPage" expression="${filePerPage}" if="filePerPage"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
 
- <target name="dist" depends="setup,odd,notodd,transform,cleanup"/>
+	<target name="transform">
+		<echo level="info">XSLT generate HTML5 files</echo>
+		<xslt force="yes" style="${stylesheetFile}"
+			in="${outputTempDir}/tmp2.xml" out="${outputFile}"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<param name="inputDir" expression="${inputFileDir}/" />
+			<param name="cssFile" expression="${cssFile}" if="cssFile" />
+			<!-- name of media overlay file -->
+			<param name="mediaoverlay" expression="${mediaoverlay}"
+				if="mediaoverlay" />
+			<!-- file per page -->
+			<param name="filePerPage" expression="${filePerPage}"
+				if="filePerPage" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="dist" depends="setup,odd,notodd,transform,cleanup" />
 
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
+
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/tei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/tei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/html5/tei.xsl	(revision 2397)
@@ -1,33 +1,30 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="tei"
-    version="2.0">
-    <!-- import base conversion style -->
+<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../xhtml2/tei.xsl"/>
-    <xsl:import href="textstructure.xsl"/>
-    <xsl:output method="xml" omit-xml-declaration="yes" doctype-system="about:legacy-compat" />
-    <xsl:param name="outputTarget">html5</xsl:param>
-    <xsl:param name="doctype-system">about:legacy-compat</xsl:param>
-    <xsl:param name="doctype-public"/>
-    <xsl:param name="divOffset">1</xsl:param>
+	<xsl:import href="../xhtml2/tei.xsl" />
+	<xsl:import href="textstructure.xsl" />
+	<xsl:output method="xml" omit-xml-declaration="yes"
+		doctype-system="about:legacy-compat" />
+	<xsl:param name="outputTarget">
+		html5
+	</xsl:param>
+	<xsl:param name="doctype-system">
+		about:legacy-compat
+	</xsl:param>
+	<xsl:param name="doctype-public" />
+	<xsl:param name="divOffset">
+		1
+	</xsl:param>
 
-    <xsl:template match="/">
-	<xsl:call-template name="processTEI"/>
-    </xsl:template>
+	<xsl:template match="/">
+		<xsl:call-template name="processTEI" />
+	</xsl:template>
 
-<!--
-    <xsl:template match="@*|text()|comment()|processing-instruction()"  mode="html5">
-      <xsl:copy-of select="."/>
-    </xsl:template>
-        
-    <xsl:template match="*" mode="html5">
-      <xsl:element name="{local-name()}">
-         <xsl:apply-templates
-	     select="*|@*|processing-instruction()|comment()|text()"  mode="html5"/>
-      </xsl:element>
-   </xsl:template>
--->
+	<!-- <xsl:template match="@*|text()|comment()|processing-instruction()" 
+		mode="html5"> <xsl:copy-of select="."/> </xsl:template> <xsl:template match="*" 
+		mode="html5"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" 
+		mode="html5"/> </xsl:element> </xsl:template> -->
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/build-to.xml	(revision 2397)
@@ -1,120 +1,131 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitoepub">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 10055 2012-01-20 18:46:11Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into ePUB files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output ePUB file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="stylesheetFile"
-	    value="../profiles/${profile}/epub/to.xsl"/>
-  <property name="listgraphics" value="../tools/makegraphicsanttask.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <import file="../odds2/build-to.xml"/>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
-  <target name="dist" depends="setup,odd,notodd,convert,cleanup"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 10055 2012-01-20 18:46:11Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into ePUB files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output ePUB file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="stylesheetFile"
+		value="../profiles/${profile}/epub/to.xsl" />
+	<property name="listgraphics"
+		value="../tools/makegraphicsanttask.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<import file="../odds2/build-to.xml" />
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
+	<target name="dist" depends="setup,odd,notodd,convert,cleanup" />
 
-  <target name="convert">
-    <!-- Recreate temporary output directory -->
-    <!-- The transformation for EPUB output. -->
-    <echo level="info">XSLT generate ePub files</echo>
-    <xslt force="yes" style="${stylesheetFile}" in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/OPS/index.html" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <param name="inputDir" expression="${inputFileDir}/"/>
-      <param name="fixgraphicsurl" expression="true"/>
-      <!-- supply unique URN for ebook-->
-      <param name="uid" expression="${uid}" if="uid"/>
-      <!-- set splitting level-->
-      <param name="splitLevel" expression="${splitLevel}" if="splitLevel"/>
-      <!-- supply name of publisher for ebook-->
-      <param name="publisher" expression="${publisher}" if="publisher"/>
-      <!-- supply subject/category for ebook-->
-      <param name="subject" expression="${subject}" if="subject"/>
-      <!-- supply name of JPEG file for ebook cover-->
-      <param name="coverimage" expression="${coverimage}" if="coverimage"/>
-      <!-- supply name of CSS file-->
-      <param name="cssFile" expression="${cssFile}" if="cssFile"/>
-      <!-- name of media overlay file -->
-      <param name="mediaoverlay" expression="${mediaoverlay}" if="mediaoverlay"/>
-      <!-- file per page -->
-      <param name="filePerPage" expression="${filePerPage}" if="filePerPage"/>
-      <!-- epub viewport -->
-      <param name="viewPortHeight" expression="${viewPortHeight}" if="viewPortHeight"/>
-      <param name="viewPortWidth" expression="${viewPortWidth}" if="viewPortWidth"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-      <!-- disable compression on the output ZIP -->
-      <param name="nocompress" expression="${nocompress}" if="nocompress"/>
-    </xslt>
-    <echo level="info">Get names of graphics files and write an ant task</echo>
-    <xslt force="yes" style="${listgraphics}" classpath="classpath" in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/copy.xml">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="inputDir" expression="${inputFileDir}"/>
-      <param name="mediaDir" expression="OPS/media"/>
-      <param name="mediaoverlay" expression="${mediaoverlay}" if="mediaoverlay"/>
-      <param name="filePerPage" expression="${filePerPage}" if="filePerPage"/>
-    </xslt>
-    <echo level="info">Copy image files</echo>
-    <ant antfile="${outputTempDir}/copy.xml"/>
-    <echo level="info">ZIP: put files from ${outputTempDir} together into ${outputFile}</echo>
-    <delete file="${outputFile}"/>
-    <zip destfile="${outputFile}" basedir="${outputTempDir}"
-	 compress="true" excludes="mimetype,tmp1.xml,tmp2.xml,copy.xml"/>
-    <zip destfile="${outputFile}" basedir="${outputTempDir}" includes="mimetype" update="true" keepcompression="true" compress="false"/>
-  </target>
+	<target name="convert">
+		<!-- Recreate temporary output directory -->
+		<!-- The transformation for EPUB output. -->
+		<echo level="info">XSLT generate ePub files</echo>
+		<xslt force="yes" style="${stylesheetFile}"
+			in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/OPS/index.html"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<param name="inputDir" expression="${inputFileDir}/" />
+			<param name="fixgraphicsurl" expression="true" />
+			<!-- supply unique URN for ebook -->
+			<param name="uid" expression="${uid}" if="uid" />
+			<!-- set splitting level -->
+			<param name="splitLevel" expression="${splitLevel}"
+				if="splitLevel" />
+			<!-- supply name of publisher for ebook -->
+			<param name="publisher" expression="${publisher}"
+				if="publisher" />
+			<!-- supply subject/category for ebook -->
+			<param name="subject" expression="${subject}" if="subject" />
+			<!-- supply name of JPEG file for ebook cover -->
+			<param name="coverimage" expression="${coverimage}"
+				if="coverimage" />
+			<!-- supply name of CSS file -->
+			<param name="cssFile" expression="${cssFile}" if="cssFile" />
+			<!-- name of media overlay file -->
+			<param name="mediaoverlay" expression="${mediaoverlay}"
+				if="mediaoverlay" />
+			<!-- file per page -->
+			<param name="filePerPage" expression="${filePerPage}"
+				if="filePerPage" />
+			<!-- epub viewport -->
+			<param name="viewPortHeight" expression="${viewPortHeight}"
+				if="viewPortHeight" />
+			<param name="viewPortWidth" expression="${viewPortWidth}"
+				if="viewPortWidth" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+			<!-- disable compression on the output ZIP -->
+			<param name="nocompress" expression="${nocompress}"
+				if="nocompress" />
+		</xslt>
+		<echo level="info">Get names of graphics files and write an ant task</echo>
+		<xslt force="yes" style="${listgraphics}" classpath="classpath"
+			in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/copy.xml">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="inputDir" expression="${inputFileDir}" />
+			<param name="mediaDir" expression="OPS/media" />
+			<param name="mediaoverlay" expression="${mediaoverlay}"
+				if="mediaoverlay" />
+			<param name="filePerPage" expression="${filePerPage}"
+				if="filePerPage" />
+		</xslt>
+		<echo level="info">Copy image files</echo>
+		<ant antfile="${outputTempDir}/copy.xml" />
+		<echo level="info">ZIP: put files from ${outputTempDir} together into
+			${outputFile}</echo>
+		<delete file="${outputFile}" />
+		<zip destfile="${outputFile}" basedir="${outputTempDir}"
+			compress="true" excludes="mimetype,tmp1.xml,tmp2.xml,copy.xml" />
+		<zip destfile="${outputFile}" basedir="${outputTempDir}"
+			includes="mimetype" update="true" keepcompression="true"
+			compress="false" />
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/tei-to-epub.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/tei-to-epub.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/tei-to-epub.xsl	(revision 2397)
@@ -1,580 +1,768 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:smil="http://www.w3.org/ns/SMIL" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:iso="http://www.iso.org/ns/1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2.0" exclude-result-prefixes="iso tei teix dc              html opf ncx smil">
-  <xsl:import href="../xhtml2/tei.xsl"/>
-  <xsl:import href="epub-common.xsl"/>
-  <xsl:import href="epub-preflight.xsl"/>
-  <xsl:output method="xml" encoding="utf-8" indent="no"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p>
-	TEI stylesheet for making ePub output. A lot learnt from
-	http://www.hxa.name/articles/content/epub-guide_hxa7241_2007.html and
-	the stylesheets of the NZETC.
-      </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:smil="http://www.w3.org/ns/SMIL"
+	xmlns:opf="http://www.idpf.org/2007/opf"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2.0"
+	exclude-result-prefixes="iso tei teix dc              html opf ncx smil">
+	<xsl:import href="../xhtml2/tei.xsl" />
+	<xsl:import href="epub-common.xsl" />
+	<xsl:import href="epub-preflight.xsl" />
+	<xsl:output method="xml" encoding="utf-8" indent="no" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet for making ePub output. A lot learnt from
+				http://www.hxa.name/articles/content/epub-guide_hxa7241_2007.html
+				and
+				the stylesheets of the NZETC.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: tei-to-epub.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:param name="STDOUT">false</xsl:param>
-  <xsl:param name="autoHead">true</xsl:param>
-  <xsl:param name="autoToc">true</xsl:param>
-  <xsl:param name="bottomNavigationPanel">false</xsl:param>
-  <xsl:param name="coverimage"/>
-  <xsl:param name="createanttask">false</xsl:param>
-  <xsl:param name="cssFile">../tei.css</xsl:param>
-  <xsl:param name="cssODDFile">../odd.css</xsl:param>
-  <xsl:param name="cssPrintFile">../epub-print.css</xsl:param>
-  <xsl:param name="debug">false</xsl:param>
-  <xsl:param name="directory">.</xsl:param>
-  <xsl:param name="doctypePublic">-//W3C//DTD XHTML 1.1//EN</xsl:param>
-  <xsl:param name="doctypeSystem">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</xsl:param>
-  <xsl:param name="fixgraphicsurl">false</xsl:param>
-  <xsl:param name="footnoteBackLink">true</xsl:param>
-  <xsl:param name="inputDir">.</xsl:param>
-  <xsl:param name="institution"/>
-  <xsl:param name="linkPanel">false</xsl:param>
-  <xsl:param name="odd">false</xsl:param>
-  <xsl:param name="outputDir"><xsl:value-of select="$directory"/>/OPS</xsl:param>
-  <xsl:param name="outputTarget">epub</xsl:param>
-  <xsl:param name="publisher"/>
-  <xsl:param name="splitLevel">0</xsl:param>
-  <xsl:param name="subject"/>
-  <xsl:param name="tocDepth">5</xsl:param>
-  <xsl:param name="tocFront">true</xsl:param>
-  <xsl:param name="topNavigationPanel">false</xsl:param>
-  <xsl:param name="uid"/>
-  <xsl:param name="useHeaderFrontMatter">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>(extensible) wrapper for root element</desc>
-  </doc>
-  <xsl:template match="/">
-    <xsl:call-template name="processTEI"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Override of top-level template. This does most of
-  the work: performing the normal transformation, fixing the links to graphics files so that they are
-  all relative, creating the extra output files, etc</desc>
-  </doc>
-  <xsl:template name="processTEI">
-    <xsl:variable name="stage1">
-      <xsl:apply-templates mode="preflight"/>
-    </xsl:variable>
-    <xsl:for-each select="$stage1">
-      <xsl:call-template name="processTEIHook"/>
-      <xsl:variable name="coverImageOutside">
-        <xsl:choose>
-          <xsl:when test="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs]">
-            <xsl:for-each select="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs][1]">
-              <xsl:for-each select="id(substring(@facs,2))">
-                <xsl:choose>
-                  <xsl:when test="count(tei:graphic)=1">
-                    <xsl:value-of select="tei:graphic/@url"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:value-of select="tei:graphic[2]/@url"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </xsl:for-each>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:when test="not($coverimage='')">
-            <xsl:value-of select="$coverimage"/>
-          </xsl:when>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="coverImageInside">
-        <xsl:choose>
-          <xsl:when test="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs]">
-            <xsl:for-each select="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs][1]">
-              <xsl:for-each select="id(substring(@facs,2))">
-                <xsl:value-of select="tei:graphic[1]/@url"/>
-              </xsl:for-each>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:when test="not($coverimage='')">
-            <xsl:value-of select="$coverimage"/>
-          </xsl:when>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-        <xsl:when test="$splitLevel='-1'">
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates mode="split"/>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:for-each select="*">
-        <xsl:variable name="TOC">
-          <TOC xmlns="http://www.w3.org/1999/xhtml">
-            <xsl:call-template name="mainTOC"/>
-          </TOC>
-        </xsl:variable>
-        <!--
-	    <xsl:result-document href="/tmp/TOC">
-	    <xsl:copy-of select="$TOC"/>
-	    </xsl:result-document>
--->
-        <xsl:for-each select="tokenize($javascriptFiles,',')">
-          <xsl:variable name="file" select="normalize-space(.)"/>
-          <xsl:variable name="name" select="tokenize($file,'/')[last()]"/>
-          <xsl:if test="$verbose='true'">
-            <xsl:message>write Javascript file <xsl:value-of select="$name"/></xsl:message>
-          </xsl:if>
-          <xsl:result-document method="text" href="{concat($directory,'/OPS/',$name)}">
-            <xsl:for-each select="unparsed-text($file)">
-              <xsl:copy-of select="."/>
-            </xsl:for-each>
-          </xsl:result-document>
-        </xsl:for-each>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/stylesheet.css</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="text" href="{concat($directory,'/OPS/stylesheet.css')}">
-          <xsl:if test="not($cssFile='')">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>reading file <xsl:value-of select="$cssFile"/></xsl:message>
-            </xsl:if>
-            <xsl:for-each select="tokenize(unparsed-text($cssFile),     '\r?\n')">
-              <xsl:call-template name="purgeCSS"/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="not($cssSecondaryFile='')">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>reading secondary file <xsl:value-of select="$cssSecondaryFile"/></xsl:message>
-            </xsl:if>
-            <xsl:for-each select="tokenize(unparsed-text($cssSecondaryFile),       '\r?\n')">
-              <xsl:call-template name="purgeCSS"/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="$odd='true'">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>reading file <xsl:value-of select="$cssODDFile"/></xsl:message>
-            </xsl:if>
-            <xsl:for-each select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
-              <xsl:call-template name="purgeCSS"/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="$odd='true'">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>reading file <xsl:value-of select="$cssODDFile"/></xsl:message>
-            </xsl:if>
-            <xsl:for-each select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
-              <xsl:call-template name="purgeCSS"/>
-            </xsl:for-each>
-          </xsl:if>
-          <xsl:if test="$filePerPage='true'">
-            <xsl:text>body { width: </xsl:text>
-            <xsl:value-of select="$viewPortWidth"/>
-            <xsl:text>px;
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-to-epub.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:param name="STDOUT">
+		false
+	</xsl:param>
+	<xsl:param name="autoHead">
+		true
+	</xsl:param>
+	<xsl:param name="autoToc">
+		true
+	</xsl:param>
+	<xsl:param name="bottomNavigationPanel">
+		false
+	</xsl:param>
+	<xsl:param name="coverimage" />
+	<xsl:param name="createanttask">
+		false
+	</xsl:param>
+	<xsl:param name="cssFile">
+		../tei.css
+	</xsl:param>
+	<xsl:param name="cssODDFile">
+		../odd.css
+	</xsl:param>
+	<xsl:param name="cssPrintFile">
+		../epub-print.css
+	</xsl:param>
+	<xsl:param name="debug">
+		false
+	</xsl:param>
+	<xsl:param name="directory">
+		.
+	</xsl:param>
+	<xsl:param name="doctypePublic">
+		-//W3C//DTD XHTML 1.1//EN
+	</xsl:param>
+	<xsl:param name="doctypeSystem">
+		http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
+	</xsl:param>
+	<xsl:param name="fixgraphicsurl">
+		false
+	</xsl:param>
+	<xsl:param name="footnoteBackLink">
+		true
+	</xsl:param>
+	<xsl:param name="inputDir">
+		.
+	</xsl:param>
+	<xsl:param name="institution" />
+	<xsl:param name="linkPanel">
+		false
+	</xsl:param>
+	<xsl:param name="odd">
+		false
+	</xsl:param>
+	<xsl:param name="outputDir">
+		<xsl:value-of select="$directory" />
+		/OPS
+	</xsl:param>
+	<xsl:param name="outputTarget">
+		epub
+	</xsl:param>
+	<xsl:param name="publisher" />
+	<xsl:param name="splitLevel">
+		0
+	</xsl:param>
+	<xsl:param name="subject" />
+	<xsl:param name="tocDepth">
+		5
+	</xsl:param>
+	<xsl:param name="tocFront">
+		true
+	</xsl:param>
+	<xsl:param name="topNavigationPanel">
+		false
+	</xsl:param>
+	<xsl:param name="uid" />
+	<xsl:param name="useHeaderFrontMatter">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>(extensible) wrapper for root element</desc>
+	</doc>
+	<xsl:template match="/">
+		<xsl:call-template name="processTEI" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Override of top-level template. This does most of
+			the work: performing the normal transformation, fixing the links to
+			graphics files so that they are
+			all relative, creating the extra output files, etc</desc>
+	</doc>
+	<xsl:template name="processTEI">
+		<xsl:variable name="stage1">
+			<xsl:apply-templates mode="preflight" />
+		</xsl:variable>
+		<xsl:for-each select="$stage1">
+			<xsl:call-template name="processTEIHook" />
+			<xsl:variable name="coverImageOutside">
+				<xsl:choose>
+					<xsl:when
+						test="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs]">
+						<xsl:for-each
+							select="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs][1]">
+							<xsl:for-each select="id(substring(@facs,2))">
+								<xsl:choose>
+									<xsl:when test="count(tei:graphic)=1">
+										<xsl:value-of select="tei:graphic/@url" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="tei:graphic[2]/@url" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="not($coverimage='')">
+						<xsl:value-of select="$coverimage" />
+					</xsl:when>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:variable name="coverImageInside">
+				<xsl:choose>
+					<xsl:when
+						test="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs]">
+						<xsl:for-each
+							select="/tei:TEI/tei:text/tei:front/tei:titlePage[@facs][1]">
+							<xsl:for-each select="id(substring(@facs,2))">
+								<xsl:value-of select="tei:graphic[1]/@url" />
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="not($coverimage='')">
+						<xsl:value-of select="$coverimage" />
+					</xsl:when>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when test="$splitLevel='-1'">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="split" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:for-each select="*">
+				<xsl:variable name="TOC">
+					<TOC xmlns="http://www.w3.org/1999/xhtml">
+						<xsl:call-template name="mainTOC" />
+					</TOC>
+				</xsl:variable>
+				<!-- <xsl:result-document href="/tmp/TOC"> <xsl:copy-of select="$TOC"/> 
+					</xsl:result-document> -->
+				<xsl:for-each select="tokenize($javascriptFiles,',')">
+					<xsl:variable name="file" select="normalize-space(.)" />
+					<xsl:variable name="name"
+						select="tokenize($file,'/')[last()]" />
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							write Javascript file
+							<xsl:value-of select="$name" />
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document method="text"
+						href="{concat($directory,'/OPS/',$name)}">
+						<xsl:for-each select="unparsed-text($file)">
+							<xsl:copy-of select="." />
+						</xsl:for-each>
+					</xsl:result-document>
+				</xsl:for-each>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/stylesheet.css
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="text"
+					href="{concat($directory,'/OPS/stylesheet.css')}">
+					<xsl:if test="not($cssFile='')">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								reading file
+								<xsl:value-of select="$cssFile" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:for-each
+							select="tokenize(unparsed-text($cssFile),     '\r?\n')">
+							<xsl:call-template name="purgeCSS" />
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:if test="not($cssSecondaryFile='')">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								reading secondary file
+								<xsl:value-of select="$cssSecondaryFile" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:for-each
+							select="tokenize(unparsed-text($cssSecondaryFile),       '\r?\n')">
+							<xsl:call-template name="purgeCSS" />
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:if test="$odd='true'">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								reading file
+								<xsl:value-of select="$cssODDFile" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:for-each
+							select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
+							<xsl:call-template name="purgeCSS" />
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:if test="$odd='true'">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								reading file
+								<xsl:value-of select="$cssODDFile" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:for-each
+							select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
+							<xsl:call-template name="purgeCSS" />
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:if test="$filePerPage='true'">
+						<xsl:text>body { width: </xsl:text>
+						<xsl:value-of select="$viewPortWidth" />
+						<xsl:text>px;
  height: </xsl:text>
-            <xsl:value-of select="$viewPortHeight"/>
-            <xsl:text>px;
+						<xsl:value-of select="$viewPortHeight" />
+						<xsl:text>px;
 }
 img.fullpage {
 position: absolute;
 height: </xsl:text>
-            <xsl:value-of select="$viewPortHeight"/>
-            <xsl:text>px; left:0px; top:0px;}
+						<xsl:value-of select="$viewPortHeight" />
+						<xsl:text>px; left:0px; top:0px;}
 </xsl:text>
-          </xsl:if>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/print.css</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="text" href="{concat($directory,'/OPS/print.css')}">
-          <xsl:if test="$verbose='true'">
-            <xsl:message>reading file <xsl:value-of select="$cssPrintFile"/></xsl:message>
-          </xsl:if>
-          <xsl:for-each select="tokenize(unparsed-text($cssPrintFile),     '\r?\n')">
-            <xsl:call-template name="purgeCSS"/>
-          </xsl:for-each>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file mimetype</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="text" href="{concat($directory,'/mimetype')}">
-          <xsl:value-of select="$epubMimetype"/>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file META-INF/container.xml</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="xml" href="{concat($directory,'/META-INF/container.xml')}">
-          <container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
-            <rootfiles>
-              <rootfile full-path="OPS/content.opf" media-type="application/oebps-package+xml"/>
-            </rootfiles>
-          </container>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/content.opf</xsl:message>
-        </xsl:if>
-        <xsl:result-document href="{concat($directory,'/OPS/content.opf')}" method="xml">
-	  <xsl:variable name="A">
-	    <xsl:call-template name="generateAuthor"/>
-	  </xsl:variable>
-	<xsl:variable name="printA">
-	  <xsl:analyze-string select="$A" regex="([^,]+), ([^,]+), (.+)">
-	    <xsl:matching-substring>
-	      <xsl:value-of select="regex-group(1)"/>
-	      <xsl:text>, </xsl:text>
-	      <xsl:value-of select="regex-group(2)"/>
-	    </xsl:matching-substring>
-	    <xsl:non-matching-substring>
-	      <xsl:value-of select="."/>
-	    </xsl:non-matching-substring>
-	  </xsl:analyze-string>
-	</xsl:variable>
+					</xsl:if>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/print.css
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="text"
+					href="{concat($directory,'/OPS/print.css')}">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							reading file
+							<xsl:value-of select="$cssPrintFile" />
+						</xsl:message>
+					</xsl:if>
+					<xsl:for-each
+						select="tokenize(unparsed-text($cssPrintFile),     '\r?\n')">
+						<xsl:call-template name="purgeCSS" />
+					</xsl:for-each>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file mimetype
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="text"
+					href="{concat($directory,'/mimetype')}">
+					<xsl:value-of select="$epubMimetype" />
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file META-INF/container.xml
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="xml"
+					href="{concat($directory,'/META-INF/container.xml')}">
+					<container
+						xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+						version="1.0">
+						<rootfiles>
+							<rootfile full-path="OPS/content.opf"
+								media-type="application/oebps-package+xml" />
+						</rootfiles>
+					</container>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/content.opf
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/content.opf')}" method="xml">
+					<xsl:variable name="A">
+						<xsl:call-template name="generateAuthor" />
+					</xsl:variable>
+					<xsl:variable name="printA">
+						<xsl:analyze-string select="$A"
+							regex="([^,]+), ([^,]+), (.+)">
+							<xsl:matching-substring>
+								<xsl:value-of select="regex-group(1)" />
+								<xsl:text>, </xsl:text>
+								<xsl:value-of select="regex-group(2)" />
+							</xsl:matching-substring>
+							<xsl:non-matching-substring>
+								<xsl:value-of select="." />
+							</xsl:non-matching-substring>
+						</xsl:analyze-string>
+					</xsl:variable>
 
-          <package xmlns="http://www.idpf.org/2007/opf" unique-identifier="dcidid" version="2.0">
-	    <xsl:call-template name="opfmetadata">
-	      <xsl:with-param name="author" select="$A"/>
-	      <xsl:with-param name="printAuthor" select="$printA"/>
-	      <xsl:with-param name="coverImageOutside" select="$coverImageOutside"/>
-	    </xsl:call-template>
-            <manifest>
-              <!-- deal with intricacies of overlay files -->
-              <xsl:variable name="TL" select="key('Timeline',1)"/>
-              <xsl:if test="$mediaoverlay='true' and        key('Timeline',1)">
-                <xsl:if test="$verbose='true'">
-                  <xsl:message>write file SMIL files</xsl:message>
-                </xsl:if>
-                <xsl:for-each select="key('Timeline',1)">
-                  <xsl:variable name="TLnumber">
-                    <xsl:number level="any"/>
-                  </xsl:variable>
-                  <xsl:variable name="audio">
-                    <xsl:text>media/audio</xsl:text>
-                    <xsl:number level="any"/>
-                    <xsl:text>.</xsl:text>
-                    <xsl:value-of select="tokenize(@corresp,'\.')[last()]"/>
-                  </xsl:variable>
-                  <item id="timeline-audio{$TLnumber}" href="{$audio}">
-                    <xsl:attribute name="media-type">
+					<package xmlns="http://www.idpf.org/2007/opf"
+						unique-identifier="dcidid" version="2.0">
+						<xsl:call-template name="opfmetadata">
+							<xsl:with-param name="author" select="$A" />
+							<xsl:with-param name="printAuthor"
+								select="$printA" />
+							<xsl:with-param name="coverImageOutside"
+								select="$coverImageOutside" />
+						</xsl:call-template>
+						<manifest>
+							<!-- deal with intricacies of overlay files -->
+							<xsl:variable name="TL" select="key('Timeline',1)" />
+							<xsl:if
+								test="$mediaoverlay='true' and        key('Timeline',1)">
+								<xsl:if test="$verbose='true'">
+									<xsl:message>
+										write file SMIL files
+									</xsl:message>
+								</xsl:if>
+								<xsl:for-each select="key('Timeline',1)">
+									<xsl:variable name="TLnumber">
+										<xsl:number level="any" />
+									</xsl:variable>
+									<xsl:variable name="audio">
+										<xsl:text>media/audio</xsl:text>
+										<xsl:number level="any" />
+										<xsl:text>.</xsl:text>
+										<xsl:value-of
+											select="tokenize(@corresp,'\.')[last()]" />
+									</xsl:variable>
+									<item id="timeline-audio{$TLnumber}" href="{$audio}">
+										<xsl:attribute name="media-type">
                       <xsl:choose>
-                        <xsl:when test="contains($audio,'.m4a')">audio/m4a</xsl:when>
+                        <xsl:when
+											test="contains($audio,'.m4a')">audio/m4a</xsl:when>
                         <xsl:otherwise>audio/m4a</xsl:otherwise>
                       </xsl:choose>
                     </xsl:attribute>
-                  </item>
-                  <xsl:for-each select="key('PB',1)">
-                    <xsl:variable name="page">
-                      <xsl:value-of select="generate-id()"/>
-                    </xsl:variable>
-                    <xsl:variable name="target">
-                      <xsl:apply-templates select="." mode="ident"/>
-                    </xsl:variable>
-                    <xsl:if test="count(key('objectOnPage',$page))&gt;0">
-                      <item id="{$target}-audio" href="{$target}-overlay.smil" media-type="application/smil+xml"/>
-                      <xsl:result-document href="{concat($directory,'/OPS/',$target,'-overlay.smil')}" method="xml">
-                        <smil xmlns="http://www.w3.org/ns/SMIL" version="3.0" profile="http://www.ipdf.org/epub/30/profile/content/">
-                          <body>
-                            <xsl:for-each select="key('objectOnPage',$page)">
-                              <xsl:variable name="object" select="@xml:id"/>
-                              <xsl:for-each select="$TL">
-                                <xsl:for-each select="key('Object',$object)">
-                                  <par id="{@xml:id}">
-                                    <text src="{$target}.html{@corresp}"/>
-                                    <audio src="{$audio}" clipBegin="{@from}{../@unit}" clipEnd="{@to}{../@unit}"/>
-                                  </par>
-                                </xsl:for-each>
-                              </xsl:for-each>
-                            </xsl:for-each>
-                          </body>
-                        </smil>
-                      </xsl:result-document>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:for-each>
-              </xsl:if>
-              <xsl:if test="not($coverImageOutside='')">
-                <item href="{$coverImageOutside}" id="cover-image" media-type="image/jpeg"/>
-              </xsl:if>
-              <xsl:if test="not($coverimage='') and not($coverimage=$coverImageOutside)">
-                <item href="{$coverimage}" id="cover-image-extra" media-type="image/jpeg"/>
-              </xsl:if>
-              <xsl:for-each select="tokenize($javascriptFiles,',')">
-                <xsl:variable name="name" select="tokenize(normalize-space(.),'/')[last()]"/>
-                <item href="{$name}" id="javascript{position()}" media-type="text/javascript"/>
-              </xsl:for-each>
-              <item href="stylesheet.css" id="css" media-type="text/css"/>
-              <item href="titlepage.html" id="titlepage" media-type="application/xhtml+xml"/>
-              <xsl:if test="$filePerPage='true'">
-                <item href="titlepageverso.html" id="titlepageverso" media-type="application/xhtml+xml"/>
-              </xsl:if>
-              <xsl:for-each select="tei:text/tei:front/tei:titlePage">
-                <xsl:variable name="N" select="position()"/>
-                <item href="titlepage{$N}.html" id="titlepage{$N}" media-type="application/xhtml+xml"/>
-              </xsl:for-each>
-              <item href="titlepageback.html" id="titlepageback" media-type="application/xhtml+xml"/>
-              <item id="print.css" href="print.css" media-type="text/css"/>
-              <item id="apt" href="page-template.xpgt" media-type="application/adobe-page-template+xml"/>
-              <item id="start" href="index.html" media-type="application/xhtml+xml"/>
-              <xsl:choose>
-                <xsl:when test="$filePerPage='true'">
-                  <xsl:for-each select="key('PB',1)">
-                    <xsl:variable name="target">
-                      <xsl:apply-templates select="." mode="ident"/>
-                    </xsl:variable>
-                    <xsl:if test="@facs">
-                      <xsl:variable name="facstarget">
-                        <xsl:apply-templates select="." mode="ident"/>
-                        <xsl:text>-facs.html</xsl:text>
-                      </xsl:variable>
-                      <item href="{$facstarget}" media-type="application/xhtml+xml">
-                        <xsl:attribute name="id">
+									</item>
+									<xsl:for-each select="key('PB',1)">
+										<xsl:variable name="page">
+											<xsl:value-of select="generate-id()" />
+										</xsl:variable>
+										<xsl:variable name="target">
+											<xsl:apply-templates select="."
+												mode="ident" />
+										</xsl:variable>
+										<xsl:if test="count(key('objectOnPage',$page))&gt;0">
+											<item id="{$target}-audio" href="{$target}-overlay.smil"
+												media-type="application/smil+xml" />
+											<xsl:result-document
+												href="{concat($directory,'/OPS/',$target,'-overlay.smil')}"
+												method="xml">
+												<smil xmlns="http://www.w3.org/ns/SMIL" version="3.0"
+													profile="http://www.ipdf.org/epub/30/profile/content/">
+													<body>
+														<xsl:for-each
+															select="key('objectOnPage',$page)">
+															<xsl:variable name="object" select="@xml:id" />
+															<xsl:for-each select="$TL">
+																<xsl:for-each
+																	select="key('Object',$object)">
+																	<par id="{@xml:id}">
+																		<text src="{$target}.html{@corresp}" />
+																		<audio src="{$audio}"
+																			clipBegin="{@from}{../@unit}"
+																			clipEnd="{@to}{../@unit}" />
+																	</par>
+																</xsl:for-each>
+															</xsl:for-each>
+														</xsl:for-each>
+													</body>
+												</smil>
+											</xsl:result-document>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:for-each>
+							</xsl:if>
+							<xsl:if test="not($coverImageOutside='')">
+								<item href="{$coverImageOutside}" id="cover-image"
+									media-type="image/jpeg" />
+							</xsl:if>
+							<xsl:if
+								test="not($coverimage='') and not($coverimage=$coverImageOutside)">
+								<item href="{$coverimage}" id="cover-image-extra"
+									media-type="image/jpeg" />
+							</xsl:if>
+							<xsl:for-each
+								select="tokenize($javascriptFiles,',')">
+								<xsl:variable name="name"
+									select="tokenize(normalize-space(.),'/')[last()]" />
+								<item href="{$name}" id="javascript{position()}"
+									media-type="text/javascript" />
+							</xsl:for-each>
+							<item href="stylesheet.css" id="css" media-type="text/css" />
+							<item href="titlepage.html" id="titlepage"
+								media-type="application/xhtml+xml" />
+							<xsl:if test="$filePerPage='true'">
+								<item href="titlepageverso.html" id="titlepageverso"
+									media-type="application/xhtml+xml" />
+							</xsl:if>
+							<xsl:for-each
+								select="tei:text/tei:front/tei:titlePage">
+								<xsl:variable name="N" select="position()" />
+								<item href="titlepage{$N}.html" id="titlepage{$N}"
+									media-type="application/xhtml+xml" />
+							</xsl:for-each>
+							<item href="titlepageback.html" id="titlepageback"
+								media-type="application/xhtml+xml" />
+							<item id="print.css" href="print.css" media-type="text/css" />
+							<item id="apt" href="page-template.xpgt"
+								media-type="application/adobe-page-template+xml" />
+							<item id="start" href="index.html"
+								media-type="application/xhtml+xml" />
+							<xsl:choose>
+								<xsl:when test="$filePerPage='true'">
+									<xsl:for-each select="key('PB',1)">
+										<xsl:variable name="target">
+											<xsl:apply-templates select="."
+												mode="ident" />
+										</xsl:variable>
+										<xsl:if test="@facs">
+											<xsl:variable name="facstarget">
+												<xsl:apply-templates select="."
+													mode="ident" />
+												<xsl:text>-facs.html</xsl:text>
+											</xsl:variable>
+											<item href="{$facstarget}"
+												media-type="application/xhtml+xml">
+												<xsl:attribute name="id">
                           <xsl:text>pagefacs</xsl:text>
-                          <xsl:number level="any"/>
+                          <xsl:number level="any" />
                         </xsl:attribute>
-                      </item>
-                    </xsl:if>
-                    <item href="{$target}.html" media-type="application/xhtml+xml">
-                      <xsl:if test="$mediaoverlay='true'">
-                        <xsl:attribute name="media-overlay">
-                          <xsl:value-of select="$target"/>
+											</item>
+										</xsl:if>
+										<item href="{$target}.html"
+											media-type="application/xhtml+xml">
+											<xsl:if test="$mediaoverlay='true'">
+												<xsl:attribute name="media-overlay">
+                          <xsl:value-of select="$target" />
                           <xsl:text>-audio</xsl:text>
                         </xsl:attribute>
-                      </xsl:if>
-                      <xsl:attribute name="id">
+											</xsl:if>
+											<xsl:attribute name="id">
                         <xsl:text>page</xsl:text>
-                        <xsl:number level="any"/>
+                        <xsl:number level="any" />
                       </xsl:attribute>
-                    </item>
-                  </xsl:for-each>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
-                    <xsl:choose>
-                      <xsl:when test="not(html:a)"/>
-                      <xsl:when test="starts-with(html:a/@href,'#')"/>
-                      <xsl:otherwise>
-                        <item href="{html:a[1]/@href}" media-type="application/xhtml+xml">
-                          <xsl:attribute name="id">
+										</item>
+									</xsl:for-each>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each
+										select="$TOC/html:TOC/html:ul/html:li">
+										<xsl:choose>
+											<xsl:when test="not(html:a)" />
+											<xsl:when test="starts-with(html:a/@href,'#')" />
+											<xsl:otherwise>
+												<item href="{html:a[1]/@href}"
+													media-type="application/xhtml+xml">
+													<xsl:attribute name="id">
                             <xsl:text>section</xsl:text>
-                            <xsl:number count="html:li" level="any"/>
+                            <xsl:number count="html:li"
+														level="any" />
                           </xsl:attribute>
-                        </item>
-                      </xsl:otherwise>
-                    </xsl:choose>
-                    <xsl:if test="html:ul">
-                      <xsl:for-each select="html:ul//html:li[html:a          and          not(contains(html:a/@href,'#'))]">
-                        <item href="{html:a[1]/@href}" media-type="application/xhtml+xml">
-                          <xsl:attribute name="id">
+												</item>
+											</xsl:otherwise>
+										</xsl:choose>
+										<xsl:if test="html:ul">
+											<xsl:for-each
+												select="html:ul//html:li[html:a          and          not(contains(html:a/@href,'#'))]">
+												<item href="{html:a[1]/@href}"
+													media-type="application/xhtml+xml">
+													<xsl:attribute name="id">
                             <xsl:text>section</xsl:text>
-                            <xsl:number count="html:li" level="any"/>
+                            <xsl:number count="html:li"
+														level="any" />
                           </xsl:attribute>
-                        </item>
-                      </xsl:for-each>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:otherwise>
-              </xsl:choose>
-              <!-- images -->
-              <xsl:for-each select="key('GRAPHICS',1)">
-                <xsl:variable name="img" select="@url|@facs"/>
-                <xsl:if test="not($img=$coverImageOutside)">
-                  <xsl:variable name="ID">
-                    <xsl:number level="any"/>
-                  </xsl:variable>
-                  <xsl:variable name="mimetype">
-                    <xsl:choose>
-                      <xsl:when test="@mimeType != ''">
-                        <xsl:value-of select="@mimeType"/>
-                      </xsl:when>
-                      <xsl:when test="contains($img,'.gif')">image/gif</xsl:when>
-                      <xsl:when test="contains($img,'.png')">image/png</xsl:when>
-                      <xsl:when test="contains($img,'.mpeg')">video/mpeg4</xsl:when>
-                      <xsl:when test="contains($img,'.mp4')">video/mpeg4</xsl:when>
-                      <xsl:when test="contains($img,'.m4v')">video/mpeg4</xsl:when>
-                      <xsl:otherwise>image/jpeg</xsl:otherwise>
-                    </xsl:choose>
-                  </xsl:variable>
-                  <item href="{$img}" id="image-{$ID}" media-type="{$mimetype}"/>
-                </xsl:if>
-              </xsl:for-each>
-              <!-- page images -->
-              <xsl:for-each select="key('PBGRAPHICS',1)">
-                <xsl:variable name="img" select="@facs"/>
-                <xsl:variable name="ID">
-                  <xsl:number level="any"/>
-                </xsl:variable>
-                <xsl:variable name="mimetype">
-                  <xsl:choose>
-                    <xsl:when test="@mimeType != ''">
-                      <xsl:value-of select="@mimeType"/>
-                    </xsl:when>
-                    <xsl:when test="contains($img,'.gif')">image/gif</xsl:when>
-                    <xsl:when test="contains($img,'.png')">image/png</xsl:when>
-                    <xsl:otherwise>image/jpeg</xsl:otherwise>
-                  </xsl:choose>
-                </xsl:variable>
-                <item href="{$img}" id="pbimage-{$ID}" media-type="{$mimetype}"/>
-              </xsl:for-each>
-              <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
-              <xsl:call-template name="epubManifestHook"/>
-            </manifest>
-            <spine toc="ncx">
-              <itemref idref="titlepage" linear="yes"/>
-              <xsl:if test="$filePerPage='true'">
-                <itemref idref="titlepageverso" linear="yes"/>
-              </xsl:if>
-              <xsl:for-each select="tei:text/tei:front/tei:titlePage">
-                <xsl:variable name="N" select="position()"/>
-                <itemref idref="titlepage{$N}" linear="yes"/>
-              </xsl:for-each>
-              <itemref idref="start" linear="yes"/>
-              <xsl:choose>
-                <xsl:when test="$filePerPage='true'">
-                  <xsl:for-each select="key('PB',1)">
-                    <xsl:if test="@facs">
-                      <itemref>
-                        <xsl:attribute name="idref">
+												</item>
+											</xsl:for-each>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+							<!-- images -->
+							<xsl:for-each select="key('GRAPHICS',1)">
+								<xsl:variable name="img" select="@url|@facs" />
+								<xsl:if test="not($img=$coverImageOutside)">
+									<xsl:variable name="ID">
+										<xsl:number level="any" />
+									</xsl:variable>
+									<xsl:variable name="mimetype">
+										<xsl:choose>
+											<xsl:when test="@mimeType != ''">
+												<xsl:value-of select="@mimeType" />
+											</xsl:when>
+											<xsl:when test="contains($img,'.gif')">
+												image/gif
+											</xsl:when>
+											<xsl:when test="contains($img,'.png')">
+												image/png
+											</xsl:when>
+											<xsl:when test="contains($img,'.mpeg')">
+												video/mpeg4
+											</xsl:when>
+											<xsl:when test="contains($img,'.mp4')">
+												video/mpeg4
+											</xsl:when>
+											<xsl:when test="contains($img,'.m4v')">
+												video/mpeg4
+											</xsl:when>
+											<xsl:otherwise>
+												image/jpeg
+											</xsl:otherwise>
+										</xsl:choose>
+									</xsl:variable>
+									<item href="{$img}" id="image-{$ID}"
+										media-type="{$mimetype}" />
+								</xsl:if>
+							</xsl:for-each>
+							<!-- page images -->
+							<xsl:for-each select="key('PBGRAPHICS',1)">
+								<xsl:variable name="img" select="@facs" />
+								<xsl:variable name="ID">
+									<xsl:number level="any" />
+								</xsl:variable>
+								<xsl:variable name="mimetype">
+									<xsl:choose>
+										<xsl:when test="@mimeType != ''">
+											<xsl:value-of select="@mimeType" />
+										</xsl:when>
+										<xsl:when test="contains($img,'.gif')">
+											image/gif
+										</xsl:when>
+										<xsl:when test="contains($img,'.png')">
+											image/png
+										</xsl:when>
+										<xsl:otherwise>
+											image/jpeg
+										</xsl:otherwise>
+									</xsl:choose>
+								</xsl:variable>
+								<item href="{$img}" id="pbimage-{$ID}"
+									media-type="{$mimetype}" />
+							</xsl:for-each>
+							<item id="ncx" href="toc.ncx"
+								media-type="application/x-dtbncx+xml" />
+							<xsl:call-template name="epubManifestHook" />
+						</manifest>
+						<spine toc="ncx">
+							<itemref idref="titlepage" linear="yes" />
+							<xsl:if test="$filePerPage='true'">
+								<itemref idref="titlepageverso" linear="yes" />
+							</xsl:if>
+							<xsl:for-each
+								select="tei:text/tei:front/tei:titlePage">
+								<xsl:variable name="N" select="position()" />
+								<itemref idref="titlepage{$N}" linear="yes" />
+							</xsl:for-each>
+							<itemref idref="start" linear="yes" />
+							<xsl:choose>
+								<xsl:when test="$filePerPage='true'">
+									<xsl:for-each select="key('PB',1)">
+										<xsl:if test="@facs">
+											<itemref>
+												<xsl:attribute name="idref">
                           <xsl:text>pagefacs</xsl:text>
-                          <xsl:number level="any"/>
+                          <xsl:number level="any" />
                         </xsl:attribute>
-                        <xsl:attribute name="linear">yes</xsl:attribute>
-                      </itemref>
-                    </xsl:if>
-                    <itemref>
-                      <xsl:attribute name="idref">
+												<xsl:attribute name="linear">yes</xsl:attribute>
+											</itemref>
+										</xsl:if>
+										<itemref>
+											<xsl:attribute name="idref">
                         <xsl:text>page</xsl:text>
-                        <xsl:number level="any"/>
+                        <xsl:number level="any" />
                       </xsl:attribute>
-                      <xsl:attribute name="linear">yes</xsl:attribute>
-                    </itemref>
-                  </xsl:for-each>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
-                    <xsl:choose>
-                      <xsl:when test="not(html:a)"/>
-                      <xsl:when test="starts-with(html:a/@href,'#')"/>
-                      <xsl:otherwise>
-                        <itemref>
-                          <xsl:attribute name="idref">
+											<xsl:attribute name="linear">yes</xsl:attribute>
+										</itemref>
+									</xsl:for-each>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each
+										select="$TOC/html:TOC/html:ul/html:li">
+										<xsl:choose>
+											<xsl:when test="not(html:a)" />
+											<xsl:when test="starts-with(html:a/@href,'#')" />
+											<xsl:otherwise>
+												<itemref>
+													<xsl:attribute name="idref">
                             <xsl:text>section</xsl:text>
-                            <xsl:number count="html:li" level="any"/>
+                            <xsl:number count="html:li"
+														level="any" />
                           </xsl:attribute>
-                          <xsl:attribute name="linear">yes</xsl:attribute>
-                        </itemref>
-                      </xsl:otherwise>
-                    </xsl:choose>
-                    <xsl:if test="html:ul">
-                      <xsl:for-each select="html:ul//html:li[html:a and not(contains(html:a/@href,'#'))]">
-                        <itemref>
-                          <xsl:attribute name="idref">
+													<xsl:attribute name="linear">yes</xsl:attribute>
+												</itemref>
+											</xsl:otherwise>
+										</xsl:choose>
+										<xsl:if test="html:ul">
+											<xsl:for-each
+												select="html:ul//html:li[html:a and not(contains(html:a/@href,'#'))]">
+												<itemref>
+													<xsl:attribute name="idref">
                             <xsl:text>section</xsl:text>
-                            <xsl:number count="html:li" level="any"/>
+                            <xsl:number count="html:li"
+														level="any" />
                           </xsl:attribute>
-                          <xsl:attribute name="linear">yes</xsl:attribute>
-                        </itemref>
-                      </xsl:for-each>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:otherwise>
-              </xsl:choose>
-              <itemref idref="titlepageback">
-                <xsl:attribute name="linear">
+													<xsl:attribute name="linear">yes</xsl:attribute>
+												</itemref>
+											</xsl:for-each>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+							<itemref idref="titlepageback">
+								<xsl:attribute name="linear">
                   <xsl:choose>
                     <xsl:when test="$filePerPage='true'">yes</xsl:when>
                     <xsl:otherwise>no</xsl:otherwise>
                   </xsl:choose>
                 </xsl:attribute>
-              </itemref>
-              <xsl:call-template name="epubSpineHook"/>
-            </spine>
-            <guide>
-              <reference type="text" href="titlepage.html" title="Cover"/>
-              <reference type="text" title="Start" href="index.html"/>
-              <xsl:choose>
-                <xsl:when test="$filePerPage='true'">
-		</xsl:when>
-                <xsl:otherwise>
-                  <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
-                    <xsl:if test="html:a">
-                      <reference type="text" href="{html:a[1]/@href}">
-                        <xsl:attribute name="title">
-                          <xsl:value-of select="normalize-space(html:a[1])"/>
+							</itemref>
+							<xsl:call-template name="epubSpineHook" />
+						</spine>
+						<guide>
+							<reference type="text" href="titlepage.html"
+								title="Cover" />
+							<reference type="text" title="Start" href="index.html" />
+							<xsl:choose>
+								<xsl:when test="$filePerPage='true'">
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each
+										select="$TOC/html:TOC/html:ul/html:li">
+										<xsl:if test="html:a">
+											<reference type="text" href="{html:a[1]/@href}">
+												<xsl:attribute name="title">
+                          <xsl:value-of
+													select="normalize-space(html:a[1])" />
                         </xsl:attribute>
-                      </reference>
-                    </xsl:if>
-                    <xsl:if test="contains(parent::html:ul/@class,'group')">
-                      <xsl:for-each select="html:ul//html:li">
-                        <xsl:choose>
-                          <xsl:when test="not(html:a)"/>
-                          <xsl:when test="contains(html:a/@href,'#')"/>
-                          <xsl:otherwise>
-                            <reference type="text" href="{html:a/@href}">
-                              <xsl:attribute name="title">
-                                <xsl:value-of select="normalize-space(html:a[1])"/>
+											</reference>
+										</xsl:if>
+										<xsl:if test="contains(parent::html:ul/@class,'group')">
+											<xsl:for-each select="html:ul//html:li">
+												<xsl:choose>
+													<xsl:when test="not(html:a)" />
+													<xsl:when test="contains(html:a/@href,'#')" />
+													<xsl:otherwise>
+														<reference type="text" href="{html:a/@href}">
+															<xsl:attribute name="title">
+                                <xsl:value-of
+																select="normalize-space(html:a[1])" />
                               </xsl:attribute>
-                            </reference>
-                          </xsl:otherwise>
-                        </xsl:choose>
-                      </xsl:for-each>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:otherwise>
-              </xsl:choose>
-              <reference href="titlepageback.html" type="text" title="About this book"/>
-            </guide>
-          </package>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/titlepage.html</xsl:message>
-        </xsl:if>
-        <xsl:result-document href="{concat($directory,'/OPS/titlepage.html')}" method="xml">
-          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-            <head>
-              <xsl:call-template name="metaHTML">
-                <xsl:with-param name="title">Title page</xsl:with-param>
-              </xsl:call-template>
-              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-              <meta name="calibre:cover" content="true"/>
-              <title>Title page</title>
-              <style type="text/css" title="override_css">
-		@page {padding: 0pt; margin:0pt}
-		body { text-align: center; padding:0pt; margin: 0pt; }
-	      </style>
-            </head>
-            <body>
-              <xsl:choose>
-                <xsl:when test="$coverImageInside=''">
-                  <div>
-                    <xsl:attribute name="style">
+														</reference>
+													</xsl:otherwise>
+												</xsl:choose>
+											</xsl:for-each>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+							<reference href="titlepageback.html" type="text"
+								title="About this book" />
+						</guide>
+					</package>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/titlepage.html
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/titlepage.html')}" method="xml">
+					<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+						<head>
+							<xsl:call-template name="metaHTML">
+								<xsl:with-param name="title">
+									Title page
+								</xsl:with-param>
+							</xsl:call-template>
+							<meta http-equiv="Content-Type"
+								content="text/html; charset=UTF-8" />
+							<meta name="calibre:cover" content="true" />
+							<title>Title page</title>
+							<style type="text/css" title="override_css">
+								@page {padding: 0pt; margin:0pt}
+								body { text-align: center; padding:0pt; margin: 0pt; }
+							</style>
+						</head>
+						<body>
+							<xsl:choose>
+								<xsl:when test="$coverImageInside=''">
+									<div>
+										<xsl:attribute name="style">
 		      font-family: serif; 
 		      height:860;          
 		      font-size:30pt; 
@@ -584,321 +772,405 @@
 		      border: solid red 1pt; 
 		      text-align:center;
 		    </xsl:attribute>
-                    <xsl:call-template name="generateTitle"/>
-                  </div>
-                </xsl:when>
-                <xsl:otherwise>
-                  <div>
-                    <img width="1200" height="1700" alt="cover picture" src="{$coverImageInside}"/>
-                  </div>
-                </xsl:otherwise>
-              </xsl:choose>
-            </body>
-          </html>
-        </xsl:result-document>
-        <xsl:for-each select="tei:text/tei:front/tei:titlePage">
-          <xsl:variable name="N" select="position()"/>
-          <xsl:if test="$verbose='true'">
-            <xsl:message>write file OPS/titlepage<xsl:value-of select="$N"/>.html</xsl:message>
-          </xsl:if>
-          <xsl:result-document href="{concat($directory,'/OPS/titlepage',$N,'.html')}" method="xml">
-            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-              <head>
-                <xsl:call-template name="metaHTML">
-                  <xsl:with-param name="title">Title page</xsl:with-param>
-                </xsl:call-template>
-                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-                <xsl:call-template name="linkCSS">
-		  <xsl:with-param
-		      name="file">stylesheet.css</xsl:with-param>
-		</xsl:call-template>
-                <title>Title page</title>
-              </head>
-              <body>
-                <div class="titlePage">
-                  <xsl:apply-templates/>
-                </div>
-              </body>
-            </html>
-          </xsl:result-document>
-        </xsl:for-each>
-        <xsl:if test="$filePerPage='true'">
-          <xsl:if test="$verbose='true'">
-            <xsl:message>write file OPS/titlepageverso.html</xsl:message>
-          </xsl:if>
-          <xsl:result-document href="{concat($directory,'/OPS/titlepageverso.html')}" method="xml">
-            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-              <head>
-                <xsl:call-template name="metaHTML">
-                  <xsl:with-param name="title">title page verso</xsl:with-param>
-                </xsl:call-template>
-                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-                <title>title page verso</title>
-              </head>
-              <body>
-                <p/>
-              </body>
-            </html>
-          </xsl:result-document>
-        </xsl:if>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/titlepageback.html</xsl:message>
-        </xsl:if>
-        <xsl:result-document href="{concat($directory,'/OPS/titlepageback.html')}" method="xml">
-          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-            <head>
-              <xsl:call-template name="metaHTML">
-                <xsl:with-param name="title">About this book</xsl:with-param>
-              </xsl:call-template>
-              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-              <title>About this book</title>
-            </head>
-            <body>
-              <div style="text-align: left; font-size: larger">
-                <h2>Information about this book</h2>
-                <xsl:for-each select="/*/tei:teiHeader/tei:fileDesc">
-                  <xsl:apply-templates mode="metadata"/>
-                </xsl:for-each>
-                <xsl:for-each select="/*/tei:teiHeader/tei:encodingDesc">
-                  <xsl:apply-templates mode="metadata"/>
-                </xsl:for-each>
-              </div>
-            </body>
-          </html>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/toc.ncx</xsl:message>
-        </xsl:if>
-        <xsl:result-document href="{concat($directory,'/OPS/toc.ncx')}" method="xml">
-          <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
-            <head>
-              <meta name="dtb:uid">
-                <xsl:attribute name="content">
-                  <xsl:call-template name="generateID"/>
+										<xsl:call-template name="generateTitle" />
+									</div>
+								</xsl:when>
+								<xsl:otherwise>
+									<div>
+										<img width="1200" height="1700" alt="cover picture"
+											src="{$coverImageInside}" />
+									</div>
+								</xsl:otherwise>
+							</xsl:choose>
+						</body>
+					</html>
+				</xsl:result-document>
+				<xsl:for-each select="tei:text/tei:front/tei:titlePage">
+					<xsl:variable name="N" select="position()" />
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							write file OPS/titlepage
+							<xsl:value-of select="$N" />
+							.html
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document
+						href="{concat($directory,'/OPS/titlepage',$N,'.html')}"
+						method="xml">
+						<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+							<head>
+								<xsl:call-template name="metaHTML">
+									<xsl:with-param name="title">
+										Title page
+									</xsl:with-param>
+								</xsl:call-template>
+								<meta http-equiv="Content-Type"
+									content="text/html; charset=utf-8" />
+								<xsl:call-template name="linkCSS">
+									<xsl:with-param name="file">
+										stylesheet.css
+									</xsl:with-param>
+								</xsl:call-template>
+								<title>Title page</title>
+							</head>
+							<body>
+								<div class="titlePage">
+									<xsl:apply-templates />
+								</div>
+							</body>
+						</html>
+					</xsl:result-document>
+				</xsl:for-each>
+				<xsl:if test="$filePerPage='true'">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							write file OPS/titlepageverso.html
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document
+						href="{concat($directory,'/OPS/titlepageverso.html')}"
+						method="xml">
+						<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+							<head>
+								<xsl:call-template name="metaHTML">
+									<xsl:with-param name="title">
+										title page verso
+									</xsl:with-param>
+								</xsl:call-template>
+								<meta http-equiv="Content-Type"
+									content="text/html; charset=UTF-8" />
+								<title>title page verso</title>
+							</head>
+							<body>
+								<p />
+							</body>
+						</html>
+					</xsl:result-document>
+				</xsl:if>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/titlepageback.html
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/titlepageback.html')}" method="xml">
+					<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+						<head>
+							<xsl:call-template name="metaHTML">
+								<xsl:with-param name="title">
+									About this book
+								</xsl:with-param>
+							</xsl:call-template>
+							<meta http-equiv="Content-Type"
+								content="text/html; charset=UTF-8" />
+							<title>About this book</title>
+						</head>
+						<body>
+							<div style="text-align: left; font-size: larger">
+								<h2>Information about this book</h2>
+								<xsl:for-each
+									select="/*/tei:teiHeader/tei:fileDesc">
+									<xsl:apply-templates mode="metadata" />
+								</xsl:for-each>
+								<xsl:for-each
+									select="/*/tei:teiHeader/tei:encodingDesc">
+									<xsl:apply-templates mode="metadata" />
+								</xsl:for-each>
+							</div>
+						</body>
+					</html>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/toc.ncx
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					href="{concat($directory,'/OPS/toc.ncx')}" method="xml">
+					<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/"
+						version="2005-1">
+						<head>
+							<meta name="dtb:uid">
+								<xsl:attribute name="content">
+                  <xsl:call-template
+									name="generateID" />
                 </xsl:attribute>
-              </meta>
-              <meta name="dtb:totalPageCount" content="0"/>
-              <meta name="dtb:maxPageNumber" content="0"/>
-            </head>
-            <docTitle>
-              <text>
-                <xsl:call-template name="generateSimpleTitle"/>
-              </text>
-            </docTitle>
-            <navMap>
-              <xsl:variable name="navPoints">
-                <navPoint>
-                  <navLabel>
-                    <text>[Cover]</text>
-                  </navLabel>
-                  <content src="titlepage.html"/>
-                </navPoint>
-                <xsl:for-each select="tei:text/tei:front/tei:titlePage[1]">
-                  <xsl:variable name="N" select="position()"/>
-                  <navPoint>
-                    <navLabel>
-                      <text>[Title page]</text>
-                    </navLabel>
-                    <content src="titlepage{$N}.html"/>
-                  </navPoint>
-                </xsl:for-each>
-                <xsl:choose>
-                  <xsl:when test="not($TOC/html:TOC/html:ul[@class='toc toc_body']/html:li)">
-                    <xsl:for-each select="$TOC/html:TOC/html:ul[@class='toc toc_front']">
-                      <xsl:apply-templates select="html:li"/>
-                    </xsl:for-each>
-                    <navPoint>
-                      <navLabel>
-                        <text>[The book]</text>
-                      </navLabel>
-                      <content src="index.html"/>
-                    </navPoint>
-                    <xsl:for-each select="$TOC/html:TOC/html:ul[contains(@class,'group')]">
-                      <xsl:apply-templates select=".//html:li[not(contains(html:a/@href,'#'))]"/>
-                    </xsl:for-each>
-                    <xsl:for-each select="$TOC/html:TOC/html:ul[@class='toc toc_back']">
-                      <xsl:apply-templates select="html:li"/>
-                    </xsl:for-each>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:for-each select="$TOC/html:TOC/html:ul">
-                      <xsl:apply-templates select="html:li"/>
-                    </xsl:for-each>
-                  </xsl:otherwise>
-                </xsl:choose>
-                <navPoint>
-                  <navLabel>
-                    <text>[About this book]</text>
-                  </navLabel>
-                  <content src="titlepageback.html"/>
-                </navPoint>
-              </xsl:variable>
-              <xsl:for-each select="$navPoints/ncx:navPoint">
-                <xsl:variable name="pos" select="position()"/>
-                <navPoint id="navPoint-{$pos}" playOrder="{$pos}">
-                  <xsl:copy-of select="*"/>
-                </navPoint>
-              </xsl:for-each>
-            </navMap>
-          </ncx>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>write file OPS/page-template.xpgt</xsl:message>
-        </xsl:if>
-        <xsl:result-document method="xml" href="{concat($directory,'/OPS/page-template.xpgt')}">
-          <ade:template xmlns="http://www.w3.org/1999/xhtml" xmlns:ade="http://ns.adobe.com/2006/ade" xmlns:fo="http://www.w3.org/1999/XSL/Format">
-            <fo:layout-master-set>
-              <fo:simple-page-master master-name="single_column">
-                <fo:region-body margin-bottom="3pt" margin-top="0.5em" margin-left="3pt" margin-right="3pt"/>
-              </fo:simple-page-master>
-              <fo:simple-page-master master-name="single_column_head">
-                <fo:region-before extent="8.3em"/>
-                <fo:region-body margin-bottom="3pt" margin-top="6em" margin-left="3pt" margin-right="3pt"/>
-              </fo:simple-page-master>
-              <fo:simple-page-master master-name="two_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
-                <fo:region-body column-count="2" column-gap="10pt"/>
-              </fo:simple-page-master>
-              <fo:simple-page-master master-name="two_column_head" margin-bottom="0.5em" margin-left="0.5em" margin-right="0.5em">
-                <fo:region-before extent="8.3em"/>
-                <fo:region-body column-count="2" margin-top="6em" column-gap="10pt"/>
-              </fo:simple-page-master>
-              <fo:simple-page-master master-name="three_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
-                <fo:region-body column-count="3" column-gap="10pt"/>
-              </fo:simple-page-master>
-              <fo:simple-page-master master-name="three_column_head" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
-                <fo:region-before extent="8.3em"/>
-                <fo:region-body column-count="3" margin-top="6em" column-gap="10pt"/>
-              </fo:simple-page-master>
-              <fo:page-sequence-master>
-                <fo:repeatable-page-master-alternatives>
-                  <fo:conditional-page-master-reference master-reference="three_column_head" page-position="first" ade:min-page-width="80em"/>
-                  <fo:conditional-page-master-reference master-reference="three_column" ade:min-page-width="80em"/>
-                  <fo:conditional-page-master-reference master-reference="two_column_head" page-position="first" ade:min-page-width="50em"/>
-                  <fo:conditional-page-master-reference master-reference="two_column" ade:min-page-width="50em"/>
-                  <fo:conditional-page-master-reference master-reference="single_column_head" page-position="first"/>
-                  <fo:conditional-page-master-reference master-reference="single_column"/>
-                </fo:repeatable-page-master-alternatives>
-              </fo:page-sequence-master>
-            </fo:layout-master-set>
-            <ade:style>
-              <ade:styling-rule selector=".title_box" display="adobe-other-region" adobe-region="xsl-region-before"/>
-            </ade:style>
-          </ade:template>
-        </xsl:result-document>
-        <xsl:if test="$filePerPage='true'">
-          <xsl:if test="$verbose='true'">
-            <xsl:message>write file META-INF/com.apple.ibooks.display-options.xml</xsl:message>
-          </xsl:if>
-          <xsl:result-document href="{concat($directory,'/META-INF/com.apple.ibooks.display-options.xml')}">
-            <display_options xmlns="">
-              <platform name="*">
-                <option name="fixed-layout">true</option>
-              </platform>
-            </display_options>
-          </xsl:result-document>
-        </xsl:if>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="html:li">
-    <xsl:choose>
-      <xsl:when test="not(html:a)"/>
-      <xsl:when test="starts-with(html:a/@href,'#')"/>
-      <xsl:when test="contains(@class,'headless')"/>
-      <xsl:when test="html:a/@href=preceding-sibling::html:li/html:a/@href"/>
-      <xsl:otherwise>
-        <navPoint xmlns="http://www.daisy.org/z3986/2005/ncx/">
-          <navLabel>
-            <text>
-              <xsl:value-of select="html:span[@class='headingNumber']"/>
-              <xsl:value-of select="normalize-space(html:a[1])"/>
-            </text>
-          </navLabel>
-          <content src="{html:a/@href}"/>
-        </navPoint>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="javascriptHook">
-    <xsl:for-each select="tokenize($javascriptFiles,',')">
-      <xsl:variable name="name" select="tokenize(normalize-space(.),'/')[last()]"/>
-      <script type="text/javascript" src="{$name}">
-        <xsl:comment>JS library</xsl:comment>
-      </script>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="epubSpineHook"/>
-  <xsl:template name="epubManifestHook"/>
-  <xsl:template name="processTEIHook"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Override addition of CSS links. We force a simple
-      name of "stylesheet.css"
-      </desc>
-  </doc>
-  <xsl:template name="includeCSS">
-    <link xmlns="http://www.w3.org/1999/xhtml" href="stylesheet.css" rel="stylesheet" type="text/css"/>
-    <xsl:if test="not($cssPrintFile='')">
-      <link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" media="print" type="text/css" href="print.css"/>
-    </xsl:if>
-    <link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="page-template.xpgt"/>
-    <xsl:call-template name="generateLocalCSS"/>
-  </xsl:template>
+							</meta>
+							<meta name="dtb:totalPageCount" content="0" />
+							<meta name="dtb:maxPageNumber" content="0" />
+						</head>
+						<docTitle>
+							<text>
+								<xsl:call-template name="generateSimpleTitle" />
+							</text>
+						</docTitle>
+						<navMap>
+							<xsl:variable name="navPoints">
+								<navPoint>
+									<navLabel>
+										<text>[Cover]</text>
+									</navLabel>
+									<content src="titlepage.html" />
+								</navPoint>
+								<xsl:for-each
+									select="tei:text/tei:front/tei:titlePage[1]">
+									<xsl:variable name="N" select="position()" />
+									<navPoint>
+										<navLabel>
+											<text>[Title page]</text>
+										</navLabel>
+										<content src="titlepage{$N}.html" />
+									</navPoint>
+								</xsl:for-each>
+								<xsl:choose>
+									<xsl:when
+										test="not($TOC/html:TOC/html:ul[@class='toc toc_body']/html:li)">
+										<xsl:for-each
+											select="$TOC/html:TOC/html:ul[@class='toc toc_front']">
+											<xsl:apply-templates select="html:li" />
+										</xsl:for-each>
+										<navPoint>
+											<navLabel>
+												<text>[The book]</text>
+											</navLabel>
+											<content src="index.html" />
+										</navPoint>
+										<xsl:for-each
+											select="$TOC/html:TOC/html:ul[contains(@class,'group')]">
+											<xsl:apply-templates
+												select=".//html:li[not(contains(html:a/@href,'#'))]" />
+										</xsl:for-each>
+										<xsl:for-each
+											select="$TOC/html:TOC/html:ul[@class='toc toc_back']">
+											<xsl:apply-templates select="html:li" />
+										</xsl:for-each>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:for-each select="$TOC/html:TOC/html:ul">
+											<xsl:apply-templates select="html:li" />
+										</xsl:for-each>
+									</xsl:otherwise>
+								</xsl:choose>
+								<navPoint>
+									<navLabel>
+										<text>[About this book]</text>
+									</navLabel>
+									<content src="titlepageback.html" />
+								</navPoint>
+							</xsl:variable>
+							<xsl:for-each select="$navPoints/ncx:navPoint">
+								<xsl:variable name="pos" select="position()" />
+								<navPoint id="navPoint-{$pos}" playOrder="{$pos}">
+									<xsl:copy-of select="*" />
+								</navPoint>
+							</xsl:for-each>
+						</navMap>
+					</ncx>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						write file OPS/page-template.xpgt
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document method="xml"
+					href="{concat($directory,'/OPS/page-template.xpgt')}">
+					<ade:template xmlns="http://www.w3.org/1999/xhtml"
+						xmlns:ade="http://ns.adobe.com/2006/ade"
+						xmlns:fo="http://www.w3.org/1999/XSL/Format">
+						<fo:layout-master-set>
+							<fo:simple-page-master
+								master-name="single_column">
+								<fo:region-body margin-bottom="3pt"
+									margin-top="0.5em" margin-left="3pt" margin-right="3pt" />
+							</fo:simple-page-master>
+							<fo:simple-page-master
+								master-name="single_column_head">
+								<fo:region-before extent="8.3em" />
+								<fo:region-body margin-bottom="3pt"
+									margin-top="6em" margin-left="3pt" margin-right="3pt" />
+							</fo:simple-page-master>
+							<fo:simple-page-master
+								master-name="two_column" margin-bottom="0.5em"
+								margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+								<fo:region-body column-count="2"
+									column-gap="10pt" />
+							</fo:simple-page-master>
+							<fo:simple-page-master
+								master-name="two_column_head" margin-bottom="0.5em"
+								margin-left="0.5em" margin-right="0.5em">
+								<fo:region-before extent="8.3em" />
+								<fo:region-body column-count="2" margin-top="6em"
+									column-gap="10pt" />
+							</fo:simple-page-master>
+							<fo:simple-page-master
+								master-name="three_column" margin-bottom="0.5em"
+								margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+								<fo:region-body column-count="3"
+									column-gap="10pt" />
+							</fo:simple-page-master>
+							<fo:simple-page-master
+								master-name="three_column_head" margin-bottom="0.5em"
+								margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+								<fo:region-before extent="8.3em" />
+								<fo:region-body column-count="3" margin-top="6em"
+									column-gap="10pt" />
+							</fo:simple-page-master>
+							<fo:page-sequence-master>
+								<fo:repeatable-page-master-alternatives>
+									<fo:conditional-page-master-reference
+										master-reference="three_column_head" page-position="first"
+										ade:min-page-width="80em" />
+									<fo:conditional-page-master-reference
+										master-reference="three_column" ade:min-page-width="80em" />
+									<fo:conditional-page-master-reference
+										master-reference="two_column_head" page-position="first"
+										ade:min-page-width="50em" />
+									<fo:conditional-page-master-reference
+										master-reference="two_column" ade:min-page-width="50em" />
+									<fo:conditional-page-master-reference
+										master-reference="single_column_head" page-position="first" />
+									<fo:conditional-page-master-reference
+										master-reference="single_column" />
+								</fo:repeatable-page-master-alternatives>
+							</fo:page-sequence-master>
+						</fo:layout-master-set>
+						<ade:style>
+							<ade:styling-rule selector=".title_box"
+								display="adobe-other-region" adobe-region="xsl-region-before" />
+						</ade:style>
+					</ade:template>
+				</xsl:result-document>
+				<xsl:if test="$filePerPage='true'">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							write file META-INF/com.apple.ibooks.display-options.xml
+						</xsl:message>
+					</xsl:if>
+					<xsl:result-document
+						href="{concat($directory,'/META-INF/com.apple.ibooks.display-options.xml')}">
+						<display_options xmlns="">
+							<platform name="*">
+								<option name="fixed-layout">true</option>
+							</platform>
+						</display_options>
+					</xsl:result-document>
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="html:li">
+		<xsl:choose>
+			<xsl:when test="not(html:a)" />
+			<xsl:when test="starts-with(html:a/@href,'#')" />
+			<xsl:when test="contains(@class,'headless')" />
+			<xsl:when
+				test="html:a/@href=preceding-sibling::html:li/html:a/@href" />
+			<xsl:otherwise>
+				<navPoint xmlns="http://www.daisy.org/z3986/2005/ncx/">
+					<navLabel>
+						<text>
+							<xsl:value-of
+								select="html:span[@class='headingNumber']" />
+							<xsl:value-of select="normalize-space(html:a[1])" />
+						</text>
+					</navLabel>
+					<content src="{html:a/@href}" />
+				</navPoint>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="javascriptHook">
+		<xsl:for-each select="tokenize($javascriptFiles,',')">
+			<xsl:variable name="name"
+				select="tokenize(normalize-space(.),'/')[last()]" />
+			<script type="text/javascript" src="{$name}">
+				<xsl:comment>
+					JS library
+				</xsl:comment>
+			</script>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="epubSpineHook" />
+	<xsl:template name="epubManifestHook" />
+	<xsl:template name="processTEIHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Override addition of CSS links. We force a simple
+			name of "stylesheet.css"
+		</desc>
+	</doc>
+	<xsl:template name="includeCSS">
+		<link xmlns="http://www.w3.org/1999/xhtml" href="stylesheet.css"
+			rel="stylesheet" type="text/css" />
+		<xsl:if test="not($cssPrintFile='')">
+			<link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet"
+				media="print" type="text/css" href="print.css" />
+		</xsl:if>
+		<link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet"
+			type="application/vnd.adobe-page-template+xml"
+			href="page-template.xpgt" />
+		<xsl:call-template name="generateLocalCSS" />
+	</xsl:template>
 
-  <xsl:template name="opfmetadata">
-    <xsl:param name="author"/>
-    <xsl:param name="printAuthor"/>
-    <xsl:param name="coverImageOutside"/>
-    <metadata xmlns="http://www.idpf.org/2007/opf"
-	      xmlns:dc="http://purl.org/dc/elements/1.1/" 
-	      xmlns:dcterms="http://purl.org/dc/terms/" 
-	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	      xmlns:opf="http://www.idpf.org/2007/opf">
-      <dc:title>
-	<xsl:call-template name="generateSimpleTitle"/>
-      </dc:title>
-      <dc:language xsi:type="dcterms:RFC3066">
-	<xsl:call-template name="generateLanguage"/>
-      </dc:language>
-      <xsl:call-template name="generateSubject"/>
-      <dc:identifier id="dcidid" opf:scheme="URI">
-	<xsl:call-template name="generateID"/>
-      </dc:identifier>
-      <dc:description>
-	<xsl:call-template name="generateSimpleTitle"/>
-	<xsl:text> / </xsl:text>
-	<xsl:value-of select="$author"/>
-      </dc:description>
-      <dc:creator>
-	<xsl:choose>
-	  <xsl:when test="$printAuthor=''">Anonymous/Unknown</xsl:when>
-	  <xsl:otherwise>
-	    <xsl:value-of select="$printAuthor"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </dc:creator>
-      <dc:publisher>
-	<xsl:call-template name="generatePublisher"/>
-      </dc:publisher>
-      <xsl:for-each select="tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@notAfter]">
-	<dc:date opf:event="creation">
-	  <xsl:value-of select="@notAfter"/>
-	</dc:date>
-      </xsl:for-each>
-      <xsl:for-each select="tei:teiHeader/tei:fileDesc/tei:sourceDesc//tei:date[@when][1]">
-	<dc:date opf:event="original-publication">
-	  <xsl:value-of select="@when"/>
-	</dc:date>
-      </xsl:for-each>
-      <dc:date opf:event="epub-publication" xsi:type="dcterms:W3CDTF">
-	<xsl:call-template name="generateDate"/>
-      </dc:date>
-      <dc:rights>
-	<xsl:call-template name="generateLicence"/>
-      </dc:rights>
-      <xsl:if test="not($coverImageOutside='')">
-	<meta name="cover" content="cover-image"/>
-      </xsl:if>
-    </metadata>
-</xsl:template>
+	<xsl:template name="opfmetadata">
+		<xsl:param name="author" />
+		<xsl:param name="printAuthor" />
+		<xsl:param name="coverImageOutside" />
+		<metadata xmlns="http://www.idpf.org/2007/opf"
+			xmlns:dc="http://purl.org/dc/elements/1.1/"
+			xmlns:dcterms="http://purl.org/dc/terms/"
+			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+			xmlns:opf="http://www.idpf.org/2007/opf">
+			<dc:title>
+				<xsl:call-template name="generateSimpleTitle" />
+			</dc:title>
+			<dc:language xsi:type="dcterms:RFC3066">
+				<xsl:call-template name="generateLanguage" />
+			</dc:language>
+			<xsl:call-template name="generateSubject" />
+			<dc:identifier id="dcidid" opf:scheme="URI">
+				<xsl:call-template name="generateID" />
+			</dc:identifier>
+			<dc:description>
+				<xsl:call-template name="generateSimpleTitle" />
+				<xsl:text> / </xsl:text>
+				<xsl:value-of select="$author" />
+			</dc:description>
+			<dc:creator>
+				<xsl:choose>
+					<xsl:when test="$printAuthor=''">
+						Anonymous/Unknown
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$printAuthor" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</dc:creator>
+			<dc:publisher>
+				<xsl:call-template name="generatePublisher" />
+			</dc:publisher>
+			<xsl:for-each
+				select="tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@notAfter]">
+				<dc:date opf:event="creation">
+					<xsl:value-of select="@notAfter" />
+				</dc:date>
+			</xsl:for-each>
+			<xsl:for-each
+				select="tei:teiHeader/tei:fileDesc/tei:sourceDesc//tei:date[@when][1]">
+				<dc:date opf:event="original-publication">
+					<xsl:value-of select="@when" />
+				</dc:date>
+			</xsl:for-each>
+			<dc:date opf:event="epub-publication"
+				xsi:type="dcterms:W3CDTF">
+				<xsl:call-template name="generateDate" />
+			</dc:date>
+			<dc:rights>
+				<xsl:call-template name="generateLicence" />
+			</dc:rights>
+			<xsl:if test="not($coverImageOutside='')">
+				<meta name="cover" content="cover-image" />
+			</xsl:if>
+		</metadata>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/epub-preflight.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/epub-preflight.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/epub-preflight.xsl	(revision 2397)
@@ -1,143 +1,160 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:iso="http://www.iso.org/ns/1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2.0" exclude-result-prefixes="iso tei teix dc html ncx">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p>
-	TEI stylesheet for making ePub output, preflight pass to clean
-	up text. 
-      </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2.0"
+	exclude-result-prefixes="iso tei teix dc html ncx">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet for making ePub output, preflight pass to clean
+				up text.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: epub-common.xsl 9329 2011-09-20 09:47:43Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Local mode to rewrite names of graphics inclusions;
-      default is identity transform
-      </desc>
-  </doc>
-  <xsl:template match="@*|text()|comment()|processing-instruction()" mode="preflight">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Local mode to rewrite names of graphics inclusions;
-      default is identifty transform
-      </desc>
-  </doc>
-  <xsl:template match="*" mode="preflight">
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="preflight"/>
-    </xsl:copy>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: epub-common.xsl 9329 2011-09-20 09:47:43Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:template match="tei:graphic" mode="preflight">
-    <xsl:copy>
-      <xsl:choose>
-        <xsl:when test="$fixgraphicsurl='true'">
-          <xsl:variable name="newName">
-            <xsl:text>media/resource</xsl:text>
-            <xsl:number level="any"/>
-            <xsl:text>.</xsl:text>
-            <xsl:value-of select="tokenize(@url,'\.')[last()]"/>
-          </xsl:variable>
-          <xsl:attribute name="url">
-            <xsl:value-of select="$newName"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Local mode to rewrite names of graphics inclusions;
+			default is identity transform
+		</desc>
+	</doc>
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="preflight">
+		<xsl:copy-of select="." />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Local mode to rewrite names of graphics inclusions;
+			default is identifty transform
+		</desc>
+	</doc>
+	<xsl:template match="*" mode="preflight">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()"
+				mode="preflight" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="tei:graphic" mode="preflight">
+		<xsl:copy>
+			<xsl:choose>
+				<xsl:when test="$fixgraphicsurl='true'">
+					<xsl:variable name="newName">
+						<xsl:text>media/resource</xsl:text>
+						<xsl:number level="any" />
+						<xsl:text>.</xsl:text>
+						<xsl:value-of select="tokenize(@url,'\.')[last()]" />
+					</xsl:variable>
+					<xsl:attribute name="url">
+            <xsl:value-of select="$newName" />
           </xsl:attribute>
-          <xsl:copy-of select="@*[not(local-name()='url')]"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:copy-of select="@*"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:copy>
-  </xsl:template>
-  <xsl:template match="tei:pb[@facs]" mode="preflight">
-    <xsl:copy>
-      <xsl:choose>
-	<xsl:when test="@rend='none'">
-          <xsl:copy-of select="@*"/>
-	</xsl:when>
-        <xsl:when test="$fixgraphicsurl='true'">
-          <xsl:variable name="newName">
-            <xsl:text>media/pageimage</xsl:text>
-            <xsl:number level="any"/>
-            <xsl:text>.</xsl:text>
-            <xsl:value-of select="tokenize(@facs,'\.')[last()]"/>
-          </xsl:variable>
-          <xsl:attribute name="facs">
-            <xsl:value-of select="$newName"/>
+					<xsl:copy-of select="@*[not(local-name()='url')]" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:copy-of select="@*" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template match="tei:pb[@facs]" mode="preflight">
+		<xsl:copy>
+			<xsl:choose>
+				<xsl:when test="@rend='none'">
+					<xsl:copy-of select="@*" />
+				</xsl:when>
+				<xsl:when test="$fixgraphicsurl='true'">
+					<xsl:variable name="newName">
+						<xsl:text>media/pageimage</xsl:text>
+						<xsl:number level="any" />
+						<xsl:text>.</xsl:text>
+						<xsl:value-of select="tokenize(@facs,'\.')[last()]" />
+					</xsl:variable>
+					<xsl:attribute name="facs">
+            <xsl:value-of select="$newName" />
           </xsl:attribute>
-          <xsl:copy-of select="@*[not(local-name()='facs')]"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:copy-of select="@*"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:copy>
-  </xsl:template>
+					<xsl:copy-of select="@*[not(local-name()='facs')]" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:copy-of select="@*" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="tei:hi[tei:pb]" mode="preflight">
-    <xsl:variable name="atts" select="@*"/>
-    <xsl:for-each-group select="node()" group-starting-with="tei:pb|tei:figure">
-        <xsl:choose>
-          <xsl:when test="self::tei:pb">
-	      <tei:pb>
-		<xsl:copy-of select="@*"/>
-	      </tei:pb>
-	      <tei:hi>
-		<xsl:copy-of select="$atts"/>
-		<xsl:copy-of select="current-group() except ."/>
-	      </tei:hi>
-          </xsl:when>
-          <xsl:when test="self::tei:figure">
-	    <xsl:copy-of select="."/>
-	    <tei:hi>
-	      <xsl:copy-of select="$atts"/>
-	      <xsl:copy-of select="current-group() except ."/>
-	    </tei:hi>
-          </xsl:when>
-          <xsl:otherwise>
-	    <tei:hi>
-	      <xsl:copy-of select="$atts"/>
-	      <xsl:copy-of select="current-group()"/>
-	    </tei:hi>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each-group>
+	<xsl:template match="tei:hi[tei:pb]" mode="preflight">
+		<xsl:variable name="atts" select="@*" />
+		<xsl:for-each-group select="node()"
+			group-starting-with="tei:pb|tei:figure">
+			<xsl:choose>
+				<xsl:when test="self::tei:pb">
+					<tei:pb>
+						<xsl:copy-of select="@*" />
+					</tei:pb>
+					<tei:hi>
+						<xsl:copy-of select="$atts" />
+						<xsl:copy-of select="current-group() except ." />
+					</tei:hi>
+				</xsl:when>
+				<xsl:when test="self::tei:figure">
+					<xsl:copy-of select="." />
+					<tei:hi>
+						<xsl:copy-of select="$atts" />
+						<xsl:copy-of select="current-group() except ." />
+					</tei:hi>
+				</xsl:when>
+				<xsl:otherwise>
+					<tei:hi>
+						<xsl:copy-of select="$atts" />
+						<xsl:copy-of select="current-group()" />
+					</tei:hi>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
 
-  </xsl:template>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/epub-common.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/epub-common.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub/epub-common.xsl	(revision 2397)
@@ -1,505 +1,582 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:iso="http://www.iso.org/ns/1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2.0" exclude-result-prefixes="iso tei teix dc html ncx">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p>
-	TEI stylesheet for making ePub output. 
-      </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2.0"
+	exclude-result-prefixes="iso tei teix dc html ncx">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet for making ePub output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: epub-common.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:key match="tei:graphic[not(ancestor::teix:egXML)]" use="1" name="G"/>
-  <xsl:key name="GRAPHICS" use="1" match="tei:graphic"/>
-  <xsl:key name="PBGRAPHICS" use="1" match="tei:pb[@facs and not(@rend='none')]"/>
-  <xsl:key name="Timeline" match="tei:timeline" use="1"/>
-  <xsl:key name="Object" match="tei:when" use="substring(@corresp,2)"/>
-  <xsl:key name="objectOnPage" match="tei:*[@xml:id]" use="generate-id(preceding::tei:pb[1])"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:param name="javascriptFiles"/>
-  <xsl:param name="epubMimetype">application/epub+zip</xsl:param>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: epub-common.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:key match="tei:graphic[not(ancestor::teix:egXML)]" use="1"
+		name="G" />
+	<xsl:key name="GRAPHICS" use="1" match="tei:graphic" />
+	<xsl:key name="PBGRAPHICS" use="1"
+		match="tei:pb[@facs and not(@rend='none')]" />
+	<xsl:key name="Timeline" match="tei:timeline" use="1" />
+	<xsl:key name="Object" match="tei:when"
+		use="substring(@corresp,2)" />
+	<xsl:key name="objectOnPage" match="tei:*[@xml:id]"
+		use="generate-id(preceding::tei:pb[1])" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Suppress normal page footer      </desc>
-  </doc>
-  <xsl:template name="stdfooter">
-    <xsl:param name="file"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Set licence</desc>
-  </doc>
-  <xsl:template name="generateLicence">
-    <xsl:text>Creative Commons Attribution</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Set language</desc>
-  </doc>
-  <xsl:template name="generateLanguage">
-    <xsl:choose>
-      <xsl:when test="@xml:lang">
-        <xsl:value-of select="@xml:lang"/>
-      </xsl:when>
-      <xsl:when test="tei:text/@xml:lang">
-        <xsl:value-of select="tei:text/@xml:lang"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>en</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Set subject</desc>
-  </doc>
-  <xsl:template name="generateSubject">
-    <xsl:if test="not($subject='')">
-      <dc:subject>
-        <xsl:value-of select="$subject"/>
-      </dc:subject>
-    </xsl:if>
-    <xsl:call-template name="generateSubjectHook"/>
-    <xsl:for-each select="tei:teiHeader/tei:profileDesc/tei:textClass/tei:keywords/tei:term">
-      <dc:subject>
-        <xsl:value-of select="."/>
-      </dc:subject>
-    </xsl:for-each>
-    <xsl:for-each select="tei:teiHeader/tei:profileDesc/tei:textClass/tei:keywords/tei:list/tei:item">
-      <dc:subject>
-        <xsl:value-of select="."/>
-      </dc:subject>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:param name="javascriptFiles" />
+	<xsl:param name="epubMimetype">
+		application/epub+zip
+	</xsl:param>
 
-  <xsl:template name="generateSubjectHook"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Suppress normal page footer      </desc>
+	</doc>
+	<xsl:template name="stdfooter">
+		<xsl:param name="file" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Set licence</desc>
+	</doc>
+	<xsl:template name="generateLicence">
+		<xsl:text>Creative Commons Attribution</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Set language</desc>
+	</doc>
+	<xsl:template name="generateLanguage">
+		<xsl:choose>
+			<xsl:when test="@xml:lang">
+				<xsl:value-of select="@xml:lang" />
+			</xsl:when>
+			<xsl:when test="tei:text/@xml:lang">
+				<xsl:value-of select="tei:text/@xml:lang" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>en</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Set subject</desc>
+	</doc>
+	<xsl:template name="generateSubject">
+		<xsl:if test="not($subject='')">
+			<dc:subject>
+				<xsl:value-of select="$subject" />
+			</dc:subject>
+		</xsl:if>
+		<xsl:call-template name="generateSubjectHook" />
+		<xsl:for-each
+			select="tei:teiHeader/tei:profileDesc/tei:textClass/tei:keywords/tei:term">
+			<dc:subject>
+				<xsl:value-of select="." />
+			</dc:subject>
+		</xsl:for-each>
+		<xsl:for-each
+			select="tei:teiHeader/tei:profileDesc/tei:textClass/tei:keywords/tei:list/tei:item">
+			<dc:subject>
+				<xsl:value-of select="." />
+			</dc:subject>
+		</xsl:for-each>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Set name of publisher</desc>
-  </doc>
-  <xsl:template name="generatePublisher">
-    <xsl:choose>
-      <xsl:when test="not($publisher='')">
-        <xsl:value-of select="$publisher"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="normalize-space(ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt)"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Set unique identifier for output
-      </desc>
-  </doc>
-  <xsl:template name="generateID">
-    <xsl:choose>
-      <xsl:when test="not($uid='')">
-        <xsl:value-of select="$uid"/>
-      </xsl:when>
-      <xsl:when test="tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno">
-        <xsl:value-of select="tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno[1]"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>http://www.example.com/TEIEPUB/</xsl:text>
-        <xsl:value-of select="format-dateTime(current-dateTime(),'[Y][M02][D02][H02][m02][s02]')"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="generateSubjectHook" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Add specific linebreak in verbatim output, as
-      readers do not seem to grok the CSS
-      </desc>
-  </doc>
-  <xsl:template name="verbatim-lineBreak">
-    <xsl:param name="id"/>
-    <br/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Remove unwanted things from CSS
-      </desc>
-  </doc>
-  <xsl:template name="purgeCSS">
-    <xsl:choose>
-      <xsl:when test="contains(.,'line-height:')"/>
-      <xsl:when test="contains(.,'max-width:')"/>
-      <xsl:when test="contains(.,'height:')"/>
-      <!--
-      <xsl:when test="contains(.,'clear:')"/>
-      <xsl:when test="contains(.,'padding')"/>
-      <xsl:when test="contains(.,'float:')"/>
-      <xsl:when test="contains(.,'font-size:')"/>
-      <xsl:when test="contains(.,'width:')"/>
-      <xsl:when test="contains(.,'margin')"/>
-      <xsl:when test="contains(.,'border')"/>
--->
-      <xsl:otherwise>
-        <xsl:value-of select="."/>
-        <xsl:text>&#10;</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="addLangAtt"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Set name of publisher</desc>
+	</doc>
+	<xsl:template name="generatePublisher">
+		<xsl:choose>
+			<xsl:when test="not($publisher='')">
+				<xsl:value-of select="$publisher" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="normalize-space(ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt)" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Set unique identifier for output
+		</desc>
+	</doc>
+	<xsl:template name="generateID">
+		<xsl:choose>
+			<xsl:when test="not($uid='')">
+				<xsl:value-of select="$uid" />
+			</xsl:when>
+			<xsl:when
+				test="tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno">
+				<xsl:value-of
+					select="tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno[1]" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>http://www.example.com/TEIEPUB/</xsl:text>
+				<xsl:value-of
+					select="format-dateTime(current-dateTime(),'[Y][M02][D02][H02][m02][s02]')" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:lb[@rend='space']">
-    <xsl:text> </xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Add specific linebreak in verbatim output, as
+			readers do not seem to grok the CSS
+		</desc>
+	</doc>
+	<xsl:template name="verbatim-lineBreak">
+		<xsl:param name="id" />
+		<br />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Remove unwanted things from CSS
+		</desc>
+	</doc>
+	<xsl:template name="purgeCSS">
+		<xsl:choose>
+			<xsl:when test="contains(.,'line-height:')" />
+			<xsl:when test="contains(.,'max-width:')" />
+			<xsl:when test="contains(.,'height:')" />
+			<!-- <xsl:when test="contains(.,'clear:')"/> <xsl:when test="contains(.,'padding')"/> 
+				<xsl:when test="contains(.,'float:')"/> <xsl:when test="contains(.,'font-size:')"/> 
+				<xsl:when test="contains(.,'width:')"/> <xsl:when test="contains(.,'margin')"/> 
+				<xsl:when test="contains(.,'border')"/> -->
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+				<xsl:text>&#10;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="addLangAtt" />
 
-  <xsl:template match="tei:milestone[@unit='line']">
-    <xsl:text> </xsl:text>
-  </xsl:template>
+	<xsl:template match="tei:lb[@rend='space']">
+		<xsl:text> </xsl:text>
+	</xsl:template>
 
-  <xsl:template match="tei:titleStmt" mode="metadata">
-    <h3>Title statement</h3>
-    <xsl:apply-templates mode="metadata"/>
-  </xsl:template>
-  <xsl:template match="tei:editionStmt" mode="metadata">
-    <h3>Edition statement</h3>
-    <xsl:apply-templates mode="metadata"/>
-  </xsl:template>
-  <xsl:template match="tei:publicationStmt" mode="metadata">
-    <h3>Publication</h3>
-    <xsl:choose>
-      <xsl:when test="tei:p">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-        <dl>
-          <xsl:apply-templates mode="metadata"/>
-        </dl>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:seriesStmt" mode="metadata">
-    <h3>Series</h3>
-    <xsl:apply-templates mode="metadata"/>
-  </xsl:template>
-  <xsl:template match="tei:notesStmt" mode="metadata">
-    <h3>Notes</h3>
-    <xsl:apply-templates mode="metadata"/>
-  </xsl:template>
-  <xsl:template match="tei:sourceDesc" mode="metadata">
-    <h3>Source</h3>
-    <xsl:apply-templates mode="metadata"/>
-  </xsl:template>
+	<xsl:template match="tei:milestone[@unit='line']">
+		<xsl:text> </xsl:text>
+	</xsl:template>
 
-  <xsl:template match="tei:projectDesc" mode="metadata">
-    <h3>Creation</h3>
-    <xsl:apply-templates mode="metadata"/>
-  </xsl:template>
+	<xsl:template match="tei:titleStmt" mode="metadata">
+		<h3>Title statement</h3>
+		<xsl:apply-templates mode="metadata" />
+	</xsl:template>
+	<xsl:template match="tei:editionStmt" mode="metadata">
+		<h3>Edition statement</h3>
+		<xsl:apply-templates mode="metadata" />
+	</xsl:template>
+	<xsl:template match="tei:publicationStmt" mode="metadata">
+		<h3>Publication</h3>
+		<xsl:choose>
+			<xsl:when test="tei:p">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<dl>
+					<xsl:apply-templates mode="metadata" />
+				</dl>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:seriesStmt" mode="metadata">
+		<h3>Series</h3>
+		<xsl:apply-templates mode="metadata" />
+	</xsl:template>
+	<xsl:template match="tei:notesStmt" mode="metadata">
+		<h3>Notes</h3>
+		<xsl:apply-templates mode="metadata" />
+	</xsl:template>
+	<xsl:template match="tei:sourceDesc" mode="metadata">
+		<h3>Source</h3>
+		<xsl:apply-templates mode="metadata" />
+	</xsl:template>
 
-  <xsl:template match="tei:editorialDecl" mode="metadata">
-    <h3>Editorial practices</h3>
-    <xsl:apply-templates mode="metadata"/>
-  </xsl:template>
+	<xsl:template match="tei:projectDesc" mode="metadata">
+		<h3>Creation</h3>
+		<xsl:apply-templates mode="metadata" />
+	</xsl:template>
 
-  <xsl:template match="tei:sourceDesc/tei:bibl" mode="metadata">
-    <p> — <xsl:apply-templates mode="metadata"/></p>
-  </xsl:template>
-  <xsl:template match="tei:sourceDesc/tei:biblFull" mode="metadata">
-    <div> — <xsl:apply-templates/></div>
-  </xsl:template>
-  <xsl:template match="tei:respStmt" mode="metadata">
-    <p><i><xsl:value-of select="tei:resp"/></i>:
-      <xsl:value-of select="tei:name"/></p>
-  </xsl:template>
+	<xsl:template match="tei:editorialDecl" mode="metadata">
+		<h3>Editorial practices</h3>
+		<xsl:apply-templates mode="metadata" />
+	</xsl:template>
 
-  <xsl:template match="tei:list" mode="metadata">
-    <ul>
-      <xsl:apply-templates mode="metadata"/>
-    </ul>
-  </xsl:template>
-  <xsl:template match="tei:item" mode="metadata">
-    <li>
-      <xsl:apply-templates mode="metadata"/>
-    </li>
-  </xsl:template>
-  <xsl:template match="tei:relatedItem[@target]" mode="metadata" priority="10">
-    <a href="{@target}">
-      <xsl:value-of select="@target"/>
-    </a>
-  </xsl:template>
-  <xsl:template match="tei:extent" mode="metadata"/>
-  <xsl:template match="tei:authority" mode="metadata">
-    <dt>Authority</dt>
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-  <xsl:template match="tei:publicationStmt/tei:address" mode="metadata">
-    <dt>Address</dt>
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-  <xsl:template match="tei:publicationStmt/tei:publisher" mode="metadata">
-    <dt>Publisher</dt>
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-  <xsl:template match="tei:publicationStmt/tei:pubPlace" mode="metadata">
-    <dt>Place of publication</dt>
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-  <xsl:template match="tei:distributor" mode="metadata">
-    <dt>Distributor</dt>
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-  <xsl:template match="tei:editor" mode="metadata">
-    <p><i>Editor</i>: 
-    <xsl:apply-templates/></p>
-  </xsl:template>
-  <xsl:template match="tei:funder" mode="metadata">
-    <p><i>Funder</i>: 
-    <xsl:apply-templates/></p>
-  </xsl:template>
-  <xsl:template match="tei:idno" mode="metadata">
-    <dt>ID [<xsl:value-of select="@type|@iso:meta"/>]</dt>
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-  <xsl:template match="tei:availability[not(@n) and preceding-sibling::tei:availability/@n]" mode="metadata"/>
-  <xsl:template match="tei:availability" mode="metadata">
-    <dt>Availability</dt>
-    <dd>
-      <xsl:apply-templates mode="metadata"/>
-    </dd>
-  </xsl:template>
+	<xsl:template match="tei:sourceDesc/tei:bibl"
+		mode="metadata">
+		<p>
+			—
+			<xsl:apply-templates mode="metadata" />
+		</p>
+	</xsl:template>
+	<xsl:template match="tei:sourceDesc/tei:biblFull"
+		mode="metadata">
+		<div>
+			—
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+	<xsl:template match="tei:respStmt" mode="metadata">
+		<p>
+			<i>
+				<xsl:value-of select="tei:resp" />
+			</i>
+			:
+			<xsl:value-of select="tei:name" />
+		</p>
+	</xsl:template>
 
-  <xsl:template match="tei:licence" mode="metadata">
-    <div>
-      <xsl:apply-templates/>
-    </div>
-  </xsl:template>
+	<xsl:template match="tei:list" mode="metadata">
+		<ul>
+			<xsl:apply-templates mode="metadata" />
+		</ul>
+	</xsl:template>
+	<xsl:template match="tei:item" mode="metadata">
+		<li>
+			<xsl:apply-templates mode="metadata" />
+		</li>
+	</xsl:template>
+	<xsl:template match="tei:relatedItem[@target]"
+		mode="metadata" priority="10">
+		<a href="{@target}">
+			<xsl:value-of select="@target" />
+		</a>
+	</xsl:template>
+	<xsl:template match="tei:extent" mode="metadata" />
+	<xsl:template match="tei:authority" mode="metadata">
+		<dt>Authority</dt>
+		<dd>
+			<xsl:apply-templates />
+		</dd>
+	</xsl:template>
+	<xsl:template match="tei:publicationStmt/tei:address"
+		mode="metadata">
+		<dt>Address</dt>
+		<dd>
+			<xsl:apply-templates />
+		</dd>
+	</xsl:template>
+	<xsl:template match="tei:publicationStmt/tei:publisher"
+		mode="metadata">
+		<dt>Publisher</dt>
+		<dd>
+			<xsl:apply-templates />
+		</dd>
+	</xsl:template>
+	<xsl:template match="tei:publicationStmt/tei:pubPlace"
+		mode="metadata">
+		<dt>Place of publication</dt>
+		<dd>
+			<xsl:apply-templates />
+		</dd>
+	</xsl:template>
+	<xsl:template match="tei:distributor" mode="metadata">
+		<dt>Distributor</dt>
+		<dd>
+			<xsl:apply-templates />
+		</dd>
+	</xsl:template>
+	<xsl:template match="tei:editor" mode="metadata">
+		<p>
+			<i>Editor</i>
+			:
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
+	<xsl:template match="tei:funder" mode="metadata">
+		<p>
+			<i>Funder</i>
+			:
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
+	<xsl:template match="tei:idno" mode="metadata">
+		<dt>
+			ID [
+			<xsl:value-of select="@type|@iso:meta" />
+			]
+		</dt>
+		<dd>
+			<xsl:apply-templates />
+		</dd>
+	</xsl:template>
+	<xsl:template
+		match="tei:availability[not(@n) and preceding-sibling::tei:availability/@n]"
+		mode="metadata" />
+	<xsl:template match="tei:availability" mode="metadata">
+		<dt>Availability</dt>
+		<dd>
+			<xsl:apply-templates mode="metadata" />
+		</dd>
+	</xsl:template>
 
-  <xsl:template match="tei:bibl/tei:title" mode="metadata" priority="99">
-    <i>
-      <xsl:apply-templates/>
-    </i>
-  </xsl:template>
-  <xsl:template match="tei:date" mode="metadata">
-    <dt>Date</dt>
-    <dd>
-      <xsl:apply-templates/>
-    </dd>
-  </xsl:template>
-  <xsl:template match="tei:bibl/tei:date" mode="metadata"
+	<xsl:template match="tei:licence" mode="metadata">
+		<div>
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+
+	<xsl:template match="tei:bibl/tei:title" mode="metadata"
 		priority="99">
-    <i>Date</i>:     <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:note" mode="metadata">
-    <xsl:text> [</xsl:text>
-    <xsl:apply-templates/>
-    <xsl:text>] </xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:notesStmt/tei:note" mode="metadata" priority="99">
-    <xsl:choose>
-      <xsl:when test="tei:p">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-        <p>
-          <xsl:apply-templates/>
-        </p>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:listPerson" mode="metadata">
-    <ul>
-      <xsl:apply-templates/>
-    </ul>
-  </xsl:template>
-  <!-- fallbacks -->
-  <xsl:template match="tei:sourceDesc/tei:bibl/*" mode="metadata">
-    <xsl:value-of select="."/>
-  </xsl:template>
-  <xsl:template match="*" mode="metadata">
-    <xsl:choose>
-      <xsl:when test="tei:p">
-	  <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-	<p>
-	  <xsl:apply-templates/>
-	</p>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:seriesStmt/tei:p">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:distributor/tei:name">
-    <xsl:apply-templates/>
-    <br/>
-  </xsl:template>
-  <xsl:template match="tei:distributor/tei:address">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:authority/tei:address">
-    <br/>
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:authority/tei:addrLine">
-    <xsl:apply-templates/>
-    <br/>
-  </xsl:template>
-  <xsl:template match="tei:title[@type='uniform']"/>
-  <xsl:template match="tei:editionStmt/tei:p">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:editor">
-    <xsl:apply-templates/>
-    <xsl:text> (editor)</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:title[@type='main']">
-    <i>
-      <xsl:apply-templates/>
-    </i>
-  </xsl:template>
-  <xsl:template match="tei:title[@type='alternative']">
-    <xsl:apply-templates/>
-    <xsl:text> (alternative title)</xsl:text>
-  </xsl:template>
+		<i>
+			<xsl:apply-templates />
+		</i>
+	</xsl:template>
+	<xsl:template match="tei:date" mode="metadata">
+		<dt>Date</dt>
+		<dd>
+			<xsl:apply-templates />
+		</dd>
+	</xsl:template>
+	<xsl:template match="tei:bibl/tei:date" mode="metadata"
+		priority="99">
+		<i>Date</i>
+		:
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:note" mode="metadata">
+		<xsl:text> [</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>] </xsl:text>
+	</xsl:template>
+	<xsl:template match="tei:notesStmt/tei:note"
+		mode="metadata" priority="99">
+		<xsl:choose>
+			<xsl:when test="tei:p">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<p>
+					<xsl:apply-templates />
+				</p>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:listPerson" mode="metadata">
+		<ul>
+			<xsl:apply-templates />
+		</ul>
+	</xsl:template>
+	<!-- fallbacks -->
+	<xsl:template match="tei:sourceDesc/tei:bibl/*"
+		mode="metadata">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="*" mode="metadata">
+		<xsl:choose>
+			<xsl:when test="tei:p">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<p>
+					<xsl:apply-templates />
+				</p>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:seriesStmt/tei:p">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:distributor/tei:name">
+		<xsl:apply-templates />
+		<br />
+	</xsl:template>
+	<xsl:template match="tei:distributor/tei:address">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:authority/tei:address">
+		<br />
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:authority/tei:addrLine">
+		<xsl:apply-templates />
+		<br />
+	</xsl:template>
+	<xsl:template match="tei:title[@type='uniform']" />
+	<xsl:template match="tei:editionStmt/tei:p">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:editor">
+		<xsl:apply-templates />
+		<xsl:text> (editor)</xsl:text>
+	</xsl:template>
+	<xsl:template match="tei:title[@type='main']">
+		<i>
+			<xsl:apply-templates />
+		</i>
+	</xsl:template>
+	<xsl:template match="tei:title[@type='alternative']">
+		<xsl:apply-templates />
+		<xsl:text> (alternative title)</xsl:text>
+	</xsl:template>
 
-  <xsl:template name="autoMakeHead">
-    <xsl:param name="display"/>
-    <xsl:choose>
-      <xsl:when test="tei:head and $display='full'">
-        <xsl:apply-templates select="tei:head" mode="makeheading"/>
-      </xsl:when>
-      <xsl:when test="tei:head">
-        <xsl:apply-templates select="tei:head" mode="plain"/>
-      </xsl:when>
-      <xsl:when test="tei:front/tei:head">
-        <xsl:apply-templates select="tei:front/tei:head" mode="plain"/>
-      </xsl:when>
-      <xsl:when test="@n">
-        <xsl:value-of select="@n"/>
-      </xsl:when>
-      <xsl:when test="@type">
-	<xsl:text>[</xsl:text>
-        <xsl:value-of select="@type"/>
-	<xsl:text>]</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>&#160;</xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="autoMakeHead">
+		<xsl:param name="display" />
+		<xsl:choose>
+			<xsl:when test="tei:head and $display='full'">
+				<xsl:apply-templates select="tei:head"
+					mode="makeheading" />
+			</xsl:when>
+			<xsl:when test="tei:head">
+				<xsl:apply-templates select="tei:head"
+					mode="plain" />
+			</xsl:when>
+			<xsl:when test="tei:front/tei:head">
+				<xsl:apply-templates select="tei:front/tei:head"
+					mode="plain" />
+			</xsl:when>
+			<xsl:when test="@n">
+				<xsl:value-of select="@n" />
+			</xsl:when>
+			<xsl:when test="@type">
+				<xsl:text>[</xsl:text>
+				<xsl:value-of select="@type" />
+				<xsl:text>]</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				&#160;
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="generateDate">
-    <xsl:choose>
-      <xsl:when test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docDate[@when]">
-        <xsl:apply-templates mode="date" select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docDate/@when"/>
-      </xsl:when>
-      <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when]">
-        <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[1]/@when"/>
-      </xsl:when>
-      <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date[@when]">
-        <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date/@when"/>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <!-- its inserted explicitly -->
-  <xsl:template match="tei:front/tei:titlePage"/>
+	<xsl:template name="generateDate">
+		<xsl:choose>
+			<xsl:when
+				test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docDate[@when]">
+				<xsl:apply-templates mode="date"
+					select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docDate/@when" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when]">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[1]/@when" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date[@when]">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date/@when" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- its inserted explicitly -->
+	<xsl:template match="tei:front/tei:titlePage" />
 
-  <xsl:template match="html:li">
-    <xsl:choose>
-      <xsl:when test="not(html:a)"/>
-      <xsl:when test="starts-with(html:a/@href,'#')"/>
-      <xsl:when test="contains(@class,'headless')"/>
-      <xsl:when test="html:a/@href=preceding-sibling::html:li/html:a/@href"/>
-      <xsl:otherwise>
-        <navPoint xmlns="http://www.daisy.org/z3986/2005/ncx/">
-          <navLabel>
-            <text>
-              <xsl:value-of select="html:span[@class='headingNumber']"/>
-              <xsl:value-of select="normalize-space(html:a[1])"/>
-            </text>
-          </navLabel>
-          <content src="{html:a/@href}"/>
-        </navPoint>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="html:li">
+		<xsl:choose>
+			<xsl:when test="not(html:a)" />
+			<xsl:when test="starts-with(html:a/@href,'#')" />
+			<xsl:when test="contains(@class,'headless')" />
+			<xsl:when
+				test="html:a/@href=preceding-sibling::html:li/html:a/@href" />
+			<xsl:otherwise>
+				<navPoint xmlns="http://www.daisy.org/z3986/2005/ncx/">
+					<navLabel>
+						<text>
+							<xsl:value-of
+								select="html:span[@class='headingNumber']" />
+							<xsl:value-of select="normalize-space(html:a[1])" />
+						</text>
+					</navLabel>
+					<content src="{html:a/@href}" />
+				</navPoint>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="javascriptHook">
-    <xsl:for-each select="tokenize($javascriptFiles,',')">
-      <xsl:variable name="name" select="tokenize(normalize-space(.),'/')[last()]"/>
-      <script type="text/javascript" src="{$name}">
-        <xsl:comment>JS library</xsl:comment>
-      </script>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="javascriptHook">
+		<xsl:for-each select="tokenize($javascriptFiles,',')">
+			<xsl:variable name="name"
+				select="tokenize(normalize-space(.),'/')[last()]" />
+			<script type="text/javascript" src="{$name}">
+				<xsl:comment>
+					JS library
+				</xsl:comment>
+			</script>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="epubSpineHook"/>
-  <xsl:template name="epubManifestHook"/>
-  <xsl:template name="processTEIHook"/>
+	<xsl:template name="epubSpineHook" />
+	<xsl:template name="epubManifestHook" />
+	<xsl:template name="processTEIHook" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[epub] Override addition of CSS links. We force a simple
-      name of "stylesheet.css"
-      </desc>
-  </doc>
-  <xsl:template name="includeCSS">
-    <xsl:call-template name="linkCSS">
-      <xsl:with-param name="file">stylesheet.css</xsl:with-param>
-    </xsl:call-template>
-    <xsl:if test="not($cssPrintFile='')">
-      <xsl:call-template name="linkCSS">
-	<xsl:with-param name="file">print.css</xsl:with-param>
-	<xsl:with-param name="media">print</xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-    <xsl:call-template name="generateLocalCSS"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[epub] Override addition of CSS links. We force a simple
+			name of "stylesheet.css"
+		</desc>
+	</doc>
+	<xsl:template name="includeCSS">
+		<xsl:call-template name="linkCSS">
+			<xsl:with-param name="file">
+				stylesheet.css
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:if test="not($cssPrintFile='')">
+			<xsl:call-template name="linkCSS">
+				<xsl:with-param name="file">
+					print.css
+				</xsl:with-param>
+				<xsl:with-param name="media">
+					print
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:call-template name="generateLocalCSS" />
+	</xsl:template>
 
-  <xsl:template name="linkCSS">
-    <xsl:param name="file"/>
-    <xsl:param name="media"/>
-    <link xmlns="http://www.w3.org/1999/xhtml" href="{$file}"
-	  rel="stylesheet" type="text/css">
-      <xsl:if test="not($media='')">
-	<xsl:attribute name="media" select="$media"/>
-      </xsl:if>
-    </link>
-  </xsl:template>
+	<xsl:template name="linkCSS">
+		<xsl:param name="file" />
+		<xsl:param name="media" />
+		<link xmlns="http://www.w3.org/1999/xhtml" href="{$file}"
+			rel="stylesheet" type="text/css">
+			<xsl:if test="not($media='')">
+				<xsl:attribute name="media" select="$media" />
+			</xsl:if>
+		</link>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/xsd/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/xsd/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/xsd/build-to.xml	(revision 2397)
@@ -1,72 +1,65 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitoxsd">
-    <!--
-        This library is free software; you can redistribute it and/or
-        modify it under the terms of the GNU Lesser General Public
-        License as published by the Free Software Foundation; either
-        version 2.1 of the License, or (at your option) any later version.
-        
-        This library is distributed in the hope that it will be useful,
-        but WITHOUT ANY WARRANTY; without even the implied warranty of
-        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-        Lesser General Public License for more details.
-        
-        You should have received a copy of the GNU Lesser General Public
-        License along with this library; if not, write to the Free Software
-        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-        
-        Id: $Id: build-to.xml 9316 2011-09-13 08:06:05Z rahtz $
-        Copyright: 2011, TEI Consortium<
-    -->
-    <!--
-        Convert TEI documents into XSD schemas.
-    -->
-    <!-- Path to TEI XML file. -->
-    <property name="inputFile" value=""/>
-    <!-- Path where the output schema file will be saved. -->
-    <property name="outputFile" value=""/>
-    <!-- which profile -->
-    <property name="profile" value="default"/>
-    <!-- where does oxygen keep stuff -->
-    <property name="oxygenlib" value=""/>
-    <dirname property="inputFileDir" file="${inputFile}"/>
-    <dirname property="outputDir" file="${outputFile}"/>
-    <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-    <!-- The input file for the TRANG transformation. -->
-    <property name="trangInputFile" value="${outputFile}.rng"/>
-    
-    <path id="classpath">
-        <pathelement path="${java.class.path}"/>
-    </path>
-    
-    <!-- Use the Relax NG target to obtain a Relax NG schema and afterward transform it
-    to XSD using TRANG. -->
-    <target name="trangConvert">
-        <!-- Obtain a Relax NG schema.  -->
-        <ant antfile="../relaxng/build-to.xml" dir="../relaxng"/>
-        <!-- The Relax NG was generated inside the output file. -->
-        <copy file="${outputFile}" tofile="${trangInputFile}"/>
-        
-        <echo level="info">TRANG generate XSD from RELAXNG files</echo>
-        <java classname="com.thaiopensource.relaxng.translate.Driver" fork="no">
-            <classpath>
-                <path refid="classpath"/>
-                <pathelement location="${oxygenlib}/trang.jar"/>
-            </classpath>
-            <!-- Even though the output type is inferred from the output file extension,
-                 make sure it's the right one. -->
-            <arg value="-O"/>
-            <arg value="xsd"/>
-            <arg value="${trangInputFile}" />
-            <arg value="${outputFile}" />
-        </java>
-    </target>
-    
-    <target name="cleanup" unless="debug">
-        <!-- Delete the intermediate Relax NG schema. -->
-        <delete file="${trangInputFile}"/>
-    </target>
-    
-    <target name="dist" depends="trangConvert, cleanup"/>
-    
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9316 2011-09-13 08:06:05Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into XSD schemas. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output schema file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<!-- The input file for the TRANG transformation. -->
+	<property name="trangInputFile" value="${outputFile}.rng" />
+
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+
+	<!-- Use the Relax NG target to obtain a Relax NG schema and afterward transform 
+		it to XSD using TRANG. -->
+	<target name="trangConvert">
+		<!-- Obtain a Relax NG schema. -->
+		<ant antfile="../relaxng/build-to.xml" dir="../relaxng" />
+		<!-- The Relax NG was generated inside the output file. -->
+		<copy file="${outputFile}" tofile="${trangInputFile}" />
+
+		<echo level="info">TRANG generate XSD from RELAXNG files</echo>
+		<java classname="com.thaiopensource.relaxng.translate.Driver"
+			fork="no">
+			<classpath>
+				<path refid="classpath" />
+				<pathelement location="${oxygenlib}/trang.jar" />
+			</classpath>
+			<!-- Even though the output type is inferred from the output file extension, 
+				make sure it's the right one. -->
+			<arg value="-O" />
+			<arg value="xsd" />
+			<arg value="${trangInputFile}" />
+			<arg value="${outputFile}" />
+		</java>
+	</target>
+
+	<target name="cleanup" unless="debug">
+		<!-- Delete the intermediate Relax NG schema. -->
+		<delete file="${trangInputFile}" />
+	</target>
+
+	<target name="dist" depends="trangConvert, cleanup" />
+
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/relaxng/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/relaxng/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/relaxng/build-to.xml	(revision 2397)
@@ -1,91 +1,89 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitohtml">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9886 2011-12-04 22:50:41Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into HTML files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output schema file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="odd2relax"
-	    value="../profiles/${profile}/relaxng/to.xsl"/>
-  <property name="odd2oddxsl" value="../odds2/odd2odd.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
-  <target name="odd">
-    <echo>Do ODD processing</echo>
-    <xslt force="yes" style="${odd2oddxsl}" in="${inputFile}" out="${outputTempDir}/tmp1.xml" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="lang" expression="${lang}" if="lang"/>
-      <param name="defaultSource" expression="${defaultSource}" if="defaultSource"/>
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
-  <target name="dist" depends="setup,odd,convert,cleanup"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9886 2011-12-04 22:50:41Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into HTML files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output schema file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="odd2relax"
+		value="../profiles/${profile}/relaxng/to.xsl" />
+	<property name="odd2oddxsl" value="../odds2/odd2odd.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
+	<target name="odd">
+		<echo>Do ODD processing</echo>
+		<xslt force="yes" style="${odd2oddxsl}" in="${inputFile}"
+			out="${outputTempDir}/tmp1.xml" classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="lang" expression="${lang}" if="lang" />
+			<param name="defaultSource" expression="${defaultSource}"
+				if="defaultSource" />
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
+	<target name="dist" depends="setup,odd,convert,cleanup" />
 
-  <target name="convert">
-    <!-- Recreate temporary output directory -->
-    <!-- The transformation for HTML output. -->
-    <echo level="info">XSLT generate RELAXNG files</echo>
-    <xslt force="yes" style="${odd2relax}" in="${outputTempDir}/tmp1.xml" out="${outputFile}" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
+	<target name="convert">
+		<!-- Recreate temporary output directory -->
+		<!-- The transformation for HTML output. -->
+		<echo level="info">XSLT generate RELAXNG files</echo>
+		<xslt force="yes" style="${odd2relax}"
+			in="${outputTempDir}/tmp1.xml" out="${outputFile}"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tei-print.css
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tei-print.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tei-print.css	(revision 2397)
@@ -17,62 +17,58 @@
 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 */
-
 @import url(tei.css);
 
 /* elements */
 
-  /* Use Helvetica by preference for most body text. Style hyperlinks with 
+/* Use Helvetica by preference for most body text. Style hyperlinks with 
      color only. Use white-space:pre-wrap or equivalent for code blocks
      so text doesn't get cut off. */
-
 a {
-   text-decoration: none;
+	text-decoration: none;
 }
 
 a:visited {
-   color:inherit;
+	color: inherit;
 }
 
-body { 
-   font-family: Helvetica, Arial, sans-serif;
-   font-size: 10pt;
+body {
+	font-family: Helvetica, Arial, sans-serif;
+	font-size: 10pt;
 }
 
 div.pre, div.pre_eg, pre.eg {
-   font-family: courier, "Courier New", fixed, monospace;
-   font-size: 9pt;
-   /* see http://cheeaun.phoenity.com/weblog/2005/06/whitespace-and-generated-content.html
+	font-family: courier, "Courier New", fixed, monospace;
+	font-size: 9pt;
+	/* see http://cheeaun.phoenity.com/weblog/2005/06/whitespace-and-generated-content.html
       for explanation of the white-space property cascade. pre-wrap is needed so long
       lines won't be cut off in print. When browser support for CSS 2.1 is solid, proprietary
       properties may be removed. */
-   white-space: pre; /* CSS2 */
-   white-space: -moz-pre-wrap; /* Mozilla */
-   white-space: -o-pre-wrap; /* Opera 7 */
-   white-space: pre-wrap; /* CSS 2.1 */
-   white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
-   word-wrap: break-word; /* IE */
-   }
+	white-space: pre; /* CSS2 */
+	white-space: -moz-pre-wrap; /* Mozilla */
+	white-space: -o-pre-wrap; /* Opera 7 */
+	white-space: pre-wrap; /* CSS 2.1 */
+	white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
+	word-wrap: break-word; /* IE */
+}
 
 div.pre_eg, pre.eg {
-   page-break-inside:avoid;
+	page-break-inside: avoid;
 }
 
-
 td {
-   font-size: 10pt;
+	font-size: 10pt;
 }
 
 td.maintext, td.maintext p {
-   font-family: Helvetica, Arial, sans-serif;
+	font-family: Helvetica, Arial, sans-serif;
 }
-   
-/* classes */
 
+/* classes */
 .plain {
-   font-family: Helvetica, Arial, sans-serif;
+	font-family: Helvetica, Arial, sans-serif;
 }
 
 div.pagebreak {
-    page-break-before: always;
+	page-break-before: always;
 }
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tite/tite-acdc.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tite/tite-acdc.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tite/tite-acdc.xsl	(revision 2397)
@@ -1,81 +1,78 @@
-<xsl:stylesheet
- xmlns="http://www.tei-c.org/ns/1.0"
- xmlns:tei="http://www.tei-c.org/ns/1.0"
- xmlns:tite="http://www.tei-c.org/ns/tite/1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
- exclude-result-prefixes="xsl tei"    
- version="1.0">
+<xsl:stylesheet xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:tite="http://www.tei-c.org/ns/tite/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="xsl tei" version="1.0">
 
-<xsl:template name="b">
-  <hi rend="bold">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="b">
+		<hi rend="bold">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="i">
-  <hi rend="italic">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="i">
+		<hi rend="italic">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="ul">
-  <hi rend="underline">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="ul">
+		<hi rend="underline">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="sup">
-  <hi rend="sup">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="sup">
+		<hi rend="sup">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="sub">
-  <hi rend="sub">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="sub">
+		<hi rend="sub">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="smcap">
-  <hi rend="smcap">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="smcap">
+		<hi rend="smcap">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="ornament">
-  <figure place="inline">
-    <xsl:apply-templates 
-	select="@*"/>
-    <xsl:choose>
-      <xsl:when test="*">
-	<xsl:apply-templates 
-	    select="*|comment()|processing-instruction"/>  
-      </xsl:when>
-      <xsl:when test="string-length(.)&gt;0">
-	<p>
-	<xsl:apply-templates 
-	    select="text()|comment()|processing-instruction"/>  
-	</p>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:apply-templates 
-	    select="comment()|processing-instruction"/>  
-      </xsl:otherwise>
-    </xsl:choose>
-  </figure>
-</xsl:template>
+	<xsl:template name="ornament">
+		<figure place="inline">
+			<xsl:apply-templates select="@*" />
+			<xsl:choose>
+				<xsl:when test="*">
+					<xsl:apply-templates
+						select="*|comment()|processing-instruction" />
+				</xsl:when>
+				<xsl:when test="string-length(.)&gt;0">
+					<p>
+						<xsl:apply-templates
+							select="text()|comment()|processing-instruction" />
+					</p>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates
+						select="comment()|processing-instruction" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</figure>
+	</xsl:template>
 
-<xsl:template name="cols">
-  <milestone unit="cols">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </milestone>
-</xsl:template>
+	<xsl:template name="cols">
+		<milestone unit="cols">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</milestone>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tite/tite-to-tei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tite/tite-to-tei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tite/tite-to-tei.xsl	(revision 2397)
@@ -1,147 +1,153 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-                xmlns="http://www.tei-c.org/ns/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-		exclude-result-prefixes="tei"
-		version="2.0"
-		xpath-default-namespace="http://www.tei-c.org/ns/tite/1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="tei"
+	version="2.0"
+	xpath-default-namespace="http://www.tei-c.org/ns/tite/1.0">
 
-   <xsl:output cdata-section-elements="eg"/>
+	<xsl:output cdata-section-elements="eg" />
 
-<xsl:template match="tei:text">
-  <TEI>
-    <teiHeader>
-    <fileDesc>
-      <titleStmt>
-        <title>[converted from Tite]</title>
-      </titleStmt>
-      <publicationStmt>
-        <p>unknown</p>
-      </publicationStmt>
-      <sourceDesc>
-        <p>converted from Tite on 
-	<date><xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')"/></date></p>
-      </sourceDesc>
-    </fileDesc>
-      
-    </teiHeader>
-    <text>
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-    </text>
-  </TEI>
-</xsl:template>
+	<xsl:template match="tei:text">
+		<TEI>
+			<teiHeader>
+				<fileDesc>
+					<titleStmt>
+						<title>[converted from Tite]</title>
+					</titleStmt>
+					<publicationStmt>
+						<p>unknown</p>
+					</publicationStmt>
+					<sourceDesc>
+						<p>
+							converted from Tite on
+							<date>
+								<xsl:value-of
+									select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')" />
+							</date>
+						</p>
+					</sourceDesc>
+				</fileDesc>
 
-<xsl:template
-    match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6|tei:div7">
-  <div>
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </div>
-</xsl:template>
+			</teiHeader>
+			<text>
+				<xsl:apply-templates
+					select="@*|*|text()|comment()|processing-instruction" />
+			</text>
+		</TEI>
+	</xsl:template>
 
-<xsl:template name="b">
-  <hi rend="bold">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template
+		match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6|tei:div7">
+		<div>
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</div>
+	</xsl:template>
 
-<xsl:template name="i">
-  <hi rend="italic">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="b">
+		<hi rend="bold">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="ul">
-  <hi rend="underline">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="i">
+		<hi rend="italic">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="sup">
-  <hi rend="sup">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="ul">
+		<hi rend="underline">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="sub">
-  <hi rend="sub">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="sup">
+		<hi rend="sup">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="smcap">
-  <hi rend="smcap">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </hi>
-</xsl:template>
+	<xsl:template name="sub">
+		<hi rend="sub">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="ornament">
-  <figure place="inline">
-    <xsl:apply-templates 
-	select="@*"/>
-    <xsl:choose>
-      <xsl:when test="*">
-	<xsl:apply-templates 
-	    select="*|comment()|processing-instruction"/>  
-      </xsl:when>
-      <xsl:when test="string-length(.)&gt;0">
-	<p>
-	<xsl:apply-templates 
-	    select="text()|comment()|processing-instruction"/>  
-	</p>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:apply-templates 
-	    select="comment()|processing-instruction"/>  
-      </xsl:otherwise>
-    </xsl:choose>
-  </figure>
-</xsl:template>
+	<xsl:template name="smcap">
+		<hi rend="smcap">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</hi>
+	</xsl:template>
 
-<xsl:template name="cols">
-  <milestone unit="cols">
-    <xsl:apply-templates 
-	select="@*|*|text()|comment()|processing-instruction"/>  
-  </milestone>
-</xsl:template>
+	<xsl:template name="ornament">
+		<figure place="inline">
+			<xsl:apply-templates select="@*" />
+			<xsl:choose>
+				<xsl:when test="*">
+					<xsl:apply-templates
+						select="*|comment()|processing-instruction" />
+				</xsl:when>
+				<xsl:when test="string-length(.)&gt;0">
+					<p>
+						<xsl:apply-templates
+							select="text()|comment()|processing-instruction" />
+					</p>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates
+						select="comment()|processing-instruction" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</figure>
+	</xsl:template>
 
-   <xsl:template match="*">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-   </xsl:template>
-   <xsl:template match="text()|comment()|@*|processing-instruction()">
-      <xsl:copy/>
-   </xsl:template>
-   <xsl:template match="b">
-      <xsl:call-template name="b"/>
-   </xsl:template>
-   <xsl:template match="i">
-      <xsl:call-template name="i"/>
-   </xsl:template>
-   <xsl:template match="ul">
-      <xsl:call-template name="ul"/>
-   </xsl:template>
-   <xsl:template match="sub">
-      <xsl:call-template name="sub"/>
-   </xsl:template>
-   <xsl:template match="sup">
-      <xsl:call-template name="sup"/>
-   </xsl:template>
-   <xsl:template match="smcap">
-      <xsl:call-template name="smcap"/>
-   </xsl:template>
-   <xsl:template match="cols">
-      <xsl:call-template name="cols"/>
-   </xsl:template>
-   <xsl:template match="ornament">
-      <xsl:call-template name="ornament"/>
-   </xsl:template>
+	<xsl:template name="cols">
+		<milestone unit="cols">
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction" />
+		</milestone>
+	</xsl:template>
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template
+		match="text()|comment()|@*|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
+	<xsl:template match="b">
+		<xsl:call-template name="b" />
+	</xsl:template>
+	<xsl:template match="i">
+		<xsl:call-template name="i" />
+	</xsl:template>
+	<xsl:template match="ul">
+		<xsl:call-template name="ul" />
+	</xsl:template>
+	<xsl:template match="sub">
+		<xsl:call-template name="sub" />
+	</xsl:template>
+	<xsl:template match="sup">
+		<xsl:call-template name="sup" />
+	</xsl:template>
+	<xsl:template match="smcap">
+		<xsl:call-template name="smcap" />
+	</xsl:template>
+	<xsl:template match="cols">
+		<xsl:call-template name="cols" />
+	</xsl:template>
+	<xsl:template match="ornament">
+		<xsl:call-template name="ornament" />
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tei.css
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tei.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tei.css	(revision 2397)
@@ -18,1277 +18,1427 @@
 
 */
 
-
 /* main layout */
-
 body.simple {
-   color: #000000;
-   background-color: #FFFFFF;
-   margin: 10pt;
+	color: #000000;
+	background-color: #FFFFFF;
+	margin: 10pt;
 }
 
-body{
-   color: #000000;
-   background-color: #FFFFFF;
-   margin: 10pt;
-   padding:0;
-   font-family: Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
+body {
+	color: #000000;
+	background-color: #FFFFFF;
+	margin: 10pt;
+	padding: 0;
+	font-family: Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
 }
 
 body.pagetable {
-   color: #000000;
-   background-color: #FFFFFF;
+	color: #000000;
+	background-color: #FFFFFF;
 }
 
-/* 3 columns allowed for, or just a right and left */  
-#col1{
-   width: 20%;
-   background: #FFFFFF;
-   margin: 0;
-   margin-top: 10px;
-   color: #000066;
-   padding: 5px;
-   position : absolute;
-   float: left;
-   border-style: solid;
-   border-width: 1px;
-   border-color: red;
+/* 3 columns allowed for, or just a right and left */
+#col1 {
+	width: 20%;
+	background: #FFFFFF;
+	margin: 0;
+	margin-top: 10px;
+	color: #000066;
+	padding: 5px;
+	position: absolute;
+	float: left;
+	border-style: solid;
+	border-width: 1px;
+	border-color: red;
 }
 
-#col2{
-   background: #FFFFFF;
-   color: #333333;
-   border-style: solid;
-   border-width: 1px;
-   border-color: #000000;
-   margin: 0;
-   margin-top: 10px;
-   padding: 5px ;
-   left: 22%;
-   width: 51%;
-   position : absolute;
+#col2 {
+	background: #FFFFFF;
+	color: #333333;
+	border-style: solid;
+	border-width: 1px;
+	border-color: #000000;
+	margin: 0;
+	margin-top: 10px;
+	padding: 5px;
+	left: 22%;
+	width: 51%;
+	position: absolute;
 }
 
-#col3{
-   width: 24%;
-   left: 75%;
-   color: #000066;
-   background: #FFFFFF;
-   border-style: solid;
-   border-width: 1px;
-   border-color: red;
-   margin: 0;
-   margin-top: 10px;
-   padding: 5px;
-   position : absolute;
-   float: right;
+#col3 {
+	width: 24%;
+	left: 75%;
+	color: #000066;
+	background: #FFFFFF;
+	border-style: solid;
+	border-width: 1px;
+	border-color: red;
+	margin: 0;
+	margin-top: 10px;
+	padding: 5px;
+	position: absolute;
+	float: right;
 }
 
-#lh-col{
-   width: 16%;
-   color: #000000;
-   margin-top: 2pt;
-   margin-right: 10pt;
-   padding: 5px;
-   background-color: #FFFFFF;
-   float: left;
-   font-weight:normal;
+#lh-col {
+	width: 16%;
+	color: #000000;
+	margin-top: 2pt;
+	margin-right: 10pt;
+	padding: 5px;
+	background-color: #FFFFFF;
+	float: left;
+	font-weight: normal;
 }
 
-#rh-col{
-   background-color: #FFFFFF;
-   color: #333333;
-   margin: 2pt;
-   padding: 5px ;
-   float: right;
-   width: 75%;
-   font-weight:normal;
+#rh-col {
+	background-color: #FFFFFF;
+	color: #333333;
+	margin: 2pt;
+	padding: 5px;
+	float: right;
+	width: 75%;
+	font-weight: normal;
 }
 
-
 /* now the layers of the header */
 
 /* the main title */
 div.stdheader {
-      border-bottom: 1pt solid black;
+	border-bottom: 1pt solid black;
 }
 
-#hdr{
-   width: auto;
-   margin: 0;
-   background-repeat : no-repeat;
-   overflow : inherit;
+#hdr {
+	width: auto;
+	margin: 0;
+	background-repeat: no-repeat;
+	overflow: inherit;
 }
 
 /* a navigation bar */
-#hdr2{
-   width: auto;
-   color: #000000;
-   font-family: Arial,Helvetica,sans-serif;
-   font-weight: bold;
-   background-color : #99CCFF;
-   padding-left : 5px;
-   padding-bottom : 2px;
-   padding-top : 2px;
-   padding-right : 5px;
+#hdr2 {
+	width: auto;
+	color: #000000;
+	font-family: Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	background-color: #99CCFF;
+	padding-left: 5px;
+	padding-bottom: 2px;
+	padding-top: 2px;
+	padding-right: 5px;
 }
 
 /* a breadcrumb trail */
-#hdr3{
-   width: auto;
-   color: #000000;
-   background-color : #AD06BC;
-   padding-left : 5px;
-   padding-bottom : 2px;
-   padding-top : 2px;
-   padding-right : 5px;
-   font-family: Arial,Helvetica,sans-serif;
-   font-weight : bold;
-   font-size: smaller;
+#hdr3 {
+	width: auto;
+	color: #000000;
+	background-color: #AD06BC;
+	padding-left: 5px;
+	padding-bottom: 2px;
+	padding-top: 2px;
+	padding-right: 5px;
+	font-family: Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	font-size: smaller;
 }
 
 .bannerright {
-   position : absolute;
-   right : 5px;
-   color: #FFFFFF;
-   font-family : Arial, Helvetica, sans-serif;
-   font-size : 0.8.0em;
-   font-weight : bold;
-   text-decoration: none;
+	position: absolute;
+	right: 5px;
+	color: #FFFFFF;
+	font-family: Arial, Helvetica, sans-serif;
+	font-size: 0.8 .0em;
+	font-weight: bold;
+	text-decoration: none;
 }
 
 /* section headings */
-#hdr h1 { color: red; }
+#hdr h1 {
+	color: red;
+}
+
 h1 {
-   font-weight: bold;
-   font-size: 2em;
-   line-height: 34pt;
+	font-weight: bold;
+	font-size: 2em;
+	line-height: 34pt;
 }
 
 h2 {
-   font-size: larger;
-   line-height: 20pt;
-   margin-top: 18pt;
-   font-weight: bold;
+	font-size: larger;
+	line-height: 20pt;
+	margin-top: 18pt;
+	font-weight: bold;
 }
 
 h3 {
-   font-size: larger;
-   line-height: 18pt;
-   font-weight: bold;
-   font-style: italic;
+	font-size: larger;
+	line-height: 18pt;
+	font-weight: bold;
+	font-style: italic;
 }
 
-
 h1.maintitle {
-   margin-left: 100px;
-   font-family: Arial,Helvetica,sans-serif;
-   font-weight: bold;
-   bottom: 5px;
+	margin-left: 100px;
+	font-family: Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	bottom: 5px;
 }
 
 h1.title {
-   margin-left: 100px;
-   font-family: Arial,Helvetica,sans-serif;
-   font-weight: bold;
-   bottom: 5px;
+	margin-left: 100px;
+	font-family: Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	bottom: 5px;
 }
 
 h2.institution {
-   margin-left: 100px;
-   font-family: Arial,Helvetica,sans-serif;
+	margin-left: 100px;
+	font-family: Arial, Helvetica, sans-serif;
 }
 
 h2.department {
-   margin-left: 100px;
-   font-family: Arial,Helvetica,sans-serif;
+	margin-left: 100px;
+	font-family: Arial, Helvetica, sans-serif;
 }
 
 h2.subtitle {
-   margin-left: 100px;
-   font-family: Arial,Helvetica,sans-serif;
-   font-weight: bold;
+	margin-left: 100px;
+	font-family: Arial, Helvetica, sans-serif;
+	font-weight: bold;
 }
 
 .footer {
-   text-align : center;
-   font-family: Arial,Helvetica,sans-serif; 
-   font-size : 0.8.0em;
+	text-align: center;
+	font-family: Arial, Helvetica, sans-serif;
+	font-size: 0.8 .0em;
 }
 
-
-
 /* components of the breadcrumb trail */
-a.breadcrumb{
-   color: #FFFFFF;
-   text-decoration: none;
-   padding-right : 5px;
-   font-family: Arial,Helvetica,sans-serif;
-   font-weight : bold;
-   font-size : 0.8.0em;
+a.breadcrumb {
+	color: #FFFFFF;
+	text-decoration: none;
+	padding-right: 5px;
+	font-family: Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	font-size: 0.8 .0em;
 }
 
-ul.breadcrumb
-{
-   display: inline;
-   font-size: 1.1em;
+ul.breadcrumb {
+	display: inline;
+	font-size: 1.1em;
 }
 
-li.breadcrumb
-{
-   padding-left: 12px;
-   padding-right: 5px;
-   display: inline;
-   color: #000000;
-   background: url(/images/rightarrow.gif);
-   background-repeat: no-repeat;
-   background-position: left;
+li.breadcrumb {
+	padding-left: 12px;
+	padding-right: 5px;
+	display: inline;
+	color: #000000;
+	background: url(/images/rightarrow.gif);
+	background-repeat: no-repeat;
+	background-position: left;
 }
-li.breadcrumb-first
-{
-   padding-left: 12px;
-   padding-right: 5px;
-   display: inline;
-   color: #000000;
-   background: url(/images/rightarrow.gif);
-   background-repeat: no-repeat;
-   background-position: left;
+
+li.breadcrumb-first {
+	padding-left: 12px;
+	padding-right: 5px;
+	display: inline;
+	color: #000000;
+	background: url(/images/rightarrow.gif);
+	background-repeat: no-repeat;
+	background-position: left;
 }
 
 div.breadcrumb {
-   display: inline;
+	display: inline;
 }
 
-.skiplinks{
-   font-family: arial, sans-serif;
-   color: #FFFFFF;
-   font-weight : bold;
-   font-size : 0.8.0em;
-   text-decoration: none;
-   padding-right : 15px;
+.skiplinks {
+	font-family: arial, sans-serif;
+	color: #FFFFFF;
+	font-weight: bold;
+	font-size: 0.8 .0em;
+	text-decoration: none;
+	padding-right: 15px;
 }
 
-.tocontent{
-   color : #000066;
-   display : none;
+.tocontent {
+	color: #000066;
+	display: none;
 }
 
-.hide{
-   display : none;
+.hide {
+	display: none;
 }
 
 .framestdlink {
-   color: red;
-   font-size: smaller;
-   font-weight: bold;
+	color: red;
+	font-size: smaller;
+	font-weight: bold;
 }
 
-a:hover
-{
-   text-decoration: underline;
+a:hover {
+	text-decoration: underline;
 }
 
-a.navbar:link
-{
-   color: #FFFFFF;
-   text-decoration: none;
+a.navbar:link {
+	color: #FFFFFF;
+	text-decoration: none;
 }
 
-a.navbar:visited
-{
-   color: #FFFFFF;
-   text-decoration: none;
+a.navbar:visited {
+	color: #FFFFFF;
+	text-decoration: none;
 }
 
 a.navbar:hover {
-   color: #FFFFFF;
-   text-decoration: underline;
+	color: #FFFFFF;
+	text-decoration: underline;
 }
 
-
 /* for use when making pages using a table */
 td.hdr2 {
-   color: #000000;
-   background-color : #99CCFF;
+	color: #000000;
+	background-color: #99CCFF;
 }
+
 td.hdr3 {
-   background-color : #AD06BC;
-   border: 1pt solid #000000;
+	background-color: #AD06BC;
+	border: 1pt solid #000000;
 }
 
 td.sidetext {
-   border-right: 1pt solid #000000;
+	border-right: 1pt solid #000000;
 }
+
 td.maintext p {
-   font-family: Arial,Helvetica,sans-serif;
+	font-family: Arial, Helvetica, sans-serif;
 }
 
 td.maintext {
-   background-color: #FFFFFF;
-   font-family: Arial,Helvetica,sans-serif;
-   color: #000000;
-   padding-left: 6pt;
-   padding-right: 6pt;
+	background-color: #FFFFFF;
+	font-family: Arial, Helvetica, sans-serif;
+	color: #000000;
+	padding-left: 6pt;
+	padding-right: 6pt;
 }
 
-table.wovenodd td,p.wovenodd {
-   background-color: #FFFFFF;
+table.wovenodd td, p.wovenodd {
+	background-color: #FFFFFF;
 }
 
 /* an inner <text>, eg inside a <q> */
 div.innertext {
-   margin: 6pt;
-   border: 1pt solid red;
+	margin: 6pt;
+	border: 1pt solid red;
 }
 /* literal code */
-
 div.cdata {
-    white-space: pre;
-    clear:both;
+	white-space: pre;
+	clear: both;
 }
 
-pre,div.pre,div.pre_eg,pre.eg,div.eg {
-    clear:both;
-    margin-top: 1em;
-    margin-bottom:1em;
-    border-top-width: 4px;
-    border-bottom-width: 4px;
-    border-left-width: 2px;
-    border-right-width: 2px;
-    border-style: solid;
-    padding-top: 10px;
-    padding-right: 10px;
-    padding-bottom: 10px;
-    padding-left: 10px;
-    color: #000000;
-    line-height: 1.1em;
-    font-family: monospace;
-    font-size: 10pt;
-    white-space: pre;
+pre, div.pre, div.pre_eg, pre.eg, div.eg {
+	clear: both;
+	margin-top: 1em;
+	margin-bottom: 1em;
+	border-top-width: 4px;
+	border-bottom-width: 4px;
+	border-left-width: 2px;
+	border-right-width: 2px;
+	border-style: solid;
+	padding-top: 10px;
+	padding-right: 10px;
+	padding-bottom: 10px;
+	padding-left: 10px;
+	color: #000000;
+	line-height: 1.1em;
+	font-family: monospace;
+	font-size: 10pt;
+	white-space: pre;
 }
 
 div.egXML_valid {
-    background-color: #f7f9f6;
-    border-color: #c5d8bb;
-    }
+	background-color: #f7f9f6;
+	border-color: #c5d8bb;
+}
+
 div.egXML_feasible {
-    background-color: #fff9f3;
-    border-color: #ffe1ad;
-    }
+	background-color: #fff9f3;
+	border-color: #ffe1ad;
+}
+
 div.egXML_invalid {
-    border-color: #ffe7e8 ;
-    background-color:  #fdbbac;
-    }
+	border-color: #ffe7e8;
+	background-color: #fdbbac;
+}
 
-
 /* table of contents */
-ul.toc {list-style: none;}
-li.toc {list-style: none;}
+ul.toc {
+	list-style: none;
+}
 
+li.toc {
+	list-style: none;
+}
+
 /* table of contents links */
-
-a.inlinetoc:link,a.inlinetoc:visited
-{
-   color: #7A7A7A;
-   font-size: smaller; 
-   text-decoration: none;
+a.inlinetoc:link, a.inlinetoc:visited {
+	color: #7A7A7A;
+	font-size: smaller;
+	text-decoration: none;
 }
 
-a.inlinetoc-this:visited,a.inlinetoc-this:link
-{   
-   font-size: smaller; 
-   color: #000000;
-   font-weight: bold; 
-   text-decoration: underline;
+a.inlinetoc-this:visited, a.inlinetoc-this:link {
+	font-size: smaller;
+	color: #000000;
+	font-weight: bold;
+	text-decoration: underline;
 }
 
-a.inlinetoc-sub:visited,a.inlinetoc-sub:link
-{
-   text-decoration: none;
-   color: #000000;
-   font-weight: normal;
-   font-size: smaller; 
+a.inlinetoc-sub:visited, a.inlinetoc-sub:link {
+	text-decoration: none;
+	color: #000000;
+	font-weight: normal;
+	font-size: smaller;
 }
 
-span.toclist{
-   font-size: smaller; 
-   font-family: Arial,Helvetica,sans-serif;
-   font-weight: bold;
+span.toclist {
+	font-size: smaller;
+	font-family: Arial, Helvetica, sans-serif;
+	font-weight: bold;
 }
 
 p.toclist0 {
-   margin-left: 0.5em; 
-   margin-top: 1pt; 
-   margin-bottom: 3pt; 
-   text-indent: -0.5em;
-   font-size: small;    
+	margin-left: 0.5em;
+	margin-top: 1pt;
+	margin-bottom: 3pt;
+	text-indent: -0.5em;
+	font-size: small;
 }
 
 p.toclist1 {
-   margin-left: 1em; 
-   margin-top: 1pt; 
-   margin-bottom: 2pt; 
-   text-indent: -0.7em;
-   font-size: small;    
+	margin-left: 1em;
+	margin-top: 1pt;
+	margin-bottom: 2pt;
+	text-indent: -0.7em;
+	font-size: small;
 }
 
 p.toclist2 {
-   margin-left: 1.5em; 
-   text-indent: -1em;
-   font-size: small;    
+	margin-left: 1.5em;
+	text-indent: -1em;
+	font-size: small;
 }
 
 p.toclist3 {
-   margin-left: 2em; 
-   text-indent: -1.5em;
-   font-size: small;    
+	margin-left: 2em;
+	text-indent: -1.5em;
+	font-size: small;
 }
 
 span.toclist-this {
-   color: red;
+	color: red;
 }
 
-a.toclist:visited,a.toclist:link
-{
-   font-weight: bold; 
-   color: #000000;
-   text-decoration: none;
+a.toclist:visited, a.toclist:link {
+	font-weight: bold;
+	color: #000000;
+	text-decoration: none;
 }
 
-
-
 /* notes */
 div.noteHeading {
-   margin-top: 9pt;
-   border: 0;
-   border-top: 1pt;
-   border-style: solid;
-   padding-top: 6pt;
-   font-size: larger;
-   font-weight: bold;
+	margin-top: 9pt;
+	border: 0;
+	border-top: 1pt;
+	border-style: solid;
+	padding-top: 6pt;
+	font-size: larger;
+	font-weight: bold;
 }
+
 div.noteBody {
-  display:inline;
+	display: inline;
 }
 
 div.note {
-   margin-left: 1em; 
-   margin-bottom: 4pt; 
-   text-indent: -1em;
+	margin-left: 1em;
+	margin-bottom: 4pt;
+	text-indent: -1em;
 }
 
 span.noteLabel {
-    font-style: italic;
+	font-style: italic;
 }
+
 span.noteNumber:before {
-    content: "[";
+	content: "[";
 }
+
 span.noteNumber:after {
-    content: "]. ";
+	content: "]. ";
 }
 
 span.note {
-    font-size: smaller;
+	font-size: smaller;
 }
 /* images */
 img.display {
-   margin-top: 10pt;
-   margin-bottom: 10pt;
-   display: block;
+	margin-top: 10pt;
+	margin-bottom: 10pt;
+	display: block;
 }
+
 .caption {
-   font-style: italic;
+	font-style: italic;
 }
+
 span.caption {
-   display: block;
+	display: block;
 }
 
 .floatimage {
-   float : left;
-   margin-right : 6px;
-   vertical-align : top;
+	float: left;
+	margin-right: 6px;
+	vertical-align: top;
 }
 /* specialized divs */
 div.letter {
-   margin-left: 2em;
-   margin-right: 2em;
-   margin-top: 6pt;
-   margin-bottom: 6pt;
-   border-top: 1pt solid green;
-   border-bottom: 1pt solid green;
+	margin-left: 2em;
+	margin-right: 2em;
+	margin-top: 6pt;
+	margin-bottom: 6pt;
+	border-top: 1pt solid green;
+	border-bottom: 1pt solid green;
 }
 /* title page */
-div.titlePage,div.titlepage {
-   border-top: 2pt solid #000000;
-   border-bottom: 2pt solid #000000;
-   padding-top: 6pt;
-   padding-bottom: 6pt;
-   font-size: larger;
-   text-align: center;
+div.titlePage, div.titlepage {
+	border-top: 2pt solid #000000;
+	border-bottom: 2pt solid #000000;
+	padding-top: 6pt;
+	padding-bottom: 6pt;
+	font-size: larger;
+	text-align: center;
 }
+
 .docImprint {
-    display: block;
-   font-style: italic;    
+	display: block;
+	font-style: italic;
 }
+
 .docDate {
-   font-style: italic;    
+	font-style: italic;
 }
+
 .docTitle {
-    display: block;
-    margin-top: 6pt;
-    font-weight: bold;
-    margin-bottom: 18pt;
+	display: block;
+	margin-top: 6pt;
+	font-weight: bold;
+	margin-bottom: 18pt;
 }
+
 .docAuthor {
-    font-style: italic;
+	font-style: italic;
 }
 
 .byline {
-    display: block;
-}   
+	display: block;
+}
 
-div.dateline{
-   text-align: right;
+div.dateline {
+	text-align: right;
 }
 /* verse */
 div.lg {
-   margin-left: 10px;
-   margin-bottom: 10px;
+	margin-left: 10px;
+	margin-bottom: 10px;
 }
 
 div.signed {
-    text-align:left;
+	text-align: left;
 }
+
 div.l {
-    text-align:left;
-    margin-left: 1em;
+	text-align: left;
+	margin-left: 1em;
 }
+
 div.epigraph {
-    margin: 20pt;
+	margin: 20pt;
 }
+
 div.numbering {
-    float:left; 
-    font-size:smaller; 
-    width: 2em;
+	float: left;
+	font-size: smaller;
+	width: 2em;
 }
 
-div.linenumber { }
+div.linenumber {
+	
+}
 
 div.indent1 {
-   margin-left: 1em;
+	margin-left: 1em;
 }
+
 div.indent2 {
-   margin-left: 2em;
+	margin-left: 2em;
 }
+
 div.indent3 {
-   margin-left: 3em;
+	margin-left: 3em;
 }
+
 div.indent4 {
-   margin-left: 4em;
+	margin-left: 4em;
 }
+
 div.indent5 {
-   margin-left: 5em;
+	margin-left: 5em;
 }
+
 div.indent6 {
-   margin-left: 6em;
+	margin-left: 6em;
 }
 
 /* general purpose block aligns */
 .centerbold {
-    text-align:center;
-    font-weight: bold;
+	text-align: center;
+	font-weight: bold;
 }
+
 .center {
-    text-align:center;
+	text-align: center;
 }
+
 .right {
-    text-align:right;
+	text-align: right;
 }
+
 .left {
-    text-align:left;
+	text-align: left;
 }
 
 /* misc inline*/
-
 span.foreign {
-    font-style: italic;
+	font-style: italic;
 }
 
 .plain {
-   text-decoration: none;
+	text-decoration: none;
 }
 
 p.box {
-   border: 1pt solid #000000;
+	border: 1pt solid #000000;
 }
 
 .small {
-   font-size: small;
+	font-size: small;
 }
 
 td.label {
-   font-weight: bold;
-   background-color: #AAAAAA;
+	font-weight: bold;
+	background-color: #AAAAAA;
 }
+
 tr.label td {
-   font-weight: bold;
-   background-color: #AAAAAA;
+	font-weight: bold;
+	background-color: #AAAAAA;
 }
 
 span.label {
-    font-weight: bold;
+	font-weight: bold;
 }
 
-h5 {    
-   font-size: 100%;
+h5 {
+	font-size: 100%;
 }
-h6 {    
-   font-size: 100%;
+
+h6 {
+	font-size: 100%;
 }
 
 div.tocFront {
-   border-bottom: 1pt solid #000000;
+	border-bottom: 1pt solid #000000;
 }
+
 div.tocBack {
-   border-bottom: 1pt solid #000000;
+	border-bottom: 1pt solid #000000;
 }
+
 div.tocBody {
-   border-bottom: 1pt solid #000000;
+	border-bottom: 1pt solid #000000;
 }
 /* a listBibl rend='labels' */
 div.listBibl {
-	     margin-top: 6pt;
-	     margin-bottom: 6pt;
+	margin-top: 6pt;
+	margin-bottom: 6pt;
 }
+
 div.bibl {
-   margin-left: 0.5em; 
-   text-indent: -0.5em;
+	margin-left: 0.5em;
+	text-indent: -0.5em;
 }
+
 div.biblfree {
-   font-size: smaller; 
-   font-style:italic;
-   margin-left: 0.5em; 
-   text-indent: -0.5em;
-   margin-bottom: 6pt;
+	font-size: smaller;
+	font-style: italic;
+	margin-left: 0.5em;
+	text-indent: -0.5em;
+	margin-bottom: 6pt;
 }
 
 span.biblLabel {
-    font-weight: bold;
-    margin-right: 1em;
+	font-weight: bold;
+	margin-right: 1em;
 }
 
 /* a <bibl> inside a <cit> */
 div.citbibl:before {
-    content: "(";
+	content: "(";
 }
+
 div.citbibl:after {
-    content: ")";
+	content: ")";
 }
+
 div.citbibl {
-   text-align:right;
-   font-size: smaller;
+	text-align: right;
+	font-size: smaller;
 }
 /* a <quote> inside a <cit> */
 div.citquote {
-   margin-left: 10pt;
-   margin-right: 10pt;
+	margin-left: 10pt;
+	margin-right: 10pt;
 }
 
 /* gloss lists with bold labels */
 dt {
-   font-weight: bold;
+	font-weight: bold;
 }
+
 div.blockquote {
-   margin: 10pt;
+	margin: 10pt;
 }
 
 /* generic <hi> */
 span.hi {
-   font-weight: bold;
+	font-weight: bold;
 }
 
 /* from drama */
 /* speeches in drama */
 div.p-in-sp {
-    margin-left: 1em;
-    }
+	margin-left: 1em;
+}
+
 div.sp {
-    margin-top: 4pt;
+	margin-top: 4pt;
 }
+
 div.spProse {
-    text-indent: -1em;
-    margin-left: 1em;
+	text-indent: -1em;
+	margin-left: 1em;
 }
+
 div.speaker {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.speaker {
-    font-style: italic;
+	font-style: italic;
 }
 
-span.actor {  
-	   font-style:italic;
+span.actor {
+	font-style: italic;
 }
+
 span.camera {
- font-style: italic;
+	font-style: italic;
 }
+
 span.caption {
- font-style: italic;
+	font-style: italic;
 }
+
 span.role {
- font-style: italic;
+	font-style: italic;
 }
+
 span.set {
- font-style: italic;
+	font-style: italic;
 }
+
 span.sound {
- font-style: italic;
+	font-style: italic;
 }
+
 span.stage {
- font-style: italic;
+	font-style: italic;
 }
+
 span.tech {
- font-style: italic;
+	font-style: italic;
 }
+
 span.view {
- font-style: italic;
+	font-style: italic;
 }
+
 span.mentioned {
-   font-style: italic;
+	font-style: italic;
 }
+
 span.nextLink {
-   font-style: italic;
+	font-style: italic;
 }
+
 span.previousLink {
-   font-style: italic;
+	font-style: italic;
 }
+
 span.upLink {
-   font-style: italic;
+	font-style: italic;
 }
+
 p, div.p {
- margin-top: 0.3em;
+	margin-top: 0.3em;
 }
 /* bibl */
 span.titlem {
-    font-style: italic;
+	font-style: italic;
 }
+
 span.titlej {
-    font-style: italic;
+	font-style: italic;
 }
+
 span.titleu {
+	
 }
+
 span.titles {
+	
 }
 
-span.margnote,div.margnote {
-             display: block;
-	     font-size: smaller;
-	     clear: right;
-	     padding: 4pt;
-	     font-style: italic;
-	     width: 10%;
-	     float:right; 
-	     border: solid green 1pt; 
-	     margin: 6pt;
+span.margnote, div.margnote {
+	display: block;
+	font-size: smaller;
+	clear: right;
+	padding: 4pt;
+	font-style: italic;
+	width: 10%;
+	float: right;
+	border: solid green 1pt;
+	margin: 6pt;
 }
 
 div.floatingText_back {
-    border-top: solid black 1pt;
+	border-top: solid black 1pt;
 }
+
 div.floatingText_front {
-    border-top: solid black 1pt;
+	border-top: solid black 1pt;
 }
+
 div.floatingText {
-    margin: 6pt;
-    border: solid black 1pt;
+	margin: 6pt;
+	border: solid black 1pt;
 }
-div.pagebreak,span.pagebreak {
-    display: block;
-    color: grey;
-    float: right;
+
+div.pagebreak, span.pagebreak {
+	display: block;
+	color: grey;
+	float: right;
 }
+
 span.element {
-    font-weight: bold;
-    color: black;
+	font-weight: bold;
+	color: black;
 }
+
 span.unclear {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.wordtypeNN, span.wordtypeNNS {
-    color: green;
-    }
-span.wordtypeVVD,span.wordtypeVVN,span.wordtypeVVN,span.wordtypeVVZ,span.wordtypeVVG, span.wordtypeVV {
-    color: red;
-    }
+	color: green;
+}
 
+span.wordtypeVVD, span.wordtypeVVN, span.wordtypeVVN, span.wordtypeVVZ,
+	span.wordtypeVVG, span.wordtypeVV {
+	color: red;
+}
+
 li.headless {
-    display: none;
+	display: none;
 }
+
 span.hi {
-    font-weight: bold;
+	font-weight: bold;
 }
 
 div.footer {
-    border-top: solid black 1pt;
+	border-top: solid black 1pt;
 }
 
 div.stdfooter {
-    border-top: solid black 1pt;
-    border-bottom: solid black 1pt;
+	border-top: solid black 1pt;
+	border-bottom: solid black 1pt;
 }
 
 div.altfigure {
-    border-top: solid black 1pt;
-    border-bottom: solid black 1pt;
+	border-top: solid black 1pt;
+	border-bottom: solid black 1pt;
 }
 
 table.table, table.table tr, table.table td {
-    border: solid black 1pt;
+	border: solid black 1pt;
 }
+
 table.table td {
-    padding: 1ex 1ex 1ex 1ex;
+	padding: 1ex 1ex 1ex 1ex;
 }
+
 p.mainAuthor {
-    display: block;
-    margin: 1ex 0ex 1ex 0ex;
+	display: block;
+	margin: 1ex 0ex 1ex 0ex;
 }
+
 p.mainEditor {
-    display: block;
-    margin: 1ex 0ex 1ex 0ex;
+	display: block;
+	margin: 1ex 0ex 1ex 0ex;
 }
 
 /* ODD-specific styles */
 /* tables for reference display */
 table.wovenodd {
-    width: 100%;
-    clear: both;
+	width: 100%;
+	clear: both;
 }
+
 td.wovenodd-col1 {
-    width:15%;
-    vertical-align: top;
+	width: 15%;
+	vertical-align: top;
 }
+
 td.wovenodd-col2 {
-    width:85%;
+	width: 85%;
 }
+
 table.wovenodd tr td {
-    border: 1px solid #555;
-    padding:1%;
+	border: 1px solid #555;
+	padding: 1%;
 }
+
 table.wovenodd {
-    border-spacing:0px;
-    border-collapse:collapse;
+	border-spacing: 0px;
+	border-collapse: collapse;
 }
+
 table.wovenodd tr td {
-    border-spacing:0px;
+	border-spacing: 0px;
 }
+
 table.wovenodd tr {
-    border-spacing:0px;
-    border-collapse:collapse;
+	border-spacing: 0px;
+	border-collapse: collapse;
 }
+
 table.wovenodd tr td table.attList {
-    border-spacing:0px;
-    border:none;
+	border-spacing: 0px;
+	border: none;
 }
+
 table.wovenodd tr td table.attList tr {
-    border-spacing:0px;
-    border:none;
+	border-spacing: 0px;
+	border: none;
 }
+
 table.wovenodd tr td table.attList tr td {
-    border-spacing:0px;
-    border:none;
+	border-spacing: 0px;
+	border: none;
 }
+
 table.attList {
-    table-layout: fixed;
-    width: 100%;
-    margin: 0pt;
-    padding: 0pt;
+	table-layout: fixed;
+	width: 100%;
+	margin: 0pt;
+	padding: 0pt;
 }
+
 td.odd_label {
-    vertical-align: top;
-    width: 10%;
-    font-weight: bold;
+	vertical-align: top;
+	width: 10%;
+	font-weight: bold;
 }
+
 td.odd_value {
-    vertical-align: top;
-    width: 90%;
+	vertical-align: top;
+	width: 90%;
 }
+
 table.attDef {
-    table-layout: fixed;
-    width: 100%;
+	table-layout: fixed;
+	width: 100%;
 }
+
 table.attDef td.odd_label {
-    width: 10%;
-    vertical-align: top;
-    font-weight: normal;
+	width: 10%;
+	vertical-align: top;
+	font-weight: normal;
 }
+
 table.attDef td.odd_value {
-    vertical-align: top;
-    width: 90%;
+	vertical-align: top;
+	width: 90%;
 }
+
 table.attList  td.odd_label:before {
-    content: "@";
+	content: "@";
 }
+
 table.attDef  td.odd_label:before {
-    content: "";
+	content: "";
 }
+
 table.valList  td.odd_label:before {
-    content: "";
+	content: "";
 }
+
 table.valList {
-    table-layout: fixed;
-    width: 100%;
+	table-layout: fixed;
+	width: 100%;
 }
+
 table.valList td.odd_label {
-    width: 10%;
-    vertical-align: top;
-    font-style: normal;
-    font-weight: normal;
+	width: 10%;
+	vertical-align: top;
+	font-style: normal;
+	font-weight: normal;
 }
+
 table.valList td.odd_value {
-    vertical-align: top;
-    width: 90%;
+	vertical-align: top;
+	width: 90%;
 }
+
 table.specDesc td.Attribute {
-    font-weight: bold;
-    vertical-align: top;
+	font-weight: bold;
+	vertical-align: top;
 }
+
 table.specDesc {
-    margin-left: 1em;
+	margin-left: 1em;
 }
+
 td p {
-    margin-top: 0pt;
-    margin-bottom: 2pt;
+	margin-top: 0pt;
+	margin-bottom: 2pt;
 }
 
 div.cdata {
-    white-space: pre;
-    clear:both;
+	white-space: pre;
+	clear: both;
 }
 
 span.tag:before {
-     
+	
 }
+
 span.tag:after {
-     
+	
 }
-span.gi,span.tag {
+
+span.gi, span.tag {
+	
 }
+
 span.att {
-     
+	
 }
+
 span.att:before {
-    content: "@";
+	content: "@";
 }
-span.ident, 
-span.ident-class, span.ident-datatype, span.ident-frag,
-span.ident-ge,    span.ident-macro,    span.ident-module,
-span.ident-pe,    span.ident-rng,      span.ident-schema  {
-    font-weight: bold;
+
+span.ident, span.ident-class, span.ident-datatype, span.ident-frag, span.ident-ge,
+	span.ident-macro, span.ident-module, span.ident-pe, span.ident-rng,
+	span.ident-schema {
+	font-weight: bold;
 }
 
 span.ident-file, span.ident-ns {
-    font-style: italic;
+	font-style: italic;
 }
 
 button.displayRelaxButton {
-    margin-right: 2px;
-    margin-top: 2px;
-    font-size: 70%;
-    float: right;
-    cursor: pointer;
+	margin-right: 2px;
+	margin-top: 2px;
+	font-size: 70%;
+	float: right;
+	cursor: pointer;
 }
+
 pre.RNG_XML {
-	    display: none;
-	    }
+	display: none;
+}
 
 span.RNG_XML {
-	    display: none;
-	    }
+	display: none;
+}
 
 /* pretty printing of XML */
 td.classSpec, td.macroSpec {
-    font-weight: bold;
+	font-weight: bold;
 }
-a.link_odd_element:link,a.link_odd_element:visited {		   
-    /*     color: #006400; */
+
+a.link_odd_element:link, a.link_odd_element:visited {
+	/*     color: #006400; */
+	
 }
-a.link_odd_macro:link,a.link_odd_macro:visited {
 
+a.link_odd_macro:link, a.link_odd_macro:visited {
+	
 }
-a.link_odd_class:link,a.link_odd_class:visited {
 
+a.link_odd_class:link, a.link_odd_class:visited {
+	
 }
+
 span.element {
-    font-weight: bold;
-    color: black;
+	font-weight: bold;
+	color: black;
 }
-td.elementSpec,span.elementname {
-    font-weight: bold;
-    color: #222288;
+
+td.elementSpec, span.elementname {
+	font-weight: bold;
+	color: #222288;
 }
+
 span.highlightelementname {
-    color: red;
+	color: red;
 }
 
 span.attribute {
-    color: #222288;
+	color: #222288;
 }
+
 span.attributevalue {
-    color: black;
+	color: black;
 }
+
 span.comment {
-    color: black;
-    font-style:italic;
+	color: black;
+	font-style: italic;
 }
+
 span.namespace {
-    color: #222288;
+	color: #222288;
 }
 /* pretty print rnc */
 span.rnc_nc {
-    color: #006400;
+	color: #006400;
 }
+
 span.rnc_decl {
-    color: green;
+	color: green;
 }
+
 span.rnc_prefix {
-    color: blue;
+	color: blue;
 }
+
 span.rnc_param {
-    color: gray;
+	color: gray;
 }
+
 span.rnc_atom {
-    color: yellow;
+	color: yellow;
 }
+
 span.rnc_annot {
-    color: #FF8040;
+	color: #FF8040;
 }
+
 span.rnc_comment {
-    color: #FF00FF;
+	color: #FF00FF;
 }
+
 span.rnc_annot {
-    color: #00FFFF;
+	color: #00FFFF;
 }
+
 span.rnc_type {
-    color: purple;
+	color: purple;
 }
+
 span.rnc_keyword {
-    color: teal;
+	color: teal;
 }
+
 span.defaultVal {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.required {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 div.moduleSpec {
-    padding: 1px;
-    margin: 1px;
-    background-color: #C0C0C0;
-    color:inherit;
-    clear:right;
+	padding: 1px;
+	margin: 1px;
+	background-color: #C0C0C0;
+	color: inherit;
+	clear: right;
 }
+
 span.moduleSpecHead {
-    font-style: italic;
+	font-style: italic;
 }
+
 ul.specList li {
-    list-style: none;
+	list-style: none;
 }
+
 span.specList-macroSpec {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.specList-elementSpec {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.specList-elementSpec:before {
-    content: "<";
-     
+	content: "<";
 }
+
 span.specList-elementSpec:after {
-    content: ">";
-     
+	content: ">";
 }
+
 span.specList-classSpec {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.specName {
-    color: #223377;
-    font-weight: bold;
+	color: #223377;
+	font-weight: bold;
 }
 /* A -Z Styles From http://www.smileycat.com/miaow/archives/000211.php -styling the a to z */
 #azindex {
-    background-color: #ddd;
-    color:inherit;
-    display: block;
-    margin: 0px;
-    float: left;
-    padding: 5px;
-    width: 75%;
-    border: 1px solid #999;
+	background-color: #ddd;
+	color: inherit;
+	display: block;
+	margin: 0px;
+	float: left;
+	padding: 5px;
+	width: 75%;
+	border: 1px solid #999;
 }
+
 #azindex p {
-    color: #fff;
-    background-color: #000060;
-    padding: 4px;
-    display: block;
-    margin: 0;
-    border-bottom: 1px solid #333;
-    font-size: 0.95em;
+	color: #fff;
+	background-color: #000060;
+	padding: 4px;
+	display: block;
+	margin: 0;
+	border-bottom: 1px solid #333;
+	font-size: 0.95em;
 }
+
 .index {
-    font: bold 100% Verdana, Helvetica, sans-serif;
-    margin: 0;
-    padding: 0;
+	font: bold 100% Verdana, Helvetica, sans-serif;
+	margin: 0;
+	padding: 0;
 }
+
 .index li {
-    float: left;
-    height: 1.5em;
-    list-style-type: none;
-    margin: 0.35em 0.15em;
-    padding: 0;
-    width: 1.5em;
+	float: left;
+	height: 1.5em;
+	list-style-type: none;
+	margin: 0.35em 0.15em;
+	padding: 0;
+	width: 1.5em;
 }
+
 .index a:link, .index a:visited {
-    background: #fff;
-    color: navy;
-    display: block;
-    height: 1.5em;
-    padding: 0.37em 0 0 0;
-    text-align: center;
-    text-decoration: none;
-    width: 1.5em;
-    border: 1px solid #999;
+	background: #fff;
+	color: navy;
+	display: block;
+	height: 1.5em;
+	padding: 0.37em 0 0 0;
+	text-align: center;
+	text-decoration: none;
+	width: 1.5em;
+	border: 1px solid #999;
 }
-li.showall, li.showall a:visited,li.showall a:link {
-    width: 10em;
+
+li.showall, li.showall a:visited, li.showall a:link {
+	width: 10em;
 }
+
 * html .index li {
-    margin: 0.2em 0.2em;
+	margin: 0.2em 0.2em;
 }
+
 ul.index li a:hover {
-    background-color: #93D1E4;
-    color: #fff;
-    text-decoration: underline;
+	background-color: #93D1E4;
+	color: #fff;
+	text-decoration: underline;
 }
+
 div.atozwrapper {
-   float: left;
-   width: 70%;
+	float: left;
+	width: 70%;
 }
-div.atoz {    
-   clear: left;
-   float: left;
-}    
+
+div.atoz {
+	clear: left;
+	float: left;
+}
+
 #byMod {
-   margin-top: 12px;
-   clear: left;
+	margin-top: 12px;
+	clear: left;
 }
+
 ul.atoz {
-    list-style: none;
-    text-align:left;
-    margin: 2px;
-    padding: 2px;
-    background-color: #eef;
-    color:inherit;
+	list-style: none;
+	text-align: left;
+	margin: 2px;
+	padding: 2px;
+	background-color: #eef;
+	color: inherit;
 }
+
 .atoz li {
-    padding: 0px;
-    display: inline;
+	padding: 0px;
+	display: inline;
 }
+
 span.listhead {
-    margin-top: 0em;
-    margin-right: 1em;
-    padding-left: 3px;
-    padding-right: 3px;
-    color: #000066;
-    font-weight: bold;
-    font-size: large;
+	margin-top: 0em;
+	margin-right: 1em;
+	padding-left: 3px;
+	padding-right: 3px;
+	color: #000066;
+	font-weight: bold;
+	font-size: large;
 }
 /* End of A - Z styles */
 div.specChildren {
-    margin: 0em;
-    padding: 0em;
+	margin: 0em;
+	padding: 0em;
 }
+
 span.specChildModule {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 div.specChild {
-    margin-bottom: 4pt;
-    margin-left: 25px;
-    text-indent: -30px;
+	margin-bottom: 4pt;
+	margin-left: 25px;
+	text-indent: -30px;
 }
+
 span.emptySlash:after {
-    content: "/";
+	content: "/";
 }
 /* status notation */
 .status_deprecated:after {
-    content: " (deprecated)";
-    color: red;
+	content: " (deprecated)";
+	color: red;
 }
+
 .status_changed:after {
-    content: " (changed)";
-    color: blue;
+	content: " (changed)";
+	color: blue;
 }
+
 .status_unstable:after {
-    content: " (unstable)";
-    color: orange;
+	content: " (unstable)";
+	color: orange;
 }
+
 .status_deprecated {
-    border: solid red 1pt;
+	border: solid red 1pt;
 }
+
 .status_changed {
-    border: solid blue 1pt;
+	border: solid blue 1pt;
 }
+
 .status_unstable {
-    border: solid orange 1pt;
+	border: solid orange 1pt;
 }
 /* <hi> rend values */
-span.typewriter{
-    font-family: monospace;
+span.typewriter {
+	font-family: monospace;
 }
-span.normalweight{
+
+span.normalweight {
+	
 }
-span.smallcaps{
-    font-variant: small-caps;
+
+span.smallcaps {
+	font-variant: small-caps;
 }
-span.bold{
-    font-weight: bold;
+
+span.bold {
+	font-weight: bold;
 }
-span.italic{
-    font-style:italic;
+
+span.italic {
+	font-style: italic;
 }
-span.capsall{
-    text-transform: uppercase;
+
+span.capsall {
+	text-transform: uppercase;
 }
-span.strikethrough{
-    text-decoration: line-through;
+
+span.strikethrough {
+	text-decoration: line-through;
 }
-span.strikedoublethrough{
-    text-decoration: line-through;
+
+span.strikedoublethrough {
+	text-decoration: line-through;
 }
-span.underline{
-    text-decoration: underline;
+
+span.underline {
+	text-decoration: underline;
 }
-span.underwavyline{
-    text-decoration-line: underline;
-    text-decoration-style: wavy;
+
+span.underwavyline {
+	text-decoration-line: underline;
+	text-decoration-style: wavy;
 }
-span.underdoubleline{
-    text-decoration: underline;
+
+span.underdoubleline {
+	text-decoration: underline;
 }
+
 span.superscript {
-    vertical-align: top;
-    font-size: 70%;
+	vertical-align: top;
+	font-size: 70%;
 }
+
 span.subscript {
-    vertical-align: bottom;
-    font-size: 70%;
+	vertical-align: bottom;
+	font-size: 70%;
 }
+
 span.numberParagraph:before {
-    content:"[";
+	content: "[";
 }
+
 span.numberParagraph:after {
-    content:"] ";
+	content: "] ";
 }
+
 span.numberParagraph {
-    font-size: smaller;
-    color: grey;
-}
+	font-size: smaller;
+	color: grey;
+}
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/msdescription.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/msdescription.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/msdescription.xsl	(revision 2397)
@@ -1,465 +1,552 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="tei" version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet dealing with elements from the msdescription module. </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the msdescription
+				module. </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: msdescription.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: msdescription.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:template name="msSection">
-    <xsl:param name="heading"/>
-    <xsl:param name="level"/>
-    <xsl:param name="implicitBlock"/>
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template name="msBlock">
-    <xsl:param name="style"/>
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template name="msInline">
-    <xsl:param name="before"/>
-    <xsl:param name="after"/>
-    <xsl:param name="style"/>
-    <xsl:value-of select="$before"/>
-    <xsl:apply-templates/>
-    <xsl:value-of select="$after"/>
-  </xsl:template>
-  <xsl:template name="msLabelled">
-    <xsl:param name="before"/>
-    <xsl:value-of select="$before"/>
-    <xsl:text>: </xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template name="msLiteral">
-    <xsl:param name="text"/>
-    <xsl:value-of select="$text"/>
-  </xsl:template>
-  <!-- headings -->
-  <xsl:template match="tei:accMat">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Accompanying material</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:additional">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Additional</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:bindingDesc">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Binding</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:msContents">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">1</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Contents</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:msDesc/tei:head">
-    <xsl:call-template name="msBlock">
-      <xsl:with-param name="style">msHead</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:history">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">1</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>History</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:provenance">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Provenance</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:acquisition">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Acquisition</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:origin">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Origin</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:msIdentifier">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">1</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Identification</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:layoutDesc">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">3</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Layout</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:decoDesc">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">3</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Decoration</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:msWriting">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Writing</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:musicNotation">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Music notation</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:objectDesc">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Object</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:physDesc">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">1</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Physical description</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:seal">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">4</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Seal</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:sealDesc">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">3</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Seal description</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:supportDesc">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">3</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Support description</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:support">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">4</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Support</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:collation">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">4</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Collation</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:extent">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">4</xsl:with-param>
-      <xsl:with-param name="implicitBlock">true</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Extent</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:incipit">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Incipit</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:explicit">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Explicit</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:msItem/tei:listBibl">
-    <xsl:call-template name="msSection">
-      <xsl:with-param name="level">2</xsl:with-param>
-      <xsl:with-param name="heading">
-        <xsl:text>Text editions</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <!-- inline -->
-  <xsl:template match="tei:abbr">
-    <xsl:choose>
-      <xsl:when test="parent::tei:choice">
-	</xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="msInline"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:orig">
-    <xsl:choose>
-      <xsl:when test="parent::tei:choice">
-	</xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="msInline"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:textLang">
-    <xsl:choose>
-      <xsl:when test="preceding-sibling::tei:summary"/>
-      <xsl:when test="preceding-sibling::tei:*">
-        <xsl:call-template name="msLiteral">
-          <xsl:with-param name="text">
-            <xsl:text>, </xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-    </xsl:choose>
-    <xsl:call-template name="msLabelled">
-      <xsl:with-param name="before">Language of text</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:summary">
-    <xsl:choose>
-      <xsl:when test="preceding-sibling::tei:*">
-        <xsl:call-template name="msLiteral">
-          <xsl:with-param name="text">
-            <xsl:text>, </xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-    </xsl:choose>
-    <xsl:call-template name="msLabelled">
-      <xsl:with-param name="before">Summary</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:rubric">
-    <xsl:if test="preceding-sibling::tei:*">
-      <xsl:call-template name="msLiteral">
-        <xsl:with-param name="text">
-          <xsl:text> </xsl:text>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-    <xsl:call-template name="msInline"/>
-  </xsl:template>
-  <xsl:template match="tei:msItem/tei:author">
-    <xsl:if test="preceding-sibling::tei:*">
-      <xsl:call-template name="msLiteral">
-        <xsl:with-param name="text">
-          <xsl:text> </xsl:text>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-    <xsl:call-template name="msInline"/>
-  </xsl:template>
-  <xsl:template match="tei:msItem/tei:title">
-    <xsl:if test="preceding-sibling::tei:*">
-      <xsl:call-template name="msLiteral">
-        <xsl:with-param name="text">
-          <xsl:text> </xsl:text>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-    <xsl:call-template name="msInline">
-      <xsl:with-param name="style">italic</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:expan/tei:ex">
-    <xsl:call-template name="msInline">
-      <xsl:with-param name="before">(</xsl:with-param>
-      <xsl:with-param name="after">)</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:locus">
-    <xsl:call-template name="msInline">
-      <xsl:with-param name="style">bold</xsl:with-param>
-      <xsl:with-param name="before"/>
-      <xsl:with-param name="after">: </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:supplied[@reason='damage']">
-    <xsl:call-template name="msInline">
-      <xsl:with-param name="before">&lt;</xsl:with-param>
-      <xsl:with-param name="after">&gt;</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:supplied[@reason='illegible']">
-    <xsl:call-template name="msInline">
-      <xsl:with-param name="before">[</xsl:with-param>
-      <xsl:with-param name="after">]</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:supplied[@reason='omitted']">
-    <xsl:call-template name="msInline">
-      <xsl:with-param name="before">⟨</xsl:with-param>
-      <xsl:with-param name="after">⟩</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:gap" priority="10">
-    <xsl:call-template name="msInline">
-      <xsl:with-param name="before">[...]</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:unclear" priority="10">
-    <xsl:call-template name="msInline">
-      <xsl:with-param name="after">[?]</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:placeName|tei:genName|tei:geogName|tei:roleName|tei:name|tei:persName">
-    <xsl:choose>
-      <xsl:when test="*">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="msInline"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:dimensions">
-    <xsl:for-each select="*">
-      <xsl:apply-templates select="."/>
-      <xsl:call-template name="msLiteral">
-        <xsl:with-param name="text">
-          <xsl:choose>
-            <xsl:when test="string-length(.)=0 and @extent">
-              <xsl:value-of select="@extent"/>
-            </xsl:when>
-            <xsl:when test="@unit">
-              <xsl:value-of select="@unit"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:text>mm</xsl:text>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:if test="following-sibling::*">
-            <xsl:text> x </xsl:text>
-          </xsl:if>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="tei:origDate">
-    <xsl:apply-imports/>
-    <xsl:if test="following-sibling::tei:origPlace">
-      <xsl:call-template name="msLiteral">
-        <xsl:with-param name="text">
-          <xsl:text>, </xsl:text>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:msIdentifier/tei:*">
-    <xsl:apply-imports/>
-    <xsl:if test="following-sibling::tei:*/text()">
-      <xsl:call-template name="msLiteral">
-        <xsl:with-param name="text">
-          <xsl:text>, </xsl:text>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:template>
-  <!--
-    <handNote scribe="AM_544_4to_1"
-    script="carolingian-insular minuscule"
-    medium="ink" scope="sole"> 
--->
-  <xsl:template match="tei:handNote">
-    <xsl:if test="not(preceding-sibling::tei:handNote)">
-      <xsl:variable name="Notes">
-        <tei:list type="ordered">
-          <xsl:for-each select="../tei:handNote">
-            <item>
-              <xsl:copy-of select="*|text()"/>
-            </item>
-          </xsl:for-each>
-        </tei:list>
-      </xsl:variable>
-      <xsl:apply-templates select="$Notes"/>
-    </xsl:if>
-  </xsl:template>
+
+	<xsl:template name="msSection">
+		<xsl:param name="heading" />
+		<xsl:param name="level" />
+		<xsl:param name="implicitBlock" />
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template name="msBlock">
+		<xsl:param name="style" />
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template name="msInline">
+		<xsl:param name="before" />
+		<xsl:param name="after" />
+		<xsl:param name="style" />
+		<xsl:value-of select="$before" />
+		<xsl:apply-templates />
+		<xsl:value-of select="$after" />
+	</xsl:template>
+	<xsl:template name="msLabelled">
+		<xsl:param name="before" />
+		<xsl:value-of select="$before" />
+		<xsl:text>: </xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template name="msLiteral">
+		<xsl:param name="text" />
+		<xsl:value-of select="$text" />
+	</xsl:template>
+	<!-- headings -->
+	<xsl:template match="tei:accMat">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Accompanying material</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:additional">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Additional</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:bindingDesc">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Binding</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:msContents">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				1
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Contents</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:msDesc/tei:head">
+		<xsl:call-template name="msBlock">
+			<xsl:with-param name="style">
+				msHead
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:history">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				1
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>History</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:provenance">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Provenance</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:acquisition">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Acquisition</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:origin">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Origin</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:msIdentifier">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				1
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Identification</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:layoutDesc">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				3
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Layout</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:decoDesc">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				3
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Decoration</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:msWriting">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Writing</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:musicNotation">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Music notation</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:objectDesc">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Object</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:physDesc">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				1
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Physical description</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:seal">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				4
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Seal</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:sealDesc">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				3
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Seal description</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:supportDesc">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				3
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Support description</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:support">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				4
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Support</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:collation">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				4
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Collation</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:extent">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				4
+			</xsl:with-param>
+			<xsl:with-param name="implicitBlock">
+				true
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Extent</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:incipit">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Incipit</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:explicit">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Explicit</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:msItem/tei:listBibl">
+		<xsl:call-template name="msSection">
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+			<xsl:with-param name="heading">
+				<xsl:text>Text editions</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<!-- inline -->
+	<xsl:template match="tei:abbr">
+		<xsl:choose>
+			<xsl:when test="parent::tei:choice">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="msInline" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:orig">
+		<xsl:choose>
+			<xsl:when test="parent::tei:choice">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="msInline" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:textLang">
+		<xsl:choose>
+			<xsl:when test="preceding-sibling::tei:summary" />
+			<xsl:when test="preceding-sibling::tei:*">
+				<xsl:call-template name="msLiteral">
+					<xsl:with-param name="text">
+						<xsl:text>, </xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:call-template name="msLabelled">
+			<xsl:with-param name="before">
+				Language of text
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:summary">
+		<xsl:choose>
+			<xsl:when test="preceding-sibling::tei:*">
+				<xsl:call-template name="msLiteral">
+					<xsl:with-param name="text">
+						<xsl:text>, </xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:call-template name="msLabelled">
+			<xsl:with-param name="before">
+				Summary
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:rubric">
+		<xsl:if test="preceding-sibling::tei:*">
+			<xsl:call-template name="msLiteral">
+				<xsl:with-param name="text">
+					<xsl:text> </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:call-template name="msInline" />
+	</xsl:template>
+	<xsl:template match="tei:msItem/tei:author">
+		<xsl:if test="preceding-sibling::tei:*">
+			<xsl:call-template name="msLiteral">
+				<xsl:with-param name="text">
+					<xsl:text> </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:call-template name="msInline" />
+	</xsl:template>
+	<xsl:template match="tei:msItem/tei:title">
+		<xsl:if test="preceding-sibling::tei:*">
+			<xsl:call-template name="msLiteral">
+				<xsl:with-param name="text">
+					<xsl:text> </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:call-template name="msInline">
+			<xsl:with-param name="style">
+				italic
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:expan/tei:ex">
+		<xsl:call-template name="msInline">
+			<xsl:with-param name="before">
+				(
+			</xsl:with-param>
+			<xsl:with-param name="after">
+				)
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:locus">
+		<xsl:call-template name="msInline">
+			<xsl:with-param name="style">
+				bold
+			</xsl:with-param>
+			<xsl:with-param name="before" />
+			<xsl:with-param name="after">
+				:
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:supplied[@reason='damage']">
+		<xsl:call-template name="msInline">
+			<xsl:with-param name="before">
+				&lt;
+			</xsl:with-param>
+			<xsl:with-param name="after">
+				&gt;
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:supplied[@reason='illegible']">
+		<xsl:call-template name="msInline">
+			<xsl:with-param name="before">
+				[
+			</xsl:with-param>
+			<xsl:with-param name="after">
+				]
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:supplied[@reason='omitted']">
+		<xsl:call-template name="msInline">
+			<xsl:with-param name="before">
+				⟨
+			</xsl:with-param>
+			<xsl:with-param name="after">
+				⟩
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:gap" priority="10">
+		<xsl:call-template name="msInline">
+			<xsl:with-param name="before">
+				[...]
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:unclear" priority="10">
+		<xsl:call-template name="msInline">
+			<xsl:with-param name="after">
+				[?]
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template
+		match="tei:placeName|tei:genName|tei:geogName|tei:roleName|tei:name|tei:persName">
+		<xsl:choose>
+			<xsl:when test="*">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="msInline" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:dimensions">
+		<xsl:for-each select="*">
+			<xsl:apply-templates select="." />
+			<xsl:call-template name="msLiteral">
+				<xsl:with-param name="text">
+					<xsl:choose>
+						<xsl:when test="string-length(.)=0 and @extent">
+							<xsl:value-of select="@extent" />
+						</xsl:when>
+						<xsl:when test="@unit">
+							<xsl:value-of select="@unit" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:text>mm</xsl:text>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:if test="following-sibling::*">
+						<xsl:text> x </xsl:text>
+					</xsl:if>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="tei:origDate">
+		<xsl:apply-imports />
+		<xsl:if test="following-sibling::tei:origPlace">
+			<xsl:call-template name="msLiteral">
+				<xsl:with-param name="text">
+					<xsl:text>, </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="tei:msIdentifier/tei:*">
+		<xsl:apply-imports />
+		<xsl:if test="following-sibling::tei:*/text()">
+			<xsl:call-template name="msLiteral">
+				<xsl:with-param name="text">
+					<xsl:text>, </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	<!-- <handNote scribe="AM_544_4to_1" script="carolingian-insular minuscule" 
+		medium="ink" scope="sole"> -->
+	<xsl:template match="tei:handNote">
+		<xsl:if test="not(preceding-sibling::tei:handNote)">
+			<xsl:variable name="Notes">
+				<tei:list type="ordered">
+					<xsl:for-each select="../tei:handNote">
+						<item>
+							<xsl:copy-of select="*|text()" />
+						</item>
+					</xsl:for-each>
+				</tei:list>
+			</xsl:variable>
+			<xsl:apply-templates select="$Notes" />
+		</xsl:if>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/figures.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/figures.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/figures.xsl	(revision 2397)
@@ -1,279 +1,311 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the figures module. </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the figures module. </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: figures.xsl 10042 2012-01-13 15:23:16Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element figure</desc>
-   </doc>
-  <xsl:template match="tei:figure" mode="xref">
-      <xsl:choose>
-	<xsl:when test="tei:head">
-	  <xsl:call-template name="calculateFigureNumber"/>
-	  <xsl:text>, </xsl:text>
-	  <xsl:apply-templates mode="plain" select="tei:head"/>
-	</xsl:when>
-	<xsl:otherwise>
-            <xsl:text>this figure</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element table</desc>
-   </doc>
-  <xsl:template match="tei:table" mode="xref">
-      <xsl:choose>
-         <xsl:when test="$numberTables='true'">
-	   <xsl:call-template name="calculateTableNumber"/>
-            <xsl:if test="tei:head">
-               <xsl:text>. </xsl:text>
-               <xsl:apply-templates mode="plain" select="tei:head"/>
-            </xsl:if>
-         </xsl:when>
-         <xsl:otherwise>
-	   <xsl:choose>
-            <xsl:when test="tei:head">
-               <xsl:apply-templates mode="plain" select="tei:head"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:text>table</xsl:text>
-	    </xsl:otherwise>
-	   </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] Analyze attributes of graphics inclusion<param name="mode">Type of output (fo, html, latex) being
-    created</param>
-      </desc>
-   </doc>
-  <xsl:template name="graphicsAttributes">
-      <xsl:param name="mode">fo</xsl:param>
-      <xsl:if test="@width">
-         <xsl:choose>
-            <xsl:when test="ends-with(@width,'%')">
-               <xsl:choose>
-                  <xsl:when test="$mode='fo'">
-                     <xsl:attribute name="content-width">
-                        <xsl:value-of select="@width"/>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: figures.xsl 10042 2012-01-13 15:23:16Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element figure</desc>
+	</doc>
+	<xsl:template match="tei:figure" mode="xref">
+		<xsl:choose>
+			<xsl:when test="tei:head">
+				<xsl:call-template name="calculateFigureNumber" />
+				<xsl:text>, </xsl:text>
+				<xsl:apply-templates mode="plain"
+					select="tei:head" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>this figure</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element table</desc>
+	</doc>
+	<xsl:template match="tei:table" mode="xref">
+		<xsl:choose>
+			<xsl:when test="$numberTables='true'">
+				<xsl:call-template name="calculateTableNumber" />
+				<xsl:if test="tei:head">
+					<xsl:text>. </xsl:text>
+					<xsl:apply-templates mode="plain"
+						select="tei:head" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="tei:head">
+						<xsl:apply-templates mode="plain"
+							select="tei:head" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>table</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[latex] Analyze attributes of graphics inclusion
+			<param name="mode">Type of output (fo, html, latex) being
+				created</param>
+		</desc>
+	</doc>
+	<xsl:template name="graphicsAttributes">
+		<xsl:param name="mode">
+			fo
+		</xsl:param>
+		<xsl:if test="@width">
+			<xsl:choose>
+				<xsl:when test="ends-with(@width,'%')">
+					<xsl:choose>
+						<xsl:when test="$mode='fo'">
+							<xsl:attribute name="content-width">
+                        <xsl:value-of select="@width" />
                      </xsl:attribute>
-                  </xsl:when>
-                  <xsl:when test="$mode='latex'">
-                     <xsl:text>width=</xsl:text>
-                     <xsl:value-of select="number(substring-before(@width,'%')) div 100"/>
-                     <xsl:text>\textwidth,</xsl:text>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:attribute name="width">
-                        <xsl:value-of select="@width"/>
+						</xsl:when>
+						<xsl:when test="$mode='latex'">
+							<xsl:text>width=</xsl:text>
+							<xsl:value-of
+								select="number(substring-before(@width,'%')) div 100" />
+							<xsl:text>\textwidth,</xsl:text>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:attribute name="width">
+                        <xsl:value-of select="@width" />
                      </xsl:attribute>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:variable name="w">
-                  <xsl:choose>
-                     <xsl:when test="ends-with(@width,'pt')">
-                        <xsl:value-of select="@width"/>
-                     </xsl:when>
-                     <xsl:when test="ends-with(@width,'px') and $mode='latex'">
-                        <xsl:value-of select="substring-before(@width,'px')"/>
-                        <xsl:text>pt</xsl:text>
-                     </xsl:when>
-                     <xsl:when test="ends-with(@width,'in')">
-                        <xsl:value-of select="@width"/>
-                     </xsl:when>
-                     <xsl:when test="ends-with(@width,'px')">
-                        <xsl:value-of select="@width"/>
-                     </xsl:when>
-                     <xsl:when test="ends-with(@width,'cm')">
-                        <xsl:value-of select="@width"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@width"/>
-                        <xsl:text>pt</xsl:text>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:variable>
-               <xsl:choose>
-                  <xsl:when test="$mode='fo'">
-                     <xsl:attribute name="content-width">
-                        <xsl:value-of select="$w"/>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="w">
+						<xsl:choose>
+							<xsl:when test="ends-with(@width,'pt')">
+								<xsl:value-of select="@width" />
+							</xsl:when>
+							<xsl:when
+								test="ends-with(@width,'px') and $mode='latex'">
+								<xsl:value-of
+									select="substring-before(@width,'px')" />
+								<xsl:text>pt</xsl:text>
+							</xsl:when>
+							<xsl:when test="ends-with(@width,'in')">
+								<xsl:value-of select="@width" />
+							</xsl:when>
+							<xsl:when test="ends-with(@width,'px')">
+								<xsl:value-of select="@width" />
+							</xsl:when>
+							<xsl:when test="ends-with(@width,'cm')">
+								<xsl:value-of select="@width" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@width" />
+								<xsl:text>pt</xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="$mode='fo'">
+							<xsl:attribute name="content-width">
+                        <xsl:value-of select="$w" />
                      </xsl:attribute>
-                  </xsl:when>
-                  <xsl:when test="$mode='latex'">
-                     <xsl:text>width=</xsl:text>
-                     <xsl:value-of select="$w"/>
-                     <xsl:text>,</xsl:text>
-                  </xsl:when>
-               </xsl:choose>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-      <xsl:if test="@height">
-         <xsl:choose>
-            <xsl:when test="ends-with(@height,'%')">
-               <xsl:choose>
-                  <xsl:when test="$mode='fo'">
-                     <xsl:attribute name="content-height">
-                        <xsl:value-of select="@height"/>
+						</xsl:when>
+						<xsl:when test="$mode='latex'">
+							<xsl:text>width=</xsl:text>
+							<xsl:value-of select="$w" />
+							<xsl:text>,</xsl:text>
+						</xsl:when>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+		<xsl:if test="@height">
+			<xsl:choose>
+				<xsl:when test="ends-with(@height,'%')">
+					<xsl:choose>
+						<xsl:when test="$mode='fo'">
+							<xsl:attribute name="content-height">
+                        <xsl:value-of select="@height" />
                      </xsl:attribute>
-                  </xsl:when>
-                  <xsl:when test="$mode='latex'">
-                     <xsl:text>height=</xsl:text>
-                     <xsl:value-of select="number(substring-before(@height,'%')) div 100"/>
-                     <xsl:text>\textheight,</xsl:text>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:attribute name="height">
-                        <xsl:value-of select="@height"/>
+						</xsl:when>
+						<xsl:when test="$mode='latex'">
+							<xsl:text>height=</xsl:text>
+							<xsl:value-of
+								select="number(substring-before(@height,'%')) div 100" />
+							<xsl:text>\textheight,</xsl:text>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:attribute name="height">
+                        <xsl:value-of select="@height" />
                      </xsl:attribute>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:variable name="h">
-                  <xsl:choose>
-                     <xsl:when test="ends-with(@height,'pt')">
-                        <xsl:value-of select="@height"/>
-                     </xsl:when>
-                     <xsl:when test="ends-with(@height,'px') and $mode='latex'">
-                        <xsl:value-of select="substring-before(@height,'px')"/>
-                        <xsl:text>pt</xsl:text>
-                     </xsl:when>
-                     <xsl:when test="ends-with(@height,'in')">
-                        <xsl:value-of select="@height"/>
-                     </xsl:when>
-                     <xsl:when test="ends-with(@height,'px')">
-                        <xsl:value-of select="@height"/>
-                     </xsl:when>
-                     <xsl:when test="ends-with(@height,'cm')">
-                        <xsl:value-of select="@height"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@height"/>
-                        <xsl:text>pt</xsl:text>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:variable>
-               <xsl:choose>
-                  <xsl:when test="$mode='fo'">
-                     <xsl:attribute name="content-height">
-                        <xsl:value-of select="$h"/>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="h">
+						<xsl:choose>
+							<xsl:when test="ends-with(@height,'pt')">
+								<xsl:value-of select="@height" />
+							</xsl:when>
+							<xsl:when
+								test="ends-with(@height,'px') and $mode='latex'">
+								<xsl:value-of
+									select="substring-before(@height,'px')" />
+								<xsl:text>pt</xsl:text>
+							</xsl:when>
+							<xsl:when test="ends-with(@height,'in')">
+								<xsl:value-of select="@height" />
+							</xsl:when>
+							<xsl:when test="ends-with(@height,'px')">
+								<xsl:value-of select="@height" />
+							</xsl:when>
+							<xsl:when test="ends-with(@height,'cm')">
+								<xsl:value-of select="@height" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@height" />
+								<xsl:text>pt</xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="$mode='fo'">
+							<xsl:attribute name="content-height">
+                        <xsl:value-of select="$h" />
                      </xsl:attribute>
-                  </xsl:when>
-                  <xsl:when test="$mode='latex'">
-                     <xsl:text>height=</xsl:text>
-                     <xsl:value-of select="$h"/>
-                     <xsl:text>,</xsl:text>
-                  </xsl:when>
-               </xsl:choose>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-      <xsl:variable name="s">
-         <xsl:choose>
-            <xsl:when test="@scale and ends-with(@scale,'%')">
-               <xsl:value-of select="number(substring-before(@scale,'%')) div 100"/>
-            </xsl:when>
-            <xsl:when test="@scale">
-               <xsl:value-of select="@scale"/>
-            </xsl:when>
-            <xsl:when test="not(@width) and not(@height) and not($standardScale=1)">
-               <xsl:value-of select="$standardScale"/>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:if test="not($s='')">
-         <xsl:choose>
-            <xsl:when test="$mode='fo'">
-               <xsl:attribute name="scale">
-                  <xsl:value-of select="$s"/>
+						</xsl:when>
+						<xsl:when test="$mode='latex'">
+							<xsl:text>height=</xsl:text>
+							<xsl:value-of select="$h" />
+							<xsl:text>,</xsl:text>
+						</xsl:when>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+		<xsl:variable name="s">
+			<xsl:choose>
+				<xsl:when test="@scale and ends-with(@scale,'%')">
+					<xsl:value-of
+						select="number(substring-before(@scale,'%')) div 100" />
+				</xsl:when>
+				<xsl:when test="@scale">
+					<xsl:value-of select="@scale" />
+				</xsl:when>
+				<xsl:when
+					test="not(@width) and not(@height) and not($standardScale=1)">
+					<xsl:value-of select="$standardScale" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:if test="not($s='')">
+			<xsl:choose>
+				<xsl:when test="$mode='fo'">
+					<xsl:attribute name="scale">
+                  <xsl:value-of select="$s" />
                </xsl:attribute>
-            </xsl:when>
-            <xsl:when test="$mode='latex'">
-               <xsl:text>scale=</xsl:text>
-               <xsl:value-of select="$s"/>
-               <xsl:text>,</xsl:text>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:if>
-  </xsl:template>
+				</xsl:when>
+				<xsl:when test="$mode='latex'">
+					<xsl:text>scale=</xsl:text>
+					<xsl:value-of select="$s" />
+					<xsl:text>,</xsl:text>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template name="calculateFigureNumber">
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:front and  $numberFrontFigures='true'">
-	<xsl:call-template name="i18n">
-	  <xsl:with-param name="word">figureWord</xsl:with-param>
-	</xsl:call-template>
-	<xsl:text> </xsl:text>
-	<xsl:number count="tei:figure[tei:head]" from="tei:front" level="any"/>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:back and $numberBackFigures='true'">
-	<xsl:call-template name="i18n">
-	  <xsl:with-param name="word">figureWord</xsl:with-param>
-	</xsl:call-template>
-	<xsl:text> </xsl:text>
-	<xsl:number count="tei:figure[tei:head]" from="tei:back" level="any"/>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:body and $numberFigures='true'">
-	<xsl:call-template name="i18n">
-	  <xsl:with-param name="word">figureWord</xsl:with-param>
-	</xsl:call-template>
-	<xsl:text> </xsl:text>
-	<xsl:number count="tei:figure[tei:head]" from="tei:body" level="any"/>
-      </xsl:when>
-    </xsl:choose>    
-  </xsl:template>
+	<xsl:template name="calculateFigureNumber">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor::tei:front and  $numberFrontFigures='true'">
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						figureWord
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text> </xsl:text>
+				<xsl:number count="tei:figure[tei:head]" from="tei:front"
+					level="any" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor::tei:back and $numberBackFigures='true'">
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						figureWord
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text> </xsl:text>
+				<xsl:number count="tei:figure[tei:head]" from="tei:back"
+					level="any" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor::tei:body and $numberFigures='true'">
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						figureWord
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text> </xsl:text>
+				<xsl:number count="tei:figure[tei:head]" from="tei:body"
+					level="any" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template name="calculateTableNumber">
-    <xsl:call-template name="i18n">
-      <xsl:with-param name="word">tableWord</xsl:with-param>
-    </xsl:call-template>
-    <xsl:text> </xsl:text>
-    <xsl:number level="any"/>
-  </xsl:template>
+	<xsl:template name="calculateTableNumber">
+		<xsl:call-template name="i18n">
+			<xsl:with-param name="word">
+				tableWord
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:text> </xsl:text>
+		<xsl:number level="any" />
+	</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tagdocs.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tagdocs.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tagdocs.xsl	(revision 2397)
@@ -1,2704 +1,2998 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:s="http://www.ascc.net/xml/schematron" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="fo s a tei html rng teix xs sch" version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for weaving TEI ODD documents</p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="fo s a tei html rng teix xs sch" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for weaving TEI ODD documents</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: tagdocs.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:key name="CHILDMOD" match="Element" use="@module"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tagdocs.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:key name="CHILDMOD" match="Element" use="@module" />
 
-  <xsl:template match="tei:ptr|tei:ref" mode="weave">
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:remarks or ancestor::tei:listRef or ancestor::tei:valDesc">
-        <xsl:choose>
-          <xsl:when test="starts-with(@target,'#') and id(substring(@target,2))">
-            <xsl:call-template name="makeInternalLink">
-              <xsl:with-param name="target" select="substring(@target,2)"/>
-              <xsl:with-param name="ptr" select="if (self::tei:ptr)
-						 then true() else false()"/>
-              <xsl:with-param name="dest">
-                <xsl:call-template name="generateEndLink">
-                  <xsl:with-param name="where">
-                    <xsl:value-of select="substring(@target,2)"/>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:when test="starts-with(@target,'#')">
-            <xsl:variable name="Chapter">
-              <xsl:value-of select="substring(@target,2,2)"/>
-            </xsl:variable>
-            <xsl:choose>
-              <xsl:when test="$Chapter='AB' or        $Chapter='AI' or        $Chapter='CC' or        $Chapter='CE' or        $Chapter='CH' or        $Chapter='CO' or        $Chapter='DI' or        $Chapter='DR' or        $Chapter='DS' or        $Chapter='FS' or        $Chapter='FT' or        $Chapter='GD' or        $Chapter='HD' or        $Chapter='MS' or        $Chapter='ND' or        $Chapter='NH' or        $Chapter='PH' or        $Chapter='SA' or        $Chapter='SG' or        $Chapter='ST' or        $Chapter='TC' or        $Chapter='TD' or        $Chapter='TS' or        $Chapter='USE' or        $Chapter='VE' or        $Chapter='WD'">
-                <xsl:call-template name="makeExternalLink">
-		  <xsl:with-param name="ptr" select="if (self::tei:ptr)
-						 then true() else false()"/>
-                  <xsl:with-param name="dest">
-                    <xsl:text>http://www.tei-c.org/release/doc/tei-p5-doc/</xsl:text>
-                    <xsl:value-of select="$documentationLanguage"/>
-                    <xsl:text>/html/</xsl:text>
-                    <xsl:value-of select="$Chapter"/>
-                    <xsl:text>.html</xsl:text>
-                    <xsl:value-of select="@target"/>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:text>«</xsl:text>
-                <xsl:value-of select="@target"/>
-                <xsl:text>»</xsl:text>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:apply-imports/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-imports/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
-  <xsl:template match="tei:attDef" mode="summary">
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="tei:altIdent">
-          <xsl:value-of select="tei:altIdent"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element namespace="{$outputNS}" name="{$rowName}">
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+	<xsl:template match="tei:ptr|tei:ref" mode="weave">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor::tei:remarks or ancestor::tei:listRef or ancestor::tei:valDesc">
+				<xsl:choose>
+					<xsl:when
+						test="starts-with(@target,'#') and id(substring(@target,2))">
+						<xsl:call-template name="makeInternalLink">
+							<xsl:with-param name="target"
+								select="substring(@target,2)" />
+							<xsl:with-param name="ptr"
+								select="if (self::tei:ptr)
+						 then true() else false()" />
+							<xsl:with-param name="dest">
+								<xsl:call-template name="generateEndLink">
+									<xsl:with-param name="where">
+										<xsl:value-of select="substring(@target,2)" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when test="starts-with(@target,'#')">
+						<xsl:variable name="Chapter">
+							<xsl:value-of select="substring(@target,2,2)" />
+						</xsl:variable>
+						<xsl:choose>
+							<xsl:when
+								test="$Chapter='AB' or        $Chapter='AI' or        $Chapter='CC' or        $Chapter='CE' or        $Chapter='CH' or        $Chapter='CO' or        $Chapter='DI' or        $Chapter='DR' or        $Chapter='DS' or        $Chapter='FS' or        $Chapter='FT' or        $Chapter='GD' or        $Chapter='HD' or        $Chapter='MS' or        $Chapter='ND' or        $Chapter='NH' or        $Chapter='PH' or        $Chapter='SA' or        $Chapter='SG' or        $Chapter='ST' or        $Chapter='TC' or        $Chapter='TD' or        $Chapter='TS' or        $Chapter='USE' or        $Chapter='VE' or        $Chapter='WD'">
+								<xsl:call-template name="makeExternalLink">
+									<xsl:with-param name="ptr"
+										select="if (self::tei:ptr)
+						 then true() else false()" />
+									<xsl:with-param name="dest">
+										<xsl:text>http://www.tei-c.org/release/doc/tei-p5-doc/</xsl:text>
+										<xsl:value-of select="$documentationLanguage" />
+										<xsl:text>/html/</xsl:text>
+										<xsl:value-of select="$Chapter" />
+										<xsl:text>.html</xsl:text>
+										<xsl:value-of select="@target" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>«</xsl:text>
+								<xsl:value-of select="@target" />
+								<xsl:text>»</xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-imports />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-imports />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="tei:attDef" mode="summary">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element namespace="{$outputNS}" name="{$rowName}">
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>odd_label</xsl:text>
           <xsl:if test="@status">
             <xsl:text> status_</xsl:text>
-            <xsl:value-of select="@status"/>
+            <xsl:value-of select="@status" />
           </xsl:if>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$codeName}">
-          <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$codeName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>att</xsl:text>
           </xsl:attribute>
-          <xsl:value-of select="$name"/>
-        </xsl:element>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:value-of select="$name" />
+				</xsl:element>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>odd_value</xsl:text>
         </xsl:attribute>
-        <xsl:call-template name="makeDescription"/>
-        <xsl:apply-templates select="valList"/>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element attDef</desc>
-  </doc>
-  <xsl:template match="tei:attDef">
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="tei:altIdent">
-          <xsl:value-of select="tei:altIdent"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element namespace="{$outputNS}" name="{$rowName}">
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+				<xsl:call-template name="makeDescription" />
+				<xsl:apply-templates select="valList" />
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element attDef</desc>
+	</doc>
+	<xsl:template match="tei:attDef">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element namespace="{$outputNS}" name="{$rowName}">
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>odd_label</xsl:text>
           <xsl:if test="@status">
             <xsl:text> status_</xsl:text>
-            <xsl:value-of select="@status"/>
+            <xsl:value-of select="@status" />
           </xsl:if>
         </xsl:attribute>
-        <xsl:value-of select="$name"/>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+				<xsl:value-of select="$name" />
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>odd_value</xsl:text>
         </xsl:attribute>
-        <xsl:call-template name="makeDescription"/>
-        <xsl:element namespace="{$outputNS}" name="{$tableName}">
-          <xsl:attribute name="{$rendName}">
+				<xsl:call-template name="makeDescription" />
+				<xsl:element namespace="{$outputNS}" name="{$tableName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>attDef</xsl:text>
           </xsl:attribute>
-          <xsl:element namespace="{$outputNS}" name="{$rowName}">
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+					<xsl:element namespace="{$outputNS}" name="{$rowName}">
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>odd_label</xsl:text>
               </xsl:attribute>
-              <xsl:element namespace="{$outputNS}" name="{$hiName}">
-                <xsl:attribute name="{$rendName}">
+							<xsl:element namespace="{$outputNS}" name="{$hiName}">
+								<xsl:attribute name="{$rendName}">
                   <xsl:text>label</xsl:text>
                 </xsl:attribute>
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Status</xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-              <xsl:text> </xsl:text>
-            </xsl:element>
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Status
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+							<xsl:text> </xsl:text>
+						</xsl:element>
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>odd_value</xsl:text>
               </xsl:attribute>
-              <xsl:element namespace="{$outputNS}" name="{$segName}">
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+							<xsl:element namespace="{$outputNS}"
+								name="{$segName}">
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:choose>
-                  <xsl:when test="@usage='mwa'">
-                    <xsl:call-template name="i18n">
-                      <xsl:with-param name="word">Mandatory when applicable</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:when>
-                  <xsl:when test="@usage='opt'">
-                    <xsl:call-template name="i18n">
-                      <xsl:with-param name="word">Optional</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:when>
-                  <xsl:when test="@usage='rec'">
-                    <xsl:call-template name="i18n">
-                      <xsl:with-param name="word">Recommended</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:when>
-                  <xsl:when test="@usage='req'">
-                    <xsl:element namespace="{$outputNS}" name="{$hiName}">
-                      <xsl:attribute name="{$rendName}">
+								<xsl:choose>
+									<xsl:when test="@usage='mwa'">
+										<xsl:call-template name="i18n">
+											<xsl:with-param name="word">
+												Mandatory when applicable
+											</xsl:with-param>
+										</xsl:call-template>
+									</xsl:when>
+									<xsl:when test="@usage='opt'">
+										<xsl:call-template name="i18n">
+											<xsl:with-param name="word">
+												Optional
+											</xsl:with-param>
+										</xsl:call-template>
+									</xsl:when>
+									<xsl:when test="@usage='rec'">
+										<xsl:call-template name="i18n">
+											<xsl:with-param name="word">
+												Recommended
+											</xsl:with-param>
+										</xsl:call-template>
+									</xsl:when>
+									<xsl:when test="@usage='req'">
+										<xsl:element namespace="{$outputNS}"
+											name="{$hiName}">
+											<xsl:attribute name="{$rendName}">
                         <xsl:text>required</xsl:text>
                       </xsl:attribute>
-                      <xsl:call-template name="i18n">
-                        <xsl:with-param name="word">Required</xsl:with-param>
-                      </xsl:call-template>
-                    </xsl:element>
-                  </xsl:when>
-                  <xsl:when test="@usage='rwa'">
-                    <xsl:call-template name="i18n">
-                      <xsl:with-param name="word">Recommended when applicable</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:call-template name="i18n">
-                      <xsl:with-param name="word">Optional</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </xsl:element>
-            </xsl:element>
-          </xsl:element>
-          <xsl:apply-templates mode="weave"/>
-        </xsl:element>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element attDef/tei:datatype</desc>
-  </doc>
-  <xsl:template match="tei:attDef/tei:datatype" mode="weave">
-    <xsl:element namespace="{$outputNS}" name="{$rowName}">
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+											<xsl:call-template name="i18n">
+												<xsl:with-param name="word">
+													Required
+												</xsl:with-param>
+											</xsl:call-template>
+										</xsl:element>
+									</xsl:when>
+									<xsl:when test="@usage='rwa'">
+										<xsl:call-template name="i18n">
+											<xsl:with-param name="word">
+												Recommended when applicable
+											</xsl:with-param>
+										</xsl:call-template>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:call-template name="i18n">
+											<xsl:with-param name="word">
+												Optional
+											</xsl:with-param>
+										</xsl:call-template>
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:element>
+						</xsl:element>
+					</xsl:element>
+					<xsl:apply-templates mode="weave" />
+				</xsl:element>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element attDef/tei:datatype</desc>
+	</doc>
+	<xsl:template match="tei:attDef/tei:datatype" mode="weave">
+		<xsl:element namespace="{$outputNS}" name="{$rowName}">
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>odd_label</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$hiName}">
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+				<xsl:element namespace="{$outputNS}" name="{$hiName}">
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:attribute name="{$rendName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>label</xsl:text>
           </xsl:attribute>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Datatype</xsl:with-param>
-          </xsl:call-template>
-        </xsl:element>
-        <xsl:text> </xsl:text>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Datatype
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+				<xsl:text> </xsl:text>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>odd_value</xsl:text>
         </xsl:attribute>
-        <xsl:variable name="minOccurs">
-          <xsl:choose>
-            <xsl:when test="@minOccurs">
-              <xsl:value-of select="@minOccurs"/>
-            </xsl:when>
-            <xsl:otherwise>1</xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:variable name="maxOccurs">
-          <xsl:choose>
-            <xsl:when test="@maxOccurs='unbounded'">
-              <xsl:text>∞</xsl:text>
-            </xsl:when>
-            <xsl:when test="@maxOccurs">
-              <xsl:value-of select="@maxOccurs"/>
-            </xsl:when>
-            <xsl:otherwise>1</xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:if test="$minOccurs != '1'  or  $maxOccurs != '1'">
-          <xsl:text> </xsl:text>
-          <xsl:value-of select="$minOccurs"/>
-          <xsl:text>–</xsl:text>
-          <xsl:value-of select="$maxOccurs"/>
-          <xsl:text> </xsl:text>
-          <xsl:element namespace="{$outputNS}" name="{$segName}">
-            <xsl:attribute name="xml:lang">
-              <xsl:value-of select="$documentationLanguage"/>
+				<xsl:variable name="minOccurs">
+					<xsl:choose>
+						<xsl:when test="@minOccurs">
+							<xsl:value-of select="@minOccurs" />
+						</xsl:when>
+						<xsl:otherwise>
+							1
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="maxOccurs">
+					<xsl:choose>
+						<xsl:when test="@maxOccurs='unbounded'">
+							<xsl:text>∞</xsl:text>
+						</xsl:when>
+						<xsl:when test="@maxOccurs">
+							<xsl:value-of select="@maxOccurs" />
+						</xsl:when>
+						<xsl:otherwise>
+							1
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:if test="$minOccurs != '1'  or  $maxOccurs != '1'">
+					<xsl:text> </xsl:text>
+					<xsl:value-of select="$minOccurs" />
+					<xsl:text>–</xsl:text>
+					<xsl:value-of select="$maxOccurs" />
+					<xsl:text> </xsl:text>
+					<xsl:element namespace="{$outputNS}" name="{$segName}">
+						<xsl:attribute name="xml:lang">
+              <xsl:value-of
+							select="$documentationLanguage" />
             </xsl:attribute>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">occurrences of</xsl:with-param>
-            </xsl:call-template>
-          </xsl:element>
-          <xsl:value-of select="$spaceCharacter"/>
-        </xsl:if>
-        <xsl:call-template name="bitOut">
-          <xsl:with-param name="grammar"/>
-          <xsl:with-param name="element">code</xsl:with-param>
-          <xsl:with-param name="content">
-            <Wrapper>
-              <xsl:copy-of select="rng:*"/>
-            </Wrapper>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:if test="$minOccurs != '1'  or  $maxOccurs != '1'">
-          <xsl:element namespace="{$outputNS}" name="{$segName}">
-            <xsl:attribute name="xml:lang">
-              <xsl:value-of select="$documentationLanguage"/>
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								occurrences of
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:element>
+					<xsl:value-of select="$spaceCharacter" />
+				</xsl:if>
+				<xsl:call-template name="bitOut">
+					<xsl:with-param name="grammar" />
+					<xsl:with-param name="element">
+						code
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<Wrapper>
+							<xsl:copy-of select="rng:*" />
+						</Wrapper>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if test="$minOccurs != '1'  or  $maxOccurs != '1'">
+					<xsl:element namespace="{$outputNS}" name="{$segName}">
+						<xsl:attribute name="xml:lang">
+              <xsl:value-of
+							select="$documentationLanguage" />
             </xsl:attribute>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">separated by whitespace</xsl:with-param>
-            </xsl:call-template>
-          </xsl:element>
-        </xsl:if>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element attList</desc>
-  </doc>
-  <xsl:template match="tei:attList" mode="show">
-    <xsl:call-template name="displayAttList">
-      <xsl:with-param name="mode">summary</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element classSpec</desc>
-  </doc>
-  <xsl:template match="tei:classSpec">
-    <xsl:if test="parent::tei:specGrp">
-      <xsl:element namespace="{$outputNS}" name="{$dtName}"><xsl:element namespace="{$outputNS}" name="{$hiName}"><xsl:attribute name="{$rendName}"><xsl:text>label</xsl:text></xsl:attribute><xsl:attribute name="xml:lang"><xsl:value-of select="$documentationLanguage"/></xsl:attribute><xsl:call-template name="i18n"><xsl:with-param name="word">Class</xsl:with-param></xsl:call-template></xsl:element>: <xsl:value-of select="@ident"/></xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$ddName}">
-        <xsl:apply-templates mode="tangle" select="."/>
-        <xsl:text>(</xsl:text>
-        <xsl:element namespace="{$outputNS}" name="{$segName}">
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								separated by whitespace
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:element>
+				</xsl:if>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element attList</desc>
+	</doc>
+	<xsl:template match="tei:attList" mode="show">
+		<xsl:call-template name="displayAttList">
+			<xsl:with-param name="mode">
+				summary
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element classSpec</desc>
+	</doc>
+	<xsl:template match="tei:classSpec">
+		<xsl:if test="parent::tei:specGrp">
+			<xsl:element namespace="{$outputNS}" name="{$dtName}">
+				<xsl:element namespace="{$outputNS}" name="{$hiName}">
+					<xsl:attribute name="{$rendName}"><xsl:text>label</xsl:text></xsl:attribute>
+					<xsl:attribute name="xml:lang"><xsl:value-of
+						select="$documentationLanguage" /></xsl:attribute>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Class
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+				:
+				<xsl:value-of select="@ident" />
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$ddName}">
+				<xsl:apply-templates mode="tangle" select="." />
+				<xsl:text>(</xsl:text>
+				<xsl:element namespace="{$outputNS}" name="{$segName}">
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Members</xsl:with-param>
-          </xsl:call-template>
-        </xsl:element>
-        <xsl:text>: </xsl:text>
-        <xsl:call-template name="generateMembers"/>
-        <xsl:text>)</xsl:text>
-      </xsl:element>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element classSpec</desc>
-  </doc>
-  <xsl:template match="tei:classSpec" mode="weavebody">
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="tei:altIdent">
-          <xsl:value-of select="tei:altIdent"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element namespace="{$outputNS}" name="{$sectionName}">
-      <xsl:call-template name="makeSectionHead">
-        <xsl:with-param name="id">
-          <xsl:value-of select="@ident"/>
-        </xsl:with-param>
-        <xsl:with-param name="name">
-          <xsl:value-of select="$name"/>
-        </xsl:with-param>
-      </xsl:call-template>
-      <xsl:element namespace="{$outputNS}" name="{$tableName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Members
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+				<xsl:text>: </xsl:text>
+				<xsl:call-template name="generateMembers" />
+				<xsl:text>)</xsl:text>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element classSpec</desc>
+	</doc>
+	<xsl:template match="tei:classSpec" mode="weavebody">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element namespace="{$outputNS}" name="{$sectionName}">
+			<xsl:call-template name="makeSectionHead">
+				<xsl:with-param name="id">
+					<xsl:value-of select="@ident" />
+				</xsl:with-param>
+				<xsl:with-param name="name">
+					<xsl:value-of select="$name" />
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:element namespace="{$outputNS}" name="{$tableName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$colspan}">2</xsl:attribute>
-            <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$colspan}">2</xsl:attribute>
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col2</xsl:text>
             </xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:value-of select="$name"/>
-            </xsl:element>
-            <xsl:call-template name="specHook">
-              <xsl:with-param name="name">
-                <xsl:value-of select="$name"/>
-              </xsl:with-param>
-            </xsl:call-template>
-            <xsl:text>&#160;</xsl:text>
-            <xsl:call-template name="makeDescription"/>
-          </xsl:element>
-        </xsl:element>
-        <xsl:if test="@generate">
-          <xsl:element namespace="{$outputNS}" name="{$rowName}">
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+							<xsl:value-of select="$name" />
+						</xsl:element>
+						<xsl:call-template name="specHook">
+							<xsl:with-param name="name">
+								<xsl:value-of select="$name" />
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:text>&#160;</xsl:text>
+						<xsl:call-template name="makeDescription" />
+					</xsl:element>
+				</xsl:element>
+				<xsl:if test="@generate">
+					<xsl:element namespace="{$outputNS}" name="{$rowName}">
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>wovenodd-col1</xsl:text>
               </xsl:attribute>
-              <xsl:element namespace="{$outputNS}" name="{$segName}">
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+							<xsl:element namespace="{$outputNS}"
+								name="{$segName}">
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">
-                    <xsl:text>Classes defined</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-            </xsl:element>
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										<xsl:text>Classes defined</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+						</xsl:element>
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>wovenodd-col2</xsl:text>
               </xsl:attribute>
-              <xsl:value-of select="@generate"/>
-            </xsl:element>
-          </xsl:element>
-        </xsl:if>
-        <xsl:if test="@module">
-          <xsl:call-template name="moduleInfo"/>
-        </xsl:if>
-        <xsl:if test="@type='model'">
-          <xsl:element namespace="{$outputNS}" name="{$rowName}">
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+							<xsl:value-of select="@generate" />
+						</xsl:element>
+					</xsl:element>
+				</xsl:if>
+				<xsl:if test="@module">
+					<xsl:call-template name="moduleInfo" />
+				</xsl:if>
+				<xsl:if test="@type='model'">
+					<xsl:element namespace="{$outputNS}" name="{$rowName}">
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>wovenodd-col1</xsl:text>
               </xsl:attribute>
-              <xsl:element namespace="{$outputNS}" name="{$hiName}">
-                <xsl:attribute name="{$rendName}">
+							<xsl:element namespace="{$outputNS}" name="{$hiName}">
+								<xsl:attribute name="{$rendName}">
                   <xsl:text>label</xsl:text>
                 </xsl:attribute>
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Used by</xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-            </xsl:element>
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Used by
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+						</xsl:element>
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>wovenodd-col2</xsl:text>
               </xsl:attribute>
-              <xsl:call-template name="generateModelParents">
-                <xsl:with-param name="showElements">true</xsl:with-param>
-              </xsl:call-template>
-            </xsl:element>
-          </xsl:element>
-        </xsl:if>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+							<xsl:call-template name="generateModelParents">
+								<xsl:with-param name="showElements">
+									true
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:element>
+				</xsl:if>
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col1</xsl:text>
             </xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:attribute name="xml:lang">
-                <xsl:value-of select="$documentationLanguage"/>
+							<xsl:attribute name="xml:lang">
+                <xsl:value-of
+								select="$documentationLanguage" />
               </xsl:attribute>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Members</xsl:with-param>
-              </xsl:call-template>
-            </xsl:element>
-          </xsl:element>
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Members
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:element>
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col2</xsl:text>
             </xsl:attribute>
-            <xsl:call-template name="generateMembers"/>
-          </xsl:element>
-        </xsl:element>
-        <xsl:if test="@type='atts'">
-          <xsl:element namespace="{$outputNS}" name="{$rowName}">
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:call-template name="generateMembers" />
+					</xsl:element>
+				</xsl:element>
+				<xsl:if test="@type='atts'">
+					<xsl:element namespace="{$outputNS}" name="{$rowName}">
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>wovenodd-col1</xsl:text>
               </xsl:attribute>
-              <xsl:element namespace="{$outputNS}" name="{$hiName}">
-                <xsl:attribute name="{$rendName}">
+							<xsl:element namespace="{$outputNS}" name="{$hiName}">
+								<xsl:attribute name="{$rendName}">
                   <xsl:text>label</xsl:text>
                 </xsl:attribute>
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Attributes</xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-            </xsl:element>
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Attributes
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+						</xsl:element>
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>wovenodd-col2</xsl:text>
               </xsl:attribute>
-              <xsl:choose>
-                <xsl:when test="not(tei:attList)">
-                  <xsl:call-template name="showAttClasses"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:for-each select="tei:attList">
-                    <xsl:call-template name="displayAttList">
-                      <xsl:with-param name="mode">all</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:for-each>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:element>
-          </xsl:element>
-        </xsl:if>
-        <xsl:apply-templates mode="weave"/>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element classes</desc>
-  </doc>
-  <xsl:template match="tei:classes" mode="weave"> </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element elementSpec</desc>
-  </doc>
-  <xsl:template match="tei:elementSpec">
-    <xsl:if test="parent::tei:specGrp">
-      <xsl:element namespace="{$outputNS}" name="{$dtName}">
-        <xsl:element namespace="{$outputNS}" name="{$segName}">
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+							<xsl:choose>
+								<xsl:when test="not(tei:attList)">
+									<xsl:call-template name="showAttClasses" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each select="tei:attList">
+										<xsl:call-template name="displayAttList">
+											<xsl:with-param name="mode">
+												all
+											</xsl:with-param>
+										</xsl:call-template>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:element>
+					</xsl:element>
+				</xsl:if>
+				<xsl:apply-templates mode="weave" />
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element classes</desc>
+	</doc>
+	<xsl:template match="tei:classes" mode="weave">
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element elementSpec</desc>
+	</doc>
+	<xsl:template match="tei:elementSpec">
+		<xsl:if test="parent::tei:specGrp">
+			<xsl:element namespace="{$outputNS}" name="{$dtName}">
+				<xsl:element namespace="{$outputNS}" name="{$segName}">
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Element</xsl:with-param>
-          </xsl:call-template>
-          <xsl:value-of select="$spaceCharacter"/>
-          <xsl:value-of select="@ident"/>
-        </xsl:element>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$ddName}">
-        <xsl:apply-templates mode="tangle" select="."/>
-      </xsl:element>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element elementSpec</desc>
-  </doc>
-  <xsl:template match="tei:elementSpec" mode="weavebody">
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="tei:altIdent">
-          <xsl:value-of select="tei:altIdent"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element namespace="{$outputNS}" name="{$sectionName}">
-      <xsl:call-template name="makeSectionHead">
-        <xsl:with-param name="id">
-          <xsl:value-of select="@ident"/>
-        </xsl:with-param>
-        <xsl:with-param name="name">
-          <xsl:text>&lt;</xsl:text>
-          <xsl:choose>
-            <xsl:when test="tei:content/rng:empty">
-              <xsl:call-template name="emptySlash">
-                <xsl:with-param name="name">
-                  <xsl:value-of select="$name"/>
-                </xsl:with-param>
-              </xsl:call-template>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="$name"/>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:text>&gt;</xsl:text>
-        </xsl:with-param>
-      </xsl:call-template>
-      <xsl:call-template name="specHook">
-        <xsl:with-param name="name">
-          <xsl:value-of select="$name"/>
-        </xsl:with-param>
-      </xsl:call-template>
-      <xsl:element namespace="{$outputNS}" name="{$tableName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Element
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:value-of select="$spaceCharacter" />
+					<xsl:value-of select="@ident" />
+				</xsl:element>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$ddName}">
+				<xsl:apply-templates mode="tangle" select="." />
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element elementSpec</desc>
+	</doc>
+	<xsl:template match="tei:elementSpec" mode="weavebody">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element namespace="{$outputNS}" name="{$sectionName}">
+			<xsl:call-template name="makeSectionHead">
+				<xsl:with-param name="id">
+					<xsl:value-of select="@ident" />
+				</xsl:with-param>
+				<xsl:with-param name="name">
+					<xsl:text>&lt;</xsl:text>
+					<xsl:choose>
+						<xsl:when test="tei:content/rng:empty">
+							<xsl:call-template name="emptySlash">
+								<xsl:with-param name="name">
+									<xsl:value-of select="$name" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$name" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:text>&gt;</xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:call-template name="specHook">
+				<xsl:with-param name="name">
+					<xsl:value-of select="$name" />
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:element namespace="{$outputNS}" name="{$tableName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$colspan}">2</xsl:attribute>
-            <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$colspan}">2</xsl:attribute>
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col2</xsl:text>
             </xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:text>&lt;</xsl:text>
-              <xsl:choose>
-                <xsl:when test="tei:content/rng:empty">
-                  <xsl:call-template name="emptySlash">
-                    <xsl:with-param name="name">
-                      <xsl:value-of select="$name"/>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:value-of select="$name"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <xsl:text>&gt; </xsl:text>
-            </xsl:element>
-            <xsl:call-template name="makeDescription"/>
-          </xsl:element>
-        </xsl:element>
-        <xsl:if test="@module">
-          <xsl:call-template name="moduleInfo"/>
-        </xsl:if>
-        <xsl:variable name="myatts">
-          <a>
-            <xsl:choose>
-              <xsl:when test="not(tei:attList)">
-                <xsl:call-template name="showAttClasses"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:for-each select="tei:attList">
-                  <xsl:call-template name="displayAttList">
-                    <xsl:with-param name="mode">all</xsl:with-param>
-                  </xsl:call-template>
-                </xsl:for-each>
-              </xsl:otherwise>
-            </xsl:choose>
-          </a>
-        </xsl:variable>
-        <xsl:if test="count($myatts/a/*)&gt;0">
-          <xsl:element namespace="{$outputNS}" name="{$rowName}">
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+							<xsl:text>&lt;</xsl:text>
+							<xsl:choose>
+								<xsl:when test="tei:content/rng:empty">
+									<xsl:call-template name="emptySlash">
+										<xsl:with-param name="name">
+											<xsl:value-of select="$name" />
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="$name" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<xsl:text>&gt; </xsl:text>
+						</xsl:element>
+						<xsl:call-template name="makeDescription" />
+					</xsl:element>
+				</xsl:element>
+				<xsl:if test="@module">
+					<xsl:call-template name="moduleInfo" />
+				</xsl:if>
+				<xsl:variable name="myatts">
+					<a>
+						<xsl:choose>
+							<xsl:when test="not(tei:attList)">
+								<xsl:call-template name="showAttClasses" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:for-each select="tei:attList">
+									<xsl:call-template name="displayAttList">
+										<xsl:with-param name="mode">
+											all
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:for-each>
+							</xsl:otherwise>
+						</xsl:choose>
+					</a>
+				</xsl:variable>
+				<xsl:if test="count($myatts/a/*)&gt;0">
+					<xsl:element namespace="{$outputNS}" name="{$rowName}">
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>wovenodd-col1</xsl:text>
               </xsl:attribute>
-              <xsl:element namespace="{$outputNS}" name="{$hiName}">
-                <xsl:attribute name="{$rendName}">
+							<xsl:element namespace="{$outputNS}" name="{$hiName}">
+								<xsl:attribute name="{$rendName}">
                   <xsl:text>label</xsl:text>
                 </xsl:attribute>
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Attributes</xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-            </xsl:element>
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Attributes
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+						</xsl:element>
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>wovenodd-col2</xsl:text>
               </xsl:attribute>
-              <xsl:choose>
-                <xsl:when test="not(tei:attList)">
-                  <xsl:call-template name="showAttClasses"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:for-each select="tei:attList">
-                    <xsl:call-template name="displayAttList">
-                      <xsl:with-param name="mode">all</xsl:with-param>
-                    </xsl:call-template>
-                  </xsl:for-each>
-                </xsl:otherwise>
-              </xsl:choose>
-              <!--
-	      <xsl:for-each select="$myatts/a">
-		<xsl:copy-of select="*|text()"/>
-	      </xsl:for-each>
--->
-            </xsl:element>
-          </xsl:element>
-        </xsl:if>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+							<xsl:choose>
+								<xsl:when test="not(tei:attList)">
+									<xsl:call-template name="showAttClasses" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:for-each select="tei:attList">
+										<xsl:call-template name="displayAttList">
+											<xsl:with-param name="mode">
+												all
+											</xsl:with-param>
+										</xsl:call-template>
+									</xsl:for-each>
+								</xsl:otherwise>
+							</xsl:choose>
+							<!-- <xsl:for-each select="$myatts/a"> <xsl:copy-of select="*|text()"/> 
+								</xsl:for-each> -->
+						</xsl:element>
+					</xsl:element>
+				</xsl:if>
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col1</xsl:text>
             </xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:attribute name="xml:lang">
-                <xsl:value-of select="$documentationLanguage"/>
+							<xsl:attribute name="xml:lang">
+                <xsl:value-of
+								select="$documentationLanguage" />
               </xsl:attribute>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Used by</xsl:with-param>
-              </xsl:call-template>
-            </xsl:element>
-          </xsl:element>
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Used by
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:element>
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col2</xsl:text>
             </xsl:attribute>
-            <xsl:call-template name="generateModelParents">
-              <xsl:with-param name="showElements">false</xsl:with-param>
-            </xsl:call-template>
-          </xsl:element>
-        </xsl:element>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+						<xsl:call-template name="generateModelParents">
+							<xsl:with-param name="showElements">
+								false
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:element>
+				</xsl:element>
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col1</xsl:text>
             </xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:attribute name="xml:lang">
-                <xsl:value-of select="$documentationLanguage"/>
+							<xsl:attribute name="xml:lang">
+                <xsl:value-of
+								select="$documentationLanguage" />
               </xsl:attribute>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Contained by</xsl:with-param>
-              </xsl:call-template>
-            </xsl:element>
-          </xsl:element>
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Contained by
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:element>
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col2</xsl:text>
             </xsl:attribute>
-            <xsl:call-template name="generateIndirectParents"/>
-          </xsl:element>
-        </xsl:element>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+						<xsl:call-template
+							name="generateIndirectParents" />
+					</xsl:element>
+				</xsl:element>
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col1</xsl:text>
             </xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:attribute name="xml:lang">
-                <xsl:value-of select="$documentationLanguage"/>
+							<xsl:attribute name="xml:lang">
+                <xsl:value-of
+								select="$documentationLanguage" />
               </xsl:attribute>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">
-                  <xsl:text>May contain</xsl:text>
-                </xsl:with-param>
-              </xsl:call-template>
-            </xsl:element>
-          </xsl:element>
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									<xsl:text>May contain</xsl:text>
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:element>
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col2</xsl:text>
             </xsl:attribute>
-            <xsl:call-template name="generateChildren"/>
-          </xsl:element>
-        </xsl:element>
-        <xsl:apply-templates mode="weave"/>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element elementSpec/tei:content</desc>
-  </doc>
-  <xsl:template match="tei:elementSpec/tei:content" mode="weave">
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="../tei:altIdent">
-          <xsl:value-of select="../tei:altIdent"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="../@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element namespace="{$outputNS}" name="{$rowName}">
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+						<xsl:call-template name="generateChildren" />
+					</xsl:element>
+				</xsl:element>
+				<xsl:apply-templates mode="weave" />
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element elementSpec/tei:content</desc>
+	</doc>
+	<xsl:template match="tei:elementSpec/tei:content"
+		mode="weave">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="../tei:altIdent">
+					<xsl:value-of select="../tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="../@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element namespace="{$outputNS}" name="{$rowName}">
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd-col1</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$hiName}">
-          <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$hiName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>label</xsl:text>
           </xsl:attribute>
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Declaration</xsl:with-param>
-          </xsl:call-template>
-        </xsl:element>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Declaration
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd-col2</xsl:text>
         </xsl:attribute>
-        <xsl:call-template name="bitOut">
-          <xsl:with-param name="grammar"/>
-          <xsl:with-param name="content">
-            <Wrapper>
-              <rng:element name="{$name}">
-                <xsl:if test="not(key('SCHEMASPECS',1))">
-                  <xsl:if test="$autoGlobal='true'">
-                    <rng:ref name="att.global.attributes"/>
-                  </xsl:if>
-                  <xsl:for-each select="..">
-                    <xsl:call-template name="showClassAtts"/>
-                  </xsl:for-each>
-                </xsl:if>
-                <xsl:apply-templates mode="tangle" select="../tei:attList"/>
-                <xsl:copy-of select="rng:*"/>
-              </rng:element>
-            </Wrapper>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:for-each select="tei:valList[@type='closed']">
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Legal values are</xsl:with-param>
-          </xsl:call-template>
-          <xsl:text>:</xsl:text>
-          <xsl:call-template name="valListChildren"/>
-        </xsl:for-each>
-        <xsl:if test="s:*">
-          <xsl:element namespace="{$outputNS}" name="{$divName}">
-            <xsl:attribute name="{$rendName}">
+				<xsl:call-template name="bitOut">
+					<xsl:with-param name="grammar" />
+					<xsl:with-param name="content">
+						<Wrapper>
+							<rng:element name="{$name}">
+								<xsl:if test="not(key('SCHEMASPECS',1))">
+									<xsl:if test="$autoGlobal='true'">
+										<rng:ref name="att.global.attributes" />
+									</xsl:if>
+									<xsl:for-each select="..">
+										<xsl:call-template name="showClassAtts" />
+									</xsl:for-each>
+								</xsl:if>
+								<xsl:apply-templates mode="tangle"
+									select="../tei:attList" />
+								<xsl:copy-of select="rng:*" />
+							</rng:element>
+						</Wrapper>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:for-each select="tei:valList[@type='closed']">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Legal values are
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:text>:</xsl:text>
+					<xsl:call-template name="valListChildren" />
+				</xsl:for-each>
+				<xsl:if test="s:*">
+					<xsl:element namespace="{$outputNS}" name="{$divName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>pre</xsl:text>
             </xsl:attribute>
-            <xsl:apply-templates select="s:*" mode="verbatim"/>
-          </xsl:element>
-        </xsl:if>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <xsl:template match="tei:constraintSpec[parent::tei:elementSpec or parent::tei:attDef]" mode="weave">
-    <xsl:element namespace="{$outputNS}" name="{$rowName}">
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+						<xsl:apply-templates select="s:*"
+							mode="verbatim" />
+					</xsl:element>
+				</xsl:if>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<xsl:template
+		match="tei:constraintSpec[parent::tei:elementSpec or parent::tei:attDef]"
+		mode="weave">
+		<xsl:element namespace="{$outputNS}" name="{$rowName}">
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd-col1</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$hiName}">
-          <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$hiName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>label</xsl:text>
           </xsl:attribute>
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:text>Schematron</xsl:text>
-        </xsl:element>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:text>Schematron</xsl:text>
+				</xsl:element>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd-col2</xsl:text>
         </xsl:attribute>
-        <xsl:call-template name="makeDescription"/>
-        <xsl:for-each select="tei:constraint">
-          <xsl:element namespace="{$outputNS}" name="{$divName}">
-            <xsl:attribute name="{$rendName}">
+				<xsl:call-template name="makeDescription" />
+				<xsl:for-each select="tei:constraint">
+					<xsl:element namespace="{$outputNS}" name="{$divName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>pre</xsl:text>
             </xsl:attribute>
-            <xsl:apply-templates mode="verbatim"/>
-          </xsl:element>
-        </xsl:for-each>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <xsl:template name="showClassAtts">
-    <xsl:for-each select="tei:classes/tei:memberOf">
-      <xsl:for-each select="key('IDENTS',@key)">
-        <xsl:if test="tei:attList">
-          <rng:ref name="{@ident}.attributes"/>
-        </xsl:if>
-        <xsl:call-template name="showClassAtts"/>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process the specification elements elements, classes and macros<param name="atts">attributes we have been asked to display</param>
-      </desc>
-  </doc>
-  <xsl:template match="tei:elementSpec|tei:classSpec|tei:macroSpec" mode="show">
-    <xsl:param name="atts"/>
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="tei:altIdent">
-          <xsl:value-of select="tei:altIdent"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element namespace="{$outputNS}" name="{$hiName}">
-      <xsl:attribute name="{$rendName}">
+						<xsl:apply-templates mode="verbatim" />
+					</xsl:element>
+				</xsl:for-each>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<xsl:template name="showClassAtts">
+		<xsl:for-each select="tei:classes/tei:memberOf">
+			<xsl:for-each select="key('IDENTS',@key)">
+				<xsl:if test="tei:attList">
+					<rng:ref name="{@ident}.attributes" />
+				</xsl:if>
+				<xsl:call-template name="showClassAtts" />
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Process the specification elements elements, classes and macros
+			<param name="atts">attributes we have been asked to display</param>
+		</desc>
+	</doc>
+	<xsl:template
+		match="tei:elementSpec|tei:classSpec|tei:macroSpec" mode="show">
+		<xsl:param name="atts" />
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element namespace="{$outputNS}" name="{$hiName}">
+			<xsl:attribute name="{$rendName}">
         <xsl:text>specList-</xsl:text>
-        <xsl:value-of select="local-name(.)"/>
+        <xsl:value-of select="local-name(.)" />
       </xsl:attribute>
-      <xsl:element namespace="{$outputNS}" name="{$xrefName}">
-        <xsl:attribute name="{$urlName}">
+			<xsl:element namespace="{$outputNS}" name="{$xrefName}">
+				<xsl:attribute name="{$urlName}">
           <xsl:choose>
             <xsl:when test="number($splitLevel)=-1">
               <xsl:text>#</xsl:text>
-              <xsl:value-of select="$idPrefix"/>
-              <xsl:value-of select="$name"/>
+              <xsl:value-of select="$idPrefix" />
+              <xsl:value-of select="$name" />
             </xsl:when>
             <xsl:when test="$STDOUT='true'">
               <xsl:for-each select="key('IDENTS',$name)">
                 <xsl:call-template name="getSpecURL">
                   <xsl:with-param name="name">
-                    <xsl:value-of select="$name"/>
+                    <xsl:value-of select="$name" />
                   </xsl:with-param>
                   <xsl:with-param name="type">
-                    <xsl:value-of select="substring-before(local-name(),'Spec')"/>
+                    <xsl:value-of
+					select="substring-before(local-name(),'Spec')" />
                   </xsl:with-param>
                 </xsl:call-template>
               </xsl:for-each>
             </xsl:when>
             <xsl:otherwise>
               <xsl:text>ref-</xsl:text>
-              <xsl:value-of select="$name"/>
+              <xsl:value-of select="$name" />
               <xsl:text>.html</xsl:text>
             </xsl:otherwise>
           </xsl:choose>
         </xsl:attribute>
-        <xsl:value-of select="$name"/>
-        <xsl:for-each select="key('IDENTS',$name)">
-          <xsl:if test="tei:content/rng:empty">
-            <xsl:text>/</xsl:text>
-          </xsl:if>
-        </xsl:for-each>
-      </xsl:element>
-    </xsl:element>
-    <xsl:call-template name="showSpace"/>
-    <xsl:call-template name="makeDescription">
-      <xsl:with-param name="showListRef">false</xsl:with-param>
-    </xsl:call-template>
-    <xsl:choose>
-      <xsl:when test="$atts='-'"/>
-      <xsl:when test="$atts='+'">
-        <xsl:call-template name="showAttClasses">
-          <xsl:with-param name="minimal">true</xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$atts=''"/>
-      <xsl:when test="string-length($atts)&gt;0">
-        <xsl:element namespace="{$outputNS}" name="{$tableName}">
-          <xsl:attribute name="{$rendName}">
+				<xsl:value-of select="$name" />
+				<xsl:for-each select="key('IDENTS',$name)">
+					<xsl:if test="tei:content/rng:empty">
+						<xsl:text>/</xsl:text>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:element>
+		</xsl:element>
+		<xsl:call-template name="showSpace" />
+		<xsl:call-template name="makeDescription">
+			<xsl:with-param name="showListRef">
+				false
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:choose>
+			<xsl:when test="$atts='-'" />
+			<xsl:when test="$atts='+'">
+				<xsl:call-template name="showAttClasses">
+					<xsl:with-param name="minimal">
+						true
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$atts=''" />
+			<xsl:when test="string-length($atts)&gt;0">
+				<xsl:element namespace="{$outputNS}" name="{$tableName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>specDesc</xsl:text>
           </xsl:attribute>
-          <xsl:variable name="HERE" select="."/>
-          <xsl:for-each select="tokenize($atts,' ')">
-            <xsl:call-template name="doAnAttToken">
-              <xsl:with-param name="HERE" select="$HERE"/>
-              <xsl:with-param name="TOKEN" select="."/>
-            </xsl:call-template>
-          </xsl:for-each>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:if test="tei:attList//tei:attDef">
-          <xsl:element namespace="{$outputNS}" name="{$tableName}">
-            <xsl:attribute name="{$rendName}">
+					<xsl:variable name="HERE" select="." />
+					<xsl:for-each select="tokenize($atts,' ')">
+						<xsl:call-template name="doAnAttToken">
+							<xsl:with-param name="HERE" select="$HERE" />
+							<xsl:with-param name="TOKEN" select="." />
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="tei:attList//tei:attDef">
+					<xsl:element namespace="{$outputNS}"
+						name="{$tableName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>attList</xsl:text>
             </xsl:attribute>
-            <xsl:apply-templates mode="summary" select="tei:attList//tei:attDef"/>
-          </xsl:element>
-        </xsl:if>
-        <xsl:call-template name="showAttClasses">
-          <xsl:with-param name="minimal">true</xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Show a selected attribute<param name="HERE">the starting node </param>
-         <param name="TOKEN">attribute we have been asked to display</param>
-      </desc>
-  </doc>
-  <xsl:template name="doAnAttToken">
-    <xsl:param name="HERE"/>
-    <xsl:param name="TOKEN"/>
-    <xsl:choose>
-      <xsl:when test="$HERE/tei:attList//tei:attDef[@ident=$TOKEN]">
-        <xsl:for-each select="$HERE/tei:attList//tei:attDef[@ident=$TOKEN]">
-          <xsl:call-template name="showAnAttribute"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:for-each select="$HERE/tei:classes/tei:memberOf">
-          <xsl:for-each select="key('IDENTS',@key)/tei:attList//tei:attDef[@ident=$TOKEN]">
-            <xsl:call-template name="showAnAttribute"/>
-          </xsl:for-each>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Display of an attribute</desc>
-  </doc>
-  <xsl:template name="showAnAttribute">
-    <xsl:element namespace="{$outputNS}" name="{$rowName}">
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+						<xsl:apply-templates mode="summary"
+							select="tei:attList//tei:attDef" />
+					</xsl:element>
+				</xsl:if>
+				<xsl:call-template name="showAttClasses">
+					<xsl:with-param name="minimal">
+						true
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Show a selected attribute
+			<param name="HERE">the starting node </param>
+			<param name="TOKEN">attribute we have been asked to display</param>
+		</desc>
+	</doc>
+	<xsl:template name="doAnAttToken">
+		<xsl:param name="HERE" />
+		<xsl:param name="TOKEN" />
+		<xsl:choose>
+			<xsl:when
+				test="$HERE/tei:attList//tei:attDef[@ident=$TOKEN]">
+				<xsl:for-each
+					select="$HERE/tei:attList//tei:attDef[@ident=$TOKEN]">
+					<xsl:call-template name="showAnAttribute" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="$HERE/tei:classes/tei:memberOf">
+					<xsl:for-each
+						select="key('IDENTS',@key)/tei:attList//tei:attDef[@ident=$TOKEN]">
+						<xsl:call-template name="showAnAttribute" />
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Display of an attribute</desc>
+	</doc>
+	<xsl:template name="showAnAttribute">
+		<xsl:element namespace="{$outputNS}" name="{$rowName}">
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>Attribute</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$hiName}">
-          <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$hiName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>att</xsl:text>
           </xsl:attribute>
-          <xsl:choose>
-            <xsl:when test="tei:altIdent">
-              <xsl:value-of select="tei:altIdent"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@ident"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:element>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:call-template name="makeDescription"/>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element exemplum</desc>
-  </doc>
-  <xsl:template match="tei:exemplum" mode="doc">
-    <xsl:variable name="documentationLanguage">
-      <xsl:call-template name="generateDoc"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="parent::tei:exemplum">
-        <xsl:call-template name="showExample"/>
-      </xsl:when>
-      <xsl:when test="not(@xml:lang)">
-        <xsl:call-template name="showExample"/>
-      </xsl:when>
-      <xsl:when test="@xml:lang='und'">
-        <xsl:call-template name="showExample"/>
-      </xsl:when>
-      <xsl:when test="@xml:lang='mul' and not($documentationLanguage='zh-TW')">
-        <!-- will need to generalize this if other langs come along like
-		chinese -->
-        <xsl:call-template name="showExample"/>
-      </xsl:when>
-      <xsl:when test="@xml:lang=$documentationLanguage">
-        <xsl:call-template name="showExample"/>
-      </xsl:when>
-      <xsl:when test="not(../tei:exemplum[@xml:lang=$documentationLanguage])                    and (@xml:lang='en'      or @xml:lang='und'      or @xml:lang='mul')">
-        <xsl:call-template name="showExample"/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process an example</desc>
-  </doc>
-  <xsl:template name="showExample">
-    <xsl:choose>
-      <xsl:when test="parent::tei:attDef">
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$colspan}">
+					<xsl:choose>
+						<xsl:when test="tei:altIdent">
+							<xsl:value-of select="tei:altIdent" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@ident" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:element>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:call-template name="makeDescription" />
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element exemplum</desc>
+	</doc>
+	<xsl:template match="tei:exemplum" mode="doc">
+		<xsl:variable name="documentationLanguage">
+			<xsl:call-template name="generateDoc" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="parent::tei:exemplum">
+				<xsl:call-template name="showExample" />
+			</xsl:when>
+			<xsl:when test="not(@xml:lang)">
+				<xsl:call-template name="showExample" />
+			</xsl:when>
+			<xsl:when test="@xml:lang='und'">
+				<xsl:call-template name="showExample" />
+			</xsl:when>
+			<xsl:when
+				test="@xml:lang='mul' and not($documentationLanguage='zh-TW')">
+				<!-- will need to generalize this if other langs come along like chinese -->
+				<xsl:call-template name="showExample" />
+			</xsl:when>
+			<xsl:when test="@xml:lang=$documentationLanguage">
+				<xsl:call-template name="showExample" />
+			</xsl:when>
+			<xsl:when
+				test="not(../tei:exemplum[@xml:lang=$documentationLanguage])                    and (@xml:lang='en'      or @xml:lang='und'      or @xml:lang='mul')">
+				<xsl:call-template name="showExample" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process an example</desc>
+	</doc>
+	<xsl:template name="showExample">
+		<xsl:choose>
+			<xsl:when test="parent::tei:attDef">
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$colspan}">
               <xsl:text>2</xsl:text>
             </xsl:attribute>
-            <xsl:apply-templates/>
-          </xsl:element>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+						<xsl:apply-templates />
+					</xsl:element>
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col1</xsl:text>
             </xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:attribute name="xml:lang">
-                <xsl:value-of select="$documentationLanguage"/>
+							<xsl:attribute name="xml:lang">
+                <xsl:value-of
+								select="$documentationLanguage" />
               </xsl:attribute>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Example</xsl:with-param>
-              </xsl:call-template>
-            </xsl:element>
-          </xsl:element>
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Example
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>
+					</xsl:element>
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>wovenodd-col2</xsl:text>
             </xsl:attribute>
-            <xsl:apply-templates/>
-          </xsl:element>
-        </xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element item</desc>
-  </doc>
-  <xsl:template match="tei:item">
-    <xsl:choose>
-      <xsl:when test="parent::tei:list[@type='gloss'] or preceding-sibling::tei:label">
-        <xsl:element namespace="{$outputNS}" name="{$ddName}">
-          <xsl:apply-templates/>
-        </xsl:element>
-      </xsl:when>
-      <xsl:when test="parent::tei:list[@type='elementlist']">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:element namespace="{$outputNS}" name="{$itemName}">
-          <xsl:apply-templates/>
-        </xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element macroSpec</desc>
-  </doc>
-  <xsl:template match="tei:macroSpec">
-    <xsl:if test="parent::tei:specGrp">
-      <xsl:element namespace="{$outputNS}" name="{$dtName}">
-        <xsl:value-of select="@ident"/>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$ddName}">
-        <xsl:apply-templates mode="tangle" select="."/>
-      </xsl:element>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element macroSpec in weavebody mode</desc>
-  </doc>
-  <xsl:template match="tei:macroSpec" mode="weavebody">
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="tei:altIdent">
-          <xsl:value-of select="tei:altIdent"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:element namespace="{$outputNS}" name="{$sectionName}">
-      <xsl:call-template name="makeSectionHead">
-        <xsl:with-param name="id">
-          <xsl:value-of select="@ident"/>
-        </xsl:with-param>
-        <xsl:with-param name="name">
-          <xsl:value-of select="$name"/>
-        </xsl:with-param>
-      </xsl:call-template>
-      <xsl:call-template name="specHook">
-        <xsl:with-param name="name">
-          <xsl:value-of select="$name"/>
-        </xsl:with-param>
-      </xsl:call-template>
-      <xsl:element namespace="{$outputNS}" name="{$tableName}">
-        <xsl:attribute name="{$rendName}">
+						<xsl:apply-templates />
+					</xsl:element>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item</desc>
+	</doc>
+	<xsl:template match="tei:item">
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:list[@type='gloss'] or preceding-sibling::tei:label">
+				<xsl:element namespace="{$outputNS}" name="{$ddName}">
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="parent::tei:list[@type='elementlist']">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element namespace="{$outputNS}" name="{$itemName}">
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element macroSpec</desc>
+	</doc>
+	<xsl:template match="tei:macroSpec">
+		<xsl:if test="parent::tei:specGrp">
+			<xsl:element namespace="{$outputNS}" name="{$dtName}">
+				<xsl:value-of select="@ident" />
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$ddName}">
+				<xsl:apply-templates mode="tangle" select="." />
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element macroSpec in weavebody mode</desc>
+	</doc>
+	<xsl:template match="tei:macroSpec" mode="weavebody">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element namespace="{$outputNS}" name="{$sectionName}">
+			<xsl:call-template name="makeSectionHead">
+				<xsl:with-param name="id">
+					<xsl:value-of select="@ident" />
+				</xsl:with-param>
+				<xsl:with-param name="name">
+					<xsl:value-of select="$name" />
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:call-template name="specHook">
+				<xsl:with-param name="name">
+					<xsl:value-of select="$name" />
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:element namespace="{$outputNS}" name="{$tableName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$colspan}">2</xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$colspan}">2</xsl:attribute>
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:value-of select="$name"/>
-            </xsl:element>
-            <xsl:text>&#160;</xsl:text>
-            <xsl:call-template name="makeDescription"/>
-          </xsl:element>
-        </xsl:element>
-        <xsl:if test="@module">
-          <xsl:call-template name="moduleInfo"/>
-        </xsl:if>
-        <xsl:choose>
-          <xsl:when test="@type='pe' or @type='dt'">
-            <xsl:element namespace="{$outputNS}" name="{$rowName}">
-              <xsl:element namespace="{$outputNS}" name="{$cellName}">
-                <xsl:attribute name="{$rendName}">
+							<xsl:value-of select="$name" />
+						</xsl:element>
+						<xsl:text>&#160;</xsl:text>
+						<xsl:call-template name="makeDescription" />
+					</xsl:element>
+				</xsl:element>
+				<xsl:if test="@module">
+					<xsl:call-template name="moduleInfo" />
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="@type='pe' or @type='dt'">
+						<xsl:element namespace="{$outputNS}" name="{$rowName}">
+							<xsl:element namespace="{$outputNS}"
+								name="{$cellName}">
+								<xsl:attribute name="{$rendName}">
                   <xsl:text>wovenodd-col1</xsl:text>
                 </xsl:attribute>
-                <xsl:element namespace="{$outputNS}" name="{$hiName}">
-                  <xsl:attribute name="{$rendName}">
+								<xsl:element namespace="{$outputNS}"
+									name="{$hiName}">
+									<xsl:attribute name="{$rendName}">
                     <xsl:text>label</xsl:text>
                   </xsl:attribute>
-                  <xsl:attribute name="xml:lang">
-                    <xsl:value-of select="$documentationLanguage"/>
+									<xsl:attribute name="xml:lang">
+                    <xsl:value-of
+										select="$documentationLanguage" />
                   </xsl:attribute>
-                  <xsl:call-template name="i18n">
-                    <xsl:with-param name="word">Used by</xsl:with-param>
-                  </xsl:call-template>
-                </xsl:element>
-              </xsl:element>
-              <xsl:element namespace="{$outputNS}" name="{$cellName}">
-                <xsl:attribute name="{$rendName}">
+									<xsl:call-template name="i18n">
+										<xsl:with-param name="word">
+											Used by
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:element>
+							</xsl:element>
+							<xsl:element namespace="{$outputNS}"
+								name="{$cellName}">
+								<xsl:attribute name="{$rendName}">
                   <xsl:text>wovenodd-col2</xsl:text>
                 </xsl:attribute>
-                <xsl:call-template name="generateModelParents">
-                  <xsl:with-param name="showElements">true</xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-            </xsl:element>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:apply-templates mode="weave"/>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element macroSpec/tei:content</desc>
-  </doc>
-  <xsl:template match="tei:macroSpec/tei:content" mode="weave">
-    <xsl:element namespace="{$outputNS}" name="{$rowName}">
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+								<xsl:call-template name="generateModelParents">
+									<xsl:with-param name="showElements">
+										true
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+						</xsl:element>
+					</xsl:when>
+				</xsl:choose>
+				<xsl:apply-templates mode="weave" />
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element macroSpec/tei:content</desc>
+	</doc>
+	<xsl:template match="tei:macroSpec/tei:content"
+		mode="weave">
+		<xsl:element namespace="{$outputNS}" name="{$rowName}">
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd-col1</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$hiName}">
-          <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$hiName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>label</xsl:text>
           </xsl:attribute>
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Declaration</xsl:with-param>
-          </xsl:call-template>
-        </xsl:element>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Declaration
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>wovenodd-col2</xsl:text>
         </xsl:attribute>
-        <xsl:call-template name="bitOut">
-          <xsl:with-param name="grammar">true</xsl:with-param>
-          <xsl:with-param name="content">
-            <Wrapper>
-              <xsl:variable name="entCont">
-                <Stuff>
-                  <xsl:apply-templates select="rng:*"/>
-                </Stuff>
-              </xsl:variable>
-              <xsl:variable name="entCount">
-                <xsl:for-each select="$entCont/html:Stuff">
-                  <xsl:value-of select="count(*)"/>
-                </xsl:for-each>
-              </xsl:variable>
-              <xsl:choose>
-                <xsl:when test=".=&quot;TEI.singleBase&quot;"/>
-                <xsl:otherwise>
-                  <rng:define name="{../@ident}">
-                    <xsl:if test="starts-with(.,'component')">
-                      <xsl:attribute name="combine">choice</xsl:attribute>
-                    </xsl:if>
-                    <xsl:copy-of select="rng:*"/>
-                  </rng:define>
-                </xsl:otherwise>
-              </xsl:choose>
-            </Wrapper>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element moduleSpec</desc>
-  </doc>
-  <xsl:template match="tei:moduleSpec">
-    <xsl:element namespace="{$outputNS}" name="{$dlName}">
-      <xsl:attribute name="{$rendName}">
+				<xsl:call-template name="bitOut">
+					<xsl:with-param name="grammar">
+						true
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<Wrapper>
+							<xsl:variable name="entCont">
+								<Stuff>
+									<xsl:apply-templates select="rng:*" />
+								</Stuff>
+							</xsl:variable>
+							<xsl:variable name="entCount">
+								<xsl:for-each select="$entCont/html:Stuff">
+									<xsl:value-of select="count(*)" />
+								</xsl:for-each>
+							</xsl:variable>
+							<xsl:choose>
+								<xsl:when test=".=&quot;TEI.singleBase&quot;" />
+								<xsl:otherwise>
+									<rng:define name="{../@ident}">
+										<xsl:if test="starts-with(.,'component')">
+											<xsl:attribute name="combine">choice</xsl:attribute>
+										</xsl:if>
+										<xsl:copy-of select="rng:*" />
+									</rng:define>
+								</xsl:otherwise>
+							</xsl:choose>
+						</Wrapper>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element moduleSpec</desc>
+	</doc>
+	<xsl:template match="tei:moduleSpec">
+		<xsl:element namespace="{$outputNS}" name="{$dlName}">
+			<xsl:attribute name="{$rendName}">
         <xsl:text>moduleSpec</xsl:text>
       </xsl:attribute>
-      <xsl:element namespace="{$outputNS}" name="{$labelName}">
-        <xsl:attribute name="{$rendName}">
+			<xsl:element namespace="{$outputNS}" name="{$labelName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>moduleSpecHead</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$segName}">
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+				<xsl:element namespace="{$outputNS}" name="{$segName}">
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Module</xsl:with-param>
-          </xsl:call-template>
-        </xsl:element>
-        <xsl:value-of select="$spaceCharacter"/>
-        <xsl:value-of select="@ident"/>
-        <xsl:text>: </xsl:text>
-        <xsl:call-template name="makeDescription"/>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$ddName}">
-        <xsl:element namespace="{$outputNS}" name="{$ulName}">
-          <xsl:if test="key('ElementModule',@ident)">
-            <xsl:element namespace="{$outputNS}" name="{$itemName}">
-              <xsl:element namespace="{$outputNS}" name="{$hiName}">
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Module
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+				<xsl:value-of select="$spaceCharacter" />
+				<xsl:value-of select="@ident" />
+				<xsl:text>: </xsl:text>
+				<xsl:call-template name="makeDescription" />
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$ddName}">
+				<xsl:element namespace="{$outputNS}" name="{$ulName}">
+					<xsl:if test="key('ElementModule',@ident)">
+						<xsl:element namespace="{$outputNS}"
+							name="{$itemName}">
+							<xsl:element namespace="{$outputNS}" name="{$hiName}">
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Elements defined</xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-              <xsl:text>: </xsl:text>
-              <xsl:variable name="list">
-                <List>
-                  <xsl:for-each select="key('ElementModule',@ident)">
-                    <xsl:sort select="@ident"/>
-                    <Item>
-                      <xsl:call-template name="linkTogether">
-                        <xsl:with-param name="name" select="@ident"/>
-			<xsl:with-param name="reftext">
-			  <xsl:choose>
-			    <xsl:when test="tei:altIdent">
-			      <xsl:value-of select="tei:altIdent"/>
-			    </xsl:when>
-			    <xsl:otherwise>
-			      <xsl:value-of select="@ident"/>
-			    </xsl:otherwise>
-			  </xsl:choose>
-			</xsl:with-param>
-                      </xsl:call-template>
-                    </Item>
-                  </xsl:for-each>
-                </List>
-              </xsl:variable>
-              <xsl:for-each select="$list/List/Item">
-                <xsl:copy-of select="*|text()"/>
-                <xsl:if test="following-sibling::Item">
-                  <xsl:call-template name="showSpaceBetweenItems"/>
-                </xsl:if>
-              </xsl:for-each>
-            </xsl:element>
-          </xsl:if>
-          <xsl:if test="key('ClassModule',@ident)">
-            <xsl:element namespace="{$outputNS}" name="{$itemName}">
-              <xsl:element namespace="{$outputNS}" name="{$hiName}">
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Elements defined
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+							<xsl:text>: </xsl:text>
+							<xsl:variable name="list">
+								<List>
+									<xsl:for-each select="key('ElementModule',@ident)">
+										<xsl:sort select="@ident" />
+										<Item>
+											<xsl:call-template name="linkTogether">
+												<xsl:with-param name="name" select="@ident" />
+												<xsl:with-param name="reftext">
+													<xsl:choose>
+														<xsl:when test="tei:altIdent">
+															<xsl:value-of select="tei:altIdent" />
+														</xsl:when>
+														<xsl:otherwise>
+															<xsl:value-of select="@ident" />
+														</xsl:otherwise>
+													</xsl:choose>
+												</xsl:with-param>
+											</xsl:call-template>
+										</Item>
+									</xsl:for-each>
+								</List>
+							</xsl:variable>
+							<xsl:for-each select="$list/List/Item">
+								<xsl:copy-of select="*|text()" />
+								<xsl:if test="following-sibling::Item">
+									<xsl:call-template
+										name="showSpaceBetweenItems" />
+								</xsl:if>
+							</xsl:for-each>
+						</xsl:element>
+					</xsl:if>
+					<xsl:if test="key('ClassModule',@ident)">
+						<xsl:element namespace="{$outputNS}"
+							name="{$itemName}">
+							<xsl:element namespace="{$outputNS}" name="{$hiName}">
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Classes defined</xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-              <xsl:text>: </xsl:text>
-              <xsl:variable name="list">
-                <List>
-                  <xsl:for-each select="key('ClassModule',@ident)">
-                    <xsl:sort select="@ident"/>
-                    <Item>
-                      <xsl:call-template name="linkTogether">
-                        <xsl:with-param name="name" select="@ident"/>
-			<xsl:with-param name="reftext">
-			  <xsl:choose>
-			    <xsl:when test="tei:altIdent">
-			      <xsl:value-of select="tei:altIdent"/>
-			    </xsl:when>
-			    <xsl:otherwise>
-			      <xsl:value-of select="@ident"/>
-			    </xsl:otherwise>
-			  </xsl:choose>
-			</xsl:with-param>
-                      </xsl:call-template>
-                    </Item>
-                  </xsl:for-each>
-                </List>
-              </xsl:variable>
-              <xsl:for-each select="$list/List/Item">
-                <xsl:copy-of select="*|text()"/>
-                <xsl:if test="following-sibling::Item">
-                  <xsl:call-template name="showSpaceBetweenItems"/>
-                </xsl:if>
-              </xsl:for-each>
-            </xsl:element>
-          </xsl:if>
-          <xsl:if test="key('MacroModule',@ident)">
-            <xsl:element namespace="{$outputNS}" name="{$itemName}">
-              <xsl:element namespace="{$outputNS}" name="{$segName}">
-                <xsl:attribute name="xml:lang">
-                  <xsl:value-of select="$documentationLanguage"/>
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Classes defined
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+							<xsl:text>: </xsl:text>
+							<xsl:variable name="list">
+								<List>
+									<xsl:for-each select="key('ClassModule',@ident)">
+										<xsl:sort select="@ident" />
+										<Item>
+											<xsl:call-template name="linkTogether">
+												<xsl:with-param name="name" select="@ident" />
+												<xsl:with-param name="reftext">
+													<xsl:choose>
+														<xsl:when test="tei:altIdent">
+															<xsl:value-of select="tei:altIdent" />
+														</xsl:when>
+														<xsl:otherwise>
+															<xsl:value-of select="@ident" />
+														</xsl:otherwise>
+													</xsl:choose>
+												</xsl:with-param>
+											</xsl:call-template>
+										</Item>
+									</xsl:for-each>
+								</List>
+							</xsl:variable>
+							<xsl:for-each select="$list/List/Item">
+								<xsl:copy-of select="*|text()" />
+								<xsl:if test="following-sibling::Item">
+									<xsl:call-template
+										name="showSpaceBetweenItems" />
+								</xsl:if>
+							</xsl:for-each>
+						</xsl:element>
+					</xsl:if>
+					<xsl:if test="key('MacroModule',@ident)">
+						<xsl:element namespace="{$outputNS}"
+							name="{$itemName}">
+							<xsl:element namespace="{$outputNS}"
+								name="{$segName}">
+								<xsl:attribute name="xml:lang">
+                  <xsl:value-of
+									select="$documentationLanguage" />
                 </xsl:attribute>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Macros defined</xsl:with-param>
-                </xsl:call-template>
-              </xsl:element>
-              <xsl:text>: </xsl:text>
-              <xsl:variable name="list">
-                <List>
-                  <xsl:for-each select="key('MacroModule',@ident)">
-                    <xsl:sort select="@ident"/>
-                    <Item>
-                      <xsl:call-template name="linkTogether">
-                        <xsl:with-param name="name" select="@ident"/>
-			<xsl:with-param name="reftext">
-			  <xsl:choose>
-			    <xsl:when test="tei:altIdent">
-			      <xsl:value-of select="tei:altIdent"/>
-			    </xsl:when>
-			    <xsl:otherwise>
-			      <xsl:value-of select="@ident"/>
-			    </xsl:otherwise>
-			  </xsl:choose>
-			</xsl:with-param>
-                      </xsl:call-template>
-                    </Item>
-                  </xsl:for-each>
-                </List>
-              </xsl:variable>
-              <xsl:for-each select="$list/List/Item">
-                <xsl:copy-of select="*|text()"/>
-                <xsl:if test="following-sibling::Item">
-                  <xsl:call-template name="showSpaceBetweenItems"/>
-                </xsl:if>
-              </xsl:for-each>
-            </xsl:element>
-          </xsl:if>
-        </xsl:element>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process tei:remarks</desc>
-  </doc>
-  <xsl:template match="tei:remarks" mode="doc">
-    <xsl:if test="string-length(.)&gt;0">
-      <xsl:element namespace="{$outputNS}" name="{$rowName}">
-        <xsl:element namespace="{$outputNS}" name="{$cellName}">
-          <xsl:attribute name="{$rendName}">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Macros defined
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:element>
+							<xsl:text>: </xsl:text>
+							<xsl:variable name="list">
+								<List>
+									<xsl:for-each select="key('MacroModule',@ident)">
+										<xsl:sort select="@ident" />
+										<Item>
+											<xsl:call-template name="linkTogether">
+												<xsl:with-param name="name" select="@ident" />
+												<xsl:with-param name="reftext">
+													<xsl:choose>
+														<xsl:when test="tei:altIdent">
+															<xsl:value-of select="tei:altIdent" />
+														</xsl:when>
+														<xsl:otherwise>
+															<xsl:value-of select="@ident" />
+														</xsl:otherwise>
+													</xsl:choose>
+												</xsl:with-param>
+											</xsl:call-template>
+										</Item>
+									</xsl:for-each>
+								</List>
+							</xsl:variable>
+							<xsl:for-each select="$list/List/Item">
+								<xsl:copy-of select="*|text()" />
+								<xsl:if test="following-sibling::Item">
+									<xsl:call-template
+										name="showSpaceBetweenItems" />
+								</xsl:if>
+							</xsl:for-each>
+						</xsl:element>
+					</xsl:if>
+				</xsl:element>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process tei:remarks</desc>
+	</doc>
+	<xsl:template match="tei:remarks" mode="doc">
+		<xsl:if test="string-length(.)&gt;0">
+			<xsl:element namespace="{$outputNS}" name="{$rowName}">
+				<xsl:element namespace="{$outputNS}" name="{$cellName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>wovenodd-col1</xsl:text>
           </xsl:attribute>
-          <xsl:element namespace="{$outputNS}" name="{$hiName}">
-            <xsl:attribute name="{$rendName}">
+					<xsl:element namespace="{$outputNS}" name="{$hiName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>label</xsl:text>
             </xsl:attribute>
-            <xsl:attribute name="xml:lang">
-              <xsl:value-of select="$documentationLanguage"/>
+						<xsl:attribute name="xml:lang">
+              <xsl:value-of
+							select="$documentationLanguage" />
             </xsl:attribute>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">Note</xsl:with-param>
-            </xsl:call-template>
-          </xsl:element>
-        </xsl:element>
-        <xsl:element namespace="{$outputNS}" name="{$cellName}">
-          <xsl:attribute name="{$rendName}">
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								Note
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:element>
+				</xsl:element>
+				<xsl:element namespace="{$outputNS}" name="{$cellName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>wovenodd-col2</xsl:text>
           </xsl:attribute>
-          <xsl:comment>&#160;</xsl:comment>
-          <xsl:apply-templates/>
-        </xsl:element>
-      </xsl:element>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process a specDesc</desc>
-  </doc>
-  <xsl:template match="tei:specDesc">
-    <xsl:element namespace="{$outputNS}" name="{$itemName}">
-      <xsl:call-template name="processSpecDesc"/>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process a specGrp</desc>
-  </doc>
-  <xsl:template match="tei:specGrp"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process  a specGrpRef</desc>
-  </doc>
-  <xsl:template match="tei:specGrpRef"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process a specList</desc>
-  </doc>
-  <xsl:template match="tei:specList">
-    <xsl:element namespace="{$outputNS}" name="{$ulName}">
-      <xsl:attribute name="{$rendName}">specList</xsl:attribute>
-      <xsl:apply-templates/>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process a valDesc</desc>
-  </doc>
-  <xsl:template match="tei:valDesc" mode="weave">
-    <xsl:variable name="documentationLanguage">
-      <xsl:call-template name="generateDoc"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="@xml:lang and         not(@xml:lang=$documentationLanguage)">
-      </xsl:when>
-      <xsl:when test="not(@xml:lang) and         not($documentationLanguage='en')          and         ../tei:valDesc[@xml:lang=$documentationLanguage]">
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:element namespace="{$outputNS}" name="{$rowName}">
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+					<xsl:comment>
+						&#160;
+					</xsl:comment>
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process a specDesc</desc>
+	</doc>
+	<xsl:template match="tei:specDesc">
+		<xsl:element namespace="{$outputNS}" name="{$itemName}">
+			<xsl:call-template name="processSpecDesc" />
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process a specGrp</desc>
+	</doc>
+	<xsl:template match="tei:specGrp" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process a specGrpRef</desc>
+	</doc>
+	<xsl:template match="tei:specGrpRef" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process a specList</desc>
+	</doc>
+	<xsl:template match="tei:specList">
+		<xsl:element namespace="{$outputNS}" name="{$ulName}">
+			<xsl:attribute name="{$rendName}">specList</xsl:attribute>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process a valDesc</desc>
+	</doc>
+	<xsl:template match="tei:valDesc" mode="weave">
+		<xsl:variable name="documentationLanguage">
+			<xsl:call-template name="generateDoc" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="@xml:lang and         not(@xml:lang=$documentationLanguage)">
+			</xsl:when>
+			<xsl:when
+				test="not(@xml:lang) and         not($documentationLanguage='en')          and         ../tei:valDesc[@xml:lang=$documentationLanguage]">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element namespace="{$outputNS}" name="{$rowName}">
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>odd_label</xsl:text>
             </xsl:attribute>
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>label</xsl:text>
               </xsl:attribute>
-              <xsl:attribute name="xml:lang">
-                <xsl:value-of select="$documentationLanguage"/>
+							<xsl:attribute name="xml:lang">
+                <xsl:value-of
+								select="$documentationLanguage" />
               </xsl:attribute>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Values</xsl:with-param>
-              </xsl:call-template>
-            </xsl:element>
-            <xsl:text> </xsl:text>
-          </xsl:element>
-          <xsl:element namespace="{$outputNS}" name="{$cellName}">
-            <xsl:attribute name="{$rendName}">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Values
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>
+						<xsl:text> </xsl:text>
+					</xsl:element>
+					<xsl:element namespace="{$outputNS}" name="{$cellName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>attribute</xsl:text>
             </xsl:attribute>
-            <xsl:apply-templates/>
-          </xsl:element>
-        </xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element val</desc>
-  </doc>
-  <xsl:template match="tei:val">
-    <xsl:element namespace="{$outputNS}" name="{$hiName}">
-      <xsl:attribute name="{$rendName}">
+						<xsl:apply-templates />
+					</xsl:element>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element val</desc>
+	</doc>
+	<xsl:template match="tei:val">
+		<xsl:element namespace="{$outputNS}" name="{$hiName}">
+			<xsl:attribute name="{$rendName}">
         <xsl:text>val</xsl:text>
       </xsl:attribute>
-      <xsl:apply-templates/>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element att</desc>
-  </doc>
-  <xsl:template match="tei:att">
-    <xsl:element namespace="{$outputNS}" name="{$hiName}">
-      <xsl:attribute name="{$rendName}">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element att</desc>
+	</doc>
+	<xsl:template match="tei:att">
+		<xsl:element namespace="{$outputNS}" name="{$hiName}">
+			<xsl:attribute name="{$rendName}">
         <xsl:text>att</xsl:text>
       </xsl:attribute>
-      <xsl:apply-templates/>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element tag</desc>
-  </doc>
-  <xsl:template match="tei:tag">
-    <xsl:element namespace="{$outputNS}" name="{$hiName}">
-      <xsl:attribute name="{$rendName}">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element tag</desc>
+	</doc>
+	<xsl:template match="tei:tag">
+		<xsl:element namespace="{$outputNS}" name="{$hiName}">
+			<xsl:attribute name="{$rendName}">
         <xsl:text>tag</xsl:text>
       </xsl:attribute>
-      <xsl:text>&lt;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>&gt;</xsl:text>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element valList</desc>
-  </doc>
-  <xsl:template match="tei:valList" mode="contents">
-    <xsl:element namespace="{$outputNS}" name="{$rowName}">
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+			<xsl:text>&lt;</xsl:text>
+			<xsl:apply-templates />
+			<xsl:text>&gt;</xsl:text>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element valList</desc>
+	</doc>
+	<xsl:template match="tei:valList" mode="contents">
+		<xsl:element namespace="{$outputNS}" name="{$rowName}">
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>odd_label</xsl:text>
         </xsl:attribute>
-        <xsl:element namespace="{$outputNS}" name="{$hiName}">
-          <xsl:attribute name="{$rendName}">
+				<xsl:element namespace="{$outputNS}" name="{$hiName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>label</xsl:text>
           </xsl:attribute>
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:choose>
-            <xsl:when test="@type='semi'">
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Suggested values include</xsl:with-param>
-              </xsl:call-template>
-              <xsl:text>:</xsl:text>
-            </xsl:when>
-            <xsl:when test="@type='open'">
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Sample values include</xsl:with-param>
-              </xsl:call-template>
-              <xsl:text>:</xsl:text>
-            </xsl:when>
-            <xsl:when test="@type='closed'">
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Legal values are</xsl:with-param>
-              </xsl:call-template>
-              <xsl:text>:</xsl:text>
-            </xsl:when>
-            <xsl:otherwise>Sample values include</xsl:otherwise>
-          </xsl:choose>
-        </xsl:element>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$cellName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:choose>
+						<xsl:when test="@type='semi'">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Suggested values include
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:text>:</xsl:text>
+						</xsl:when>
+						<xsl:when test="@type='open'">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Sample values include
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:text>:</xsl:text>
+						</xsl:when>
+						<xsl:when test="@type='closed'">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Legal values are
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:text>:</xsl:text>
+						</xsl:when>
+						<xsl:otherwise>
+							Sample values include
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:element>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$cellName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>odd_value</xsl:text>
         </xsl:attribute>
-        <xsl:call-template name="valListChildren"/>
-      </xsl:element>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[odds] all the values in a valList</desc>
-  </doc>
-  <xsl:template name="valListChildren">
-    <xsl:element namespace="{$outputNS}" name="{$dlName}">
-      <xsl:attribute name="{$rendName}">
+				<xsl:call-template name="valListChildren" />
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[odds] all the values in a valList</desc>
+	</doc>
+	<xsl:template name="valListChildren">
+		<xsl:element namespace="{$outputNS}" name="{$dlName}">
+			<xsl:attribute name="{$rendName}">
         <xsl:text>valList</xsl:text>
       </xsl:attribute>
-      <xsl:for-each select="tei:valItem">
-        <xsl:variable name="name">
-          <xsl:choose>
-            <xsl:when test="tei:altIdent">
-              <xsl:value-of select="tei:altIdent"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@ident"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:element namespace="{$outputNS}" name="{$dtName}">
-          <xsl:attribute name="{$rendName}">
+			<xsl:for-each select="tei:valItem">
+				<xsl:variable name="name">
+					<xsl:choose>
+						<xsl:when test="tei:altIdent">
+							<xsl:value-of select="tei:altIdent" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@ident" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:element namespace="{$outputNS}" name="{$dtName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>odd_label</xsl:text>
           </xsl:attribute>
-          <xsl:value-of select="$name"/>
-        </xsl:element>
-        <xsl:element namespace="{$outputNS}" name="{$ddName}">
-          <xsl:attribute name="{$rendName}">
+					<xsl:value-of select="$name" />
+				</xsl:element>
+				<xsl:element namespace="{$outputNS}" name="{$ddName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>odd_value</xsl:text>
           </xsl:attribute>
-          <xsl:call-template name="makeDescription"/>
-          <xsl:if test="@ident=../../tei:defaultVal">
-            <xsl:element namespace="{$outputNS}" name="{$hiName}">
-              <xsl:attribute name="{$rendName}">
+					<xsl:call-template name="makeDescription" />
+					<xsl:if test="@ident=../../tei:defaultVal">
+						<xsl:element namespace="{$outputNS}" name="{$hiName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>defaultVal</xsl:text>
               </xsl:attribute>
-              <xsl:attribute name="xml:lang">
-                <xsl:value-of select="$documentationLanguage"/>
+							<xsl:attribute name="xml:lang">
+                <xsl:value-of
+								select="$documentationLanguage" />
               </xsl:attribute>
-              <xsl:text> [</xsl:text>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Default</xsl:with-param>
-              </xsl:call-template>
-              <xsl:text>]</xsl:text>
-            </xsl:element>
-          </xsl:if>
-        </xsl:element>
-      </xsl:for-each>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[odds] </desc>
-  </doc>
-  <xsl:template name="moduleInfo">
-    <xsl:if test="not($oddWeaveLite='true')">
-      <xsl:element namespace="{$outputNS}" name="{$rowName}">
-        <xsl:element namespace="{$outputNS}" name="{$cellName}">
-          <xsl:attribute name="{$rendName}">
+							<xsl:text> [</xsl:text>
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Default
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:text>]</xsl:text>
+						</xsl:element>
+					</xsl:if>
+				</xsl:element>
+			</xsl:for-each>
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[odds] </desc>
+	</doc>
+	<xsl:template name="moduleInfo">
+		<xsl:if test="not($oddWeaveLite='true')">
+			<xsl:element namespace="{$outputNS}" name="{$rowName}">
+				<xsl:element namespace="{$outputNS}" name="{$cellName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>wovenodd-col1</xsl:text>
           </xsl:attribute>
-          <xsl:element namespace="{$outputNS}" name="{$hiName}">
-            <xsl:attribute name="{$rendName}">
+					<xsl:element namespace="{$outputNS}" name="{$hiName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>label</xsl:text>
             </xsl:attribute>
-            <xsl:attribute name="xml:lang">
-              <xsl:value-of select="$documentationLanguage"/>
+						<xsl:attribute name="xml:lang">
+              <xsl:value-of
+							select="$documentationLanguage" />
             </xsl:attribute>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">Module</xsl:with-param>
-            </xsl:call-template>
-          </xsl:element>
-        </xsl:element>
-        <xsl:element namespace="{$outputNS}" name="{$cellName}">
-          <xsl:attribute name="{$rendName}">
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								Module
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:element>
+				</xsl:element>
+				<xsl:element namespace="{$outputNS}" name="{$cellName}">
+					<xsl:attribute name="{$rendName}">
             <xsl:text>wovenodd-col2</xsl:text>
           </xsl:attribute>
-          <xsl:call-template name="makeTagsetInfo"/>
-        </xsl:element>
-      </xsl:element>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[odds] display attribute list  </desc>
-  </doc>
-  <xsl:template name="displayAttList">
-    <xsl:param name="mode"/>
-    <xsl:call-template name="showAttClasses"/>
-    <xsl:if test=".//tei:attDef">
-      <xsl:element namespace="{$outputNS}" name="{$tableName}">
-        <xsl:attribute name="{$rendName}">
+					<xsl:call-template name="makeTagsetInfo" />
+				</xsl:element>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[odds] display attribute list  </desc>
+	</doc>
+	<xsl:template name="displayAttList">
+		<xsl:param name="mode" />
+		<xsl:call-template name="showAttClasses" />
+		<xsl:if test=".//tei:attDef">
+			<xsl:element namespace="{$outputNS}" name="{$tableName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>attList</xsl:text>
         </xsl:attribute>
-        <xsl:choose>
-          <xsl:when test="$mode='all'">
-            <xsl:apply-templates/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:apply-templates mode="summary"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:element>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[odds] display list of model parents </desc>
-  </doc>
-  <xsl:template name="generateModelParents">
-    <xsl:param name="showElements">true</xsl:param>
-    <xsl:variable name="here" select="."/>
-    <xsl:element namespace="{$outputNS}" name="{$divName}">
-      <xsl:attribute name="{$rendName}">parent</xsl:attribute>
-      <xsl:variable name="Parents">
-        <xsl:for-each select="key('REFS',@ident)/ancestor::tei:content/parent::*">
-          <Element type="{local-name()}" module="{@module}" name="{@ident}">
-            <xsl:attribute name="altName">
+				<xsl:choose>
+					<xsl:when test="$mode='all'">
+						<xsl:apply-templates />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates mode="summary" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[odds] display list of model parents </desc>
+	</doc>
+	<xsl:template name="generateModelParents">
+		<xsl:param name="showElements">
+			true
+		</xsl:param>
+		<xsl:variable name="here" select="." />
+		<xsl:element namespace="{$outputNS}" name="{$divName}">
+			<xsl:attribute name="{$rendName}">parent</xsl:attribute>
+			<xsl:variable name="Parents">
+				<xsl:for-each
+					select="key('REFS',@ident)/ancestor::tei:content/parent::*">
+					<Element type="{local-name()}" module="{@module}"
+						name="{@ident}">
+						<xsl:attribute name="altName">
               <xsl:choose>
                 <xsl:when test="tei:altIdent">
-                  <xsl:value-of select="tei:altIdent"/>
+                  <xsl:value-of select="tei:altIdent" />
                 </xsl:when>
                 <xsl:otherwise>
-                  <xsl:value-of select="@ident"/>
+                  <xsl:value-of select="@ident" />
                 </xsl:otherwise>
               </xsl:choose>
             </xsl:attribute>
-          </Element>
-        </xsl:for-each>
-        <xsl:for-each select="tei:classes/tei:memberOf">
-          <xsl:for-each select="key('CLASSES',@key)">
-            <xsl:if test="@type='model'">
-              <Element type="classSpec" module="{@module}" name="{@ident}">
-                <xsl:attribute name="altName">
+					</Element>
+				</xsl:for-each>
+				<xsl:for-each select="tei:classes/tei:memberOf">
+					<xsl:for-each select="key('CLASSES',@key)">
+						<xsl:if test="@type='model'">
+							<Element type="classSpec" module="{@module}"
+								name="{@ident}">
+								<xsl:attribute name="altName">
                   <xsl:choose>
                     <xsl:when test="tei:altIdent">
-                      <xsl:value-of select="tei:altIdent"/>
+                      <xsl:value-of select="tei:altIdent" />
                     </xsl:when>
                     <xsl:otherwise>
-                      <xsl:value-of select="@ident"/>
+                      <xsl:value-of select="@ident" />
                     </xsl:otherwise>
                   </xsl:choose>
                 </xsl:attribute>
-              </Element>
-            </xsl:if>
-          </xsl:for-each>
-        </xsl:for-each>
-      </xsl:variable>
-      <xsl:if test="count($Parents/*)&gt;0">
-        <xsl:for-each-group select="$Parents/*" group-by="@name">
-          <xsl:sort select="@altName"/>
-          <xsl:variable name="name" select="@name"/>
-          <xsl:variable name="alt" select="@altName"/>
-          <xsl:variable name="type" select="@type"/>
-          <xsl:if test="not(@type='elementSpec' and $showElements='false')">
-            <xsl:for-each select="$here">
-              <xsl:call-template name="linkTogether">
-                <xsl:with-param name="name" select="$name"/>
-                <xsl:with-param name="reftext" select="$alt"/>
-                <xsl:with-param name="class">link_odd_<xsl:value-of select="$type"/></xsl:with-param>
-              </xsl:call-template>
-            </xsl:for-each>
-            <xsl:if test="not(position() = last())">
-              <xsl:call-template name="showSpaceBetweenItems"/>
-            </xsl:if>
-          </xsl:if>
-        </xsl:for-each-group>
-      </xsl:if>
-      <xsl:call-template name="generateParentsByAttribute"/>
-    </xsl:element>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>[odds] display list of generated parents (via models)   </desc>
-  </doc>
-  <xsl:template name="generateIndirectParents">
-    <xsl:element namespace="{$outputNS}" name="{$divName}">
-      <xsl:attribute name="{$rendName}">parent</xsl:attribute>
-      <xsl:variable name="here" select="."/>
-      <xsl:variable name="name" select="@ident"/>
-      <xsl:variable name="Parents">
-        <xsl:call-template name="ProcessDirectRefs"/>
-        <!-- now look at class membership -->
-        <xsl:for-each select="tei:classes/tei:memberOf">
-          <xsl:for-each select="key('CLASSES',@key)">
-            <xsl:if test="@type='model'">
-              <xsl:call-template name="ProcessClass">
-                <xsl:with-param name="name" select="$name"/>
-              </xsl:call-template>
-            </xsl:if>
-          </xsl:for-each>
-        </xsl:for-each>
-      </xsl:variable>
-      <xsl:call-template name="displayElementsByModule">
-        <xsl:with-param name="List">
-          <xsl:copy-of select="$Parents"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:element>
-  </xsl:template>
-  <xsl:template name="ProcessDirectRefs">
-    <!-- direct parents -->
-    <xsl:for-each select="key('REFS',@ident)/ancestor::tei:content/parent::tei:*">
-      <xsl:choose>
-        <xsl:when test="self::tei:elementSpec">
-          <Element type="{local-name()}" module="{@module}" name="{@ident}">
-            <xsl:attribute name="altName">
+							</Element>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:variable>
+			<xsl:if test="count($Parents/*)&gt;0">
+				<xsl:for-each-group select="$Parents/*"
+					group-by="@name">
+					<xsl:sort select="@altName" />
+					<xsl:variable name="name" select="@name" />
+					<xsl:variable name="alt" select="@altName" />
+					<xsl:variable name="type" select="@type" />
+					<xsl:if
+						test="not(@type='elementSpec' and $showElements='false')">
+						<xsl:for-each select="$here">
+							<xsl:call-template name="linkTogether">
+								<xsl:with-param name="name" select="$name" />
+								<xsl:with-param name="reftext" select="$alt" />
+								<xsl:with-param name="class">
+									link_odd_
+									<xsl:value-of select="$type" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:for-each>
+						<xsl:if test="not(position() = last())">
+							<xsl:call-template name="showSpaceBetweenItems" />
+						</xsl:if>
+					</xsl:if>
+				</xsl:for-each-group>
+			</xsl:if>
+			<xsl:call-template
+				name="generateParentsByAttribute" />
+		</xsl:element>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[odds] display list of generated parents (via models)   </desc>
+	</doc>
+	<xsl:template name="generateIndirectParents">
+		<xsl:element namespace="{$outputNS}" name="{$divName}">
+			<xsl:attribute name="{$rendName}">parent</xsl:attribute>
+			<xsl:variable name="here" select="." />
+			<xsl:variable name="name" select="@ident" />
+			<xsl:variable name="Parents">
+				<xsl:call-template name="ProcessDirectRefs" />
+				<!-- now look at class membership -->
+				<xsl:for-each select="tei:classes/tei:memberOf">
+					<xsl:for-each select="key('CLASSES',@key)">
+						<xsl:if test="@type='model'">
+							<xsl:call-template name="ProcessClass">
+								<xsl:with-param name="name" select="$name" />
+							</xsl:call-template>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:variable>
+			<xsl:call-template name="displayElementsByModule">
+				<xsl:with-param name="List">
+					<xsl:copy-of select="$Parents" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:element>
+	</xsl:template>
+	<xsl:template name="ProcessDirectRefs">
+		<!-- direct parents -->
+		<xsl:for-each
+			select="key('REFS',@ident)/ancestor::tei:content/parent::tei:*">
+			<xsl:choose>
+				<xsl:when test="self::tei:elementSpec">
+					<Element type="{local-name()}" module="{@module}"
+						name="{@ident}">
+						<xsl:attribute name="altName">
               <xsl:choose>
                 <xsl:when test="tei:altIdent">
-                  <xsl:value-of select="tei:altIdent"/>
+                  <xsl:value-of select="tei:altIdent" />
                 </xsl:when>
                 <xsl:otherwise>
-                  <xsl:value-of select="@ident"/>
+                  <xsl:value-of select="@ident" />
                 </xsl:otherwise>
               </xsl:choose>
             </xsl:attribute>
-          </Element>
-        </xsl:when>
-        <xsl:when test="self::tei:macroSpec">
-          <xsl:call-template name="ProcessDirectRefs"/>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="ProcessClass">
-    <xsl:param name="name"/>
-    <xsl:for-each select="key('REFS',@ident)/ancestor::tei:content/parent::tei:*">
-      <xsl:choose>
-        <xsl:when test="self::tei:elementSpec">
-          <Element type="{local-name()}" module="{@module}" name="{@ident}">
-            <xsl:attribute name="altName">
+					</Element>
+				</xsl:when>
+				<xsl:when test="self::tei:macroSpec">
+					<xsl:call-template name="ProcessDirectRefs" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="ProcessClass">
+		<xsl:param name="name" />
+		<xsl:for-each
+			select="key('REFS',@ident)/ancestor::tei:content/parent::tei:*">
+			<xsl:choose>
+				<xsl:when test="self::tei:elementSpec">
+					<Element type="{local-name()}" module="{@module}"
+						name="{@ident}">
+						<xsl:attribute name="altName">
               <xsl:choose>
                 <xsl:when test="tei:altIdent">
-                  <xsl:value-of select="tei:altIdent"/>
+                  <xsl:value-of select="tei:altIdent" />
                 </xsl:when>
                 <xsl:otherwise>
-                  <xsl:value-of select="@ident"/>
+                  <xsl:value-of select="@ident" />
                 </xsl:otherwise>
               </xsl:choose>
             </xsl:attribute>
-          </Element>
-        </xsl:when>
-        <xsl:when test="self::tei:macroSpec">
-          <xsl:call-template name="ProcessDirectRefs"/>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:for-each>
-    <xsl:for-each select="tei:classes/tei:memberOf">
-      <xsl:for-each select="key('CLASSES',@key)">
-        <xsl:if test="@type='model'">
-          <xsl:call-template name="ProcessClass">
-            <xsl:with-param name="name" select="$name"/>
-          </xsl:call-template>
-        </xsl:if>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="generateMembers">
-    <xsl:param name="depth">1</xsl:param>
-    <xsl:param name="me"/>
-    <xsl:variable name="here" select="."/>
-    <xsl:variable name="this" select="@ident"/>
-    <xsl:if test="not($this=$me) and key('CLASSMEMBERS',$this)">
-      <xsl:element namespace="{$outputNS}" name="{$hiName}">
-        <xsl:attribute name="{$rendName}">
+					</Element>
+				</xsl:when>
+				<xsl:when test="self::tei:macroSpec">
+					<xsl:call-template name="ProcessDirectRefs" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+		<xsl:for-each select="tei:classes/tei:memberOf">
+			<xsl:for-each select="key('CLASSES',@key)">
+				<xsl:if test="@type='model'">
+					<xsl:call-template name="ProcessClass">
+						<xsl:with-param name="name" select="$name" />
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="generateMembers">
+		<xsl:param name="depth">
+			1
+		</xsl:param>
+		<xsl:param name="me" />
+		<xsl:variable name="here" select="." />
+		<xsl:variable name="this" select="@ident" />
+		<xsl:if test="not($this=$me) and key('CLASSMEMBERS',$this)">
+			<xsl:element namespace="{$outputNS}" name="{$hiName}">
+				<xsl:attribute name="{$rendName}">
           <xsl:text>showmembers</xsl:text>
-          <xsl:value-of select="$depth"/>
+          <xsl:value-of select="$depth" />
         </xsl:attribute>
-        <xsl:if test="$depth &gt; 1"> [</xsl:if>
-        <xsl:variable name="list">
-          <ClassList>
-            <xsl:for-each select="key('CLASSMEMBERS',$this)">
-              <Item type="local-name()" ident="@ident">
-                <xsl:call-template name="linkTogether">
-                  <xsl:with-param name="name" select="@ident"/>
-                  <xsl:with-param name="reftext">
-                    <xsl:choose>
-                      <xsl:when test="tei:altIdent">
-                        <xsl:value-of select="tei:altIdent"/>
-                      </xsl:when>
-                      <xsl:otherwise>
-                        <xsl:value-of select="@ident"/>
-                      </xsl:otherwise>
-                    </xsl:choose>
-                  </xsl:with-param>
-                  <xsl:with-param name="class">
-                    <xsl:text>link_odd_</xsl:text>
-                    <xsl:value-of select="local-name()"/>
-                  </xsl:with-param>
-                </xsl:call-template>
-                <xsl:call-template name="generateMembers">
-                  <xsl:with-param name="depth">
-                    <xsl:value-of select="$depth + 1"/>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </Item>
-            </xsl:for-each>
-          </ClassList>
-        </xsl:variable>
-        <xsl:for-each select="$list/ClassList/Item">
-          <xsl:sort select="@type"/>
-          <xsl:sort select="@ident"/>
-          <xsl:copy-of select="*|text()"/>
-          <xsl:if test="following-sibling::Item">
-            <xsl:call-template name="showSpaceBetweenItems"/>
-          </xsl:if>
-        </xsl:for-each>
-        <xsl:if test="$depth &gt; 1">] </xsl:if>
-      </xsl:element>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template name="generateParentsByAttribute">
-    <xsl:variable name="this" select="@ident"/>
-    <xsl:variable name="list">
-      <PattList>
-	<xsl:for-each select="key('ATTREFS-CLASS',$this)">
-	  <xsl:sort select="ancestor::tei:classSpec/@ident"/>
-	  <xsl:sort select="@ident"/>
-	  <xsl:element namespace="{$outputNS}" name="{$itemName}">
-	    <xsl:for-each select="ancestor::tei:classSpec">
-	      <Item>
-		<xsl:call-template name="linkTogether">
-		  <xsl:with-param name="name">
-		    <xsl:value-of select="@ident"/>
-		  </xsl:with-param>
-		  <xsl:with-param name="class">
-		    <xsl:text>link_odd_classSpec</xsl:text>
-		  </xsl:with-param>
-		</xsl:call-template>
-	      </Item>
-	    </xsl:for-each>
-	    <xsl:text>/@</xsl:text>
-	    <xsl:value-of select="ancestor::tei:attDef/@ident"/>
-	  </xsl:element>
-	</xsl:for-each>
-      </PattList>
-    </xsl:variable>
-    <xsl:if test="count($list/PattList/Item)&gt;0">
-      <xsl:element namespace="{$outputNS}" name="{$segName}">
-        <xsl:attribute name="xml:lang">
-          <xsl:value-of select="$documentationLanguage"/>
+				<xsl:if test="$depth &gt; 1">
+					[
+				</xsl:if>
+				<xsl:variable name="list">
+					<ClassList>
+						<xsl:for-each select="key('CLASSMEMBERS',$this)">
+							<Item type="local-name()" ident="@ident">
+								<xsl:call-template name="linkTogether">
+									<xsl:with-param name="name" select="@ident" />
+									<xsl:with-param name="reftext">
+										<xsl:choose>
+											<xsl:when test="tei:altIdent">
+												<xsl:value-of select="tei:altIdent" />
+											</xsl:when>
+											<xsl:otherwise>
+												<xsl:value-of select="@ident" />
+											</xsl:otherwise>
+										</xsl:choose>
+									</xsl:with-param>
+									<xsl:with-param name="class">
+										<xsl:text>link_odd_</xsl:text>
+										<xsl:value-of select="local-name()" />
+									</xsl:with-param>
+								</xsl:call-template>
+								<xsl:call-template name="generateMembers">
+									<xsl:with-param name="depth">
+										<xsl:value-of select="$depth + 1" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</Item>
+						</xsl:for-each>
+					</ClassList>
+				</xsl:variable>
+				<xsl:for-each select="$list/ClassList/Item">
+					<xsl:sort select="@type" />
+					<xsl:sort select="@ident" />
+					<xsl:copy-of select="*|text()" />
+					<xsl:if test="following-sibling::Item">
+						<xsl:call-template name="showSpaceBetweenItems" />
+					</xsl:if>
+				</xsl:for-each>
+				<xsl:if test="$depth &gt; 1">
+					]
+				</xsl:if>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="generateParentsByAttribute">
+		<xsl:variable name="this" select="@ident" />
+		<xsl:variable name="list">
+			<PattList>
+				<xsl:for-each select="key('ATTREFS-CLASS',$this)">
+					<xsl:sort select="ancestor::tei:classSpec/@ident" />
+					<xsl:sort select="@ident" />
+					<xsl:element namespace="{$outputNS}" name="{$itemName}">
+						<xsl:for-each select="ancestor::tei:classSpec">
+							<Item>
+								<xsl:call-template name="linkTogether">
+									<xsl:with-param name="name">
+										<xsl:value-of select="@ident" />
+									</xsl:with-param>
+									<xsl:with-param name="class">
+										<xsl:text>link_odd_classSpec</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</Item>
+						</xsl:for-each>
+						<xsl:text>/@</xsl:text>
+						<xsl:value-of select="ancestor::tei:attDef/@ident" />
+					</xsl:element>
+				</xsl:for-each>
+			</PattList>
+		</xsl:variable>
+		<xsl:if test="count($list/PattList/Item)&gt;0">
+			<xsl:element namespace="{$outputNS}" name="{$segName}">
+				<xsl:attribute name="xml:lang">
+          <xsl:value-of select="$documentationLanguage" />
         </xsl:attribute>
-        <xsl:call-template name="i18n">
-          <xsl:with-param name="word">
-            <xsl:text> Class</xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:element>
-      <xsl:text>: </xsl:text>
-      <xsl:element namespace="{$outputNS}" name="{$ulName}">
-        <xsl:for-each select="$list/PattList/Item">
-          <xsl:copy-of select="*|text()"/>
-        </xsl:for-each>
-      </xsl:element>
-    </xsl:if>
-    <xsl:variable name="list2">
-      <PattList>
-	<xsl:for-each select="key('ATTREFS-ELEMENT',$this)">
-	  <xsl:sort select="ancestor::tei:elementSpec/@ident"/>
-	  <xsl:sort select="@ident"/>
-	  <Item>
-	    <xsl:element namespace="{$outputNS}" name="{$itemName}">
-	      <xsl:for-each select="ancestor::tei:elementSpec">
-		<xsl:call-template name="linkTogether">
-		  <xsl:with-param name="name">
-		    <xsl:value-of select="@ident"/>
-		  </xsl:with-param>
-		  <xsl:with-param name="reftext">
-		    <xsl:choose>
-		      <xsl:when test="tei:altIdent">
-			<xsl:value-of select="tei:altIdent"/>
-		      </xsl:when>
-		      <xsl:otherwise>
-			<xsl:value-of select="@ident"/>
-		      </xsl:otherwise>
-		    </xsl:choose>
-		  </xsl:with-param>
-		  <xsl:with-param name="class">
-		    <xsl:text>link_odd_elementSpec</xsl:text>
-		  </xsl:with-param>
-		</xsl:call-template>
-	      </xsl:for-each>
-	      <xsl:text>/@</xsl:text>
-	      <xsl:for-each select="ancestor::tei:attDef">
-		<xsl:value-of select="(tei:altIdent|@ident)[last()]"/>
-	      </xsl:for-each>
-	    </xsl:element>
-	  </Item>
-	</xsl:for-each>
-      </PattList>
-    </xsl:variable>
-    <xsl:if test="count($list2/PattList/Item)&gt;0">
-      <xsl:element namespace="{$outputNS}" name="{$segName}">
-	<xsl:attribute name="xml:lang">
-	  <xsl:value-of select="$documentationLanguage"/>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						<xsl:text> Class</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:element>
+			<xsl:text>: </xsl:text>
+			<xsl:element namespace="{$outputNS}" name="{$ulName}">
+				<xsl:for-each select="$list/PattList/Item">
+					<xsl:copy-of select="*|text()" />
+				</xsl:for-each>
+			</xsl:element>
+		</xsl:if>
+		<xsl:variable name="list2">
+			<PattList>
+				<xsl:for-each select="key('ATTREFS-ELEMENT',$this)">
+					<xsl:sort select="ancestor::tei:elementSpec/@ident" />
+					<xsl:sort select="@ident" />
+					<Item>
+						<xsl:element namespace="{$outputNS}"
+							name="{$itemName}">
+							<xsl:for-each select="ancestor::tei:elementSpec">
+								<xsl:call-template name="linkTogether">
+									<xsl:with-param name="name">
+										<xsl:value-of select="@ident" />
+									</xsl:with-param>
+									<xsl:with-param name="reftext">
+										<xsl:choose>
+											<xsl:when test="tei:altIdent">
+												<xsl:value-of select="tei:altIdent" />
+											</xsl:when>
+											<xsl:otherwise>
+												<xsl:value-of select="@ident" />
+											</xsl:otherwise>
+										</xsl:choose>
+									</xsl:with-param>
+									<xsl:with-param name="class">
+										<xsl:text>link_odd_elementSpec</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+							<xsl:text>/@</xsl:text>
+							<xsl:for-each select="ancestor::tei:attDef">
+								<xsl:value-of
+									select="(tei:altIdent|@ident)[last()]" />
+							</xsl:for-each>
+						</xsl:element>
+					</Item>
+				</xsl:for-each>
+			</PattList>
+		</xsl:variable>
+		<xsl:if test="count($list2/PattList/Item)&gt;0">
+			<xsl:element namespace="{$outputNS}" name="{$segName}">
+				<xsl:attribute name="xml:lang">
+	  <xsl:value-of select="$documentationLanguage" />
 	</xsl:attribute>
-	<xsl:call-template name="i18n">
-	  <xsl:with-param name="word">
-	    <xsl:text>Element</xsl:text>
-	  </xsl:with-param>
-	</xsl:call-template>
-	<xsl:text>: </xsl:text>
-      </xsl:element>
-      <xsl:element namespace="{$outputNS}" name="{$ulName}">
-	<xsl:for-each select="$list2/PattList/Item">
-	  <xsl:copy-of select="*|text()"/>
-	</xsl:for-each>
-      </xsl:element>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:classSpec|tei:elementSpec|tei:macroSpec" mode="weave">
-    <xsl:call-template name="refdoc"/>
-  </xsl:template>
-  <xsl:template match="tei:divGen[@type='modelclasscat']">
-    <xsl:apply-templates mode="weave" select="key('MODELCLASSDOCS',1)">
-      <xsl:sort select="@ident"/>
-    </xsl:apply-templates>
-  </xsl:template>
-  <xsl:template match="tei:divGen[@type='attclasscat']">
-    <xsl:apply-templates mode="weave" select="key('ATTCLASSDOCS',1)">
-      <xsl:sort select="@ident"/>
-    </xsl:apply-templates>
-  </xsl:template>
-  <xsl:template match="tei:divGen[@type='macrocat']">
-    <xsl:apply-templates mode="weave" select="key('MACRODOCS',1)">
-      <xsl:sort select="@ident"/>
-    </xsl:apply-templates>
-  </xsl:template>
-  <xsl:template match="tei:divGen[@type='elementcat']">
-    <xsl:apply-templates mode="weave" select="key('ELEMENTDOCS',1)">
-      <xsl:sort select="@ident"/>
-    </xsl:apply-templates>
-  </xsl:template>
-  <xsl:template match="tei:divGen[@type='attcat']">
-    <xsl:element namespace="{$outputNS}" name="{$tableName}">
-      <xsl:attribute name="{$rendName}">
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						<xsl:text>Element</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>: </xsl:text>
+			</xsl:element>
+			<xsl:element namespace="{$outputNS}" name="{$ulName}">
+				<xsl:for-each select="$list2/PattList/Item">
+					<xsl:copy-of select="*|text()" />
+				</xsl:for-each>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template
+		match="tei:classSpec|tei:elementSpec|tei:macroSpec" mode="weave">
+		<xsl:call-template name="refdoc" />
+	</xsl:template>
+	<xsl:template match="tei:divGen[@type='modelclasscat']">
+		<xsl:apply-templates mode="weave"
+			select="key('MODELCLASSDOCS',1)">
+			<xsl:sort select="@ident" />
+		</xsl:apply-templates>
+	</xsl:template>
+	<xsl:template match="tei:divGen[@type='attclasscat']">
+		<xsl:apply-templates mode="weave"
+			select="key('ATTCLASSDOCS',1)">
+			<xsl:sort select="@ident" />
+		</xsl:apply-templates>
+	</xsl:template>
+	<xsl:template match="tei:divGen[@type='macrocat']">
+		<xsl:apply-templates mode="weave"
+			select="key('MACRODOCS',1)">
+			<xsl:sort select="@ident" />
+		</xsl:apply-templates>
+	</xsl:template>
+	<xsl:template match="tei:divGen[@type='elementcat']">
+		<xsl:apply-templates mode="weave"
+			select="key('ELEMENTDOCS',1)">
+			<xsl:sort select="@ident" />
+		</xsl:apply-templates>
+	</xsl:template>
+	<xsl:template match="tei:divGen[@type='attcat']">
+		<xsl:element namespace="{$outputNS}" name="{$tableName}">
+			<xsl:attribute name="{$rendName}">
         <xsl:text>attcat</xsl:text>
       </xsl:attribute>
-      <xsl:for-each select="key('ATTDOCS',1)">
-        <xsl:sort select="@ident"/>
-        <xsl:variable name="this" select="@ident"/>
-        <xsl:if test="generate-id()=generate-id(key('ATTRIBUTES',$this)[1])">
-          <xsl:element namespace="{$outputNS}" name="{$rowName}">
-            <xsl:call-template name="identifyElement">
-              <xsl:with-param name="id">
-                <xsl:value-of select="translate($this,':','_')"/>
-              </xsl:with-param>
-            </xsl:call-template>
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+			<xsl:for-each select="key('ATTDOCS',1)">
+				<xsl:sort select="@ident" />
+				<xsl:variable name="this" select="@ident" />
+				<xsl:if
+					test="generate-id()=generate-id(key('ATTRIBUTES',$this)[1])">
+					<xsl:element namespace="{$outputNS}" name="{$rowName}">
+						<xsl:call-template name="identifyElement">
+							<xsl:with-param name="id">
+								<xsl:value-of select="translate($this,':','_')" />
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>attcat-col1</xsl:text>
               </xsl:attribute>
-              <xsl:value-of select="$this"/>
-            </xsl:element>
-            <xsl:element namespace="{$outputNS}" name="{$cellName}">
-              <xsl:attribute name="{$rendName}">
+							<xsl:value-of select="$this" />
+						</xsl:element>
+						<xsl:element namespace="{$outputNS}"
+							name="{$cellName}">
+							<xsl:attribute name="{$rendName}">
                 <xsl:text>attcat-col2</xsl:text>
               </xsl:attribute>
-              <xsl:for-each select="key('ATTRIBUTES-CLASS',$this)">
-                <xsl:sort select="ancestor::tei:classSpec/@ident"/>
-                <xsl:for-each select="ancestor::tei:classSpec|ancestor::elementSpec">
-                  <xsl:call-template name="linkTogether">
-                    <xsl:with-param name="name">
-                      <xsl:value-of select="@ident"/>
-                    </xsl:with-param>
-		    <xsl:with-param name="reftext">
-		      <xsl:choose>
-			<xsl:when test="tei:altIdent">
-			  <xsl:value-of select="tei:altIdent"/>
+							<xsl:for-each select="key('ATTRIBUTES-CLASS',$this)">
+								<xsl:sort select="ancestor::tei:classSpec/@ident" />
+								<xsl:for-each
+									select="ancestor::tei:classSpec|ancestor::elementSpec">
+									<xsl:call-template name="linkTogether">
+										<xsl:with-param name="name">
+											<xsl:value-of select="@ident" />
+										</xsl:with-param>
+										<xsl:with-param name="reftext">
+											<xsl:choose>
+												<xsl:when test="tei:altIdent">
+													<xsl:value-of select="tei:altIdent" />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:value-of select="@ident" />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:with-param>
+										<xsl:with-param name="class">
+											<xsl:text>link_odd</xsl:text>
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:for-each>
+								<xsl:text> </xsl:text>
+							</xsl:for-each>
+							<xsl:for-each
+								select="key('ATTRIBUTES-ELEMENT',$this)">
+								<xsl:sort select="ancestor::tei:elementSpec/@ident" />
+								<xsl:for-each select="ancestor::tei:elementSpec">
+									<xsl:call-template name="linkTogether">
+										<xsl:with-param name="name">
+											<xsl:value-of select="@ident" />
+										</xsl:with-param>
+										<xsl:with-param name="reftext">
+											<xsl:choose>
+												<xsl:when test="tei:altIdent">
+													<xsl:value-of select="tei:altIdent" />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:value-of select="@ident" />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:with-param>
+										<xsl:with-param name="class">
+											<xsl:text>link_odd</xsl:text>
+										</xsl:with-param>
+									</xsl:call-template>
+								</xsl:for-each>
+								<xsl:value-of select="$spaceCharacter" />
+								<xsl:text> </xsl:text>
+							</xsl:for-each>
+						</xsl:element>
+					</xsl:element>
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:element>
+	</xsl:template>
+	<xsl:template match="tei:exemplum" mode="weave">
+		<xsl:if test="teix:egXML/* or teix:egXML/text() or text()">
+			<xsl:apply-templates select="." mode="doc" />
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>No-op processing of elements tei:gloss and tei:desc in
+			normal modes, as they will always be called explicitly if
+			needed.</desc>
+	</doc>
+	<xsl:template match="tei:desc|tei:gloss" mode="weave" />
+	<xsl:template match="tei:remarks" mode="weave">
+		<xsl:variable name="documentationLanguage">
+			<xsl:call-template name="generateDoc" />
+		</xsl:variable>
+		<xsl:variable name="langs">
+			<xsl:value-of
+				select="concat(normalize-space($documentationLanguage),' ')" />
+		</xsl:variable>
+		<xsl:variable name="firstLang">
+			<xsl:value-of select="substring-before($langs,' ')" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="@xml:lang=$firstLang">
+				<xsl:apply-templates select="." mode="doc" />
 			</xsl:when>
+			<xsl:when
+				test="not(@xml:lang) and $documentationLanguage='en'">
+				<xsl:apply-templates select="." mode="doc" />
+			</xsl:when>
 			<xsl:otherwise>
-			  <xsl:value-of select="@ident"/>
+				<xsl:variable name="currentLang">
+					<xsl:call-template name="findLanguage" />
+				</xsl:variable>
+				<xsl:if test="contains($langs,concat($currentLang,' '))">
+					<xsl:apply-templates select="." mode="doc" />
+				</xsl:if>
 			</xsl:otherwise>
-		      </xsl:choose>
-		    </xsl:with-param>
-                    <xsl:with-param name="class">
-                      <xsl:text>link_odd</xsl:text>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </xsl:for-each>
-                <xsl:text> </xsl:text>
-              </xsl:for-each>
-              <xsl:for-each select="key('ATTRIBUTES-ELEMENT',$this)">
-                <xsl:sort select="ancestor::tei:elementSpec/@ident"/>
-                <xsl:for-each select="ancestor::tei:elementSpec">
-                  <xsl:call-template name="linkTogether">
-                    <xsl:with-param name="name">
-                      <xsl:value-of select="@ident"/>
-                    </xsl:with-param>
-                    <xsl:with-param name="reftext">
-                      <xsl:choose>
-                        <xsl:when test="tei:altIdent">
-                          <xsl:value-of select="tei:altIdent"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                          <xsl:value-of select="@ident"/>
-                        </xsl:otherwise>
-                      </xsl:choose>
-                    </xsl:with-param>
-                    <xsl:with-param name="class">
-                      <xsl:text>link_odd</xsl:text>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </xsl:for-each>
-                <xsl:value-of select="$spaceCharacter"/>
-                <xsl:text> </xsl:text>
-              </xsl:for-each>
-            </xsl:element>
-          </xsl:element>
-        </xsl:if>
-      </xsl:for-each>
-    </xsl:element>
-  </xsl:template>
-  <xsl:template match="tei:exemplum" mode="weave">
-    <xsl:if test="teix:egXML/* or teix:egXML/text() or text()">
-      <xsl:apply-templates select="." mode="doc"/>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>No-op processing of elements tei:gloss and tei:desc in
-    normal modes, as they will always be called explicitly if
-    needed.</desc>
-  </doc>
-  <xsl:template match="tei:desc|tei:gloss" mode="weave"/>
-  <xsl:template match="tei:remarks" mode="weave">
-    <xsl:variable name="documentationLanguage">
-      <xsl:call-template name="generateDoc"/>
-    </xsl:variable>
-    <xsl:variable name="langs">
-      <xsl:value-of select="concat(normalize-space($documentationLanguage),' ')"/>
-    </xsl:variable>
-    <xsl:variable name="firstLang">
-      <xsl:value-of select="substring-before($langs,' ')"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="@xml:lang=$firstLang">
-        <xsl:apply-templates select="." mode="doc"/>
-      </xsl:when>
-      <xsl:when test="not(@xml:lang) and $documentationLanguage='en'">
-        <xsl:apply-templates select="." mode="doc"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="currentLang">
-          <xsl:call-template name="findLanguage"/>
-        </xsl:variable>
-        <xsl:if test="contains($langs,concat($currentLang,' '))">
-          <xsl:apply-templates select="." mode="doc"/>
-        </xsl:if>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element valList</desc>
-  </doc>
-  <xsl:template match="tei:valList" mode="weave">
-    <xsl:apply-templates mode="contents" select="."/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element attList</desc>
-  </doc>
-  <xsl:template match="tei:attList" mode="weave"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element defaultVal</desc>
-  </doc>
-  <xsl:template match="tei:defaultVal" mode="weave"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element desc</desc>
-  </doc>
-  <xsl:template match="tei:desc">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <!-- pretty printing of RNC -->
-  <xsl:template match="nc" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_nc</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="declaration" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_decl</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="prefix" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_prefix</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="param" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_param</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="op" mode="keep">
-    <xsl:value-of select="translate (., ' ', '&#160;')"/>
-  </xsl:template>
-  <xsl:template match="atom" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_atom</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="t" mode="keep">
-    <xsl:choose>
-      <xsl:when test=". = '[' or . = ']'">
-        <xsl:call-template name="showRNC">
-          <xsl:with-param name="style">
-            <xsl:text>rnc_annot</xsl:text>
-          </xsl:with-param>
-          <xsl:with-param name="contents">
-            <xsl:value-of select="."/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="."/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="doc" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_comment</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="annot" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_annot</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="type" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_type</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="keyword" mode="keep">
-    <xsl:call-template name="showRNC">
-      <xsl:with-param name="style">
-        <xsl:text>rnc_keyword</xsl:text>
-      </xsl:with-param>
-      <xsl:with-param name="contents">
-        <xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:attList[@org='choice']">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template name="showAttClasses">
-    <xsl:param name="minimal">false</xsl:param>
-    <xsl:variable name="clatts">
-      <xsl:for-each select="ancestor-or-self::tei:elementSpec|ancestor-or-self::tei:classSpec">
-        <xsl:call-template name="attClassDetails"/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:if test="$minimal='true'">
-      <xsl:text> — </xsl:text>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="$minimal='true' and not($clatts='')">
-        <xsl:text> [+ </xsl:text>
-        <xsl:copy-of select="$clatts"/>
-        <xsl:text>]</xsl:text>
-      </xsl:when>
-      <xsl:when test="not($clatts='')">
-        <xsl:if test="ancestor::tei:schemaSpec and key('CLASSES','att.global')">
-          <xsl:element namespace="{$outputNS}" name="{$segName}">
-            <xsl:attribute name="xml:lang">
-              <xsl:value-of select="$documentationLanguage"/>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element valList</desc>
+	</doc>
+	<xsl:template match="tei:valList" mode="weave">
+		<xsl:apply-templates mode="contents" select="." />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element attList</desc>
+	</doc>
+	<xsl:template match="tei:attList" mode="weave" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element defaultVal</desc>
+	</doc>
+	<xsl:template match="tei:defaultVal" mode="weave" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element desc</desc>
+	</doc>
+	<xsl:template match="tei:desc">
+		<xsl:apply-templates />
+	</xsl:template>
+	<!-- pretty printing of RNC -->
+	<xsl:template match="nc" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_nc</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="declaration" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_decl</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="prefix" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_prefix</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="param" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_param</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="op" mode="keep">
+		<xsl:value-of select="translate (., ' ', '&#160;')" />
+	</xsl:template>
+	<xsl:template match="atom" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_atom</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="t" mode="keep">
+		<xsl:choose>
+			<xsl:when test=". = '[' or . = ']'">
+				<xsl:call-template name="showRNC">
+					<xsl:with-param name="style">
+						<xsl:text>rnc_annot</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="contents">
+						<xsl:value-of select="." />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="doc" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_comment</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="annot" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_annot</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="type" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_type</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="keyword" mode="keep">
+		<xsl:call-template name="showRNC">
+			<xsl:with-param name="style">
+				<xsl:text>rnc_keyword</xsl:text>
+			</xsl:with-param>
+			<xsl:with-param name="contents">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:attList[@org='choice']">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template name="showAttClasses">
+		<xsl:param name="minimal">
+			false
+		</xsl:param>
+		<xsl:variable name="clatts">
+			<xsl:for-each
+				select="ancestor-or-self::tei:elementSpec|ancestor-or-self::tei:classSpec">
+				<xsl:call-template name="attClassDetails" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:if test="$minimal='true'">
+			<xsl:text> — </xsl:text>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="$minimal='true' and not($clatts='')">
+				<xsl:text> [+ </xsl:text>
+				<xsl:copy-of select="$clatts" />
+				<xsl:text>]</xsl:text>
+			</xsl:when>
+			<xsl:when test="not($clatts='')">
+				<xsl:if
+					test="ancestor::tei:schemaSpec and key('CLASSES','att.global')">
+					<xsl:element namespace="{$outputNS}" name="{$segName}">
+						<xsl:attribute name="xml:lang">
+              <xsl:value-of
+							select="$documentationLanguage" />
             </xsl:attribute>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">
-                <xsl:choose>
-                  <xsl:when test="not($autoGlobal='true')">Attributes</xsl:when>
-                  <xsl:when test=".//tei:attDef">In addition to global attributes and those inherited from</xsl:when>
-                  <xsl:otherwise>Global attributes and those inherited from</xsl:otherwise>
-                </xsl:choose>
-              </xsl:with-param>
-            </xsl:call-template>
-            <xsl:value-of select="$spaceCharacter"/>
-          </xsl:element>
-        </xsl:if>
-        <xsl:copy-of select="$clatts"/>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:schemaSpec and not(key('CLASSES','att.global'))">
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="i18n">
-          <xsl:with-param name="word">
-            <xsl:choose>
-              <xsl:when test="not($autoGlobal='true')">Attributes</xsl:when>
-              <xsl:when test=".//tei:attDef">In addition to global attributes</xsl:when>
-              <xsl:otherwise>Global attributes only</xsl:otherwise>
-            </xsl:choose>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="attClassDetails">
-    <xsl:param name="depth">1</xsl:param>
-    <xsl:for-each select="tei:classes/tei:memberOf">
-      <xsl:choose>
-        <xsl:when test="key('CLASSES',@key)">
-          <xsl:for-each select="key('CLASSES',@key)">
-            <xsl:if test="@type='atts'">
-              <xsl:if test="$depth &gt; 1"> (</xsl:if>
-              <xsl:call-template name="linkTogether">
-                <xsl:with-param name="name" select="@ident"/>
-              </xsl:call-template>
-              <xsl:if test=".//tei:attDef">
-                <xsl:text> (</xsl:text>
-                <xsl:for-each select=".//tei:attDef">
-                  <xsl:call-template name="emphasize">
-                    <xsl:with-param name="class">attribute</xsl:with-param>
-                    <xsl:with-param name="content">
-                      <xsl:text>@</xsl:text>
-                      <xsl:choose>
-                        <xsl:when test="tei:altIdent">
-                          <xsl:value-of select="tei:altIdent"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                          <xsl:value-of select="@ident"/>
-                        </xsl:otherwise>
-                      </xsl:choose>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                  <xsl:if test="following-sibling::tei:attDef">
-                    <xsl:text>, </xsl:text>
-                  </xsl:if>
-                </xsl:for-each>
-                <xsl:text>)</xsl:text>
-                <xsl:if test="$depth=1">
-                  <xsl:call-template name="showSpace"/>
-                </xsl:if>
-              </xsl:if>
-              <xsl:call-template name="attClassDetails">
-                <xsl:with-param name="depth">
-                  <xsl:value-of select="$depth + 1"/>
-                </xsl:with-param>
-              </xsl:call-template>
-              <xsl:if test="$depth &gt; 1">) </xsl:if>
-            </xsl:if>
-          </xsl:for-each>
-        </xsl:when>
-        <xsl:when test="ancestor::tei:schemaSpec">
-	  </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="@key"/>
-          <xsl:call-template name="showSpace"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="showElement">
-    <xsl:param name="name"/>
-    <xsl:variable name="documentationLanguage">
-      <xsl:call-template name="generateDoc"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$oddmode='tei'">
-        <tei:ref target="#{$name}">
-          <xsl:value-of select="$name"/>
-        </tei:ref>
-      </xsl:when>
-      <xsl:when test="$oddmode='html'">
-        <xsl:choose>
-          <xsl:when test="key('IDENTS',$name) and number($splitLevel)=-1">
-            <a xmlns="http://www.w3.org/1999/xhtml" class="link_element" href="#{$name}">
-              <xsl:value-of select="$name"/>
-            </a>
-          </xsl:when>
-          <xsl:when test="key('IDENTS',$name) and $STDOUT='true'">
-            <a xmlns="http://www.w3.org/1999/xhtml" class="link_element">
-              <xsl:attribute name="href">
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								<xsl:choose>
+									<xsl:when test="not($autoGlobal='true')">
+										Attributes
+									</xsl:when>
+									<xsl:when test=".//tei:attDef">
+										In addition to global attributes and those inherited from
+									</xsl:when>
+									<xsl:otherwise>
+										Global attributes and those inherited from
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:value-of select="$spaceCharacter" />
+					</xsl:element>
+				</xsl:if>
+				<xsl:copy-of select="$clatts" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor::tei:schemaSpec and not(key('CLASSES','att.global'))">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						<xsl:choose>
+							<xsl:when test="not($autoGlobal='true')">
+								Attributes
+							</xsl:when>
+							<xsl:when test=".//tei:attDef">
+								In addition to global attributes
+							</xsl:when>
+							<xsl:otherwise>
+								Global attributes only
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="attClassDetails">
+		<xsl:param name="depth">
+			1
+		</xsl:param>
+		<xsl:for-each select="tei:classes/tei:memberOf">
+			<xsl:choose>
+				<xsl:when test="key('CLASSES',@key)">
+					<xsl:for-each select="key('CLASSES',@key)">
+						<xsl:if test="@type='atts'">
+							<xsl:if test="$depth &gt; 1">
+								(
+							</xsl:if>
+							<xsl:call-template name="linkTogether">
+								<xsl:with-param name="name" select="@ident" />
+							</xsl:call-template>
+							<xsl:if test=".//tei:attDef">
+								<xsl:text> (</xsl:text>
+								<xsl:for-each select=".//tei:attDef">
+									<xsl:call-template name="emphasize">
+										<xsl:with-param name="class">
+											attribute
+										</xsl:with-param>
+										<xsl:with-param name="content">
+											<xsl:text>@</xsl:text>
+											<xsl:choose>
+												<xsl:when test="tei:altIdent">
+													<xsl:value-of select="tei:altIdent" />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:value-of select="@ident" />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:with-param>
+									</xsl:call-template>
+									<xsl:if test="following-sibling::tei:attDef">
+										<xsl:text>, </xsl:text>
+									</xsl:if>
+								</xsl:for-each>
+								<xsl:text>)</xsl:text>
+								<xsl:if test="$depth=1">
+									<xsl:call-template name="showSpace" />
+								</xsl:if>
+							</xsl:if>
+							<xsl:call-template name="attClassDetails">
+								<xsl:with-param name="depth">
+									<xsl:value-of select="$depth + 1" />
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:if test="$depth &gt; 1">
+								)
+							</xsl:if>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="ancestor::tei:schemaSpec">
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@key" />
+					<xsl:call-template name="showSpace" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="showElement">
+		<xsl:param name="name" />
+		<xsl:variable name="documentationLanguage">
+			<xsl:call-template name="generateDoc" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$oddmode='tei'">
+				<tei:ref target="#{$name}">
+					<xsl:value-of select="$name" />
+				</tei:ref>
+			</xsl:when>
+			<xsl:when test="$oddmode='html'">
+				<xsl:choose>
+					<xsl:when
+						test="key('IDENTS',$name) and number($splitLevel)=-1">
+						<a xmlns="http://www.w3.org/1999/xhtml" class="link_element"
+							href="#{$name}">
+							<xsl:value-of select="$name" />
+						</a>
+					</xsl:when>
+					<xsl:when test="key('IDENTS',$name) and $STDOUT='true'">
+						<a xmlns="http://www.w3.org/1999/xhtml" class="link_element">
+							<xsl:attribute name="href">
                 <xsl:call-template name="getSpecURL">
                   <xsl:with-param name="name">
-                    <xsl:value-of select="$name"/>
+                    <xsl:value-of select="$name" />
                   </xsl:with-param>
                   <xsl:with-param name="type">
-                    <xsl:value-of select="substring-before(local-name(),'Spec')"/>
+                    <xsl:value-of
+								select="substring-before(local-name(),'Spec')" />
                   </xsl:with-param>
                 </xsl:call-template>
               </xsl:attribute>
-              <xsl:value-of select="$name"/>
-            </a>
-          </xsl:when>
-          <xsl:when test="key('IDENTS',$name)">
-            <a xmlns="http://www.w3.org/1999/xhtml" class="link_element" href="ref-{$name}{$outputSuffix}">
-              <xsl:value-of select="$name"/>
-            </a>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="$name"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="$oddmode='pdf'">
-        <fo:inline font-style="italic">
-          <xsl:value-of select="$name"/>
-        </fo:inline>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="$name"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="processSpecDesc">
-    <xsl:variable name="name">
-      <xsl:value-of select="@key"/>
-    </xsl:variable>
-    <xsl:variable name="atts">
-      <xsl:choose>
-        <xsl:when test="@rend='noatts'">-</xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="normalize-space(@atts)"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$name=''">
-        <xsl:message>ERROR: no key attribute on specDesc</xsl:message>
-      </xsl:when>
-      <xsl:when test="key('IDENTS',$name)">
-        <xsl:apply-templates mode="show" select="key('IDENTS',$name)">
-          <xsl:with-param name="atts" select="$atts"/>
-        </xsl:apply-templates>
-      </xsl:when>
-      <xsl:when test="not($localsource='')">
-        <xsl:for-each select="document($localsource)/tei:TEI">
-          <xsl:apply-templates mode="show" select="tei:*[@ident=$name]">
-            <xsl:with-param name="atts" select="$atts"/>
-          </xsl:apply-templates>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>UNKNOWN ELEMENT </xsl:text>
-        <xsl:value-of select="$name"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="processatts">
-    <xsl:param name="values"/>
-    <xsl:variable name="here" select="."/>
-    <xsl:for-each select="tokenize($values, ' ')">
-      <xsl:variable name="v" select="."/>
-      <xsl:for-each select="$here">
-        <xsl:apply-templates select="key('IDENTS',.)"/>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element attList</desc>
-  </doc>
-  <xsl:template match="tei:attList" mode="show">
-    <xsl:call-template name="displayAttList">
-      <xsl:with-param name="mode">summary</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="makeTagsetInfo">
-    <xsl:value-of select="@module"/>
-    <xsl:for-each select="key('MODULES',@module)/ancestor::tei:div[last()]">
-      <xsl:text> — </xsl:text>
-      <xsl:call-template name="makeInternalLink">
-        <xsl:with-param name="target" select="@xml:id"/>
-        <xsl:with-param name="ptr" select="true()"/>
-        <xsl:with-param name="dest">
-          <xsl:value-of select="tei:head"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="generateChildren">
-    <xsl:variable name="name" select="@ident"/>
-    <xsl:variable name="Original" select="/"/>
-    <xsl:choose>
-      <xsl:when test="tei:content//rng:ref[@name='macro.anyXML']">
-        <xsl:element namespace="{$outputNS}" name="{$segName}">
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+							<xsl:value-of select="$name" />
+						</a>
+					</xsl:when>
+					<xsl:when test="key('IDENTS',$name)">
+						<a xmlns="http://www.w3.org/1999/xhtml" class="link_element"
+							href="ref-{$name}{$outputSuffix}">
+							<xsl:value-of select="$name" />
+						</a>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$name" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="$oddmode='pdf'">
+				<fo:inline font-style="italic">
+					<xsl:value-of select="$name" />
+				</fo:inline>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$name" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="processSpecDesc">
+		<xsl:variable name="name">
+			<xsl:value-of select="@key" />
+		</xsl:variable>
+		<xsl:variable name="atts">
+			<xsl:choose>
+				<xsl:when test="@rend='noatts'">
+					-
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="normalize-space(@atts)" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$name=''">
+				<xsl:message>
+					ERROR: no key attribute on specDesc
+				</xsl:message>
+			</xsl:when>
+			<xsl:when test="key('IDENTS',$name)">
+				<xsl:apply-templates mode="show"
+					select="key('IDENTS',$name)">
+					<xsl:with-param name="atts" select="$atts" />
+				</xsl:apply-templates>
+			</xsl:when>
+			<xsl:when test="not($localsource='')">
+				<xsl:for-each select="document($localsource)/tei:TEI">
+					<xsl:apply-templates mode="show"
+						select="tei:*[@ident=$name]">
+						<xsl:with-param name="atts" select="$atts" />
+					</xsl:apply-templates>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>UNKNOWN ELEMENT </xsl:text>
+				<xsl:value-of select="$name" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="processatts">
+		<xsl:param name="values" />
+		<xsl:variable name="here" select="." />
+		<xsl:for-each select="tokenize($values, ' ')">
+			<xsl:variable name="v" select="." />
+			<xsl:for-each select="$here">
+				<xsl:apply-templates select="key('IDENTS',.)" />
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element attList</desc>
+	</doc>
+	<xsl:template match="tei:attList" mode="show">
+		<xsl:call-template name="displayAttList">
+			<xsl:with-param name="mode">
+				summary
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="makeTagsetInfo">
+		<xsl:value-of select="@module" />
+		<xsl:for-each
+			select="key('MODULES',@module)/ancestor::tei:div[last()]">
+			<xsl:text> — </xsl:text>
+			<xsl:call-template name="makeInternalLink">
+				<xsl:with-param name="target" select="@xml:id" />
+				<xsl:with-param name="ptr" select="true()" />
+				<xsl:with-param name="dest">
+					<xsl:value-of select="tei:head" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="generateChildren">
+		<xsl:variable name="name" select="@ident" />
+		<xsl:variable name="Original" select="/" />
+		<xsl:choose>
+			<xsl:when test="tei:content//rng:ref[@name='macro.anyXML']">
+				<xsl:element namespace="{$outputNS}" name="{$segName}">
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:text>ANY</xsl:text>
-        </xsl:element>
-      </xsl:when>
-      <xsl:when test="tei:content/rng:empty">
-        <xsl:element namespace="{$outputNS}" name="{$segName}">
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+					<xsl:text>ANY</xsl:text>
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="tei:content/rng:empty">
+				<xsl:element namespace="{$outputNS}" name="{$segName}">
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Empty element</xsl:with-param>
-          </xsl:call-template>
-        </xsl:element>
-      </xsl:when>
-      <xsl:when test="tei:content/rng:text and    count(tei:content/rng:*)=1">
-        <xsl:element namespace="{$outputNS}" name="{$segName}">
-          <xsl:attribute name="xml:lang">
-            <xsl:value-of select="$documentationLanguage"/>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Empty element
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+			</xsl:when>
+			<xsl:when
+				test="tei:content/rng:text and    count(tei:content/rng:*)=1">
+				<xsl:element namespace="{$outputNS}" name="{$segName}">
+					<xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage" />
           </xsl:attribute>
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Character data only</xsl:with-param>
-          </xsl:call-template>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="Children">
-          <xsl:for-each select="tei:content">
-            <xsl:call-template name="followRef"/>
-          </xsl:for-each>
-        </xsl:variable>
-        <xsl:call-template name="displayElementsByModule">
-          <xsl:with-param name="List">
-            <xsl:copy-of select="$Children"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="displayElementsByModule">
-    <xsl:param name="List"/>
-    <xsl:variable name="here" select="."/>
-    <xsl:for-each select="$List">
-      <xsl:choose>
-        <xsl:when test="Element[@type='Text'] and count(Element)=1">
-          <xsl:element namespace="{$outputNS}" name="{$segName}">
-            <xsl:attribute name="xml:lang">
-              <xsl:value-of select="$documentationLanguage"/>
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Character data only
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="Children">
+					<xsl:for-each select="tei:content">
+						<xsl:call-template name="followRef" />
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:call-template name="displayElementsByModule">
+					<xsl:with-param name="List">
+						<xsl:copy-of select="$Children" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="displayElementsByModule">
+		<xsl:param name="List" />
+		<xsl:variable name="here" select="." />
+		<xsl:for-each select="$List">
+			<xsl:choose>
+				<xsl:when test="Element[@type='Text'] and count(Element)=1">
+					<xsl:element namespace="{$outputNS}" name="{$segName}">
+						<xsl:attribute name="xml:lang">
+              <xsl:value-of
+							select="$documentationLanguage" />
             </xsl:attribute>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">Character data only</xsl:with-param>
-            </xsl:call-template>
-          </xsl:element>
-        </xsl:when>
-        <xsl:when test="count(Element)=0">
-          <xsl:element namespace="{$outputNS}" name="{$segName}">
-            <xsl:attribute name="xml:lang">
-              <xsl:value-of select="$documentationLanguage"/>
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								Character data only
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:element>
+				</xsl:when>
+				<xsl:when test="count(Element)=0">
+					<xsl:element namespace="{$outputNS}" name="{$segName}">
+						<xsl:attribute name="xml:lang">
+              <xsl:value-of
+							select="$documentationLanguage" />
             </xsl:attribute>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">Empty element</xsl:with-param>
-            </xsl:call-template>
-          </xsl:element>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:element namespace="{$outputNS}" name="{$divName}">
-            <xsl:attribute name="{$rendName}">
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								Empty element
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:element>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:element namespace="{$outputNS}" name="{$divName}">
+						<xsl:attribute name="{$rendName}">
               <xsl:text>specChildren</xsl:text>
             </xsl:attribute>
-            <xsl:for-each-group select="*" group-by="@module">
-              <xsl:sort select="@module"/>
-              <xsl:element namespace="{$outputNS}" name="{$divName}">
-                <xsl:attribute name="{$rendName}">
+						<xsl:for-each-group select="*"
+							group-by="@module">
+							<xsl:sort select="@module" />
+							<xsl:element namespace="{$outputNS}"
+								name="{$divName}">
+								<xsl:attribute name="{$rendName}">
                   <xsl:text>specChild</xsl:text>
                 </xsl:attribute>
-                <xsl:if test="string-length(current-grouping-key())&gt;0">
-                  <xsl:element namespace="{$outputNS}" name="{$segName}">
-                    <xsl:attribute name="{$rendName}">
+								<xsl:if test="string-length(current-grouping-key())&gt;0">
+									<xsl:element namespace="{$outputNS}"
+										name="{$segName}">
+										<xsl:attribute name="{$rendName}">
                       <xsl:text>specChildModule</xsl:text>
                     </xsl:attribute>
-                    <xsl:value-of select="current-grouping-key()"/>
-                    <xsl:text>: </xsl:text>
-                  </xsl:element>
-                </xsl:if>
-                <xsl:element namespace="{$outputNS}" name="{$segName}">
-                  <xsl:attribute name="{$rendName}">
+										<xsl:value-of select="current-grouping-key()" />
+										<xsl:text>: </xsl:text>
+									</xsl:element>
+								</xsl:if>
+								<xsl:element namespace="{$outputNS}"
+									name="{$segName}">
+									<xsl:attribute name="{$rendName}">
                     <xsl:text>specChildElements</xsl:text>
                   </xsl:attribute>
-                  <xsl:for-each-group select="current-group()" group-by="@altName">
-                    <xsl:sort select="@altName"/>
-                    <xsl:variable name="me" select="@name"/>
-                    <xsl:variable name="alt" select="@altName"/>
-                    <xsl:variable name="type" select="@type"/>
-                    <xsl:for-each select="$here">
-                      <xsl:call-template name="linkTogether">
-                        <xsl:with-param name="name" select="$me"/>
-                        <xsl:with-param name="reftext" select="$alt"/>
-                        <xsl:with-param name="class">link_odd_<xsl:value-of select="$type"/></xsl:with-param>
-                      </xsl:call-template>
-                    </xsl:for-each>
-                    <xsl:if test="not(position() = last())">
-                      <xsl:call-template name="showSpaceBetweenItems"/>
-                    </xsl:if>
-                  </xsl:for-each-group>
-                </xsl:element>
-              </xsl:element>
-            </xsl:for-each-group>
-          </xsl:element>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="followRef">
-    <xsl:for-each select=".//rng:ref">
-      <xsl:if test="not(starts-with(@name,'any')        or starts-with(@name,'macro.any')       or @name='AnyThing')">
-        <xsl:variable name="Name">
-          <xsl:choose>
-            <xsl:when test="contains(@name,'_sequence')">
-              <xsl:value-of select="substring-before(@name,'_')"/>
-            </xsl:when>
-            <xsl:when test="contains(@name,'_alternat')">
-              <xsl:value-of select="substring-before(@name,'_')"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@name"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:for-each select="key('IDENTS',$Name)">
-          <xsl:choose>
-            <xsl:when test="self::tei:elementSpec">
-              <Element name="{@ident}" module="{@module}" type="{local-name()}">
-                <xsl:attribute name="altName">
+									<xsl:for-each-group select="current-group()"
+										group-by="@altName">
+										<xsl:sort select="@altName" />
+										<xsl:variable name="me" select="@name" />
+										<xsl:variable name="alt" select="@altName" />
+										<xsl:variable name="type" select="@type" />
+										<xsl:for-each select="$here">
+											<xsl:call-template name="linkTogether">
+												<xsl:with-param name="name" select="$me" />
+												<xsl:with-param name="reftext" select="$alt" />
+												<xsl:with-param name="class">
+													link_odd_
+													<xsl:value-of select="$type" />
+												</xsl:with-param>
+											</xsl:call-template>
+										</xsl:for-each>
+										<xsl:if test="not(position() = last())">
+											<xsl:call-template
+												name="showSpaceBetweenItems" />
+										</xsl:if>
+									</xsl:for-each-group>
+								</xsl:element>
+							</xsl:element>
+						</xsl:for-each-group>
+					</xsl:element>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="followRef">
+		<xsl:for-each select=".//rng:ref">
+			<xsl:if
+				test="not(starts-with(@name,'any')        or starts-with(@name,'macro.any')       or @name='AnyThing')">
+				<xsl:variable name="Name">
+					<xsl:choose>
+						<xsl:when test="contains(@name,'_sequence')">
+							<xsl:value-of select="substring-before(@name,'_')" />
+						</xsl:when>
+						<xsl:when test="contains(@name,'_alternat')">
+							<xsl:value-of select="substring-before(@name,'_')" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@name" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:for-each select="key('IDENTS',$Name)">
+					<xsl:choose>
+						<xsl:when test="self::tei:elementSpec">
+							<Element name="{@ident}" module="{@module}"
+								type="{local-name()}">
+								<xsl:attribute name="altName">
                   <xsl:choose>
                     <xsl:when test="tei:altIdent">
-                      <xsl:value-of select="tei:altIdent"/>
+                      <xsl:value-of select="tei:altIdent" />
                     </xsl:when>
                     <xsl:otherwise>
-                      <xsl:value-of select="@ident"/>
+                      <xsl:value-of select="@ident" />
                     </xsl:otherwise>
                   </xsl:choose>
                 </xsl:attribute>
-              </Element>
-            </xsl:when>
-            <xsl:when test="self::tei:macroSpec">
-              <xsl:for-each select="tei:content">
-                <xsl:choose>
-                  <xsl:when test="rng:text and count(rng:*)=1">
-                    <Element type="TEXT"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:call-template name="followRef"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </xsl:for-each>
-            </xsl:when>
-            <xsl:when test="self::tei:classSpec">
-              <xsl:call-template name="followMembers"/>
-            </xsl:when>
-          </xsl:choose>
-        </xsl:for-each>
-      </xsl:if>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="followMembers">
-    <xsl:for-each select="key('CLASSMEMBERS',@ident)">
-      <xsl:choose>
-        <xsl:when test="self::tei:elementSpec">
-          <Element name="{@ident}" module="{@module}"
-		   type="{local-name()}">
-	    <xsl:attribute name="altName">
+							</Element>
+						</xsl:when>
+						<xsl:when test="self::tei:macroSpec">
+							<xsl:for-each select="tei:content">
+								<xsl:choose>
+									<xsl:when test="rng:text and count(rng:*)=1">
+										<Element type="TEXT" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:call-template name="followRef" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:for-each>
+						</xsl:when>
+						<xsl:when test="self::tei:classSpec">
+							<xsl:call-template name="followMembers" />
+						</xsl:when>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="followMembers">
+		<xsl:for-each select="key('CLASSMEMBERS',@ident)">
+			<xsl:choose>
+				<xsl:when test="self::tei:elementSpec">
+					<Element name="{@ident}" module="{@module}"
+						type="{local-name()}">
+						<xsl:attribute name="altName">
 	      <xsl:choose>
 		<xsl:when test="tei:altIdent">
-		  <xsl:value-of select="tei:altIdent"/>
+		  <xsl:value-of select="tei:altIdent" />
 		</xsl:when>
 		<xsl:otherwise>
-		  <xsl:value-of select="@ident"/>
+		  <xsl:value-of select="@ident" />
 		</xsl:otherwise>
 	      </xsl:choose>
 	    </xsl:attribute>
-	  </Element>
-        </xsl:when>
-        <xsl:when test="self::tei:classSpec">
-          <xsl:call-template name="followMembers"/>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
+					</Element>
+				</xsl:when>
+				<xsl:when test="self::tei:classSpec">
+					<xsl:call-template name="followMembers" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/textstructure.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/textstructure.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/textstructure.xsl	(revision 2397)
@@ -1,101 +1,116 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the textstructure
-      module. </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the textstructure
+				module.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: textstructure.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Establish nesting depth of sections</desc>
-   </doc>
-  <xsl:template match="tei:text" mode="depth">
-    <xsl:value-of select="count(ancestor::tei:text)-1"/>
-  </xsl:template>
-  <xsl:template match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
-                 mode="depth">
-      <xsl:choose>
-	<xsl:when test="ancestor::tei:text/parent::tei:group and
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: textstructure.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Establish nesting depth of sections</desc>
+	</doc>
+	<xsl:template match="tei:text" mode="depth">
+		<xsl:value-of select="count(ancestor::tei:text)-1" />
+	</xsl:template>
+	<xsl:template
+		match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
+		mode="depth">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor::tei:text/parent::tei:group and
 			self::tei:div">
-	   <xsl:value-of select="count(ancestor::tei:div) + 1"/>
-	</xsl:when>
-         <xsl:when test="local-name(.) = 'div'">
-            <xsl:value-of select="count(ancestor::tei:div)"/>
-         </xsl:when>
-	<xsl:when test="ancestor::tei:text/parent::tei:group">
-	   <xsl:value-of select="number(substring-after(local-name(.),'div')) "/>
-	</xsl:when>
-	<xsl:when test="ancestor::tei:text/parent::tei:group">
-	  <xsl:value-of select="number(substring-after(local-name(.),'div'))"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="number(substring-after(local-name(.),'div')) - 1"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+				<xsl:value-of select="count(ancestor::tei:div) + 1" />
+			</xsl:when>
+			<xsl:when test="local-name(.) = 'div'">
+				<xsl:value-of select="count(ancestor::tei:div)" />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:text/parent::tei:group">
+				<xsl:value-of
+					select="number(substring-after(local-name(.),'div')) " />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:text/parent::tei:group">
+				<xsl:value-of
+					select="number(substring-after(local-name(.),'div'))" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="number(substring-after(local-name(.),'div')) - 1" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Generate revision description</desc>
-  </doc>
-  <xsl:template match="tei:divGen[@type='revHist']">
-    <xsl:variable name="r">
-      <div xmlns="http://www.tei-c.org/ns/1.0" rend='nonumber'>
-	<head>Revision history</head>
-	<table rend="rules" >
-	  <xsl:for-each
-	      select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change">
-	    <row>
-	      <cell><xsl:value-of select="@when"/></cell>
-	      <cell><xsl:value-of select="@who"/></cell>
-	      <cell><xsl:value-of select="."/></cell>
-	    </row>
-	  </xsl:for-each>
-	</table>
-      </div>
-    </xsl:variable>
-    <xsl:for-each select="$r">
-      <xsl:apply-templates/>
-    </xsl:for-each>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Generate revision description</desc>
+	</doc>
+	<xsl:template match="tei:divGen[@type='revHist']">
+		<xsl:variable name="r">
+			<div xmlns="http://www.tei-c.org/ns/1.0" rend='nonumber'>
+				<head>Revision history</head>
+				<table rend="rules">
+					<xsl:for-each
+						select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change">
+						<row>
+							<cell>
+								<xsl:value-of select="@when" />
+							</cell>
+							<cell>
+								<xsl:value-of select="@who" />
+							</cell>
+							<cell>
+								<xsl:value-of select="." />
+							</cell>
+						</row>
+					</xsl:for-each>
+				</table>
+			</div>
+		</xsl:variable>
+		<xsl:for-each select="$r">
+			<xsl:apply-templates />
+		</xsl:for-each>
+	</xsl:template>
 
 
 
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/textcrit.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/textcrit.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/textcrit.xsl	(revision 2397)
@@ -1,97 +1,103 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing with elements from the
-      textcrit module.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				textcrit module.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-   <xsl:key name="APP" match="tei:app" use="1"/>
-   
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process element app</p>
-         <p>Process lem and rdg within app. Sends lots of information
-	 to a footnote. If a lem is not found, the first rdg is
-	 used as the base text. 
-	 </p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:app">
-    <xsl:call-template name="appReading">
-      <xsl:with-param name="lemma">
-	<xsl:choose>
-	  <xsl:when test="tei:lem">
-	    <xsl:value-of select="tei:lem"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="tei:rdg[1]"/>
-	</xsl:otherwise>
-      </xsl:choose>
-      </xsl:with-param>
-      <xsl:with-param name="lemmawitness">
-      <xsl:value-of select="@wit"/>
-      </xsl:with-param>
-      <xsl:with-param name="readings">
-	<xsl:for-each select="tei:rdg">
-	  <xsl:choose>
-	    <xsl:when test="not(../tei:lem) and position()=1"/>
-	    <xsl:otherwise>
-	      <xsl:value-of select="."/>
-	      <xsl:text>(</xsl:text>
-	      <xsl:value-of select="translate(substring(@wit,2),' #',', ')"/>
-	      <xsl:text>)</xsl:text>
-	  </xsl:otherwise>
-	  </xsl:choose>
-	  <xsl:if test="following-sibling::tei:rdg">; </xsl:if>
-	</xsl:for-each>
-      </xsl:with-param>
-    </xsl:call-template>
-    </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
+	<xsl:key name="APP" match="tei:app" use="1" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element app</p>
+			<p>Process lem and rdg within app. Sends lots of information
+				to a footnote. If a lem is not found, the first rdg is
+				used as the base text.
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:app">
+		<xsl:call-template name="appReading">
+			<xsl:with-param name="lemma">
+				<xsl:choose>
+					<xsl:when test="tei:lem">
+						<xsl:value-of select="tei:lem" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="tei:rdg[1]" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:with-param>
+			<xsl:with-param name="lemmawitness">
+				<xsl:value-of select="@wit" />
+			</xsl:with-param>
+			<xsl:with-param name="readings">
+				<xsl:for-each select="tei:rdg">
+					<xsl:choose>
+						<xsl:when test="not(../tei:lem) and position()=1" />
+						<xsl:otherwise>
+							<xsl:value-of select="." />
+							<xsl:text>(</xsl:text>
+							<xsl:value-of
+								select="translate(substring(@wit,2),' #',', ')" />
+							<xsl:text>)</xsl:text>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:if test="following-sibling::tei:rdg">
+						;
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/core.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/core.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/core.xsl	(revision 2397)
@@ -1,879 +1,1019 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the core module. </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module. </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: core.xsl 10010 2012-01-03 19:35:49Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:output indent="no"/>
-    <xsl:strip-space elements="tei:author tei:forename tei:surname tei:editor"/>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <xsl:key name="MNAMES"
-            match="tei:monogr/tei:author[tei:surname]|tei:monogr/tei:editor[tei:surname]"
-            use="ancestor::tei:biblStruct/@xml:id"/>
-  <xsl:key name="ANAMES"
-            match="tei:analytic/tei:author[tei:surname]|tei:analytic/tei:editor[tei:surname]"
-            use="ancestor::tei:biblStruct/@xml:id"/>
-  
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process all elements to find out their nesting depth</desc>
-   </doc>
-  <xsl:template match="tei:*" mode="depth">99</xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process all elements in plain mode</desc>
-   </doc>
-  <xsl:template match="tei:*" mode="plain">
-      <xsl:apply-templates mode="plain"/>
-  </xsl:template>
-  <xsl:template match="tei:note" mode="plain"/>
-  <xsl:template match="tei:app" mode="plain"/>
-  <xsl:template match="tei:pb" mode="plain"/>
-  <xsl:template match="tei:lb" mode="plain"/>
-  <xsl:template match="tei:figure" mode="plain"/>
-  <xsl:template match="tei:figDesc" mode="plain"/>
-  <xsl:template match="tei:ptr" mode="plain"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process tei:sic</desc>
-   </doc>
-  <xsl:template match="tei:sic">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process tei:corr</desc>
-   </doc>
-  <xsl:template match="tei:corr"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process tei:item in runin mode</desc>
-   </doc>
-  <xsl:template match="tei:item" mode="runin">
-      <xsl:text> • </xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>&#160;</xsl:text>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: core.xsl 10010 2012-01-03 19:35:49Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output indent="no" />
+	<xsl:strip-space
+		elements="tei:author tei:forename tei:surname tei:editor" />
 
+	<xsl:key name="MNAMES"
+		match="tei:monogr/tei:author[tei:surname]|tei:monogr/tei:editor[tei:surname]"
+		use="ancestor::tei:biblStruct/@xml:id" />
+	<xsl:key name="ANAMES"
+		match="tei:analytic/tei:author[tei:surname]|tei:analytic/tei:editor[tei:surname]"
+		use="ancestor::tei:biblStruct/@xml:id" />
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element edition</desc>
-   </doc>
-  <xsl:template match="tei:edition">
-      <xsl:apply-templates/>
-      <xsl:if test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
-         <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters">. </xsl:with-param>
-	 </xsl:call-template>
-      </xsl:if>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process all elements to find out their nesting depth</desc>
+	</doc>
+	<xsl:template match="tei:*" mode="depth">
+		99
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process all elements in plain mode</desc>
+	</doc>
+	<xsl:template match="tei:*" mode="plain">
+		<xsl:apply-templates mode="plain" />
+	</xsl:template>
+	<xsl:template match="tei:note" mode="plain" />
+	<xsl:template match="tei:app" mode="plain" />
+	<xsl:template match="tei:pb" mode="plain" />
+	<xsl:template match="tei:lb" mode="plain" />
+	<xsl:template match="tei:figure" mode="plain" />
+	<xsl:template match="tei:figDesc" mode="plain" />
+	<xsl:template match="tei:ptr" mode="plain" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process tei:sic</desc>
+	</doc>
+	<xsl:template match="tei:sic">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process tei:corr</desc>
+	</doc>
+	<xsl:template match="tei:corr" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process tei:item in runin mode</desc>
+	</doc>
+	<xsl:template match="tei:item" mode="runin">
+		<xsl:text> • </xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>&#160;</xsl:text>
+	</xsl:template>
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element imprint</desc>
-   </doc>
-  <xsl:template match="tei:imprint">
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
-	           <xsl:apply-templates select="tei:date"/>
-	           <xsl:apply-templates select="tei:pubPlace"/>
-	           <xsl:apply-templates select="tei:publisher"/>
-	           <xsl:apply-templates select="tei:biblScope"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
 
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element edition</desc>
+	</doc>
+	<xsl:template match="tei:edition">
+		<xsl:apply-templates />
+		<xsl:if
+			test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
+			<xsl:call-template name="tei:makeText">
+				<xsl:with-param name="letters">
+					.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
 
-   <!-- biblStruct -->
-<xsl:template match="tei:biblStruct" mode="xref">
-      <xsl:choose>
-         <xsl:when test="count(key('ANAMES',@xml:id))=1">
-	           <xsl:value-of select="key('ANAMES',@xml:id)/tei:surname"/>
-         </xsl:when>
-         <xsl:when test="count(key('ANAMES',@xml:id))=2">
-	           <xsl:value-of select="key('ANAMES',@xml:id)[1]/tei:surname"/>
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters"> and </xsl:with-param>
-		   </xsl:call-template>
-	           <xsl:value-of select="key('ANAMES',@xml:id)[2]/tei:surname"/>
-         </xsl:when>
-         <xsl:when test="count(key('ANAMES',@xml:id))&gt;2">
-	           <xsl:value-of select="key('ANAMES',@xml:id)[1]/tei:surname"/>
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters"> et al.</xsl:with-param>
-		   </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="count(key('MNAMES',@xml:id))=1">
-	           <xsl:value-of select="key('MNAMES',@xml:id)/tei:surname"/>
-         </xsl:when>
-         <xsl:when test="count(key('MNAMES',@xml:id))=2">
-	           <xsl:value-of select="key('MNAMES',@xml:id)[1]/tei:surname"/>
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters"> and </xsl:with-param>
-		   </xsl:call-template>
-	           <xsl:value-of select="key('MNAMES',@xml:id)[2]/tei:surname"/>
-         </xsl:when>
-         <xsl:when test="count(key('MNAMES',@xml:id))&gt;2">
-	           <xsl:value-of select="key('MNAMES',@xml:id)[1]/tei:surname"/>
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters"> et al.</xsl:with-param>
-		   </xsl:call-template>
-         </xsl:when>
-         <xsl:when test=".//tei:author[tei:surname]">
-	           <xsl:value-of select=".//tei:author/tei:surname[1]"/>
-         </xsl:when>
-         <xsl:when test=".//tei:author[tei:orgName]">
-	           <xsl:value-of select=".//tei:author/tei:orgName[1]"/>
-         </xsl:when>
-         <xsl:when test=".//tei:author">
-	           <xsl:value-of select=".//tei:author[1]"/>
-         </xsl:when>
-         <xsl:when test=".//tei:editor[tei:surname]">
-	           <xsl:value-of select=".//tei:editor/tei:surname[1]"/>
-         </xsl:when>
-         <xsl:when test=".//tei:editor">
-	           <xsl:value-of select=".//tei:editor[1]"/>
-         </xsl:when>
-         <xsl:otherwise>
-	           <xsl:value-of select=".//tei:title[1]"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:choose>
-         <xsl:when test="count(tei:*[1]/tei:editor)=1">
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters"> (ed.)</xsl:with-param>
-		   </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="count(tei:*[1]/tei:editor)&gt;1">
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters"> (eds.)</xsl:with-param>
-		   </xsl:call-template>
-         </xsl:when>
-      </xsl:choose>
-      <xsl:choose>
-         <xsl:when test="tei:monogr/tei:imprint/tei:date/@when">
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters"> (</xsl:with-param>
-		   </xsl:call-template>
-	           <xsl:value-of select="substring-before(tei:monogr/tei:imprint/tei:date/@when,'-')"/>
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters">)</xsl:with-param>
-		   </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="tei:monogr/tei:imprint/tei:date">
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters"> (</xsl:with-param>
-		   </xsl:call-template>
-	           <xsl:value-of select="tei:monogr/tei:imprint/tei:date"/>
-	           <xsl:call-template name="tei:makeText">
-		     <xsl:with-param name="letters">)</xsl:with-param>
-		   </xsl:call-template>
-         </xsl:when>
-      </xsl:choose>
-   </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element imprint</desc>
+	</doc>
+	<xsl:template match="tei:imprint">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
+				<xsl:apply-templates select="tei:date" />
+				<xsl:apply-templates select="tei:pubPlace" />
+				<xsl:apply-templates select="tei:publisher" />
+				<xsl:apply-templates select="tei:biblScope" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
 
-   <!-- authors and editors -->
-   <xsl:template match="tei:editor|tei:author">
-     <xsl:choose>
-       <xsl:when test="ancestor::tei:bibl">
-	 <xsl:apply-templates/>
-       </xsl:when>
-       <xsl:when test="self::tei:author and not(following-sibling::tei:author)">
-	 <xsl:apply-templates/>
-	 <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters">. </xsl:with-param>
-	 </xsl:call-template>
-       </xsl:when>
-       <xsl:when test="self::tei:editor and not(following-sibling::tei:editor)">
-	 <xsl:apply-templates/>
-	 <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters"> (ed</xsl:with-param>
-	 </xsl:call-template>
-	 <xsl:if test="preceding-sibling::tei:editor">s</xsl:if>
-	 <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters">.) </xsl:with-param>
-	 </xsl:call-template>
-       </xsl:when>
-       <xsl:otherwise>
-	 <xsl:apply-templates/>
-	 <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters">, </xsl:with-param>
-	 </xsl:call-template>
-       </xsl:otherwise>
-     </xsl:choose>
-   </xsl:template>
+	</xsl:template>
 
-   <xsl:template match="tei:author|tei:editor" mode="mla">
-     <!-- <xsl:variable name="totalNbr">
-	  <xsl:number select="ancestor::tei:listBibl"/>
-        </xsl:variable>
-        <xsl:value-of select="$totalNbr"/>. 
-        <xsl:choose>
-        <xsl:when test="self::tei:author[1] = parent::tei:analytic/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/*/tei:author[1] or self::tei:author[1] =
-        parent::tei:analytic/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/tei:monogr/tei:editor[1]">
-        <xsl:text>[three hyphens]</xsl:text>
-        <xsl:choose>
-        <xsl:when test="self::tei:author and following-sibling::tei:author"><xsl:text>, </xsl:text></xsl:when>
-        <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
-        </xsl:choose>
-        </xsl:when>
-        <xsl:when test="self::tei:author[1] = parent::tei:monogr/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/*/tei:author[1] and not(preceding-sibling::tei:analytic) or self::tei:author[1] =
-        parent::tei:monogr/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/tei:monogr/tei:editor[1] and not(preceding-sibling::tei:analytic)">
-        <xsl:text>[three hyphens]</xsl:text>
-        <xsl:choose>
-        <xsl:when test="self::tei:author and following-sibling::tei:author"><xsl:text>, </xsl:text></xsl:when>
-        <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
-        </xsl:choose>
-        </xsl:when>
-        <xsl:when test="self::tei:editor[1] = parent::tei:*/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/*/tei:author[1] and
-        not(preceding-sibling::tei:analytic) or self::tei:editor[1]
-        = parent::tei:*/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/tei:monogr/tei:editor[1] and not(preceding-sibling::tei:analytic)">
-        <xsl:text>[three hyphens]</xsl:text>
-        <xsl:text>, </xsl:text>
-        </xsl:when> 
-        TAKE OUT THE EXTRA OPEN CHOOSE BEFORE YOU ADD THIS BACK IN-->
-     <xsl:choose>
-       <xsl:when test="self::tei:author and not(following-sibling::tei:author)">
-	 <xsl:choose>
-	   <xsl:when test="ancestor::tei:biblStruct and not(preceding-sibling::tei:author)">
-	     <xsl:apply-templates/>
-	     <xsl:if test="not(ends-with(.,'.'))">
-	       <xsl:text>. </xsl:text>
-	     </xsl:if>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:if test="not(self::tei:author[3])">
-	       <xsl:text> and </xsl:text>
-	     </xsl:if>
-	     <xsl:choose>
-	       <xsl:when test="contains(self::tei:author, ',')">
-		 <xsl:value-of select="substring-after(., ',')"/>
-		 <xsl:text> </xsl:text>
-		 <xsl:value-of select="substring-before(., ',')"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	     <xsl:if test="not(ends-with(.,'.'))">
-	       <xsl:text>. </xsl:text>
-	     </xsl:if>
-	   </xsl:otherwise>
-	 </xsl:choose>
-	 <xsl:text> </xsl:text>
-       </xsl:when>
-       <xsl:when test="self::tei:author and following-sibling::tei:author">
-	 <xsl:choose>
-	   <xsl:when test="ancestor::tei:biblStruct and not(preceding-sibling::tei:author)">
-	     <xsl:apply-templates/>
-	     <xsl:text>, </xsl:text>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:choose>
-	       <xsl:when test="contains(self::tei:author, ',')">
-		 <xsl:value-of select="substring-after(., ',')"/>
-		 <xsl:text> </xsl:text>
-		 <xsl:value-of select="substring-before(., ',')"/>
-		 <xsl:text>, and </xsl:text>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-		 <xsl:text>, and </xsl:text>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:otherwise>
-	 </xsl:choose>
-       </xsl:when>
-       <xsl:when test="self::tei:editor[@role='translator'] and ancestor::tei:biblStruct">
-	 <xsl:choose>
-	   <xsl:when test="preceding-sibling::tei:editor[@role='editor']/text() = self::tei:editor[@role='translator']/text()">
-	     <xsl:text>Ed. and Trans. </xsl:text>
-	   </xsl:when>
-	   <xsl:when test="not(preceding-sibling::tei:editor[@role='translator'])">				
-	     <xsl:text>Trans. </xsl:text>
-	   </xsl:when>
-	   <xsl:when test="preceding-sibling::tei:editor[@role='translator'] and following-sibling::tei:editor[@role='translator']">
-	     <xsl:text>, </xsl:text>
-	   </xsl:when>
-	   <xsl:otherwise><xsl:text> and </xsl:text></xsl:otherwise>
-	 </xsl:choose>
-	 <xsl:choose>
-	   <xsl:when test="contains(self::tei:editor[@role='translator'], ',')">
-	     <xsl:value-of select="substring-after(., ',')"/>
-	     <xsl:text> </xsl:text>
-	     <xsl:value-of select="substring-before(., ',')"/>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:apply-templates/>
-	   </xsl:otherwise>
-	 </xsl:choose>
-	 <xsl:if test="not(following-sibling::tei:editor[@role='translator'])">
-	   <xsl:text>. </xsl:text>
-	 </xsl:if>
-       </xsl:when>
-       <xsl:when test="self::tei:editor[@role='editor'] and not(parent::tei:monogr/parent::tei:biblStruct/tei:analytic) and not(preceding-sibling::tei:author)">
-	 <xsl:choose>
-	   <xsl:when test="ancestor::tei:biblStruct and not(following-sibling::tei:editor[@role='editor']) and not(preceding-sibling::tei:editor[@role='editor'])">
-	     <xsl:apply-templates/>
-	     <xsl:text>, ed. </xsl:text>
-	   </xsl:when>
-	   <xsl:when test="ancestor::tei:biblStruct and following-sibling::tei:editor[@role='editor'] and not(preceding-sibling::tei:editor[@role='editor'])">
-	     <xsl:apply-templates/>
-	     <xsl:choose>
-	       <xsl:when test="position() + 1 = last()">
-		 <xsl:text> </xsl:text>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:text>, </xsl:text>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:when>
-	   <xsl:when test="ancestor::tei:biblStruct and following-sibling::tei:editor[@role='editor']">
-	     <xsl:choose>
-	       <xsl:when test="contains(self::tei:editor[@role='editor'], ',')">						
-		 <xsl:value-of select="substring-after(., ',')"/>
-		 <xsl:text> </xsl:text>
-		 <xsl:value-of select="substring-before(., ',')"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	     <xsl:choose>
-	       <xsl:when test="position() + 1 = last()">
-		 <xsl:text> </xsl:text>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:text>, </xsl:text>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:when>
-	   <xsl:when test="ancestor::tei:biblStruct and not(following-sibling::tei:editor[@role='editor'])">
-	     <xsl:choose>
-	       <xsl:when test="preceding-sibling::tei:editor[@role='editor']">
-		 <xsl:text>and </xsl:text>
-		 <xsl:choose>
-		   <xsl:when test="contains(self::tei:editor[@role='editor'], ',')">						
-		     <xsl:value-of select="substring-after(., ',')"/>
-		     <xsl:text> </xsl:text>
-		     <xsl:value-of select="substring-before(., ',')"/>
-		   </xsl:when>
-		   <xsl:otherwise>
-		     <xsl:apply-templates/>
-		   </xsl:otherwise>
-		 </xsl:choose>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	     <xsl:choose>
-	       <xsl:when test="../tei:editor[@role='editor'][2]">
-		 <xsl:text>, eds. </xsl:text>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:text>, ed. </xsl:text>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:when>
-	 </xsl:choose>
-       </xsl:when>
-       <xsl:when test="self::tei:editor[@role='editor'] and not(following-sibling::tei:editor[@role='editor'])">
-	 <xsl:choose>
-	   <xsl:when test="ancestor::tei:biblStruct and not(preceding-sibling::tei:editor[@role='editor'])">
-	     <xsl:text>Ed. </xsl:text>
-	     <xsl:choose>
-	       <xsl:when test="contains(self::tei:editor[@role='editor'], ',')">						
-		 <xsl:value-of select="substring-after(., ',')"/>
-		 <xsl:text> </xsl:text>
-		 <xsl:value-of select="substring-before(., ',')"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	     <xsl:text>. </xsl:text>
-	   </xsl:when>
-	   <xsl:when test="ancestor::tei:biblStruct and preceding-sibling::tei:editor[@role='editor']">
-	     <xsl:text>and </xsl:text>
-	     <xsl:choose>
-	       <xsl:when test="contains(self::tei:editor[@role='editor'], ',')">						
-		 <xsl:value-of select="substring-after(., ',')"/>
-		 <xsl:text> </xsl:text>
-		 <xsl:value-of select="substring-before(., ',')"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	     <xsl:text>. </xsl:text>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:apply-templates/>
-	     <xsl:text> (</xsl:text>
-	     <xsl:text>ed</xsl:text>
-	     <xsl:if test="preceding-sibling::tei:editor[@role='editor']">s</xsl:if>
-	     <xsl:text>.</xsl:text>
-	     <xsl:text>) </xsl:text>
-	   </xsl:otherwise>
-	 </xsl:choose>
-       </xsl:when>
-       <xsl:when test="self::tei:editor[@role='editor'] and following-sibling::tei:editor[@role='editor']">
-	 <xsl:choose>
-	   <xsl:when test="ancestor::tei:biblStruct and not(preceding-sibling::tei:editor[@role='editor'])">
-	     <xsl:text>Ed. </xsl:text>
-	     <xsl:choose>
-	       <xsl:when test="contains(self::tei:editor[@role='editor'], ',')">						
-		 <xsl:value-of select="substring-after(., ',')"/>
-		 <xsl:text> </xsl:text>
-		 <xsl:value-of select="substring-before(., ',')"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	     <xsl:choose>
-	       <xsl:when test="position() + 1 = last()">
-		 <xsl:text> </xsl:text>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:text>, </xsl:text>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:when>
-	   <xsl:when test="ancestor::tei:biblStruct and preceding-sibling::tei:editor[@role='editor']">
-	     <xsl:choose>
-	       <xsl:when test="contains(self::tei:editor[@role='editor'], ',')">						
-		 <xsl:value-of select="substring-after(., ',')"/>
-		 <xsl:text> </xsl:text>
-		 <xsl:value-of select="substring-before(., ',')"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	     <xsl:text>, </xsl:text>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:choose>
-	       <xsl:when test="contains(self::tei:editor[@role='editor'], ',')">						
-		 <xsl:value-of select="substring-after(., ',')"/>
-		 <xsl:text> </xsl:text>
-		 <xsl:value-of select="substring-before(., ',')"/>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:apply-templates/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	     <xsl:choose>
-	       <xsl:when test="position() + 1 = last()">
-		 <xsl:text> </xsl:text>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:text>, </xsl:text>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:otherwise>
-	 </xsl:choose>
-       </xsl:when>
-     </xsl:choose>
-   </xsl:template>
-   
-   <xsl:template match="tei:surname">
-      <xsl:if test="../tei:forename">
-         <xsl:apply-templates select="../tei:forename" mode="use"/>
-         <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters"><xsl:text> </xsl:text></xsl:with-param>
-	 </xsl:call-template>
-      </xsl:if>
-      <xsl:if test="../tei:nameLink">
-         <xsl:apply-templates select="../tei:nameLink" mode="use"/>
-         <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters"><xsl:text> </xsl:text></xsl:with-param>
-	 </xsl:call-template>
-      </xsl:if>
-      <xsl:apply-templates/>
-   </xsl:template>
 
-   <xsl:template match="tei:forename">
-   </xsl:template>
+	<!-- biblStruct -->
+	<xsl:template match="tei:biblStruct" mode="xref">
+		<xsl:choose>
+			<xsl:when test="count(key('ANAMES',@xml:id))=1">
+				<xsl:value-of
+					select="key('ANAMES',@xml:id)/tei:surname" />
+			</xsl:when>
+			<xsl:when test="count(key('ANAMES',@xml:id))=2">
+				<xsl:value-of
+					select="key('ANAMES',@xml:id)[1]/tei:surname" />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						and
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of
+					select="key('ANAMES',@xml:id)[2]/tei:surname" />
+			</xsl:when>
+			<xsl:when test="count(key('ANAMES',@xml:id))&gt;2">
+				<xsl:value-of
+					select="key('ANAMES',@xml:id)[1]/tei:surname" />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						et al.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="count(key('MNAMES',@xml:id))=1">
+				<xsl:value-of
+					select="key('MNAMES',@xml:id)/tei:surname" />
+			</xsl:when>
+			<xsl:when test="count(key('MNAMES',@xml:id))=2">
+				<xsl:value-of
+					select="key('MNAMES',@xml:id)[1]/tei:surname" />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						and
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of
+					select="key('MNAMES',@xml:id)[2]/tei:surname" />
+			</xsl:when>
+			<xsl:when test="count(key('MNAMES',@xml:id))&gt;2">
+				<xsl:value-of
+					select="key('MNAMES',@xml:id)[1]/tei:surname" />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						et al.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test=".//tei:author[tei:surname]">
+				<xsl:value-of select=".//tei:author/tei:surname[1]" />
+			</xsl:when>
+			<xsl:when test=".//tei:author[tei:orgName]">
+				<xsl:value-of select=".//tei:author/tei:orgName[1]" />
+			</xsl:when>
+			<xsl:when test=".//tei:author">
+				<xsl:value-of select=".//tei:author[1]" />
+			</xsl:when>
+			<xsl:when test=".//tei:editor[tei:surname]">
+				<xsl:value-of select=".//tei:editor/tei:surname[1]" />
+			</xsl:when>
+			<xsl:when test=".//tei:editor">
+				<xsl:value-of select=".//tei:editor[1]" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select=".//tei:title[1]" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="count(tei:*[1]/tei:editor)=1">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						(ed.)
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="count(tei:*[1]/tei:editor)&gt;1">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						(eds.)
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="tei:monogr/tei:imprint/tei:date/@when">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						(
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of
+					select="substring-before(tei:monogr/tei:imprint/tei:date/@when,'-')" />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						)
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="tei:monogr/tei:imprint/tei:date">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						(
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of select="tei:monogr/tei:imprint/tei:date" />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						)
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:nameLink">
-</xsl:template>
+	<!-- authors and editors -->
+	<xsl:template match="tei:editor|tei:author">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:bibl">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when
+				test="self::tei:author and not(following-sibling::tei:author)">
+				<xsl:apply-templates />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when
+				test="self::tei:editor and not(following-sibling::tei:editor)">
+				<xsl:apply-templates />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						(ed
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if test="preceding-sibling::tei:editor">
+					s
+				</xsl:if>
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						.)
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						,
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:forename" mode="use">
-      <xsl:if test="preceding-sibling::tei:forename">
-         <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters"><xsl:text> </xsl:text></xsl:with-param>
-	 </xsl:call-template>
-      </xsl:if>
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:author|tei:editor" mode="mla">
+		<!-- <xsl:variable name="totalNbr"> <xsl:number select="ancestor::tei:listBibl"/> 
+			</xsl:variable> <xsl:value-of select="$totalNbr"/>. <xsl:choose> <xsl:when 
+			test="self::tei:author[1] = parent::tei:analytic/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/*/tei:author[1] 
+			or self::tei:author[1] = parent::tei:analytic/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/tei:monogr/tei:editor[1]"> 
+			<xsl:text>[three hyphens]</xsl:text> <xsl:choose> <xsl:when test="self::tei:author 
+			and following-sibling::tei:author"><xsl:text>, </xsl:text></xsl:when> <xsl:otherwise><xsl:text>. 
+			</xsl:text></xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="self::tei:author[1] 
+			= parent::tei:monogr/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/*/tei:author[1] 
+			and not(preceding-sibling::tei:analytic) or self::tei:author[1] = parent::tei:monogr/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/tei:monogr/tei:editor[1] 
+			and not(preceding-sibling::tei:analytic)"> <xsl:text>[three hyphens]</xsl:text> 
+			<xsl:choose> <xsl:when test="self::tei:author and following-sibling::tei:author"><xsl:text>, 
+			</xsl:text></xsl:when> <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise> 
+			</xsl:choose> </xsl:when> <xsl:when test="self::tei:editor[1] = parent::tei:*/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/*/tei:author[1] 
+			and not(preceding-sibling::tei:analytic) or self::tei:editor[1] = parent::tei:*/parent::tei:biblStruct/preceding-sibling::tei:biblStruct/tei:monogr/tei:editor[1] 
+			and not(preceding-sibling::tei:analytic)"> <xsl:text>[three hyphens]</xsl:text> 
+			<xsl:text>, </xsl:text> </xsl:when> TAKE OUT THE EXTRA OPEN CHOOSE BEFORE 
+			YOU ADD THIS BACK IN -->
+		<xsl:choose>
+			<xsl:when
+				test="self::tei:author and not(following-sibling::tei:author)">
+				<xsl:choose>
+					<xsl:when
+						test="ancestor::tei:biblStruct and not(preceding-sibling::tei:author)">
+						<xsl:apply-templates />
+						<xsl:if test="not(ends-with(.,'.'))">
+							<xsl:text>. </xsl:text>
+						</xsl:if>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:if test="not(self::tei:author[3])">
+							<xsl:text> and </xsl:text>
+						</xsl:if>
+						<xsl:choose>
+							<xsl:when test="contains(self::tei:author, ',')">
+								<xsl:value-of select="substring-after(., ',')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="substring-before(., ',')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:if test="not(ends-with(.,'.'))">
+							<xsl:text>. </xsl:text>
+						</xsl:if>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:text> </xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="self::tei:author and following-sibling::tei:author">
+				<xsl:choose>
+					<xsl:when
+						test="ancestor::tei:biblStruct and not(preceding-sibling::tei:author)">
+						<xsl:apply-templates />
+						<xsl:text>, </xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:choose>
+							<xsl:when test="contains(self::tei:author, ',')">
+								<xsl:value-of select="substring-after(., ',')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="substring-before(., ',')" />
+								<xsl:text>, and </xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+								<xsl:text>, and </xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when
+				test="self::tei:editor[@role='translator'] and ancestor::tei:biblStruct">
+				<xsl:choose>
+					<xsl:when
+						test="preceding-sibling::tei:editor[@role='editor']/text() = self::tei:editor[@role='translator']/text()">
+						<xsl:text>Ed. and Trans. </xsl:text>
+					</xsl:when>
+					<xsl:when
+						test="not(preceding-sibling::tei:editor[@role='translator'])">
+						<xsl:text>Trans. </xsl:text>
+					</xsl:when>
+					<xsl:when
+						test="preceding-sibling::tei:editor[@role='translator'] and following-sibling::tei:editor[@role='translator']">
+						<xsl:text>, </xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text> and </xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:choose>
+					<xsl:when
+						test="contains(self::tei:editor[@role='translator'], ',')">
+						<xsl:value-of select="substring-after(., ',')" />
+						<xsl:text> </xsl:text>
+						<xsl:value-of select="substring-before(., ',')" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:if
+					test="not(following-sibling::tei:editor[@role='translator'])">
+					<xsl:text>. </xsl:text>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when
+				test="self::tei:editor[@role='editor'] and not(parent::tei:monogr/parent::tei:biblStruct/tei:analytic) and not(preceding-sibling::tei:author)">
+				<xsl:choose>
+					<xsl:when
+						test="ancestor::tei:biblStruct and not(following-sibling::tei:editor[@role='editor']) and not(preceding-sibling::tei:editor[@role='editor'])">
+						<xsl:apply-templates />
+						<xsl:text>, ed. </xsl:text>
+					</xsl:when>
+					<xsl:when
+						test="ancestor::tei:biblStruct and following-sibling::tei:editor[@role='editor'] and not(preceding-sibling::tei:editor[@role='editor'])">
+						<xsl:apply-templates />
+						<xsl:choose>
+							<xsl:when test="position() + 1 = last()">
+								<xsl:text> </xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>, </xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when
+						test="ancestor::tei:biblStruct and following-sibling::tei:editor[@role='editor']">
+						<xsl:choose>
+							<xsl:when
+								test="contains(self::tei:editor[@role='editor'], ',')">
+								<xsl:value-of select="substring-after(., ',')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="substring-before(., ',')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when test="position() + 1 = last()">
+								<xsl:text> </xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>, </xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when
+						test="ancestor::tei:biblStruct and not(following-sibling::tei:editor[@role='editor'])">
+						<xsl:choose>
+							<xsl:when
+								test="preceding-sibling::tei:editor[@role='editor']">
+								<xsl:text>and </xsl:text>
+								<xsl:choose>
+									<xsl:when
+										test="contains(self::tei:editor[@role='editor'], ',')">
+										<xsl:value-of select="substring-after(., ',')" />
+										<xsl:text> </xsl:text>
+										<xsl:value-of select="substring-before(., ',')" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:apply-templates />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when test="../tei:editor[@role='editor'][2]">
+								<xsl:text>, eds. </xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>, ed. </xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when
+				test="self::tei:editor[@role='editor'] and not(following-sibling::tei:editor[@role='editor'])">
+				<xsl:choose>
+					<xsl:when
+						test="ancestor::tei:biblStruct and not(preceding-sibling::tei:editor[@role='editor'])">
+						<xsl:text>Ed. </xsl:text>
+						<xsl:choose>
+							<xsl:when
+								test="contains(self::tei:editor[@role='editor'], ',')">
+								<xsl:value-of select="substring-after(., ',')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="substring-before(., ',')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:text>. </xsl:text>
+					</xsl:when>
+					<xsl:when
+						test="ancestor::tei:biblStruct and preceding-sibling::tei:editor[@role='editor']">
+						<xsl:text>and </xsl:text>
+						<xsl:choose>
+							<xsl:when
+								test="contains(self::tei:editor[@role='editor'], ',')">
+								<xsl:value-of select="substring-after(., ',')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="substring-before(., ',')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:text>. </xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+						<xsl:text> (</xsl:text>
+						<xsl:text>ed</xsl:text>
+						<xsl:if
+							test="preceding-sibling::tei:editor[@role='editor']">
+							s
+						</xsl:if>
+						<xsl:text>.</xsl:text>
+						<xsl:text>) </xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when
+				test="self::tei:editor[@role='editor'] and following-sibling::tei:editor[@role='editor']">
+				<xsl:choose>
+					<xsl:when
+						test="ancestor::tei:biblStruct and not(preceding-sibling::tei:editor[@role='editor'])">
+						<xsl:text>Ed. </xsl:text>
+						<xsl:choose>
+							<xsl:when
+								test="contains(self::tei:editor[@role='editor'], ',')">
+								<xsl:value-of select="substring-after(., ',')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="substring-before(., ',')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when test="position() + 1 = last()">
+								<xsl:text> </xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>, </xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when
+						test="ancestor::tei:biblStruct and preceding-sibling::tei:editor[@role='editor']">
+						<xsl:choose>
+							<xsl:when
+								test="contains(self::tei:editor[@role='editor'], ',')">
+								<xsl:value-of select="substring-after(., ',')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="substring-before(., ',')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:text>, </xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:choose>
+							<xsl:when
+								test="contains(self::tei:editor[@role='editor'], ',')">
+								<xsl:value-of select="substring-after(., ',')" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="substring-before(., ',')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when test="position() + 1 = last()">
+								<xsl:text> </xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>, </xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:nameLink" mode="use">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:surname">
+		<xsl:if test="../tei:forename">
+			<xsl:apply-templates select="../tei:forename"
+				mode="use" />
+			<xsl:call-template name="tei:makeText">
+				<xsl:with-param name="letters">
+					<xsl:text> </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:if test="../tei:nameLink">
+			<xsl:apply-templates select="../tei:nameLink"
+				mode="use" />
+			<xsl:call-template name="tei:makeText">
+				<xsl:with-param name="letters">
+					<xsl:text> </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <!-- title  -->
-   <xsl:template match="tei:titlePart" mode="simple">
-      <xsl:if test="preceding-sibling::tei:titlePart">
-         <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters"> — </xsl:with-param>
-	 </xsl:call-template>
-      </xsl:if>
-      <xsl:value-of select="."/>
-   </xsl:template>
+	<xsl:template match="tei:forename">
+	</xsl:template>
 
-   <xsl:template match="tei:title" mode="simple">
-      <xsl:value-of select="."/>
-   </xsl:template>
+	<xsl:template match="tei:nameLink">
+	</xsl:template>
 
-   <xsl:template match="tei:titlePart">
-      <xsl:if test="preceding-sibling::tei:titlePart">
-         <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters"> — </xsl:with-param>
-	 </xsl:call-template>
-      </xsl:if>
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:forename" mode="use">
+		<xsl:if test="preceding-sibling::tei:forename">
+			<xsl:call-template name="tei:makeText">
+				<xsl:with-param name="letters">
+					<xsl:text> </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:title">
-      <xsl:choose>
-         <xsl:when test="parent::tei:titleStmt/parent::tei:fileDesc">
-            <xsl:if test="preceding-sibling::tei:title">
-	      <xsl:call-template name="tei:makeText">
-		<xsl:with-param name="letters"> — </xsl:with-param>
-	      </xsl:call-template>
-            </xsl:if>
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="@level='m' or not(@level)">
-	   <xsl:call-template name="emphasize">
-	     <xsl:with-param name="class">
-	       <xsl:text>titlem</xsl:text>
-	     </xsl:with-param>
-	     <xsl:with-param name="content">
-	       <xsl:apply-templates/>
-	     </xsl:with-param>
-	   </xsl:call-template>
-	   <xsl:if test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
-	     <xsl:call-template name="tei:makeText">
-	       <xsl:with-param name="letters">, </xsl:with-param>
-	     </xsl:call-template>
-	   </xsl:if>
-         </xsl:when>
-         <xsl:when test="@level='s'">
-	   <xsl:call-template name="emphasize">
-	     <xsl:with-param name="class">
-	       <xsl:text>titles</xsl:text>
-	     </xsl:with-param>
-	     <xsl:with-param name="content">
-	       <xsl:apply-templates/>
-	     </xsl:with-param>
-	   </xsl:call-template>
-	   <xsl:if test="following-sibling::* and
+	<xsl:template match="tei:nameLink" mode="use">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<!-- title -->
+	<xsl:template match="tei:titlePart" mode="simple">
+		<xsl:if test="preceding-sibling::tei:titlePart">
+			<xsl:call-template name="tei:makeText">
+				<xsl:with-param name="letters">
+					—
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template match="tei:title" mode="simple">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template match="tei:titlePart">
+		<xsl:if test="preceding-sibling::tei:titlePart">
+			<xsl:call-template name="tei:makeText">
+				<xsl:with-param name="letters">
+					—
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="tei:title">
+		<xsl:choose>
+			<xsl:when test="parent::tei:titleStmt/parent::tei:fileDesc">
+				<xsl:if test="preceding-sibling::tei:title">
+					<xsl:call-template name="tei:makeText">
+						<xsl:with-param name="letters">
+							—
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@level='m' or not(@level)">
+				<xsl:call-template name="emphasize">
+					<xsl:with-param name="class">
+						<xsl:text>titlem</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<xsl:apply-templates />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if
+					test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
+					<xsl:call-template name="tei:makeText">
+						<xsl:with-param name="letters">
+							,
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="@level='s'">
+				<xsl:call-template name="emphasize">
+					<xsl:with-param name="class">
+						<xsl:text>titles</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<xsl:apply-templates />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if
+					test="following-sibling::* and
 			 (ancestor::tei:biblStruct  or ancestor::tei:biblFull)">
-	     <xsl:call-template name="tei:makeText">
-	       <xsl:with-param name="letters">
-	       </xsl:with-param>
-	     </xsl:call-template>
-	   </xsl:if>
-         </xsl:when>
-         <xsl:when test="@level='j'">
-	   <xsl:call-template name="emphasize">
-	     <xsl:with-param name="class">
-	       <xsl:text>titlej</xsl:text>
-	     </xsl:with-param>
-	     <xsl:with-param name="content">
-	       <xsl:apply-templates/>
-	     </xsl:with-param>
-	   </xsl:call-template>
-	   <xsl:call-template name="tei:makeText">
-	     <xsl:with-param name="letters"><xsl:text> </xsl:text></xsl:with-param>
-	   </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="@level='a'">
-	   <xsl:call-template name="emphasize">
-	     <xsl:with-param name="class">
-	       <xsl:text>titlea</xsl:text>
-	     </xsl:with-param>
-	     <xsl:with-param name="content">
-	       <xsl:apply-templates/>
-	     </xsl:with-param>
-	   </xsl:call-template>
-	   <xsl:if test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
-	     <xsl:call-template name="tei:makeText">
-	       <xsl:with-param
-		   name="letters">. </xsl:with-param>
-	     </xsl:call-template>
-	   </xsl:if>
-         </xsl:when>
-         <xsl:when test="@level='u'">
-	   <xsl:call-template name="emphasize">
-	     <xsl:with-param name="class">
-	       <xsl:text>titleu</xsl:text>
-	     </xsl:with-param>
-	     <xsl:with-param name="content">
-	       <xsl:apply-templates/>
-	     </xsl:with-param>
-	   </xsl:call-template>
-	   <xsl:if test="ancestor::tei:biblStruct  or ancestor::tei:biblFull">
-	     <xsl:call-template name="tei:makeText">
-	       <xsl:with-param
-		   name="letters">. </xsl:with-param>
-	     </xsl:call-template>
-	   </xsl:if>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:bibl">
-	   <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-	   <xsl:call-template name="emphasize">
-	     <xsl:with-param name="class">
-	       <xsl:text>titlem</xsl:text>
-	     </xsl:with-param>
-	     <xsl:with-param name="content">
-	       <xsl:apply-templates/>
-	     </xsl:with-param>
-	   </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
-   
+					<xsl:call-template name="tei:makeText">
+						<xsl:with-param name="letters">
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="@level='j'">
+				<xsl:call-template name="emphasize">
+					<xsl:with-param name="class">
+						<xsl:text>titlej</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<xsl:apply-templates />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@level='a'">
+				<xsl:call-template name="emphasize">
+					<xsl:with-param name="class">
+						<xsl:text>titlea</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<xsl:apply-templates />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if
+					test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
+					<xsl:call-template name="tei:makeText">
+						<xsl:with-param name="letters">
+							.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="@level='u'">
+				<xsl:call-template name="emphasize">
+					<xsl:with-param name="class">
+						<xsl:text>titleu</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<xsl:apply-templates />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if
+					test="ancestor::tei:biblStruct  or ancestor::tei:biblFull">
+					<xsl:call-template name="tei:makeText">
+						<xsl:with-param name="letters">
+							.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="ancestor::tei:bibl">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="emphasize">
+					<xsl:with-param name="class">
+						<xsl:text>titlem</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<xsl:apply-templates />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:meeting">
-      <xsl:call-template name="tei:makeText">
-	<xsl:with-param name="letters"> (</xsl:with-param>
-      </xsl:call-template>
-      <xsl:apply-templates/>
-      <xsl:call-template name="tei:makeText">
-	<xsl:with-param name="letters">)</xsl:with-param>
-      </xsl:call-template>
-      <xsl:if test="following-sibling::* and (ancestor::tei:biblStruct  or ancestor::tei:biblFull)">
-         <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters"><xsl:text> </xsl:text></xsl:with-param>
-	 </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
 
-   <xsl:template match="tei:series">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:meeting">
+		<xsl:call-template name="tei:makeText">
+			<xsl:with-param name="letters">
+				(
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:apply-templates />
+		<xsl:call-template name="tei:makeText">
+			<xsl:with-param name="letters">
+				)
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:if
+			test="following-sibling::* and (ancestor::tei:biblStruct  or ancestor::tei:biblFull)">
+			<xsl:call-template name="tei:makeText">
+				<xsl:with-param name="letters">
+					<xsl:text> </xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-   <xsl:template match="tei:biblStruct//tei:date|tei:biblFull//tei:date">
-     <!--
-	 <xsl:choose>
-	 <xsl:when test="starts-with(.,'$Date:')">
-	 <xsl:value-of select="substring-before(substring-after(.,'$Date:'),'$')"/>
-	 </xsl:when>
-	 <xsl:otherwise>
-	 <xsl:apply-templates/>
-	 </xsl:otherwise>
-	 </xsl:choose>
-     -->
-      <xsl:apply-templates/>
-     <xsl:call-template name="tei:makeText">
-       <xsl:with-param name="letters">. </xsl:with-param>
-     </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="tei:series">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:byline">
-     <xsl:call-template name="makeSpan"/>
-   </xsl:template>
+	<xsl:template
+		match="tei:biblStruct//tei:date|tei:biblFull//tei:date">
+		<!-- <xsl:choose> <xsl:when test="starts-with(.,'$Date:')"> <xsl:value-of 
+			select="substring-before(substring-after(.,'$Date:'),'$')"/> </xsl:when> 
+			<xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> -->
+		<xsl:apply-templates />
+		<xsl:call-template name="tei:makeText">
+			<xsl:with-param name="letters">
+				.
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="tei:pubPlace">
-     <xsl:call-template name="makeSpan"/>
-     <xsl:choose>
-         <xsl:when test="ancestor::tei:bibl"/>
-         <xsl:when test="following-sibling::tei:pubPlace">
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters">, </xsl:with-param>
-	    </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="../tei:publisher">
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters">: </xsl:with-param>
-	    </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters">. </xsl:with-param>
-	    </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="tei:byline">
+		<xsl:call-template name="makeSpan" />
+	</xsl:template>
 
-   <xsl:template match="tei:publisher">
-     <xsl:call-template name="makeSpan"/>
-      <xsl:if test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
-         <xsl:call-template name="tei:makeText">
-	   <xsl:with-param name="letters">. </xsl:with-param>
-	 </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template match="tei:pubPlace">
+		<xsl:call-template name="makeSpan" />
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:bibl" />
+			<xsl:when test="following-sibling::tei:pubPlace">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						,
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="../tei:publisher">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						:
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <!-- details and notes -->
-   <xsl:template match="tei:biblScope">
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:bibl">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="@type='vol' or @type='volume'">
-            <xsl:call-template name="emphasize">
-               <xsl:with-param name="class">
-	                 <xsl:text>vol</xsl:text>
-               </xsl:with-param>
-               <xsl:with-param name="content">
-	                 <xsl:apply-templates/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="@type='chap'">
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters">chapter </xsl:with-param>
-	    </xsl:call-template>
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="@type='issue' or @type='nr'">
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters"> (</xsl:with-param>
-	    </xsl:call-template>
-            <xsl:apply-templates/>
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters">) </xsl:with-param>
-	    </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="@type='page_from'">
-	   <xsl:text>pp. </xsl:text>
-	   <xsl:apply-templates/>
-	 </xsl:when>
-         <xsl:when test="@type='page_to'">
-	   <xsl:text>-</xsl:text>
-	   <xsl:apply-templates/>
-	 </xsl:when>
-         <xsl:when test="@type='pp' or @type='pages'">
-            <xsl:choose>
-               <xsl:when test="contains(.,'-')">
-	                 <xsl:call-template name="tei:makeText">
-			   <xsl:with-param
-			       name="letters">pp. </xsl:with-param>
-			 </xsl:call-template>
-               </xsl:when>
-               <xsl:when test="contains(.,'ff')">
-	                 <xsl:call-template name="tei:makeText">
-			   <xsl:with-param
-			       name="letters">pp. </xsl:with-param>
-			 </xsl:call-template>
-               </xsl:when>
-               <xsl:when test="contains(.,' ')">
-	                 <xsl:call-template name="tei:makeText">
-			   <xsl:with-param
-			       name="letters">pp. </xsl:with-param>
-			 </xsl:call-template>
-               </xsl:when>
-               <xsl:otherwise>
-	                 <xsl:call-template name="tei:makeText">
-			   <xsl:with-param
-			       name="letters">p. </xsl:with-param>
-			 </xsl:call-template>
-               </xsl:otherwise>
-            </xsl:choose>
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
- 
-      <xsl:choose>
-         <xsl:when test="@type='vol' and      following-sibling::tei:biblScope[@type='issue']">
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters"><xsl:text> </xsl:text></xsl:with-param>
-	    </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="@type='vol' and following-sibling::tei:biblScope">
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters"><xsl:text> </xsl:text></xsl:with-param>
-	    </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="following-sibling::tei:biblScope">
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters"><xsl:text> </xsl:text></xsl:with-param>
-	    </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
-            <xsl:call-template name="tei:makeText">
-	      <xsl:with-param name="letters">. </xsl:with-param>
-	    </xsl:call-template>
-         </xsl:when>
-      </xsl:choose>
+	<xsl:template match="tei:publisher">
+		<xsl:call-template name="makeSpan" />
+		<xsl:if
+			test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
+			<xsl:call-template name="tei:makeText">
+				<xsl:with-param name="letters">
+					.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-   </xsl:template>
+	<!-- details and notes -->
+	<xsl:template match="tei:biblScope">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:bibl">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@type='vol' or @type='volume'">
+				<xsl:call-template name="emphasize">
+					<xsl:with-param name="class">
+						<xsl:text>vol</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<xsl:apply-templates />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@type='chap'">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						chapter
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@type='issue' or @type='nr'">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						(
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:apply-templates />
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						)
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@type='page_from'">
+				<xsl:text>pp. </xsl:text>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@type='page_to'">
+				<xsl:text>-</xsl:text>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@type='pp' or @type='pages'">
+				<xsl:choose>
+					<xsl:when test="contains(.,'-')">
+						<xsl:call-template name="tei:makeText">
+							<xsl:with-param name="letters">
+								pp.
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when test="contains(.,'ff')">
+						<xsl:call-template name="tei:makeText">
+							<xsl:with-param name="letters">
+								pp.
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when test="contains(.,' ')">
+						<xsl:call-template name="tei:makeText">
+							<xsl:with-param name="letters">
+								pp.
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="tei:makeText">
+							<xsl:with-param name="letters">
+								p.
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element name and tei:persName</desc>
-   </doc>
-  <xsl:template match="tei:name|tei:persName">
-      <xsl:apply-templates/>
-      <xsl:choose>
-         <xsl:when test="not(ancestor::tei:person|ancestor::tei:biblStruct)"/>
-         <xsl:when test="following-sibling::tei:name|following-sibling::tei:persName">
-	   <xsl:call-template name="tei:makeText">
-	     <xsl:with-param name="letters">, </xsl:with-param>
-	   </xsl:call-template>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<xsl:when
+				test="@type='vol' and      following-sibling::tei:biblScope[@type='issue']">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when
+				test="@type='vol' and following-sibling::tei:biblScope">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="following-sibling::tei:biblScope">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when
+				test="ancestor::tei:biblStruct or ancestor::tei:biblFull">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
 
-  <xsl:template match="tei:bibl/tei:note|tei:biblStruct/tei:note">
-    <xsl:call-template name="tei:makeText">
-      <xsl:with-param name="letters"> (</xsl:with-param>
-    </xsl:call-template>
-      <xsl:apply-templates/>
-    <xsl:call-template name="tei:makeText">
-      <xsl:with-param name="letters">)</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element name and tei:persName</desc>
+	</doc>
+	<xsl:template match="tei:name|tei:persName">
+		<xsl:apply-templates />
+		<xsl:choose>
+			<xsl:when
+				test="not(ancestor::tei:person|ancestor::tei:biblStruct)" />
+			<xsl:when
+				test="following-sibling::tei:name|following-sibling::tei:persName">
+				<xsl:call-template name="tei:makeText">
+					<xsl:with-param name="letters">
+						,
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template
+		match="tei:bibl/tei:note|tei:biblStruct/tei:note">
+		<xsl:call-template name="tei:makeText">
+			<xsl:with-param name="letters">
+				(
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:apply-templates />
+		<xsl:call-template name="tei:makeText">
+			<xsl:with-param name="letters">
+				)
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/functions.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/functions.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/functions.xsl	(revision 2397)
@@ -1,305 +1,653 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cals="http://www.oasis-open.org/specs/tm9901" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:iso="http://www.iso.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" version="2.0" exclude-result-prefixes="cals ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI Utility stylesheet defining functions for use in all
-	 output formats.</p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" version="2.0"
+	exclude-result-prefixes="cals ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI Utility stylesheet defining functions for use in all
+				output formats.</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: functions.xsl 10018 2012-01-10 14:51:47Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Whether a section is "identifiable"</desc>
-  </doc>
-  <xsl:function name="tei:is-identifiable" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-        <xsl:when test="self::tei:div">true</xsl:when>
-        <xsl:when test="self::tei:div1">true</xsl:when>
-        <xsl:when test="self::tei:div2">true</xsl:when>
-        <xsl:when test="self::tei:div3">true</xsl:when>
-        <xsl:when test="self::tei:div4">true</xsl:when>
-        <xsl:when test="self::tei:div5">true</xsl:when>
-        <xsl:when test="self::tei:div6">true</xsl:when>
-        <xsl:when test="self::tei:p[@xml:id]">true</xsl:when>
-        <xsl:when test="self::tei:index[@xml:id]">true</xsl:when>
-        <xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Whether a section is "transcribable"</desc>
-  </doc>
-  <xsl:function name="tei:is-transcribable" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-	<xsl:when test="self::tei:p and parent::tei:sp">true</xsl:when>
-        <xsl:when test="self::tei:l">true</xsl:when>
-        <xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: functions.xsl 10018 2012-01-10 14:51:47Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Whether a section is "identifiable"</desc>
+	</doc>
+	<xsl:function name="tei:is-identifiable" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when test="self::tei:div">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:div1">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:div2">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:div3">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:div4">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:div5">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:div6">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:p[@xml:id]">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:index[@xml:id]">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Whether to render text in small caps.</desc>
-  </doc>
-  <xsl:function name="tei:render-smallcaps" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-        <xsl:when test="contains(@rend,'smallcaps')">true</xsl:when>
-        <xsl:when test="@rend='sc'">true</xsl:when>
-        <xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Whether a section is "transcribable"</desc>
+	</doc>
+	<xsl:function name="tei:is-transcribable" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when test="self::tei:p and parent::tei:sp">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:l">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Whether to render text in smart quotes.</desc>
-  </doc>
-  <xsl:function name="tei:render-quotes" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-        <xsl:when test="self::tei:soCalled">true</xsl:when>
-        <xsl:when test="contains(@rend,'quotes')">true</xsl:when>
-        <xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Whether to render text in small caps.</desc>
+	</doc>
+	<xsl:function name="tei:render-smallcaps" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when test="contains(@rend,'smallcaps')">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='sc'">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Whether to render text in smart quotes.</desc>
+	</doc>
+	<xsl:function name="tei:render-quotes" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when test="self::tei:soCalled">
+					true
+				</xsl:when>
+				<xsl:when test="contains(@rend,'quotes')">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Whether to render text in bold.</desc>
-  </doc>
-  <xsl:function name="tei:render-bold" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-        <xsl:when test="parent::tei:hi[starts-with(@rend,'specList-')]">true</xsl:when>
-        <xsl:when test="parent::tei:hi[@rend='bold']">true</xsl:when>
-        <xsl:when test="contains(@rend,'bold')">true</xsl:when>
-        <xsl:when test="@rend='label'">true</xsl:when>
-        <xsl:when test="ancestor-or-self::tei:cell[@role='label']">true</xsl:when>
-        <xsl:when test="ancestor-or-self::tei:cell[@rend='wovenodd-col1']">true</xsl:when>
-        <xsl:when test="self::tei:cell and parent::tei:row[@role='label']">true</xsl:when>
-        <xsl:when test="self::tei:label[following-sibling::tei:item]">true</xsl:when>
-        <xsl:when test="self::tei:term">true</xsl:when>
-        <xsl:when test="self::tei:unclear">true</xsl:when>
-        <xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Whether to render something in italic.</desc>
-  </doc>
-  <xsl:function name="tei:render-italic" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-        <xsl:when test="self::tei:ref and tei:render-italic(..)">true</xsl:when>
-        <xsl:when test="contains(@rend,'italic')">true</xsl:when>
-        <xsl:when test="self::tei:emph">true</xsl:when>
-        <xsl:when test="self::tei:hi[not(@rend)]">true</xsl:when>
-        <xsl:when test="self::tbx:hi[@style='italics']">true</xsl:when>
-        <xsl:when test="@rend='ital'">true</xsl:when>
-        <xsl:when test="@rend='it'">true</xsl:when>
-        <xsl:when test="@rend='i'">true</xsl:when>
-        <xsl:when test="@rend='att'">true</xsl:when>
-        <xsl:when test="self::tei:att">true</xsl:when>
-        <xsl:when test="self::tei:speaker">true</xsl:when>
-        <xsl:when test="self::tei:gloss">true</xsl:when>
-        <xsl:when test="self::tei:title">true</xsl:when>
-        <xsl:when test="self::tei:name">true</xsl:when>
-        <xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Whether to render something in typewriter-like code.</desc>
-  </doc>
-  <xsl:function name="tei:render-typewriter" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-        <xsl:when test="self::tei:gi">true</xsl:when>
-        <xsl:when test="self::tei:val">true</xsl:when>
-        <xsl:when test="self::tei:code">true</xsl:when>
-        <xsl:when test="self::tei:ident">true</xsl:when>
-        <xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Is given an element and defines whether or not this element is to be rendered inline.</desc>
-  </doc>
-  <xsl:function name="tei:is-inline" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-        <xsl:when test="self::mml:math">true</xsl:when>
-        <xsl:when test="self::tei:abbr">true</xsl:when>
-        <xsl:when test="self::tei:affiliation">true</xsl:when>
-        <xsl:when test="self::tei:altIdentifier">true</xsl:when>
-        <xsl:when test="self::tei:analytic">true</xsl:when>
-        <xsl:when test="self::tei:add">true</xsl:when>
-        <xsl:when test="self::tei:am">true</xsl:when>
-        <xsl:when test="self::tei:att">true</xsl:when>
-        <xsl:when test="self::tei:author">true</xsl:when>
-        <xsl:when test="self::tei:bibl and tei:is-inline($element/..)">true</xsl:when>
-        <xsl:when test="self::tei:biblScope">true</xsl:when>
-        <xsl:when test="self::tei:br">true</xsl:when>
-        <xsl:when test="self::tei:byline">true</xsl:when>
-        <xsl:when test="self::tei:c">true</xsl:when>
-        <xsl:when test="self::tei:caesura">true</xsl:when>
-        <xsl:when test="self::tei:choice">true</xsl:when>
-        <xsl:when test="self::tei:code">true</xsl:when>
-        <xsl:when test="self::tei:collection">true</xsl:when>
-        <xsl:when test="self::tei:country">true</xsl:when>
-        <xsl:when test="self::tei:damage">true</xsl:when>
-        <xsl:when test="self::tei:date">true</xsl:when>
-        <xsl:when test="self::tei:del">true</xsl:when>
-        <xsl:when test="self::tei:depth">true</xsl:when>
-        <xsl:when test="self::tei:dim">true</xsl:when>
-        <xsl:when test="self::tei:dimensions">true</xsl:when>
-        <xsl:when test="self::tei:editor">true</xsl:when>
-        <xsl:when test="self::tei:editionStmt">true</xsl:when>
-        <xsl:when test="self::tei:emph">true</xsl:when>
-        <xsl:when test="self::tei:ex">true</xsl:when>
-        <xsl:when test="self::tei:expan">true</xsl:when>
-        <xsl:when test="self::tei:figure[@place='inline']">true</xsl:when>
-        <xsl:when test="self::tei:foreign">true</xsl:when>
-        <xsl:when test="self::tei:forename">true</xsl:when>
-        <xsl:when test="self::tei:gap">true</xsl:when>
-        <xsl:when test="self::tei:genName">true</xsl:when>
-        <xsl:when test="self::tei:geogName">true</xsl:when>
-        <xsl:when test="self::tei:gi">true</xsl:when>
-        <xsl:when test="self::tei:gloss">true</xsl:when>
-        <xsl:when test="self::tei:graphic">true</xsl:when>
-        <xsl:when test="self::tei:height">true</xsl:when>
-        <xsl:when test="self::tei:hi[not(w:*)]">true</xsl:when>
-        <xsl:when test="self::tei:ident">true</xsl:when>
-        <xsl:when test="self::tei:idno">true</xsl:when>
-        <xsl:when test="self::tei:imprint">true</xsl:when>
-        <xsl:when test="self::tei:institution">true</xsl:when>
-        <xsl:when test="self::tei:lb">true</xsl:when>
-        <xsl:when test="self::tei:locus">true</xsl:when>
-        <xsl:when test="self::tei:mentioned">true</xsl:when>
-        <xsl:when test="self::tei:monogr">true</xsl:when>
-        <xsl:when test="self::tei:series">true</xsl:when>
-        <xsl:when test="self::tei:msName">true</xsl:when>
-        <xsl:when test="self::tei:name">true</xsl:when>
-        <xsl:when test="self::tei:note[@place='margin']">false</xsl:when>
-        <xsl:when test="self::tei:note[@place='bottom']">true</xsl:when>
-        <xsl:when test="self::tei:note[@place='comment']">true</xsl:when>
-        <xsl:when test="self::tei:note[@place='end']">true</xsl:when>
-        <xsl:when test="self::tei:note[@place='foot']">true</xsl:when>
-        <xsl:when test="self::tei:note[@place='inline']">true</xsl:when>
-        <xsl:when test="self::tei:note[parent::tei:biblStruct]">true</xsl:when>
-        <xsl:when test="self::tei:note[parent::tei:bibl]">true</xsl:when>
-        <xsl:when test="self::tei:num">true</xsl:when>
-        <xsl:when test="self::tei:orgName">true</xsl:when>
-        <xsl:when test="self::tei:orig">true</xsl:when>
-        <xsl:when test="self::tei:origDate">true</xsl:when>
-        <xsl:when test="self::tei:origPlace">true</xsl:when>
-        <xsl:when test="self::tei:origPlace">true</xsl:when>
-        <xsl:when test="self::tei:pb">true</xsl:when>
-        <xsl:when test="self::tei:persName">true</xsl:when>
-        <xsl:when test="self::tei:placeName">true</xsl:when>
-        <xsl:when test="self::tei:ptr">true</xsl:when>
-        <xsl:when test="self::tei:publisher">true</xsl:when>
-        <xsl:when test="self::tei:pubPlace">true</xsl:when>
-        <xsl:when test="self::tei:q[tei:l]">false</xsl:when>
-        <xsl:when test="self::tei:q[tei:figure or tei:p or tei:note or
-			tei:bibl or tei:sp or tei:floatingText]">false</xsl:when>
-        <xsl:when test="self::tei:q">true</xsl:when>
-        <xsl:when test="self::tei:said">true</xsl:when>
-        <xsl:when test="self::tei:ref">true</xsl:when>
-        <xsl:when test="self::tei:region">true</xsl:when>
-        <xsl:when test="self::tei:repository">true</xsl:when>
-        <xsl:when test="self::tei:roleName">true</xsl:when>
-        <xsl:when test="self::tei:rubric">true</xsl:when>
-        <xsl:when test="self::tei:seg">true</xsl:when>
-        <xsl:when test="self::tei:sic">true</xsl:when>
-        <xsl:when test="self::tei:settlement">true</xsl:when>
-        <xsl:when test="self::tei:soCalled">true</xsl:when>
-        <xsl:when test="self::tei:summary">true</xsl:when>
-        <xsl:when test="self::tei:supplied">true</xsl:when>
-        <xsl:when test="self::tei:surname">true</xsl:when>
-        <xsl:when test="self::tei:term">true</xsl:when>
-        <xsl:when test="self::tei:textLang">true</xsl:when>
-        <xsl:when test="self::tei:title">true</xsl:when>
-        <xsl:when test="self::tei:unclear">true</xsl:when>
-        <xsl:when test="self::tei:val">true</xsl:when>
-        <xsl:when test="self::tei:width">true</xsl:when>
-        <xsl:when test="self::tei:dynamicContent">true</xsl:when>
-        <xsl:when test="self::w:drawing">true</xsl:when>
-        <xsl:when test="self::m:oMath">true</xsl:when>
-        <xsl:otherwise>
-          <xsl:choose>
-            <xsl:when test="empty($element/..)">false</xsl:when>
-            <xsl:when test="tei:is-inline($element/..)">true</xsl:when>
-            <xsl:otherwise>false</xsl:otherwise>
-          </xsl:choose>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Is given an element and says whether the context is at the
-    level of a block</desc>
-  </doc>
-  <xsl:function name="tei:blockContext" as="xs:boolean">
-    <xsl:param name="element"/>
-    <xsl:for-each select="$element">
-      <xsl:choose>
-	<xsl:when test="parent::tei:note[@place='foot'] and self::tei:gap">false</xsl:when>
-	<xsl:when test="parent::tei:note[@place='foot' or @place='bottom']">true</xsl:when>
-	<xsl:when test="parent::tei:body">true</xsl:when>
-	<xsl:when test="tei:floatingText">true</xsl:when>
-	<xsl:when test="parent::tei:div">true</xsl:when>
-	<xsl:when test="parent::tei:titlePage">true</xsl:when>
-	<xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Whether to render text in bold.</desc>
+	</doc>
+	<xsl:function name="tei:render-bold" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when
+					test="parent::tei:hi[starts-with(@rend,'specList-')]">
+					true
+				</xsl:when>
+				<xsl:when test="parent::tei:hi[@rend='bold']">
+					true
+				</xsl:when>
+				<xsl:when test="contains(@rend,'bold')">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='label'">
+					true
+				</xsl:when>
+				<xsl:when test="ancestor-or-self::tei:cell[@role='label']">
+					true
+				</xsl:when>
+				<xsl:when
+					test="ancestor-or-self::tei:cell[@rend='wovenodd-col1']">
+					true
+				</xsl:when>
+				<xsl:when
+					test="self::tei:cell and parent::tei:row[@role='label']">
+					true
+				</xsl:when>
+				<xsl:when
+					test="self::tei:label[following-sibling::tei:item]">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:term">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:unclear">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Whether to render something in italic.</desc>
+	</doc>
+	<xsl:function name="tei:render-italic" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when test="self::tei:ref and tei:render-italic(..)">
+					true
+				</xsl:when>
+				<xsl:when test="contains(@rend,'italic')">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:emph">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:hi[not(@rend)]">
+					true
+				</xsl:when>
+				<xsl:when test="self::tbx:hi[@style='italics']">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='ital'">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='it'">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='i'">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='att'">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:att">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:speaker">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:gloss">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:title">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:name">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Whether to render something in typewriter-like code.</desc>
+	</doc>
+	<xsl:function name="tei:render-typewriter" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when test="self::tei:gi">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:val">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:code">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:ident">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Is given an element and defines whether or not this element is
+			to be rendered inline.</desc>
+	</doc>
+	<xsl:function name="tei:is-inline" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when test="self::mml:math">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:abbr">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:affiliation">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:altIdentifier">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:analytic">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:add">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:am">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:att">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:author">
+					true
+				</xsl:when>
+				<xsl:when
+					test="self::tei:bibl and tei:is-inline($element/..)">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:biblScope">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:br">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:byline">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:c">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:caesura">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:choice">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:code">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:collection">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:country">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:damage">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:date">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:del">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:depth">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:dim">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:dimensions">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:editor">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:editionStmt">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:emph">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:ex">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:expan">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:figure[@place='inline']">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:foreign">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:forename">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:gap">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:genName">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:geogName">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:gi">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:gloss">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:graphic">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:height">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:hi[not(w:*)]">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:ident">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:idno">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:imprint">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:institution">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:lb">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:locus">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:mentioned">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:monogr">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:series">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:msName">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:name">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:note[@place='margin']">
+					false
+				</xsl:when>
+				<xsl:when test="self::tei:note[@place='bottom']">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:note[@place='comment']">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:note[@place='end']">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:note[@place='foot']">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:note[@place='inline']">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:note[parent::tei:biblStruct]">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:note[parent::tei:bibl]">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:num">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:orgName">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:orig">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:origDate">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:origPlace">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:origPlace">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:pb">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:persName">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:placeName">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:ptr">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:publisher">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:pubPlace">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:q[tei:l]">
+					false
+				</xsl:when>
+				<xsl:when
+					test="self::tei:q[tei:figure or tei:p or tei:note or
+			tei:bibl or tei:sp or tei:floatingText]">
+					false
+				</xsl:when>
+				<xsl:when test="self::tei:q">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:said">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:ref">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:region">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:repository">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:roleName">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:rubric">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:seg">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:sic">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:settlement">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:soCalled">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:summary">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:supplied">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:surname">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:term">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:textLang">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:title">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:unclear">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:val">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:width">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:dynamicContent">
+					true
+				</xsl:when>
+				<xsl:when test="self::w:drawing">
+					true
+				</xsl:when>
+				<xsl:when test="self::m:oMath">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:choose>
+						<xsl:when test="empty($element/..)">
+							false
+						</xsl:when>
+						<xsl:when test="tei:is-inline($element/..)">
+							true
+						</xsl:when>
+						<xsl:otherwise>
+							false
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Is given an element and says whether the context is at the
+			level of a block</desc>
+	</doc>
+	<xsl:function name="tei:blockContext" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when
+					test="parent::tei:note[@place='foot'] and self::tei:gap">
+					false
+				</xsl:when>
+				<xsl:when
+					test="parent::tei:note[@place='foot' or @place='bottom']">
+					true
+				</xsl:when>
+				<xsl:when test="parent::tei:body">
+					true
+				</xsl:when>
+				<xsl:when test="tei:floatingText">
+					true
+				</xsl:when>
+				<xsl:when test="parent::tei:div">
+					true
+				</xsl:when>
+				<xsl:when test="parent::tei:titlePage">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
 
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/header.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/header.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/header.xsl	(revision 2397)
@@ -1,407 +1,474 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the header module. </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the header module. </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: header.xsl 10056 2012-01-20 23:22:33Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] Find a plausible editor name</desc>
-   </doc>
-  <xsl:template name="generateEditor">
-    <xsl:choose>
-      <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:editor">
-        <xsl:for-each
-          select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:editor">
-          <xsl:apply-templates/>
-          <xsl:choose>
-            <xsl:when test="count(following-sibling::tei:editor)=1">
-              <xsl:if test="count(preceding-sibling::tei:editor)>=1">
-                <xsl:text>,</xsl:text>
-              </xsl:if>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">and</xsl:with-param>
-              </xsl:call-template>
-            </xsl:when>
-            <xsl:when test="following-sibling::tei:editor">, </xsl:when>
-          </xsl:choose>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:when
-        test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/tei:respStmt[tei:resp='editor']">
-        <xsl:apply-templates
-          select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/tei:respStmt[tei:resp='editor'][1]/tei:name"
-        />
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] Find a plausible main author name</desc>
-   </doc>
-  <xsl:template name="generateAuthor">
-      <xsl:choose>
-         <xsl:when test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docAuthor">
-            <xsl:apply-templates mode="author"
-                                 select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docAuthor"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author">
-            <xsl:for-each select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author">
-               <xsl:apply-templates/>
-               <xsl:choose>
-            <xsl:when test="count(following-sibling::tei:author)=1">
-              <xsl:if test="count(preceding-sibling::tei:author)>1">
-                <xsl:text>,</xsl:text>
-              </xsl:if>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">and</xsl:with-param>
-              </xsl:call-template>
-            </xsl:when>
-                  <xsl:when test="following-sibling::tei:author">, </xsl:when>
-               </xsl:choose>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/tei:respStmt[tei:resp='author']">
-            <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/tei:respStmt[tei:resp='author'][1]/tei:name"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docAuthor">
-            <xsl:apply-templates mode="author"
-                                 select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docAuthor"/>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] Find a plausible name of person responsible for current revision</desc>
-   </doc>
-  <xsl:template name="generateRevAuthor">
-      <xsl:variable name="who">
-         <xsl:choose>
-            <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/@vcwho">
-               <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/@vcwho"/>
-            </xsl:when>
-            <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[1]/tei:respStmt/tei:name">
-               <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[1]/tei:respStmt/tei:name/text()"/>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="normalize-space($who)=concat('$Author', '$')"/>
-         <xsl:when test="starts-with($who,'$Author')">
-        <!-- it's RCS -->
-        <xsl:value-of select="normalize-space(substring-before(substring-after($who,'Author'),'$'))"/>
-         </xsl:when>
-         <xsl:when test="starts-with($who,'$LastChangedBy')">
-        <!-- it's Subversion -->
-        <xsl:value-of select="normalize-space(substring-before(substring-after($who,'LastChangedBy:'),'$'))"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="$who"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] </desc>
-   </doc>
-  <xsl:template name="generateAuthorList">
-      <xsl:variable name="realauthor">
-         <xsl:call-template name="generateAuthor"/>
-      </xsl:variable>
-      <xsl:variable name="revauthor">
-         <xsl:call-template name="generateRevAuthor"/>
-      </xsl:variable>
-      <xsl:variable name="editor">
-        <xsl:call-template name="generateEditor"/>
-      </xsl:variable>
-      <xsl:if test="not($realauthor = '')">
-        <p xmlns="http://www.w3.org/1999/xhtml" class="mainAuthor">
-         <xsl:text> </xsl:text>
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">authorWord</xsl:with-param>
-         </xsl:call-template>
-          <xsl:text>: </xsl:text>
-         <xsl:copy-of select="$realauthor"/>
-        </p>
-      </xsl:if>
-      <xsl:if test="not($revauthor = '')">
-      <p class="mainRevAuthor" xmlns="http://www.w3.org/1999/xhtml">
-         <xsl:text> (</xsl:text>
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">revisedWord</xsl:with-param>
-         </xsl:call-template>
-         <xsl:text> </xsl:text>
-         <xsl:copy-of select="$revauthor"/>
-         <xsl:text>)</xsl:text>
-      </p>
-    </xsl:if>
-    <xsl:if test="not($editor = '')">
-      <p class="mainEditor" xmlns="http://www.w3.org/1999/xhtml">
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">editorWord</xsl:with-param>
-         </xsl:call-template>
-        <xsl:text>: </xsl:text>
-        <xsl:copy-of select="$editor"/>
-      </p>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] Work out the last revision date of the document </desc>
-   </doc>
-  <xsl:template name="generateRevDate">
-      <xsl:variable name="when">
-         <xsl:choose>
-            <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/@vcdate">
-               <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/@vcdate"/>
-            </xsl:when>
-            <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/descendant::tei:date">
-               <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/descendant::tei:date[1]"/>
-            </xsl:when>
-            <xsl:when
-		test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/descendant::tei:date">
-	      <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/descendant::tei:date"/>
-	    </xsl:when>	    
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="starts-with($when,'$Date')">
-	   <!-- it's RCS -->
-	   <xsl:value-of select="substring($when,16,2)"/>
-	   <xsl:text>/</xsl:text>
-	   <xsl:value-of select="substring($when,13,2)"/>
-	   <xsl:text>/</xsl:text>
-	   <xsl:value-of select="substring($when,8,4)"/>
-         </xsl:when>
-         <xsl:when test="starts-with($when,'$LastChangedDate')">
-	   <!-- it's Subversion-->
-	   <xsl:value-of select="substring-before(substring-after($when,'('),')')"/>
-         </xsl:when>
-         <xsl:when test="not($when='')">
-	   <xsl:value-of select="$when"/>
-	 </xsl:when>
-	 <xsl:otherwise>
-	   <xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] Work out the publish date of the document </desc>
-   </doc>
-  <xsl:template name="generateDate">
-      <xsl:choose>
-	 <xsl:when test="$useFixedDate='true'">1970-01-01</xsl:when>
-         <xsl:when test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docDate">
-            <xsl:apply-templates mode="date" select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docDate"/>
-         </xsl:when>
-         <xsl:when
-	     test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when]">
-            <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when][1]/@when"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date">
-            <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[1]"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date">
-            <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
-            <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition"/>
-         </xsl:when>
-	 <xsl:when
-	     test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[@when
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: header.xsl 10056 2012-01-20 23:22:33Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[common] Find a plausible editor name</desc>
+	</doc>
+	<xsl:template name="generateEditor">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:editor">
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:editor">
+					<xsl:apply-templates />
+					<xsl:choose>
+						<xsl:when test="count(following-sibling::tei:editor)=1">
+							<xsl:if test="count(preceding-sibling::tei:editor)>=1">
+								<xsl:text>,</xsl:text>
+							</xsl:if>
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									and
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:when test="following-sibling::tei:editor">
+							,
+						</xsl:when>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/tei:respStmt[tei:resp='editor']">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/tei:respStmt[tei:resp='editor'][1]/tei:name" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[common] Find a plausible main author name</desc>
+	</doc>
+	<xsl:template name="generateAuthor">
+		<xsl:choose>
+			<xsl:when
+				test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docAuthor">
+				<xsl:apply-templates mode="author"
+					select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docAuthor" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author">
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author">
+					<xsl:apply-templates />
+					<xsl:choose>
+						<xsl:when test="count(following-sibling::tei:author)=1">
+							<xsl:if test="count(preceding-sibling::tei:author)>1">
+								<xsl:text>,</xsl:text>
+							</xsl:if>
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									and
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:when test="following-sibling::tei:author">
+							,
+						</xsl:when>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/tei:respStmt[tei:resp='author']">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change/tei:respStmt[tei:resp='author'][1]/tei:name" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docAuthor">
+				<xsl:apply-templates mode="author"
+					select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docAuthor" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[common] Find a plausible name of person responsible for current
+			revision</desc>
+	</doc>
+	<xsl:template name="generateRevAuthor">
+		<xsl:variable name="who">
+			<xsl:choose>
+				<xsl:when
+					test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/@vcwho">
+					<xsl:apply-templates
+						select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/@vcwho" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[1]/tei:respStmt/tei:name">
+					<xsl:value-of
+						select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[1]/tei:respStmt/tei:name/text()" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="normalize-space($who)=concat('$Author', '$')" />
+			<xsl:when test="starts-with($who,'$Author')">
+				<!-- it's RCS -->
+				<xsl:value-of
+					select="normalize-space(substring-before(substring-after($who,'Author'),'$'))" />
+			</xsl:when>
+			<xsl:when test="starts-with($who,'$LastChangedBy')">
+				<!-- it's Subversion -->
+				<xsl:value-of
+					select="normalize-space(substring-before(substring-after($who,'LastChangedBy:'),'$'))" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$who" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[common] </desc>
+	</doc>
+	<xsl:template name="generateAuthorList">
+		<xsl:variable name="realauthor">
+			<xsl:call-template name="generateAuthor" />
+		</xsl:variable>
+		<xsl:variable name="revauthor">
+			<xsl:call-template name="generateRevAuthor" />
+		</xsl:variable>
+		<xsl:variable name="editor">
+			<xsl:call-template name="generateEditor" />
+		</xsl:variable>
+		<xsl:if test="not($realauthor = '')">
+			<p xmlns="http://www.w3.org/1999/xhtml" class="mainAuthor">
+				<xsl:text> </xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						authorWord
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>: </xsl:text>
+				<xsl:copy-of select="$realauthor" />
+			</p>
+		</xsl:if>
+		<xsl:if test="not($revauthor = '')">
+			<p class="mainRevAuthor" xmlns="http://www.w3.org/1999/xhtml">
+				<xsl:text> (</xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						revisedWord
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text> </xsl:text>
+				<xsl:copy-of select="$revauthor" />
+				<xsl:text>)</xsl:text>
+			</p>
+		</xsl:if>
+		<xsl:if test="not($editor = '')">
+			<p class="mainEditor" xmlns="http://www.w3.org/1999/xhtml">
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						editorWord
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>: </xsl:text>
+				<xsl:copy-of select="$editor" />
+			</p>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[common] Work out the last revision date of the document </desc>
+	</doc>
+	<xsl:template name="generateRevDate">
+		<xsl:variable name="when">
+			<xsl:choose>
+				<xsl:when
+					test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/@vcdate">
+					<xsl:apply-templates
+						select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/@vcdate" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/descendant::tei:date">
+					<xsl:value-of
+						select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/descendant::tei:date[1]" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/descendant::tei:date">
+					<xsl:value-of
+						select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/descendant::tei:date" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="starts-with($when,'$Date')">
+				<!-- it's RCS -->
+				<xsl:value-of select="substring($when,16,2)" />
+				<xsl:text>/</xsl:text>
+				<xsl:value-of select="substring($when,13,2)" />
+				<xsl:text>/</xsl:text>
+				<xsl:value-of select="substring($when,8,4)" />
+			</xsl:when>
+			<xsl:when test="starts-with($when,'$LastChangedDate')">
+				<!-- it's Subversion -->
+				<xsl:value-of
+					select="substring-before(substring-after($when,'('),')')" />
+			</xsl:when>
+			<xsl:when test="not($when='')">
+				<xsl:value-of select="$when" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[common] Work out the publish date of the document </desc>
+	</doc>
+	<xsl:template name="generateDate">
+		<xsl:choose>
+			<xsl:when test="$useFixedDate='true'">
+				1970-01-01
+			</xsl:when>
+			<xsl:when
+				test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docDate">
+				<xsl:apply-templates mode="date"
+					select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docDate" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when]">
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when][1]/@when" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date">
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[1]" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date">
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[@when
 		   or tei:date]">
-            <xsl:for-each
-		select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[1]">
-	      <xsl:choose>
-		<xsl:when test="@when">
-		  <xsl:value-of select="@when"/>
-		</xsl:when>
-		<xsl:when test="tei:date/@when">
-		  <xsl:value-of select="tei:date/@when"/>
-		</xsl:when>
-		<xsl:when test="tei:date">
-		  <xsl:value-of select="tei:date"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:for-each>
-	 </xsl:when>
-	 <xsl:otherwise>
-	   <xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')"/>
-	 </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] Generate a title</desc>
-   </doc>
-  <xsl:template name="generateTitle">
-      <xsl:choose>
-         <xsl:when test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle">
-            <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle/tei:titlePart"/>
-         </xsl:when>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[1]">
+					<xsl:choose>
+						<xsl:when test="@when">
+							<xsl:value-of select="@when" />
+						</xsl:when>
+						<xsl:when test="tei:date/@when">
+							<xsl:value-of select="tei:date/@when" />
+						</xsl:when>
+						<xsl:when test="tei:date">
+							<xsl:value-of select="tei:date" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[common] Generate a title</desc>
+	</doc>
+	<xsl:template name="generateTitle">
+		<xsl:choose>
+			<xsl:when
+				test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle/tei:titlePart" />
+			</xsl:when>
 
-         <xsl:when test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:teiCorpus/tei:text/tei:front//tei:docTitle">
-            <xsl:apply-templates select="ancestor-or-self::tei:teiCorpus/tei:text/tei:front//tei:docTitle/tei:titlePart"/>
-         </xsl:when>
+			<xsl:when
+				test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:teiCorpus/tei:text/tei:front//tei:docTitle">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:teiCorpus/tei:text/tei:front//tei:docTitle/tei:titlePart" />
+			</xsl:when>
 
-         <xsl:when test="self::tei:teiCorpus">	
-            <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[not(@type='subordinate')]"/>
-         </xsl:when>
+			<xsl:when test="self::tei:teiCorpus">
+				<xsl:apply-templates
+					select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[not(@type='subordinate')]" />
+			</xsl:when>
 
-         <xsl:otherwise>
-            <xsl:for-each
-		select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt">
-	      <xsl:choose>
-		<xsl:when test="tei:title[@type='main']">
-		  <xsl:apply-templates select="tei:title[@type='main']"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <xsl:apply-templates select="tei:title"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[common] </p>
-         <p>Generate simple title with no markup</p>
-      </desc>
-   </doc>
-  <xsl:template name="generateSimpleTitle">
-      <xsl:choose>
-         <xsl:when test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle">
-            <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle"
-                                 mode="simple"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:for-each
-		select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt">
-	      <xsl:choose>
-		<xsl:when test="tei:title[@type='main']">
-		  <xsl:apply-templates
-		      select="tei:title[@type='main']" mode="simple"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <xsl:apply-templates select="tei:title[1]" mode="simple"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+			<xsl:otherwise>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt">
+					<xsl:choose>
+						<xsl:when test="tei:title[@type='main']">
+							<xsl:apply-templates
+								select="tei:title[@type='main']" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates select="tei:title" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[common] </p>
+			<p>Generate simple title with no markup</p>
+		</desc>
+	</doc>
+	<xsl:template name="generateSimpleTitle">
+		<xsl:choose>
+			<xsl:when
+				test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle"
+					mode="simple" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt">
+					<xsl:choose>
+						<xsl:when test="tei:title[@type='main']">
+							<xsl:apply-templates
+								select="tei:title[@type='main']" mode="simple" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates select="tei:title[1]"
+								mode="simple" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] Generate sub title </desc>
-   </doc>
-  <xsl:template name="generateSubTitle">
-      <xsl:choose>
-         <xsl:when test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle">
-            <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle"/>
-         </xsl:when>
-         <xsl:when test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:teiCorpus/tei:text/tei:front//tei:docTitle">
-            <xsl:apply-templates select="ancestor-or-self::tei:teiCorpus/tei:text/tei:front//tei:docTitle"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:for-each select="ancestor-or-self::tei:TEI|ancestor-or-self::tei:teiCorpus">
-               <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='subordinate']"/>
-            </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:div/tei:docAuthor"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc> Omit docAuthor found outside front matter</desc>
-   </doc>
-  <xsl:template match="tei:div/tei:docDate"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc> Omit docDate if found outside front matter</desc>
-   </doc>
-  <xsl:template match="tei:div/tei:docTitle"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Ignore docTitle in a div</desc>
-   </doc>
-  <xsl:template match="tei:docAuthor" mode="heading">
-      <xsl:if test="preceding-sibling::tei:docAuthor">
-         <xsl:choose>
-            <xsl:when test="not(following-sibling::tei:docAuthor)">
-               <xsl:text> and </xsl:text>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:text>, </xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-      <xsl:apply-templates/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[common] Generate sub title </desc>
+	</doc>
+	<xsl:template name="generateSubTitle">
+		<xsl:choose>
+			<xsl:when
+				test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:text/tei:front//tei:docTitle" />
+			</xsl:when>
+			<xsl:when
+				test="$useHeaderFrontMatter='true' and ancestor-or-self::tei:teiCorpus/tei:text/tei:front//tei:docTitle">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:teiCorpus/tei:text/tei:front//tei:docTitle" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI|ancestor-or-self::tei:teiCorpus">
+					<xsl:apply-templates
+						select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='subordinate']" />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:div/tei:docAuthor" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc> Omit docAuthor found outside front matter</desc>
+	</doc>
+	<xsl:template match="tei:div/tei:docDate" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc> Omit docDate if found outside front matter</desc>
+	</doc>
+	<xsl:template match="tei:div/tei:docTitle" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Ignore docTitle in a div</desc>
+	</doc>
+	<xsl:template match="tei:docAuthor" mode="heading">
+		<xsl:if test="preceding-sibling::tei:docAuthor">
+			<xsl:choose>
+				<xsl:when test="not(following-sibling::tei:docAuthor)">
+					<xsl:text> and </xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>, </xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:idno[@type='url']">
-      <xsl:text> &lt;</xsl:text>
-      <xsl:call-template name="makeExternalLink">
-         <xsl:with-param name="ptr" select="true()"/>
-         <xsl:with-param name="dest">
-            <xsl:value-of select="normalize-space(.)"/>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:text>&gt;.</xsl:text>
-   </xsl:template>
+	<xsl:template match="tei:idno[@type='url']">
+		<xsl:text> &lt;</xsl:text>
+		<xsl:call-template name="makeExternalLink">
+			<xsl:with-param name="ptr" select="true()" />
+			<xsl:with-param name="dest">
+				<xsl:value-of select="normalize-space(.)" />
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:text>&gt;.</xsl:text>
+	</xsl:template>
 
 
-   <xsl:template match="tei:idno">
-      <xsl:text> </xsl:text>
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:idno">
+		<xsl:text> </xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:idno[@type='doi']"/>
+	<xsl:template match="tei:idno[@type='doi']" />
 
-  <xsl:template name="generateEdition">
-    <p xmlns="http://www.w3.org/1999/xhtml" class="editionStmt">
-      <xsl:apply-templates select="/(tei:teiCorpus|tei:TEI)/tei:teiHeader/tei:fileDesc/tei:editionStmt"/>
-    </p>
-  </xsl:template>
+	<xsl:template name="generateEdition">
+		<p xmlns="http://www.w3.org/1999/xhtml" class="editionStmt">
+			<xsl:apply-templates
+				select="/(tei:teiCorpus|tei:TEI)/tei:teiHeader/tei:fileDesc/tei:editionStmt" />
+		</p>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/odds.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/odds.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/odds.xsl	(revision 2397)
@@ -1,255 +1,300 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cals="http://www.oasis-open.org/specs/tm9901" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:iso="http://www.iso.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" version="2.0" exclude-result-prefixes="cals ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI Utility stylesheet defining templates for use in
-      processing ODD</p>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" version="2.0"
+	exclude-result-prefixes="cals ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI Utility stylesheet defining templates for use in
+				processing ODD</p>
 
-      <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: functions.xsl 9464 2011-10-06 08:27:01Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:template name="makeDescription">
-    <xsl:param name="includeValList">false</xsl:param>
-    <xsl:param name="coded">true</xsl:param>
-    <xsl:param name="showListRef">true</xsl:param>
-    <xsl:variable name="documentationLanguage">
-      <xsl:call-template name="generateDoc"/>
-    </xsl:variable>
-    <xsl:variable name="langs">
-      <xsl:value-of select="concat(normalize-space($documentationLanguage),' ')"/>
-    </xsl:variable>
-    <xsl:variable name="firstLang">
-      <xsl:value-of select="substring-before($langs,' ')"/>
-    </xsl:variable>
-    <!-- first the gloss -->
-    <xsl:call-template name="makeGloss">
-      <xsl:with-param name="langs" select="$langs"/>
-    </xsl:call-template>
-    <!-- now the description -->
-    <xsl:choose>
-      <xsl:when test="not(tei:desc)"> </xsl:when>
-      <xsl:when test="count(tei:desc)=1">
-        <xsl:for-each select="tei:desc">
-          <xsl:apply-templates select="." mode="inLanguage"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:when test="tei:desc[@xml:lang=$firstLang]">
-        <xsl:for-each select="tei:desc[@xml:lang=$firstLang]">
-          <xsl:apply-templates select="." mode="inLanguage"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="D">
-          <xsl:for-each select="tei:desc">
-            <xsl:variable name="currentLang">
-              <xsl:call-template name="findLanguage"/>
-            </xsl:variable>
-            <xsl:if test="contains($langs,concat($currentLang,' '))">
-              <xsl:apply-templates select="." mode="inLanguage"/>
-            </xsl:if>
-          </xsl:for-each>
-        </xsl:variable>
-        <xsl:choose>
-          <xsl:when test="$D='' and tei:desc[not(@xml:lang)]">
-            <xsl:for-each select="tei:desc[not(@xml:lang)]">
-              <xsl:apply-templates select="." mode="inLanguage"/>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:when test="$coded='false'">
-            <xsl:value-of select="$D"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:copy-of select="$D"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:choose>
-      <xsl:when test="$includeValList='false'"/>
-      <xsl:when test="tei:valList[@type='open']">
-        <xsl:text>&#10;</xsl:text>
-        <xsl:call-template name="i18n">
-          <xsl:with-param name="word">
-            <xsl:text>Sample values include</xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:text>: </xsl:text>
-        <xsl:for-each select="tei:valList/tei:valItem">
-          <xsl:number/>
-          <xsl:text>] </xsl:text>
-          <xsl:choose>
-            <xsl:when test="tei:altIdent=@ident">
-              <xsl:value-of select="@ident"/>
-            </xsl:when>
-            <xsl:when test="tei:altIdent">
-              <xsl:value-of select="normalize-space(tei:altIdent)"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@ident"/>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:variable name="documentationLanguage">
-            <xsl:call-template name="generateDoc"/>
-          </xsl:variable>
-          <xsl:variable name="langs">
-            <xsl:value-of select="concat(normalize-space($documentationLanguage),' ')"/>
-          </xsl:variable>
-          <xsl:variable name="firstLang">
-            <xsl:value-of select="substring-before($langs,' ')"/>
-          </xsl:variable>
-          <xsl:call-template name="makeGloss">
-            <xsl:with-param name="langs" select="$langs"/>
-          </xsl:call-template>
-          <xsl:if test="following-sibling::tei:valItem">
-            <xsl:text>; </xsl:text>
-          </xsl:if>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:when test="tei:valList[@type='semi']">
-        <xsl:text>&#10;</xsl:text>
-        <xsl:call-template name="i18n">
-          <xsl:with-param name="word">
-            <xsl:text>Suggested values include</xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:text>: </xsl:text>
-        <xsl:for-each select="tei:valList/tei:valItem">
-          <xsl:number/>
-          <xsl:text>] </xsl:text>
-          <xsl:choose>
-            <xsl:when test="tei:altIdent=@ident">
-              <xsl:value-of select="@ident"/>
-            </xsl:when>
-            <xsl:when test="tei:altIdent">
-              <xsl:value-of select="normalize-space(tei:altIdent)"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@ident"/>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:variable name="documentationLanguage">
-            <xsl:call-template name="generateDoc"/>
-          </xsl:variable>
-          <xsl:variable name="langs">
-            <xsl:value-of select="concat(normalize-space($documentationLanguage),' ')"/>
-          </xsl:variable>
-          <xsl:variable name="firstLang">
-            <xsl:value-of select="substring-before($langs,' ')"/>
-          </xsl:variable>
-          <xsl:call-template name="makeGloss">
-            <xsl:with-param name="langs" select="$langs"/>
-          </xsl:call-template>
-          <xsl:if test="following-sibling::tei:valItem">
-            <xsl:text>; </xsl:text>
-          </xsl:if>
-        </xsl:for-each>
-      </xsl:when>
-    </xsl:choose>
-    <xsl:if test="tei:listRef and $showListRef='true'">
-	<xsl:text> [</xsl:text>
-	<xsl:for-each select="tei:listRef/tei:*">
-	  <xsl:apply-templates select="." mode="weave"/>
-	  <xsl:if test="following-sibling::tei:*"> 
-	    <xsl:text> </xsl:text>
-	  </xsl:if>
-	</xsl:for-each>
-	<xsl:text>]</xsl:text>
-    </xsl:if>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template name="makeGloss">
-    <xsl:param name="langs"/>
-    <xsl:variable name="firstLang">
-      <xsl:value-of select="substring-before($langs,' ')"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="not(tei:gloss)"/>
-      <xsl:when test="string-length(tei:gloss[1])=0"/>
-      <xsl:when test="count(tei:gloss)=1 and not(tei:gloss[@xml:lang])">
-        <xsl:text> (</xsl:text>
-        <xsl:apply-templates select="tei:gloss" mode="inLanguage"/>
-        <xsl:text>) </xsl:text>
-      </xsl:when>
-      <xsl:when test="tei:gloss[@xml:lang=$firstLang]">
-        <xsl:if test="not(tei:gloss[@xml:lang=$firstLang]='')">
-          <xsl:text> (</xsl:text>
-          <xsl:apply-templates select="tei:gloss[@xml:lang=$firstLang]" mode="inLanguage"/>
-          <xsl:text>) </xsl:text>
-        </xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="G">
-          <xsl:for-each select="tei:gloss">
-            <xsl:variable name="currentLang">
-              <xsl:call-template name="findLanguage"/>
-            </xsl:variable>
-            <xsl:if test="contains($langs,concat($currentLang,' '))">
-              <xsl:text>(</xsl:text>
-              <xsl:apply-templates select="." mode="inLanguage"/>
-              <xsl:text>) </xsl:text>
-            </xsl:if>
-          </xsl:for-each>
-        </xsl:variable>
-        <xsl:choose>
-          <xsl:when test="$G='' and tei:gloss[not(@xml:lang)]">
-            <xsl:text> (</xsl:text>
-            <xsl:apply-templates select="tei:gloss[not(@xml:lang)]" mode="inLanguage"/>
-            <xsl:text>) </xsl:text>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:copy-of select="$G"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: functions.xsl 9464 2011-10-06 08:27:01Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:template name="makeDescription">
+		<xsl:param name="includeValList">
+			false
+		</xsl:param>
+		<xsl:param name="coded">
+			true
+		</xsl:param>
+		<xsl:param name="showListRef">
+			true
+		</xsl:param>
+		<xsl:variable name="documentationLanguage">
+			<xsl:call-template name="generateDoc" />
+		</xsl:variable>
+		<xsl:variable name="langs">
+			<xsl:value-of
+				select="concat(normalize-space($documentationLanguage),' ')" />
+		</xsl:variable>
+		<xsl:variable name="firstLang">
+			<xsl:value-of select="substring-before($langs,' ')" />
+		</xsl:variable>
+		<!-- first the gloss -->
+		<xsl:call-template name="makeGloss">
+			<xsl:with-param name="langs" select="$langs" />
+		</xsl:call-template>
+		<!-- now the description -->
+		<xsl:choose>
+			<xsl:when test="not(tei:desc)">
+			</xsl:when>
+			<xsl:when test="count(tei:desc)=1">
+				<xsl:for-each select="tei:desc">
+					<xsl:apply-templates select="."
+						mode="inLanguage" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="tei:desc[@xml:lang=$firstLang]">
+				<xsl:for-each select="tei:desc[@xml:lang=$firstLang]">
+					<xsl:apply-templates select="."
+						mode="inLanguage" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="D">
+					<xsl:for-each select="tei:desc">
+						<xsl:variable name="currentLang">
+							<xsl:call-template name="findLanguage" />
+						</xsl:variable>
+						<xsl:if test="contains($langs,concat($currentLang,' '))">
+							<xsl:apply-templates select="."
+								mode="inLanguage" />
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$D='' and tei:desc[not(@xml:lang)]">
+						<xsl:for-each select="tei:desc[not(@xml:lang)]">
+							<xsl:apply-templates select="."
+								mode="inLanguage" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="$coded='false'">
+						<xsl:value-of select="$D" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy-of select="$D" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="$includeValList='false'" />
+			<xsl:when test="tei:valList[@type='open']">
+				<xsl:text>&#10;</xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						<xsl:text>Sample values include</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>: </xsl:text>
+				<xsl:for-each select="tei:valList/tei:valItem">
+					<xsl:number />
+					<xsl:text>] </xsl:text>
+					<xsl:choose>
+						<xsl:when test="tei:altIdent=@ident">
+							<xsl:value-of select="@ident" />
+						</xsl:when>
+						<xsl:when test="tei:altIdent">
+							<xsl:value-of select="normalize-space(tei:altIdent)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@ident" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:variable name="documentationLanguage">
+						<xsl:call-template name="generateDoc" />
+					</xsl:variable>
+					<xsl:variable name="langs">
+						<xsl:value-of
+							select="concat(normalize-space($documentationLanguage),' ')" />
+					</xsl:variable>
+					<xsl:variable name="firstLang">
+						<xsl:value-of select="substring-before($langs,' ')" />
+					</xsl:variable>
+					<xsl:call-template name="makeGloss">
+						<xsl:with-param name="langs" select="$langs" />
+					</xsl:call-template>
+					<xsl:if test="following-sibling::tei:valItem">
+						<xsl:text>; </xsl:text>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="tei:valList[@type='semi']">
+				<xsl:text>&#10;</xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						<xsl:text>Suggested values include</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>: </xsl:text>
+				<xsl:for-each select="tei:valList/tei:valItem">
+					<xsl:number />
+					<xsl:text>] </xsl:text>
+					<xsl:choose>
+						<xsl:when test="tei:altIdent=@ident">
+							<xsl:value-of select="@ident" />
+						</xsl:when>
+						<xsl:when test="tei:altIdent">
+							<xsl:value-of select="normalize-space(tei:altIdent)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@ident" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:variable name="documentationLanguage">
+						<xsl:call-template name="generateDoc" />
+					</xsl:variable>
+					<xsl:variable name="langs">
+						<xsl:value-of
+							select="concat(normalize-space($documentationLanguage),' ')" />
+					</xsl:variable>
+					<xsl:variable name="firstLang">
+						<xsl:value-of select="substring-before($langs,' ')" />
+					</xsl:variable>
+					<xsl:call-template name="makeGloss">
+						<xsl:with-param name="langs" select="$langs" />
+					</xsl:call-template>
+					<xsl:if test="following-sibling::tei:valItem">
+						<xsl:text>; </xsl:text>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:if test="tei:listRef and $showListRef='true'">
+			<xsl:text> [</xsl:text>
+			<xsl:for-each select="tei:listRef/tei:*">
+				<xsl:apply-templates select="." mode="weave" />
+				<xsl:if test="following-sibling::tei:*">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+			</xsl:for-each>
+			<xsl:text>]</xsl:text>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template name="findLanguage">
-    <xsl:choose>
-      <xsl:when test="@xml:lang">
-        <xsl:value-of select="@xml:lang"/>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:*[@xml:lang]">
-        <xsl:value-of select="(ancestor::tei:*[@xml:lang])[1]/@xml:lang"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>en</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="makeGloss">
+		<xsl:param name="langs" />
+		<xsl:variable name="firstLang">
+			<xsl:value-of select="substring-before($langs,' ')" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="not(tei:gloss)" />
+			<xsl:when test="string-length(tei:gloss[1])=0" />
+			<xsl:when
+				test="count(tei:gloss)=1 and not(tei:gloss[@xml:lang])">
+				<xsl:text> (</xsl:text>
+				<xsl:apply-templates select="tei:gloss"
+					mode="inLanguage" />
+				<xsl:text>) </xsl:text>
+			</xsl:when>
+			<xsl:when test="tei:gloss[@xml:lang=$firstLang]">
+				<xsl:if test="not(tei:gloss[@xml:lang=$firstLang]='')">
+					<xsl:text> (</xsl:text>
+					<xsl:apply-templates
+						select="tei:gloss[@xml:lang=$firstLang]" mode="inLanguage" />
+					<xsl:text>) </xsl:text>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="G">
+					<xsl:for-each select="tei:gloss">
+						<xsl:variable name="currentLang">
+							<xsl:call-template name="findLanguage" />
+						</xsl:variable>
+						<xsl:if test="contains($langs,concat($currentLang,' '))">
+							<xsl:text>(</xsl:text>
+							<xsl:apply-templates select="."
+								mode="inLanguage" />
+							<xsl:text>) </xsl:text>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$G='' and tei:gloss[not(@xml:lang)]">
+						<xsl:text> (</xsl:text>
+						<xsl:apply-templates
+							select="tei:gloss[not(@xml:lang)]" mode="inLanguage" />
+						<xsl:text>) </xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy-of select="$G" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
+	<xsl:template name="findLanguage">
+		<xsl:choose>
+			<xsl:when test="@xml:lang">
+				<xsl:value-of select="@xml:lang" />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:*[@xml:lang]">
+				<xsl:value-of
+					select="(ancestor::tei:*[@xml:lang])[1]/@xml:lang" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>en</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/verbatim.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/verbatim.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/verbatim.xsl	(revision 2397)
@@ -1,711 +1,896 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:i="http://www.iso.org/ns/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:s="http://www.ascc.net/xml/schematron" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dbk="http://docbook.org/ns/docbook" exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl         m atom xlink xhtml dbk" version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet dealing with elements from the core module. </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:i="http://www.iso.org/ns/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:atom="http://www.w3.org/2005/Atom"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	xmlns:dbk="http://docbook.org/ns/docbook"
+	exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl         m atom xlink xhtml dbk"
+	version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module. </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: verbatim.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:strip-space elements="teix:* rng:* xsl:* xhtml:* atom:* m:*"/>
-  <xsl:param name="useNSPrefixes">true</xsl:param>
-  <xsl:param name="startComment">&lt;span class="comment"&gt;</xsl:param>
-  <xsl:param name="endComment">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startElement">&lt;span class="element"&gt;</xsl:param>
-  <xsl:param name="endElement">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startElementName">&lt;span class="elementname"&gt;</xsl:param>
-  <xsl:param name="endElementName">&lt;/span&gt;</xsl:param>
-  <xsl:param name="highlightStartElementName">&lt;span class="highlightelementname"&gt;</xsl:param>
-  <xsl:param name="highlightEndElementName">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startAttribute">&lt;span class="attribute"&gt;</xsl:param>
-  <xsl:param name="endAttribute">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startAttributeValue">&lt;span class="attributevalue"&gt;</xsl:param>
-  <xsl:param name="endAttributeValue">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startNamespace">&lt;span class="namespace"&gt;</xsl:param>
-  <xsl:param name="endNamespace">&lt;/span&gt;</xsl:param>
-  <xsl:param name="spaceCharacter">&#160;</xsl:param>
-  <xsl:param name="showNamespaceDecls">true</xsl:param>
-  <xsl:param name="forceWrap">false</xsl:param>
-  <xsl:param name="wrapLength">65</xsl:param>
-  <xsl:param name="attLength">40</xsl:param>
-  <xsl:param name="attsOnSameLine">3</xsl:param>
-  <xsl:param name="omitNSDecls">http://www.tei-c.org/ns/1.0</xsl:param>
-  <xsl:key name="NSUsed" match="*" use="namespace-uri()"/>
-  <xsl:key name="NSUsed" match="@*" use="namespace-uri()"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Work out a namespace prefix for verbatim elements</p>
-      <p>[common] </p>
-    </desc>
-  </doc>
-  <xsl:template name="verbatim-getNamespacePrefix">
-    <xsl:variable name="ns" select="namespace-uri()"/>
-    <xsl:variable name="prefix" select="tei:getPrefix($ns,ancestor-or-self::*[1])[1]"/>
-    <xsl:choose>
-      <xsl:when test="$prefix !=''">
-        <xsl:value-of select="$prefix"/>
-      </xsl:when>
-      <xsl:when test="$ns='http://docbook.org/ns/docbook'">dbk</xsl:when>
-      <xsl:when test="$ns='http://earth.google.com/kml/2.1'">kml</xsl:when>
-      <xsl:when test="$ns='http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0'">nvdl</xsl:when>
-      <xsl:when test="$ns='http://purl.org/rss/1.0/modules/event/'">ev</xsl:when>
-      <xsl:when test="$ns='http://purl.oclc.org/dsdl/schematron'">s</xsl:when>
-      <xsl:when test="$ns='http://relaxng.org/ns/compatibility/annotations/1.0'">a</xsl:when>
-      <xsl:when test="$ns='http://relaxng.org/ns/structure/1.0'">rng</xsl:when>
-      <xsl:when test="$ns='http://www.ascc.net/xml/schematron'">sch</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/1998/Math/MathML'">m</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/1999/XSL/Transform'">xsl</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/1999/xhtml'">xhtml</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/1999/xlink'">xlink</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/2001/XMLSchema'">xsd</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/2005/11/its'">its</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/2005/Atom'">atom</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/XML/1998/namespace'">xml</xsl:when>
-      <xsl:when test="$ns='http://www.tei-c.org/ns/geneticEditions'">ge</xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-newLine"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Make newline</p>
-      <p>[common] </p>
-      <param name="id">identifier for debugging only</param>
-    </desc>
-  </doc>
-  <xsl:template name="verbatim-lineBreak">
-    <xsl:param name="id"/>
-    <xsl:text>&#10;</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process comments in verbatim mode</p>
-      <p>[common] </p>
-    </desc>
-  </doc>
-  <xsl:template match="comment()" mode="verbatim">
-    <xsl:choose>
-      <xsl:when test="ancestor::Wrapper"/>
-      <xsl:when test="ancestor::xhtml:Wrapper"/>
-      <xsl:otherwise>
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">21</xsl:with-param>
-        </xsl:call-template>
-        <xsl:value-of disable-output-escaping="yes" select="$startComment"/>
-        <xsl:text>&lt;!--</xsl:text>
-        <xsl:choose>
-          <xsl:when test="$forceWrap='true'">
-            <xsl:call-template name="verbatim-reformatText">
-              <xsl:with-param name="sofar">0</xsl:with-param>
-              <xsl:with-param name="indent">
-                <xsl:text> </xsl:text>
-              </xsl:with-param>
-              <xsl:with-param name="text">
-                <xsl:value-of select="normalize-space(.)"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="."/>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:text>--&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endComment"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process text nodes in verbatim mode</p>
-      <p>[common] </p>
-    </desc>
-  </doc>
-  <xsl:template match="text()" mode="verbatim">
-    <xsl:choose>
-      <xsl:when test="$forceWrap='true'">
-        <xsl:variable name="indent">
-          <xsl:for-each select="parent::*">
-            <xsl:call-template name="verbatim-makeIndent"/>
-          </xsl:for-each>
-        </xsl:variable>
-        <xsl:if test="string-length(.)&gt;$wrapLength or parent::sch:assert">
-          <xsl:text>&#10;</xsl:text>
-          <xsl:value-of select="$indent"/>
-        </xsl:if>
-        <xsl:call-template name="verbatim-reformatText">
-          <xsl:with-param name="sofar">0</xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:value-of select="$indent"/>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-            <xsl:value-of select="normalize-space(.)"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:if test="string-length(.)&gt;$wrapLength or parent::sch:assert">
-          <xsl:text>&#10;</xsl:text>
-          <xsl:value-of select="$indent"/>
-        </xsl:if>
-      </xsl:when>
-      <xsl:when test="not(preceding-sibling::node() or         contains(.,'&#10;'))">
-        <xsl:if test="starts-with(.,' ')">
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="normalize-space(.)"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:if test="substring(.,string-length(.),1)=' '">
-          <xsl:text> </xsl:text>
-        </xsl:if>
-      </xsl:when>
-      <xsl:when test="normalize-space(.)=''">
-        <xsl:for-each select="following-sibling::*[1]">
-          <xsl:call-template name="verbatim-lineBreak">
-            <xsl:with-param name="id">7</xsl:with-param>
-          </xsl:call-template>
-          <xsl:call-template name="verbatim-makeIndent"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="verbatim-wraptext">
-          <xsl:with-param name="count">0</xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:for-each select="parent::*">
-              <xsl:call-template name="verbatim-makeIndent"/>
-            </xsl:for-each>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-            <xsl:choose>
-              <xsl:when test="starts-with(.,'&#10;') and not          (preceding-sibling::node())">
-                <xsl:value-of select="translate(substring(.,2),'&#10;','⌤')"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="translate(.,'&#10;','⌤')"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:with-param>
-        </xsl:call-template>
-        <!--
-	<xsl:if test="substring(.,string-length(.))=' '">
-	  <xsl:text> </xsl:text>
-	</xsl:if>
-	-->
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-reformatText">
-    <xsl:param name="indent"/>
-    <xsl:param name="text"/>
-    <xsl:param name="sofar"/>
-    <xsl:choose>
-      <xsl:when test="number($sofar) &gt; $wrapLength">
-        <xsl:text>&#10;</xsl:text>
-        <xsl:value-of select="$indent"/>
-        <xsl:call-template name="verbatim-reformatText">
-          <xsl:with-param name="text">
-            <xsl:value-of select="$text"/>
-          </xsl:with-param>
-          <xsl:with-param name="sofar">
-            <xsl:text>0</xsl:text>
-          </xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:value-of select="$indent"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="not(contains($text,' '))">
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="$text"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="chunk">
-          <xsl:value-of select="substring-before($text,' ')"/>
-        </xsl:variable>
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="$chunk"/>
-            <xsl:text> </xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="verbatim-reformatText">
-          <xsl:with-param name="text">
-            <xsl:value-of select="substring-after($text,' ')"/>
-          </xsl:with-param>
-          <xsl:with-param name="sofar">
-            <xsl:value-of select="$sofar + string-length($chunk) + 1"/>
-          </xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:value-of select="$indent"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-wraptext">
-    <xsl:param name="indent"/>
-    <xsl:param name="text"/>
-    <xsl:param name="count">0</xsl:param>
-    <xsl:variable name="finalSpace">
-      <xsl:choose>
-        <xsl:when test="substring($text,string-length($text),1)=' '">
-          <xsl:text> </xsl:text>
-        </xsl:when>
-        <xsl:when test="substring($text,string-length($text),1)='⌤'">
-          <xsl:text> </xsl:text>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:text/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <!--
-<xsl:message>my text is [<xsl:value-of select="$text"/>]</xsl:message>
-<xsl:message>my space is [<xsl:value-of select="$finalSpace"/>]</xsl:message>
--->
-    <xsl:choose>
-      <xsl:when test="normalize-space($text)=''"/>
-      <xsl:when test="contains($text,'⌤')">
-        <xsl:if test="$count &gt; 0">
-          <xsl:value-of select="$indent"/>
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:if test="starts-with($text,' ')">
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="normalize-space(substring-before($text,'⌤'))"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <!--	<xsl:if test="not(substring-after($text,'&#10;')='')">-->
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">6</xsl:with-param>
-        </xsl:call-template>
-        <xsl:value-of select="$indent"/>
-        <xsl:call-template name="verbatim-wraptext">
-          <xsl:with-param name="indent">
-            <xsl:value-of select="$indent"/>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-            <xsl:value-of select="normalize-space(substring-after($text,'⌤'))"/>
-            <xsl:value-of select="$finalSpace"/>
-          </xsl:with-param>
-          <xsl:with-param name="count">
-            <xsl:value-of select="$count + 1"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:if test="starts-with($text,' ')">
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:if test="$count &gt; 0 and parent::*">
-          <xsl:value-of select="$indent"/>
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="normalize-space($text)"/>
-            <xsl:value-of select="$finalSpace"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process text and process ampersands</p>
-      <p>[common] </p>
-    </desc>
-  </doc>
-  <xsl:template name="verbatim-Text">
-    <xsl:param name="words"/>
-    <xsl:analyze-string select="$words" regex="(&amp;)(.)">
-      <xsl:matching-substring>
-        <xsl:choose>
-          <xsl:when test="starts-with(regex-group(2),'#')">
-            <xsl:text>&amp;</xsl:text>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:text>&amp;amp;</xsl:text>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>
-        <xsl:value-of select="."/>
-      </xsl:non-matching-substring>
-    </xsl:analyze-string>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Process default elements in verbatim mode</p>
-      <p>[common] </p>
-    </desc>
-  </doc>
-  <xsl:template match="*" mode="verbatim">
-    <xsl:param name="highlight"/>
-    <xsl:choose>
-      <xsl:when test="parent::xhtml:Wrapper"/>
-      <!--      <xsl:when test="child::node()[last()]/self::text()[not(.='')] and child::node()[1]/self::text()[not(.='')]"/>-->
-      <xsl:when test="not(parent::*)  or parent::teix:egXML">
-        <xsl:choose>
-          <xsl:when test="preceding-sibling::node()[1][self::text()]      and following-sibling::node()[1][self::text()]"/>
-          <xsl:when test="preceding-sibling::*">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">-1</xsl:with-param>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="verbatim-newLine"/>
-            <!-- <xsl:call-template name="makeIndent"/>-->
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="not(preceding-sibling::node())">
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">-2</xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="verbatim-makeIndent"/>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::node()[1]/self::*">
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">1</xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="verbatim-makeIndent"/>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::node()[1]/self::text()"> </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">9</xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="verbatim-makeIndent"/>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
-    <xsl:text>&lt;</xsl:text>
-    <xsl:call-template name="verbatim-makeElementName">
-      <xsl:with-param name="start">true</xsl:with-param>
-      <xsl:with-param name="highlight">
-        <xsl:value-of select="$highlight"/>
-      </xsl:with-param>
-    </xsl:call-template>
-    <xsl:apply-templates select="@*" mode="verbatim"/>
-    <xsl:if test="$showNamespaceDecls='true' or parent::teix:egXML[@rend='full']">
-      <xsl:choose>
-        <xsl:when test="not(parent::*)">
-          <xsl:call-template name="nsList"/>
-        </xsl:when>
-        <xsl:when test="parent::teix:egXML and not(preceding-sibling::*)">
-          <xsl:call-template name="nsList"/>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="child::node()">
-        <xsl:text>&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-        <xsl:apply-templates mode="verbatim">
-          <xsl:with-param name="highlight">
-            <xsl:value-of select="$highlight"/>
-          </xsl:with-param>
-        </xsl:apply-templates>
-        <xsl:choose>
-          <xsl:when test="child::node()[last()]/self::text() and child::node()[1]/self::text()"/>
-          <xsl:when test="not(parent::*)  or parent::teix:egXML">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">23</xsl:with-param>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:when test="child::node()[last()]/self::text()[normalize-space(.)='']">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">3</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="verbatim-makeIndent"/>
-          </xsl:when>
-          <xsl:when test="child::node()[last()]/self::comment()">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">4</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="verbatim-makeIndent"/>
-          </xsl:when>
-          <xsl:when test="child::node()[last()]/self::*">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">5</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="verbatim-makeIndent"/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
-        <xsl:text>&lt;/</xsl:text>
-        <xsl:call-template name="verbatim-makeElementName">
-          <xsl:with-param name="start">false</xsl:with-param>
-          <xsl:with-param name="highlight">
-            <xsl:value-of select="$highlight"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:text>&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>/&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-createElement">
-    <xsl:param name="name"/>
-    <xsl:param name="special"/>
-    <xsl:choose>
-      <xsl:when test="$special='true'">
-        <xsl:value-of disable-output-escaping="yes" select="$highlightStartElementName"/>
-        <xsl:value-of select="$name"/>
-        <xsl:value-of disable-output-escaping="yes" select="$highlightEndElementName"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="$name"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-createAttribute">
-    <xsl:param name="name"/>
-    <xsl:value-of select="$name"/>
-  </xsl:template>
-  <xsl:template name="verbatim-makeElementName">
-    <xsl:param name="start"/>
-    <xsl:param name="highlight"/>
-    <!-- get namespace prefix -->
-    <xsl:variable name="ns-prefix">
-      <xsl:call-template name="verbatim-getNamespacePrefix"/>
-    </xsl:variable>
-    <xsl:variable name="highlightMe">
-      <xsl:choose>
-        <xsl:when test="$highlight=local-name()">true</xsl:when>
-        <xsl:otherwise>false</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="namespace-uri()='http://www.tei-c.org/ns/Examples'">
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="local-name(.)"/>
-          <xsl:with-param name="special">
-            <xsl:value-of select="$highlightMe"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="contains($omitNSDecls,namespace-uri())">
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="local-name(.)"/>
-          <xsl:with-param name="special">
-            <xsl:value-of select="$highlightMe"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$useNSPrefixes='true' and string-length($ns-prefix) &gt; 0">
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="concat($ns-prefix,':',local-name(.))"/>
-          <xsl:with-param name="special">
-            <xsl:value-of select="$highlightMe"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="not(namespace-uri()='')">
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="local-name(.)"/>
-          <xsl:with-param name="special">
-            <xsl:value-of select="$highlightMe"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:if test="$start='true' and not(namespace-uri()=namespace-uri(..))">
-          <xsl:text> xmlns="</xsl:text>
-          <xsl:value-of select="namespace-uri()"/>
-          <xsl:text>"</xsl:text>
-          <!-- 
-	       <xsl:call-template name="verbatim-lineBreak">
-	       <xsl:with-param name="id">5</xsl:with-param>
-	       </xsl:call-template>
-	       <xsl:call-template name="verbatim-makeIndent"/>
-	  -->
-        </xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="local-name(.)"/>
-          <xsl:with-param name="special">
-            <xsl:value-of select="$highlightMe"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-makeIndent">
-    <xsl:variable name="depth" select="count(ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')])"/>
-    <xsl:call-template name="verbatim-makeSpace">
-      <xsl:with-param name="d">
-        <xsl:value-of select="$depth"/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="verbatim-makeSpace">
-    <xsl:param name="d"/>
-    <xsl:if test="number($d)&gt;1">
-      <xsl:value-of select="$spaceCharacter"/>
-      <xsl:call-template name="verbatim-makeSpace">
-        <xsl:with-param name="d">
-          <xsl:value-of select="$d -1"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="@*" mode="verbatim">
-    <xsl:variable name="L">
-      <xsl:for-each select="../@*">
-        <xsl:value-of select="."/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:if test="count(../@*)&gt;$attsOnSameLine or      string-length($L)&gt;$attLength or     ancestor::tei:cell[not(@rend='wovenodd-col2')] or     namespace-uri()='http://www.w3.org/2005/11/its' or     string-length(.)+string-length(name(.)) &gt;     $attLength">
-      <xsl:call-template name="verbatim-lineBreak">
-        <xsl:with-param name="id">5</xsl:with-param>
-      </xsl:call-template>
-      <xsl:call-template name="verbatim-makeIndent"/>
-    </xsl:if>
-    <xsl:value-of select="$spaceCharacter"/>
-    <xsl:variable name="ns-prefix">
-      <xsl:call-template name="verbatim-getNamespacePrefix"/>
-    </xsl:variable>
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="string-length($ns-prefix) &gt; 0">
-          <xsl:value-of select="$ns-prefix"/>
-          <xsl:text>:</xsl:text>
-          <xsl:value-of select="local-name(.)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name(.)"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:call-template name="verbatim-createAttribute">
-      <xsl:with-param name="name" select="$name"/>
-    </xsl:call-template>
-    <xsl:text>="</xsl:text>
-    <xsl:value-of disable-output-escaping="yes" select="$startAttributeValue"/>
-    <xsl:apply-templates select="." mode="attributetext"/>
-    <xsl:value-of disable-output-escaping="yes" select="$endAttributeValue"/>
-    <xsl:text>"</xsl:text>
-  </xsl:template>
-  <xsl:template match="@*" mode="attributetext">
-    <xsl:choose>
-      <xsl:when test="string-length(.)&gt;$attLength and contains(.,' ')">
-        <xsl:call-template name="verbatim-reformatText">
-          <xsl:with-param name="sofar">0</xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:text> </xsl:text>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-            <xsl:value-of select="normalize-space(.)"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="."/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="text()|comment()|processing-instruction()" mode="ns"/>
-  <xsl:template match="*" mode="ns">
-    <xsl:for-each select="namespace::*">
-      <xsl:variable name="ns" select="."/>
-      <xsl:choose>
-        <xsl:when test=".='http://relaxng.org/ns/structure/1.0'"/>
-        <xsl:when test=".='http://www.w3.org/2001/XInclude'"/>
-        <xsl:when test=".='http://www.tei-c.org/ns/Examples'"/>
-        <xsl:when test=".='http://www.ascc.net/xml/schematron'"/>
-        <xsl:when test=".='http://relaxng.org/ns/compatibility/annotations/1.0'"/>
-        <xsl:when test="name(.)=''"/>
-        <xsl:when test=".='http://www.w3.org/XML/1998/namespace'"/>
-        <xsl:otherwise>
-          <ns name="{name(.)}" value="{.}"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-    <xsl:apply-templates mode="ns"/>
-  </xsl:template>
-  <xsl:template name="nsList">
-    <xsl:variable name="ns">
-      <all>
-        <names>
-          <xsl:apply-templates select="." mode="ns"/>
-        </names>
-        <text>
-          <xsl:copy-of select="."/>
-        </text>
-      </all>
-    </xsl:variable>
-    <xsl:for-each select="$ns/all/names">
-      <xsl:for-each-group select="ns" group-by="@name">
-        <xsl:if test="key('NSUsed',@value)">
-          <xsl:call-template name="verbatim-lineBreak">
-            <xsl:with-param name="id">22</xsl:with-param>
-          </xsl:call-template>
-          <xsl:text>&#160;&#160;&#160;</xsl:text>
-          <xsl:text>xmlns:</xsl:text>
-          <xsl:value-of select="@name"/>
-          <xsl:text>="</xsl:text>
-          <xsl:value-of select="@value"/>
-          <xsl:text>"</xsl:text>
-        </xsl:if>
-      </xsl:for-each-group>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:function name="tei:getPrefix" as="xs:string*">
-    <xsl:param name="ns"/>
-    <xsl:param name="here"/>
-    <xsl:for-each select="in-scope-prefixes($here)">
-      <xsl:choose>
-        <xsl:when test=".=''"/>
-        <xsl:when test="$ns=namespace-uri-for-prefix(.,$here)">
-          <xsl:value-of select="."/>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: verbatim.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:strip-space
+		elements="teix:* rng:* xsl:* xhtml:* atom:* m:*" />
+	<xsl:param name="useNSPrefixes">
+		true
+	</xsl:param>
+	<xsl:param name="startComment">
+		&lt;span class="comment"&gt;
+	</xsl:param>
+	<xsl:param name="endComment">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startElement">
+		&lt;span class="element"&gt;
+	</xsl:param>
+	<xsl:param name="endElement">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startElementName">
+		&lt;span class="elementname"&gt;
+	</xsl:param>
+	<xsl:param name="endElementName">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="highlightStartElementName">
+		&lt;span class="highlightelementname"&gt;
+	</xsl:param>
+	<xsl:param name="highlightEndElementName">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startAttribute">
+		&lt;span class="attribute"&gt;
+	</xsl:param>
+	<xsl:param name="endAttribute">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startAttributeValue">
+		&lt;span class="attributevalue"&gt;
+	</xsl:param>
+	<xsl:param name="endAttributeValue">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startNamespace">
+		&lt;span class="namespace"&gt;
+	</xsl:param>
+	<xsl:param name="endNamespace">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="spaceCharacter">
+		&#160;
+	</xsl:param>
+	<xsl:param name="showNamespaceDecls">
+		true
+	</xsl:param>
+	<xsl:param name="forceWrap">
+		false
+	</xsl:param>
+	<xsl:param name="wrapLength">
+		65
+	</xsl:param>
+	<xsl:param name="attLength">
+		40
+	</xsl:param>
+	<xsl:param name="attsOnSameLine">
+		3
+	</xsl:param>
+	<xsl:param name="omitNSDecls">
+		http://www.tei-c.org/ns/1.0
+	</xsl:param>
+	<xsl:key name="NSUsed" match="*" use="namespace-uri()" />
+	<xsl:key name="NSUsed" match="@*" use="namespace-uri()" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Work out a namespace prefix for verbatim elements</p>
+			<p>[common] </p>
+		</desc>
+	</doc>
+	<xsl:template name="verbatim-getNamespacePrefix">
+		<xsl:variable name="ns" select="namespace-uri()" />
+		<xsl:variable name="prefix"
+			select="tei:getPrefix($ns,ancestor-or-self::*[1])[1]" />
+		<xsl:choose>
+			<xsl:when test="$prefix !=''">
+				<xsl:value-of select="$prefix" />
+			</xsl:when>
+			<xsl:when test="$ns='http://docbook.org/ns/docbook'">
+				dbk
+			</xsl:when>
+			<xsl:when test="$ns='http://earth.google.com/kml/2.1'">
+				kml
+			</xsl:when>
+			<xsl:when
+				test="$ns='http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0'">
+				nvdl
+			</xsl:when>
+			<xsl:when
+				test="$ns='http://purl.org/rss/1.0/modules/event/'">
+				ev
+			</xsl:when>
+			<xsl:when test="$ns='http://purl.oclc.org/dsdl/schematron'">
+				s
+			</xsl:when>
+			<xsl:when
+				test="$ns='http://relaxng.org/ns/compatibility/annotations/1.0'">
+				a
+			</xsl:when>
+			<xsl:when test="$ns='http://relaxng.org/ns/structure/1.0'">
+				rng
+			</xsl:when>
+			<xsl:when test="$ns='http://www.ascc.net/xml/schematron'">
+				sch
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/1998/Math/MathML'">
+				m
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/1999/XSL/Transform'">
+				xsl
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/1999/xhtml'">
+				xhtml
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/1999/xlink'">
+				xlink
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/2001/XMLSchema'">
+				xsd
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/2005/11/its'">
+				its
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/2005/Atom'">
+				atom
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/XML/1998/namespace'">
+				xml
+			</xsl:when>
+			<xsl:when
+				test="$ns='http://www.tei-c.org/ns/geneticEditions'">
+				ge
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-newLine" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Make newline</p>
+			<p>[common] </p>
+			<param name="id">identifier for debugging only</param>
+		</desc>
+	</doc>
+	<xsl:template name="verbatim-lineBreak">
+		<xsl:param name="id" />
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process comments in verbatim mode</p>
+			<p>[common] </p>
+		</desc>
+	</doc>
+	<xsl:template match="comment()" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="ancestor::Wrapper" />
+			<xsl:when test="ancestor::xhtml:Wrapper" />
+			<xsl:otherwise>
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						21
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startComment" />
+				<xsl:text>&lt;!--</xsl:text>
+				<xsl:choose>
+					<xsl:when test="$forceWrap='true'">
+						<xsl:call-template name="verbatim-reformatText">
+							<xsl:with-param name="sofar">
+								0
+							</xsl:with-param>
+							<xsl:with-param name="indent">
+								<xsl:text> </xsl:text>
+							</xsl:with-param>
+							<xsl:with-param name="text">
+								<xsl:value-of select="normalize-space(.)" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:text>--&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endComment" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process text nodes in verbatim mode</p>
+			<p>[common] </p>
+		</desc>
+	</doc>
+	<xsl:template match="text()" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="$forceWrap='true'">
+				<xsl:variable name="indent">
+					<xsl:for-each select="parent::*">
+						<xsl:call-template name="verbatim-makeIndent" />
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:if
+					test="string-length(.)&gt;$wrapLength or parent::sch:assert">
+					<xsl:text>&#10;</xsl:text>
+					<xsl:value-of select="$indent" />
+				</xsl:if>
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="sofar">
+						0
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of select="normalize-space(.)" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if
+					test="string-length(.)&gt;$wrapLength or parent::sch:assert">
+					<xsl:text>&#10;</xsl:text>
+					<xsl:value-of select="$indent" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:when
+				test="not(preceding-sibling::node() or         contains(.,'&#10;'))">
+				<xsl:if test="starts-with(.,' ')">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="normalize-space(.)" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if test="substring(.,string-length(.),1)=' '">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="normalize-space(.)=''">
+				<xsl:for-each select="following-sibling::*[1]">
+					<xsl:call-template name="verbatim-lineBreak">
+						<xsl:with-param name="id">
+							7
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:call-template name="verbatim-makeIndent" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="verbatim-wraptext">
+					<xsl:with-param name="count">
+						0
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:for-each select="parent::*">
+							<xsl:call-template name="verbatim-makeIndent" />
+						</xsl:for-each>
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:choose>
+							<xsl:when
+								test="starts-with(.,'&#10;') and not          (preceding-sibling::node())">
+								<xsl:value-of
+									select="translate(substring(.,2),'&#10;','⌤')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="translate(.,'&#10;','⌤')" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+				</xsl:call-template>
+				<!-- <xsl:if test="substring(.,string-length(.))=' '"> <xsl:text> </xsl:text> 
+					</xsl:if> -->
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-reformatText">
+		<xsl:param name="indent" />
+		<xsl:param name="text" />
+		<xsl:param name="sofar" />
+		<xsl:choose>
+			<xsl:when test="number($sofar) &gt; $wrapLength">
+				<xsl:text>&#10;</xsl:text>
+				<xsl:value-of select="$indent" />
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="text">
+						<xsl:value-of select="$text" />
+					</xsl:with-param>
+					<xsl:with-param name="sofar">
+						<xsl:text>0</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not(contains($text,' '))">
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="$text" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="chunk">
+					<xsl:value-of select="substring-before($text,' ')" />
+				</xsl:variable>
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="$chunk" />
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="text">
+						<xsl:value-of select="substring-after($text,' ')" />
+					</xsl:with-param>
+					<xsl:with-param name="sofar">
+						<xsl:value-of
+							select="$sofar + string-length($chunk) + 1" />
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-wraptext">
+		<xsl:param name="indent" />
+		<xsl:param name="text" />
+		<xsl:param name="count">
+			0
+		</xsl:param>
+		<xsl:variable name="finalSpace">
+			<xsl:choose>
+				<xsl:when
+					test="substring($text,string-length($text),1)=' '">
+					<xsl:text> </xsl:text>
+				</xsl:when>
+				<xsl:when
+					test="substring($text,string-length($text),1)='⌤'">
+					<xsl:text> </xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<!-- <xsl:message>my text is [<xsl:value-of select="$text"/>]</xsl:message> 
+			<xsl:message>my space is [<xsl:value-of select="$finalSpace"/>]</xsl:message> -->
+		<xsl:choose>
+			<xsl:when test="normalize-space($text)=''" />
+			<xsl:when test="contains($text,'⌤')">
+				<xsl:if test="$count &gt; 0">
+					<xsl:value-of select="$indent" />
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:if test="starts-with($text,' ')">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of
+							select="normalize-space(substring-before($text,'⌤'))" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<!-- <xsl:if test="not(substring-after($text,'&#10;')='')"> -->
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						6
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of select="$indent" />
+				<xsl:call-template name="verbatim-wraptext">
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of
+							select="normalize-space(substring-after($text,'⌤'))" />
+						<xsl:value-of select="$finalSpace" />
+					</xsl:with-param>
+					<xsl:with-param name="count">
+						<xsl:value-of select="$count + 1" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="starts-with($text,' ')">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:if test="$count &gt; 0 and parent::*">
+					<xsl:value-of select="$indent" />
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="normalize-space($text)" />
+						<xsl:value-of select="$finalSpace" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process text and process ampersands</p>
+			<p>[common] </p>
+		</desc>
+	</doc>
+	<xsl:template name="verbatim-Text">
+		<xsl:param name="words" />
+		<xsl:analyze-string select="$words"
+			regex="(&amp;)(.)">
+			<xsl:matching-substring>
+				<xsl:choose>
+					<xsl:when test="starts-with(regex-group(2),'#')">
+						<xsl:text>&amp;</xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>&amp;amp;</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:value-of select="." />
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process default elements in verbatim mode</p>
+			<p>[common] </p>
+		</desc>
+	</doc>
+	<xsl:template match="*" mode="verbatim">
+		<xsl:param name="highlight" />
+		<xsl:choose>
+			<xsl:when test="parent::xhtml:Wrapper" />
+			<!-- <xsl:when test="child::node()[last()]/self::text()[not(.='')] and 
+				child::node()[1]/self::text()[not(.='')]"/> -->
+			<xsl:when test="not(parent::*)  or parent::teix:egXML">
+				<xsl:choose>
+					<xsl:when
+						test="preceding-sibling::node()[1][self::text()]      and following-sibling::node()[1][self::text()]" />
+					<xsl:when test="preceding-sibling::*">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								-1
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="verbatim-newLine" />
+						<!-- <xsl:call-template name="makeIndent"/> -->
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="not(preceding-sibling::node())">
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						-2
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="verbatim-makeIndent" />
+			</xsl:when>
+			<xsl:when test="preceding-sibling::node()[1]/self::*">
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						1
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="verbatim-makeIndent" />
+			</xsl:when>
+			<xsl:when test="preceding-sibling::node()[1]/self::text()">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						9
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="verbatim-makeIndent" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:value-of disable-output-escaping="yes"
+			select="$startElement" />
+		<xsl:text>&lt;</xsl:text>
+		<xsl:call-template name="verbatim-makeElementName">
+			<xsl:with-param name="start">
+				true
+			</xsl:with-param>
+			<xsl:with-param name="highlight">
+				<xsl:value-of select="$highlight" />
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:apply-templates select="@*" mode="verbatim" />
+		<xsl:if
+			test="$showNamespaceDecls='true' or parent::teix:egXML[@rend='full']">
+			<xsl:choose>
+				<xsl:when test="not(parent::*)">
+					<xsl:call-template name="nsList" />
+				</xsl:when>
+				<xsl:when
+					test="parent::teix:egXML and not(preceding-sibling::*)">
+					<xsl:call-template name="nsList" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="child::node()">
+				<xsl:text>&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+				<xsl:apply-templates mode="verbatim">
+					<xsl:with-param name="highlight">
+						<xsl:value-of select="$highlight" />
+					</xsl:with-param>
+				</xsl:apply-templates>
+				<xsl:choose>
+					<xsl:when
+						test="child::node()[last()]/self::text() and child::node()[1]/self::text()" />
+					<xsl:when test="not(parent::*)  or parent::teix:egXML">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								23
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when
+						test="child::node()[last()]/self::text()[normalize-space(.)='']">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								3
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="verbatim-makeIndent" />
+					</xsl:when>
+					<xsl:when test="child::node()[last()]/self::comment()">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								4
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="verbatim-makeIndent" />
+					</xsl:when>
+					<xsl:when test="child::node()[last()]/self::*">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								5
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="verbatim-makeIndent" />
+					</xsl:when>
+				</xsl:choose>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElement" />
+				<xsl:text>&lt;/</xsl:text>
+				<xsl:call-template name="verbatim-makeElementName">
+					<xsl:with-param name="start">
+						false
+					</xsl:with-param>
+					<xsl:with-param name="highlight">
+						<xsl:value-of select="$highlight" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>/&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-createElement">
+		<xsl:param name="name" />
+		<xsl:param name="special" />
+		<xsl:choose>
+			<xsl:when test="$special='true'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$highlightStartElementName" />
+				<xsl:value-of select="$name" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$highlightEndElementName" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$name" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-createAttribute">
+		<xsl:param name="name" />
+		<xsl:value-of select="$name" />
+	</xsl:template>
+	<xsl:template name="verbatim-makeElementName">
+		<xsl:param name="start" />
+		<xsl:param name="highlight" />
+		<!-- get namespace prefix -->
+		<xsl:variable name="ns-prefix">
+			<xsl:call-template
+				name="verbatim-getNamespacePrefix" />
+		</xsl:variable>
+		<xsl:variable name="highlightMe">
+			<xsl:choose>
+				<xsl:when test="$highlight=local-name()">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="namespace-uri()='http://www.tei-c.org/ns/Examples'">
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name" select="local-name(.)" />
+					<xsl:with-param name="special">
+						<xsl:value-of select="$highlightMe" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="contains($omitNSDecls,namespace-uri())">
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name" select="local-name(.)" />
+					<xsl:with-param name="special">
+						<xsl:value-of select="$highlightMe" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when
+				test="$useNSPrefixes='true' and string-length($ns-prefix) &gt; 0">
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name"
+						select="concat($ns-prefix,':',local-name(.))" />
+					<xsl:with-param name="special">
+						<xsl:value-of select="$highlightMe" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not(namespace-uri()='')">
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name" select="local-name(.)" />
+					<xsl:with-param name="special">
+						<xsl:value-of select="$highlightMe" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if
+					test="$start='true' and not(namespace-uri()=namespace-uri(..))">
+					<xsl:text> xmlns="</xsl:text>
+					<xsl:value-of select="namespace-uri()" />
+					<xsl:text>"</xsl:text>
+					<!-- <xsl:call-template name="verbatim-lineBreak"> <xsl:with-param name="id">5</xsl:with-param> 
+						</xsl:call-template> <xsl:call-template name="verbatim-makeIndent"/> -->
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name" select="local-name(.)" />
+					<xsl:with-param name="special">
+						<xsl:value-of select="$highlightMe" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-makeIndent">
+		<xsl:variable name="depth"
+			select="count(ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')])" />
+		<xsl:call-template name="verbatim-makeSpace">
+			<xsl:with-param name="d">
+				<xsl:value-of select="$depth" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="verbatim-makeSpace">
+		<xsl:param name="d" />
+		<xsl:if test="number($d)&gt;1">
+			<xsl:value-of select="$spaceCharacter" />
+			<xsl:call-template name="verbatim-makeSpace">
+				<xsl:with-param name="d">
+					<xsl:value-of select="$d -1" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="@*" mode="verbatim">
+		<xsl:variable name="L">
+			<xsl:for-each select="../@*">
+				<xsl:value-of select="." />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:if
+			test="count(../@*)&gt;$attsOnSameLine or      string-length($L)&gt;$attLength or     ancestor::tei:cell[not(@rend='wovenodd-col2')] or     namespace-uri()='http://www.w3.org/2005/11/its' or     string-length(.)+string-length(name(.)) &gt;     $attLength">
+			<xsl:call-template name="verbatim-lineBreak">
+				<xsl:with-param name="id">
+					5
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:call-template name="verbatim-makeIndent" />
+		</xsl:if>
+		<xsl:value-of select="$spaceCharacter" />
+		<xsl:variable name="ns-prefix">
+			<xsl:call-template
+				name="verbatim-getNamespacePrefix" />
+		</xsl:variable>
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="string-length($ns-prefix) &gt; 0">
+					<xsl:value-of select="$ns-prefix" />
+					<xsl:text>:</xsl:text>
+					<xsl:value-of select="local-name(.)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name(.)" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:call-template name="verbatim-createAttribute">
+			<xsl:with-param name="name" select="$name" />
+		</xsl:call-template>
+		<xsl:text>="</xsl:text>
+		<xsl:value-of disable-output-escaping="yes"
+			select="$startAttributeValue" />
+		<xsl:apply-templates select="."
+			mode="attributetext" />
+		<xsl:value-of disable-output-escaping="yes"
+			select="$endAttributeValue" />
+		<xsl:text>"</xsl:text>
+	</xsl:template>
+	<xsl:template match="@*" mode="attributetext">
+		<xsl:choose>
+			<xsl:when
+				test="string-length(.)&gt;$attLength and contains(.,' ')">
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="sofar">
+						0
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of select="normalize-space(.)" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template
+		match="text()|comment()|processing-instruction()" mode="ns" />
+	<xsl:template match="*" mode="ns">
+		<xsl:for-each select="namespace::*">
+			<xsl:variable name="ns" select="." />
+			<xsl:choose>
+				<xsl:when test=".='http://relaxng.org/ns/structure/1.0'" />
+				<xsl:when test=".='http://www.w3.org/2001/XInclude'" />
+				<xsl:when test=".='http://www.tei-c.org/ns/Examples'" />
+				<xsl:when test=".='http://www.ascc.net/xml/schematron'" />
+				<xsl:when
+					test=".='http://relaxng.org/ns/compatibility/annotations/1.0'" />
+				<xsl:when test="name(.)=''" />
+				<xsl:when test=".='http://www.w3.org/XML/1998/namespace'" />
+				<xsl:otherwise>
+					<ns name="{name(.)}" value="{.}" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+		<xsl:apply-templates mode="ns" />
+	</xsl:template>
+	<xsl:template name="nsList">
+		<xsl:variable name="ns">
+			<all>
+				<names>
+					<xsl:apply-templates select="." mode="ns" />
+				</names>
+				<text>
+					<xsl:copy-of select="." />
+				</text>
+			</all>
+		</xsl:variable>
+		<xsl:for-each select="$ns/all/names">
+			<xsl:for-each-group select="ns" group-by="@name">
+				<xsl:if test="key('NSUsed',@value)">
+					<xsl:call-template name="verbatim-lineBreak">
+						<xsl:with-param name="id">
+							22
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:text>&#160;&#160;&#160;</xsl:text>
+					<xsl:text>xmlns:</xsl:text>
+					<xsl:value-of select="@name" />
+					<xsl:text>="</xsl:text>
+					<xsl:value-of select="@value" />
+					<xsl:text>"</xsl:text>
+				</xsl:if>
+			</xsl:for-each-group>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:function name="tei:getPrefix" as="xs:string*">
+		<xsl:param name="ns" />
+		<xsl:param name="here" />
+		<xsl:for-each select="in-scope-prefixes($here)">
+			<xsl:choose>
+				<xsl:when test=".=''" />
+				<xsl:when test="$ns=namespace-uri-for-prefix(.,$here)">
+					<xsl:value-of select="." />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/linking.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/linking.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/linking.xsl	(revision 2397)
@@ -1,396 +1,428 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-		xmlns:xs="http://www.w3.org/2001/XMLSchema"                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei xs"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the linking module. </p>
-         <p>This software is dual-licensed:
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei xs" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the linking module. </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: linking.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element  in xref mode</desc>
-   </doc>
-  <xsl:template match="tei:TEI" mode="xref">
-      <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]"/>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements text in xref mode</desc>
-   </doc>
-  <xsl:template match="tei:text" mode="xref">
-   <xsl:choose>
-     <xsl:when test="tei:head">
-       <xsl:apply-templates select="tei:head" mode="plain"/>
-     </xsl:when>
-     <xsl:when test="tei:body/tei:head">
-       <xsl:apply-templates select="tei:body/tei:head" mode="plain"/>
-     </xsl:when>
-     <xsl:when test="tei:front//tei:titlePart/tei:title">
-       <xsl:apply-templates select="tei:front//tei:titlePart/tei:titl" mode="plain"/>
-     </xsl:when>
-     <xsl:otherwise>
-       <xsl:text>Text </xsl:text>
-       <xsl:number/>
-     </xsl:otherwise>
-   </xsl:choose>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: linking.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element in xref mode</desc>
+	</doc>
+	<xsl:template match="tei:TEI" mode="xref">
+		<xsl:apply-templates
+			select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]" />
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element anchor|tei:p in xref mode</desc>
-   </doc>
-  <xsl:template match="tei:anchor|tei:p" mode="xref">
-      <xsl:text>here</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element bibl</desc>
-   </doc>
-  <xsl:template match="tei:bibl" mode="xref">
-      <xsl:text>[</xsl:text>
-      <xsl:number/>
-      <xsl:text>]</xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements text in xref mode</desc>
+	</doc>
+	<xsl:template match="tei:text" mode="xref">
+		<xsl:choose>
+			<xsl:when test="tei:head">
+				<xsl:apply-templates select="tei:head"
+					mode="plain" />
+			</xsl:when>
+			<xsl:when test="tei:body/tei:head">
+				<xsl:apply-templates select="tei:body/tei:head"
+					mode="plain" />
+			</xsl:when>
+			<xsl:when test="tei:front//tei:titlePart/tei:title">
+				<xsl:apply-templates
+					select="tei:front//tei:titlePart/tei:titl" mode="plain" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>Text </xsl:text>
+				<xsl:number />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element s
-      tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6 in
-      xref mode<param name="minimal">whether to make a link with just numbers or with
-      text too</param>
-      </desc>
-   </doc>
-  <xsl:template match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
-                 mode="xref">
-      <xsl:param name="minimal">false</xsl:param>
-      <xsl:call-template name="header">
-         <xsl:with-param name="minimal" select="$minimal"/>
-         <xsl:with-param name="display">plain</xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element ptr in xref mode</desc>
-   </doc>
-  <xsl:template match="tei:ptr">
-      <xsl:call-template name="makeTEILink">
-         <xsl:with-param name="ptr" select="true()"/>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element ref</desc>
-   </doc>
-  <xsl:template match="tei:ref">
-      <xsl:call-template name="makeTEILink">
-         <xsl:with-param name="ptr" select="false()"/>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] Making a heading for something
-         <param name="minimal">whether to display headings</param>
-         <param name="toc">whether this is making a TOC entry</param>
-         <param name="display">detail of display (full, simple, plain), ie
-    whether markup is followed</param>
-      </desc>
-   </doc>
-  <xsl:template name="header">
-      <xsl:param name="minimal">false</xsl:param>
-      <xsl:param name="toc"/>
-      <xsl:param name="display">full</xsl:param>
-      <xsl:variable name="depth">
-         <xsl:apply-templates mode="depth" select="."/>
-      </xsl:variable>
-      <xsl:call-template name="formatHeadingNumber">
-         <xsl:with-param name="toc">
-	   <xsl:value-of select="$toc"/>
-         </xsl:with-param>
-         <xsl:with-param name="text">
-            <xsl:choose>
-               <xsl:when test="local-name(.) = 'TEI'"/>
-               <xsl:when test="$depth &gt; $numberHeadingsDepth"> </xsl:when>
-               <xsl:when test="self::tei:text">
-		 <xsl:number/>
-		 <xsl:call-template name="headingNumberSuffix"/>
-	       </xsl:when>
-               <xsl:when test="ancestor::tei:back">
-                  <xsl:if test="$numberBackHeadings='true'">
-                     <xsl:call-template name="i18n">
-                        <xsl:with-param name="word">appendixWords</xsl:with-param>
-                     </xsl:call-template>
-                     <xsl:text> </xsl:text>
-                     <xsl:call-template name="numberBackDiv"/>
-                     <xsl:if test="$minimal='false'">
-                        <xsl:value-of select="$numberSpacer"/>
-                     </xsl:if>
-                  </xsl:if>
-               </xsl:when>
-               <xsl:when test="ancestor::tei:front">
-                  <xsl:if test="$numberFrontHeadings='true'">
-                     <xsl:call-template name="numberFrontDiv">
-		       <xsl:with-param name="minimal">
-			 <xsl:value-of select="$minimal"/>
-		       </xsl:with-param>
-		     </xsl:call-template>
-                  </xsl:if>
-               </xsl:when>
-               <xsl:when test="$numberHeadings ='true'">
-                  <xsl:choose>
-                     <xsl:when test="$prenumberedHeadings='true'">
-                        <xsl:value-of select="@n"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:call-template name="numberBodyDiv"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-                  <xsl:if test="$minimal='false'">
-                     <xsl:call-template name="headingNumberSuffix"/>
-                  </xsl:if>
-               </xsl:when>
-            </xsl:choose>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:if test="$minimal='false'">
-         <xsl:choose>
-            <xsl:when test="local-name(.) = 'TEI'">
-               <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]"/>
-            </xsl:when>
-            <xsl:when test="not($toc='')">
-	      <xsl:call-template name="makeInternalLink">
-		<xsl:with-param name="dest">
-		  <xsl:value-of select="$toc"/>
-		</xsl:with-param>
-		<xsl:with-param name="class">
-		  <xsl:value-of select="$class_toc"/>
-		  <xsl:text> </xsl:text>
-		  <xsl:value-of select="concat($class_toc,'_',$depth)"/>
-		</xsl:with-param>
-		<xsl:with-param name="body">
-		  <xsl:choose>
-		    <xsl:when test="not(tei:head) and tei:body/tei:head">
-			<xsl:apply-templates mode="plain" select="tei:body/tei:head"/>
-		    </xsl:when>	
-		    <xsl:when test="not(tei:head) and tei:front//tei:titlePart/tei:title">
-			<xsl:apply-templates mode="plain" select="tei:front//tei:titlePart/tei:title"/>
-		    </xsl:when>	
-		    <xsl:when test="tei:head">
-			<xsl:apply-templates mode="plain" select="tei:head"/>
-		    </xsl:when>
-		    <xsl:when test="$autoHead='true'">
-		      <xsl:call-template name="autoMakeHead">
-			<xsl:with-param name="display" select="$display"/>
-		      </xsl:call-template>
-		    </xsl:when>
-		    <xsl:otherwise>
-		      <xsl:number/>
-		    </xsl:otherwise>
-		  </xsl:choose>
-		</xsl:with-param>
-	      </xsl:call-template>
-            </xsl:when>
-            <xsl:when test="$autoHead='true'">
-	      <xsl:choose>
-		<xsl:when test="($outputTarget='epub' or $outputTarget='epub3') and
-				not(tei:head)"/>
-		<xsl:otherwise>
-		  <xsl:call-template name="autoMakeHead">
-		    <xsl:with-param name="display" select="$display"/>
-		  </xsl:call-template>
-		</xsl:otherwise>
-	      </xsl:choose>
-            </xsl:when>
-            <xsl:when test="$display='plain'">
-               <xsl:for-each select="tei:head">
-		 <xsl:apply-templates mode="plain"/>
-	       </xsl:for-each>
-            </xsl:when>
-            <xsl:when test="$display='simple'">
-               <xsl:for-each select="tei:head">
-		 <xsl:apply-templates mode="plain"/>
-	       </xsl:for-each>
-            </xsl:when>
-	    <xsl:when test="self::tei:index">
-	      <xsl:value-of select="substring(tei:term,1,10)"/>
-	      <xsl:text>…</xsl:text>
-	    </xsl:when>
-	    <xsl:when test="not(tei:head)">
-	      <xsl:value-of select="substring(normalize-space(.),1,10)"/>
-	      <xsl:text>…</xsl:text>
-	    </xsl:when>
-            <xsl:otherwise>
-               <xsl:apply-templates select="tei:head" mode="makeheading"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element anchor|tei:p in xref mode</desc>
+	</doc>
+	<xsl:template match="tei:anchor|tei:p" mode="xref">
+		<xsl:text>here</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element bibl</desc>
+	</doc>
+	<xsl:template match="tei:bibl" mode="xref">
+		<xsl:text>[</xsl:text>
+		<xsl:number />
+		<xsl:text>]</xsl:text>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[common] processing the number portion of a heading</p>
-         <p>By default, the text is printed as is. You may
-    wish to colour it, align it, etc</p>
-         <param name="text"/>
-      </desc>
-   </doc>
-  <xsl:template name="formatHeadingNumber">
-      <xsl:param name="text"/>
-      <xsl:param name="toc"/>
-      <xsl:copy-of select="$text"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Process element s
+			tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6 in
+			xref mode
+			<param name="minimal">whether to make a link with just numbers or with
+				text too</param>
+		</desc>
+	</doc>
+	<xsl:template
+		match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
+		mode="xref">
+		<xsl:param name="minimal">
+			false
+		</xsl:param>
+		<xsl:call-template name="header">
+			<xsl:with-param name="minimal" select="$minimal" />
+			<xsl:with-param name="display">
+				plain
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element ptr in xref mode</desc>
+	</doc>
+	<xsl:template match="tei:ptr">
+		<xsl:call-template name="makeTEILink">
+			<xsl:with-param name="ptr" select="true()" />
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element ref</desc>
+	</doc>
+	<xsl:template match="tei:ref">
+		<xsl:call-template name="makeTEILink">
+			<xsl:with-param name="ptr" select="false()" />
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[common] Making a heading for something
+			<param name="minimal">whether to display headings</param>
+			<param name="toc">whether this is making a TOC entry</param>
+			<param name="display">detail of display (full, simple, plain), ie
+				whether markup is followed</param>
+		</desc>
+	</doc>
+	<xsl:template name="header">
+		<xsl:param name="minimal">
+			false
+		</xsl:param>
+		<xsl:param name="toc" />
+		<xsl:param name="display">
+			full
+		</xsl:param>
+		<xsl:variable name="depth">
+			<xsl:apply-templates mode="depth" select="." />
+		</xsl:variable>
+		<xsl:call-template name="formatHeadingNumber">
+			<xsl:with-param name="toc">
+				<xsl:value-of select="$toc" />
+			</xsl:with-param>
+			<xsl:with-param name="text">
+				<xsl:choose>
+					<xsl:when test="local-name(.) = 'TEI'" />
+					<xsl:when test="$depth &gt; $numberHeadingsDepth">
+					</xsl:when>
+					<xsl:when test="self::tei:text">
+						<xsl:number />
+						<xsl:call-template name="headingNumberSuffix" />
+					</xsl:when>
+					<xsl:when test="ancestor::tei:back">
+						<xsl:if test="$numberBackHeadings='true'">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									appendixWords
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:text> </xsl:text>
+							<xsl:call-template name="numberBackDiv" />
+							<xsl:if test="$minimal='false'">
+								<xsl:value-of select="$numberSpacer" />
+							</xsl:if>
+						</xsl:if>
+					</xsl:when>
+					<xsl:when test="ancestor::tei:front">
+						<xsl:if test="$numberFrontHeadings='true'">
+							<xsl:call-template name="numberFrontDiv">
+								<xsl:with-param name="minimal">
+									<xsl:value-of select="$minimal" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:if>
+					</xsl:when>
+					<xsl:when test="$numberHeadings ='true'">
+						<xsl:choose>
+							<xsl:when test="$prenumberedHeadings='true'">
+								<xsl:value-of select="@n" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template name="numberBodyDiv" />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:if test="$minimal='false'">
+							<xsl:call-template name="headingNumberSuffix" />
+						</xsl:if>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:if test="$minimal='false'">
+			<xsl:choose>
+				<xsl:when test="local-name(.) = 'TEI'">
+					<xsl:apply-templates
+						select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]" />
+				</xsl:when>
+				<xsl:when test="not($toc='')">
+					<xsl:call-template name="makeInternalLink">
+						<xsl:with-param name="dest">
+							<xsl:value-of select="$toc" />
+						</xsl:with-param>
+						<xsl:with-param name="class">
+							<xsl:value-of select="$class_toc" />
+							<xsl:text> </xsl:text>
+							<xsl:value-of select="concat($class_toc,'_',$depth)" />
+						</xsl:with-param>
+						<xsl:with-param name="body">
+							<xsl:choose>
+								<xsl:when test="not(tei:head) and tei:body/tei:head">
+									<xsl:apply-templates mode="plain"
+										select="tei:body/tei:head" />
+								</xsl:when>
+								<xsl:when
+									test="not(tei:head) and tei:front//tei:titlePart/tei:title">
+									<xsl:apply-templates mode="plain"
+										select="tei:front//tei:titlePart/tei:title" />
+								</xsl:when>
+								<xsl:when test="tei:head">
+									<xsl:apply-templates mode="plain"
+										select="tei:head" />
+								</xsl:when>
+								<xsl:when test="$autoHead='true'">
+									<xsl:call-template name="autoMakeHead">
+										<xsl:with-param name="display"
+											select="$display" />
+									</xsl:call-template>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:number />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:when test="$autoHead='true'">
+					<xsl:choose>
+						<xsl:when
+							test="($outputTarget='epub' or $outputTarget='epub3') and
+				not(tei:head)" />
+						<xsl:otherwise>
+							<xsl:call-template name="autoMakeHead">
+								<xsl:with-param name="display" select="$display" />
+							</xsl:call-template>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:when test="$display='plain'">
+					<xsl:for-each select="tei:head">
+						<xsl:apply-templates mode="plain" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="$display='simple'">
+					<xsl:for-each select="tei:head">
+						<xsl:apply-templates mode="plain" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="self::tei:index">
+					<xsl:value-of select="substring(tei:term,1,10)" />
+					<xsl:text>…</xsl:text>
+				</xsl:when>
+				<xsl:when test="not(tei:head)">
+					<xsl:value-of
+						select="substring(normalize-space(.),1,10)" />
+					<xsl:text>…</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="tei:head"
+						mode="makeheading" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[common] Making a heading for something, and making sure it has
-      contents</p>
-         <p>This is a wrapper around the "header" template which ensures that
-      some text is returned; if all else fails, the element name is
-    used.</p>
-         <param name="minimal">false</param>
-      </desc>
-   </doc>
-  <xsl:template name="headerLink">
-      <xsl:param name="minimal">false</xsl:param>
-      <xsl:variable name="Text">
-         <xsl:call-template name="header">
-            <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-	           <xsl:with-param name="display">plain</xsl:with-param>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$Text=''">
-	   <!--
-	       <xsl:text>&lt;</xsl:text>
-	       <xsl:value-of select="local-name(.)"/>
-	       <xsl:text>&gt;</xsl:text>
-	   -->
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:copy-of select="$Text"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>[common] Make a hypertext link</p>
-         <p>cross-referencing </p>
-         <param name="ptr">ptr</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeTEILink">
-      <xsl:param name="ptr" as="xs:boolean" select="false()"/>
-      <!-- is this a ptr or a ref? -->
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[common] processing the number portion of a heading</p>
+			<p>By default, the text is printed as is. You may
+				wish to colour it, align it, etc</p>
+			<param name="text" />
+		</desc>
+	</doc>
+	<xsl:template name="formatHeadingNumber">
+		<xsl:param name="text" />
+		<xsl:param name="toc" />
+		<xsl:copy-of select="$text" />
+	</xsl:template>
 
-    <xsl:choose>
-      <!-- If there is a target attribute starting with #, it is always a local reference -->
-      <xsl:when test="@target and starts-with(@target,'#')">
-            <xsl:call-template name="makeInternalLink">
-               <xsl:with-param name="target" select="substring(@target,2)"/>
-               <xsl:with-param name="ptr" select="$ptr"/>
-               <xsl:with-param name="dest">
-                  <xsl:call-template name="generateEndLink">
-                     <xsl:with-param name="where">
-                        <xsl:value-of select="substring(@target,2)"/>
-                     </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <!-- if we are doing TEI P4, all targets are local -->
-      <xsl:when test="@target and $teiP4Compat='true'">
-            <xsl:call-template name="makeInternalLink">
-               <xsl:with-param name="target" select="@target"/>
-               <xsl:with-param name="ptr" select="$ptr"/>
-               <xsl:with-param name="dest">
-                  <xsl:call-template name="generateEndLink">
-                     <xsl:with-param name="where">
-                        <xsl:value-of select="@target"/>
-                     </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <!-- other uses of target means it is external -->
-      <xsl:when test="@target">
-            <xsl:call-template name="makeExternalLink">
-               <xsl:with-param name="ptr" select="$ptr"/>
-               <xsl:with-param name="dest">
-                  <xsl:value-of select="@target"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <!-- If there is a url attribute starting with #, it is a local
-       reference -->
-      <xsl:when test="@url and starts-with(@url,'#')">
-            <xsl:call-template name="makeInternalLink">
-               <xsl:with-param name="target" select="substring(@url,2)"/>
-               <xsl:with-param name="ptr" select="$ptr"/>
-               <xsl:with-param name="dest">
-                  <xsl:call-template name="generateEndLink">
-                     <xsl:with-param name="where">
-                        <xsl:value-of select="substring(@url,2)"/>
-                     </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <!-- otherwise it is an external URL -->
-      <xsl:when test="@url">
-            <xsl:call-template name="makeExternalLink">
-               <xsl:with-param name="ptr" select="$ptr"/>
-               <xsl:with-param name="dest">
-                  <xsl:value-of select="@url"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <!-- A doc attribute means an external reference -->
-      <xsl:when test="@doc">
-            <xsl:call-template name="makeExternalLink">
-               <xsl:with-param name="ptr" select="$ptr"/>
-               <xsl:with-param name="dest">
-                  <xsl:value-of select="unparsed-entity-uri(@doc)"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-        <!--
-      <xsl:for-each select="@*">
-	[[markup error: <xsl:value-of select="name(.)"/>=<xsl:value-of select="."/>]]
-      </xsl:for-each>
--->
-        <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[common] Making a heading for something, and making sure it has
+				contents</p>
+			<p>This is a wrapper around the "header" template which ensures that
+				some text is returned; if all else fails, the element name is
+				used.</p>
+			<param name="minimal">false</param>
+		</desc>
+	</doc>
+	<xsl:template name="headerLink">
+		<xsl:param name="minimal">
+			false
+		</xsl:param>
+		<xsl:variable name="Text">
+			<xsl:call-template name="header">
+				<xsl:with-param name="minimal"
+					select="$minimalCrossRef" />
+				<xsl:with-param name="display">
+					plain
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$Text=''">
+				<!-- <xsl:text>&lt;</xsl:text> <xsl:value-of select="local-name(.)"/> 
+					<xsl:text>&gt;</xsl:text> -->
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="$Text" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>[common] Make a hypertext link</p>
+			<p>cross-referencing </p>
+			<param name="ptr">ptr</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeTEILink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<!-- is this a ptr or a ref? -->
+
+		<xsl:choose>
+			<!-- If there is a target attribute starting with #, it is always a local 
+				reference -->
+			<xsl:when test="@target and starts-with(@target,'#')">
+				<xsl:call-template name="makeInternalLink">
+					<xsl:with-param name="target"
+						select="substring(@target,2)" />
+					<xsl:with-param name="ptr" select="$ptr" />
+					<xsl:with-param name="dest">
+						<xsl:call-template name="generateEndLink">
+							<xsl:with-param name="where">
+								<xsl:value-of select="substring(@target,2)" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<!-- if we are doing TEI P4, all targets are local -->
+			<xsl:when test="@target and $teiP4Compat='true'">
+				<xsl:call-template name="makeInternalLink">
+					<xsl:with-param name="target" select="@target" />
+					<xsl:with-param name="ptr" select="$ptr" />
+					<xsl:with-param name="dest">
+						<xsl:call-template name="generateEndLink">
+							<xsl:with-param name="where">
+								<xsl:value-of select="@target" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<!-- other uses of target means it is external -->
+			<xsl:when test="@target">
+				<xsl:call-template name="makeExternalLink">
+					<xsl:with-param name="ptr" select="$ptr" />
+					<xsl:with-param name="dest">
+						<xsl:value-of select="@target" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<!-- If there is a url attribute starting with #, it is a local reference -->
+			<xsl:when test="@url and starts-with(@url,'#')">
+				<xsl:call-template name="makeInternalLink">
+					<xsl:with-param name="target"
+						select="substring(@url,2)" />
+					<xsl:with-param name="ptr" select="$ptr" />
+					<xsl:with-param name="dest">
+						<xsl:call-template name="generateEndLink">
+							<xsl:with-param name="where">
+								<xsl:value-of select="substring(@url,2)" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<!-- otherwise it is an external URL -->
+			<xsl:when test="@url">
+				<xsl:call-template name="makeExternalLink">
+					<xsl:with-param name="ptr" select="$ptr" />
+					<xsl:with-param name="dest">
+						<xsl:value-of select="@url" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<!-- A doc attribute means an external reference -->
+			<xsl:when test="@doc">
+				<xsl:call-template name="makeExternalLink">
+					<xsl:with-param name="ptr" select="$ptr" />
+					<xsl:with-param name="dest">
+						<xsl:value-of select="unparsed-entity-uri(@doc)" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- <xsl:for-each select="@*"> [[markup error: <xsl:value-of select="name(.)"/>=<xsl:value-of 
+					select="."/>]] </xsl:for-each> -->
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/i18n.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/i18n.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/i18n.xsl	(revision 2397)
@@ -1,163 +1,196 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-    xmlns:fo="http://www.w3.org/1999/XSL/Format" 
-    xmlns:html="http://www.w3.org/1999/xhtml" 
-    xmlns:i="http://www.iso.org/ns/1.0"
-    xmlns:rng="http://relaxng.org/ns/structure/1.0"
-    xmlns:s="http://www.ascc.net/xml/schematron" 
-    xmlns:sch="http://purl.oclc.org/dsdl/schematron" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:teix="http://www.tei-c.org/ns/Examples" 
-    xmlns:xi="http://www.w3.org/2001/XInclude"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl" 
-    version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet definitions common for all of HTML, FO and LaTeX
-      outputs </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:i="http://www.iso.org/ns/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl"
+	version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet definitions common for all of HTML, FO and LaTeX
+				outputs
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: i18n.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:key match="entry" name="KEYS" use="key"/>
-  <xsl:param name="documentationLanguage">en</xsl:param>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:variable name="i18n"
-		select="document('../i18n.xml',document(''))"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: i18n.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:key match="entry" name="KEYS" use="key" />
+	<xsl:param name="documentationLanguage">
+		en
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] give language-specific version of a word or phrase<param name="word">the word(s) to translate</param>
-      </desc>
-   </doc>
-  <xsl:template name="i18n">
-      <xsl:param name="word"/>
-      <xsl:variable name="Word">
-         <xsl:value-of select="normalize-space($word)"/>
-      </xsl:variable>
-      <xsl:variable name="local">
-         <xsl:call-template name="myi18n">
-	           <xsl:with-param name="word">
-	              <xsl:value-of select="$word"/>
-	           </xsl:with-param>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="string-length($local)&gt;0">
-            <xsl:value-of select="$local"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:for-each select="$i18n">
-	      <xsl:choose>
-		<xsl:when test="key('KEYS',$Word)/text[@xml:lang=$documentationLanguage]">
-		  <xsl:value-of select="key('KEYS',$Word)/text[@xml:lang=$documentationLanguage]"/>
-		</xsl:when>
-		<xsl:when test="key('KEYS',$Word)/text[@lang3=$documentationLanguage]">
-		  <xsl:value-of select="key('KEYS',$Word)/text[lang3=$documentationLanguage]"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <!--
-		      <xsl:if test="$verbose='true'">
-		      <xsl:message>NO TRANSLATION for <xsl:value-of 
-		      select="$word"/> in <xsl:value-of select="$documentationLanguage"/></xsl:message>
-		      </xsl:if>
-		  -->
-		  <xsl:value-of select="key('KEYS',$Word)/text[@xml:lang='en']"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-            </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<xsl:variable name="i18n"
+		select="document('../i18n.xml',document(''))" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[localisation] dummy template for overriding in a local system<param name="word">the word(s) to translate</param>
-      </desc>
-   </doc>
-  <xsl:template name="myi18n">
-	     <xsl:param name="word"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[common] give language-specific version of a word or phrase
+			<param name="word">the word(s) to translate</param>
+		</desc>
+	</doc>
+	<xsl:template name="i18n">
+		<xsl:param name="word" />
+		<xsl:variable name="Word">
+			<xsl:value-of select="normalize-space($word)" />
+		</xsl:variable>
+		<xsl:variable name="local">
+			<xsl:call-template name="myi18n">
+				<xsl:with-param name="word">
+					<xsl:value-of select="$word" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="string-length($local)&gt;0">
+				<xsl:value-of select="$local" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="$i18n">
+					<xsl:choose>
+						<xsl:when
+							test="key('KEYS',$Word)/text[@xml:lang=$documentationLanguage]">
+							<xsl:value-of
+								select="key('KEYS',$Word)/text[@xml:lang=$documentationLanguage]" />
+						</xsl:when>
+						<xsl:when
+							test="key('KEYS',$Word)/text[@lang3=$documentationLanguage]">
+							<xsl:value-of
+								select="key('KEYS',$Word)/text[lang3=$documentationLanguage]" />
+						</xsl:when>
+						<xsl:otherwise>
+							<!-- <xsl:if test="$verbose='true'"> <xsl:message>NO TRANSLATION for 
+								<xsl:value-of select="$word"/> in <xsl:value-of select="$documentationLanguage"/></xsl:message> 
+								</xsl:if> -->
+							<xsl:value-of
+								select="key('KEYS',$Word)/text[@xml:lang='en']" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="localisation" type="string">
-      <desc> The language to use when
-    generating text (use ISO 2-letter codes)</desc>
-   </doc>
-  <xsl:param name="lang">en</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="localisation">
-      <desc>[common] Prefix text before an auto-generated table of contents </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="localisation" type="string">
-      <desc> The language the text is in
-    (use ISO 2-letter codes)</desc>
-   </doc>
-  <xsl:param name="doclang">en</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="localisation">
-      <desc>[common] Prefix text before an auto-generated table of contents </desc>
-   </doc>
-  <xsl:template name="contentsHeading">
-      <xsl:call-template name="i18n">
-         <xsl:with-param name="word">contentsHeading</xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="localisation">
-      <desc>[common] Title for "Contents"; by default uses language-specific
-      lookup table.</desc>
-   </doc>
-  <xsl:template name="contentsWord">
-      <xsl:call-template name="i18n">
-         <xsl:with-param name="word">contentsWord</xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="localisation">
-      <desc>[common] Title for "Feedback"</desc>
-   </doc>
-  <xsl:template name="feedbackWords">
-      <xsl:call-template name="i18n">
-         <xsl:with-param name="word">feedbackWords</xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="localisation">
-      <desc>[common] Title for "Search"; by default uses language-specific
-      lookup table. </desc>
-   </doc>
-  <xsl:template name="searchWords">
-      <xsl:call-template name="i18n">
-         <xsl:with-param name="word">searchWords</xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[localisation] dummy template for overriding in a local system
+			<param name="word">the word(s) to translate</param>
+		</desc>
+	</doc>
+	<xsl:template name="myi18n">
+		<xsl:param name="word" />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="localisation" type="string">
+		<desc> The language to use when
+			generating text (use ISO 2-letter codes)</desc>
+	</doc>
+	<xsl:param name="lang">
+		en
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="localisation">
+		<desc>[common] Prefix text before an auto-generated table of contents </desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="localisation" type="string">
+		<desc> The language the text is in
+			(use ISO 2-letter codes)</desc>
+	</doc>
+	<xsl:param name="doclang">
+		en
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="localisation">
+		<desc>[common] Prefix text before an auto-generated table of contents </desc>
+	</doc>
+	<xsl:template name="contentsHeading">
+		<xsl:call-template name="i18n">
+			<xsl:with-param name="word">
+				contentsHeading
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="localisation">
+		<desc>[common] Title for "Contents"; by default uses language-specific
+			lookup table.</desc>
+	</doc>
+	<xsl:template name="contentsWord">
+		<xsl:call-template name="i18n">
+			<xsl:with-param name="word">
+				contentsWord
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="localisation">
+		<desc>[common] Title for "Feedback"</desc>
+	</doc>
+	<xsl:template name="feedbackWords">
+		<xsl:call-template name="i18n">
+			<xsl:with-param name="word">
+				feedbackWords
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="localisation">
+		<desc>[common] Title for "Search"; by default uses language-specific
+			lookup table.
+		</desc>
+	</doc>
+	<xsl:template name="searchWords">
+		<xsl:call-template name="i18n">
+			<xsl:with-param name="word">
+				searchWords
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tei-param.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tei-param.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tei-param.xsl	(revision 2397)
@@ -1,332 +1,473 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="m tei xsi sch" version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p>TEI stylesheet customization module, common for all output
-      formats.</p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="m tei xsi sch" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>TEI stylesheet customization module, common for all output
+				formats.</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: tei-param.xsl 10010 2012-01-03 19:35:49Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>Type of output being generated</desc>
-   </doc>
-  <xsl:param name="outputTarget">html</xsl:param>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-param.xsl 10010 2012-01-03 19:35:49Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS" type="string">
-    <desc>CSS class for TOC entries</desc>
-  </doc>
-  <xsl:param name="class_toc">toc</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="string">
-    <desc>Directory specification to put before names of graphics files,
-      unless they start with "./"</desc>
-  </doc>
-  <xsl:param name="graphicsPrefix"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="string">
-    <desc> Default file suffix for graphics files,
-    if not directly specified</desc>
-  </doc>
-  <xsl:param name="graphicsSuffix">.png</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures" type="decimal">
-    <desc> Scaling of imported graphics</desc>
-  </doc>
-  <xsl:param name="standardScale">1</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>Type of output being generated</desc>
+	</doc>
+	<xsl:param name="outputTarget">
+		html
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="headings" type="boolean">
-    <desc> Construct a heading 
-    for &lt;div&gt; elements with no &lt;head&gt;</desc>
-  </doc>
-  <xsl:param name="autoHead"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="CSS"
+		type="string">
+		<desc>CSS class for TOC entries</desc>
+	</doc>
+	<xsl:param name="class_toc">
+		toc
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="string">
+		<desc>Directory specification to put before names of graphics files,
+			unless they start with "./"</desc>
+	</doc>
+	<xsl:param name="graphicsPrefix" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="string">
+		<desc> Default file suffix for graphics files,
+			if not directly specified</desc>
+	</doc>
+	<xsl:param name="graphicsSuffix">
+		.png
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="figures"
+		type="decimal">
+		<desc> Scaling of imported graphics</desc>
+	</doc>
+	<xsl:param name="standardScale">
+		1
+	</xsl:param>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="headings"
+		type="boolean">
+		<desc> Construct a heading
+			for &lt;div&gt; elements with no &lt;head&gt;</desc>
+	</doc>
+	<xsl:param name="autoHead" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="headings">
-    <desc>[common] How to make a heading for section if there is no
-      &lt;head&gt;</desc>
-  </doc>
-  <xsl:template name="autoMakeHead">
-    <xsl:param name="display"/>
-    <xsl:choose>
-      <xsl:when test="tei:head and $display='full'">
-        <xsl:apply-templates select="tei:head" mode="makeheading"/>
-      </xsl:when>
-      <xsl:when test="tei:head">
-        <xsl:apply-templates select="tei:head" mode="plain"/>
-      </xsl:when>
-      <xsl:when test="tei:front/tei:head">
-        <xsl:apply-templates select="tei:front/tei:head" mode="plain"/>
-      </xsl:when>
-      <xsl:when test="@n">
-	<xsl:value-of select="@n"/>
-      </xsl:when>
-      <xsl:when test="@type">
-	<xsl:text>[</xsl:text>
-        <xsl:value-of select="@type"/>
-	<xsl:text>]</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>➤</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="headings" type="string">
-    <desc> Punctuation to insert after a section
-    number</desc>
-  </doc>
-  <xsl:template name="headingNumberSuffix">
-    <xsl:text>.</xsl:text>
-    <xsl:value-of select="$numberSpacer"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="headings" type="string">
-    <desc> Character to put after number of
-    section header</desc>
-  </doc>
-  <xsl:param name="numberSpacer">
-    <xsl:text> </xsl:text>
-  </xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="string">
-    <desc> Name of department within institution</desc>
-  </doc>
-  <xsl:param name="department"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="string">
-    <desc> Name of link to home page of application</desc>
-  </doc>
-  <xsl:param name="homeLabel">Home</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="anyURI">
-    <desc>Project Home</desc>
-  </doc>
-  <xsl:param name="homeURL">http://www.tei-c.org/</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="string">
-    <desc>Project</desc>
-  </doc>
-  <xsl:param name="homeWords">TEI</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="string">
-    <desc> Institution</desc>
-  </doc>
-  <xsl:param name="institution">A TEI Project</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="anyURI">
-    <desc> Institution link</desc>
-  </doc>
-  <xsl:param name="parentURL">http://www.tei-c.org/</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="string">
-    <desc> Name of overall institution</desc>
-  </doc>
-  <xsl:param name="parentWords">Parent Institution</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links" type="anyURI">
-    <desc> Link to search application</desc>
-  </doc>
-  <xsl:param name="searchURL">http://www.google.com</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc" type="anyURI">
-    <desc> The home page for these stylesheets</desc>
-  </doc>
-  <xsl:param name="teixslHome">http://www.tei-c.org/Stylesheets/</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc" type="boolean">
-    <desc> Process elements according to assumptions
-    of TEI P4</desc>
-  </doc>
-  <xsl:param name="teiP4Compat">false</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc" type="boolean">
-    <desc> Title, author and date is taken from the
-    &lt;teiHeader&gt; rather than looked for in the front matter</desc>
-  </doc>
-  <xsl:param name="useHeaderFrontMatter">false</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="headings">
+		<desc>[common] How to make a heading for section if there is no
+			&lt;head&gt;</desc>
+	</doc>
+	<xsl:template name="autoMakeHead">
+		<xsl:param name="display" />
+		<xsl:choose>
+			<xsl:when test="tei:head and $display='full'">
+				<xsl:apply-templates select="tei:head"
+					mode="makeheading" />
+			</xsl:when>
+			<xsl:when test="tei:head">
+				<xsl:apply-templates select="tei:head"
+					mode="plain" />
+			</xsl:when>
+			<xsl:when test="tei:front/tei:head">
+				<xsl:apply-templates select="tei:front/tei:head"
+					mode="plain" />
+			</xsl:when>
+			<xsl:when test="@n">
+				<xsl:value-of select="@n" />
+			</xsl:when>
+			<xsl:when test="@type">
+				<xsl:text>[</xsl:text>
+				<xsl:value-of select="@type" />
+				<xsl:text>]</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>➤</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="headings"
+		type="string">
+		<desc> Punctuation to insert after a section
+			number</desc>
+	</doc>
+	<xsl:template name="headingNumberSuffix">
+		<xsl:text>.</xsl:text>
+		<xsl:value-of select="$numberSpacer" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="headings"
+		type="string">
+		<desc> Character to put after number of
+			section header</desc>
+	</doc>
+	<xsl:param name="numberSpacer">
+		<xsl:text> </xsl:text>
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="string">
+		<desc> Name of department within institution</desc>
+	</doc>
+	<xsl:param name="department" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="string">
+		<desc> Name of link to home page of application</desc>
+	</doc>
+	<xsl:param name="homeLabel">
+		Home
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="anyURI">
+		<desc>Project Home</desc>
+	</doc>
+	<xsl:param name="homeURL">
+		http://www.tei-c.org/
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="string">
+		<desc>Project</desc>
+	</doc>
+	<xsl:param name="homeWords">
+		TEI
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="string">
+		<desc> Institution</desc>
+	</doc>
+	<xsl:param name="institution">
+		A TEI Project
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="anyURI">
+		<desc> Institution link</desc>
+	</doc>
+	<xsl:param name="parentURL">
+		http://www.tei-c.org/
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="string">
+		<desc> Name of overall institution</desc>
+	</doc>
+	<xsl:param name="parentWords">
+		Parent Institution
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="links"
+		type="anyURI">
+		<desc> Link to search application</desc>
+	</doc>
+	<xsl:param name="searchURL">
+		http://www.google.com
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc"
+		type="anyURI">
+		<desc> The home page for these stylesheets</desc>
+	</doc>
+	<xsl:param name="teixslHome">
+		http://www.tei-c.org/Stylesheets/
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc"
+		type="boolean">
+		<desc> Process elements according to assumptions
+			of TEI P4</desc>
+	</doc>
+	<xsl:param name="teiP4Compat">
+		false
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc" type="boolean">
-    <desc>Whether to attempt to work out a current date (set to true
-    for test results which won't differ</desc>
-  </doc>
-  <xsl:param name="useFixedDate">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering">
-    <desc>[common] How to number sections in back matter</desc>
-  </doc>
-  <xsl:template name="numberBackDiv">
-    <xsl:if test="not($numberBackHeadings='')">
-      <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" format="A.1.1.1.1.1" level="multiple"/>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc> Automatically number figures in back
-    matter</desc>
-  </doc>
-  <xsl:param name="numberBackFigures">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="string">
-    <desc> How to construct heading numbering in
-    back matter</desc>
-  </doc>
-  <xsl:param name="numberBackHeadings">A.1</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc> Automatically number tables in back
-    matter</desc>
-  </doc>
-  <xsl:param name="numberBackTables">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering">
-    <desc>[common] How to number sections in main matter</desc>
-  </doc>
-  <xsl:template name="numberBodyDiv">
-    <xsl:if test="$numberHeadings='true'">
-      <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" level="multiple"/>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="string">
-    <desc> How to construct heading numbering in
-    main matter</desc>
-  </doc>
-  <xsl:param name="numberBodyHeadings">1.1.1.1</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc> Automatically number figures</desc>
-  </doc>
-  <xsl:param name="numberFigures">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering">
-    <desc>[common] How to number sections in front matter</desc>
-  </doc>
-  <xsl:template name="numberFrontDiv">
-    <xsl:param name="minimal"/>
-    <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" level="multiple"/>
-    <xsl:if test="$minimal='false'">
-      <xsl:value-of select="$numberSpacer"/>
-    </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc> Automatically number figures in
-    front matter</desc>
-  </doc>
-  <xsl:param name="numberFrontFigures">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="string">
-    <desc> How to construct heading numbering in
-    front matter</desc>
-  </doc>
-  <xsl:param name="numberFrontHeadings"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc> Automatically number tables in front
-    matter</desc>
-  </doc>
-  <xsl:param name="numberFrontTables">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc> Automatically number sections</desc>
-  </doc>
-  <xsl:param name="numberHeadings">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="integer">
-    <desc> Depth to which sections should be
-    numbered</desc>
-  </doc>
-  <xsl:param name="numberHeadingsDepth">9</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc> Automatically number tables</desc>
-  </doc>
-  <xsl:param name="numberTables">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc> Use value of "n" attribute to number
-    sections</desc>
-  </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering" type="boolean">
-    <desc>
-    Automatically number paragraphs.
-  </desc>
-  </doc>
-  <xsl:param name="numberParagraphs">false</xsl:param>
-  <xsl:param name="prenumberedHeadings">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-    <desc> The complete URL when the document is
-    being delivered from a web server (normally set by Apache or Cocoon)</desc>
-  </doc>
-  <xsl:param name="REQUEST"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="boolean">
-    <desc> Write to standard output channel</desc>
-  </doc>
-  <xsl:param name="STDOUT">true</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-    <desc> Display of &lt;pb&gt; element.
-    Choices are "visible", "active" and "none".</desc>
-  </doc>
-  <xsl:param name="pagebreakStyle">visible</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-    <desc> How to display Relax NG schema fragments
-    (rnc or rng)</desc>
-  </doc>
-  <xsl:param name="displayMode">rnc</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="boolean">
-    <desc> Provide minimal context for a link</desc>
-  </doc>
-  <xsl:param name="minimalCrossRef">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-    <desc> Character to insert at end of quote.</desc>
-  </doc>
-  <xsl:param name="postQuote">’</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string">
-    <desc> Character to insert at start of quote</desc>
-  </doc>
-  <xsl:param name="preQuote">‘</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables" type="string">
-    <desc> Default alignment of table cells</desc>
-  </doc>
-  <xsl:param name="cellAlign">left</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables" type="string">
-    <desc> Default alignment of tables</desc>
-  </doc>
-  <xsl:param name="tableAlign">left</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-    <desc>
-Whether to make simplified display of ODD
-</desc>
-  </doc>
-  <xsl:param name="oddWeaveLite">false</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-    <desc>
-Paragraph indentation
-</desc>
-  </doc>
-  <xsl:param name="parIndent">1em</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc"
+		type="boolean">
+		<desc> Title, author and date is taken from the
+			&lt;teiHeader&gt; rather than looked for in the front matter</desc>
+	</doc>
+	<xsl:param name="useHeaderFrontMatter">
+		false
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-    <desc>
-      Style for formatted bibliography
-    </desc>
-  </doc>
-  <xsl:param name="biblioStyle"></xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="misc"
+		type="boolean">
+		<desc>Whether to attempt to work out a current date (set to true
+			for test results which won't differ</desc>
+	</doc>
+	<xsl:param name="useFixedDate">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering">
+		<desc>[common] How to number sections in back matter</desc>
+	</doc>
+	<xsl:template name="numberBackDiv">
+		<xsl:if test="not($numberBackHeadings='')">
+			<xsl:number
+				count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
+				format="A.1.1.1.1.1" level="multiple" />
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc> Automatically number figures in back
+			matter</desc>
+	</doc>
+	<xsl:param name="numberBackFigures">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="string">
+		<desc> How to construct heading numbering in
+			back matter</desc>
+	</doc>
+	<xsl:param name="numberBackHeadings">
+		A.1
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc> Automatically number tables in back
+			matter</desc>
+	</doc>
+	<xsl:param name="numberBackTables">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering">
+		<desc>[common] How to number sections in main matter</desc>
+	</doc>
+	<xsl:template name="numberBodyDiv">
+		<xsl:if test="$numberHeadings='true'">
+			<xsl:number
+				count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
+				level="multiple" />
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="string">
+		<desc> How to construct heading numbering in
+			main matter</desc>
+	</doc>
+	<xsl:param name="numberBodyHeadings">
+		1.1.1.1
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc> Automatically number figures</desc>
+	</doc>
+	<xsl:param name="numberFigures">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering">
+		<desc>[common] How to number sections in front matter</desc>
+	</doc>
+	<xsl:template name="numberFrontDiv">
+		<xsl:param name="minimal" />
+		<xsl:number
+			count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
+			level="multiple" />
+		<xsl:if test="$minimal='false'">
+			<xsl:value-of select="$numberSpacer" />
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc> Automatically number figures in
+			front matter</desc>
+	</doc>
+	<xsl:param name="numberFrontFigures">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="string">
+		<desc> How to construct heading numbering in
+			front matter</desc>
+	</doc>
+	<xsl:param name="numberFrontHeadings" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc> Automatically number tables in front
+			matter</desc>
+	</doc>
+	<xsl:param name="numberFrontTables">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc> Automatically number sections</desc>
+	</doc>
+	<xsl:param name="numberHeadings">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="integer">
+		<desc> Depth to which sections should be
+			numbered</desc>
+	</doc>
+	<xsl:param name="numberHeadingsDepth">
+		9
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc> Automatically number tables</desc>
+	</doc>
+	<xsl:param name="numberTables">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc> Use value of "n" attribute to number
+			sections</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="numbering"
+		type="boolean">
+		<desc>
+			Automatically number paragraphs.
+		</desc>
+	</doc>
+	<xsl:param name="numberParagraphs">
+		false
+	</xsl:param>
+	<xsl:param name="prenumberedHeadings">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc> The complete URL when the document is
+			being delivered from a web server (normally set by Apache or Cocoon)</desc>
+	</doc>
+	<xsl:param name="REQUEST" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="boolean">
+		<desc> Write to standard output channel</desc>
+	</doc>
+	<xsl:param name="STDOUT">
+		true
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc> Display of &lt;pb&gt; element.
+			Choices are "visible", "active" and "none".</desc>
+	</doc>
+	<xsl:param name="pagebreakStyle">
+		visible
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc> How to display Relax NG schema fragments
+			(rnc or rng)</desc>
+	</doc>
+	<xsl:param name="displayMode">
+		rnc
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="boolean">
+		<desc> Provide minimal context for a link</desc>
+	</doc>
+	<xsl:param name="minimalCrossRef">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc> Character to insert at end of quote.</desc>
+	</doc>
+	<xsl:param name="postQuote">
+		’
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc> Character to insert at start of quote</desc>
+	</doc>
+	<xsl:param name="preQuote">
+		‘
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables"
+		type="string">
+		<desc> Default alignment of table cells</desc>
+	</doc>
+	<xsl:param name="cellAlign">
+		left
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="tables"
+		type="string">
+		<desc> Default alignment of tables</desc>
+	</doc>
+	<xsl:param name="tableAlign">
+		left
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Whether to make simplified display of ODD
+		</desc>
+	</doc>
+	<xsl:param name="oddWeaveLite">
+		false
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Paragraph indentation
+		</desc>
+	</doc>
+	<xsl:param name="parIndent">
+		1em
+	</xsl:param>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-    <desc>
-Default spacing between paragraphs
-</desc>
-  </doc>
-  <xsl:param name="parSkip">0pt</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-    <desc>[common] Hook where actions can be inserted when making
-     a heading</desc>
-  </doc>
-  <xsl:template name="sectionHeadHook"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Style for formatted bibliography
+		</desc>
+	</doc>
+	<xsl:param name="biblioStyle"></xsl:param>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Default spacing between paragraphs
+		</desc>
+	</doc>
+	<xsl:param name="parSkip">
+		0pt
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[common] Hook where actions can be inserted when making
+			a heading</desc>
+	</doc>
+	<xsl:template name="sectionHeadHook" />
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/common2/tei.xsl	(revision 2397)
@@ -1,149 +1,188 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:s="http://www.ascc.net/xml/schematron"
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:sch="http://purl.oclc.org/dsdl/schematron"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="s tei fotex xsi sch fo"
-                version="2.0">
-  <xsl:import href="tei-param.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet definitions common for all of HTML, FO and LaTeX
-      outputs </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:fotex="http://www.tug.org/fotex"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="s tei fotex xsi sch fo" version="2.0">
+	<xsl:import href="tei-param.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet definitions common for all of HTML, FO and LaTeX
+				outputs
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei.xsl 10010 2012-01-03 19:35:49Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:include href="core.xsl"/>
-  <xsl:include href="textstructure.xsl"/>
-  <xsl:include href="header.xsl"/>
-  <xsl:include href="linking.xsl"/>
-  <xsl:include href="figures.xsl"/>
-  <xsl:include href="textcrit.xsl"/>
-  <xsl:include href="i18n.xsl"/>
-  <xsl:include href="functions.xsl"/>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <xsl:key name="APP" match="tei:app" use="1"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" type="string">
-      <desc> Name of XSLT processor.</desc>
-   </doc>
-  <xsl:variable name="processor">
-      <xsl:value-of select="system-property('xsl:vendor')"/>
-  </xsl:variable>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[common] turn names into quote characters<param name="quote">quote</param>
-      </desc>
-   </doc>
-  <xsl:template name="getQuote">
-      <xsl:param name="quote"/>
-      <xsl:choose>
-         <xsl:when test="$quote='laquo'">«</xsl:when>
-         <xsl:when test="$quote='ldquo'">“</xsl:when>
-         <xsl:when test="$quote='ldquor'">„</xsl:when>
-         <xsl:when test="$quote='lsaquo'">‹</xsl:when>
-         <xsl:when test="$quote='lsquo'">‘</xsl:when>
-         <xsl:when test="$quote='lsquor'">‚</xsl:when>
-         <xsl:when test="$quote='mdash'">—</xsl:when>
-         <xsl:when test="$quote='raquo'">»</xsl:when>
-         <xsl:when test="$quote='rdquo'">”</xsl:when>
-         <xsl:when test="$quote='rdquor'">‟</xsl:when>
-         <xsl:when test="$quote='rsaquo'">›</xsl:when>
-         <xsl:when test="$quote='rsquo'">’</xsl:when>
-         <xsl:when test="$quote='rsquor'">‛</xsl:when>
-         <xsl:otherwise>?</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template name="whatsTheDate">
-    <xsl:choose>
-      	<xsl:when test="$useFixedDate='true'">1970-01-01</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of
-	      select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')"/>
-	</xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-   <xsl:template name="makeQuote">
-      <xsl:variable name="pre">
-         <xsl:choose>
-            <xsl:when test="contains(@rend,'PRE')">
-	              <xsl:choose>
-	                 <xsl:when test="contains(@rend,'POST')">
-	                    <xsl:call-template name="getQuote">
-	                       <xsl:with-param name="quote"
-                                        select="normalize-space(substring-before(substring-after(@rend,'PRE'),'POST'))"/>
-	                    </xsl:call-template>
-	                 </xsl:when>
-	                 <xsl:otherwise>
-	                    <xsl:call-template name="getQuote">
-	                       <xsl:with-param name="quote" select="normalize-space(substring-after(@rend,'PRE'))"/>
-	                    </xsl:call-template>
-	                 </xsl:otherwise>
-	              </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:value-of select="$preQuote"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="post">
-         <xsl:choose>
-            <xsl:when test="contains(@rend,'POST')">
-	              <xsl:call-template name="getQuote">
-	                 <xsl:with-param name="quote" select="normalize-space(substring-after(@rend,'POST'))"/>
-	              </xsl:call-template>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:value-of select="$postQuote"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:value-of select="$pre"/>
-      <xsl:apply-templates/>
-      <xsl:value-of select="$post"/>
-   </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei.xsl 10010 2012-01-03 19:35:49Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:include href="core.xsl" />
+	<xsl:include href="textstructure.xsl" />
+	<xsl:include href="header.xsl" />
+	<xsl:include href="linking.xsl" />
+	<xsl:include href="figures.xsl" />
+	<xsl:include href="textcrit.xsl" />
+	<xsl:include href="i18n.xsl" />
+	<xsl:include href="functions.xsl" />
 
-  <xsl:template name="tei:makeText">
-    <xsl:param name="letters"/>
-    <xsl:value-of select="$letters"/>
-  </xsl:template>
+	<xsl:key name="APP" match="tei:app" use="1" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" type="string">
+		<desc> Name of XSLT processor.</desc>
+	</doc>
+	<xsl:variable name="processor">
+		<xsl:value-of select="system-property('xsl:vendor')" />
+	</xsl:variable>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[common] turn names into quote characters
+			<param name="quote">quote</param>
+		</desc>
+	</doc>
+	<xsl:template name="getQuote">
+		<xsl:param name="quote" />
+		<xsl:choose>
+			<xsl:when test="$quote='laquo'">
+				«
+			</xsl:when>
+			<xsl:when test="$quote='ldquo'">
+				“
+			</xsl:when>
+			<xsl:when test="$quote='ldquor'">
+				„
+			</xsl:when>
+			<xsl:when test="$quote='lsaquo'">
+				‹
+			</xsl:when>
+			<xsl:when test="$quote='lsquo'">
+				‘
+			</xsl:when>
+			<xsl:when test="$quote='lsquor'">
+				‚
+			</xsl:when>
+			<xsl:when test="$quote='mdash'">
+				—
+			</xsl:when>
+			<xsl:when test="$quote='raquo'">
+				»
+			</xsl:when>
+			<xsl:when test="$quote='rdquo'">
+				”
+			</xsl:when>
+			<xsl:when test="$quote='rdquor'">
+				‟
+			</xsl:when>
+			<xsl:when test="$quote='rsaquo'">
+				›
+			</xsl:when>
+			<xsl:when test="$quote='rsquo'">
+				’
+			</xsl:when>
+			<xsl:when test="$quote='rsquor'">
+				‛
+			</xsl:when>
+			<xsl:otherwise>
+				?
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="whatsTheDate">
+		<xsl:choose>
+			<xsl:when test="$useFixedDate='true'">
+				1970-01-01
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<xsl:template name="makeQuote">
+		<xsl:variable name="pre">
+			<xsl:choose>
+				<xsl:when test="contains(@rend,'PRE')">
+					<xsl:choose>
+						<xsl:when test="contains(@rend,'POST')">
+							<xsl:call-template name="getQuote">
+								<xsl:with-param name="quote"
+									select="normalize-space(substring-before(substring-after(@rend,'PRE'),'POST'))" />
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template name="getQuote">
+								<xsl:with-param name="quote"
+									select="normalize-space(substring-after(@rend,'PRE'))" />
+							</xsl:call-template>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$preQuote" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="post">
+			<xsl:choose>
+				<xsl:when test="contains(@rend,'POST')">
+					<xsl:call-template name="getQuote">
+						<xsl:with-param name="quote"
+							select="normalize-space(substring-after(@rend,'POST'))" />
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$postQuote" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:value-of select="$pre" />
+		<xsl:apply-templates />
+		<xsl:value-of select="$post" />
+	</xsl:template>
+
+	<xsl:template name="tei:makeText">
+		<xsl:param name="letters" />
+		<xsl:value-of select="$letters" />
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/msdescription.css
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/msdescription.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/msdescription.css	(revision 2397)
@@ -4,635 +4,807 @@
    for general HTML display
 */
 msDesc {
-    display: block;
-    font-family: "Junicode";
-    margin-left: 25pt;
-    margin-right: 15pt;
-    margin-top: 15pt;
-    margin-bottom: 15pt;
-    font-size: 12pt;
-    line-height: 14pt;
-    text-align: left
+	display: block;
+	font-family: "Junicode";
+	margin-left: 25pt;
+	margin-right: 15pt;
+	margin-top: 15pt;
+	margin-bottom: 15pt;
+	font-size: 12pt;
+	line-height: 14pt;
+	text-align: left
 }
+
 msDesc>msIdentifier {
-    display: block;
-    font-size: 26pt;
-    line-height: 28pt;
-    color: #ad1010
+	display: block;
+	font-size: 26pt;
+	line-height: 28pt;
+	color: #ad1010
 }
+
 msIdentifier country {
-    display: none
+	display: none
 }
+
 msIdentifier settlement {
-    display: none
+	display: none
 }
+
 msIdentifier repository {
-    display: none
+	display: none
 }
+
 msIdentifier altIdentifier {
-    display: none
+	display: none
 }
+
 msName[type="nickname"]:before {
-    content: "(\201C"
+	content: "(\201C"
 }
+
 msName[type="nickname"]:after {
-    content: "\201D)"
+	content: "\201D)"
 }
+
 head, msContents, history, additional, seal {
-    padding-top: 3pt;
-    padding-bottom: 2pt;
-    display: block
+	padding-top: 3pt;
+	padding-bottom: 2pt;
+	display: block
 }
+
 physDesc, supportDesc, objectDesc, layoutDesc, decoDesc, sealDesc {
-    display: block;
-    margin-bottom: 4pt;
+	display: block;
+	margin-bottom: 4pt;
 }
+
 physDesc:before {
-    content: "Physical description:";
-    font-weight: 600;
-    font-variant: small-caps;
-    font-size: 120%;
+	content: "Physical description:";
+	font-weight: 600;
+	font-variant: small-caps;
+	font-size: 120%;
 }
+
 history:before {
-    content: "History:";
-    display: block;
-    font-weight: 600;
-    font-variant: small-caps;
-    font-size: 120%
+	content: "History:";
+	display: block;
+	font-weight: 600;
+	font-variant: small-caps;
+	font-size: 120%
 }
 
 head {
-    font-size: 16pt;
-    line-height: 19pt
+	font-size: 16pt;
+	line-height: 19pt
 }
+
 title {
-    display: inline;
+	display: inline;
 }
+
 head title {
-    font-style: italic
+	font-style: italic
 }
+
 head>title:after {
-    content: ". "
+	content: ". "
 }
+
 head>origPlace:after {
-    content: ", "
+	content: ", "
 }
+
 head>origDate:after {
-    content: "."
+	content: "."
 }
+
 head>textLang:after {
-    content: "."
+	content: "."
 }
+
 head note {
-    display: block;
-    padding-top: 10pt;
-    font-size: 13pt
+	display: block;
+	padding-top: 10pt;
+	font-size: 13pt
 }
+
 msItem[n]:before {
-    font-weight: 600;
-    content: attr(n) ". "
+	font-weight: 600;
+	content: attr(n) ". "
 }
+
 msContents:before {
-    content: "Contents:";
-    font-weight: 600;
-    font-variant: small-caps;
-    font-size: 120%
+	content: "Contents:";
+	font-weight: 600;
+	font-variant: small-caps;
+	font-size: 120%
 }
+
 msItem {
-    display: block;
-    margin-left: 10pt
+	display: block;
+	margin-left: 10pt
 }
+
 msItem>msItem {
-    display: block;
-    margin-left: 15pt
+	display: block;
+	margin-left: 15pt
 }
+
 msItem[n]>locus:before {
-    content: "("
+	content: "("
 }
+
 msItem[n]>locus:after {
-    content: ")"
+	content: ")"
 }
+
 msItem>title {
-    font-weight: 600;
-    font-size: 100%;
-    letter-spacing: 1px
+	font-weight: 600;
+	font-size: 100%;
+	letter-spacing: 1px
 }
+
 msItem>title:after {
-    content: ". "
+	content: ". "
 }
+
 rubric {
-    display: block
+	display: block
 }
+
 rubric:before {
-    content: "Rubric: \201C"
+	content: "Rubric: \201C"
 }
+
 rubric:after {
-    content: "\201D "
+	content: "\201D "
 }
+
 incipit {
-    display: block
+	display: block
 }
+
 incipit:before {
-    content: "Incipit: \201C"
+	content: "Incipit: \201C"
 }
+
 incipit:after {
-    content: "\201D "
+	content: "\201D "
 }
+
 explicit {
-    display: block
+	display: block
 }
+
 explicit:before {
-    content: "Explicit: \201C"
+	content: "Explicit: \201C"
 }
+
 explicit:after {
-    content: "\201D "
+	content: "\201D "
 }
+
 incipit[defective="yes"]:before {
-    content: "Begins: \201C"
+	content: "Begins: \201C"
 }
+
 explicit[defective="yes"]:before {
-    content: "Ends: \201C"
+	content: "Ends: \201C"
 }
+
 rubric[type="final"]:before {
-    content: "Final rubric: \201C"
+	content: "Final rubric: \201C"
 }
+
 rubric[type="final"]:after {
-    content: "\201D "
+	content: "\201D "
 }
+
 colophon {
-    display: block
+	display: block
 }
+
 colophon:before {
-    content: "Colophon: \201C"
+	content: "Colophon: \201C"
 }
+
 colophon:after {
-    content: "\201D "
+	content: "\201D "
 }
+
 msItem>textLang {
-    display: block
+	display: block
 }
+
 msItem>textLang:before {
-    content: "Language of text: "
+	content: "Language of text: "
 }
+
 msItem>textLang:after {
-    content: "."
+	content: "."
 }
+
 history origin {
-    display: block
+	display: block
 }
+
 history origin:before {
-    content: "Origin:";
-    font-weight: bold
+	content: "Origin:";
+	font-weight: bold
 }
+
 history provenance:before {
-    content: "Provenance: ";
-    font-weight: bold
+	content: "Provenance: ";
+	font-weight: bold
 }
+
 history provenance {
-    display: block
+	display: block
 }
+
 history acquisition:before {
-    content: "Acquisition: ";
-    font-weight: bold
+	content: "Acquisition: ";
+	font-weight: bold
 }
+
 history acquisition {
-    display: block
+	display: block
 }
+
 msItem>listBibl {
-    display: block;
-    list-style-type: none;
-    margin-left: 20pt
+	display: block;
+	list-style-type: none;
+	margin-left: 20pt
 }
+
 msItem>listBibl>bibl {
-    display: list-item;
-    margin-left: 30pt
+	display: list-item;
+	margin-left: 30pt
 }
+
 msItem>listBibl:before {
-    content: "Text editions:";
-    display: block;
-    font-weight: 600
+	content: "Text editions:";
+	display: block;
+	font-weight: 600
 }
+
 msItem>bibl {
-    display: block;
-    margin-left: 20pt
+	display: block;
+	margin-left: 20pt
 }
+
 msItem>bibl:before {
-    content: "Text edition: ";
-    font-weight: 600
+	content: "Text edition: ";
+	font-weight: 600
 }
+
 msItem>listBibl>bibl:after {
-    content: "."
+	content: "."
 }
+
 author:after {
-    content: ", "
+	content: ", "
 }
+
 bibl>editor:after {
-    content: ", ";
-    text-align: left
+	content: ", ";
+	text-align: left
 }
+
 bibl title[level="m"] {
-    font-style: italic;
-    font-weight: normal;
-    font-size: 100%
+	font-style: italic;
+	font-weight: normal;
+	font-size: 100%
 }
+
 bibl title[level="j"] {
-    font-style: italic;
-    font-weight: normal;
-    font-size: 100%
+	font-style: italic;
+	font-weight: normal;
+	font-size: 100%
 }
+
 bibl title[level="s"] {
-    font-style: normal;
-    font-weight: normal;
-    font-size: 100%
+	font-style: normal;
+	font-weight: normal;
+	font-size: 100%
 }
+
 bibl title[level="a"] {
-    font-style: normal;
-    font-weight: normal;
-    font-size: 100%
+	font-style: normal;
+	font-weight: normal;
+	font-size: 100%
 }
+
 bibl title[level="a"]:before {
-    content: " \201C"
+	content: " \201C"
 }
+
 bibl title[level="a"]:after {
-    content: "\201D, "
+	content: "\201D, "
 }
+
 bibl title[level="s"]:before {
-    content: ", "
+	content: ", "
 }
+
 msItem bibl title {
-    font-style: italic
+	font-style: italic
 }
+
 biblScope[type="pages"]:before {
-    content: ", pp. "
+	content: ", pp. "
 }
+
 imprint:before {
-    content: "("
+	content: "("
 }
+
 imprint:after {
-    content: ")"
+	content: ")"
 }
+
 pubPlace:after {
-    content: ","
+	content: ","
 }
+
 bibl>note:before {
-    content: " ("
+	content: " ("
 }
+
 bibl>note:after {
-    content: ")"
+	content: ")"
 }
+
 additional>listBibl>bibl:after {
-    content: "."
+	content: "."
 }
+
 q:before {
-    content: "\201C"
+	content: "\201C"
 }
+
 q:after {
-    content: "\201D"
+	content: "\201D"
 }
+
 q q:before {
-    content: "�"
+	content: "�"
 }
+
 q q:after {
-    content: "�"
+	content: "�"
 }
+
 q[type="block"] {
-    display: block;
-    margin-left: 15pt;
-    font-size: 12pt;
-    line-height: 14pt
+	display: block;
+	margin-left: 15pt;
+	font-size: 12pt;
+	line-height: 14pt
 }
+
 q[type="block"]:before {
-    content: ""
+	content: ""
 }
+
 q[type="block"]:after {
-    content: ""
+	content: ""
 }
+
 msItem note:before {
-    content: " ("
+	content: " ("
 }
+
 msItem note:after {
-    content: ")"
+	content: ")"
 }
+
 form {
-    display: block
+	display: block
 }
+
 form:before {
-    content: "Form: ";
-    font-weight: bold
+	content: "Form: ";
+	font-weight: bold
 }
+
 support {
-    display: block
+	display: block
 }
+
 support:before {
-    content: "Support: ";
-    font-weight: bold
+	content: "Support: ";
+	font-weight: bold
 }
+
 extent {
-    display: block
+	display: block
 }
+
 extent:before {
-    content: "No. of leaves: ";
-    font-weight: bold;
-    display: block
+	content: "No. of leaves: ";
+	font-weight: bold;
+	display: block
 }
+
 collation {
-    display: block
+	display: block
 }
+
 collation:before {
-    content: "Collation: ";
-    font-weight: bold
+	content: "Collation: ";
+	font-weight: bold
 }
+
 layout {
-    display: block
+	display: block
 }
+
 layout:before {
-    content: "Layout: ";
-    font-weight: bold
+	content: "Layout: ";
+	font-weight: bold
 }
+
 msWriting {
-    display: block
+	display: block
 }
+
 msWriting:before {
-    content: "Script: ";
-    font-weight: bold
+	content: "Script: ";
+	font-weight: bold
 }
+
 musicNotation {
-    display: block
+	display: block
 }
+
 musicNotation:before {
-    content: "Musical notation: ";
-    font-weight: bold
+	content: "Musical notation: ";
+	font-weight: bold
 }
+
 decoDesc:before {
-    content: "Decoration: ";
-    font-weight: bold
+	content: "Decoration: ";
+	font-weight: bold
 }
+
 decoNote {
-    display: list-item;
-    margin-left: 16pt;
+	display: list-item;
+	margin-left: 16pt;
 }
+
 bindingDesc {
-    display: block
+	display: block
 }
+
 bindingDesc:before {
-    content: "Binding: ";
-    font-weight: bold
+	content: "Binding: ";
+	font-weight: bold
 }
+
 foliation {
-    display: block
+	display: block
 }
+
 foliation:before {
-    content: "Foliation: ";
-    font-weight: bold
+	content: "Foliation: ";
+	font-weight: bold
 }
+
 additions {
-    display: block
+	display: block
 }
+
 additions:before {
-    content: "Additions: ";
-    font-weight: bold
+	content: "Additions: ";
+	font-weight: bold
 }
+
 condition {
-    display: block
+	display: block
 }
+
 condition:before {
-    content: "Condition: ";
-    font-weight: bold
+	content: "Condition: ";
+	font-weight: bold
 }
+
 dimensions[type="leaf"] {
-    display: block
+	display: block
 }
+
 dimensions[type="leaf"]:before {
-    content: "Size of leaves: ";
-    font-weight: bold;
-    display: block
+	content: "Size of leaves: ";
+	font-weight: bold;
+	display: block
 }
+
 dimensions height:after {
-    content: " x "
+	content: " x "
 }
+
 dimensions:after {
-    content: " mm."
+	content: " mm."
 }
+
 dimensions depth:before {
-    content: " x "
+	content: " x "
 }
+
 recordHist {
-    display: block
+	display: block
 }
+
 recordHist:before {
-    content: "Record history: ";
-    font-weight: bold
+	content: "Record history: ";
+	font-weight: bold
 }
+
 availability {
-    display: block
+	display: block
 }
+
 availability:before {
-    content: "Availability: ";
-    font-weight: bold
+	content: "Availability: ";
+	font-weight: bold
 }
+
 custodialHist {
-    display: block
+	display: block
 }
+
 custodialHist:before {
-    content: "Custodial history: ";
-    font-weight: bold
+	content: "Custodial history: ";
+	font-weight: bold
 }
+
 custEvent {
-    display: list-item;
-    list-style-type: none;
-    margin-left: 30pt
+	display: list-item;
+	list-style-type: none;
+	margin-left: 30pt
 }
+
 surrogates {
-    display: block
+	display: block
 }
+
 surrogates:before {
-    content: "Surrogates: ";
-    font-weight: bold
+	content: "Surrogates: ";
+	font-weight: bold
 }
+
 surrogates>p>listBibl {
-    display: block;
+	display: block;
 }
+
 surrogates>p>listBibl>bibl {
-    display: list-item;
-    margin-left: 30pt
+	display: list-item;
+	margin-left: 30pt
 }
+
 title[type="gmd"]:before {
-    content: "Format: "
+	content: "Format: "
 }
+
 title[type="gmd"]:after {
-    content: ". "
+	content: ". "
 }
+
 surrogates idno:before {
-    content: "ID no.: "
+	content: "ID no.: "
 }
+
 surrogates idno:after {
-    content: ". "
+	content: ". "
 }
+
 surrogates bibl date:before {
-    content: "Date created: "
+	content: "Date created: "
 }
+
 accMat {
-    display: block
+	display: block
 }
+
 accMat:before {
-    content: "Accompanying material: ";
-    font-weight: bold
+	content: "Accompanying material: ";
+	font-weight: bold
 }
+
 additional:before {
-    content: "Additional:";
-    display: block;
-    font-weight: 600;
-    font-variant: small-caps;
-    font-size: 120%
+	content: "Additional:";
+	display: block;
+	font-weight: 600;
+	font-variant: small-caps;
+	font-size: 120%
 }
+
 additional>listBibl {
-    display: block;
-    list-style-type: none;
-    margin-top: 10pt
+	display: block;
+	list-style-type: none;
+	margin-top: 10pt
 }
+
 additional>listBibl:before {
-    content: "Bibliography:";
-    display: block;
-    font-weight: 600;
-    font-variant: small-caps;
-    font-size: 120%
+	content: "Bibliography:";
+	display: block;
+	font-weight: 600;
+	font-variant: small-caps;
+	font-size: 120%
 }
+
 additional>listBibl>bibl {
-    text-align: left;
-    display: list-item;
-    margin-left: 30pt
+	text-align: left;
+	display: list-item;
+	margin-left: 30pt
 }
+
 list {
-    display: block;
+	display: block;
 }
+
 list item {
-    display: list-item;
-    margin-left: 30pt
+	display: list-item;
+	margin-left: 30pt
 }
+
 q item {
-    list-style-type: none
+	list-style-type: none
 }
+
 item locus:after {
-    content: ": "
+	content: ": "
 }
+
 pb:before {
-    font-weight: 600;
-    content: "|" attr(n) "|"
+	font-weight: 600;
+	content: "|" attr(n) "|"
 }
+
 lb[n] {
-    display: list-item;
-    list-style-type: none;
-    margin-left: 30pt;
+	display: list-item;
+	list-style-type: none;
+	margin-left: 30pt;
 }
+
 lb[type="hyphenated"]:before {
-    content: "-|"
+	content: "-|"
 }
+
 lb[n]:after {
-    content: attr(n);
+	content: attr(n);
 }
+
 supplied[reason="damage"]:before {
-    content: "<"
+	content: "<"
 }
+
 supplied[reason="damage"]:after {
-    content: ">"
+	content: ">"
 }
+
 supplied[reason="illegible"]:before {
-    content: "["
+	content: "["
 }
+
 supplied[reason="illegible"]:after {
-    content: "]"
+	content: "]"
 }
+
 supplied[reason="omitted"]:before {
-    content: "\27E8"
+	content: "\27E8"
 }
+
 supplied[reason="omitted"]:after {
-    content: "\27E9"
+	content: "\27E9"
 }
+
 gap:before {
-    content: " [...]"
+	content: " [...]"
 }
+
 expan {
-    font-style: italic
+	font-style: italic
 }
+
 foreign {
-    font-style: italic
+	font-style: italic
 }
+
 ref {
-    font-style: italic
+	font-style: italic
 }
+
 hi[rend="sup"] {
-    font-size: .83em;
-    vertical-align: super
+	font-size: .83em;
+	vertical-align: super
 }
+
 hi[rend="underline"] {
-    text-decoration: underline
+	text-decoration: underline
 }
+
 hi[rend="bold"] {
-    font-weight: bold
+	font-weight: bold
 }
+
 hi[rend="italic"] {
-    font-style: italic
+	font-style: italic
 }
+
 del[rend="overstrike"] {
-    text-decoration: line-through
+	text-decoration: line-through
 }
+
 note>title {
-    font-style: italic
+	font-style: italic
 }
+
 p {
-    display: block
+	display: block
 }
+
 p>p {
-    display: block;
-    margin-left: 15pt;
-    margin-right: 15pt;
-    margin-top: 2pt;
-    margin-bottom: 2pt;
-    font-style: normal;
-    font-size: 12pt;
-    line-height: 13pt
+	display: block;
+	margin-left: 15pt;
+	margin-right: 15pt;
+	margin-top: 2pt;
+	margin-bottom: 2pt;
+	font-style: normal;
+	font-size: 12pt;
+	line-height: 13pt
 }
+
 lg {
-    display: block;
-    margin-bottom: 10pt
+	display: block;
+	margin-bottom: 10pt
 }
+
 l {
-    display: block
+	display: block
 }
+
 msPart {
-    display: block;
-    margin-top: 15pt;
-    margin-bottom: 15pt
+	display: block;
+	margin-top: 15pt;
+	margin-bottom: 15pt
 }
+
 msPart idno {
-    display: block;
-    font-size: 16pt
+	display: block;
+	font-size: 16pt
 }
+
 hi[rend="scap"] {
-    font-size: 65%
+	font-size: 65%
 }
+
 hi[rend="lig"] {
-    letter-spacing: -4px
+	letter-spacing: -4px
 }
+
 publisher {
-    display: inline;
+	display: inline;
 }
-choice > abbr {
-    display: none;
+
+choice>abbr {
+	display: none;
 }
-choice > orig {
-    display: none;
+
+choice>orig {
+	display: none;
 }
-choice > expan {
-    font-style: normal
+
+choice>expan {
+	font-style: normal
 }
-expan > ex:before {
-    content: "(";
+
+expan>ex:before {
+	content: "(";
 }
-expan > ex:after {
-    content: ")";
+
+expan>ex:after {
+	content: ")";
 }
 
 placeName, persName, name, genName, geogName, roleName {
-        display: inline;
+	display: inline;
 }
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/crm.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/crm.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/crm.xsl	(revision 2397)
@@ -1,661 +1,725 @@
 <?xml version="1.0"?>
-<xsl:stylesheet 
-    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
-        xmlns="http://purl.org/NET/crm-owl#" 
-    xmlns:crm="http://purl.org/NET/crm-owl#" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0" 
-    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
-    xmlns:owl="http://www.w3.org/2002/07/owl#" 
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    version="2.0" 
-    xpath-default-namespace="http://www.tei-c.org/ns/1.0" 
-    exclude-result-prefixes="tei rdf rdfs owl xsd crm xsl xs">
-  
-  <xsl:output encoding="utf-8" method="xml" indent="yes"/>
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns="http://purl.org/NET/crm-owl#"
+	xmlns:crm="http://purl.org/NET/crm-owl#"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="tei rdf rdfs owl xsd crm xsl xs">
 
-  <xsl:key name="persons" match="persName" use="@ref"/>
-  <xsl:key name="Places" match="place[placeName]" use="placeName"/>
-  <xsl:key name="Idents" 
-	   match="crm:P131_is_identified_by"
-	   use="crm:E82_Actor_Appellation/@rdf:about"/>
+	<xsl:output encoding="utf-8" method="xml" indent="yes" />
 
-  <xsl:key name="Idents" 
-	   match="crm:P87_is_identified_by"
-	   use="crm:E48_Place_Name/@rdf:about"/>
+	<xsl:key name="persons" match="persName" use="@ref" />
+	<xsl:key name="Places" match="place[placeName]" use="placeName" />
+	<xsl:key name="Idents" match="crm:P131_is_identified_by"
+		use="crm:E82_Actor_Appellation/@rdf:about" />
 
-  <xsl:template name="TEI">
-    <xsl:choose>
-      <xsl:when test="parent::*">
-	<xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:call-template name="doit"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:key name="Idents" match="crm:P87_is_identified_by"
+		use="crm:E48_Place_Name/@rdf:about" />
 
-  <xsl:template name="processAll">
-    <xsl:call-template name="doit"/>
-  </xsl:template>
+	<xsl:template name="TEI">
+		<xsl:choose>
+			<xsl:when test="parent::*">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="doit" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="doit">
-      <xsl:variable name="rdf1">
-	<rdf:RDF
-	    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
-	    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
-	    >
-	  <xsl:call-template name="typology"/>
-	  <xsl:apply-templates/>
-	</rdf:RDF>
-      </xsl:variable>
-      <xsl:apply-templates select="$rdf1" mode="rdf2"/>
-  </xsl:template>
+	<xsl:template name="processAll">
+		<xsl:call-template name="doit" />
+	</xsl:template>
 
-  <!-- clean up pass -->
+	<xsl:template name="doit">
+		<xsl:variable name="rdf1">
+			<rdf:RDF
+				xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+				xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
+				<xsl:call-template name="typology" />
+				<xsl:apply-templates />
+			</rdf:RDF>
+		</xsl:variable>
+		<xsl:apply-templates select="$rdf1" mode="rdf2" />
+	</xsl:template>
 
-  <xsl:template match="crm:*[crm:E53_Place]" mode="rdf2">
-    <xsl:copy>
-      <xsl:attribute name="rdf:resource"
-			 select="crm:E53_Place/@rdf:about"/>
-    </xsl:copy>
-  </xsl:template>
+	<!-- clean up pass -->
 
-  <xsl:template match="crm:E53_Place" mode="rdf2"/>
+	<xsl:template match="crm:*[crm:E53_Place]" mode="rdf2">
+		<xsl:copy>
+			<xsl:attribute name="rdf:resource"
+				select="crm:E53_Place/@rdf:about" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="crm:E53_Place" mode="rdf3">
-     <xsl:copy>
-      <xsl:apply-templates  select="*|@*|processing-instruction()|comment()|text()"
-	  mode="rdf2"/>
-     </xsl:copy>    
-  </xsl:template>
+	<xsl:template match="crm:E53_Place" mode="rdf2" />
 
-  <xsl:template match="rdf:RDF" mode="rdf2">
-     <xsl:copy>
-      <xsl:apply-templates  select="*|@*|processing-instruction()|comment()|text()"
-	  mode="rdf2"/>
-     <xsl:apply-templates select=".//crm:E53_Place" mode="rdf3"/>
-     </xsl:copy>
-  </xsl:template>
+	<xsl:template match="crm:E53_Place" mode="rdf3">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="rdf2" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="*" mode="rdf2">
-     <xsl:copy>
-      <xsl:apply-templates
-	  select="*|@*|processing-instruction()|comment()|text()"
-	  mode="rdf2"/>
-     </xsl:copy>
-   </xsl:template>
-   
-   <xsl:template match="text()|comment()|@*|processing-instruction()"
-		 mode="rdf2">
-     <xsl:copy-of select="."/>
-   </xsl:template>
+	<xsl:template match="rdf:RDF" mode="rdf2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="rdf2" />
+			<xsl:apply-templates select=".//crm:E53_Place"
+				mode="rdf3" />
+		</xsl:copy>
+	</xsl:template>
 
-   <!-- normal pass -->
-  <xsl:template name="E31">
-    <E31_Document xmlns="http://purl.org/NET/crm-owl#" 
-	rdf:about="{tei:makeID(.,'id')}">
-      <xsl:apply-templates select="fileDesc"/>
-    </E31_Document>
-    <xsl:apply-templates select="*[not(self::fileDesc)]"/>
-  </xsl:template>
+	<xsl:template match="*" mode="rdf2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="rdf2" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template name="anonblock">
-    <xsl:choose>
-      <xsl:when test="@type='dDay'">
-	<E5_Event rdf:about="{tei:makeID(.,'event')}">
-	  <rdf:value>
-	    <xsl:value-of select="."/>
-	  </rdf:value>
-	  <xsl:apply-templates/>
-	</E5_Event>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  
+	<xsl:template
+		match="text()|comment()|@*|processing-instruction()" mode="rdf2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template name="teiname">
-    <xsl:choose>
-      <xsl:when test="@type='place'">
-        <xsl:call-template name="E53"/>
-      </xsl:when>
-      <xsl:when test="@type='person'">
-        <xsl:call-template name="E21"/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+	<!-- normal pass -->
+	<xsl:template name="E31">
+		<E31_Document xmlns="http://purl.org/NET/crm-owl#"
+			rdf:about="{tei:makeID(.,'id')}">
+			<xsl:apply-templates select="fileDesc" />
+		</E31_Document>
+		<xsl:apply-templates
+			select="*[not(self::fileDesc)]" />
+	</xsl:template>
 
-  <xsl:template name="E53">
-      <xsl:choose>
-	<xsl:when test="ancestor::state"/>	
-	<xsl:when test="ancestor::trait"/>
-	<xsl:when test="parent::p"/>
-	<xsl:otherwise>
-	  <E53_Place  xmlns="http://purl.org/NET/crm-owl#" >
-	    <xsl:attribute name="rdf:about" select="tei:makeID(.,'place')"/>
-	    <xsl:apply-templates select="*[not(self::place or self::listPlace)]"/>
-	    <xsl:for-each select="parent::place[1]">
-	      <P89_falls_within rdf:resource="{tei:makeID(.,'place')}"/>
-	    </xsl:for-each>
-	  </E53_Place>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:apply-templates select="place|listPlace"/>
-  </xsl:template>
+	<xsl:template name="anonblock">
+		<xsl:choose>
+			<xsl:when test="@type='dDay'">
+				<E5_Event rdf:about="{tei:makeID(.,'event')}">
+					<rdf:value>
+						<xsl:value-of select="." />
+					</rdf:value>
+					<xsl:apply-templates />
+				</E5_Event>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="E21">
-    <xsl:choose>
-      <xsl:when test="self::name">
-	<P131_is_identified_by  xmlns="http://purl.org/NET/crm-owl#"
-	      rdf:resource="{tei:makeID(.,'persname')}"/>
-      </xsl:when>
-      <xsl:otherwise>
-	<E21_Person rdf:about="{tei:makeID(.,'person')}">
-	  <xsl:apply-templates/>
-	</E21_Person>
-      </xsl:otherwise>
-    </xsl:choose>
 
-  </xsl:template>
+	<xsl:template name="teiname">
+		<xsl:choose>
+			<xsl:when test="@type='place'">
+				<xsl:call-template name="E53" />
+			</xsl:when>
+			<xsl:when test="@type='person'">
+				<xsl:call-template name="E21" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="E74">
-    <E74_Group xmlns="http://purl.org/NET/crm-owl#" rdf:about="{tei:makeID(.,'org')}">
-      <xsl:apply-templates/>
-    </E74_Group>
-  </xsl:template>
+	<xsl:template name="E53">
+		<xsl:choose>
+			<xsl:when test="ancestor::state" />
+			<xsl:when test="ancestor::trait" />
+			<xsl:when test="parent::p" />
+			<xsl:otherwise>
+				<E53_Place xmlns="http://purl.org/NET/crm-owl#">
+					<xsl:attribute name="rdf:about"
+						select="tei:makeID(.,'place')" />
+					<xsl:apply-templates
+						select="*[not(self::place or self::listPlace)]" />
+					<xsl:for-each select="parent::place[1]">
+						<P89_falls_within
+							rdf:resource="{tei:makeID(.,'place')}" />
+					</xsl:for-each>
+				</E53_Place>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:apply-templates select="place|listPlace" />
+	</xsl:template>
 
-  <xsl:template name="E5">
-    <P11i_participated_in  xmlns="http://purl.org/NET/crm-owl#" >
-      <E5_Event rdf:about="{tei:makeID(.,'event')}">
-	<rdf:value>
-	  <xsl:value-of select="."/>
-	</rdf:value>
-	<xsl:apply-templates/>
-      </E5_Event>
-    </P11i_participated_in>
-  </xsl:template>
+	<xsl:template name="E21">
+		<xsl:choose>
+			<xsl:when test="self::name">
+				<P131_is_identified_by
+					xmlns="http://purl.org/NET/crm-owl#"
+					rdf:resource="{tei:makeID(.,'persname')}" />
+			</xsl:when>
+			<xsl:otherwise>
+				<E21_Person rdf:about="{tei:makeID(.,'person')}">
+					<xsl:apply-templates />
+				</E21_Person>
+			</xsl:otherwise>
+		</xsl:choose>
 
-  <xsl:template name="E47">
-    <P87_is_identified_by  xmlns="http://purl.org/NET/crm-owl#" >
-      <E47_Place_Spatial_Coordinates rdf:about="{tei:makeID(.,'placecoords')}">
-	<rdf:value>
-	  <xsl:value-of select="."/>
-	</rdf:value>
-      </E47_Place_Spatial_Coordinates>
-    </P87_is_identified_by>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template name="E69">
-    <P100i_died_in  xmlns="http://purl.org/NET/crm-owl#" >
-      <E69_Death>
-	<P4_has_time-span>
-	  <E52_Time-Span>
-	    <P82_at_some_time_within>
-	      <E61_Time_Primitive>
-		<xsl:call-template name="calc-date-value"/>
-	      </E61_Time_Primitive>
-	    </P82_at_some_time_within>
-	  </E52_Time-Span>
-	</P4_has_time-span>
-      </E69_Death>
-    </P100i_died_in>
-  </xsl:template>
+	<xsl:template name="E74">
+		<E74_Group xmlns="http://purl.org/NET/crm-owl#"
+			rdf:about="{tei:makeID(.,'org')}">
+			<xsl:apply-templates />
+		</E74_Group>
+	</xsl:template>
 
-  <xsl:template name="E52">
-    <xsl:choose>
-      <xsl:when test="parent::residence"/>
+	<xsl:template name="E5">
+		<P11i_participated_in
+			xmlns="http://purl.org/NET/crm-owl#">
+			<E5_Event rdf:about="{tei:makeID(.,'event')}">
+				<rdf:value>
+					<xsl:value-of select="." />
+				</rdf:value>
+				<xsl:apply-templates />
+			</E5_Event>
+		</P11i_participated_in>
+	</xsl:template>
 
-      <xsl:when test="parent::creation"/>
+	<xsl:template name="E47">
+		<P87_is_identified_by
+			xmlns="http://purl.org/NET/crm-owl#">
+			<E47_Place_Spatial_Coordinates
+				rdf:about="{tei:makeID(.,'placecoords')}">
+				<rdf:value>
+					<xsl:value-of select="." />
+				</rdf:value>
+			</E47_Place_Spatial_Coordinates>
+		</P87_is_identified_by>
+	</xsl:template>
 
-      <xsl:when test="parent::p"/>
+	<xsl:template name="E69">
+		<P100i_died_in xmlns="http://purl.org/NET/crm-owl#">
+			<E69_Death>
+				<P4_has_time-span>
+					<E52_Time-Span>
+						<P82_at_some_time_within>
+							<E61_Time_Primitive>
+								<xsl:call-template name="calc-date-value" />
+							</E61_Time_Primitive>
+						</P82_at_some_time_within>
+					</E52_Time-Span>
+				</P4_has_time-span>
+			</E69_Death>
+		</P100i_died_in>
+	</xsl:template>
 
-      <xsl:otherwise>
-	<P4_has_time-span  xmlns="http://purl.org/NET/crm-owl#" >
-	  <E52_Time-Span>
-	    <P82_at_some_time_within>
-	      <E61_Time_Primitive>
-		<xsl:call-template name="calc-date-value"/>
-	      </E61_Time_Primitive>
-	    </P82_at_some_time_within>
-	  </E52_Time-Span>
-	</P4_has_time-span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="E52">
+		<xsl:choose>
+			<xsl:when test="parent::residence" />
 
-  <xsl:template name="E67">
-    <P98i_was_born  xmlns="http://purl.org/NET/crm-owl#" >
-      <E67_Birth>
-	<P4_has_time-span>
-	  <E52_Time-Span>
-	    <P82_at_some_time_within>
-	      <E61_Time_Primitive>
-		<xsl:call-template name="calc-date-value"/>
-	      </E61_Time_Primitive>
-	    </P82_at_some_time_within>
-	  </E52_Time-Span>
-	</P4_has_time-span>
-	<xsl:choose>
-	  <xsl:when test="placeName">
-	    <P7_took_place_at>
-	      <E53_Place rdf:about="{tei:makeID(.,'place')}">
-		<P87_is_identified_by>
-		  <xsl:copy-of select="@xml:lang"/>
-		  <E48_Place_Name rdf:about="{tei:makeID(.,'placename')}">
-		    <rdf:value>
-		      <xsl:value-of select="normalize-space(.)"/>
-		    </rdf:value>
-		  </E48_Place_Name>
-		</P87_is_identified_by>
-	      </E53_Place>
-	    </P7_took_place_at>
-	  </xsl:when>
-	</xsl:choose>
-      </E67_Birth>
-    </P98i_was_born>
-  </xsl:template>
+			<xsl:when test="parent::creation" />
 
-  <xsl:template name="E82">
-    <xsl:choose>
-      <xsl:when test="parent::change"/>
-      <xsl:when test="parent::person">
-	<P131_is_identified_by  xmlns="http://purl.org/NET/crm-owl#" >
-	  <xsl:copy-of select="@xml:lang"/>
-	  <E82_Actor_Appellation  rdf:about="{tei:makeID(.,'persname')}">
-	    <rdf:value>
-	      <xsl:value-of select="normalize-space(.)"/>
-	    </rdf:value>
-	  </E82_Actor_Appellation>
-	</P131_is_identified_by>
-      </xsl:when>
-      <xsl:when test="self::name or ancestor::event or ancestor::ab[@type='dDay']">
-	<P11_had_participant>
-	  <xsl:choose>
-	    <xsl:when test="@ref">
-	      <xsl:attribute name="rdf:resource" select="resolve-uri(@ref,base-uri(ancestor::tei:TEI))"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <E21_Person rdf:about="{tei:makeID(.,'person')}">
-		<P131_is_identified_by>
-		  <E82_Actor_Appellation rdf:about="{tei:makeID(.,'persname')}">
-		    <rdf:value>
-		      <xsl:value-of select="normalize-space(.)"/>
-		    </rdf:value>
-		  </E82_Actor_Appellation>
-		</P131_is_identified_by>
-	      </E21_Person>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</P11_had_participant>
-      </xsl:when>
+			<xsl:when test="parent::p" />
 
-      <xsl:when test="parent::label"/>
-      <xsl:when test="parent::desc"/>
-      <xsl:when test="not(@ref)">
-	<E21_Person rdf:about="{tei:makeID(.,'person')}">
-	  <P131_is_identified_by>
-	    <xsl:copy-of select="@xml:lang"/>
-	    <E82_Actor_Appellation  rdf:about="{tei:makeID(.,'persname')}">
-	      <rdf:value>
-		<xsl:value-of select="normalize-space(.)"/>
-	      </rdf:value>
-	    </E82_Actor_Appellation>
-	  </P131_is_identified_by>
-	</E21_Person>
-      </xsl:when>
-      <xsl:when test="generate-id(.) = generate-id(key('persons',@ref)[1])">
-	<E21_Person rdf:about="{tei:makeID(.,'person')}">
-	  <P131_is_identified_by>
-	    <xsl:copy-of select="@xml:lang"/>
-	    <E82_Actor_Appellation  rdf:about="{tei:makeID(.,'persname')}">
-	      <rdf:value>
-		<xsl:value-of select="normalize-space(.)"/>
-	      </rdf:value>
-	    </E82_Actor_Appellation>
-	  </P131_is_identified_by>
-	</E21_Person>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+			<xsl:otherwise>
+				<P4_has_time-span
+					xmlns="http://purl.org/NET/crm-owl#">
+					<E52_Time-Span>
+						<P82_at_some_time_within>
+							<E61_Time_Primitive>
+								<xsl:call-template name="calc-date-value" />
+							</E61_Time_Primitive>
+						</P82_at_some_time_within>
+					</E52_Time-Span>
+				</P4_has_time-span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="E48">
-    <xsl:choose>
-      <xsl:when test=".=''"/>
-      <xsl:when test="parent::label"/>
-      <xsl:when test="parent::desc"/>
-      <xsl:when test="parent::tei:location"/>
-      <xsl:when test="parent::place">
-	<P87_is_identified_by  xmlns="http://purl.org/NET/crm-owl#" >
-	  <xsl:copy-of select="@xml:lang"/>
-	  <E48_Place_Name rdf:about="{tei:makeID(.,'placename')}">
-	    <rdf:value>
-	      <xsl:value-of select="normalize-space(.)"/>
-	    </rdf:value>
-	  </E48_Place_Name>
-	</P87_is_identified_by>
-      </xsl:when>
-      <xsl:when test="district|settlement|region|country|bloc">
-	<xsl:call-template name="placeHierarchy">
-	  <xsl:with-param name="next">district</xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:when test="self::name or ancestor::event  or ancestor::ab[@type='dDay']">
-	<P7_took_place_at  xmlns="http://purl.org/NET/crm-owl#" >
-	  <xsl:choose>
-	    <xsl:when test="@ref">
-	      <xsl:attribute name="rdf:resource" select="resolve-uri(@ref,base-uri(ancestor::tei:TEI))"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <E53_Place rdf:about="{tei:makeID(.,'place')}"  xmlns="http://purl.org/NET/crm-owl#" >
-		<P87_is_identified_by>
-		  <xsl:copy-of select="@xml:lang"/>
-		  <E48_Place_Name rdf:about="{tei:makeID(.,'placename')}">
-		    <rdf:value>
-		      <xsl:value-of select="normalize-space(.)"/>
-		    </rdf:value>
-		  </E48_Place_Name>
-		</P87_is_identified_by>
-	      </E53_Place>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</P7_took_place_at>
-      </xsl:when>
-      <xsl:otherwise>
-	<E53_Place rdf:about="{tei:makeID(.,'place')}"  xmlns="http://purl.org/NET/crm-owl#" >
-	  <P87_is_identified_by>
-	    <xsl:copy-of select="@xml:lang"/>
-	    <E48_Place_Name rdf:about="{tei:makeID(.,'placename')}">
-	      <rdf:value>
-		<xsl:value-of select="normalize-space(.)"/>
-	      </rdf:value>
-	    </E48_Place_Name>
-	  </P87_is_identified_by>
-	</E53_Place>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="E67">
+		<P98i_was_born xmlns="http://purl.org/NET/crm-owl#">
+			<E67_Birth>
+				<P4_has_time-span>
+					<E52_Time-Span>
+						<P82_at_some_time_within>
+							<E61_Time_Primitive>
+								<xsl:call-template name="calc-date-value" />
+							</E61_Time_Primitive>
+						</P82_at_some_time_within>
+					</E52_Time-Span>
+				</P4_has_time-span>
+				<xsl:choose>
+					<xsl:when test="placeName">
+						<P7_took_place_at>
+							<E53_Place rdf:about="{tei:makeID(.,'place')}">
+								<P87_is_identified_by>
+									<xsl:copy-of select="@xml:lang" />
+									<E48_Place_Name
+										rdf:about="{tei:makeID(.,'placename')}">
+										<rdf:value>
+											<xsl:value-of select="normalize-space(.)" />
+										</rdf:value>
+									</E48_Place_Name>
+								</P87_is_identified_by>
+							</E53_Place>
+						</P7_took_place_at>
+					</xsl:when>
+				</xsl:choose>
+			</E67_Birth>
+		</P98i_was_born>
+	</xsl:template>
 
-  <xsl:template name="placeHierarchy">
-    <xsl:param name="next"/>
-    <xsl:if test="*[local-name()=$next]">
-      <xsl:for-each select="*[local-name()=$next][1]">
-	<E53_Place rdf:about="{tei:makeID(.,'place')}"  xmlns="http://purl.org/NET/crm-owl#" >
-	  <P2_has_type rdf:resource="http://www.tei-c.org/type/place/{$next}"/>
-	  <P87_is_identified_by>
-	    <xsl:copy-of select="@xml:lang"/>
-	    <E48_Place_Name rdf:about="{tei:makeID(.,'placename')}">
-	      <rdf:value>
-		<xsl:value-of select="normalize-space(.)"/>
-	      </rdf:value>
-	    </E48_Place_Name>
-	  </P87_is_identified_by>
-	  <xsl:choose>
-	    <xsl:when test="$next='district'">
-	      <xsl:call-template name="placeParent">
-		<xsl:with-param name="next">settlement</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:when>
-	    <xsl:when test="$next='settlement'">
-	      <xsl:call-template name="placeParent">
-		<xsl:with-param name="next">region</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:when>
-	    <xsl:when test="$next='region'">
-	      <xsl:call-template name="placeParent">
-		<xsl:with-param name="next">country</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:when>
-	    <xsl:when test="$next='country'">
-	      <xsl:call-template name="placeParent">
-		<xsl:with-param name="next">bloc</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:when>
-	  </xsl:choose>
-	</E53_Place>
-      </xsl:for-each>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="$next='district'">
-	<xsl:call-template name="placeHierarchy">
-	  <xsl:with-param name="next">settlement</xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$next='settlement'">
-	<xsl:call-template name="placeHierarchy">
-	  <xsl:with-param name="next">region</xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$next='region'">
-	<xsl:call-template name="placeHierarchy">
-	  <xsl:with-param name="next">country</xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$next='country'">
-	<xsl:call-template name="placeHierarchy">
-	  <xsl:with-param name="next">bloc</xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="E82">
+		<xsl:choose>
+			<xsl:when test="parent::change" />
+			<xsl:when test="parent::person">
+				<P131_is_identified_by
+					xmlns="http://purl.org/NET/crm-owl#">
+					<xsl:copy-of select="@xml:lang" />
+					<E82_Actor_Appellation
+						rdf:about="{tei:makeID(.,'persname')}">
+						<rdf:value>
+							<xsl:value-of select="normalize-space(.)" />
+						</rdf:value>
+					</E82_Actor_Appellation>
+				</P131_is_identified_by>
+			</xsl:when>
+			<xsl:when
+				test="self::name or ancestor::event or ancestor::ab[@type='dDay']">
+				<P11_had_participant>
+					<xsl:choose>
+						<xsl:when test="@ref">
+							<xsl:attribute name="rdf:resource"
+								select="resolve-uri(@ref,base-uri(ancestor::tei:TEI))" />
+						</xsl:when>
+						<xsl:otherwise>
+							<E21_Person rdf:about="{tei:makeID(.,'person')}">
+								<P131_is_identified_by>
+									<E82_Actor_Appellation
+										rdf:about="{tei:makeID(.,'persname')}">
+										<rdf:value>
+											<xsl:value-of select="normalize-space(.)" />
+										</rdf:value>
+									</E82_Actor_Appellation>
+								</P131_is_identified_by>
+							</E21_Person>
+						</xsl:otherwise>
+					</xsl:choose>
+				</P11_had_participant>
+			</xsl:when>
 
-  <xsl:template name="placeParent">
-    <xsl:param name="next"/>
-    <xsl:if test="parent::*/*[local-name()=$next]">
-      <P89_falls_within
-	  rdf:resource="{tei:makeID(parent::*/*[local-name()=$next],'place')}"  xmlns="http://purl.org/NET/crm-owl#" />
-    </xsl:if>
-</xsl:template>
-	      
-  <xsl:template name="P74">
-    <P74_has_current_or_former_residence  xmlns="http://purl.org/NET/crm-owl#" >
-      <xsl:choose>
-	<xsl:when test="placeName">
-	  <xsl:apply-templates/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <E53_Place rdf:about="{tei:makeID(.,'place')}">
-	    <P87_is_identified_by>
-	      <xsl:copy-of select="@xml:lang"/>
-	      <E48_Place_Name rdf:about="{tei:makeID(.,'placename')}">
-		<rdf:value>
-		  <xsl:value-of select="normalize-space(.)"/>
-		</rdf:value>
-	      </E48_Place_Name>
-	    </P87_is_identified_by>
-	  </E53_Place>
-	</xsl:otherwise>
-      </xsl:choose>
-    </P74_has_current_or_former_residence>
-  </xsl:template>
+			<xsl:when test="parent::label" />
+			<xsl:when test="parent::desc" />
+			<xsl:when test="not(@ref)">
+				<E21_Person rdf:about="{tei:makeID(.,'person')}">
+					<P131_is_identified_by>
+						<xsl:copy-of select="@xml:lang" />
+						<E82_Actor_Appellation
+							rdf:about="{tei:makeID(.,'persname')}">
+							<rdf:value>
+								<xsl:value-of select="normalize-space(.)" />
+							</rdf:value>
+						</E82_Actor_Appellation>
+					</P131_is_identified_by>
+				</E21_Person>
+			</xsl:when>
+			<xsl:when
+				test="generate-id(.) = generate-id(key('persons',@ref)[1])">
+				<E21_Person rdf:about="{tei:makeID(.,'person')}">
+					<P131_is_identified_by>
+						<xsl:copy-of select="@xml:lang" />
+						<E82_Actor_Appellation
+							rdf:about="{tei:makeID(.,'persname')}">
+							<rdf:value>
+								<xsl:value-of select="normalize-space(.)" />
+							</rdf:value>
+						</E82_Actor_Appellation>
+					</P131_is_identified_by>
+				</E21_Person>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="E35">
-    <xsl:choose>
-      <xsl:when test="ancestor::biblFull or ancestor::bibl"/>
-      <xsl:when test="parent::p"/>
-      <xsl:otherwise>
-	<P102_has_title  xmlns="http://purl.org/NET/crm-owl#" >
-	  <E35_Title>
-	    <rdf:value>
-	      <xsl:value-of select="normalize-space(.)"/>
-	    </rdf:value>
-	  </E35_Title>
-	</P102_has_title>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="E48">
+		<xsl:choose>
+			<xsl:when test=".=''" />
+			<xsl:when test="parent::label" />
+			<xsl:when test="parent::desc" />
+			<xsl:when test="parent::tei:location" />
+			<xsl:when test="parent::place">
+				<P87_is_identified_by
+					xmlns="http://purl.org/NET/crm-owl#">
+					<xsl:copy-of select="@xml:lang" />
+					<E48_Place_Name
+						rdf:about="{tei:makeID(.,'placename')}">
+						<rdf:value>
+							<xsl:value-of select="normalize-space(.)" />
+						</rdf:value>
+					</E48_Place_Name>
+				</P87_is_identified_by>
+			</xsl:when>
+			<xsl:when test="district|settlement|region|country|bloc">
+				<xsl:call-template name="placeHierarchy">
+					<xsl:with-param name="next">
+						district
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when
+				test="self::name or ancestor::event  or ancestor::ab[@type='dDay']">
+				<P7_took_place_at
+					xmlns="http://purl.org/NET/crm-owl#">
+					<xsl:choose>
+						<xsl:when test="@ref">
+							<xsl:attribute name="rdf:resource"
+								select="resolve-uri(@ref,base-uri(ancestor::tei:TEI))" />
+						</xsl:when>
+						<xsl:otherwise>
+							<E53_Place rdf:about="{tei:makeID(.,'place')}"
+								xmlns="http://purl.org/NET/crm-owl#">
+								<P87_is_identified_by>
+									<xsl:copy-of select="@xml:lang" />
+									<E48_Place_Name
+										rdf:about="{tei:makeID(.,'placename')}">
+										<rdf:value>
+											<xsl:value-of select="normalize-space(.)" />
+										</rdf:value>
+									</E48_Place_Name>
+								</P87_is_identified_by>
+							</E53_Place>
+						</xsl:otherwise>
+					</xsl:choose>
+				</P7_took_place_at>
+			</xsl:when>
+			<xsl:otherwise>
+				<E53_Place rdf:about="{tei:makeID(.,'place')}"
+					xmlns="http://purl.org/NET/crm-owl#">
+					<P87_is_identified_by>
+						<xsl:copy-of select="@xml:lang" />
+						<E48_Place_Name
+							rdf:about="{tei:makeID(.,'placename')}">
+							<rdf:value>
+								<xsl:value-of select="normalize-space(.)" />
+							</rdf:value>
+						</E48_Place_Name>
+					</P87_is_identified_by>
+				</E53_Place>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="E65">
-    <xsl:if test="not(ancestor::biblFull or ancestor::bibl)">
-    <P94i_was_created_by  xmlns="http://purl.org/NET/crm-owl#" >
-      <E65_Creation>
-	<P11_had_participant>
-	  <E21_Person rdf:about="{tei:makeID(.,'person')}">
-	    <P131_is_identified_by>
-	      <E82_Actor_Appellation rdf:about="{tei:makeID(.,'persname')}">
+	<xsl:template name="placeHierarchy">
+		<xsl:param name="next" />
+		<xsl:if test="*[local-name()=$next]">
+			<xsl:for-each select="*[local-name()=$next][1]">
+				<E53_Place rdf:about="{tei:makeID(.,'place')}"
+					xmlns="http://purl.org/NET/crm-owl#">
+					<P2_has_type
+						rdf:resource="http://www.tei-c.org/type/place/{$next}" />
+					<P87_is_identified_by>
+						<xsl:copy-of select="@xml:lang" />
+						<E48_Place_Name
+							rdf:about="{tei:makeID(.,'placename')}">
+							<rdf:value>
+								<xsl:value-of select="normalize-space(.)" />
+							</rdf:value>
+						</E48_Place_Name>
+					</P87_is_identified_by>
+					<xsl:choose>
+						<xsl:when test="$next='district'">
+							<xsl:call-template name="placeParent">
+								<xsl:with-param name="next">
+									settlement
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:when test="$next='settlement'">
+							<xsl:call-template name="placeParent">
+								<xsl:with-param name="next">
+									region
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:when test="$next='region'">
+							<xsl:call-template name="placeParent">
+								<xsl:with-param name="next">
+									country
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:when test="$next='country'">
+							<xsl:call-template name="placeParent">
+								<xsl:with-param name="next">
+									bloc
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:when>
+					</xsl:choose>
+				</E53_Place>
+			</xsl:for-each>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="$next='district'">
+				<xsl:call-template name="placeHierarchy">
+					<xsl:with-param name="next">
+						settlement
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$next='settlement'">
+				<xsl:call-template name="placeHierarchy">
+					<xsl:with-param name="next">
+						region
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$next='region'">
+				<xsl:call-template name="placeHierarchy">
+					<xsl:with-param name="next">
+						country
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$next='country'">
+				<xsl:call-template name="placeHierarchy">
+					<xsl:with-param name="next">
+						bloc
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="placeParent">
+		<xsl:param name="next" />
+		<xsl:if test="parent::*/*[local-name()=$next]">
+			<P89_falls_within
+				rdf:resource="{tei:makeID(parent::*/*[local-name()=$next],'place')}"
+				xmlns="http://purl.org/NET/crm-owl#" />
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template name="P74">
+		<P74_has_current_or_former_residence
+			xmlns="http://purl.org/NET/crm-owl#">
+			<xsl:choose>
+				<xsl:when test="placeName">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<E53_Place rdf:about="{tei:makeID(.,'place')}">
+						<P87_is_identified_by>
+							<xsl:copy-of select="@xml:lang" />
+							<E48_Place_Name
+								rdf:about="{tei:makeID(.,'placename')}">
+								<rdf:value>
+									<xsl:value-of select="normalize-space(.)" />
+								</rdf:value>
+							</E48_Place_Name>
+						</P87_is_identified_by>
+					</E53_Place>
+				</xsl:otherwise>
+			</xsl:choose>
+		</P74_has_current_or_former_residence>
+	</xsl:template>
+
+	<xsl:template name="E35">
+		<xsl:choose>
+			<xsl:when test="ancestor::biblFull or ancestor::bibl" />
+			<xsl:when test="parent::p" />
+			<xsl:otherwise>
+				<P102_has_title xmlns="http://purl.org/NET/crm-owl#">
+					<E35_Title>
+						<rdf:value>
+							<xsl:value-of select="normalize-space(.)" />
+						</rdf:value>
+					</E35_Title>
+				</P102_has_title>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="E65">
+		<xsl:if test="not(ancestor::biblFull or ancestor::bibl)">
+			<P94i_was_created_by
+				xmlns="http://purl.org/NET/crm-owl#">
+				<E65_Creation>
+					<P11_had_participant>
+						<E21_Person rdf:about="{tei:makeID(.,'person')}">
+							<P131_is_identified_by>
+								<E82_Actor_Appellation
+									rdf:about="{tei:makeID(.,'persname')}">
+									<rdf:value>
+										<xsl:value-of select="normalize-space(.)" />
+									</rdf:value>
+								</E82_Actor_Appellation>
+							</P131_is_identified_by>
+						</E21_Person>
+					</P11_had_participant>
+				</E65_Creation>
+			</P94i_was_created_by>
+		</xsl:if>
+	</xsl:template>
+
+	<!-- general templates -->
+
+	<xsl:template name="calc-date-value">
 		<rdf:value>
-		  <xsl:value-of select="normalize-space(.)"/>
+			<xsl:choose>
+				<xsl:when test="@when">
+					<xsl:value-of select="@when" />
+				</xsl:when>
+				<xsl:when test="@notBefore and @notAfter">
+					<xsl:value-of select="@notBefore" />
+					<xsl:text> to  </xsl:text>
+					<xsl:value-of select="@notAfter" />
+				</xsl:when>
+				<xsl:when test="@notBefore">
+					<xsl:value-of select="@notBefore" />
+					<xsl:text> to </xsl:text>
+				</xsl:when>
+				<xsl:when test="@notAfter">
+					<xsl:text> to </xsl:text>
+					<xsl:value-of select="@notAfter" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:otherwise>
+			</xsl:choose>
 		</rdf:value>
-	      </E82_Actor_Appellation>
-	    </P131_is_identified_by>
-	  </E21_Person>
-	</P11_had_participant>
-      </E65_Creation>
-    </P94i_was_created_by>
-    </xsl:if>
-  </xsl:template>
-  
-  <!-- general templates -->
+	</xsl:template>
 
-  <xsl:template name="calc-date-value">
-    <rdf:value>
-      <xsl:choose>
-        <xsl:when test="@when">
-          <xsl:value-of select="@when"/>
-        </xsl:when>
-        <xsl:when test="@notBefore and @notAfter">
-          <xsl:value-of select="@notBefore"/>
-          <xsl:text> to  </xsl:text>
-          <xsl:value-of select="@notAfter"/>
-        </xsl:when>
-        <xsl:when test="@notBefore">
-          <xsl:value-of select="@notBefore"/>
-          <xsl:text> to </xsl:text>
-        </xsl:when>
-        <xsl:when test="@notAfter">
-          <xsl:text> to </xsl:text>
-          <xsl:value-of select="@notAfter"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="normalize-space(.)"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </rdf:value>
-  </xsl:template>
-
-  <xsl:function name="tei:makeID" as="xs:string*">
-    <xsl:param name="here"/>
-    <xsl:param name="type"/>
-    <xsl:for-each select="$here">
-      <xsl:variable name="baseid">
-	<xsl:choose>
-	  <xsl:when
-	      test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[starts-with(.,'http')]">
-	    <xsl:value-of 
-		select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[starts-with(.,'http')][1]"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:choose>
-	      <xsl:when test="ancestor-or-self::*/@xml:base">
-		<xsl:value-of select="ancestor-or-self::*[@xml:base][1]/@xml:base"/>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:text>http://www.example.com</xsl:text>
-	      </xsl:otherwise>
-	    </xsl:choose>
-	    <xsl:choose>
-	      <xsl:when test="@xml:id">
-		<xsl:value-of select="@xml:id"/>
-	      </xsl:when>
-	      <xsl:when
-		  test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno">
-		<xsl:value-of select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[1]"/>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:number level="any"/>
-	      </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="baseurl">
-	<xsl:choose>
-	  <xsl:when
-	      test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[contains(.,'/id/')]">
-	    <xsl:analyze-string
-		select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[contains(.,'/id/')][1]"
-		regex="(.*)/id/[^/]+">
-	      <xsl:matching-substring>
-		<xsl:value-of select="regex-group(1)"/>
-	      </xsl:matching-substring>
-	      <xsl:non-matching-substring>
-		<xsl:value-of select="regex-group(0)"/>
-	      </xsl:non-matching-substring>
-	    </xsl:analyze-string>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:choose>
-	      <xsl:when test="ancestor-or-self::*/@xml:base">
-		<xsl:value-of select="ancestor-or-self::*[@xml:base][1]/@xml:base"/>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:text>http://www.example.com</xsl:text>
-	      </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-	<xsl:when test="$type='id'">
-	  <xsl:value-of select="$baseid"/>
-	</xsl:when>	
-	<xsl:when test="$type='place' and @ref">
-	  <xsl:value-of select="resolve-uri(@ref,base-uri(ancestor::tei:TEI))"/>
-	</xsl:when>
-	<xsl:when test="$type='person' and @ref">
-	  <xsl:value-of select="resolve-uri(@ref,base-uri(ancestor::tei:TEI))"/>
-	</xsl:when>
-	<xsl:when test="$type='place' and placeName[@ref]">
-	  <xsl:value-of select="placeName/resolve-uri(@ref,base-uri(ancestor::tei:TEI))"/>
-	</xsl:when>
-	<xsl:when test="$type='place' and key('Places',.)">
-	  <xsl:value-of select="tei:makeID(key('Places',.)[1],'place')"/>
-	</xsl:when>
-	<xsl:when test="$type='placename' and key('Places',.)">
-	  <xsl:value-of select="tei:makeID(key('Places',.)[1],'placename')"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:variable name="composite">
-	    <xsl:value-of select="$baseurl"/>
-	    <xsl:text>/</xsl:text>
-	    <xsl:value-of select="$type"/>
-	    <xsl:text>/</xsl:text>
-	    <xsl:choose>
-	      <xsl:when test="@xml:id">
-		<xsl:value-of select="@xml:id"/>
-	      </xsl:when>
-	      <xsl:when test="placeName[@key]">
-		<xsl:value-of select="placeName/@key"/>
-	      </xsl:when>
-	      <xsl:when test="self::placeName and
+	<xsl:function name="tei:makeID" as="xs:string*">
+		<xsl:param name="here" />
+		<xsl:param name="type" />
+		<xsl:for-each select="$here">
+			<xsl:variable name="baseid">
+				<xsl:choose>
+					<xsl:when
+						test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[starts-with(.,'http')]">
+						<xsl:value-of
+							select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[starts-with(.,'http')][1]" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:choose>
+							<xsl:when test="ancestor-or-self::*/@xml:base">
+								<xsl:value-of
+									select="ancestor-or-self::*[@xml:base][1]/@xml:base" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>http://www.example.com</xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when test="@xml:id">
+								<xsl:value-of select="@xml:id" />
+							</xsl:when>
+							<xsl:when
+								test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno">
+								<xsl:value-of
+									select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[1]" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:number level="any" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:variable name="baseurl">
+				<xsl:choose>
+					<xsl:when
+						test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[contains(.,'/id/')]">
+						<xsl:analyze-string
+							select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[contains(.,'/id/')][1]"
+							regex="(.*)/id/[^/]+">
+							<xsl:matching-substring>
+								<xsl:value-of select="regex-group(1)" />
+							</xsl:matching-substring>
+							<xsl:non-matching-substring>
+								<xsl:value-of select="regex-group(0)" />
+							</xsl:non-matching-substring>
+						</xsl:analyze-string>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:choose>
+							<xsl:when test="ancestor-or-self::*/@xml:base">
+								<xsl:value-of
+									select="ancestor-or-self::*[@xml:base][1]/@xml:base" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>http://www.example.com</xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when test="$type='id'">
+					<xsl:value-of select="$baseid" />
+				</xsl:when>
+				<xsl:when test="$type='place' and @ref">
+					<xsl:value-of
+						select="resolve-uri(@ref,base-uri(ancestor::tei:TEI))" />
+				</xsl:when>
+				<xsl:when test="$type='person' and @ref">
+					<xsl:value-of
+						select="resolve-uri(@ref,base-uri(ancestor::tei:TEI))" />
+				</xsl:when>
+				<xsl:when test="$type='place' and placeName[@ref]">
+					<xsl:value-of
+						select="placeName/resolve-uri(@ref,base-uri(ancestor::tei:TEI))" />
+				</xsl:when>
+				<xsl:when test="$type='place' and key('Places',.)">
+					<xsl:value-of
+						select="tei:makeID(key('Places',.)[1],'place')" />
+				</xsl:when>
+				<xsl:when test="$type='placename' and key('Places',.)">
+					<xsl:value-of
+						select="tei:makeID(key('Places',.)[1],'placename')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="composite">
+						<xsl:value-of select="$baseurl" />
+						<xsl:text>/</xsl:text>
+						<xsl:value-of select="$type" />
+						<xsl:text>/</xsl:text>
+						<xsl:choose>
+							<xsl:when test="@xml:id">
+								<xsl:value-of select="@xml:id" />
+							</xsl:when>
+							<xsl:when test="placeName[@key]">
+								<xsl:value-of select="placeName/@key" />
+							</xsl:when>
+							<xsl:when
+								test="self::placeName and
 			      parent::place[@xml:id]">
-		<xsl:value-of select="parent::place/@xml:id"/>
-	      </xsl:when>
-	      <xsl:when test="self::persName and
+								<xsl:value-of select="parent::place/@xml:id" />
+							</xsl:when>
+							<xsl:when
+								test="self::persName and
 			      parent::person[@xml:id]">
-		<xsl:value-of select="parent::person/@xml:id"/>
-	      </xsl:when>
-	      <xsl:when test="self::placeName|self::persName|self::district|self::settlement|self::region|self::country|self::bloc">
-		<xsl:value-of select="replace(lower-case(normalize-space(.)),'[^A-z]','')"/>
-	      </xsl:when>
-	      <xsl:when test="self::author">
-		<xsl:value-of select="replace(lower-case(normalize-space(.)),'[^A-z]','')"/>
-	      </xsl:when>
-	      <xsl:when test="persName|placeName">
-		<xsl:value-of select="replace(lower-case(normalize-space((persName|placeName)[1])),'[^A-z]','')"/>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:value-of select="generate-id()"/>
-	      </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:variable>
-	  <xsl:value-of select="$composite"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:function>
+								<xsl:value-of select="parent::person/@xml:id" />
+							</xsl:when>
+							<xsl:when
+								test="self::placeName|self::persName|self::district|self::settlement|self::region|self::country|self::bloc">
+								<xsl:value-of
+									select="replace(lower-case(normalize-space(.)),'[^A-z]','')" />
+							</xsl:when>
+							<xsl:when test="self::author">
+								<xsl:value-of
+									select="replace(lower-case(normalize-space(.)),'[^A-z]','')" />
+							</xsl:when>
+							<xsl:when test="persName|placeName">
+								<xsl:value-of
+									select="replace(lower-case(normalize-space((persName|placeName)[1])),'[^A-z]','')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="generate-id()" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:value-of select="$composite" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
 
 
-  
 
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/make-acdc.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/make-acdc.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/make-acdc.xsl	(revision 2397)
@@ -1,86 +1,97 @@
 <XSL:stylesheet
-    xpath-default-namespace="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/TransformAlias" 
-    xmlns:XSL="http://www.w3.org/1999/XSL/Transform" 
-    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
-    exclude-result-prefixes="rdf"
-    version="2.0"
->
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/TransformAlias"
+	xmlns:XSL="http://www.w3.org/1999/XSL/Transform"
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	exclude-result-prefixes="rdf" version="2.0">
 
-  <XSL:import href="../common2/odds.xsl"/>
-  <XSL:import href="../common2/i18n.xsl"/>
+	<XSL:import href="../common2/odds.xsl" />
+	<XSL:import href="../common2/i18n.xsl" />
 
-  <XSL:key name="EQUIVFILES" match="equiv" use="@filter"/>
-  <XSL:key name="MEMBERS" match="elementSpec" use="classes/memberOf/@key"/>
-  <XSL:output method="xml" indent="yes" encoding="utf-8"/>
-  <XSL:key name="NS" match="elementSpec|attDef" use="@ns"/>
-  <XSL:param name="useFixedDate">false</XSL:param>
-  
-  <XSL:namespace-alias stylesheet-prefix="xsl" result-prefix="XSL"/>
+	<XSL:key name="EQUIVFILES" match="equiv" use="@filter" />
+	<XSL:key name="MEMBERS" match="elementSpec"
+		use="classes/memberOf/@key" />
+	<XSL:output method="xml" indent="yes" encoding="utf-8" />
+	<XSL:key name="NS" match="elementSpec|attDef" use="@ns" />
+	<XSL:param name="useFixedDate">
+		false
+	</XSL:param>
 
-  <XSL:template name="generateDoc">
-    <XSL:choose>
-      <XSL:when test="string-length($doclang)&gt;0">
-        <XSL:value-of select="$doclang"/>
-      </XSL:when>
-      <XSL:otherwise>
-        <XSL:text>en</XSL:text>
-      </XSL:otherwise>
-    </XSL:choose>
-  </XSL:template>
-  <XSL:template name="bitOut">
-    <XSL:param name="grammar">true</XSL:param>
-    <XSL:param name="content"/>
-    <XSL:copy-of select="$content"/>
-  </XSL:template>
-  
-  <XSL:template match="/">
-  
+	<XSL:namespace-alias stylesheet-prefix="xsl"
+		result-prefix="XSL" />
 
-  <xsl:stylesheet version="2.0"
-		  xpath-default-namespace="http://www.tei-c.org/ns/1.0"
-		  xmlns:XSL="http://www.w3.org/1999/XSL/Transform">
+	<XSL:template name="generateDoc">
+		<XSL:choose>
+			<XSL:when test="string-length($doclang)&gt;0">
+				<XSL:value-of select="$doclang" />
+			</XSL:when>
+			<XSL:otherwise>
+				<XSL:text>en</XSL:text>
+			</XSL:otherwise>
+		</XSL:choose>
+	</XSL:template>
+	<XSL:template name="bitOut">
+		<XSL:param name="grammar">
+			true
+		</XSL:param>
+		<XSL:param name="content" />
+		<XSL:copy-of select="$content" />
+	</XSL:template>
 
-    <xsl:import href="../tools/getfiles.xsl"/>
+	<XSL:template match="/">
 
-    <XSL:for-each select="distinct-values(//equiv/@filter)">
-	<xsl:import href="{.}"/>  
-    </XSL:for-each>
-    
-    <xsl:param name="corpus">./</xsl:param>
- 
-    <xsl:template match="*">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:template>
-   
-    <xsl:template match="text()|comment()|@*|processing-instruction()"/>
 
-    <XSL:for-each select="//equiv[@filter]">
-      <xsl:template>
-	<XSL:variable name="f" select="@filter"/>
-	<XSL:attribute name="match">
-	  <XSL:value-of select="ancestor::elementSpec/@ident"/>
+		<xsl:stylesheet version="2.0"
+			xpath-default-namespace="http://www.tei-c.org/ns/1.0"
+			xmlns:XSL="http://www.w3.org/1999/XSL/Transform">
+
+			<xsl:import href="../tools/getfiles.xsl" />
+
+			<XSL:for-each select="distinct-values(//equiv/@filter)">
+				<xsl:import href="{.}" />
+			</XSL:for-each>
+
+			<xsl:param name="corpus">./</xsl:param>
+
+			<xsl:template match="*">
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()" />
+			</xsl:template>
+
+			<xsl:template
+				match="text()|comment()|@*|processing-instruction()" />
+
+			<XSL:for-each select="//equiv[@filter]">
+				<xsl:template>
+					<XSL:variable name="f" select="@filter" />
+					<XSL:attribute name="match">
+	  <XSL:value-of select="ancestor::elementSpec/@ident" />
 	</XSL:attribute>
-	<xsl:call-template name="{@name}"/>
-      </xsl:template>
-    </XSL:for-each>
+					<xsl:call-template name="{@name}" />
+				</xsl:template>
+			</XSL:for-each>
 
-    <xsl:template name="typology">
-      <E55_Type rdf:about="http://www.tei-c.org/type/place" xmlns="http://purl.org/NET/crm-owl#" >
-	<label xmlns="http://www.w3.org/2000/01/rdf-schema#" >place</label>
-      </E55_Type>
-      <XSL:for-each select="key('MEMBERS','model.placeNamePart')">
-	<E55_Type rdf:about="http://www.tei-c.org/type/place/{@ident}" xmlns="http://purl.org/NET/crm-owl#" >
-	<label xmlns="http://www.w3.org/2000/01/rdf-schema#" >
-	  <XSL:call-template name="makeDescription"/>
-	</label>
-	<P127_has_broader_term rdf:resource="http://www.tei-c.org/type/place"/>
-      </E55_Type>
-      </XSL:for-each>
-    </xsl:template>
-    
-  </xsl:stylesheet>
+			<xsl:template name="typology">
+				<E55_Type rdf:about="http://www.tei-c.org/type/place"
+					xmlns="http://purl.org/NET/crm-owl#">
+					<label xmlns="http://www.w3.org/2000/01/rdf-schema#">place</label>
+				</E55_Type>
+				<XSL:for-each
+					select="key('MEMBERS','model.placeNamePart')">
+					<E55_Type
+						rdf:about="http://www.tei-c.org/type/place/{@ident}"
+						xmlns="http://purl.org/NET/crm-owl#">
+						<label xmlns="http://www.w3.org/2000/01/rdf-schema#">
+							<XSL:call-template name="makeDescription" />
+						</label>
+						<P127_has_broader_term
+							rdf:resource="http://www.tei-c.org/type/place" />
+					</E55_Type>
+				</XSL:for-each>
+			</xsl:template>
 
-</XSL:template>
+		</xsl:stylesheet>
 
+	</XSL:template>
+
 </XSL:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/dc.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/dc.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/dc.xsl	(revision 2397)
@@ -1,76 +1,75 @@
 <?xml version="1.0"?>
-<xsl:stylesheet 
-    xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
-    xmlns="http://purl.org/NET/crm-owl#" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0" 
-    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
-    xmlns:owl="http://www.w3.org/2002/07/owl#" 
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    version="2.0" 
-    xpath-default-namespace="http://www.tei-c.org/ns/1.0" 
-    exclude-result-prefixes="dc tei rdf rdfs owl xsd xsl xs">
-  
-  <xsl:output encoding="utf-8" method="xml" indent="yes"/>
+<xsl:stylesheet
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns="http://purl.org/NET/crm-owl#"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="dc tei rdf rdfs owl xsd xsl xs">
 
-  <xsl:template name="dc_header">
-    <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/"
-	rdf:about="{.//idno[1]}">
-      <xsl:apply-templates/>
-    </rdf:Description>
-  </xsl:template>
+	<xsl:output encoding="utf-8" method="xml" indent="yes" />
 
-  <xsl:template name="dc_title">
-    <dc:title>
-      <xsl:value-of select="."/>
-    </dc:title>
-  </xsl:template>
-  
-  <xsl:template name="dc_creator">
-    <dc:creator>
-      <xsl:value-of select="."/>
-    </dc:creator>
-  </xsl:template>
-  
-  <xsl:template name="dc_publisher">
-    <xsl:if test="publisher">
-      <dc:publisher>
-	<xsl:value-of select="publisher"/>
-	<xsl:if test="pubPlace">
-	  <xsl:text>, </xsl:text>
-	  <xsl:value-of select="pubPlace"/>
-	</xsl:if>
-	<xsl:if test="date">
-	  <xsl:text>, </xsl:text>
-		<xsl:value-of select="date"/>
-	</xsl:if>
-      </dc:publisher>
-    </xsl:if>
-  </xsl:template>
+	<xsl:template name="dc_header">
+		<rdf:Description
+			xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="{.//idno[1]}">
+			<xsl:apply-templates />
+		</rdf:Description>
+	</xsl:template>
 
-  <xsl:template name="dc_date">
-    <dc:date>
-      <xsl:value-of select="."/>
-    </dc:date>
-  </xsl:template>
-  
-  <xsl:template name="dc_rights">
-    <dc:rights>
-      <xsl:value-of select="."/>
-    </dc:rights>
-  </xsl:template>
+	<xsl:template name="dc_title">
+		<dc:title>
+			<xsl:value-of select="." />
+		</dc:title>
+	</xsl:template>
 
-  <xsl:template name="dc_subject">
-      <dc:subject>
-	<xsl:value-of select="."/>
-      </dc:subject>
-  </xsl:template>
-  
-  <xsl:template name="dc_contributor">
-    <dc:contributor>
-      <xsl:value-of select="."/>
-    </dc:contributor>
-  </xsl:template>
+	<xsl:template name="dc_creator">
+		<dc:creator>
+			<xsl:value-of select="." />
+		</dc:creator>
+	</xsl:template>
+
+	<xsl:template name="dc_publisher">
+		<xsl:if test="publisher">
+			<dc:publisher>
+				<xsl:value-of select="publisher" />
+				<xsl:if test="pubPlace">
+					<xsl:text>, </xsl:text>
+					<xsl:value-of select="pubPlace" />
+				</xsl:if>
+				<xsl:if test="date">
+					<xsl:text>, </xsl:text>
+					<xsl:value-of select="date" />
+				</xsl:if>
+			</dc:publisher>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template name="dc_date">
+		<dc:date>
+			<xsl:value-of select="." />
+		</dc:date>
+	</xsl:template>
+
+	<xsl:template name="dc_rights">
+		<dc:rights>
+			<xsl:value-of select="." />
+		</dc:rights>
+	</xsl:template>
+
+	<xsl:template name="dc_subject">
+		<dc:subject>
+			<xsl:value-of select="." />
+		</dc:subject>
+	</xsl:template>
+
+	<xsl:template name="dc_contributor">
+		<dc:contributor>
+			<xsl:value-of select="." />
+		</dc:contributor>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/build-to.xml	(revision 2397)
@@ -1,74 +1,68 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitordf">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9319 2011-09-14 15:25:52Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into RDF files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output schema file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="odd2rdf"
-	    value="../profiles/${profile}/rdf/to.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
-  <target name="dist" depends="setup,convert,cleanup"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9319 2011-09-14 15:25:52Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into RDF files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output schema file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="odd2rdf"
+		value="../profiles/${profile}/rdf/to.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
+	<target name="dist" depends="setup,convert,cleanup" />
 
-  <target name="convert">
-    <!-- Recreate temporary output directory -->
-    <!-- The transformation for RDF output. -->
-    <echo level="info">XSLT generate RDF file</echo>
-    <xslt force="yes" style="${odd2rdf}" in="${inputFile}" out="${outputFile}" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xrdf11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
+	<target name="convert">
+		<!-- Recreate temporary output directory -->
+		<!-- The transformation for RDF output. -->
+		<echo level="info">XSLT generate RDF file</echo>
+		<xslt force="yes" style="${odd2rdf}" in="${inputFile}"
+			out="${outputFile}" classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xrdf11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/rdf.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/rdf.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/rdf.xsl	(revision 2397)
@@ -1,409 +1,382 @@
 <?xml version="1.0"?>
-<xsl:stylesheet 
-    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
-    xmlns:oo="http://purl.org/openorg/"
-    xmlns="http://purl.org/NET/crm-owl#" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0" 
-    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
-    xmlns:owl="http://www.w3.org/2002/07/owl#" 
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
-    xmlns:crm="http://purl.org/NET/crm-owl#" 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:html="http://www.w3.org/1999/xhtml"
-    version="1.0" 
-    xmlns:foaf="http://xmlns.com/foaf/0.1/"
-    xmlns:service="http://purl.org/service/"
-    xmlns:ox-service="http://vocab.ox.ac.uk/service/"
-    exclude-result-prefixes="tei rdf rdfs owl xsd crm xsl xs oo foaf
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:oo="http://purl.org/openorg/"
+	xmlns="http://purl.org/NET/crm-owl#"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+	xmlns:crm="http://purl.org/NET/crm-owl#"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:html="http://www.w3.org/1999/xhtml" version="1.0"
+	xmlns:foaf="http://xmlns.com/foaf/0.1/"
+	xmlns:service="http://purl.org/service/"
+	xmlns:ox-service="http://vocab.ox.ac.uk/service/"
+	exclude-result-prefixes="tei rdf rdfs owl xsd crm xsl xs oo foaf
     service ox-service">
 
-  <xsl:param name="REQUEST">/</xsl:param>
-  <xsl:param name="SERVER">http://www.oucs.ox.ac.uk</xsl:param>
+	<xsl:param name="REQUEST">
+		/
+	</xsl:param>
+	<xsl:param name="SERVER">
+		http://www.oucs.ox.ac.uk
+	</xsl:param>
 
-  <xsl:output encoding="utf-8" method="xml" indent="yes"/>
+	<xsl:output encoding="utf-8" method="xml" indent="yes" />
 
-  <xsl:key name="persons" match="persName" use="@ref"/>
+	<xsl:key name="persons" match="persName" use="@ref" />
 
-  <xsl:template match="/">
-    <rdf:RDF>
-      <xsl:apply-templates/>
-    </rdf:RDF>
-  </xsl:template>
+	<xsl:template match="/">
+		<rdf:RDF>
+			<xsl:apply-templates />
+		</rdf:RDF>
+	</xsl:template>
 
-  <xsl:template match="html:link[@rev|@rel]">
-    <service:Service
-	rdf:about="{@href}">
-      <xsl:if test="@rev='ox-service:serviceLevelDescription'">
-	<rdfs:label>
-	  <xsl:value-of
-	      select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title|ancestor::TEI.2/teiHeader/fileDesc/titleStmt/title"/>
-	</rdfs:label>
-	<service:maintainedBy>
-	  <foaf:Group>
-	    <xsl:attribute name="rdf:about">
-	      <xsl:value-of select="substring-before(@href,'service')"/>
+	<xsl:template match="html:link[@rev|@rel]">
+		<service:Service rdf:about="{@href}">
+			<xsl:if test="@rev='ox-service:serviceLevelDescription'">
+				<rdfs:label>
+					<xsl:value-of
+						select="ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title|ancestor::TEI.2/teiHeader/fileDesc/titleStmt/title" />
+				</rdfs:label>
+				<service:maintainedBy>
+					<foaf:Group>
+						<xsl:attribute name="rdf:about">
+	      <xsl:value-of
+							select="substring-before(@href,'service')" />
 	      <xsl:text>group</xsl:text>
-	      <xsl:value-of select="substring-after(@href,'service')"/>
+	      <xsl:value-of
+							select="substring-after(@href,'service')" />
 	    </xsl:attribute>
-	    <foaf:mbox rdf:resource="mailto:{ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:authority|ancestor::TEI.2/teiHeader/fileDesc/publicationStmt/authority}"/>
-	  </foaf:Group>
-	</service:maintainedBy>
-	<oo:contact>
-	    <xsl:attribute name="rdf:resource">
-	      <xsl:value-of select="substring-before(@href,'service')"/>
+						<foaf:mbox
+							rdf:resource="mailto:{ancestor::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:authority|ancestor::TEI.2/teiHeader/fileDesc/publicationStmt/authority}" />
+					</foaf:Group>
+				</service:maintainedBy>
+				<oo:contact>
+					<xsl:attribute name="rdf:resource">
+	      <xsl:value-of
+						select="substring-before(@href,'service')" />
 	      <xsl:text>group</xsl:text>
-	      <xsl:value-of select="substring-after(@href,'service')"/>
+	      <xsl:value-of
+						select="substring-after(@href,'service')" />
 	    </xsl:attribute>
-	</oo:contact>
+				</oo:contact>
 
-      </xsl:if>
-      <xsl:element name="{@rev|@rel}">
-	<xsl:attribute name="rdf:resource">
-	  <xsl:value-of select="$SERVER"/>
-	  <xsl:value-of select="$REQUEST"/>
+			</xsl:if>
+			<xsl:element name="{@rev|@rel}">
+				<xsl:attribute name="rdf:resource">
+	  <xsl:value-of select="$SERVER" />
+	  <xsl:value-of select="$REQUEST" />
 	</xsl:attribute>
-      </xsl:element>
+			</xsl:element>
 
 
-    </service:Service>
-  </xsl:template>
-<!--  
-  <rdf:RDF
-    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-    xmlns:foaf="http://xmlns.com/foaf/0.1/"
-    xmlns:oo="http://purl.org/openorg/"
-    xmlns:service="http://purl.org/service/"
-    xmlns:ox-service="http://vocab.ox.ac.uk/service/">
-  <service:Service rdf:about="http://data.ox.ac.uk/id/service/oucs/nexus">
-    <rdfs:label>Nexus</rdfs:label>
-    <service:provider rdf:resource="http://oxpoints.oucs.ox.ac.uk/id/23232373"/>
-    <service:maintainedBy>
-      <foaf:Group rdf:about="http://data.ox.ac.uk/id/group/nexus-team">
-        <rdfs:label>Nexus Team</rdfs:label>
-        <org:subOrganizationOf rdf:resource="http://oxpoints.oucs.ox.ac.uk/id/23232373"/>
-        <foaf:mbox rdf:resource="mailto:nexus@oucs.ox.ac.uk"/>
-      </foaf:Group>
-    </service:maintainedBy>
-    <oo:contact rdf:resource="http://data.ox.ac.uk/id/group/nexus-team"/>
+		</service:Service>
+	</xsl:template>
+	<!-- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
+		xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:oo="http://purl.org/openorg/" 
+		xmlns:service="http://purl.org/service/" xmlns:ox-service="http://vocab.ox.ac.uk/service/"> 
+		<service:Service rdf:about="http://data.ox.ac.uk/id/service/oucs/nexus"> 
+		<rdfs:label>Nexus</rdfs:label> <service:provider rdf:resource="http://oxpoints.oucs.ox.ac.uk/id/23232373"/> 
+		<service:maintainedBy> <foaf:Group rdf:about="http://data.ox.ac.uk/id/group/nexus-team"> 
+		<rdfs:label>Nexus Team</rdfs:label> <org:subOrganizationOf rdf:resource="http://oxpoints.oucs.ox.ac.uk/id/23232373"/> 
+		<foaf:mbox rdf:resource="mailto:nexus@oucs.ox.ac.uk"/> </foaf:Group> </service:maintainedBy> 
+		<oo:contact rdf:resource="http://data.ox.ac.uk/id/group/nexus-team"/> <service:subService> 
+		<service:Service rdf:about="http://data.ox.ac.uk/id/service/oucs/nexus/exchange"> 
+		<rdfs:label>Nexus Exchange</rdfs:label> <foaf:homepage rdf:resource="http://www.oucs.ox.ac.uk/nexus/email/"/> 
+		<service:software rdf:resource="http://dbpedia.org/resource/Microsoft_Exchange_Server"/> 
+		<service:provides rdf:resource="http://dbpedia.org/resource/Email"/> <ox-service:serviceLevelDescription 
+		rdf:resource="http://www.oucs.ox.ac.uk/internal/sld/nexus-exchange.xml"/> 
+		<service:interface> <service:Interface rdf:about="http://data.ox.ac.uk/id/service-interface/oucs/nexus/exchange/http"> 
+		<service:protocol rdf:resource="http://dbpedia.org/resource/HTTP_Secure"/> 
+		<service:endpoint rdf:resource="https://nexus.ox.ac.uk/"/> </service:Interface> 
+		</service:interface> <service:interface> <service:Interface rdf:about="http://data.ox.ac.uk/id/service-interface/oucs/nexus/exchange/imaps"> 
+		<service:protocol rdf:resource="http://dbpedia.org/resource/Internet_Message_Access_Protocol"/> 
+		<service:endpoint rdf:resource="imaps://imap.nexus.ox.ac.uk/"/> </service:Interface> 
+		</service:interface> </service:Service> </service:subService> <service:subService> 
+		<service:Service rdf:about="http://data.ox.ac.uk/id/service/oucs/nexus/sharepoint"> 
+		<rdfs:label>Nexus Sharepoint</rdfs:label> <foaf:homepage rdf:resource="http://www.oucs.ox.ac.uk/nexus/sharepoint/"/> 
+		<service:software rdf:resource="http://dbpedia.org/resource/Microsoft_SharePoint_Server"/> 
+		<service:provides rdf:resource="http://dbpedia.org/resource/Collaborative_software"/> 
+		<ox-service:serviceLevelDescription rdf:resource="http://www.oucs.ox.ac.uk/internal/sld/nexus-sharepoint.xml"/> 
+		<service:interface> <service:Interface rdf:about="http://data.ox.ac.uk/id/service-interface/oucs/nexus/sharepoint/http"> 
+		<service:protocol rdf:resource="http://dbpedia.org/resource/HTTP_Secure"/> 
+		<service:endpoint rdf:resource="https://sharepoint.nexus.ox.ac.uk/"/> </service:Interface> 
+		</service:interface> </service:Service> </service:subService> </service:Service> 
+		</rdf:RDF> <link rel="alternate" type="application/rdf+xml" href="nexus.rdf"/> 
+		<link rel="foaf:primaryTopic" href="http://data.ox.ac.uk/id/service/oucs/nexus"/> 
+		<link rev="foaf:homepage" href="http://data.ox.ac.uk/id/service/oucs/nexus"/> 
+		<http://data.ox.ac.uk/id/service/oucs/nexus> <http://www.xmlns.com/foaf/0.1/homepage> 
+		<http://nexus.ox.ac.uk/> <rdf:RDF> <rdf:Description rdf:about="http://www.oucs.ox.ac.uk/internal/sld/nexus.xml"> 
+		<foaf:primaryTopic rdf:resource="http://data.ox.ac.uk/id/service/oucs/nexus"/> 
+		</rdf:Description> <rdf:Description rdf:about="http://data.ox.ac.uk/id/service/oucs/nexus"> 
+		<foaf:homepage rdf:resource="http://www.oucs.ox.ac.uk/nexus/"/> <ox-service:serviceLevelDescription 
+		rdf:resource="http://www.oucs.ox.ac.uk/internal/sld/nexus.xml"/> </rdf:Description> 
+		</rdf:RDF> -->
 
-    <service:subService>
-      <service:Service rdf:about="http://data.ox.ac.uk/id/service/oucs/nexus/exchange">
-        <rdfs:label>Nexus Exchange</rdfs:label>
-        <foaf:homepage rdf:resource="http://www.oucs.ox.ac.uk/nexus/email/"/>
-        <service:software rdf:resource="http://dbpedia.org/resource/Microsoft_Exchange_Server"/>
-        <service:provides rdf:resource="http://dbpedia.org/resource/Email"/>
+	<xsl:template name="teiname">
+		<xsl:choose>
+			<xsl:when test="@type='place'">
+				<xsl:call-template name="E53" />
+			</xsl:when>
+			<xsl:when test="@type='person'">
+				<xsl:call-template name="E21" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-        <ox-service:serviceLevelDescription rdf:resource="http://www.oucs.ox.ac.uk/internal/sld/nexus-exchange.xml"/>
-        <service:interface>
-          <service:Interface rdf:about="http://data.ox.ac.uk/id/service-interface/oucs/nexus/exchange/http">
-            <service:protocol rdf:resource="http://dbpedia.org/resource/HTTP_Secure"/>
-            <service:endpoint rdf:resource="https://nexus.ox.ac.uk/"/>
-          </service:Interface>
-        </service:interface>
-        <service:interface>
-          <service:Interface rdf:about="http://data.ox.ac.uk/id/service-interface/oucs/nexus/exchange/imaps">
-            <service:protocol rdf:resource="http://dbpedia.org/resource/Internet_Message_Access_Protocol"/>
-            <service:endpoint rdf:resource="imaps://imap.nexus.ox.ac.uk/"/>
-          </service:Interface>
-        </service:interface>
-      </service:Service>
-    </service:subService>
+	<xsl:template name="E53">
+		<E53_Place>
+			<xsl:call-template name="makeID" />
+			<xsl:apply-templates />
+		</E53_Place>
+	</xsl:template>
 
-    <service:subService>
-      <service:Service rdf:about="http://data.ox.ac.uk/id/service/oucs/nexus/sharepoint">
-        <rdfs:label>Nexus Sharepoint</rdfs:label>
-        <foaf:homepage rdf:resource="http://www.oucs.ox.ac.uk/nexus/sharepoint/"/>
-        <service:software rdf:resource="http://dbpedia.org/resource/Microsoft_SharePoint_Server"/>
-        <service:provides rdf:resource="http://dbpedia.org/resource/Collaborative_software"/>
-        <ox-service:serviceLevelDescription rdf:resource="http://www.oucs.ox.ac.uk/internal/sld/nexus-sharepoint.xml"/>
-        <service:interface>
-          <service:Interface rdf:about="http://data.ox.ac.uk/id/service-interface/oucs/nexus/sharepoint/http">
-            <service:protocol rdf:resource="http://dbpedia.org/resource/HTTP_Secure"/>
-            <service:endpoint rdf:resource="https://sharepoint.nexus.ox.ac.uk/"/>
-          </service:Interface>
-        </service:interface>
-      </service:Service>
-    </service:subService>
-  </service:Service>
-</rdf:RDF>
+	<xsl:template name="E21">
+		<E21_Person>
+			<xsl:call-template name="makeID" />
+			<xsl:apply-templates />
+		</E21_Person>
+	</xsl:template>
 
+	<xsl:template name="E74">
+		<E74_Place>
+			<xsl:apply-templates />
+		</E74_Place>
+	</xsl:template>
 
+	<xsl:template name="E5">
+		<P11i_participated_in>
+			<E5_Event>
+			</E5_Event>
+		</P11i_participated_in>
+	</xsl:template>
 
-<link rel="alternate" type="application/rdf+xml" href="nexus.rdf"/>
-<link rel="foaf:primaryTopic" href="http://data.ox.ac.uk/id/service/oucs/nexus"/>
+	<xsl:template name="E47">
+		<P87_is_identified_by>
+			<E47_Place_Spatial_Coordinates>
+				<rdf:value>
+					<xsl:value-of select="." />
+				</rdf:value>
+			</E47_Place_Spatial_Coordinates>
+		</P87_is_identified_by>
+	</xsl:template>
 
+	<xsl:template name="E69">
+		<P100i_died_in>
+			<E69_Death>
+				<P4_has_time-span>
+					<E52_Time-Span>
+						<P82_at_some_time_within>
+							<E61_Time_Primitive>
+								<xsl:call-template name="calc-date-value" />
+							</E61_Time_Primitive>
+						</P82_at_some_time_within>
+					</E52_Time-Span>
+				</P4_has_time-span>
+			</E69_Death>
+		</P100i_died_in>
+	</xsl:template>
 
-<link rev="foaf:homepage" href="http://data.ox.ac.uk/id/service/oucs/nexus"/>
+	<xsl:template name="E67">
+		<P98i_was_born>
+			<E67_Birth>
+				<P4_has_time-span>
+					<E52_Time-Span>
+						<P82_at_some_time_within>
+							<E61_Time_Primitive>
+								<xsl:call-template name="calc-date-value" />
+							</E61_Time_Primitive>
+						</P82_at_some_time_within>
+					</E52_Time-Span>
+				</P4_has_time-span>
+				<P7_took_place_at
+					rdf:resource="{tei:makeID(.)}/{placeName/@key}" />
+			</E67_Birth>
+		</P98i_was_born>
+	</xsl:template>
 
-<http://data.ox.ac.uk/id/service/oucs/nexus> <http://www.xmlns.com/foaf/0.1/homepage> <http://nexus.ox.ac.uk/>
+	<xsl:template name="E82">
+		<xsl:choose>
+			<xsl:when test="parent::person">
+				<P131_is_identified_by>
+					<xsl:copy-of select="@xml:lang" />
+					<E82_Actor_Appellation>
+						<rdf:value>
+							<xsl:value-of select="normalize-space(.)" />
+						</rdf:value>
+					</E82_Actor_Appellation>
+				</P131_is_identified_by>
+			</xsl:when>
+			<xsl:when test="not(@ref)">
+				<E21_Person>
+					<xsl:call-template name="makeID" />
+					<P131_is_identified_by>
+						<xsl:copy-of select="@xml:lang" />
+						<E82_Actor_Appellation>
+							<rdf:value>
+								<xsl:value-of select="normalize-space(.)" />
+							</rdf:value>
+						</E82_Actor_Appellation>
+					</P131_is_identified_by>
+				</E21_Person>
+			</xsl:when>
+			<xsl:when
+				test="generate-id(.) = generate-id(key('persons',@ref)[1])">
+				<E21_Person>
+					<xsl:call-template name="makeID" />
+					<P131_is_identified_by>
+						<xsl:copy-of select="@xml:lang" />
+						<E82_Actor_Appellation>
+							<rdf:value>
+								<xsl:value-of select="normalize-space(.)" />
+							</rdf:value>
+						</E82_Actor_Appellation>
+					</P131_is_identified_by>
+				</E21_Person>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-<rdf:RDF>
-  <rdf:Description rdf:about="http://www.oucs.ox.ac.uk/internal/sld/nexus.xml">
-    <foaf:primaryTopic rdf:resource="http://data.ox.ac.uk/id/service/oucs/nexus"/>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://data.ox.ac.uk/id/service/oucs/nexus">
-    <foaf:homepage rdf:resource="http://www.oucs.ox.ac.uk/nexus/"/>
-    <ox-service:serviceLevelDescription rdf:resource="http://www.oucs.ox.ac.uk/internal/sld/nexus.xml"/>
-  </rdf:Description>
-</rdf:RDF>
+	<xsl:template name="E48">
+		<xsl:choose>
+			<xsl:when test="parent::place">
+				<P87_is_identified_by>
+					<xsl:copy-of select="@xml:lang" />
+					<E48_Place_Name>
+						<rdf:value>
+							<xsl:value-of select="normalize-space(.)" />
+						</rdf:value>
+					</E48_Place_Name>
+				</P87_is_identified_by>
+			</xsl:when>
+			<xsl:when test=".=''" />
+			<xsl:otherwise>
+				<E53_Place>
+					<xsl:call-template name="makeID" />
+					<P87_is_identified_by>
+						<xsl:copy-of select="@xml:lang" />
+						<E48_Place_Name>
+							<rdf:value>
+								<xsl:value-of select="normalize-space(.)" />
+							</rdf:value>
+						</E48_Place_Name>
+					</P87_is_identified_by>
+				</E53_Place>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
--->
+	<xsl:template name="P74">
+		<P74_has_current_or_former_residence>
+			<xsl:choose>
+				<xsl:when test="placeName">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<E53_Place>
+						<xsl:call-template name="makeID" />
+						<P87_is_identified_by>
+							<xsl:copy-of select="@xml:lang" />
+							<E53_Place_Name>
+								<rdf:value>
+									<xsl:value-of select="normalize-space(.)" />
+								</rdf:value>
+							</E53_Place_Name>
+						</P87_is_identified_by>
+					</E53_Place>
+				</xsl:otherwise>
+			</xsl:choose>
+		</P74_has_current_or_former_residence>
+	</xsl:template>
 
-  <xsl:template name="teiname">
-    <xsl:choose>
-      <xsl:when test="@type='place'">
-        <xsl:call-template name="E53"/>
-      </xsl:when>
-      <xsl:when test="@type='person'">
-        <xsl:call-template name="E21"/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="makeID">
+		<xsl:variable name="id">
+			<xsl:choose>
+				<xsl:when test="ancestor-or-self::*/@xml:base">
+					<xsl:value-of
+						select="ancestor-or-self::*[@xml:base][1]/@xml:base" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>http://www.example.com/id</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="@ref">
+					<xsl:value-of select="@ref" />
+				</xsl:when>
+				<xsl:when test="@xml:id">
+					<xsl:value-of select="@xml:id" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>/</xsl:text>
+					<xsl:number level="any" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:attribute name="rdf:about">
+      <xsl:value-of select="$id" />
+    </xsl:attribute>
+	</xsl:template>
 
-  <xsl:template name="E53">
-    <E53_Place>
-      <xsl:call-template name="makeID"/>
-      <xsl:apply-templates/>
-    </E53_Place>
-  </xsl:template>
-
-  <xsl:template name="E21">
-    <E21_Person>
-      <xsl:call-template name="makeID"/>
-      <xsl:apply-templates/>
-    </E21_Person>
-  </xsl:template>
-
-  <xsl:template name="E74">
-    <E74_Place>
-      <xsl:apply-templates/>
-    </E74_Place>
-  </xsl:template>
-
-  <xsl:template name="E5">
-    <P11i_participated_in>
-      <E5_Event>
-      </E5_Event>
-    </P11i_participated_in>
-  </xsl:template>
-
-  <xsl:template name="E47">
-    <P87_is_identified_by>
-      <E47_Place_Spatial_Coordinates>
-	<rdf:value>
-	  <xsl:value-of select="."/>
-	</rdf:value>
-      </E47_Place_Spatial_Coordinates>
-    </P87_is_identified_by>
-  </xsl:template>
-
-  <xsl:template name="E69">
-    <P100i_died_in>
-      <E69_Death>
-	<P4_has_time-span>
-	  <E52_Time-Span>
-	    <P82_at_some_time_within>
-	      <E61_Time_Primitive>
-		<xsl:call-template name="calc-date-value"/>
-	      </E61_Time_Primitive>
-	    </P82_at_some_time_within>
-	  </E52_Time-Span>
-	</P4_has_time-span>
-      </E69_Death>
-    </P100i_died_in>
-  </xsl:template>
-
-  <xsl:template name="E67">
-    <P98i_was_born>
-      <E67_Birth>
-	<P4_has_time-span>
-	  <E52_Time-Span>
-	    <P82_at_some_time_within>
-	      <E61_Time_Primitive>
-		<xsl:call-template name="calc-date-value"/>
-	      </E61_Time_Primitive>
-	    </P82_at_some_time_within>
-	  </E52_Time-Span>
-	</P4_has_time-span>
-	<P7_took_place_at rdf:resource="{tei:makeID(.)}/{placeName/@key}"/>
-      </E67_Birth>
-    </P98i_was_born>
-  </xsl:template>
-
-  <xsl:template name="E82">
-    <xsl:choose>
-      <xsl:when test="parent::person">
-	<P131_is_identified_by>
-	  <xsl:copy-of select="@xml:lang"/>
-	  <E82_Actor_Appellation>
-	    <rdf:value>
-	      <xsl:value-of select="normalize-space(.)"/>
-	    </rdf:value>
-	  </E82_Actor_Appellation>
-	</P131_is_identified_by>
-      </xsl:when>
-      <xsl:when test="not(@ref)">
-	<E21_Person><xsl:call-template name="makeID"/>
-	  <P131_is_identified_by>
-	    <xsl:copy-of select="@xml:lang"/>
-	    <E82_Actor_Appellation>
-	      <rdf:value>
-		<xsl:value-of select="normalize-space(.)"/>
-	      </rdf:value>
-	    </E82_Actor_Appellation>
-	  </P131_is_identified_by>
-	</E21_Person>
-      </xsl:when>
-      <xsl:when test="generate-id(.) = generate-id(key('persons',@ref)[1])">
-	<E21_Person><xsl:call-template name="makeID"/>
-	  <P131_is_identified_by>
-	    <xsl:copy-of select="@xml:lang"/>
-	    <E82_Actor_Appellation>
-	      <rdf:value>
-		<xsl:value-of select="normalize-space(.)"/>
-	      </rdf:value>
-	    </E82_Actor_Appellation>
-	  </P131_is_identified_by>
-	</E21_Person>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template name="E48">
-    <xsl:choose>
-      <xsl:when test="parent::place">
-	<P87_is_identified_by>
-	  <xsl:copy-of select="@xml:lang"/>
-	  <E48_Place_Name>
-	    <rdf:value>
-	      <xsl:value-of select="normalize-space(.)"/>
-	    </rdf:value>
-	  </E48_Place_Name>
-	</P87_is_identified_by>
-      </xsl:when>
-      <xsl:when test=".=''"/>
-      <xsl:otherwise>
-	<E53_Place><xsl:call-template name="makeID"/>
-	  <P87_is_identified_by>
-	    <xsl:copy-of select="@xml:lang"/>
-	    <E48_Place_Name>
-	      <rdf:value>
-		<xsl:value-of select="normalize-space(.)"/>
-	      </rdf:value>
-	    </E48_Place_Name>
-	  </P87_is_identified_by>
-	</E53_Place>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template name="P74">
-    <P74_has_current_or_former_residence>
-      <xsl:choose>
-	<xsl:when test="placeName">
-	  <xsl:apply-templates/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <E53_Place><xsl:call-template name="makeID"/>
-	    <P87_is_identified_by>
-	      <xsl:copy-of select="@xml:lang"/>
-	      <E53_Place_Name>
+	<xsl:template name="calc-date-value">
 		<rdf:value>
-		  <xsl:value-of select="normalize-space(.)"/>
+			<xsl:choose>
+				<xsl:when test="@when">
+					<xsl:value-of select="@when" />
+				</xsl:when>
+				<xsl:when test="@notBefore and @notAfter">
+					<xsl:value-of select="@notBefore" />
+					<xsl:text> to  </xsl:text>
+					<xsl:value-of select="@notAfter" />
+				</xsl:when>
+				<xsl:when test="@notBefore">
+					<xsl:value-of select="@notBefore" />
+					<xsl:text> to </xsl:text>
+				</xsl:when>
+				<xsl:when test="@notAfter">
+					<xsl:text> to </xsl:text>
+					<xsl:value-of select="@notAfter" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:otherwise>
+			</xsl:choose>
 		</rdf:value>
-	      </E53_Place_Name>
-	    </P87_is_identified_by>
-	  </E53_Place>
-	</xsl:otherwise>
-      </xsl:choose>
-    </P74_has_current_or_former_residence>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template name="makeID">
-    <xsl:variable name="id">
-      <xsl:choose>
-	<xsl:when test="ancestor-or-self::*/@xml:base">
-	  <xsl:value-of select="ancestor-or-self::*[@xml:base][1]/@xml:base"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:text>http://www.example.com/id</xsl:text>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:choose>
-	<xsl:when test="@ref">
-	  <xsl:value-of select="@ref"/>
-	</xsl:when>
-	<xsl:when test="@xml:id">
-	  <xsl:value-of select="@xml:id"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:text>/</xsl:text>
-	  <xsl:number level="any"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:attribute name="rdf:about">
-      <xsl:value-of select="$id"/>
-    </xsl:attribute>
-  </xsl:template>
 
-  <xsl:template name="calc-date-value">
-    <rdf:value>
-      <xsl:choose>
-        <xsl:when test="@when">
-          <xsl:value-of select="@when"/>
-        </xsl:when>
-        <xsl:when test="@notBefore and @notAfter">
-          <xsl:value-of select="@notBefore"/>
-          <xsl:text> to  </xsl:text>
-          <xsl:value-of select="@notAfter"/>
-        </xsl:when>
-        <xsl:when test="@notBefore">
-          <xsl:value-of select="@notBefore"/>
-          <xsl:text> to </xsl:text>
-        </xsl:when>
-        <xsl:when test="@notAfter">
-          <xsl:text> to </xsl:text>
-          <xsl:value-of select="@notAfter"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="normalize-space(.)"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </rdf:value>
-  </xsl:template>
+	<xsl:function name="tei:makeID" as="xs:string*">
+		<xsl:param name="here" />
+		<xsl:for-each select="$here">
+			<xsl:variable name="id">
+				<xsl:choose>
+					<xsl:when test="ancestor-or-self::*/@xml:base">
+						<xsl:value-of
+							select="ancestor-or-self::*[@xml:base][1]/@xml:base" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>http://www.example.com/id</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:choose>
+					<xsl:when test="@ref">
+						<xsl:value-of select="@ref" />
+					</xsl:when>
+					<xsl:when test="@xml:id">
+						<xsl:value-of select="@xml:id" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>/</xsl:text>
+						<xsl:number level="any" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:value-of select="$id" />
+		</xsl:for-each>
+	</xsl:function>
 
 
-  <xsl:function name="tei:makeID" as="xs:string*">
-    <xsl:param name="here"/>
-      <xsl:for-each select="$here">
-	<xsl:variable name="id">
-        <xsl:choose>
-          <xsl:when test="ancestor-or-self::*/@xml:base">
-            <xsl:value-of select="ancestor-or-self::*[@xml:base][1]/@xml:base"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:text>http://www.example.com/id</xsl:text>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:choose>
-	  <xsl:when test="@ref">
-	    <xsl:value-of select="@ref"/>
-	  </xsl:when>
-          <xsl:when test="@xml:id">
-            <xsl:value-of select="@xml:id"/>
-          </xsl:when>
-          <xsl:otherwise>
-	    <xsl:text>/</xsl:text>
-            <xsl:number level="any"/>
-          </xsl:otherwise>
-        </xsl:choose>
-    </xsl:variable>
-      <xsl:value-of select="$id"/>
-      </xsl:for-each>
-  </xsl:function>
-
-
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/tei2rdf.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/tei2rdf.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/rdf/tei2rdf.xsl	(revision 2397)
@@ -1,114 +1,135 @@
 <?xml version="1.0" encoding="utf-8"?>
-<XSL:stylesheet xmlns:XSL="http://www.w3.org/1999/XSL/Transform" version="2.0"
-                xpath-default-namespace="http://www.tei-c.org/ns/1.0">
-   <XSL:import href="../tools/getfiles.xsl"/>
-   <XSL:import href="crm.xsl"/>
-   <XSL:param name="corpus">./</XSL:param>
-   <XSL:template match="*">
-      <XSL:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-   </XSL:template>
-   <XSL:template match="text()|comment()|@*|processing-instruction()"/>
-   <XSL:template match="name">
-      <XSL:call-template name="teiname"/>
-   </XSL:template>
-   <XSL:template match="date">
-      <XSL:call-template name="E52"/>
-   </XSL:template>
-   <XSL:template match="author">
-      <XSL:call-template name="E65"/>
-   </XSL:template>
-   <XSL:template match="title">
-      <XSL:call-template name="E35"/>
-   </XSL:template>
-   <XSL:template match="teiHeader">
-      <XSL:call-template name="E31"/>
-   </XSL:template>
-   <XSL:template match="TEI">
-      <XSL:call-template name="TEI"/>
-   </XSL:template>
-   <XSL:template match="persName">
-      <XSL:call-template name="E82"/>
-   </XSL:template>
-   <XSL:template match="placeName">
-      <XSL:call-template name="E48"/>
-   </XSL:template>
-   <XSL:template match="birth">
-      <XSL:call-template name="E67"/>
-   </XSL:template>
-   <XSL:template match="death">
-      <XSL:call-template name="E69"/>
-   </XSL:template>
-   <XSL:template match="event">
-      <XSL:call-template name="E5"/>
-   </XSL:template>
-   <XSL:template match="geo">
-      <XSL:call-template name="E47"/>
-   </XSL:template>
-   <XSL:template match="org">
-      <XSL:call-template name="E74"/>
-   </XSL:template>
-   <XSL:template match="person">
-      <XSL:call-template name="E21"/>
-   </XSL:template>
-   <XSL:template match="place">
-      <XSL:call-template name="E53"/>
-   </XSL:template>
-   <XSL:template match="residence">
-      <XSL:call-template name="P74"/>
-   </XSL:template>
-   <XSL:template match="ab">
-      <XSL:call-template name="anonblock"/>
-   </XSL:template>
-   <XSL:template name="typology">
-      <E55_Type xmlns="http://purl.org/NET/crm-owl#"
-                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                rdf:about="http://www.tei-c.org/type/place">
-         <label xmlns="http://www.w3.org/2000/01/rdf-schema#">place</label>
-      </E55_Type>
-      <E55_Type xmlns="http://purl.org/NET/crm-owl#"
-                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                rdf:about="http://www.tei-c.org/type/place/placeName">
-         <label xmlns="http://www.w3.org/2000/01/rdf-schema#">contains an absolute or relative place name. </label>
-         <P127_has_broader_term rdf:resource="http://www.tei-c.org/type/place"/>
-      </E55_Type>
-      <E55_Type xmlns="http://purl.org/NET/crm-owl#"
-                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                rdf:about="http://www.tei-c.org/type/place/bloc">
-         <label xmlns="http://www.w3.org/2000/01/rdf-schema#">(bloc) contains the name of a geo-political unit consisting of two or more nation states or
-    countries.</label>
-         <P127_has_broader_term rdf:resource="http://www.tei-c.org/type/place"/>
-      </E55_Type>
-      <E55_Type xmlns="http://purl.org/NET/crm-owl#"
-                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                rdf:about="http://www.tei-c.org/type/place/country">
-         <label xmlns="http://www.w3.org/2000/01/rdf-schema#">(country) contains the name of a geo-political unit, such as a nation, country, colony, or
-    commonwealth, larger than or administratively superior to a region and smaller than a bloc.</label>
-         <P127_has_broader_term rdf:resource="http://www.tei-c.org/type/place"/>
-      </E55_Type>
-      <E55_Type xmlns="http://purl.org/NET/crm-owl#"
-                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                rdf:about="http://www.tei-c.org/type/place/region">
-         <label xmlns="http://www.w3.org/2000/01/rdf-schema#">contains the name of an administrative unit such as a state, province, or county, larger
-    than a settlement, but smaller than a country.</label>
-         <P127_has_broader_term rdf:resource="http://www.tei-c.org/type/place"/>
-      </E55_Type>
-      <E55_Type xmlns="http://purl.org/NET/crm-owl#"
-                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                rdf:about="http://www.tei-c.org/type/place/district">
-         <label xmlns="http://www.w3.org/2000/01/rdf-schema#">contains the name of any kind of subdivision of a settlement, such as a parish, ward, or other administrative or geographic unit.</label>
-         <P127_has_broader_term rdf:resource="http://www.tei-c.org/type/place"/>
-      </E55_Type>
-      <E55_Type xmlns="http://purl.org/NET/crm-owl#"
-                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                rdf:about="http://www.tei-c.org/type/place/settlement">
-         <label xmlns="http://www.w3.org/2000/01/rdf-schema#">contains the name of a settlement such as a city, town, or village identified as a single geo-political or administrative unit.</label>
-         <P127_has_broader_term rdf:resource="http://www.tei-c.org/type/place"/>
-      </E55_Type>
-      <E55_Type xmlns="http://purl.org/NET/crm-owl#"
-                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                rdf:about="http://www.tei-c.org/type/place/geogName">
-         <label xmlns="http://www.w3.org/2000/01/rdf-schema#">(geographical name) a name associated with some geographical feature such as Windrush Valley or Mount Sinai.</label>
-         <P127_has_broader_term rdf:resource="http://www.tei-c.org/type/place"/>
-      </E55_Type>
-   </XSL:template>
+<XSL:stylesheet
+	xmlns:XSL="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0">
+	<XSL:import href="../tools/getfiles.xsl" />
+	<XSL:import href="crm.xsl" />
+	<XSL:param name="corpus">
+		./
+	</XSL:param>
+	<XSL:template match="*">
+		<XSL:apply-templates
+			select="*|@*|processing-instruction()|comment()|text()" />
+	</XSL:template>
+	<XSL:template
+		match="text()|comment()|@*|processing-instruction()" />
+	<XSL:template match="name">
+		<XSL:call-template name="teiname" />
+	</XSL:template>
+	<XSL:template match="date">
+		<XSL:call-template name="E52" />
+	</XSL:template>
+	<XSL:template match="author">
+		<XSL:call-template name="E65" />
+	</XSL:template>
+	<XSL:template match="title">
+		<XSL:call-template name="E35" />
+	</XSL:template>
+	<XSL:template match="teiHeader">
+		<XSL:call-template name="E31" />
+	</XSL:template>
+	<XSL:template match="TEI">
+		<XSL:call-template name="TEI" />
+	</XSL:template>
+	<XSL:template match="persName">
+		<XSL:call-template name="E82" />
+	</XSL:template>
+	<XSL:template match="placeName">
+		<XSL:call-template name="E48" />
+	</XSL:template>
+	<XSL:template match="birth">
+		<XSL:call-template name="E67" />
+	</XSL:template>
+	<XSL:template match="death">
+		<XSL:call-template name="E69" />
+	</XSL:template>
+	<XSL:template match="event">
+		<XSL:call-template name="E5" />
+	</XSL:template>
+	<XSL:template match="geo">
+		<XSL:call-template name="E47" />
+	</XSL:template>
+	<XSL:template match="org">
+		<XSL:call-template name="E74" />
+	</XSL:template>
+	<XSL:template match="person">
+		<XSL:call-template name="E21" />
+	</XSL:template>
+	<XSL:template match="place">
+		<XSL:call-template name="E53" />
+	</XSL:template>
+	<XSL:template match="residence">
+		<XSL:call-template name="P74" />
+	</XSL:template>
+	<XSL:template match="ab">
+		<XSL:call-template name="anonblock" />
+	</XSL:template>
+	<XSL:template name="typology">
+		<E55_Type xmlns="http://purl.org/NET/crm-owl#"
+			xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			rdf:about="http://www.tei-c.org/type/place">
+			<label xmlns="http://www.w3.org/2000/01/rdf-schema#">place</label>
+		</E55_Type>
+		<E55_Type xmlns="http://purl.org/NET/crm-owl#"
+			xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			rdf:about="http://www.tei-c.org/type/place/placeName">
+			<label xmlns="http://www.w3.org/2000/01/rdf-schema#">contains an absolute or relative place name. </label>
+			<P127_has_broader_term
+				rdf:resource="http://www.tei-c.org/type/place" />
+		</E55_Type>
+		<E55_Type xmlns="http://purl.org/NET/crm-owl#"
+			xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			rdf:about="http://www.tei-c.org/type/place/bloc">
+			<label xmlns="http://www.w3.org/2000/01/rdf-schema#">(bloc) contains the name of a geo-political unit
+				consisting of two or more nation states or
+				countries.</label>
+			<P127_has_broader_term
+				rdf:resource="http://www.tei-c.org/type/place" />
+		</E55_Type>
+		<E55_Type xmlns="http://purl.org/NET/crm-owl#"
+			xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			rdf:about="http://www.tei-c.org/type/place/country">
+			<label xmlns="http://www.w3.org/2000/01/rdf-schema#">(country) contains the name of a geo-political
+				unit, such as a nation, country, colony, or
+				commonwealth, larger than or administratively superior to a region and smaller
+				than a bloc.</label>
+			<P127_has_broader_term
+				rdf:resource="http://www.tei-c.org/type/place" />
+		</E55_Type>
+		<E55_Type xmlns="http://purl.org/NET/crm-owl#"
+			xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			rdf:about="http://www.tei-c.org/type/place/region">
+			<label xmlns="http://www.w3.org/2000/01/rdf-schema#">contains the name of an administrative unit such
+				as a state, province, or county, larger
+				than a settlement, but smaller than a country.</label>
+			<P127_has_broader_term
+				rdf:resource="http://www.tei-c.org/type/place" />
+		</E55_Type>
+		<E55_Type xmlns="http://purl.org/NET/crm-owl#"
+			xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			rdf:about="http://www.tei-c.org/type/place/district">
+			<label xmlns="http://www.w3.org/2000/01/rdf-schema#">contains the name of any kind of subdivision of a
+				settlement, such as a parish, ward, or other administrative or
+				geographic unit.</label>
+			<P127_has_broader_term
+				rdf:resource="http://www.tei-c.org/type/place" />
+		</E55_Type>
+		<E55_Type xmlns="http://purl.org/NET/crm-owl#"
+			xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			rdf:about="http://www.tei-c.org/type/place/settlement">
+			<label xmlns="http://www.w3.org/2000/01/rdf-schema#">contains the name of a settlement such as a city,
+				town, or village identified as a single geo-political or
+				administrative unit.</label>
+			<P127_has_broader_term
+				rdf:resource="http://www.tei-c.org/type/place" />
+		</E55_Type>
+		<E55_Type xmlns="http://purl.org/NET/crm-owl#"
+			xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			rdf:about="http://www.tei-c.org/type/place/geogName">
+			<label xmlns="http://www.w3.org/2000/01/rdf-schema#">(geographical name) a name associated with some
+				geographical feature such as Windrush Valley or Mount Sinai.</label>
+			<P127_has_broader_term
+				rdf:resource="http://www.tei-c.org/type/place" />
+		</E55_Type>
+	</XSL:template>
 </XSL:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-sch.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-sch.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-sch.xsl	(revision 2397)
@@ -1,161 +1,168 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xi="http://www.w3.org/2001/XInclude"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-		xmlns:sch="http://www.ascc.net/xml/schematron"
-		xmlns="http://www.ascc.net/xml/schematron"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="tei rng teix sch xi #default">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for simplifying TEI ODD markup </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:sch="http://www.ascc.net/xml/schematron"
+	xmlns="http://www.ascc.net/xml/schematron"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="tei rng teix sch xi #default">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for simplifying TEI ODD markup </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: extract-sch.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:output encoding="utf-8" indent="yes" method="xml"/>
-  <xsl:param name="lang"></xsl:param>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:key name="NS" 
-	   match="sch:ns"
-	   use="1"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: extract-sch.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output encoding="utf-8" indent="yes" method="xml" />
+	<xsl:param name="lang"></xsl:param>
 
-  <xsl:key name="PATTERNS"
-	   match="sch:pattern"
-	   use="1"/>
+	<xsl:key name="NS" match="sch:ns" use="1" />
 
-  <xsl:key name="CONSTRAINTS"
-	   match="tei:constraint"
-	   use="1"/>
+	<xsl:key name="PATTERNS" match="sch:pattern" use="1" />
 
+	<xsl:key name="CONSTRAINTS" match="tei:constraint" use="1" />
 
-  <xsl:template match="/">
-      <schema>
-         <title>Schematron 1.5 rules</title>
-         <xsl:for-each select="key('NS',1)">
-            <xsl:choose>
-               <xsl:when test="ancestor::teix:egXML"/>
-	       <xsl:when test="ancestor::tei:constraintSpec/@xml:lang
-		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)"/>
-               <xsl:otherwise>
-                  <xsl:apply-templates select="."/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:for-each>
 
-         <xsl:for-each select="key('PATTERNS',1)">
-            <xsl:choose>
-               <xsl:when test="ancestor::teix:egXML"/>
-	       <xsl:when test="ancestor::tei:constraintSpec/@xml:lang
-		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)"/>
-               <xsl:otherwise>
-                  <xsl:apply-templates select="."/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:for-each>
+	<xsl:template match="/">
+		<schema>
+			<title>Schematron 1.5 rules</title>
+			<xsl:for-each select="key('NS',1)">
+				<xsl:choose>
+					<xsl:when test="ancestor::teix:egXML" />
+					<xsl:when
+						test="ancestor::tei:constraintSpec/@xml:lang
+		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)" />
+					<xsl:otherwise>
+						<xsl:apply-templates select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
 
-         <xsl:for-each select="key('CONSTRAINTS',1)">
-            <xsl:choose>
-               <xsl:when test="ancestor::teix:egXML"/>
-	       <xsl:when test="ancestor::tei:constraintSpec/@xml:lang
-		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)"/>
-               <xsl:otherwise>
-		 <xsl:variable name="patID">
-		   <xsl:choose>
-		     <xsl:when test="ancestor::tei:elementSpec">
-		       <xsl:value-of select="concat(ancestor::tei:elementSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)"/>
-		     </xsl:when>
-		     <xsl:when test="ancestor::tei:classSpec">
-		       <xsl:value-of select="concat(ancestor::tei:classSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)"/>
-		     </xsl:when>
-		     <xsl:when test="ancestor::tei:macroSpec">
-		       <xsl:value-of select="concat(ancestor::tei:macroSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)"/>
-		     </xsl:when>
-                     </xsl:choose>
-                  </xsl:variable>
-		 <xsl:if test="sch:rule">
-		   <pattern id="{$patID}">
-		     <xsl:apply-templates select="sch:rule"/>
-		   </pattern>
-		 </xsl:if>
-		 <xsl:if test="sch:assert|sch:report">
-		   <pattern id="{$patID}">
-		     <rule>
-		       <xsl:attribute name="context">
+			<xsl:for-each select="key('PATTERNS',1)">
+				<xsl:choose>
+					<xsl:when test="ancestor::teix:egXML" />
+					<xsl:when
+						test="ancestor::tei:constraintSpec/@xml:lang
+		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)" />
+					<xsl:otherwise>
+						<xsl:apply-templates select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+
+			<xsl:for-each select="key('CONSTRAINTS',1)">
+				<xsl:choose>
+					<xsl:when test="ancestor::teix:egXML" />
+					<xsl:when
+						test="ancestor::tei:constraintSpec/@xml:lang
+		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)" />
+					<xsl:otherwise>
+						<xsl:variable name="patID">
+							<xsl:choose>
+								<xsl:when test="ancestor::tei:elementSpec">
+									<xsl:value-of
+										select="concat(ancestor::tei:elementSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)" />
+								</xsl:when>
+								<xsl:when test="ancestor::tei:classSpec">
+									<xsl:value-of
+										select="concat(ancestor::tei:classSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)" />
+								</xsl:when>
+								<xsl:when test="ancestor::tei:macroSpec">
+									<xsl:value-of
+										select="concat(ancestor::tei:macroSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)" />
+								</xsl:when>
+							</xsl:choose>
+						</xsl:variable>
+						<xsl:if test="sch:rule">
+							<pattern id="{$patID}">
+								<xsl:apply-templates select="sch:rule" />
+							</pattern>
+						</xsl:if>
+						<xsl:if test="sch:assert|sch:report">
+							<pattern id="{$patID}">
+								<rule>
+									<xsl:attribute name="context">
 			 <xsl:text>tei:</xsl:text>
 			 <xsl:choose>
 			   <xsl:when test="ancestor::tei:elementSpec">
 			     <xsl:value-of
-				 select="ancestor::tei:elementSpec/@ident"/>
+										select="ancestor::tei:elementSpec/@ident" />
 			   </xsl:when>
 			   <xsl:otherwise>*</xsl:otherwise>
 			 </xsl:choose>
 		       </xsl:attribute>
-		       <xsl:apply-templates select="sch:assert|sch:report"/>
-		     </rule>
-		   </pattern>
-		 </xsl:if>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:for-each>
-      </schema>
-  </xsl:template>
-  
-  <xsl:template match="sch:rule[not(@context)]">
-    <rule>
-      <xsl:attribute name="context">
+									<xsl:apply-templates
+										select="sch:assert|sch:report" />
+								</rule>
+							</pattern>
+						</xsl:if>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</schema>
+	</xsl:template>
+
+	<xsl:template match="sch:rule[not(@context)]">
+		<rule>
+			<xsl:attribute name="context">
 	<xsl:text>tei:</xsl:text>
-	<xsl:value-of select="ancestor::tei:elementSpec/@ident"/>
+	<xsl:value-of select="ancestor::tei:elementSpec/@ident" />
       </xsl:attribute>
-      <xsl:apply-templates/>
-    </rule>
-  </xsl:template>
-  
-  
-  <xsl:template match="@*|text()|comment()|processing-instruction()">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  
-  <xsl:template match="sch:*">
-    <xsl:element name="{local-name()}">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
-  
+			<xsl:apply-templates />
+		</rule>
+	</xsl:template>
+
+
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+
+	<xsl:template match="sch:*">
+		<xsl:element name="{local-name()}">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/table2list.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/table2list.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/table2list.xsl	(revision 2397)
@@ -1,106 +1,122 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:t="http://www.thaiopensource.com/ns/annotations"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns="http://www.tei-c.org/ns/1.0"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a t tei fo rng xs"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the core module. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:t="http://www.thaiopensource.com/ns/annotations"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns="http://www.tei-c.org/ns/1.0"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a t tei fo rng xs" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module. </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: table2list.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <xsl:template match="tei:table[@rend='valList'         or @rend='attDef'        or @rend='attList'         or @rend='specDesc']">
-      <list type="termlist">
-         <xsl:apply-templates/>
-      </list>
-  </xsl:template>
-  <xsl:template match="tei:table[@rend='attList'      or @rend='valList'      or @rend='attDef'      or @rend='specDesc']/tei:row">
-      <item>
-         <xsl:apply-templates/>
-      </item>
-  </xsl:template>
-  <xsl:template match="tei:table[@rend='attList'       or @rend='specDesc'       or @rend='valList'       or @rend='attDef']/tei:row/tei:cell[1]">
-      <xsl:choose>
-         <xsl:when test="parent::tei:row/parent::tei:table[@rend='attList']">
-            <hi rend="bold">@<xsl:apply-templates/>
-            </hi>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:table[@rend='valList']">
-            <hi rend="bold">
-               <xsl:apply-templates/>
-            </hi>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:table[@rend='specDesc']">
-            <hi rend="bold">@<xsl:apply-templates/>
-            </hi>
-         </xsl:when>
-         <xsl:otherwise>
-            <hi rend="bold">
-               <xsl:apply-templates/>
-            </hi>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:table[@rend='attList'        or @rend='valList'        or @rend='specDesc'        or @rend='attDef']/tei:row/tei:cell[2]">
-      <c rend="tab">
-         <xsl:text>	</xsl:text>
-      </c>
-      <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:index"/>
-  <xsl:template match="processing-instruction()[name()='tex' and .='\ ']">
-      <c xml:space="preserve"> </c>
-  </xsl:template>
-   <!-- identity transform -->
-  <xsl:output method="xml" indent="yes"/>
-  <xsl:template match="@*|text()|comment()|processing-instruction()">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-  <xsl:template match="*">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: table2list.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:template
+		match="tei:table[@rend='valList'         or @rend='attDef'        or @rend='attList'         or @rend='specDesc']">
+		<list type="termlist">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
+	<xsl:template
+		match="tei:table[@rend='attList'      or @rend='valList'      or @rend='attDef'      or @rend='specDesc']/tei:row">
+		<item>
+			<xsl:apply-templates />
+		</item>
+	</xsl:template>
+	<xsl:template
+		match="tei:table[@rend='attList'       or @rend='specDesc'       or @rend='valList'       or @rend='attDef']/tei:row/tei:cell[1]">
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:row/parent::tei:table[@rend='attList']">
+				<hi rend="bold">
+					@
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when test="ancestor::tei:table[@rend='valList']">
+				<hi rend="bold">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when test="ancestor::tei:table[@rend='specDesc']">
+				<hi rend="bold">
+					@
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:otherwise>
+				<hi rend="bold">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template
+		match="tei:table[@rend='attList'        or @rend='valList'        or @rend='specDesc'        or @rend='attDef']/tei:row/tei:cell[2]">
+		<c rend="tab">
+			<xsl:text>	</xsl:text>
+		</c>
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:index" />
+	<xsl:template
+		match="processing-instruction()[name()='tex' and .='\ ']">
+		<c xml:space="preserve"> </c>
+	</xsl:template>
+	<!-- identity transform -->
+	<xsl:output method="xml" indent="yes" />
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2lite.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2lite.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2lite.xsl	(revision 2397)
@@ -1,518 +1,606 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns="http://www.tei-c.org/ns/1.0"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-		xmlns:s="http://www.ascc.net/xml/schematron" 
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:sch="http://purl.oclc.org/dsdl/schematron"
-                exclude-result-prefixes="fo a tei html s rng sch xsi teix xs"
-                version="2.0">
-  <xsl:import href="../common2/verbatim.xsl"/>
-  <xsl:import href="teiodds.xsl"/>
-  <xsl:import href="../common2/tei.xsl"/>
-  <xsl:include href="../common2/tagdocs.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making TEI Lite XML from ODD </p>
-         <p>This software is dual-licensed:
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	exclude-result-prefixes="fo a tei html s rng sch xsi teix xs"
+	version="2.0">
+	<xsl:import href="../common2/verbatim.xsl" />
+	<xsl:import href="teiodds.xsl" />
+	<xsl:import href="../common2/tei.xsl" />
+	<xsl:include href="../common2/tagdocs.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making TEI Lite XML from ODD </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: odd2lite.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:param name="summaryDoc">false</xsl:param>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:param name="cellName">cell</xsl:param>
-  <xsl:param name="xrefName">ref</xsl:param>
-  <xsl:param name="urlName">target</xsl:param>
-  <xsl:param name="ulName">list</xsl:param>
-  <xsl:param name="dlName">list</xsl:param>
-  <xsl:param name="codeName">code</xsl:param>
-  <xsl:param name="colspan">cols</xsl:param>
-  <xsl:param name="ddName">item</xsl:param>
-  <xsl:param name="dtName">label</xsl:param>
-  <xsl:param name="hiName">hi</xsl:param>
-  <xsl:param name="itemName">item</xsl:param>
-  <xsl:param name="labelName">label</xsl:param>
-  <xsl:param name="rendName">rend</xsl:param>
-  <xsl:param name="rowName">row</xsl:param>
-  <xsl:param name="tableName">table</xsl:param>
-  <xsl:param name="sectionName">div</xsl:param>
-  <xsl:param name="divName">ab</xsl:param>
-  <xsl:param name="segName">seg</xsl:param>
-  <xsl:param name="outputNS">http://www.tei-c.org/ns/1.0</xsl:param>
-  <xsl:param name="startAttribute"/>
-  <xsl:param name="endAttribute"/>
-  <xsl:param name="startAttributeValue"/>
-  <xsl:param name="endAttributeValue"/>
-  <xsl:param name="startComment"/>
-  <xsl:param name="endComment"/>
-  <xsl:param name="startElement"/>
-  <xsl:param name="endElement"/>
-  <xsl:param name="startElementName"/>
-  <xsl:param name="endElementName"/>
-  <xsl:param name="startNamespace"/>
-  <xsl:param name="endNamespace"/>
-  <xsl:param name="spaceCharacter">&#160;</xsl:param>
-  <xsl:param name="oddmode">tei</xsl:param>
-  <xsl:param name="displayMode">rnc</xsl:param>
-  <xsl:param name="splitLevel">-1</xsl:param>
-  <xsl:param name="idPrefix">TEI.</xsl:param>
-  <xsl:template name="identifyElement">
-      <xsl:param name="id"/>
-      <xsl:attribute name="xml:id">
-         <xsl:value-of select="$id"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: odd2lite.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:param name="summaryDoc">
+		false
+	</xsl:param>
+
+	<xsl:param name="cellName">
+		cell
+	</xsl:param>
+	<xsl:param name="xrefName">
+		ref
+	</xsl:param>
+	<xsl:param name="urlName">
+		target
+	</xsl:param>
+	<xsl:param name="ulName">
+		list
+	</xsl:param>
+	<xsl:param name="dlName">
+		list
+	</xsl:param>
+	<xsl:param name="codeName">
+		code
+	</xsl:param>
+	<xsl:param name="colspan">
+		cols
+	</xsl:param>
+	<xsl:param name="ddName">
+		item
+	</xsl:param>
+	<xsl:param name="dtName">
+		label
+	</xsl:param>
+	<xsl:param name="hiName">
+		hi
+	</xsl:param>
+	<xsl:param name="itemName">
+		item
+	</xsl:param>
+	<xsl:param name="labelName">
+		label
+	</xsl:param>
+	<xsl:param name="rendName">
+		rend
+	</xsl:param>
+	<xsl:param name="rowName">
+		row
+	</xsl:param>
+	<xsl:param name="tableName">
+		table
+	</xsl:param>
+	<xsl:param name="sectionName">
+		div
+	</xsl:param>
+	<xsl:param name="divName">
+		ab
+	</xsl:param>
+	<xsl:param name="segName">
+		seg
+	</xsl:param>
+	<xsl:param name="outputNS">
+		http://www.tei-c.org/ns/1.0
+	</xsl:param>
+	<xsl:param name="startAttribute" />
+	<xsl:param name="endAttribute" />
+	<xsl:param name="startAttributeValue" />
+	<xsl:param name="endAttributeValue" />
+	<xsl:param name="startComment" />
+	<xsl:param name="endComment" />
+	<xsl:param name="startElement" />
+	<xsl:param name="endElement" />
+	<xsl:param name="startElementName" />
+	<xsl:param name="endElementName" />
+	<xsl:param name="startNamespace" />
+	<xsl:param name="endNamespace" />
+	<xsl:param name="spaceCharacter">
+		&#160;
+	</xsl:param>
+	<xsl:param name="oddmode">
+		tei
+	</xsl:param>
+	<xsl:param name="displayMode">
+		rnc
+	</xsl:param>
+	<xsl:param name="splitLevel">
+		-1
+	</xsl:param>
+	<xsl:param name="idPrefix">
+		TEI.
+	</xsl:param>
+	<xsl:template name="identifyElement">
+		<xsl:param name="id" />
+		<xsl:attribute name="xml:id">
+         <xsl:value-of select="$id" />
       </xsl:attribute>
-  </xsl:template>
-  <xsl:template name="verbatim-lineBreak">
-      <xsl:param name="id"/>
-      <xsl:text>&#10;</xsl:text>
-  </xsl:template>
-  <xsl:key match="tei:moduleSpec[@ident]" name="FILES" use="@ident"/>
-  <xsl:variable name="top" select="/"/>
-  <xsl:template match="@*|comment()|processing-instruction()">
-      <xsl:copy-of select="."/>
-  </xsl:template>
+	</xsl:template>
+	<xsl:template name="verbatim-lineBreak">
+		<xsl:param name="id" />
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
+	<xsl:key match="tei:moduleSpec[@ident]" name="FILES"
+		use="@ident" />
+	<xsl:variable name="top" select="/" />
+	<xsl:template
+		match="@*|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="teix:egXML">
-      <xsl:param name="simple">false</xsl:param>
-      <xsl:param name="highlight"/>
-      <xsl:copy>
-         <xsl:if test="not(@xml:lang)">
-	           <xsl:copy-of select="parent::tei:*/@xml:lang"/>
-         </xsl:if>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-  </xsl:template>
+	<xsl:template match="teix:egXML">
+		<xsl:param name="simple">
+			false
+		</xsl:param>
+		<xsl:param name="highlight" />
+		<xsl:copy>
+			<xsl:if test="not(@xml:lang)">
+				<xsl:copy-of select="parent::tei:*/@xml:lang" />
+			</xsl:if>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
 
-  <xsl:template match="*|tei:author|tei:title">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-  </xsl:template>
-  <xsl:template name="showSpace">
-      <c xml:space="preserve"> </c>
-  </xsl:template>
+	<xsl:template match="*|tei:author|tei:title">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template name="showSpace">
+		<c xml:space="preserve"> </c>
+	</xsl:template>
 
-  <xsl:template name="showSpaceBetweenItems">
-      <c xml:space="preserve"> </c>
-  </xsl:template>
+	<xsl:template name="showSpaceBetweenItems">
+		<c xml:space="preserve"> </c>
+	</xsl:template>
 
-  <xsl:template name="makeInternalLink">
-      <xsl:param name="ptr" as="xs:boolean"  select="false()"/>
-      <xsl:param name="target"/>
-      <xsl:param name="dest"/>
-      <xsl:param name="class"/>
-      <xsl:param name="body"/>
-      <xsl:variable name="W">
-         <xsl:choose>
-            <xsl:when test="$target">
-               <xsl:value-of select="$target"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$dest"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="not($body='')">
-            <tei:ref target="#{$W}">
-	      <xsl:if test="$class">
-		<xsl:attribute name="rend" select="$class"/>
-	      </xsl:if>
-               <xsl:value-of select="$body"/>
-            </tei:ref>
-         </xsl:when>
-         <xsl:when test="$ptr">
-            <tei:ptr target="#{$W}"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="makeExternalLink">
-      <xsl:param name="ptr" as="xs:boolean" select="false()"/>
-      <xsl:param name="dest"/>
-      <xsl:choose>
-         <xsl:when test="$ptr">
-            <tei:ptr target="{$dest}"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <tei:ref target="{$dest}">
-               <xsl:apply-templates/>
-            </tei:ref>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="generateEndLink">
-      <xsl:param name="where"/>
-      <xsl:value-of select="$where"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[odds] Document an element, macro, or class</desc>
-   </doc>
-  <xsl:template name="refdoc">
-      <xsl:if test="$verbose='true'">
-         <xsl:message> refdoc for <xsl:value-of select="name(.)"/> - <xsl:value-of select="@ident"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="self::tei:classSpec and  count(key('CLASSMEMBERS',@ident))=0">
-            <xsl:if test="$verbose='true'">
-               <xsl:message> class <xsl:value-of select="@ident"/> omitted as it has no members
-          </xsl:message>
-            </xsl:if>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates mode="weavebody" select="."/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<xsl:template name="makeInternalLink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="target" />
+		<xsl:param name="dest" />
+		<xsl:param name="class" />
+		<xsl:param name="body" />
+		<xsl:variable name="W">
+			<xsl:choose>
+				<xsl:when test="$target">
+					<xsl:value-of select="$target" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$dest" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="not($body='')">
+				<tei:ref target="#{$W}">
+					<xsl:if test="$class">
+						<xsl:attribute name="rend" select="$class" />
+					</xsl:if>
+					<xsl:value-of select="$body" />
+				</tei:ref>
+			</xsl:when>
+			<xsl:when test="$ptr">
+				<tei:ptr target="#{$W}" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="makeExternalLink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="dest" />
+		<xsl:choose>
+			<xsl:when test="$ptr">
+				<tei:ptr target="{$dest}" />
+			</xsl:when>
+			<xsl:otherwise>
+				<tei:ref target="{$dest}">
+					<xsl:apply-templates />
+				</tei:ref>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="generateEndLink">
+		<xsl:param name="where" />
+		<xsl:value-of select="$where" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[odds] Document an element, macro, or class</desc>
+	</doc>
+	<xsl:template name="refdoc">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				refdoc for
+				<xsl:value-of select="name(.)" />
+				-
+				<xsl:value-of select="@ident" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when
+				test="self::tei:classSpec and  count(key('CLASSMEMBERS',@ident))=0">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						class
+						<xsl:value-of select="@ident" />
+						omitted as it has no members
+					</xsl:message>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates mode="weavebody" select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="makeAnchor">
-      <xsl:param name="name"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[odds] <param name="text">text</param>
-      </desc>
-   </doc>
-  <xsl:template name="typewriter">
-      <xsl:param name="text"/>
-      <code>
-         <xsl:copy-of select="$text"/>
-      </code>
-  </xsl:template>
+	<xsl:template name="makeAnchor">
+		<xsl:param name="name" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[odds]
+			<param name="text">text</param>
+		</desc>
+	</doc>
+	<xsl:template name="typewriter">
+		<xsl:param name="text" />
+		<code>
+			<xsl:copy-of select="$text" />
+		</code>
+	</xsl:template>
 
-  <xsl:template name="makeSectionHead">
-      <xsl:param name="name"/>
-      <xsl:param name="id"/>
-      <xsl:attribute name="type">
+	<xsl:template name="makeSectionHead">
+		<xsl:param name="name" />
+		<xsl:param name="id" />
+		<xsl:attribute name="type">
          <xsl:text>refdoc</xsl:text>
       </xsl:attribute>
-      <xsl:attribute name="xml:id">
-         <xsl:value-of select="$idPrefix"/>
-         <xsl:value-of select="$id"/>
+		<xsl:attribute name="xml:id">
+         <xsl:value-of select="$idPrefix" />
+         <xsl:value-of select="$id" />
       </xsl:attribute>
-      <head>
-         <xsl:value-of select="$name"/>
-      </head>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[odds] <param name="grammar">grammar</param>
-         <param name="content">content</param>
-         <param name="element">element</param>
-      </desc>
-   </doc>
-  <xsl:template name="bitOut">
-      <xsl:param name="grammar"/>
-      <xsl:param name="content"/>
-      <xsl:param name="element">pre</xsl:param>
-      <eg rend="eg_rnc">
-         <xsl:call-template name="make-body-from-r-t-f">
-            <xsl:with-param name="schema">
-               <xsl:for-each select="$content/*">
-                  <xsl:call-template name="make-compact-schema"/>
-               </xsl:for-each>
-            </xsl:with-param>
-         </xsl:call-template>
-      </eg>
-  </xsl:template>
-  <xsl:template match="tei:remarks/tei:p">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:exemplum/tei:p">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template name="linkTogether">
-      <xsl:param name="name"/>
-      <xsl:param name="reftext"/>
-      <xsl:param name="class"/>
-      <xsl:variable name="partialname">
-         <xsl:value-of select="$idPrefix"/>
-         <xsl:choose>
-            <xsl:when test="contains($name,'_')">
-               <xsl:value-of select="substring-before($name,'_')"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$name"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <ref target="#{$partialname}">
-	<xsl:if test="$class">
-	  <xsl:attribute name="rend" select="$class"/>
-	</xsl:if>
-         <xsl:choose>
-            <xsl:when test="$reftext=''">
-               <xsl:value-of select="$name"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$reftext"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </ref>
-  </xsl:template>
-  <xsl:template name="showRNC">
-      <xsl:param name="style"/>
-      <xsl:param name="contents"/>
-      <xsl:value-of select="$contents"/>
-  </xsl:template>
-  <xsl:template name="emptySlash">
-      <xsl:param name="name"/>
-      <xsl:value-of select="$name"/>
-      <xsl:text>/</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:gi">
-      <xsl:choose>
-         <xsl:when test="not(@scheme='') or parent::tei:ref or parent::tei:head">
-            <xsl:text>&lt;</xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>&gt;</xsl:text>
-         </xsl:when>
-         <xsl:when test="key('ELEMENTS',.)[last()]">
-            <xsl:for-each select="key('ELEMENTS',.)">
-               <ref target="#{@ident}">
-                  <xsl:text>&lt;</xsl:text>
-                  <xsl:choose>
-                     <xsl:when test="tei:content/rng:empty">
-                        <xsl:call-template name="emptySlash">
-                           <xsl:with-param name="name">
-                              <xsl:value-of select="(tei:altIdent|@ident)[last()]"/>
-                           </xsl:with-param>
-                        </xsl:call-template>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="(tei:altIdent|@ident)[last()]"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-                  <xsl:text>&gt;</xsl:text>
-               </ref>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>&lt;</xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>&gt;</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-   <!-- debugging
-<xsl:template name="SHOW">
- &lt;<xsl:value-of select="name()"/>
-<xsl:for-each select="@*">
-  <xsl:text> </xsl:text>
-  <xsl:value-of select="name()"/>="<xsl:value-of select="."/>"
-</xsl:for-each>
-&gt;
-   <xsl:for-each select="*">
-     <xsl:call-template name="SHOW"/>
-   </xsl:for-each>
- &lt;/<xsl:value-of select="name()"/>&gt;
-</xsl:template>
+		<head>
+			<xsl:value-of select="$name" />
+		</head>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[odds]
+			<param name="grammar">grammar</param>
+			<param name="content">content</param>
+			<param name="element">element</param>
+		</desc>
+	</doc>
+	<xsl:template name="bitOut">
+		<xsl:param name="grammar" />
+		<xsl:param name="content" />
+		<xsl:param name="element">
+			pre
+		</xsl:param>
+		<eg rend="eg_rnc">
+			<xsl:call-template name="make-body-from-r-t-f">
+				<xsl:with-param name="schema">
+					<xsl:for-each select="$content/*">
+						<xsl:call-template name="make-compact-schema" />
+					</xsl:for-each>
+				</xsl:with-param>
+			</xsl:call-template>
+		</eg>
+	</xsl:template>
+	<xsl:template match="tei:remarks/tei:p">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:exemplum/tei:p">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template name="linkTogether">
+		<xsl:param name="name" />
+		<xsl:param name="reftext" />
+		<xsl:param name="class" />
+		<xsl:variable name="partialname">
+			<xsl:value-of select="$idPrefix" />
+			<xsl:choose>
+				<xsl:when test="contains($name,'_')">
+					<xsl:value-of select="substring-before($name,'_')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$name" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<ref target="#{$partialname}">
+			<xsl:if test="$class">
+				<xsl:attribute name="rend" select="$class" />
+			</xsl:if>
+			<xsl:choose>
+				<xsl:when test="$reftext=''">
+					<xsl:value-of select="$name" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$reftext" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</ref>
+	</xsl:template>
+	<xsl:template name="showRNC">
+		<xsl:param name="style" />
+		<xsl:param name="contents" />
+		<xsl:value-of select="$contents" />
+	</xsl:template>
+	<xsl:template name="emptySlash">
+		<xsl:param name="name" />
+		<xsl:value-of select="$name" />
+		<xsl:text>/</xsl:text>
+	</xsl:template>
+	<xsl:template match="tei:gi">
+		<xsl:choose>
+			<xsl:when
+				test="not(@scheme='') or parent::tei:ref or parent::tei:head">
+				<xsl:text>&lt;</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>&gt;</xsl:text>
+			</xsl:when>
+			<xsl:when test="key('ELEMENTS',.)[last()]">
+				<xsl:for-each select="key('ELEMENTS',.)">
+					<ref target="#{@ident}">
+						<xsl:text>&lt;</xsl:text>
+						<xsl:choose>
+							<xsl:when test="tei:content/rng:empty">
+								<xsl:call-template name="emptySlash">
+									<xsl:with-param name="name">
+										<xsl:value-of
+											select="(tei:altIdent|@ident)[last()]" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of
+									select="(tei:altIdent|@ident)[last()]" />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:text>&gt;</xsl:text>
+					</ref>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>&lt;</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>&gt;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- debugging <xsl:template name="SHOW"> &lt;<xsl:value-of select="name()"/> 
+		<xsl:for-each select="@*"> <xsl:text> </xsl:text> <xsl:value-of select="name()"/>="<xsl:value-of 
+		select="."/>" </xsl:for-each> &gt; <xsl:for-each select="*"> <xsl:call-template 
+		name="SHOW"/> </xsl:for-each> &lt;/<xsl:value-of select="name()"/>&gt; </xsl:template> -->
+	<xsl:template name="emphasize">
+		<xsl:param name="class" />
+		<xsl:param name="content" />
+		<hi rend="{$class}">
+			<xsl:copy-of select="$content" />
+		</hi>
+	</xsl:template>
+	<xsl:template name="specHook">
+		<xsl:param name="name" />
+		<index indexName="ODDS">
+			<xsl:choose>
+				<xsl:when test="local-name()='macroSpec'">
+					<term>
+						<xsl:value-of select="$name" />
+						<xsl:text> (macro)</xsl:text>
+					</term>
+				</xsl:when>
+				<xsl:when
+					test="local-name()='classSpec' and        @type='model'">
+					<term>
+						<xsl:value-of select="$name" />
+						<xsl:text> (model class)</xsl:text>
+					</term>
+				</xsl:when>
+				<xsl:when
+					test="local-name()='classSpec' and        @type='atts'">
+					<term>
+						<xsl:value-of select="$name" />
+						<xsl:text> (attribute class)</xsl:text>
+					</term>
+					<xsl:for-each select=".//tei:attDef">
+						<index indexName="ODDS">
+							<term sortKey="{@ident}">
+								<xsl:text>@</xsl:text>
+								<xsl:value-of select="@ident" />
+							</term>
+						</index>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="local-name()='elementSpec'">
+					<term sortKey="{$name}">
+						<xsl:text>&lt;</xsl:text>
+						<xsl:value-of select="$name" />
+						<xsl:text>&gt;</xsl:text>
+					</term>
+					<xsl:for-each select=".//tei:attDef">
+						<index indexName="ODDS">
+							<term sortKey="{@ident}">
+								<xsl:text>@</xsl:text>
+								<xsl:value-of select="@ident" />
+							</term>
+						</index>
+					</xsl:for-each>
+				</xsl:when>
+			</xsl:choose>
+		</index>
+	</xsl:template>
 
--->
-  <xsl:template name="emphasize">
-      <xsl:param name="class"/>
-      <xsl:param name="content"/>
-      <hi rend="{$class}">
-         <xsl:copy-of select="$content"/>
-      </hi>
-  </xsl:template>
-  <xsl:template name="specHook">
-      <xsl:param name="name"/>
-      <index indexName="ODDS">
-         <xsl:choose>
-            <xsl:when test="local-name()='macroSpec'">
-               <term>
-                  <xsl:value-of select="$name"/>
-                  <xsl:text> (macro)</xsl:text>
-               </term>
-            </xsl:when>
-            <xsl:when test="local-name()='classSpec' and        @type='model'">
-               <term>
-                  <xsl:value-of select="$name"/>
-                  <xsl:text> (model class)</xsl:text>
-               </term>
-            </xsl:when>
-            <xsl:when test="local-name()='classSpec' and        @type='atts'">
-               <term>
-                  <xsl:value-of select="$name"/>
-                  <xsl:text> (attribute class)</xsl:text>
-               </term>
-               <xsl:for-each select=".//tei:attDef">
-                  <index indexName="ODDS">
-                     <term sortKey="{@ident}">
-                        <xsl:text>@</xsl:text>
-                        <xsl:value-of select="@ident"/>
-                     </term>
-                  </index>
-               </xsl:for-each>
-            </xsl:when>
-            <xsl:when test="local-name()='elementSpec'">
-               <term sortKey="{$name}">
-                  <xsl:text>&lt;</xsl:text>
-                  <xsl:value-of select="$name"/>
-                  <xsl:text>&gt;</xsl:text>
-               </term>
-               <xsl:for-each select=".//tei:attDef">
-                  <index indexName="ODDS">
-                     <term sortKey="{@ident}">
-                        <xsl:text>@</xsl:text>
-                        <xsl:value-of select="@ident"/>
-                     </term>
-                  </index>
-               </xsl:for-each>
-            </xsl:when>
-         </xsl:choose>
-      </index>
-  </xsl:template>
-
-  <xsl:template match="tei:schemaSpec">
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Processing schemaSpec <xsl:value-of select="@ident"/>, summaryDoc=<xsl:value-of select="$summaryDoc"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="$summaryDoc='true'">
-	   <div>
-	     <head>Schema <xsl:value-of select="@ident"/>: changed components</head>
-	     <xsl:for-each select="tei:classSpec[@mode or @rend='change']  
+	<xsl:template match="tei:schemaSpec">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Processing schemaSpec
+				<xsl:value-of select="@ident" />
+				, summaryDoc=
+				<xsl:value-of select="$summaryDoc" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="$summaryDoc='true'">
+				<div>
+					<head>
+						Schema
+						<xsl:value-of select="@ident" />
+						: changed components
+					</head>
+					<xsl:for-each
+						select="tei:classSpec[@mode or @rend='change']  
 				   | tei:macroSpec[(@mode or @rend='change')]  
 				   | tei:elementSpec[(@mode or @rend='change')]">
-	       <xsl:sort select="@ident"/>
-	       <xsl:apply-templates mode="weave" select="."/>
-	     </xsl:for-each>
-	   </div>
-	   <div>
-	   <head>Schema <xsl:value-of select="@ident"/>:  unchanged components</head>
-	   <table>
-	     <xsl:for-each select="tei:classSpec[not(@mode or @rend)]  
+						<xsl:sort select="@ident" />
+						<xsl:apply-templates mode="weave" select="." />
+					</xsl:for-each>
+				</div>
+				<div>
+					<head>
+						Schema
+						<xsl:value-of select="@ident" />
+						: unchanged components
+					</head>
+					<table>
+						<xsl:for-each
+							select="tei:classSpec[not(@mode or @rend)]  
 				   | tei:macroSpec[not(@mode or  @rend)]  
 				   | tei:elementSpec[not(@mode or @rend)]">
-	       <xsl:sort select="@ident"/>
-	       <row>
-		 <cell>
-		   <xsl:attribute name="xml:id">
-		     <xsl:value-of select="@ident"/>
+							<xsl:sort select="@ident" />
+							<row>
+								<cell>
+									<xsl:attribute name="xml:id">
+		     <xsl:value-of select="@ident" />
 		   </xsl:attribute>
-		   <hi>
-		     <ref target="http://www.tei-c.org/release/doc/tei-p5-doc/{$documentationLanguage}/html/ref-{@ident}.html">
-		       <xsl:value-of select="@ident"/>
-		     </ref>
-		     </hi>:
-		   <xsl:call-template name="makeDescription"/>
-		 </cell>
-	       </row>
-	     </xsl:for-each>
-	   </table>
-	   </div>
-	 </xsl:when>
-         <xsl:otherwise>
-	   <div>
-	     <head>Elements</head>
-	     <xsl:apply-templates mode="weave" select="tei:elementSpec">
-	       <xsl:sort select="@ident"/>
-	     </xsl:apply-templates>
-	   </div>
-	   <xsl:if test="tei:classSpec[@type='model']">
-	     <div>
-	       <head>Model classes</head>
-	       <xsl:apply-templates mode="weave" select="tei:classSpec[@type='model']">
-		 <xsl:sort select="@ident"/>
-	       </xsl:apply-templates>
-	     </div>
-	   </xsl:if>
-	   <xsl:if test="tei:classSpec[@type='atts']">
-	     <div>
-	       <head>Attribute classes</head>
-	       <xsl:apply-templates mode="weave" select="tei:classSpec[@type='atts']">
-		 <xsl:sort select="@ident"/>
-	       </xsl:apply-templates>
-	     </div>
-	   </xsl:if>
-	   <xsl:if test="tei:macroSpec">
-	     <div>
-	       <head>Macros</head>
-	       <xsl:apply-templates mode="weave" select="tei:macroSpec">
-		 <xsl:sort select="@ident"/>
-	       </xsl:apply-templates>
-	     </div>
-	   </xsl:if>
-	 </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+									<hi>
+										<ref
+											target="http://www.tei-c.org/release/doc/tei-p5-doc/{$documentationLanguage}/html/ref-{@ident}.html">
+											<xsl:value-of select="@ident" />
+										</ref>
+									</hi>
+									:
+									<xsl:call-template name="makeDescription" />
+								</cell>
+							</row>
+						</xsl:for-each>
+					</table>
+				</div>
+			</xsl:when>
+			<xsl:otherwise>
+				<div>
+					<head>Elements</head>
+					<xsl:apply-templates mode="weave"
+						select="tei:elementSpec">
+						<xsl:sort select="@ident" />
+					</xsl:apply-templates>
+				</div>
+				<xsl:if test="tei:classSpec[@type='model']">
+					<div>
+						<head>Model classes</head>
+						<xsl:apply-templates mode="weave"
+							select="tei:classSpec[@type='model']">
+							<xsl:sort select="@ident" />
+						</xsl:apply-templates>
+					</div>
+				</xsl:if>
+				<xsl:if test="tei:classSpec[@type='atts']">
+					<div>
+						<head>Attribute classes</head>
+						<xsl:apply-templates mode="weave"
+							select="tei:classSpec[@type='atts']">
+							<xsl:sort select="@ident" />
+						</xsl:apply-templates>
+					</div>
+				</xsl:if>
+				<xsl:if test="tei:macroSpec">
+					<div>
+						<head>Macros</head>
+						<xsl:apply-templates mode="weave"
+							select="tei:macroSpec">
+							<xsl:sort select="@ident" />
+						</xsl:apply-templates>
+					</div>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="applyRendition"/>
+	<xsl:template name="applyRendition" />
 
 
-  <xsl:template match="tei:gloss" mode="inLanguage">
-      <seg>
-         <xsl:copy-of select="@xml:lang"/>
-         <xsl:value-of select="."/>
-      </seg>
-  </xsl:template>
+	<xsl:template match="tei:gloss" mode="inLanguage">
+		<seg>
+			<xsl:copy-of select="@xml:lang" />
+			<xsl:value-of select="." />
+		</seg>
+	</xsl:template>
 
-  <xsl:template match="tei:desc" mode="inLanguage">
-      <seg>
-         <xsl:copy-of select="@xml:lang"/>
-         <xsl:apply-templates/>
-      </seg>
-  </xsl:template>
+	<xsl:template match="tei:desc" mode="inLanguage">
+		<seg>
+			<xsl:copy-of select="@xml:lang" />
+			<xsl:apply-templates />
+		</seg>
+	</xsl:template>
 
-  <xsl:template name="appReading">
-     <xsl:param name="lemma"/>
-     <xsl:param name="lemmawitness"/>
-     <xsl:param name="readings"/>
-     <xsl:value-of select="$lemma"/>
-  </xsl:template>
+	<xsl:template name="appReading">
+		<xsl:param name="lemma" />
+		<xsl:param name="lemmawitness" />
+		<xsl:param name="readings" />
+		<xsl:value-of select="$lemma" />
+	</xsl:template>
 
-  <xsl:template name="makeSpan">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template name="makeSpan">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="tei:listRef" mode="weave"/>
+	<xsl:template match="tei:listRef" mode="weave" />
 
-  <xsl:template match="tei:ref" mode="weave" priority="9">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="tei:ref" mode="weave" priority="9">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/guidelines.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/guidelines.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/guidelines.xsl	(revision 2397)
@@ -1,1264 +1,1422 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xlink rng tei teix xhtml a html xs xsl" version="2.0">
-  <xsl:param name="outputDir"><xsl:value-of select="$directory"/>/OPS</xsl:param>
-  <xsl:key name="EXAMPLES" match="teix:*[ancestor::teix:egXML]" use="concat(ancestor::tei:div[last()]/@xml:id,local-name())"/>
-  <xsl:key name="HEADS" match="tei:head" use="concat(@xml:lang,@corresp)"/>
-  <xsl:key name="BACKLINKS" match="teix:egXML[@corresp]" use="substring(@corresp,2)"/>
-  <xsl:key name="BACKLINKS" match="tei:ptr[@type='cit']" use="substring(@target,2)"/>
-  <heads xmlns="http://www.tei-c.org/ns/1.0">
-    <head xml:lang="fr" corresp="AB">À propos des Principes directeurs</head>
-    <head xml:lang="fr" corresp="AI">Mécanismes analytiques simples</head>
-    <head xml:lang="fr" corresp="BIB">Bibliographie</head>
-    <head xml:lang="fr" corresp="CC">Corpus linguistiques</head>
-    <head xml:lang="fr" corresp="CE">Degré de certitude et responsabilité</head>
-    <head xml:lang="fr" corresp="CH">Langues et jeux de caractères </head>
-    <head xml:lang="fr" corresp="CO">Éléments disponibles pour tous les documents TEI</head>
-    <head xml:lang="fr" corresp="COL">Colophon</head>
-    <head xml:lang="fr" corresp="dedication">Dédicace</head>
-    <head xml:lang="fr" corresp="DI">Dictionnaires</head>
-    <head xml:lang="fr" corresp="DR">Théâtre</head>
-    <head xml:lang="fr" corresp="DS">Structure textuelle par défaut</head>
-    <head xml:lang="fr" corresp="FS">Structures de traits</head>
-    <head xml:lang="fr" corresp="FT">Tableaux, formules et graphiques</head>
-    <head xml:lang="fr" corresp="GD">Graphes, réseaux et arbres</head>
-    <head xml:lang="fr" corresp="HD">En-tête TEI</head>
-    <head xml:lang="fr" corresp="MS">Description de manuscrits</head>
-    <head xml:lang="fr" corresp="ND">Noms, dates, personnes et lieux</head>
-    <head xml:lang="fr" corresp="NH">Structures non hiérarchiques</head>
-    <head xml:lang="fr" corresp="PH">Représentation de sources primaires</head>
-    <head xml:lang="fr" corresp="PREF">Préface et remerciements</head>
-    <head xml:lang="fr" corresp="PREFS">Notes préliminaires </head>
-    <head xml:lang="fr" corresp="REF-CLASSES-ATTS">Classes attributives</head>
-    <head xml:lang="fr" corresp="REF-CLASSES-MODEL">Classes structurales</head>
-    <head xml:lang="fr" corresp="REF-ELEMENTS">Éléments</head>
-    <head xml:lang="fr" corresp="REF-MACROS">Types de données et autres macros </head>
-    <head xml:lang="fr" corresp="SA">Liens, segmentation et alignement</head>
-    <head xml:lang="fr" corresp="SG">Petite introduction à XML</head>
-    <head xml:lang="fr" corresp="ST">Infrastructure de la TEI</head>
-    <head xml:lang="fr" corresp="TC">Apparat critique</head>
-    <head xml:lang="fr" corresp="TD">Éléments de déclaration d’un modèle</head>
-    <head xml:lang="fr" corresp="TitlePageVerso">Versions des Principes directeurs</head>
-    <head xml:lang="fr" corresp="TS">Transcriptions de la parole</head>
-    <head xml:lang="fr" corresp="USE">Utiliser la TEI</head>
-    <head xml:lang="fr" corresp="VE">Poésie</head>
-    <head xml:lang="fr" corresp="WD">Représentation des caractères et des
-glyphes non standard</head>
-    <head xml:lang="zh-TW" corresp="AI">簡易分析機制</head>
-    <head xml:lang="zh-TW" corresp="CE">確定程度與不確定程度</head>
-    <head xml:lang="zh-TW" corresp="CO">所有TEI文件所通用的元素</head>
-    <head xml:lang="zh-TW" corresp="CC">文集文本</head>
-    <head xml:lang="zh-TW" corresp="DI">紙本字典</head>
-    <head xml:lang="zh-TW" corresp="DR">劇本</head>
-    <head xml:lang="zh-TW" corresp="FT">表格、方程式與圖表</head>
-    <head xml:lang="zh-TW" corresp="WD">文字與字體說明</head>
-    <head xml:lang="zh-TW" corresp="HD">TEI標頭</head>
-    <head xml:lang="zh-TW" corresp="FS">功能結構 (Feature Structures)</head>
-    <head xml:lang="zh-TW" corresp="SA">Linking, segmentation and alignment連結、分割與隊列</head>
-    <head xml:lang="zh-TW" corresp="MS">寫本描述</head>
-    <head xml:lang="zh-TW" corresp="ND">名稱與日期</head>
-    <head xml:lang="zh-TW" corresp="GD">圖形、網絡與樹狀結構</head>
-    <head xml:lang="zh-TW" corresp="TS">轉錄的言詞</head>
-    <head xml:lang="zh-TW" corresp="TD">TEI模組說明</head>
-    <head xml:lang="zh-TW" corresp="ST">所有TEI模組可用的元素集、資料類型、巨集指令之宣告</head>
-    <head xml:lang="zh-TW" corresp="TC">學術編輯註解</head>
-    <head xml:lang="zh-TW" corresp="DS">預設文件結構</head>
-    <head xml:lang="zh-TW" corresp="PH">原文轉錄</head>
-    <head xml:lang="zh-TW" corresp="VE">韻文結構</head>
-    <head xml:lang="zh-TW" corresp="dedication">獻辭</head>
-    <head xml:lang="zh-TW" corresp="PREF">序言與致謝</head>
-    <head xml:lang="zh-TW" corresp="PREFS">序文的言辭</head>
-    <head xml:lang="zh-TW" corresp="REF-CLASSES-ATTS">屬性集</head>
-    <head xml:lang="zh-TW" corresp="REF-CLASSES-MODEL">元素集</head>
-    <head xml:lang="zh-TW" corresp="REF-ELEMENTS">元素</head>
-    <head xml:lang="zh-TW" corresp="REF-MACROS">資料類型與其他巨集指令</head>
-    <head xml:lang="zh-TW" corresp="USE">使用TEI</head>
-    <head xml:lang="zh-TW" corresp="SG">XML入門</head>
-    <head xml:lang="zh-TW" corresp="AB">關於</head>
-    <head xml:lang="it" corresp="USE">Come usare TEI</head>
-    <head xml:lang="it" corresp="SG">Una graduale introduzione a XML</head>
-    <head xml:lang="it" corresp="AB">Le presenti Linee Guida</head>
-    <head xml:lang="it" corresp="AI">Semplici meccanismi di analisi</head>
-    <head xml:lang="it" corresp="CE">Certezza e incertezza</head>
-    <head xml:lang="it" corresp="CO">Elementi comuni a tutti i documenti TEI</head>
-    <head xml:lang="it" corresp="CC">Corpus di testi</head>
-    <head xml:lang="it" corresp="DI">Dizionari a stampa</head>
-    <head xml:lang="it" corresp="DR">Testi per performance</head>
-    <head xml:lang="it" corresp="FT">Tabelle, formule e figure</head>
-    <head xml:lang="it" corresp="WD">Documentazione di caratteri non standard e glifi</head>
-    <head xml:lang="it" corresp="HD">L'intestazione TEI (TEI Header)</head>
-    <head xml:lang="it" corresp="FS">Strutture di configurazione (feature structures)</head>
-    <head xml:lang="it" corresp="SA">Collegamento, segmentazione e allineamento</head>
-    <head xml:lang="it" corresp="MS">Descrizione di manoscritti</head>
-    <head xml:lang="it" corresp="ND">Nomi e date</head>
-    <head xml:lang="it" corresp="GD">Grafici, reti e alberi</head>
-    <head xml:lang="it" corresp="TS">Trascrizione del parlato</head>
-    <head xml:lang="it" corresp="TD">Documentazione dei moduli TEI</head>
-    <head xml:lang="it" corresp="ST">Dichiarazione di classi, tipi di dati e macro
-</head>
-    <head xml:lang="it" corresp="TC">Apparato critico</head>
-    <head xml:lang="it" corresp="DS">Struttura standard del testo</head>
-    <head xml:lang="it" corresp="PH">Trascrizione di fonti primarie</head>
-    <head xml:lang="it" corresp="VE">Strutture poetiche</head>
-    <head xml:lang="it" corresp="COL">Colofone</head>
-    <head xml:lang="it" corresp="dedication">Dedica</head>
-    <head xml:lang="it" corresp="PREF">Prefazione e ringraziamenti</head>
-    <head xml:lang="it" corresp="PREFS">Note introduttive</head>
-    <head xml:lang="it" corresp="REF-CLASSES-ATTS">Classi di attributi</head>
-    <head xml:lang="it" corresp="REF-CLASSES-MODEL">Classi di modelli</head>
-    <head xml:lang="it" corresp="REF-ELEMENTS">Elementi</head>
-    <head xml:lang="it" corresp="REF-MACROS">Datatype e altre macro</head>
-    <head xml:lang="pt" corresp="AI">Mecanismos simples de análise</head>
-    <head xml:lang="pt" corresp="CE">Certeza e incerteza</head>
-    <head xml:lang="pt" corresp="CO">Elementos comuns a todos os documentos TEI</head>
-    <head xml:lang="pt" corresp="CC">Textos do corpora</head>
-    <head xml:lang="pt" corresp="DI">Dicionários impressos</head>
-    <head xml:lang="pt" corresp="DR">Textos de actuação</head>
-    <head xml:lang="pt" corresp="FT">Tabelas, fórmulas, e figuras</head>
-    <head xml:lang="pt" corresp="WD">Documentação dos carateres</head>
-    <head xml:lang="pt" corresp="HD">O cabeçalho TEI</head>
-    <head xml:lang="pt" corresp="FS">Estrutura das características</head>
-    <head xml:lang="pt" corresp="SA">Ligação, segmentação e alinhamento</head>
-    <head xml:lang="pt" corresp="MS">Descrição do manuscrito</head>
-    <head xml:lang="pt" corresp="ND">Nomes e datas</head>
-    <head xml:lang="pt" corresp="GD">Grafos, redes, e árvores</head>
-    <head xml:lang="pt" corresp="TS">Transcrição do discurso</head>
-    <head xml:lang="pt" corresp="TD">Documentação dos módulos TEI</head>
-    <head xml:lang="pt" corresp="ST">Declaraçoes de classes, tipos de dados, e macros disponíveis em todos os módulos  TEI </head>
-    <head xml:lang="pt" corresp="TC">Critical Apparatus</head>
-    <head xml:lang="pt" corresp="DS">Estrutura do texto por defeito</head>
-    <head xml:lang="pt" corresp="PH">Transcrição de fontes primárias</head>
-    <head xml:lang="pt" corresp="VE">Estrutura dos versos</head>
-    <head xml:lang="pt" corresp="COL">Colophon</head>
-    <head xml:lang="pt" corresp="dedication">Dedicação</head>
-    <head xml:lang="pt" corresp="PREF">Prefácio e agradecimentos</head>
-    <head xml:lang="pt" corresp="PREFS">Notas de prefácio</head>
-    <head xml:lang="pt" corresp="REF-CLASSES-ATTS">Classes dos atributos</head>
-    <head xml:lang="pt" corresp="REF-CLASSES-MODEL">Classes do modelo</head>
-    <head xml:lang="pt" corresp="REF-ELEMENTS">Elementos</head>
-    <head xml:lang="pt" corresp="REF-MACROS">Tipos de dados e outras macros</head>
-    <!-- keywords on the interface for Module -->
-    <head xml:lang="ja" corresp="AI">分析モジュール</head>
-    <head xml:lang="ja" corresp="CE">確信度モジュール</head>
-    <head xml:lang="ja" corresp="CO">コアモジュール</head>
-    <head xml:lang="ja" corresp="CC">コーパスモジュール</head>
-    <head xml:lang="ja" corresp="DI">辞書モジュール</head>
-    <head xml:lang="ja" corresp="DR">舞台芸術モジュール</head>
-    <head xml:lang="ja" corresp="FT">図表式モジュール</head>
-    <head xml:lang="ja" corresp="WD">外字モジュール</head>
-    <head xml:lang="ja" corresp="HD">ヘダーモジュール</head>
-    <head xml:lang="ja" corresp="FS">素性構造モジュール</head>
-    <head xml:lang="ja" corresp="SA">リンクモジュール</head>
-    <head xml:lang="ja" corresp="MS">手書きモジュール</head>
-    <head xml:lang="ja" corresp="ND">名前モジュール</head>
-    <head xml:lang="ja" corresp="GD">グラフモジュール</head>
-    <head xml:lang="ja" corresp="TS">発話モジュール</head>
-    <head xml:lang="ja" corresp="TD">タグ定義モジュール</head>
-    <head xml:lang="ja" corresp="TC">校勘モジュール</head>
-    <head xml:lang="ja" corresp="DS">テキスト構造モジュール</head>
-    <head xml:lang="ja" corresp="PH">転記モジュール</head>
-    <head xml:lang="ja" corresp="VE">韻文モジュール</head>
-    <!-- keywords on the interface for toc -->
-    <head xml:lang="ja" corresp="COL">コロフォン</head>
-    <head xml:lang="ja" corresp="dedication">献辞</head>
-    <head xml:lang="ja" corresp="PREF">序文と謝辞</head>
-    <head xml:lang="ja" corresp="PREFS">序文集</head>
-    <head xml:lang="ja" corresp="REF-CLASSES-ATTS">属性クラス</head>
-    <head xml:lang="ja" corresp="REF-CLASSES-MODEL">モデルクラス</head>
-    <head xml:lang="ja" corresp="REF-ELEMENTS">要素</head>
-    <!-- keywords on the interface for app.D -->
-    <head xml:lang="ja" corresp="REF-MACROS">データ型とマクロ</head>
-    <head xml:lang="ja" corresp="ST">TEIの基礎構造</head>
-    <head xml:lang="ja" corresp="AB">本ガイドラインについて</head>
-    <head xml:lang="ja" corresp="SG">XML入門</head>
-    <head xml:lang="ja" corresp="USE">TEIの使い方</head>
-    <head xml:lang="es" corresp="AI">Mecanismos analíticos simples</head>
-    <head xml:lang="es" corresp="CE">Certeza e incertidumbre</head>
-    <head xml:lang="es" corresp="CO">Elementos comunes a todos los documentos TEI</head>
-    <head xml:lang="es" corresp="CC">Textos de corpus</head>
-    <head xml:lang="es" corresp="DI">Diccionarios impresos</head>
-    <head xml:lang="es" corresp="DR">Textos teatrales</head>
-    <head xml:lang="es" corresp="FT">Tablas, fórmulas y figuras</head>
-    <head xml:lang="es" corresp="WD">Documentación de caracteres y glifos</head>
-    <head xml:lang="es" corresp="HD">La cabecera TEI</head>
-    <head xml:lang="es" corresp="FS">Estructuras de rasgos</head>
-    <head xml:lang="es" corresp="SA">Enlace, segmentación y alineación</head>
-    <head xml:lang="es" corresp="MS">Descripción de manuscritos</head>
-    <head xml:lang="es" corresp="ND">Nombres y fechas</head>
-    <head xml:lang="es" corresp="GD">Grafos, redes y árboles</head>
-    <head xml:lang="es" corresp="TS">Habla transcrita</head>
-    <head xml:lang="es" corresp="TD">Documentación de los módulos de TEI</head>
-    <head xml:lang="es" corresp="ST">Declaraciones de clases, tipos de datos y macros disponibles para todos los módulos TEI</head>
-    <head xml:lang="es" corresp="TC">Aparato crítico</head>
-    <head xml:lang="es" corresp="DS">Estructura textual por defecto</head>
-    <head xml:lang="es" corresp="PH">Transcripción de fuentes primarias</head>
-    <head xml:lang="es" corresp="VE">Estructuras de versos</head>
-    <head xml:lang="es" corresp="AB">Sobre estas directrices</head>
-    <head xml:lang="es" corresp="REF-CLASSES-ATTS">Clases de atributos</head>
-    <head xml:lang="es" corresp="REF-CLASSES-MODEL">Clases de modelos</head>
-    <head xml:lang="es" corresp="REF-ELEMENTS">Elementos</head>
-    <head xml:lang="es" corresp="SG">Una introducción suave a XML</head>
-    <head xml:lang="es" corresp="USE">Cómo usar TEI</head>
-    <!-- Catalan -->
-    <head xml:lang="ca" corresp="AI">Mecanismes analítics simples</head>
-    <head xml:lang="ca" corresp="CE">Certitud i incertitud</head>
-    <head xml:lang="ca" corresp="CO">Elements comuns a tots els documents TEI</head>
-    <head xml:lang="ca" corresp="CC">Textos de corpus</head>
-    <head xml:lang="ca" corresp="DI">Diccionaris impresos</head>
-    <head xml:lang="ca" corresp="DR">Textos teatrals</head>
-    <head xml:lang="ca" corresp="FT">Taules, fórmules i figures</head>
-    <head xml:lang="ca" corresp="WD">Documentació de caràcters i glifs</head>
-    <head xml:lang="ca" corresp="HD">L'encapçalament TEI</head>
-    <head xml:lang="ca" corresp="FS">Estructures de trets</head>
-    <head xml:lang="ca" corresp="SA">Enllaç, segmentació i alineació</head>
-    <head xml:lang="ca" corresp="MS">Descripció de manuscrits</head>
-    <head xml:lang="ca" corresp="ND">Noms i dates</head>
-    <head xml:lang="ca" corresp="GD">Grafs, xarxes i arbres</head>
-    <head xml:lang="ca" corresp="TS">Parla transcrita</head>
-    <head xml:lang="ca" corresp="TD">Documentació dels mòduls de TEI</head>
-    <head xml:lang="ca" corresp="ST">Declaracions de classes, tipus de dades i macros disponibles per a tots els mòduls TEI</head>
-    <head xml:lang="ca" corresp="TC">Aparat crític</head>
-    <head xml:lang="ca" corresp="DS">Estructura textual per defecte</head>
-    <head xml:lang="ca" corresp="PH">Transcripció de fonts primàries</head>
-    <head xml:lang="ca" corresp="VE">Estructures de versos</head>
-    <head xml:lang="ca" corresp="AB">Sobre aquestes directrius</head>
-    <head xml:lang="ca" corresp="REF-CLASSES-ATTS">Classes d'atributs</head>
-    <head xml:lang="ca" corresp="REF-CLASSES-MODEL">Classes de models</head>
-    <head xml:lang="ca" corresp="REF-ELEMENTS">Elements</head>
-    <head xml:lang="ca" corresp="SG">Una introducció suau a XML</head>
-    <head xml:lang="ca" corresp="USE">Com usar TEI</head>
-    <!-- German -->
-    <head xml:lang="de" corresp="AI">Einfache Analyse-Mechanismen</head>
-    <head xml:lang="de" corresp="CE">Zuverlässigkeit und Unsicherheit</head>
-    <head xml:lang="de" corresp="CO">Elemente, verfügbar in allen TEI-Dokumenten</head>
-    <head xml:lang="de" corresp="CC">Korpustexte</head>
-    <head xml:lang="de" corresp="DI">Gedruckte Wörterbücher</head>
-    <head xml:lang="de" corresp="DR">Zur Aufführung bestimmte Texte</head>
-    <head xml:lang="de" corresp="FT">Tabellen, Formeln und Abbildungen</head>
-    <head xml:lang="de" corresp="WD">Dokumentation von Zeichen und Glyphen</head>
-    <head xml:lang="de" corresp="HD">Der TEI-Header</head>
-    <head xml:lang="de" corresp="FS">Merkmalsstrukturen</head>
-    <head xml:lang="de" corresp="SA">Verlinken, Segmentieren und Parallelisieren</head>
-    <head xml:lang="de" corresp="MS">Handschriftenbeschreibung</head>
-    <head xml:lang="de" corresp="ND">Namen und Datumsangaben</head>
-    <head xml:lang="de" corresp="GD">Graphen, Netze und Bäume</head>
-    <head xml:lang="de" corresp="TS">Transkription gesprochener Sprache</head>
-    <head xml:lang="de" corresp="TD">Dokumentation zu den TEI-Modulen</head>
-    <head xml:lang="de" corresp="ST">Deklaration zu Klassen, Datentypen und Makros, verfügbar in allen TEI-Modulen</head>
-    <head xml:lang="de" corresp="TC">Kritische Apparate</head>
-    <head xml:lang="de" corresp="DS">Standard-Textstruktur</head>
-    <head xml:lang="de" corresp="PH">Transkription von Primärquellen</head>
-    <head xml:lang="de" corresp="VE">Vers-Strukturen</head>
-    <head xml:lang="kr" corresp="AI">단순 분석 기제</head>
-    <head xml:lang="kr" corresp="CE">확실성과 불확실성</head>
-    <head xml:lang="kr" corresp="CO">모든 TEI 문서에 공통된 요소들</head>
-    <head xml:lang="kr" corresp="CC">코퍼스 텍스트</head>
-    <head xml:lang="kr" corresp="DI">인쇄 사전</head>
-    <head xml:lang="kr" corresp="DR">공연 텍스트</head>
-    <head xml:lang="kr" corresp="FT">표, 식, 그림</head>
-    <head xml:lang="kr" corresp="WD">문자와 그림문자 문서</head>
-    <head xml:lang="kr" corresp="HD">TEI 헤더</head>
-    <head xml:lang="kr" corresp="FS">자질 구조</head>
-    <head xml:lang="kr" corresp="SA">연결, 분할, 정렬</head>
-    <head xml:lang="kr" corresp="MS">필사본 기술</head>
-    <head xml:lang="kr" corresp="ND">이름과 날짜</head>
-    <head xml:lang="kr" corresp="GD">그래프, 망, 수형도</head>
-    <head xml:lang="kr" corresp="TS">전사된 대화(말)</head>
-    <head xml:lang="kr" corresp="TD">TEI 모듈 문서</head>
-    <head xml:lang="kr" corresp="ST">모든 TEI 모듈에 사용되는 부류, 자료유형, 마크로를 위한 선언</head>
-    <head xml:lang="kr" corresp="TC">비평적 주석</head>
-    <head xml:lang="kr" corresp="DS">기본값 텍스트 구조</head>
-    <head xml:lang="kr" corresp="PH">일차 원전 전사</head>
-    <head xml:lang="kr" corresp="VE">운문 구조</head>
-    <head xml:lang="kr" corresp="COL">판권 면</head>
-    <head xml:lang="kr" corresp="dedication">헌정</head>
-    <head xml:lang="kr" corresp="PREF">서문과 사사 </head>
-    <head xml:lang="kr" corresp="PREFS">서문</head>
-    <head xml:lang="kr" corresp="REF-CLASSES-ATTS">속성 부류</head>
-    <head xml:lang="kr" corresp="REF-CLASSES-MODEL">모형 부류</head>
-    <head xml:lang="kr" corresp="REF-ELEMENTS">요소</head>
-    <head xml:lang="kr" corresp="REF-MACROS">자료유형과 다른 마크로</head>
-  </heads>
-  <xsl:template name="processTEIHook">
-    <xsl:for-each select="key('ELEMENTDOCS',1)">
-      <xsl:variable name="me" select="@ident"/>
-      <xsl:variable name="documentationLanguage">
-        <xsl:call-template name="generateDoc"/>
-      </xsl:variable>
-      <xsl:variable name="langs">
-        <xsl:value-of select="concat(normalize-space($documentationLanguage),' ')"/>
-      </xsl:variable>
-      <xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}" encoding="{$outputEncoding}" href="{$outputDir}/examples-{$me}.html" method="{$outputMethod}">
-        <html>
-          <xsl:comment>THIS IS A GENERATED FILE. DO NOT EDIT (10) </xsl:comment>
-          <head>
-            <title>
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">Example</xsl:with-param>
-              </xsl:call-template>
-              <xsl:text>: &lt;</xsl:text>
-              <xsl:value-of select="$me"/>
-              <xsl:text>&gt; </xsl:text>
-              <xsl:call-template name="makeGloss">
-                <xsl:with-param name="langs" select="$langs"/>
-              </xsl:call-template>
-            </title>
-            <xsl:call-template name="includeCSS"/>
-            <meta content="Text Encoding Initiative Consortium XSLT stylesheets" name="generator"/>
-            <meta name="DC.Title">
-              <xsl:attribute name="content">
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="xlink rng tei teix xhtml a html xs xsl"
+	version="2.0">
+	<xsl:param name="outputDir">
+		<xsl:value-of select="$directory" />
+		/OPS
+	</xsl:param>
+	<xsl:key name="EXAMPLES" match="teix:*[ancestor::teix:egXML]"
+		use="concat(ancestor::tei:div[last()]/@xml:id,local-name())" />
+	<xsl:key name="HEADS" match="tei:head"
+		use="concat(@xml:lang,@corresp)" />
+	<xsl:key name="BACKLINKS" match="teix:egXML[@corresp]"
+		use="substring(@corresp,2)" />
+	<xsl:key name="BACKLINKS" match="tei:ptr[@type='cit']"
+		use="substring(@target,2)" />
+	<heads xmlns="http://www.tei-c.org/ns/1.0">
+		<head xml:lang="fr" corresp="AB">À propos des Principes directeurs</head>
+		<head xml:lang="fr" corresp="AI">Mécanismes analytiques simples</head>
+		<head xml:lang="fr" corresp="BIB">Bibliographie</head>
+		<head xml:lang="fr" corresp="CC">Corpus linguistiques</head>
+		<head xml:lang="fr" corresp="CE">Degré de certitude et responsabilité</head>
+		<head xml:lang="fr" corresp="CH">Langues et jeux de caractères </head>
+		<head xml:lang="fr" corresp="CO">Éléments disponibles pour tous les
+			documents TEI</head>
+		<head xml:lang="fr" corresp="COL">Colophon</head>
+		<head xml:lang="fr" corresp="dedication">Dédicace</head>
+		<head xml:lang="fr" corresp="DI">Dictionnaires</head>
+		<head xml:lang="fr" corresp="DR">Théâtre</head>
+		<head xml:lang="fr" corresp="DS">Structure textuelle par défaut</head>
+		<head xml:lang="fr" corresp="FS">Structures de traits</head>
+		<head xml:lang="fr" corresp="FT">Tableaux, formules et graphiques</head>
+		<head xml:lang="fr" corresp="GD">Graphes, réseaux et arbres</head>
+		<head xml:lang="fr" corresp="HD">En-tête TEI</head>
+		<head xml:lang="fr" corresp="MS">Description de manuscrits</head>
+		<head xml:lang="fr" corresp="ND">Noms, dates, personnes et lieux</head>
+		<head xml:lang="fr" corresp="NH">Structures non hiérarchiques</head>
+		<head xml:lang="fr" corresp="PH">Représentation de sources primaires</head>
+		<head xml:lang="fr" corresp="PREF">Préface et remerciements</head>
+		<head xml:lang="fr" corresp="PREFS">Notes préliminaires </head>
+		<head xml:lang="fr" corresp="REF-CLASSES-ATTS">Classes attributives</head>
+		<head xml:lang="fr" corresp="REF-CLASSES-MODEL">Classes structurales</head>
+		<head xml:lang="fr" corresp="REF-ELEMENTS">Éléments</head>
+		<head xml:lang="fr" corresp="REF-MACROS">Types de données et autres macros </head>
+		<head xml:lang="fr" corresp="SA">Liens, segmentation et alignement</head>
+		<head xml:lang="fr" corresp="SG">Petite introduction à XML</head>
+		<head xml:lang="fr" corresp="ST">Infrastructure de la TEI</head>
+		<head xml:lang="fr" corresp="TC">Apparat critique</head>
+		<head xml:lang="fr" corresp="TD">Éléments de déclaration d’un modèle</head>
+		<head xml:lang="fr" corresp="TitlePageVerso">Versions des Principes directeurs</head>
+		<head xml:lang="fr" corresp="TS">Transcriptions de la parole</head>
+		<head xml:lang="fr" corresp="USE">Utiliser la TEI</head>
+		<head xml:lang="fr" corresp="VE">Poésie</head>
+		<head xml:lang="fr" corresp="WD">Représentation des caractères et des
+			glyphes non standard</head>
+		<head xml:lang="zh-TW" corresp="AI">簡易分析機制</head>
+		<head xml:lang="zh-TW" corresp="CE">確定程度與不確定程度</head>
+		<head xml:lang="zh-TW" corresp="CO">所有TEI文件所通用的元素</head>
+		<head xml:lang="zh-TW" corresp="CC">文集文本</head>
+		<head xml:lang="zh-TW" corresp="DI">紙本字典</head>
+		<head xml:lang="zh-TW" corresp="DR">劇本</head>
+		<head xml:lang="zh-TW" corresp="FT">表格、方程式與圖表</head>
+		<head xml:lang="zh-TW" corresp="WD">文字與字體說明</head>
+		<head xml:lang="zh-TW" corresp="HD">TEI標頭</head>
+		<head xml:lang="zh-TW" corresp="FS">功能結構 (Feature Structures)</head>
+		<head xml:lang="zh-TW" corresp="SA">Linking, segmentation and
+			alignment連結、分割與隊列</head>
+		<head xml:lang="zh-TW" corresp="MS">寫本描述</head>
+		<head xml:lang="zh-TW" corresp="ND">名稱與日期</head>
+		<head xml:lang="zh-TW" corresp="GD">圖形、網絡與樹狀結構</head>
+		<head xml:lang="zh-TW" corresp="TS">轉錄的言詞</head>
+		<head xml:lang="zh-TW" corresp="TD">TEI模組說明</head>
+		<head xml:lang="zh-TW" corresp="ST">所有TEI模組可用的元素集、資料類型、巨集指令之宣告</head>
+		<head xml:lang="zh-TW" corresp="TC">學術編輯註解</head>
+		<head xml:lang="zh-TW" corresp="DS">預設文件結構</head>
+		<head xml:lang="zh-TW" corresp="PH">原文轉錄</head>
+		<head xml:lang="zh-TW" corresp="VE">韻文結構</head>
+		<head xml:lang="zh-TW" corresp="dedication">獻辭</head>
+		<head xml:lang="zh-TW" corresp="PREF">序言與致謝</head>
+		<head xml:lang="zh-TW" corresp="PREFS">序文的言辭</head>
+		<head xml:lang="zh-TW" corresp="REF-CLASSES-ATTS">屬性集</head>
+		<head xml:lang="zh-TW" corresp="REF-CLASSES-MODEL">元素集</head>
+		<head xml:lang="zh-TW" corresp="REF-ELEMENTS">元素</head>
+		<head xml:lang="zh-TW" corresp="REF-MACROS">資料類型與其他巨集指令</head>
+		<head xml:lang="zh-TW" corresp="USE">使用TEI</head>
+		<head xml:lang="zh-TW" corresp="SG">XML入門</head>
+		<head xml:lang="zh-TW" corresp="AB">關於</head>
+		<head xml:lang="it" corresp="USE">Come usare TEI</head>
+		<head xml:lang="it" corresp="SG">Una graduale introduzione a XML</head>
+		<head xml:lang="it" corresp="AB">Le presenti Linee Guida</head>
+		<head xml:lang="it" corresp="AI">Semplici meccanismi di analisi</head>
+		<head xml:lang="it" corresp="CE">Certezza e incertezza</head>
+		<head xml:lang="it" corresp="CO">Elementi comuni a tutti i documenti
+			TEI</head>
+		<head xml:lang="it" corresp="CC">Corpus di testi</head>
+		<head xml:lang="it" corresp="DI">Dizionari a stampa</head>
+		<head xml:lang="it" corresp="DR">Testi per performance</head>
+		<head xml:lang="it" corresp="FT">Tabelle, formule e figure</head>
+		<head xml:lang="it" corresp="WD">Documentazione di caratteri non
+			standard e glifi</head>
+		<head xml:lang="it" corresp="HD">L'intestazione TEI (TEI Header)</head>
+		<head xml:lang="it" corresp="FS">Strutture di configurazione (feature
+			structures)</head>
+		<head xml:lang="it" corresp="SA">Collegamento, segmentazione e
+			allineamento</head>
+		<head xml:lang="it" corresp="MS">Descrizione di manoscritti</head>
+		<head xml:lang="it" corresp="ND">Nomi e date</head>
+		<head xml:lang="it" corresp="GD">Grafici, reti e alberi</head>
+		<head xml:lang="it" corresp="TS">Trascrizione del parlato</head>
+		<head xml:lang="it" corresp="TD">Documentazione dei moduli TEI</head>
+		<head xml:lang="it" corresp="ST">Dichiarazione di classi, tipi di dati
+			e macro
+		</head>
+		<head xml:lang="it" corresp="TC">Apparato critico</head>
+		<head xml:lang="it" corresp="DS">Struttura standard del testo</head>
+		<head xml:lang="it" corresp="PH">Trascrizione di fonti primarie</head>
+		<head xml:lang="it" corresp="VE">Strutture poetiche</head>
+		<head xml:lang="it" corresp="COL">Colofone</head>
+		<head xml:lang="it" corresp="dedication">Dedica</head>
+		<head xml:lang="it" corresp="PREF">Prefazione e ringraziamenti</head>
+		<head xml:lang="it" corresp="PREFS">Note introduttive</head>
+		<head xml:lang="it" corresp="REF-CLASSES-ATTS">Classi di attributi</head>
+		<head xml:lang="it" corresp="REF-CLASSES-MODEL">Classi di modelli</head>
+		<head xml:lang="it" corresp="REF-ELEMENTS">Elementi</head>
+		<head xml:lang="it" corresp="REF-MACROS">Datatype e altre macro</head>
+		<head xml:lang="pt" corresp="AI">Mecanismos simples de análise</head>
+		<head xml:lang="pt" corresp="CE">Certeza e incerteza</head>
+		<head xml:lang="pt" corresp="CO">Elementos comuns a todos os
+			documentos TEI</head>
+		<head xml:lang="pt" corresp="CC">Textos do corpora</head>
+		<head xml:lang="pt" corresp="DI">Dicionários impressos</head>
+		<head xml:lang="pt" corresp="DR">Textos de actuação</head>
+		<head xml:lang="pt" corresp="FT">Tabelas, fórmulas, e figuras</head>
+		<head xml:lang="pt" corresp="WD">Documentação dos carateres</head>
+		<head xml:lang="pt" corresp="HD">O cabeçalho TEI</head>
+		<head xml:lang="pt" corresp="FS">Estrutura das características</head>
+		<head xml:lang="pt" corresp="SA">Ligação, segmentação e alinhamento</head>
+		<head xml:lang="pt" corresp="MS">Descrição do manuscrito</head>
+		<head xml:lang="pt" corresp="ND">Nomes e datas</head>
+		<head xml:lang="pt" corresp="GD">Grafos, redes, e árvores</head>
+		<head xml:lang="pt" corresp="TS">Transcrição do discurso</head>
+		<head xml:lang="pt" corresp="TD">Documentação dos módulos TEI</head>
+		<head xml:lang="pt" corresp="ST">Declaraçoes de classes, tipos de
+			dados, e macros disponíveis em todos os módulos TEI </head>
+		<head xml:lang="pt" corresp="TC">Critical Apparatus</head>
+		<head xml:lang="pt" corresp="DS">Estrutura do texto por defeito</head>
+		<head xml:lang="pt" corresp="PH">Transcrição de fontes primárias</head>
+		<head xml:lang="pt" corresp="VE">Estrutura dos versos</head>
+		<head xml:lang="pt" corresp="COL">Colophon</head>
+		<head xml:lang="pt" corresp="dedication">Dedicação</head>
+		<head xml:lang="pt" corresp="PREF">Prefácio e agradecimentos</head>
+		<head xml:lang="pt" corresp="PREFS">Notas de prefácio</head>
+		<head xml:lang="pt" corresp="REF-CLASSES-ATTS">Classes dos atributos</head>
+		<head xml:lang="pt" corresp="REF-CLASSES-MODEL">Classes do modelo</head>
+		<head xml:lang="pt" corresp="REF-ELEMENTS">Elementos</head>
+		<head xml:lang="pt" corresp="REF-MACROS">Tipos de dados e outras macros</head>
+		<!-- keywords on the interface for Module -->
+		<head xml:lang="ja" corresp="AI">分析モジュール</head>
+		<head xml:lang="ja" corresp="CE">確信度モジュール</head>
+		<head xml:lang="ja" corresp="CO">コアモジュール</head>
+		<head xml:lang="ja" corresp="CC">コーパスモジュール</head>
+		<head xml:lang="ja" corresp="DI">辞書モジュール</head>
+		<head xml:lang="ja" corresp="DR">舞台芸術モジュール</head>
+		<head xml:lang="ja" corresp="FT">図表式モジュール</head>
+		<head xml:lang="ja" corresp="WD">外字モジュール</head>
+		<head xml:lang="ja" corresp="HD">ヘダーモジュール</head>
+		<head xml:lang="ja" corresp="FS">素性構造モジュール</head>
+		<head xml:lang="ja" corresp="SA">リンクモジュール</head>
+		<head xml:lang="ja" corresp="MS">手書きモジュール</head>
+		<head xml:lang="ja" corresp="ND">名前モジュール</head>
+		<head xml:lang="ja" corresp="GD">グラフモジュール</head>
+		<head xml:lang="ja" corresp="TS">発話モジュール</head>
+		<head xml:lang="ja" corresp="TD">タグ定義モジュール</head>
+		<head xml:lang="ja" corresp="TC">校勘モジュール</head>
+		<head xml:lang="ja" corresp="DS">テキスト構造モジュール</head>
+		<head xml:lang="ja" corresp="PH">転記モジュール</head>
+		<head xml:lang="ja" corresp="VE">韻文モジュール</head>
+		<!-- keywords on the interface for toc -->
+		<head xml:lang="ja" corresp="COL">コロフォン</head>
+		<head xml:lang="ja" corresp="dedication">献辞</head>
+		<head xml:lang="ja" corresp="PREF">序文と謝辞</head>
+		<head xml:lang="ja" corresp="PREFS">序文集</head>
+		<head xml:lang="ja" corresp="REF-CLASSES-ATTS">属性クラス</head>
+		<head xml:lang="ja" corresp="REF-CLASSES-MODEL">モデルクラス</head>
+		<head xml:lang="ja" corresp="REF-ELEMENTS">要素</head>
+		<!-- keywords on the interface for app.D -->
+		<head xml:lang="ja" corresp="REF-MACROS">データ型とマクロ</head>
+		<head xml:lang="ja" corresp="ST">TEIの基礎構造</head>
+		<head xml:lang="ja" corresp="AB">本ガイドラインについて</head>
+		<head xml:lang="ja" corresp="SG">XML入門</head>
+		<head xml:lang="ja" corresp="USE">TEIの使い方</head>
+		<head xml:lang="es" corresp="AI">Mecanismos analíticos simples</head>
+		<head xml:lang="es" corresp="CE">Certeza e incertidumbre</head>
+		<head xml:lang="es" corresp="CO">Elementos comunes a todos los
+			documentos TEI</head>
+		<head xml:lang="es" corresp="CC">Textos de corpus</head>
+		<head xml:lang="es" corresp="DI">Diccionarios impresos</head>
+		<head xml:lang="es" corresp="DR">Textos teatrales</head>
+		<head xml:lang="es" corresp="FT">Tablas, fórmulas y figuras</head>
+		<head xml:lang="es" corresp="WD">Documentación de caracteres y glifos</head>
+		<head xml:lang="es" corresp="HD">La cabecera TEI</head>
+		<head xml:lang="es" corresp="FS">Estructuras de rasgos</head>
+		<head xml:lang="es" corresp="SA">Enlace, segmentación y alineación</head>
+		<head xml:lang="es" corresp="MS">Descripción de manuscritos</head>
+		<head xml:lang="es" corresp="ND">Nombres y fechas</head>
+		<head xml:lang="es" corresp="GD">Grafos, redes y árboles</head>
+		<head xml:lang="es" corresp="TS">Habla transcrita</head>
+		<head xml:lang="es" corresp="TD">Documentación de los módulos de TEI</head>
+		<head xml:lang="es" corresp="ST">Declaraciones de clases, tipos de
+			datos y macros disponibles para todos los módulos TEI</head>
+		<head xml:lang="es" corresp="TC">Aparato crítico</head>
+		<head xml:lang="es" corresp="DS">Estructura textual por defecto</head>
+		<head xml:lang="es" corresp="PH">Transcripción de fuentes primarias</head>
+		<head xml:lang="es" corresp="VE">Estructuras de versos</head>
+		<head xml:lang="es" corresp="AB">Sobre estas directrices</head>
+		<head xml:lang="es" corresp="REF-CLASSES-ATTS">Clases de atributos</head>
+		<head xml:lang="es" corresp="REF-CLASSES-MODEL">Clases de modelos</head>
+		<head xml:lang="es" corresp="REF-ELEMENTS">Elementos</head>
+		<head xml:lang="es" corresp="SG">Una introducción suave a XML</head>
+		<head xml:lang="es" corresp="USE">Cómo usar TEI</head>
+		<!-- Catalan -->
+		<head xml:lang="ca" corresp="AI">Mecanismes analítics simples</head>
+		<head xml:lang="ca" corresp="CE">Certitud i incertitud</head>
+		<head xml:lang="ca" corresp="CO">Elements comuns a tots els documents
+			TEI</head>
+		<head xml:lang="ca" corresp="CC">Textos de corpus</head>
+		<head xml:lang="ca" corresp="DI">Diccionaris impresos</head>
+		<head xml:lang="ca" corresp="DR">Textos teatrals</head>
+		<head xml:lang="ca" corresp="FT">Taules, fórmules i figures</head>
+		<head xml:lang="ca" corresp="WD">Documentació de caràcters i glifs</head>
+		<head xml:lang="ca" corresp="HD">L'encapçalament TEI</head>
+		<head xml:lang="ca" corresp="FS">Estructures de trets</head>
+		<head xml:lang="ca" corresp="SA">Enllaç, segmentació i alineació</head>
+		<head xml:lang="ca" corresp="MS">Descripció de manuscrits</head>
+		<head xml:lang="ca" corresp="ND">Noms i dates</head>
+		<head xml:lang="ca" corresp="GD">Grafs, xarxes i arbres</head>
+		<head xml:lang="ca" corresp="TS">Parla transcrita</head>
+		<head xml:lang="ca" corresp="TD">Documentació dels mòduls de TEI</head>
+		<head xml:lang="ca" corresp="ST">Declaracions de classes, tipus de
+			dades i macros disponibles per a tots els mòduls TEI</head>
+		<head xml:lang="ca" corresp="TC">Aparat crític</head>
+		<head xml:lang="ca" corresp="DS">Estructura textual per defecte</head>
+		<head xml:lang="ca" corresp="PH">Transcripció de fonts primàries</head>
+		<head xml:lang="ca" corresp="VE">Estructures de versos</head>
+		<head xml:lang="ca" corresp="AB">Sobre aquestes directrius</head>
+		<head xml:lang="ca" corresp="REF-CLASSES-ATTS">Classes d'atributs</head>
+		<head xml:lang="ca" corresp="REF-CLASSES-MODEL">Classes de models</head>
+		<head xml:lang="ca" corresp="REF-ELEMENTS">Elements</head>
+		<head xml:lang="ca" corresp="SG">Una introducció suau a XML</head>
+		<head xml:lang="ca" corresp="USE">Com usar TEI</head>
+		<!-- German -->
+		<head xml:lang="de" corresp="AI">Einfache Analyse-Mechanismen</head>
+		<head xml:lang="de" corresp="CE">Zuverlässigkeit und Unsicherheit</head>
+		<head xml:lang="de" corresp="CO">Elemente, verfügbar in allen
+			TEI-Dokumenten</head>
+		<head xml:lang="de" corresp="CC">Korpustexte</head>
+		<head xml:lang="de" corresp="DI">Gedruckte Wörterbücher</head>
+		<head xml:lang="de" corresp="DR">Zur Aufführung bestimmte Texte</head>
+		<head xml:lang="de" corresp="FT">Tabellen, Formeln und Abbildungen</head>
+		<head xml:lang="de" corresp="WD">Dokumentation von Zeichen und Glyphen</head>
+		<head xml:lang="de" corresp="HD">Der TEI-Header</head>
+		<head xml:lang="de" corresp="FS">Merkmalsstrukturen</head>
+		<head xml:lang="de" corresp="SA">Verlinken, Segmentieren und
+			Parallelisieren</head>
+		<head xml:lang="de" corresp="MS">Handschriftenbeschreibung</head>
+		<head xml:lang="de" corresp="ND">Namen und Datumsangaben</head>
+		<head xml:lang="de" corresp="GD">Graphen, Netze und Bäume</head>
+		<head xml:lang="de" corresp="TS">Transkription gesprochener Sprache</head>
+		<head xml:lang="de" corresp="TD">Dokumentation zu den TEI-Modulen</head>
+		<head xml:lang="de" corresp="ST">Deklaration zu Klassen, Datentypen
+			und Makros, verfügbar in allen TEI-Modulen</head>
+		<head xml:lang="de" corresp="TC">Kritische Apparate</head>
+		<head xml:lang="de" corresp="DS">Standard-Textstruktur</head>
+		<head xml:lang="de" corresp="PH">Transkription von Primärquellen</head>
+		<head xml:lang="de" corresp="VE">Vers-Strukturen</head>
+		<head xml:lang="kr" corresp="AI">단순 분석 기제</head>
+		<head xml:lang="kr" corresp="CE">확실성과 불확실성</head>
+		<head xml:lang="kr" corresp="CO">모든 TEI 문서에 공통된 요소들</head>
+		<head xml:lang="kr" corresp="CC">코퍼스 텍스트</head>
+		<head xml:lang="kr" corresp="DI">인쇄 사전</head>
+		<head xml:lang="kr" corresp="DR">공연 텍스트</head>
+		<head xml:lang="kr" corresp="FT">표, 식, 그림</head>
+		<head xml:lang="kr" corresp="WD">문자와 그림문자 문서</head>
+		<head xml:lang="kr" corresp="HD">TEI 헤더</head>
+		<head xml:lang="kr" corresp="FS">자질 구조</head>
+		<head xml:lang="kr" corresp="SA">연결, 분할, 정렬</head>
+		<head xml:lang="kr" corresp="MS">필사본 기술</head>
+		<head xml:lang="kr" corresp="ND">이름과 날짜</head>
+		<head xml:lang="kr" corresp="GD">그래프, 망, 수형도</head>
+		<head xml:lang="kr" corresp="TS">전사된 대화(말)</head>
+		<head xml:lang="kr" corresp="TD">TEI 모듈 문서</head>
+		<head xml:lang="kr" corresp="ST">모든 TEI 모듈에 사용되는 부류, 자료유형, 마크로를 위한 선언</head>
+		<head xml:lang="kr" corresp="TC">비평적 주석</head>
+		<head xml:lang="kr" corresp="DS">기본값 텍스트 구조</head>
+		<head xml:lang="kr" corresp="PH">일차 원전 전사</head>
+		<head xml:lang="kr" corresp="VE">운문 구조</head>
+		<head xml:lang="kr" corresp="COL">판권 면</head>
+		<head xml:lang="kr" corresp="dedication">헌정</head>
+		<head xml:lang="kr" corresp="PREF">서문과 사사 </head>
+		<head xml:lang="kr" corresp="PREFS">서문</head>
+		<head xml:lang="kr" corresp="REF-CLASSES-ATTS">속성 부류</head>
+		<head xml:lang="kr" corresp="REF-CLASSES-MODEL">모형 부류</head>
+		<head xml:lang="kr" corresp="REF-ELEMENTS">요소</head>
+		<head xml:lang="kr" corresp="REF-MACROS">자료유형과 다른 마크로</head>
+	</heads>
+	<xsl:template name="processTEIHook">
+		<xsl:for-each select="key('ELEMENTDOCS',1)">
+			<xsl:variable name="me" select="@ident" />
+			<xsl:variable name="documentationLanguage">
+				<xsl:call-template name="generateDoc" />
+			</xsl:variable>
+			<xsl:variable name="langs">
+				<xsl:value-of
+					select="concat(normalize-space($documentationLanguage),' ')" />
+			</xsl:variable>
+			<xsl:result-document
+				doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}"
+				encoding="{$outputEncoding}" href="{$outputDir}/examples-{$me}.html"
+				method="{$outputMethod}">
+				<html>
+					<xsl:comment>
+						THIS IS A GENERATED FILE. DO NOT EDIT (10)
+					</xsl:comment>
+					<head>
+						<title>
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									Example
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:text>: &lt;</xsl:text>
+							<xsl:value-of select="$me" />
+							<xsl:text>&gt; </xsl:text>
+							<xsl:call-template name="makeGloss">
+								<xsl:with-param name="langs" select="$langs" />
+							</xsl:call-template>
+						</title>
+						<xsl:call-template name="includeCSS" />
+						<meta
+							content="Text Encoding Initiative Consortium XSLT stylesheets"
+							name="generator" />
+						<meta name="DC.Title">
+							<xsl:attribute name="content">
                 <xsl:call-template name="i18n">
                   <xsl:with-param name="word">Example</xsl:with-param>
                 </xsl:call-template>
                 <xsl:text>: </xsl:text>
-                <xsl:value-of select="$me"/>
+                <xsl:value-of select="$me" />
                 <xsl:text> </xsl:text>
                 <xsl:call-template name="makeGloss">
-                  <xsl:with-param name="langs" select="$langs"/>
+                  <xsl:with-param name="langs"
+								select="$langs" />
                 </xsl:call-template>
               </xsl:attribute>
-            </meta>
-            <meta content="application/xhtml+xml; charset=utf-8" http-equiv="Content-Type"/>
-            <xsl:call-template name="includeJavascript"/>
-            <xsl:call-template name="javascriptHook"/>
-          </head>
-          <body id="TOP">
-            <xsl:call-template name="guidelinesTop">
-              <xsl:with-param name="name">
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Example</xsl:with-param>
-                </xsl:call-template>
-                <xsl:text>: &lt;</xsl:text>
-                <xsl:value-of select="$me"/>
-                <xsl:text>&gt; </xsl:text>
-                <xsl:call-template name="makeGloss">
-                  <xsl:with-param name="langs" select="$langs"/>
-                </xsl:call-template>
-              </xsl:with-param>
-            </xsl:call-template>
-            <div class="main-content">
-              <xsl:call-template name="startDivHook"/>
-              <h3>
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Example</xsl:with-param>
-                </xsl:call-template>
-                <xsl:text>: &lt;</xsl:text>
-                <xsl:value-of select="$me"/>
-                <xsl:text>&gt; </xsl:text>
-                <xsl:call-template name="makeGloss">
-                  <xsl:with-param name="langs" select="$langs"/>
-                </xsl:call-template>
-              </h3>
-              <p>These search results reproduce every example of the
-	      use of <xsl:text>&lt;</xsl:text>
-	      <xsl:value-of select="$me"/>
-	      <xsl:text>&gt;</xsl:text> in the Guidelines, including all localised
-	      and translated versions. In some cases, the examples have been drawn
-	      from discussion of other elements in the Guidelines and illustrating
-	      the use of <xsl:text>&lt;</xsl:text>
-	      <xsl:value-of select="$me"/>
-	      <xsl:text>&gt;</xsl:text>
-	      is not the main 
-	      focus of the passage in question. In other cases, examples may be direct 
-	      translations of each other, and hence identical from the perspective of 
-	      their encoding.</p>
-              <xsl:variable name="items">
-                <xsl:for-each select="/tei:TEI/tei:text/tei:body/tei:div">
-                  <xsl:if test="count(key('EXAMPLES',concat(@xml:id,$me)))&gt;0">
-                    <li>
-                      <a href="#{@xml:id}">
-                        <xsl:call-template name="header"/>
-                      </a>
-                    </li>
-                  </xsl:if>
-                </xsl:for-each>
-              </xsl:variable>
-              <xsl:if test="count($items/html:li)&gt;0">
-                <ul>
-                  <xsl:copy-of select="$items/html:li"/>
-                </ul>
-              </xsl:if>
-              <xsl:for-each select="/tei:TEI/tei:text/tei:body/tei:div">
-                <xsl:if test="count(key('EXAMPLES',concat(@xml:id,$me)))&gt;0">
-                  <h4 id="{@xml:id}">
-                    <xsl:call-template name="header"/>
-                  </h4>
-                  <xsl:for-each select="key('EXAMPLES',concat(@xml:id,$me))">
-                    <xsl:variable name="pos">
-                      <xsl:number level="any" from="teix:egXML"/>
-                    </xsl:variable>
-                    <xsl:if test="number($pos)=1 or ($me='egXML' and         number($pos)=2)">
-                      <hr/>
-                      <p>
-                        <xsl:choose>
-                          <xsl:when test="ancestor::tei:elementSpec">
-                            <a href="ref-{ancestor::tei:elementSpec/@ident}.html">
-                              <xsl:text>&lt;</xsl:text>
-                              <xsl:value-of select="ancestor::tei:elementSpec/@ident"/>
-                              <xsl:text>&gt;</xsl:text>
-                            </a>
-                          </xsl:when>
-                          <xsl:when test="ancestor::tei:classSpec">
-                            <a href="ref-{ancestor::tei:classSpec/@ident}.html">
-                              <xsl:value-of select="ancestor::tei:classSpec/@ident"/>
-                            </a>
-                          </xsl:when>
-                          <xsl:otherwise>
-                            <xsl:for-each select="ancestor::tei:div[@xml:id and tei:head][1]">
-                              <a>
-                                <xsl:attribute name="href">
-                                  <xsl:apply-templates select="." mode="generateLink"/>
+						</meta>
+						<meta content="application/xhtml+xml; charset=utf-8"
+							http-equiv="Content-Type" />
+						<xsl:call-template name="includeJavascript" />
+						<xsl:call-template name="javascriptHook" />
+					</head>
+					<body id="TOP">
+						<xsl:call-template name="guidelinesTop">
+							<xsl:with-param name="name">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Example
+									</xsl:with-param>
+								</xsl:call-template>
+								<xsl:text>: &lt;</xsl:text>
+								<xsl:value-of select="$me" />
+								<xsl:text>&gt; </xsl:text>
+								<xsl:call-template name="makeGloss">
+									<xsl:with-param name="langs" select="$langs" />
+								</xsl:call-template>
+							</xsl:with-param>
+						</xsl:call-template>
+						<div class="main-content">
+							<xsl:call-template name="startDivHook" />
+							<h3>
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Example
+									</xsl:with-param>
+								</xsl:call-template>
+								<xsl:text>: &lt;</xsl:text>
+								<xsl:value-of select="$me" />
+								<xsl:text>&gt; </xsl:text>
+								<xsl:call-template name="makeGloss">
+									<xsl:with-param name="langs" select="$langs" />
+								</xsl:call-template>
+							</h3>
+							<p>
+								These search results reproduce every example of the
+								use of
+								<xsl:text>&lt;</xsl:text>
+								<xsl:value-of select="$me" />
+								<xsl:text>&gt;</xsl:text>
+								in the Guidelines, including all localised
+								and translated versions. In some cases, the examples have been
+								drawn
+								from discussion of other elements in the Guidelines and illustrating
+								the use of
+								<xsl:text>&lt;</xsl:text>
+								<xsl:value-of select="$me" />
+								<xsl:text>&gt;</xsl:text>
+								is not the main
+								focus of the passage in question. In other cases, examples may be
+								direct
+								translations of each other, and hence identical from the perspective of
+								their encoding.
+							</p>
+							<xsl:variable name="items">
+								<xsl:for-each
+									select="/tei:TEI/tei:text/tei:body/tei:div">
+									<xsl:if
+										test="count(key('EXAMPLES',concat(@xml:id,$me)))&gt;0">
+										<li>
+											<a href="#{@xml:id}">
+												<xsl:call-template name="header" />
+											</a>
+										</li>
+									</xsl:if>
+								</xsl:for-each>
+							</xsl:variable>
+							<xsl:if test="count($items/html:li)&gt;0">
+								<ul>
+									<xsl:copy-of select="$items/html:li" />
+								</ul>
+							</xsl:if>
+							<xsl:for-each
+								select="/tei:TEI/tei:text/tei:body/tei:div">
+								<xsl:if
+									test="count(key('EXAMPLES',concat(@xml:id,$me)))&gt;0">
+									<h4 id="{@xml:id}">
+										<xsl:call-template name="header" />
+									</h4>
+									<xsl:for-each
+										select="key('EXAMPLES',concat(@xml:id,$me))">
+										<xsl:variable name="pos">
+											<xsl:number level="any" from="teix:egXML" />
+										</xsl:variable>
+										<xsl:if
+											test="number($pos)=1 or ($me='egXML' and         number($pos)=2)">
+											<hr />
+											<p>
+												<xsl:choose>
+													<xsl:when test="ancestor::tei:elementSpec">
+														<a href="ref-{ancestor::tei:elementSpec/@ident}.html">
+															<xsl:text>&lt;</xsl:text>
+															<xsl:value-of
+																select="ancestor::tei:elementSpec/@ident" />
+															<xsl:text>&gt;</xsl:text>
+														</a>
+													</xsl:when>
+													<xsl:when test="ancestor::tei:classSpec">
+														<a href="ref-{ancestor::tei:classSpec/@ident}.html">
+															<xsl:value-of
+																select="ancestor::tei:classSpec/@ident" />
+														</a>
+													</xsl:when>
+													<xsl:otherwise>
+														<xsl:for-each
+															select="ancestor::tei:div[@xml:id and tei:head][1]">
+															<a>
+																<xsl:attribute name="href">
+                                  <xsl:apply-templates
+																	select="." mode="generateLink" />
                                 </xsl:attribute>
-                                <xsl:call-template name="header"/>
-                              </a>
-                            </xsl:for-each>
-                          </xsl:otherwise>
-                        </xsl:choose>
-                      </p>
-                      <xsl:apply-templates select="ancestor::teix:egXML">
-                        <xsl:with-param name="simple">true</xsl:with-param>
-                        <xsl:with-param name="highlight">
-                          <xsl:value-of select="$me"/>
-                        </xsl:with-param>
-                      </xsl:apply-templates>
-                    </xsl:if>
-                  </xsl:for-each>
-                </xsl:if>
-              </xsl:for-each>
-            </div>
-            <xsl:call-template name="stdfooter">
-              <xsl:with-param name="file">
-                <xsl:text>examples-</xsl:text>
-                <xsl:value-of select="$me"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </body>
-        </html>
-      </xsl:result-document>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="metaHTML">
-    <xsl:param name="title"/>
-    <meta name="Language" content="{$documentationLanguage}"/>
-    <meta name="DC.Title" content="{$title}"/>
-    <meta name="DC.Language" content="(SCHEME=iso639) {$documentationLanguage}"/>
-    <meta name="DC.Creator" content="TEI, Oxford University Computing Services, 13 Banbury Road, Oxford OX2 6NN, United Kingdom"/>
-    <meta name="DC.Creator.Address" content="tei@oucs.ox.ac.uk"/>
-    <meta content="application/xhtml+xml; charset=utf-8" http-equiv="Content-Type"/>
-  </xsl:template>
-  <xsl:template name="startDivHook">
-      <xsl:if test="($outputTarget='epub' or $outputTarget='epub3') and not(parent::tei:div)">
-        <h2>
-          <xsl:call-template name="header"/>
-        </h2>
-      </xsl:if>
-    <xsl:if test="not(parent::tei:div) or not(local-name(preceding::*[1])='head')">
-      <div>
-        <xsl:if test="$outputTarget='epub' or $outputTarget='epub3'">
-          <xsl:attribute name="style">
+																<xsl:call-template name="header" />
+															</a>
+														</xsl:for-each>
+													</xsl:otherwise>
+												</xsl:choose>
+											</p>
+											<xsl:apply-templates
+												select="ancestor::teix:egXML">
+												<xsl:with-param name="simple">
+													true
+												</xsl:with-param>
+												<xsl:with-param name="highlight">
+													<xsl:value-of select="$me" />
+												</xsl:with-param>
+											</xsl:apply-templates>
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:if>
+							</xsl:for-each>
+						</div>
+						<xsl:call-template name="stdfooter">
+							<xsl:with-param name="file">
+								<xsl:text>examples-</xsl:text>
+								<xsl:value-of select="$me" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</body>
+				</html>
+			</xsl:result-document>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="metaHTML">
+		<xsl:param name="title" />
+		<meta name="Language" content="{$documentationLanguage}" />
+		<meta name="DC.Title" content="{$title}" />
+		<meta name="DC.Language"
+			content="(SCHEME=iso639) {$documentationLanguage}" />
+		<meta name="DC.Creator"
+			content="TEI, Oxford University Computing Services, 13 Banbury Road, Oxford OX2 6NN, United Kingdom" />
+		<meta name="DC.Creator.Address" content="tei@oucs.ox.ac.uk" />
+		<meta content="application/xhtml+xml; charset=utf-8"
+			http-equiv="Content-Type" />
+	</xsl:template>
+	<xsl:template name="startDivHook">
+		<xsl:if
+			test="($outputTarget='epub' or $outputTarget='epub3') and not(parent::tei:div)">
+			<h2>
+				<xsl:call-template name="header" />
+			</h2>
+		</xsl:if>
+		<xsl:if
+			test="not(parent::tei:div) or not(local-name(preceding::*[1])='head')">
+			<div>
+				<xsl:if test="$outputTarget='epub' or $outputTarget='epub3'">
+					<xsl:attribute name="style">
             <xsl:text>margin-top: 0em;</xsl:text>
           </xsl:attribute>
-        </xsl:if>
-        <xsl:choose>
-          <xsl:when test="not(parent::tei:div) and child::tei:div">
-            <xsl:attribute name="class">
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="not(parent::tei:div) and child::tei:div">
+						<xsl:attribute name="class">
               <xsl:text>miniTOC miniTOC_left</xsl:text>
             </xsl:attribute>
-            <xsl:call-template name="subtoc"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:attribute name="class">
+						<xsl:call-template name="subtoc" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:attribute name="class">
               <xsl:text>miniTOC miniTOC_right</xsl:text>
             </xsl:attribute>
-          </xsl:otherwise>
-        </xsl:choose>
-        <ul class="subtoc">
-          <li class="subtoc">
-            <xsl:call-template name="previousLink"/>
-          </li>
-          <li class="subtoc">
-            <xsl:call-template name="nextLink"/>
-          </li>
-          <li class="subtoc">
-            <a class="navigation" href="index.html">
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">homeWord</xsl:with-param>
-              </xsl:call-template>
-            </a>
-            <xsl:text> | </xsl:text>
-            <a class="navigation" href="index-toc.html">
-              <xsl:call-template name="i18n">
-                <xsl:with-param name="word">tocWords</xsl:with-param>
-              </xsl:call-template>
-            </a>
-          </li>
-          <li class="subtoc">
-            <xsl:choose>
-              <xsl:when test="self::tei:elementSpec">
-                <a class="navigation" href="REF-ELEMENTS.html">
-                  <xsl:call-template name="showHead">
-                    <xsl:with-param name="ID">
-                      <xsl:text>REF-ELEMENTS</xsl:text>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </a>
-              </xsl:when>
-              <xsl:when test="self::tei:classSpec[@type='model']">
-                <a class="navigation" href="REF-CLASSES-MODEL.html">
-                  <xsl:call-template name="showHead">
-                    <xsl:with-param name="ID">
-                      <xsl:text>REF-CLASSES-MODEL</xsl:text>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </a>
-              </xsl:when>
-              <xsl:when test="self::tei:classSpec[@type='atts']">
-                <a class="navigation" href="REF-CLASSES-ATTS.html">
-                  <xsl:call-template name="showHead">
-                    <xsl:with-param name="ID">
-                      <xsl:text>REF-CLASSES-ATTS</xsl:text>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </a>
-              </xsl:when>
-              <xsl:when test="self::tei:macroSpec">
-                <a class="navigation" href="REF-MACROS.html">
-                  <xsl:call-template name="showHead">
-                    <xsl:with-param name="ID">
-                      <xsl:text>REF-MACROS</xsl:text>
-                    </xsl:with-param>
-                  </xsl:call-template>
-                </a>
-              </xsl:when>
-            </xsl:choose>
-          </li>
-        </ul>
-      </div>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template name="mainPage">
-    <xsl:param name="currentID"/>
-    <xsl:call-template name="guidelinesTop"/>
-    <div id="onecol" class="main-content">
-      <xsl:call-template name="mainFrame">
-        <xsl:with-param name="currentID" select="$currentID"/>
-        <xsl:with-param name="minimal">true</xsl:with-param>
-      </xsl:call-template>
-      <xsl:if test="$currentID=''">
-        <div style="float:left; margin:4%;">
-          <h3>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">Versions of the Guidelines</xsl:with-param>
-            </xsl:call-template>
-          </h3>
-          <ul>
-            <li>
-              <a href="index-toc.html">
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">tocWords</xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <xsl:if test="$outputTarget='html'">
-              <li>
-                <a href="../../en/Guidelines.pdf">PDF</a>
-              </li>
-            </xsl:if>
-            <li>
-              <a href="http://www.tei-c.org/Council/tcw06.xml">
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Getting the most recent version</xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="http://tei.svn.sourceforge.net/viewvc/tei/">
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">Sourceforge Subversion Repository</xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="http://sourceforge.net/tracker/?group_id=106328&amp;func=browse">
-                <xsl:call-template name="i18n">
-                  <xsl:with-param name="word">BugsFeatures</xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-          </ul>
-        </div>
-        <div style="float:left; margin:4%;">
-          <h3>
-            <xsl:call-template name="i18n">
-              <xsl:with-param name="word">Some Popular Sections</xsl:with-param>
-            </xsl:call-template>
-          </h3>
-          <ul>
-            <li>
-              <a href="AB.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>AB</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="SG.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>SG</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="ST.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>ST</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="HD.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>HD</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="CO.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>CO</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="USE.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>USE</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="REF-CLASSES-MODEL.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>REF-CLASSES-MODEL</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="REF-CLASSES-ATTS.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>REF-CLASSES-ATTS</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-            <li>
-              <a href="REF-ELEMENTS.html">
-                <xsl:call-template name="showHead">
-                  <xsl:with-param name="ID">
-                    <xsl:text>REF-ELEMENTS</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </a>
-            </li>
-          </ul>
-        </div>
-        <xsl:variable name="name">TEI Guidelines TOC </xsl:variable>
-        <xsl:variable name="outName">
-          <xsl:call-template name="outputChunkName">
-            <xsl:with-param name="ident">
-              <xsl:text>index-toc</xsl:text>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:variable>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Opening file <xsl:value-of select="$outName"/></xsl:message>
-        </xsl:if>
-        <xsl:result-document 
-	    doctype-public="{$doctypePublic}"
-	    omit-xml-declaration="yes"
-	    doctype-system="{$doctypeSystem}" 
-	    encoding="{$outputEncoding}" 
-	    href="{$outName}" 
-	    method="{$outputMethod}">
-          <html>
-            <xsl:comment>THIS IS A GENERATED FILE. DO NOT EDIT (8) </xsl:comment>
-            <head>
-              <title>
-                <xsl:value-of select="$name"/>
-              </title>
-              <xsl:call-template name="includeCSS"/>
-              <meta content="Text Encoding Initiative Consortium XSLT stylesheets" name="generator"/>
-              <meta content="{$name}" name="DC.Title"/>
-              <meta content="application/xhtml+xml; charset=utf-8" http-equiv="Content-Type"/>
-              <xsl:call-template name="includeJavascript"/>
-              <xsl:call-template name="javascriptHook"/>
-            </head>
-            <body id="TOP">
-              <xsl:call-template name="bodyHook"/>
-              <xsl:call-template name="guidelinesTop"/>
-              <div id="onecol" class="main-content">
-                <xsl:call-template name="mainTOC"/>
-              </div>
-              <xsl:call-template name="stdfooter"/>
-            </body>
-          </html>
-        </xsl:result-document>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Closing file <xsl:value-of select="$outName"/></xsl:message>
-        </xsl:if>
-      </xsl:if>
-    </div>
-  </xsl:template>
-  <xsl:template name="showHead">
-    <xsl:param name="ID"/>
-    <xsl:variable name="Here" select="/"/>
-    <xsl:for-each select="id($ID)">
-      <xsl:choose>
-        <xsl:when test="ancestor::tei:front">
-          <xsl:number format="i"/>
-        </xsl:when>
-        <xsl:when test="ancestor::tei:back">
-          <xsl:number format="A"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:number/>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text> </xsl:text>
-    </xsl:for-each>
-    <xsl:for-each select="document('')">
-      <xsl:choose>
-        <xsl:when test="key('HEADS',concat($documentationLanguage,$ID))">
-          <xsl:for-each select="key('HEADS',concat($documentationLanguage,$ID))">
-            <xsl:value-of select="."/>
-          </xsl:for-each>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:for-each select="$Here">
-            <xsl:for-each select="id($ID)">
-              <xsl:value-of select="tei:head"/>
-            </xsl:for-each>
-          </xsl:for-each>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="numberFrontDiv">
-    <xsl:param name="minimal"/>
-    <xsl:if test="count(ancestor::tei:div)&lt;2">
-      <xsl:number count="tei:div" format="i.1.1." level="multiple"/>
-      <xsl:if test="$minimal='false'">
-        <xsl:value-of select="$numberSpacer"/>
-      </xsl:if>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template name="pageHeader">
-    <xsl:param name="mode"/>
-    <xsl:call-template name="makeHTMLHeading">
-      <xsl:with-param name="class">title</xsl:with-param>
-      <xsl:with-param name="text">
-        <xsl:call-template name="generateTitle"/>
-      </xsl:with-param>
-      <xsl:with-param name="level">1</xsl:with-param>
-    </xsl:call-template>
-    <xsl:call-template name="makeHTMLHeading">
-      <xsl:with-param name="class">subtitle</xsl:with-param>
-      <xsl:with-param name="text">
-        <xsl:call-template name="generateSubTitle"/>
-      </xsl:with-param>
-      <xsl:with-param name="level">2</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="stdheader">
-    <xsl:param name="title" select="'(no title)'"/>
-    <xsl:call-template name="pageHeader"/>
-  </xsl:template>
-  <xsl:template match="tei:titlePage">
-    <!--
-	<div class="titlePage">
-	<h1>
-	<xsl:apply-templates
-	select="tei:docTitle/tei:titlePart/tei:title"/>
-	</h1>
-	<h2>
-	<xsl:value-of select="tei:docAuthor"/>
-	</h2>
-	</div>
-    -->
-  </xsl:template>
-  <xsl:template name="continuedToc">
-    <xsl:if test="tei:div">
-      <ul class="continuedtoc">
-        <xsl:apply-templates mode="maketoc" select="tei:div"/>
-      </ul>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:div" mode="maketoc">
-    <xsl:param name="forcedepth"/>
-    <xsl:variable name="myName">
-      <xsl:value-of select="local-name(.)"/>
-    </xsl:variable>
-    <xsl:if test="tei:head or $autoHead='true'">
-      <xsl:variable name="Depth">
-        <xsl:choose>
-          <xsl:when test="not($forcedepth='')">
-            <xsl:value-of select="$forcedepth"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="$tocDepth"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="thislevel">
-        <xsl:value-of select="count(ancestor::tei:div)"/>
-      </xsl:variable>
-      <xsl:variable name="pointer">
-        <xsl:apply-templates mode="generateLink" select="."/>
-      </xsl:variable>
-      <li>
-        <xsl:choose>
-	  <xsl:when test="$outputTarget='epub' or $outputTarget='epub3'"/>
-          <xsl:when test="not(ancestor::tei:div) and tei:div">
-            <xsl:attribute name="class">
+					</xsl:otherwise>
+				</xsl:choose>
+				<ul class="subtoc">
+					<li class="subtoc">
+						<xsl:call-template name="previousLink" />
+					</li>
+					<li class="subtoc">
+						<xsl:call-template name="nextLink" />
+					</li>
+					<li class="subtoc">
+						<a class="navigation" href="index.html">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									homeWord
+								</xsl:with-param>
+							</xsl:call-template>
+						</a>
+						<xsl:text> | </xsl:text>
+						<a class="navigation" href="index-toc.html">
+							<xsl:call-template name="i18n">
+								<xsl:with-param name="word">
+									tocWords
+								</xsl:with-param>
+							</xsl:call-template>
+						</a>
+					</li>
+					<li class="subtoc">
+						<xsl:choose>
+							<xsl:when test="self::tei:elementSpec">
+								<a class="navigation" href="REF-ELEMENTS.html">
+									<xsl:call-template name="showHead">
+										<xsl:with-param name="ID">
+											<xsl:text>REF-ELEMENTS</xsl:text>
+										</xsl:with-param>
+									</xsl:call-template>
+								</a>
+							</xsl:when>
+							<xsl:when test="self::tei:classSpec[@type='model']">
+								<a class="navigation" href="REF-CLASSES-MODEL.html">
+									<xsl:call-template name="showHead">
+										<xsl:with-param name="ID">
+											<xsl:text>REF-CLASSES-MODEL</xsl:text>
+										</xsl:with-param>
+									</xsl:call-template>
+								</a>
+							</xsl:when>
+							<xsl:when test="self::tei:classSpec[@type='atts']">
+								<a class="navigation" href="REF-CLASSES-ATTS.html">
+									<xsl:call-template name="showHead">
+										<xsl:with-param name="ID">
+											<xsl:text>REF-CLASSES-ATTS</xsl:text>
+										</xsl:with-param>
+									</xsl:call-template>
+								</a>
+							</xsl:when>
+							<xsl:when test="self::tei:macroSpec">
+								<a class="navigation" href="REF-MACROS.html">
+									<xsl:call-template name="showHead">
+										<xsl:with-param name="ID">
+											<xsl:text>REF-MACROS</xsl:text>
+										</xsl:with-param>
+									</xsl:call-template>
+								</a>
+							</xsl:when>
+						</xsl:choose>
+					</li>
+				</ul>
+			</div>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="mainPage">
+		<xsl:param name="currentID" />
+		<xsl:call-template name="guidelinesTop" />
+		<div id="onecol" class="main-content">
+			<xsl:call-template name="mainFrame">
+				<xsl:with-param name="currentID" select="$currentID" />
+				<xsl:with-param name="minimal">
+					true
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:if test="$currentID=''">
+				<div style="float:left; margin:4%;">
+					<h3>
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								Versions of the Guidelines
+							</xsl:with-param>
+						</xsl:call-template>
+					</h3>
+					<ul>
+						<li>
+							<a href="index-toc.html">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										tocWords
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<xsl:if test="$outputTarget='html'">
+							<li>
+								<a href="../../en/Guidelines.pdf">PDF</a>
+							</li>
+						</xsl:if>
+						<li>
+							<a href="http://www.tei-c.org/Council/tcw06.xml">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Getting the most recent version
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="http://tei.svn.sourceforge.net/viewvc/tei/">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										Sourceforge Subversion Repository
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a
+								href="http://sourceforge.net/tracker/?group_id=106328&amp;func=browse">
+								<xsl:call-template name="i18n">
+									<xsl:with-param name="word">
+										BugsFeatures
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+					</ul>
+				</div>
+				<div style="float:left; margin:4%;">
+					<h3>
+						<xsl:call-template name="i18n">
+							<xsl:with-param name="word">
+								Some Popular Sections
+							</xsl:with-param>
+						</xsl:call-template>
+					</h3>
+					<ul>
+						<li>
+							<a href="AB.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>AB</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="SG.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>SG</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="ST.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>ST</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="HD.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>HD</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="CO.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>CO</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="USE.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>USE</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="REF-CLASSES-MODEL.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>REF-CLASSES-MODEL</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="REF-CLASSES-ATTS.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>REF-CLASSES-ATTS</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+						<li>
+							<a href="REF-ELEMENTS.html">
+								<xsl:call-template name="showHead">
+									<xsl:with-param name="ID">
+										<xsl:text>REF-ELEMENTS</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</a>
+						</li>
+					</ul>
+				</div>
+				<xsl:variable name="name">
+					TEI Guidelines TOC
+				</xsl:variable>
+				<xsl:variable name="outName">
+					<xsl:call-template name="outputChunkName">
+						<xsl:with-param name="ident">
+							<xsl:text>index-toc</xsl:text>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Opening file
+						<xsl:value-of select="$outName" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:result-document
+					doctype-public="{$doctypePublic}" omit-xml-declaration="yes"
+					doctype-system="{$doctypeSystem}" encoding="{$outputEncoding}"
+					href="{$outName}" method="{$outputMethod}">
+					<html>
+						<xsl:comment>
+							THIS IS A GENERATED FILE. DO NOT EDIT (8)
+						</xsl:comment>
+						<head>
+							<title>
+								<xsl:value-of select="$name" />
+							</title>
+							<xsl:call-template name="includeCSS" />
+							<meta
+								content="Text Encoding Initiative Consortium XSLT stylesheets"
+								name="generator" />
+							<meta content="{$name}" name="DC.Title" />
+							<meta content="application/xhtml+xml; charset=utf-8"
+								http-equiv="Content-Type" />
+							<xsl:call-template name="includeJavascript" />
+							<xsl:call-template name="javascriptHook" />
+						</head>
+						<body id="TOP">
+							<xsl:call-template name="bodyHook" />
+							<xsl:call-template name="guidelinesTop" />
+							<div id="onecol" class="main-content">
+								<xsl:call-template name="mainTOC" />
+							</div>
+							<xsl:call-template name="stdfooter" />
+						</body>
+					</html>
+				</xsl:result-document>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Closing file
+						<xsl:value-of select="$outName" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:if>
+		</div>
+	</xsl:template>
+	<xsl:template name="showHead">
+		<xsl:param name="ID" />
+		<xsl:variable name="Here" select="/" />
+		<xsl:for-each select="id($ID)">
+			<xsl:choose>
+				<xsl:when test="ancestor::tei:front">
+					<xsl:number format="i" />
+				</xsl:when>
+				<xsl:when test="ancestor::tei:back">
+					<xsl:number format="A" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:number />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text> </xsl:text>
+		</xsl:for-each>
+		<xsl:for-each select="document('')">
+			<xsl:choose>
+				<xsl:when
+					test="key('HEADS',concat($documentationLanguage,$ID))">
+					<xsl:for-each
+						select="key('HEADS',concat($documentationLanguage,$ID))">
+						<xsl:value-of select="." />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:for-each select="$Here">
+						<xsl:for-each select="id($ID)">
+							<xsl:value-of select="tei:head" />
+						</xsl:for-each>
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="numberFrontDiv">
+		<xsl:param name="minimal" />
+		<xsl:if test="count(ancestor::tei:div)&lt;2">
+			<xsl:number count="tei:div" format="i.1.1."
+				level="multiple" />
+			<xsl:if test="$minimal='false'">
+				<xsl:value-of select="$numberSpacer" />
+			</xsl:if>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="pageHeader">
+		<xsl:param name="mode" />
+		<xsl:call-template name="makeHTMLHeading">
+			<xsl:with-param name="class">
+				title
+			</xsl:with-param>
+			<xsl:with-param name="text">
+				<xsl:call-template name="generateTitle" />
+			</xsl:with-param>
+			<xsl:with-param name="level">
+				1
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:call-template name="makeHTMLHeading">
+			<xsl:with-param name="class">
+				subtitle
+			</xsl:with-param>
+			<xsl:with-param name="text">
+				<xsl:call-template name="generateSubTitle" />
+			</xsl:with-param>
+			<xsl:with-param name="level">
+				2
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="stdheader">
+		<xsl:param name="title" select="'(no title)'" />
+		<xsl:call-template name="pageHeader" />
+	</xsl:template>
+	<xsl:template match="tei:titlePage">
+		<!-- <div class="titlePage"> <h1> <xsl:apply-templates select="tei:docTitle/tei:titlePart/tei:title"/> 
+			</h1> <h2> <xsl:value-of select="tei:docAuthor"/> </h2> </div> -->
+	</xsl:template>
+	<xsl:template name="continuedToc">
+		<xsl:if test="tei:div">
+			<ul class="continuedtoc">
+				<xsl:apply-templates mode="maketoc"
+					select="tei:div" />
+			</ul>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="tei:div" mode="maketoc">
+		<xsl:param name="forcedepth" />
+		<xsl:variable name="myName">
+			<xsl:value-of select="local-name(.)" />
+		</xsl:variable>
+		<xsl:if test="tei:head or $autoHead='true'">
+			<xsl:variable name="Depth">
+				<xsl:choose>
+					<xsl:when test="not($forcedepth='')">
+						<xsl:value-of select="$forcedepth" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$tocDepth" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:variable name="thislevel">
+				<xsl:value-of select="count(ancestor::tei:div)" />
+			</xsl:variable>
+			<xsl:variable name="pointer">
+				<xsl:apply-templates mode="generateLink"
+					select="." />
+			</xsl:variable>
+			<li>
+				<xsl:choose>
+					<xsl:when
+						test="$outputTarget='epub' or $outputTarget='epub3'" />
+					<xsl:when test="not(ancestor::tei:div) and tei:div">
+						<xsl:attribute name="class">
               <xsl:text>tocTree</xsl:text>
             </xsl:attribute>
-            <span class="showhide">
-              <span class="tocShow">
-                <img alt="+" src="Images/plus.gif"/>
-              </span>
-              <span class="tocHide">
-                <img alt="-" src="Images/minus.gif"/>
-              </span>
-            </span>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:attribute name="class">
+						<span class="showhide">
+							<span class="tocShow">
+								<img alt="+" src="Images/plus.gif" />
+							</span>
+							<span class="tocHide">
+								<img alt="-" src="Images/minus.gif" />
+							</span>
+						</span>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:attribute name="class">
               <xsl:text>toc</xsl:text>
             </xsl:attribute>
-            <span class="notshowhide">
-              <xsl:text>&#160;&#160;</xsl:text>
-            </span>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:call-template name="header">
-          <xsl:with-param name="toc" select="$pointer"/>
-          <xsl:with-param name="minimal">false</xsl:with-param>
-          <xsl:with-param name="display">plain</xsl:with-param>
-        </xsl:call-template>
-        <xsl:if test="$thislevel &lt; $Depth">
-          <xsl:call-template name="continuedToc"/>
-        </xsl:if>
-      </li>
-    </xsl:if>
-  </xsl:template>
-  <!--
-  <xsl:template name="mainTOC">
-    <xsl:param name="force"/>
-
-    <div class="toc_back">
-      <h3>
-      	  <xsl:call-template name="i18n">
-	    <xsl:with-param name="word">Back Matter</xsl:with-param>
-	  </xsl:call-template>
-      </h3>
-      <xsl:for-each
-	  select="ancestor-or-self::tei:TEI/tei:text/tei:back">
-	<xsl:if test="tei:div">
-	  <ul class="toc{$force} toc_back">
-	    <xsl:apply-templates mode="maketoc"
-				 select="tei:div">
-	      <xsl:with-param name="forcedepth" select="$force"/>
-              </xsl:apply-templates>
-	  </ul>
-	</xsl:if>
-      </xsl:for-each>
-    </div>
-
-    <div class="toc_front">
-      <h3>
-      	  <xsl:call-template name="i18n">
-	    <xsl:with-param name="word">Front Matter</xsl:with-param>
-	  </xsl:call-template>
-      </h3>
-      <xsl:for-each
-	  select="ancestor-or-self::tei:TEI/tei:text/tei:front">
-	<xsl:if	    test="tei:div">
-	  <ul class="toc{$force} toc_front">
-	    <xsl:apply-templates mode="maketoc" select="tei:div">
-	      <xsl:with-param name="forcedepth" select="$force"/>
-	    </xsl:apply-templates>
-            </ul>
-	</xsl:if>
-      </xsl:for-each>
-    </div>
-
-    <div class="toc_body">
-      <h3>
-      	  <xsl:call-template name="i18n">
-	    <xsl:with-param name="word">Text body</xsl:with-param>
-	  </xsl:call-template>
-      </h3>
-      <xsl:for-each
-        select="ancestor-or-self::tei:TEI/tei:text/tei:body">
-        <xsl:if          test="tei:div">
-          <ul class="toc{$force}  toc_body">
-            <xsl:apply-templates mode="maketoc"
-              select="tei:div">
-              <xsl:with-param name="forcedepth" select="$force"/>
-            </xsl:apply-templates>
-          </ul>
-        </xsl:if>
-      </xsl:for-each>
-    </div>
-
-  </xsl:template>
-
--->
-  <xsl:template match="tei:divGen[@type='toc']">
-    <xsl:call-template name="mainPage"/>
-  </xsl:template>
-  <xsl:template name="javascriptHook">
-    <script type="text/javascript" src="jquery-1.2.6.min.js">
-      <xsl:comment>JQuery</xsl:comment>
-    </script>
-    <!--
-    <script type="text/javascript" src="jquery.treeview.js">	
-       <xsl:comment>JQuery treeview</xsl:comment>
-    </script>
--->
-    <script type="text/javascript" src="columnlist.js">
-      <xsl:comment>JQuery columnlist</xsl:comment>
-    </script>
-    <script type="text/javascript">
-        $(function() {
-         $('ul.attrefs-class').columnizeList({cols:3,width:30,unit:'%'});
-         $('ul.attrefs-element').columnizeList({cols:3,width:30,unit:'%'});
-         $(".displayRelaxButton").click(function() {
-           $(this).parent().find('.RNG_XML').toggle();
-           $(this).parent().find('.RNG_Compact').toggle();
-         });
-         $(".tocTree .showhide").click(function() {
-          $(this).find(".tocShow,.tocHide").toggle();
-          $(this).parent().find("ul.continuedtoc").toggle();
-	  });
-        })
-    </script>
-    <xsl:if test="not($googleAnalytics='')">
-      <script type="text/javascript" src="udm-all.js">
-        <xsl:comment>UDM</xsl:comment>
-      </script>
-      <link rel="stylesheet" href="udm.css"/>
-    </xsl:if>
-    <xsl:call-template name="jsForOdds"/>
-  </xsl:template>
-  <xsl:template name="sectionHeadHook">
-    <xsl:variable name="ident">
-      <xsl:apply-templates mode="ident" select="."/>
-    </xsl:variable>
-    <xsl:variable name="d">
-      <xsl:apply-templates mode="depth" select="."/>
-    </xsl:variable>
-    <xsl:if test="$d &gt; 0">
-      <span class="bookmarklink">
-        <a class="bookmarklink" href="#{$ident}">
-          <xsl:attribute name="title">
+						<span class="notshowhide">
+							<xsl:text>&#160;&#160;</xsl:text>
+						</span>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:call-template name="header">
+					<xsl:with-param name="toc" select="$pointer" />
+					<xsl:with-param name="minimal">
+						false
+					</xsl:with-param>
+					<xsl:with-param name="display">
+						plain
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if test="$thislevel &lt; $Depth">
+					<xsl:call-template name="continuedToc" />
+				</xsl:if>
+			</li>
+		</xsl:if>
+	</xsl:template>
+	<!-- <xsl:template name="mainTOC"> <xsl:param name="force"/> <div class="toc_back"> 
+		<h3> <xsl:call-template name="i18n"> <xsl:with-param name="word">Back Matter</xsl:with-param> 
+		</xsl:call-template> </h3> <xsl:for-each select="ancestor-or-self::tei:TEI/tei:text/tei:back"> 
+		<xsl:if test="tei:div"> <ul class="toc{$force} toc_back"> <xsl:apply-templates 
+		mode="maketoc" select="tei:div"> <xsl:with-param name="forcedepth" select="$force"/> 
+		</xsl:apply-templates> </ul> </xsl:if> </xsl:for-each> </div> <div class="toc_front"> 
+		<h3> <xsl:call-template name="i18n"> <xsl:with-param name="word">Front Matter</xsl:with-param> 
+		</xsl:call-template> </h3> <xsl:for-each select="ancestor-or-self::tei:TEI/tei:text/tei:front"> 
+		<xsl:if test="tei:div"> <ul class="toc{$force} toc_front"> <xsl:apply-templates 
+		mode="maketoc" select="tei:div"> <xsl:with-param name="forcedepth" select="$force"/> 
+		</xsl:apply-templates> </ul> </xsl:if> </xsl:for-each> </div> <div class="toc_body"> 
+		<h3> <xsl:call-template name="i18n"> <xsl:with-param name="word">Text body</xsl:with-param> 
+		</xsl:call-template> </h3> <xsl:for-each select="ancestor-or-self::tei:TEI/tei:text/tei:body"> 
+		<xsl:if test="tei:div"> <ul class="toc{$force} toc_body"> <xsl:apply-templates 
+		mode="maketoc" select="tei:div"> <xsl:with-param name="forcedepth" select="$force"/> 
+		</xsl:apply-templates> </ul> </xsl:if> </xsl:for-each> </div> </xsl:template> -->
+	<xsl:template match="tei:divGen[@type='toc']">
+		<xsl:call-template name="mainPage" />
+	</xsl:template>
+	<xsl:template name="javascriptHook">
+		<script type="text/javascript" src="jquery-1.2.6.min.js">
+			<xsl:comment>
+				JQuery
+			</xsl:comment>
+		</script>
+		<!-- <script type="text/javascript" src="jquery.treeview.js"> <xsl:comment>JQuery 
+			treeview</xsl:comment> </script> -->
+		<script type="text/javascript" src="columnlist.js">
+			<xsl:comment>
+				JQuery columnlist
+			</xsl:comment>
+		</script>
+		<script type="text/javascript">
+			$(function() {
+			$('ul.attrefs-class').columnizeList({cols:3,width:30,unit:'%'});
+			$('ul.attrefs-element').columnizeList({cols:3,width:30,unit:'%'});
+			$(".displayRelaxButton").click(function() {
+			$(this).parent().find('.RNG_XML').toggle();
+			$(this).parent().find('.RNG_Compact').toggle();
+			});
+			$(".tocTree .showhide").click(function() {
+			$(this).find(".tocShow,.tocHide").toggle();
+			$(this).parent().find("ul.continuedtoc").toggle();
+			});
+			})
+		</script>
+		<xsl:if test="not($googleAnalytics='')">
+			<script type="text/javascript" src="udm-all.js">
+				<xsl:comment>
+					UDM
+				</xsl:comment>
+			</script>
+			<link rel="stylesheet" href="udm.css" />
+		</xsl:if>
+		<xsl:call-template name="jsForOdds" />
+	</xsl:template>
+	<xsl:template name="sectionHeadHook">
+		<xsl:variable name="ident">
+			<xsl:apply-templates mode="ident" select="." />
+		</xsl:variable>
+		<xsl:variable name="d">
+			<xsl:apply-templates mode="depth" select="." />
+		</xsl:variable>
+		<xsl:if test="$d &gt; 0">
+			<span class="bookmarklink">
+				<a class="bookmarklink" href="#{$ident}">
+					<xsl:attribute name="title">
             <xsl:text>link to this section </xsl:text>
           </xsl:attribute>
-          <span class="invisible">
-            <xsl:text>TEI: </xsl:text>
-            <xsl:value-of select="tei:head[1]"/>
-          </span>
-          <span class="pilcrow">
-            <xsl:text>¶</xsl:text>
-          </span>
-        </a>
-      </span>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="/div"> </xsl:template>
-  <xsl:template name="myi18n">
-    <xsl:param name="word"/>
-    <xsl:choose>
-      <xsl:when test="$word='previousWord'">
-        <span class="icon">
-          <xsl:text>« </xsl:text>
-        </span>
-      </xsl:when>
-      <xsl:when test="$word='upWord'">
-        <span class="icon">
-          <xsl:text>↑ </xsl:text>
-        </span>
-      </xsl:when>
-      <xsl:when test="$word='nextWord'">
-        <span class="icon">
-          <xsl:text>» </xsl:text>
-        </span>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+					<span class="invisible">
+						<xsl:text>TEI: </xsl:text>
+						<xsl:value-of select="tei:head[1]" />
+					</span>
+					<span class="pilcrow">
+						<xsl:text>¶</xsl:text>
+					</span>
+				</a>
+			</span>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="/div">
+	</xsl:template>
+	<xsl:template name="myi18n">
+		<xsl:param name="word" />
+		<xsl:choose>
+			<xsl:when test="$word='previousWord'">
+				<span class="icon">
+					<xsl:text>« </xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:when test="$word='upWord'">
+				<span class="icon">
+					<xsl:text>↑ </xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:when test="$word='nextWord'">
+				<span class="icon">
+					<xsl:text>» </xsl:text>
+				</span>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- only use listBibl if its in right language-->
-  <xsl:template match="tei:listBibl[@xml:lang and not($documentationLanguage=@xml:lang)]"/>
+	<!-- only use listBibl if its in right language -->
+	<xsl:template
+		match="tei:listBibl[@xml:lang and not($documentationLanguage=@xml:lang)]" />
 
-  <!-- link from bibl back to egXML -->
-  <xsl:template
-      match="tei:listBibl/tei:biblStruct|tei:listBibl/tei:bibl">
-    <xsl:apply-templates/>
-    <xsl:for-each select="key('BACKLINKS',@xml:id)">
-      <xsl:if test="self::teix:egXML">
-        <xsl:text> </xsl:text>
-        <a class="link_return" title="Go back to text">
-          <xsl:attribute name="href">
-            <xsl:apply-templates select="." mode="generateLink"/>
+	<!-- link from bibl back to egXML -->
+	<xsl:template
+		match="tei:listBibl/tei:biblStruct|tei:listBibl/tei:bibl">
+		<xsl:apply-templates />
+		<xsl:for-each select="key('BACKLINKS',@xml:id)">
+			<xsl:if test="self::teix:egXML">
+				<xsl:text> </xsl:text>
+				<a class="link_return" title="Go back to text">
+					<xsl:attribute name="href">
+            <xsl:apply-templates select="."
+						mode="generateLink" />
           </xsl:attribute>
-          <xsl:text>↵</xsl:text>
-        </a>
-      </xsl:if>
-    </xsl:for-each>
-  </xsl:template>
+					<xsl:text>↵</xsl:text>
+				</a>
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="egXMLEndHook">
-    <xsl:if test="@corresp and id(substring(@corresp,2))">
-      <div style="float: right;">
-        <a>
-          <xsl:attribute name="href">
-            <xsl:apply-templates mode="generateLink" select="id(substring(@corresp,2))"/>
+	<xsl:template name="egXMLEndHook">
+		<xsl:if test="@corresp and id(substring(@corresp,2))">
+			<div style="float: right;">
+				<a>
+					<xsl:attribute name="href">
+            <xsl:apply-templates
+						mode="generateLink" select="id(substring(@corresp,2))" />
           </xsl:attribute>
-          <xsl:text>bibliography</xsl:text>
-          <!--	  <span class="citLink">&#x270d;</span>-->
-        </a>
-	<xsl:text>&#160;</xsl:text>
-      </div>
-    </xsl:if>
-    <xsl:for-each select="ancestor::tei:elementSpec">
-      <div style="float: right;">
-        <a href="examples-{@ident}.html">
-          <xsl:call-template name="i18n">
-            <xsl:with-param name="word">Show all</xsl:with-param>
-          </xsl:call-template>
-        </a>
-	<xsl:text>&#160;</xsl:text>
-      </div>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="figureHook">
-    <xsl:if test="@corresp and id(substring(@corresp,2))">
-      <div style="float: right;">
-        <a>
-          <xsl:attribute name="href">
-            <xsl:apply-templates mode="generateLink" select="id(substring(@corresp,2))"/>
+					<xsl:text>bibliography</xsl:text>
+					<!-- <span class="citLink">&#x270d;</span> -->
+				</a>
+				<xsl:text>&#160;</xsl:text>
+			</div>
+		</xsl:if>
+		<xsl:for-each select="ancestor::tei:elementSpec">
+			<div style="float: right;">
+				<a href="examples-{@ident}.html">
+					<xsl:call-template name="i18n">
+						<xsl:with-param name="word">
+							Show all
+						</xsl:with-param>
+					</xsl:call-template>
+				</a>
+				<xsl:text>&#160;</xsl:text>
+			</div>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="figureHook">
+		<xsl:if test="@corresp and id(substring(@corresp,2))">
+			<div style="float: right;">
+				<a>
+					<xsl:attribute name="href">
+            <xsl:apply-templates
+						mode="generateLink" select="id(substring(@corresp,2))" />
           </xsl:attribute>
-          <xsl:text>bibliography</xsl:text>
-        </a>
-      </div>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template name="stdfooter">
-    <xsl:param name="style" select="'plain'"/>
-    <xsl:param name="file">index</xsl:param>
-    <xsl:variable name="date">
-      <xsl:call-template name="generateDate"/>
-    </xsl:variable>
-    <xsl:variable name="author">
-      <xsl:call-template name="generateAuthor"/>
-    </xsl:variable>
-    <div class="stdfooter">
-      <xsl:if test="$outputTarget='html'">
-        <p>
-	  [<a href="../../en/html/{$file}.html">English</a>]
-	  [<a href="../../de/html/{$file}.html">Deutsch</a>]
-	  [<a href="../../es/html/{$file}.html">Español</a>]
-	  [<a href="../../it/html/{$file}.html">Italiano</a>]
-	  [<a href="../../fr/html/{$file}.html">Français</a>]
-	  [<a href="../../ja/html/{$file}.html">日本語</a>]
-	  [<a href="../../kr/html/{$file}.html">한국어</a>]
-	  [<a href="../../zh-TW/html/{$file}.html">中文</a>]
-	</p>
-      </xsl:if>
-      <hr/>
-      <xsl:if test="$linkPanel='true'">
-        <div class="footer">
-          <xsl:if test="not($parentURL='')">
-            <a class="{$style}" href="{$parentURL}">
-              <xsl:value-of select="$parentWords"/>
-            </a>
-          </xsl:if>
-          <xsl:if test="$searchURL"> | <a class="{$style}" href="{$searchURL}" target="_top"><xsl:call-template name="searchWords"/></a>
-          </xsl:if>
-          <xsl:if test="$feedbackURL"> | <a class="{$style}" href="{$feedbackURL}"><xsl:call-template name="feedbackWords"/></a>
-          </xsl:if>
-        </div>
-        <hr/>
-      </xsl:if>
-      <xsl:for-each
-	  select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability">
-	<div class="availability">
-	  <xsl:apply-templates/>
-	  <xsl:choose>
-	    <xsl:when test="count(tei:licence)&gt;1">
-	      <ol>
-		<xsl:for-each select="tei:licence">
-		  <li>
-		    <xsl:choose>
-		      <xsl:when test="@target">
-			<a href="{@target}"><xsl:value-of select="@target"/></a>
-		      </xsl:when>
-		      <xsl:otherwise>			
-			<xsl:apply-templates/>
-		      </xsl:otherwise>
-		    </xsl:choose>
-		  </li>
-		</xsl:for-each>
-	      </ol>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <div class="licence">
-		<xsl:for-each select="tei:licence">
-		  <a href="{@target}">
-		    <xsl:apply-templates/>
-		  </a>
-		</xsl:for-each>
-	      </div>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</div>
-      </xsl:for-each>
+					<xsl:text>bibliography</xsl:text>
+				</a>
+			</div>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="stdfooter">
+		<xsl:param name="style" select="'plain'" />
+		<xsl:param name="file">
+			index
+		</xsl:param>
+		<xsl:variable name="date">
+			<xsl:call-template name="generateDate" />
+		</xsl:variable>
+		<xsl:variable name="author">
+			<xsl:call-template name="generateAuthor" />
+		</xsl:variable>
+		<div class="stdfooter">
+			<xsl:if test="$outputTarget='html'">
+				<p>
+					[
+					<a href="../../en/html/{$file}.html">English</a>
+					]
+					[
+					<a href="../../de/html/{$file}.html">Deutsch</a>
+					]
+					[
+					<a href="../../es/html/{$file}.html">Español</a>
+					]
+					[
+					<a href="../../it/html/{$file}.html">Italiano</a>
+					]
+					[
+					<a href="../../fr/html/{$file}.html">Français</a>
+					]
+					[
+					<a href="../../ja/html/{$file}.html">日本語</a>
+					]
+					[
+					<a href="../../kr/html/{$file}.html">한국어</a>
+					]
+					[
+					<a href="../../zh-TW/html/{$file}.html">中文</a>
+					]
+				</p>
+			</xsl:if>
+			<hr />
+			<xsl:if test="$linkPanel='true'">
+				<div class="footer">
+					<xsl:if test="not($parentURL='')">
+						<a class="{$style}" href="{$parentURL}">
+							<xsl:value-of select="$parentWords" />
+						</a>
+					</xsl:if>
+					<xsl:if test="$searchURL">
+						|
+						<a class="{$style}" href="{$searchURL}" target="_top">
+							<xsl:call-template name="searchWords" />
+						</a>
+					</xsl:if>
+					<xsl:if test="$feedbackURL">
+						|
+						<a class="{$style}" href="{$feedbackURL}">
+							<xsl:call-template name="feedbackWords" />
+						</a>
+					</xsl:if>
+				</div>
+				<hr />
+			</xsl:if>
+			<xsl:for-each
+				select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability">
+				<div class="availability">
+					<xsl:apply-templates />
+					<xsl:choose>
+						<xsl:when test="count(tei:licence)&gt;1">
+							<ol>
+								<xsl:for-each select="tei:licence">
+									<li>
+										<xsl:choose>
+											<xsl:when test="@target">
+												<a href="{@target}">
+													<xsl:value-of select="@target" />
+												</a>
+											</xsl:when>
+											<xsl:otherwise>
+												<xsl:apply-templates />
+											</xsl:otherwise>
+										</xsl:choose>
+									</li>
+								</xsl:for-each>
+							</ol>
+						</xsl:when>
+						<xsl:otherwise>
+							<div class="licence">
+								<xsl:for-each select="tei:licence">
+									<a href="{@target}">
+										<xsl:apply-templates />
+									</a>
+								</xsl:for-each>
+							</div>
+						</xsl:otherwise>
+					</xsl:choose>
+				</div>
+			</xsl:for-each>
 
-      <address>
-	<br/>
-        <xsl:text>Version </xsl:text>
-        <xsl:value-of 
-	    select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition"/>
-        <xsl:text>This page generated on </xsl:text> 
-	<xsl:call-template name="whatsTheDate"/>
-      </address>
-    </div>
-    <xsl:if test="not($googleAnalytics='')">
-      <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-        <!-- load google analytics -->
-      </script>
-      <script type="text/javascript">
-        <xsl:text>_uacct = "</xsl:text>
-        <xsl:value-of select="$googleAnalytics"/>
-        <xsl:text>";
+			<address>
+				<br />
+				<xsl:text>Version </xsl:text>
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition" />
+				<xsl:text>This page generated on </xsl:text>
+				<xsl:call-template name="whatsTheDate" />
+			</address>
+		</div>
+		<xsl:if test="not($googleAnalytics='')">
+			<script src="http://www.google-analytics.com/urchin.js"
+				type="text/javascript">
+				<!-- load google analytics -->
+			</script>
+			<script type="text/javascript">
+				<xsl:text>_uacct = "</xsl:text>
+				<xsl:value-of select="$googleAnalytics" />
+				<xsl:text>";
 	urchinTracker();
 	</xsl:text>
-      </script>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template name="guidelinesTop">
-    <xsl:param name="name"/>
-    <xsl:if test="$outputTarget='html'">
-      <xsl:if test="not($googleAnalytics='')">
-        <script type="text/javascript" src="udm-dom.js">
-          <xsl:comment>&#160;</xsl:comment>
-        </script>
-        <script type="text/javascript" src="udm-mod-keyboard.js">
-          <xsl:comment>&#160;</xsl:comment>
-        </script>
-      </xsl:if>
-      <div id="container">
-        <a href="#contentstart" title="Skip to content" class="skip">skip to content</a>
-        <div id="banner">
-          <img src="Images/banner.jpg" alt="Text Encoding Initiative logo and banner"/>
-        </div>
-        <xsl:if test="not($googleAnalytics='')">
-          <xsl:copy-of select="document('staticnav.xml')/html:ul"/>
-        </xsl:if>
-      </div>
-      <div id="searchbox" style="float:left;">
-        <form action="http://www.google.com/search" method="get">
-          <fieldset><input style="color:#225588;" value="" maxlength="255" size="20" name="q" type="text"/>&#160;<select name="sitesearch"><option value="http://www.tei-c.org/">Entire site</option><option value="http://www.tei-c.org/release/doc/tei-p5-doc/{$documentationLanguage}/html/" selected="selected">P5 Guidelines
-	    <xsl:choose><xsl:when test="$documentationLanguage='en'"> — English</xsl:when><xsl:when test="$documentationLanguage='de'"> — Deutsch</xsl:when><xsl:when test="$documentationLanguage='es'"> — Español</xsl:when><xsl:when test="$documentationLanguage='it'"> — Italiano</xsl:when><xsl:when test="$documentationLanguage='fr'"> — Français</xsl:when><xsl:when test="$documentationLanguage='ja'"> — 日本語</xsl:when><xsl:when test="$documentationLanguage='kr'"> — 한국어</xsl:when><xsl:when test="$documentationLanguage='zh-TW'"> — 中文</xsl:when></xsl:choose>
-	    </option><option value="http://www.tei-c.org/Guidelines/P4/html/">P4 Guidelines</option></select>&#160;<input style="font-size:100%; font-weight:bold;      color:#FFFFFF; background-color:#225588; height: 2em;" value="Search" type="submit"/></fieldset>
-        </form>
-      </div>
-    </xsl:if>
-    <div class="mainhead">
-      <h1>P5: 
-    <xsl:call-template name="i18n"><xsl:with-param name="word">GuidelinesTEI</xsl:with-param></xsl:call-template>
-    </h1>
-    </div>
-  </xsl:template>
-  <xsl:template name="generateParentsByAttribute">
-    <xsl:variable name="this" select="@ident"/>
-    <xsl:if test="count(key('ATTREFS-CLASS',$this))&gt;0">
-      <div>
-        <xsl:call-template name="i18n">
-          <xsl:with-param name="word">
-            <xsl:text>Class</xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:text>: </xsl:text>
-        <ul class="attrefs-class">
-          <xsl:for-each select="key('ATTREFS-CLASS',$this)">
-            <xsl:sort select="ancestor::tei:classSpec/@ident"/>
-            <xsl:sort select="@ident"/>
-            <li>
-              <xsl:for-each select="ancestor::tei:classSpec">
-                <xsl:call-template name="linkTogether">
-                  <xsl:with-param name="name">
-                    <xsl:value-of select="@ident"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="class">
-                    <xsl:text>link_odd_class</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </xsl:for-each>
-              <xsl:text>/@</xsl:text>
-              <xsl:value-of select="ancestor::tei:attDef/@ident"/>
-              <xsl:call-template name="showSpace"/>
-            </li>
-          </xsl:for-each>
-        </ul>
-      </div>
-    </xsl:if>
-    <xsl:if test="count(key('ATTREFS-ELEMENT',$this))&gt;0">
-      <div>
-        <xsl:call-template name="i18n">
-          <xsl:with-param name="word">
-            <xsl:text>Element</xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:text>: </xsl:text>
-        <ul class="attrefs-element">
-          <xsl:for-each select="key('ATTREFS-ELEMENT',$this)">
-            <xsl:sort select="ancestor::tei:elementSpec/@ident"/>
-            <xsl:sort select="@ident"/>
-            <li>
-              <xsl:for-each select="ancestor::tei:elementSpec">
-                <xsl:call-template name="linkTogether">
-                  <xsl:with-param name="name">
-                    <xsl:value-of select="@ident"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="class">
-                    <xsl:text>link_odd_element</xsl:text>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </xsl:for-each>
-              <xsl:text>/@</xsl:text>
-	      <xsl:for-each select="ancestor::tei:attDef">
-		<xsl:value-of select="(tei:altIdent|@ident)[last()]"/>
-	      </xsl:for-each>
-              <xsl:call-template name="showSpace"/>
-            </li>
-          </xsl:for-each>
-        </ul>
-      </div>
-    </xsl:if>
-  </xsl:template>
+			</script>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="guidelinesTop">
+		<xsl:param name="name" />
+		<xsl:if test="$outputTarget='html'">
+			<xsl:if test="not($googleAnalytics='')">
+				<script type="text/javascript" src="udm-dom.js">
+					<xsl:comment>
+						&#160;
+					</xsl:comment>
+				</script>
+				<script type="text/javascript" src="udm-mod-keyboard.js">
+					<xsl:comment>
+						&#160;
+					</xsl:comment>
+				</script>
+			</xsl:if>
+			<div id="container">
+				<a href="#contentstart" title="Skip to content" class="skip">skip to
+					content</a>
+				<div id="banner">
+					<img src="Images/banner.jpg"
+						alt="Text Encoding Initiative logo and banner" />
+				</div>
+				<xsl:if test="not($googleAnalytics='')">
+					<xsl:copy-of select="document('staticnav.xml')/html:ul" />
+				</xsl:if>
+			</div>
+			<div id="searchbox" style="float:left;">
+				<form action="http://www.google.com/search" method="get">
+					<fieldset>
+						<input style="color:#225588;" value="" maxlength="255"
+							size="20" name="q" type="text" />
+						&#160;
+						<select name="sitesearch">
+							<option value="http://www.tei-c.org/">Entire site</option>
+							<option
+								value="http://www.tei-c.org/release/doc/tei-p5-doc/{$documentationLanguage}/html/"
+								selected="selected">
+								P5 Guidelines
+								<xsl:choose>
+									<xsl:when test="$documentationLanguage='en'">
+										— English
+									</xsl:when>
+									<xsl:when test="$documentationLanguage='de'">
+										— Deutsch
+									</xsl:when>
+									<xsl:when test="$documentationLanguage='es'">
+										— Español
+									</xsl:when>
+									<xsl:when test="$documentationLanguage='it'">
+										— Italiano
+									</xsl:when>
+									<xsl:when test="$documentationLanguage='fr'">
+										— Français
+									</xsl:when>
+									<xsl:when test="$documentationLanguage='ja'">
+										— 日本語
+									</xsl:when>
+									<xsl:when test="$documentationLanguage='kr'">
+										— 한국어
+									</xsl:when>
+									<xsl:when test="$documentationLanguage='zh-TW'">
+										— 中文
+									</xsl:when>
+								</xsl:choose>
+							</option>
+							<option value="http://www.tei-c.org/Guidelines/P4/html/">P4 Guidelines</option>
+						</select>
+						&#160;
+						<input
+							style="font-size:100%; font-weight:bold;      color:#FFFFFF; background-color:#225588; height: 2em;"
+							value="Search" type="submit" />
+					</fieldset>
+				</form>
+			</div>
+		</xsl:if>
+		<div class="mainhead">
+			<h1>
+				P5:
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						GuidelinesTEI
+					</xsl:with-param>
+				</xsl:call-template>
+			</h1>
+		</div>
+	</xsl:template>
+	<xsl:template name="generateParentsByAttribute">
+		<xsl:variable name="this" select="@ident" />
+		<xsl:if test="count(key('ATTREFS-CLASS',$this))&gt;0">
+			<div>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						<xsl:text>Class</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>: </xsl:text>
+				<ul class="attrefs-class">
+					<xsl:for-each select="key('ATTREFS-CLASS',$this)">
+						<xsl:sort select="ancestor::tei:classSpec/@ident" />
+						<xsl:sort select="@ident" />
+						<li>
+							<xsl:for-each select="ancestor::tei:classSpec">
+								<xsl:call-template name="linkTogether">
+									<xsl:with-param name="name">
+										<xsl:value-of select="@ident" />
+									</xsl:with-param>
+									<xsl:with-param name="class">
+										<xsl:text>link_odd_class</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+							<xsl:text>/@</xsl:text>
+							<xsl:value-of select="ancestor::tei:attDef/@ident" />
+							<xsl:call-template name="showSpace" />
+						</li>
+					</xsl:for-each>
+				</ul>
+			</div>
+		</xsl:if>
+		<xsl:if test="count(key('ATTREFS-ELEMENT',$this))&gt;0">
+			<div>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						<xsl:text>Element</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>: </xsl:text>
+				<ul class="attrefs-element">
+					<xsl:for-each select="key('ATTREFS-ELEMENT',$this)">
+						<xsl:sort select="ancestor::tei:elementSpec/@ident" />
+						<xsl:sort select="@ident" />
+						<li>
+							<xsl:for-each select="ancestor::tei:elementSpec">
+								<xsl:call-template name="linkTogether">
+									<xsl:with-param name="name">
+										<xsl:value-of select="@ident" />
+									</xsl:with-param>
+									<xsl:with-param name="class">
+										<xsl:text>link_odd_element</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+							<xsl:text>/@</xsl:text>
+							<xsl:for-each select="ancestor::tei:attDef">
+								<xsl:value-of
+									select="(tei:altIdent|@ident)[last()]" />
+							</xsl:for-each>
+							<xsl:call-template name="showSpace" />
+						</li>
+					</xsl:for-each>
+				</ul>
+			</div>
+		</xsl:if>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/build-to.xml	(revision 2397)
@@ -1,67 +1,66 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="antodd">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9755 2011-11-15 09:07:52Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
-    performs ODD processing.
- -->
-  <!-- whether to make summary odd doc  -->
-  <property name="summaryDoc" value="false"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9755 2011-11-15 09:07:52Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- performs ODD processing. -->
+	<!-- whether to make summary odd doc -->
+	<property name="summaryDoc" value="false" />
 
-  <property name="odd2oddxsl"      value="../odds2/odd2odd.xsl"/>
-  <property name="odd2litexsl"     value="../odds2/odd2lite.xsl"/>
+	<property name="odd2oddxsl" value="../odds2/odd2odd.xsl" />
+	<property name="odd2litexsl" value="../odds2/odd2lite.xsl" />
 
-   <condition property="processODD">
-    <equals arg1="${odd}" arg2="true"/>
-  </condition>
+	<condition property="processODD">
+		<equals arg1="${odd}" arg2="true" />
+	</condition>
 
-  <target name="notodd" unless="processODD">
-    <copy file="${inputFile}" tofile="${outputTempDir}/tmp2.xml" overwrite="true"/>
-  </target>
+	<target name="notodd" unless="processODD">
+		<copy file="${inputFile}" tofile="${outputTempDir}/tmp2.xml"
+			overwrite="true" />
+	</target>
 
-  <target name="odd" if="processODD">
-    <echo>Do ODD processing </echo>
-    <xslt force="yes" style="${odd2oddxsl}" in="${inputFile}" out="${outputTempDir}/tmp1.xml" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="lang" expression="${lang}" if="lang"/>
-      <param name="defaultSource" expression="${defaultSource}" if="defaultSource"/>
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-    <xslt force="yes" style="${odd2litexsl}" in="${outputTempDir}/tmp1.xml" out="${outputTempDir}/tmp2.xml" classpath="classpath">
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <param name="summaryDoc" expression="${summaryDoc}" if="summaryDoc"/>
-      <param name="displayMode" expression="rnc"/>
-    </xslt>
-  </target>
+	<target name="odd" if="processODD">
+		<echo>Do ODD processing </echo>
+		<xslt force="yes" style="${odd2oddxsl}" in="${inputFile}"
+			out="${outputTempDir}/tmp1.xml" classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="lang" expression="${lang}" if="lang" />
+			<param name="defaultSource" expression="${defaultSource}"
+				if="defaultSource" />
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+		<xslt force="yes" style="${odd2litexsl}"
+			in="${outputTempDir}/tmp1.xml" out="${outputTempDir}/tmp2.xml"
+			classpath="classpath">
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<param name="summaryDoc" expression="${summaryDoc}"
+				if="summaryDoc" />
+			<param name="displayMode" expression="rnc" />
+		</xslt>
+	</target>
 
 </project>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/teiodds.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/teiodds.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/teiodds.xsl	(revision 2397)
@@ -1,2047 +1,2316 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-    xmlns:fo="http://www.w3.org/1999/XSL/Format" 
-    xmlns:html="http://www.w3.org/1999/xhtml" 
-    xmlns:i="http://www.iso.org/ns/1.0"
-    xmlns:rng="http://relaxng.org/ns/structure/1.0"
-    xmlns:s="http://www.ascc.net/xml/schematron" 
-    xmlns:sch="http://purl.oclc.org/dsdl/schematron" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:teix="http://www.tei-c.org/ns/Examples" 
-    xmlns:xi="http://www.w3.org/2001/XInclude"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl" 
-  version="2.0">
-  <xsl:import href="../common2/odds.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for processing TEI ODD markup </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:i="http://www.iso.org/ns/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl"
+	version="2.0">
+	<xsl:import href="../common2/odds.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for processing TEI ODD markup </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: teiodds.xsl 9861 2011-12-02 00:05:30Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:include href="RngToRnc.xsl"/>
-  <xsl:param name="idPrefix"/>
-  <xsl:param name="oddmode">tei</xsl:param>
-  <xsl:param name="STDOUT">true</xsl:param>
-  <xsl:param name="outputSuffix">.html</xsl:param>
-  <xsl:param name="selectedSchema"/>
-  <xsl:param name="outputDir"/>
-  <xsl:param name="splitLevel">-1</xsl:param>
-  <xsl:param name="localsource"/>
-  <xsl:param name="lang"/>
-  <xsl:param name="doclang"/>
-  <xsl:param name="patternPrefix"/>
-  <xsl:param name="TEIC">false</xsl:param>
-  <xsl:param name="autoGlobal">false</xsl:param>
-  <xsl:param name="lookupDatabase">false</xsl:param>
-  <xsl:param name="verbose">false</xsl:param>
-  <xsl:param name="schemaBaseURL">http://localhost/schema/relaxng/</xsl:param>
-  <xsl:key match="tei:*" name="LOCALIDENTS" use="@ident"/>
-  <xsl:key match="tei:macroSpec" name="MACROS" use="@ident"/>
-  <xsl:key match="tei:elementSpec" name="ELEMENTS" use="@ident"/>
-  <xsl:key match="tei:elementSpec" name="ELEMENTS" use="tei:altIdent"/>
-  <xsl:key match="tei:classSpec" name="CLASSES" use="@ident"/>
-  <xsl:key match="rng:ref" name="REFS"  use="@name"/>
-  <xsl:key match="rng:ref[contains(@name,'_')]" name="REFS" use="substring-before(@name,'_')"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: teiodds.xsl 9861 2011-12-02 00:05:30Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:key match="tei:elementSpec/tei:attList/tei:attDef/tei:datatype/rng:ref"
-    name="ATTREFS-ELEMENT" use="@name"/>
-  <xsl:key match="tei:classSpec/tei:attList/tei:attDef/tei:datatype/rng:ref" name="ATTREFS-CLASS"
-    use="@name"/>
-  <xsl:key match="tei:elementSpec/tei:attList/tei:attList/tei:attDef/tei:datatype/rng:ref"
-    name="ATTREFS-ELEMENT" use="@name"/>
-  <xsl:key match="tei:classSpec/tei:attList/tei:attList/tei:attDef/tei:datatype/rng:ref"
-    name="ATTREFS-CLASS" use="@name"/>
-  <xsl:key match="tei:macroSpec/tei:content//rng:ref" name="MACROREFS"  use="@name"/>
+	<xsl:include href="RngToRnc.xsl" />
+	<xsl:param name="idPrefix" />
+	<xsl:param name="oddmode">
+		tei
+	</xsl:param>
+	<xsl:param name="STDOUT">
+		true
+	</xsl:param>
+	<xsl:param name="outputSuffix">
+		.html
+	</xsl:param>
+	<xsl:param name="selectedSchema" />
+	<xsl:param name="outputDir" />
+	<xsl:param name="splitLevel">
+		-1
+	</xsl:param>
+	<xsl:param name="localsource" />
+	<xsl:param name="lang" />
+	<xsl:param name="doclang" />
+	<xsl:param name="patternPrefix" />
+	<xsl:param name="TEIC">
+		false
+	</xsl:param>
+	<xsl:param name="autoGlobal">
+		false
+	</xsl:param>
+	<xsl:param name="lookupDatabase">
+		false
+	</xsl:param>
+	<xsl:param name="verbose">
+		false
+	</xsl:param>
+	<xsl:param name="schemaBaseURL">
+		http://localhost/schema/relaxng/
+	</xsl:param>
+	<xsl:key match="tei:*" name="LOCALIDENTS" use="@ident" />
+	<xsl:key match="tei:macroSpec" name="MACROS" use="@ident" />
+	<xsl:key match="tei:elementSpec" name="ELEMENTS" use="@ident" />
+	<xsl:key match="tei:elementSpec" name="ELEMENTS"
+		use="tei:altIdent" />
+	<xsl:key match="tei:classSpec" name="CLASSES" use="@ident" />
+	<xsl:key match="rng:ref" name="REFS" use="@name" />
+	<xsl:key match="rng:ref[contains(@name,'_')]" name="REFS"
+		use="substring-before(@name,'_')" />
 
-  <xsl:key match="tei:elementSpec|tei:classSpec" name="CLASSMEMBERS"
-    use="tei:classes/tei:memberOf/@key"/>
-  <xsl:key match="tei:elementSpec|tei:classSpec|tei:macroSpec" name="IDENTS" use="@ident"/>
+	<xsl:key
+		match="tei:elementSpec/tei:attList/tei:attDef/tei:datatype/rng:ref"
+		name="ATTREFS-ELEMENT" use="@name" />
+	<xsl:key
+		match="tei:classSpec/tei:attList/tei:attDef/tei:datatype/rng:ref"
+		name="ATTREFS-CLASS" use="@name" />
+	<xsl:key
+		match="tei:elementSpec/tei:attList/tei:attList/tei:attDef/tei:datatype/rng:ref"
+		name="ATTREFS-ELEMENT" use="@name" />
+	<xsl:key
+		match="tei:classSpec/tei:attList/tei:attList/tei:attDef/tei:datatype/rng:ref"
+		name="ATTREFS-CLASS" use="@name" />
+	<xsl:key match="tei:macroSpec/tei:content//rng:ref"
+		name="MACROREFS" use="@name" />
 
-  <xsl:key match="tei:macroSpec[@type='dt']" name="DATATYPES" use="1"/>
-  <xsl:key match="tei:macroSpec" name="MACRODOCS" use="1"/>
-  <xsl:key match="tei:attDef" name="ATTDOCS" use="1"/>
-  <xsl:key match="tei:attDef" name="ATTRIBUTES" use="@ident"/>
-  <xsl:key match="tei:classSpec//tei:attDef" name="ATTRIBUTES-CLASS" use="@ident"/>
-  <xsl:key match="tei:elementSpec//tei:attDef" name="ATTRIBUTES-ELEMENT" use="@ident"/>
-  <xsl:key match="tei:schemaSpec" name="SCHEMASPECS" use="1"/>
-  <xsl:key match="tei:schemaSpec" name="LISTSCHEMASPECS" use="@ident"/>
-  <xsl:key match="tei:classSpec[@type='atts']" name="ATTCLASSDOCS" use="1"/>
-  <xsl:key match="tei:classSpec[@type='model']" name="MODELCLASSDOCS" use="1"/>
-  <xsl:key match="tei:elementSpec" name="ELEMENTDOCS" use="1"/>
-  <xsl:key match="tei:*" name="NameToID" use="@ident"/>
-  <xsl:key match="tei:elementSpec" name="ElementModule" use="@module"/>
-  <xsl:key match="tei:classSpec" name="ClassModule" use="@module"/>
-  <xsl:key match="tei:macroSpec" name="MacroModule" use="@module"/>
-  <xsl:key match="tei:moduleSpec" name="Modules" use="1"/>
-  <xsl:key match="tei:moduleSpec" name="MODULES" use="@ident"/>
-  <xsl:key match="tei:classSpec[@predeclare='true']" name="predeclaredClasses" use="1"/>
-  <xsl:key match="tei:macroSpec[@predeclare='true']" name="PredeclareMacros" use="@ident"/>
-  <xsl:key match="tei:macroSpec[@predeclare='true']" name="PredeclareMacrosModule" use="@module"/>
-  <xsl:key match="tei:macroSpec[@predeclare='true']" name="PredeclareAllMacros" use="1"/>
-  <xsl:variable name="parameterize">
-    <xsl:choose>
-      <xsl:when test="key('SCHEMASPECS',1)">false</xsl:when>
-      <xsl:otherwise>true</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  <xsl:variable name="whichSchemaSpec">
-    <xsl:choose>
-      <xsl:when test="$selectedSchema">
-        <xsl:value-of select="$selectedSchema"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="key('SCHEMASPECS',1)[1]/@ident"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
+	<xsl:key match="tei:elementSpec|tei:classSpec"
+		name="CLASSMEMBERS" use="tei:classes/tei:memberOf/@key" />
+	<xsl:key match="tei:elementSpec|tei:classSpec|tei:macroSpec"
+		name="IDENTS" use="@ident" />
 
-  <!-- lookup table of element contents, and templates to access the result -->
-  <xsl:key match="Contains" name="ELEMENTPARENTS" use="."/>
+	<xsl:key match="tei:macroSpec[@type='dt']" name="DATATYPES"
+		use="1" />
+	<xsl:key match="tei:macroSpec" name="MACRODOCS" use="1" />
+	<xsl:key match="tei:attDef" name="ATTDOCS" use="1" />
+	<xsl:key match="tei:attDef" name="ATTRIBUTES" use="@ident" />
+	<xsl:key match="tei:classSpec//tei:attDef"
+		name="ATTRIBUTES-CLASS" use="@ident" />
+	<xsl:key match="tei:elementSpec//tei:attDef"
+		name="ATTRIBUTES-ELEMENT" use="@ident" />
+	<xsl:key match="tei:schemaSpec" name="SCHEMASPECS" use="1" />
+	<xsl:key match="tei:schemaSpec" name="LISTSCHEMASPECS"
+		use="@ident" />
+	<xsl:key match="tei:classSpec[@type='atts']"
+		name="ATTCLASSDOCS" use="1" />
+	<xsl:key match="tei:classSpec[@type='model']"
+		name="MODELCLASSDOCS" use="1" />
+	<xsl:key match="tei:elementSpec" name="ELEMENTDOCS" use="1" />
+	<xsl:key match="tei:*" name="NameToID" use="@ident" />
+	<xsl:key match="tei:elementSpec" name="ElementModule"
+		use="@module" />
+	<xsl:key match="tei:classSpec" name="ClassModule" use="@module" />
+	<xsl:key match="tei:macroSpec" name="MacroModule" use="@module" />
+	<xsl:key match="tei:moduleSpec" name="Modules" use="1" />
+	<xsl:key match="tei:moduleSpec" name="MODULES" use="@ident" />
+	<xsl:key match="tei:classSpec[@predeclare='true']"
+		name="predeclaredClasses" use="1" />
+	<xsl:key match="tei:macroSpec[@predeclare='true']"
+		name="PredeclareMacros" use="@ident" />
+	<xsl:key match="tei:macroSpec[@predeclare='true']"
+		name="PredeclareMacrosModule" use="@module" />
+	<xsl:key match="tei:macroSpec[@predeclare='true']"
+		name="PredeclareAllMacros" use="1" />
+	<xsl:variable name="parameterize">
+		<xsl:choose>
+			<xsl:when test="key('SCHEMASPECS',1)">
+				false
+			</xsl:when>
+			<xsl:otherwise>
+				true
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	<xsl:variable name="whichSchemaSpec">
+		<xsl:choose>
+			<xsl:when test="$selectedSchema">
+				<xsl:value-of select="$selectedSchema" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="key('SCHEMASPECS',1)[1]/@ident" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
 
-  <xsl:variable name="generalPrefix">
-    <xsl:choose>
-      <xsl:when test="string-length($patternPrefix)&gt;0">
-        <xsl:value-of select="$patternPrefix"/>
-      </xsl:when>
-      <xsl:when test="key('LISTSCHEMASPECS',$whichSchemaSpec)[@prefix]">
-        <xsl:value-of select="key('LISTSCHEMASPECS',$whichSchemaSpec)/@prefix"/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:variable>
+	<!-- lookup table of element contents, and templates to access the result -->
+	<xsl:key match="Contains" name="ELEMENTPARENTS" use="." />
 
-  <xsl:variable name="targetLanguage">
-    <xsl:choose>
-      <xsl:when test="string-length($lang)&gt;0">
-        <xsl:value-of select="$lang"/>
-      </xsl:when>
-      <xsl:when test="key('LISTSCHEMASPECS',$whichSchemaSpec)[@targetLang]">
-        <xsl:value-of select="key('LISTSCHEMASPECS',$whichSchemaSpec)/@targetLang"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>en</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
+	<xsl:variable name="generalPrefix">
+		<xsl:choose>
+			<xsl:when test="string-length($patternPrefix)&gt;0">
+				<xsl:value-of select="$patternPrefix" />
+			</xsl:when>
+			<xsl:when
+				test="key('LISTSCHEMASPECS',$whichSchemaSpec)[@prefix]">
+				<xsl:value-of
+					select="key('LISTSCHEMASPECS',$whichSchemaSpec)/@prefix" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:variable>
 
+	<xsl:variable name="targetLanguage">
+		<xsl:choose>
+			<xsl:when test="string-length($lang)&gt;0">
+				<xsl:value-of select="$lang" />
+			</xsl:when>
+			<xsl:when
+				test="key('LISTSCHEMASPECS',$whichSchemaSpec)[@targetLang]">
+				<xsl:value-of
+					select="key('LISTSCHEMASPECS',$whichSchemaSpec)/@targetLang" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>en</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
 
-  <xsl:template name="generateDoc">
-    <xsl:choose>
-      <xsl:when test="string-length($doclang)&gt;0">
-        <xsl:value-of select="$doclang"/>
-      </xsl:when>
-      <xsl:when test="key('LISTSCHEMASPECS',$whichSchemaSpec)/@docLang">
-        <xsl:value-of select="key('LISTSCHEMASPECS',$whichSchemaSpec)/@docLang"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>en</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
+	<xsl:template name="generateDoc">
+		<xsl:choose>
+			<xsl:when test="string-length($doclang)&gt;0">
+				<xsl:value-of select="$doclang" />
+			</xsl:when>
+			<xsl:when
+				test="key('LISTSCHEMASPECS',$whichSchemaSpec)/@docLang">
+				<xsl:value-of
+					select="key('LISTSCHEMASPECS',$whichSchemaSpec)/@docLang" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>en</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="processing-instruction()">
-    <xsl:choose>
-      <xsl:when test="name(.) = 'odds'">
-	<xsl:choose>
-	  <xsl:when test=".='date'"> This formatted version of the Guidelines was created on
-	  <xsl:call-template name="showDate"/>. </xsl:when>
-	</xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:copy-of select="."/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
-  <xsl:template match="*" mode="literal">
-    <xsl:text>&#10;</xsl:text>
-    <xsl:for-each select="ancestor::rng:*">
-      <xsl:text> </xsl:text>
-    </xsl:for-each>
-    <xsl:text>&lt;</xsl:text>
-    <xsl:value-of select="local-name(.)"/>
-    <xsl:for-each select="@*">
-      <xsl:text> </xsl:text>
-      <xsl:value-of select="local-name(.)"/>="<xsl:value-of select="."/>"</xsl:for-each>
-    <xsl:choose>
-      <xsl:when test="child::node()">
-        <xsl:text>&gt;</xsl:text>
-        <xsl:apply-templates mode="literal"/>
-        <xsl:if test="node()[last()]/self::rng:*">
-          <xsl:text>&#10;</xsl:text>
-        </xsl:if>
-        <xsl:for-each select="ancestor::rng:*">
-          <xsl:text> </xsl:text>
-        </xsl:for-each>
-        <xsl:text>&lt;/</xsl:text>
-        <xsl:value-of select="local-name(.)"/>
-        <xsl:text>&gt;</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>/&gt;</xsl:text>
-        <xsl:if test="node()[last()]/self::rng:*">
-          <xsl:text>&#10;	  </xsl:text>
-        </xsl:if>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="processing-instruction()">
+		<xsl:choose>
+			<xsl:when test="name(.) = 'odds'">
+				<xsl:choose>
+					<xsl:when test=".='date'">
+						This formatted version of the Guidelines was created on
+						<xsl:call-template name="showDate" />
+						.
+					</xsl:when>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="rng:ref">
-    <xsl:call-template name="makeRef">
-      <xsl:with-param name="lookup" select="replace(@name,'_(alternation|sequenceOptionalRepeatable|sequenceOptional|sequenceRepeatable|sequence)','')"/>
-    </xsl:call-template>
-  </xsl:template>
+	<xsl:template match="*" mode="literal">
+		<xsl:text>&#10;</xsl:text>
+		<xsl:for-each select="ancestor::rng:*">
+			<xsl:text> </xsl:text>
+		</xsl:for-each>
+		<xsl:text>&lt;</xsl:text>
+		<xsl:value-of select="local-name(.)" />
+		<xsl:for-each select="@*">
+			<xsl:text> </xsl:text>
+			<xsl:value-of select="local-name(.)" />
+			="
+			<xsl:value-of select="." />
+			"
+		</xsl:for-each>
+		<xsl:choose>
+			<xsl:when test="child::node()">
+				<xsl:text>&gt;</xsl:text>
+				<xsl:apply-templates mode="literal" />
+				<xsl:if test="node()[last()]/self::rng:*">
+					<xsl:text>&#10;</xsl:text>
+				</xsl:if>
+				<xsl:for-each select="ancestor::rng:*">
+					<xsl:text> </xsl:text>
+				</xsl:for-each>
+				<xsl:text>&lt;/</xsl:text>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:text>&gt;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>/&gt;</xsl:text>
+				<xsl:if test="node()[last()]/self::rng:*">
+					<xsl:text>&#10;	  </xsl:text>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template name="makeRef">
-      <xsl:param name="lookup"/>
-      <xsl:variable name="fullname" select="@name"/>
-      <xsl:variable name="myprefix"
-		    select="ancestor::*[@prefix][1]/@prefix"/>
-      <xsl:choose>
-	<xsl:when test="ancestor::tei:content[@autoPrefix='false']">
-	  <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$fullname}"/>
-	</xsl:when>
-	<xsl:when test="count(key('IDENTS',$lookup))&gt;1">
-	  <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$myprefix}{$fullname}"/>
-	</xsl:when>
-	<xsl:when test="key('IDENTS',$lookup)">
-	  <xsl:for-each select="key('IDENTS',$lookup)">
-	    <xsl:variable name="localprefix">
-	      <xsl:choose>
-		<xsl:when test="@prefix">
-		<xsl:value-of select="@prefix"/>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:value-of select="$generalPrefix"/>
-	      </xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:variable>
-	    <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$localprefix}{$fullname}"/>
-	  </xsl:for-each>
-	</xsl:when>
-	<xsl:otherwise>
-	  <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{@name}"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="rng:ref">
+		<xsl:call-template name="makeRef">
+			<xsl:with-param name="lookup"
+				select="replace(@name,'_(alternation|sequenceOptionalRepeatable|sequenceOptional|sequenceRepeatable|sequence)','')" />
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template name="makeRef">
+		<xsl:param name="lookup" />
+		<xsl:variable name="fullname" select="@name" />
+		<xsl:variable name="myprefix"
+			select="ancestor::*[@prefix][1]/@prefix" />
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:content[@autoPrefix='false']">
+				<ref xmlns="http://relaxng.org/ns/structure/1.0"
+					name="{$fullname}" />
+			</xsl:when>
+			<xsl:when test="count(key('IDENTS',$lookup))&gt;1">
+				<ref xmlns="http://relaxng.org/ns/structure/1.0"
+					name="{$myprefix}{$fullname}" />
+			</xsl:when>
+			<xsl:when test="key('IDENTS',$lookup)">
+				<xsl:for-each select="key('IDENTS',$lookup)">
+					<xsl:variable name="localprefix">
+						<xsl:choose>
+							<xsl:when test="@prefix">
+								<xsl:value-of select="@prefix" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="$generalPrefix" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<ref xmlns="http://relaxng.org/ns/structure/1.0"
+						name="{$localprefix}{$fullname}" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<ref xmlns="http://relaxng.org/ns/structure/1.0" name="{@name}" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="rng:*">
-    <xsl:element name="{local-name()}" xmlns="http://relaxng.org/ns/structure/1.0" >
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates select="rng:*|tei:*|text()|comment()"/>
-    </xsl:element>
-  </xsl:template>
 
+	<xsl:template match="rng:*">
+		<xsl:element name="{local-name()}"
+			xmlns="http://relaxng.org/ns/structure/1.0">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates
+				select="rng:*|tei:*|text()|comment()" />
+		</xsl:element>
+	</xsl:template>
 
-  <xsl:template match="rng:zeroOrMore">
-    <xsl:choose>
-      <xsl:when
-        test="rng:ref/@name='model.global'   and preceding-sibling::rng:*[1][self::rng:zeroOrMore/rng:ref/@name='model.global']"/>
-      <xsl:when test="count(rng:*)=1 and rng:zeroOrMore">
-        <xsl:apply-templates select="rng:*|tei:*|text()|comment()"/>
-      </xsl:when>
-      <xsl:otherwise>
-	<zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0" >
-          <xsl:copy-of select="@*"/>
-          <xsl:apply-templates select="rng:*|tei:*|text()|comment()"/>
-	</zeroOrMore>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
+	<xsl:template match="rng:zeroOrMore">
+		<xsl:choose>
+			<xsl:when
+				test="rng:ref/@name='model.global'   and preceding-sibling::rng:*[1][self::rng:zeroOrMore/rng:ref/@name='model.global']" />
+			<xsl:when test="count(rng:*)=1 and rng:zeroOrMore">
+				<xsl:apply-templates
+					select="rng:*|tei:*|text()|comment()" />
+			</xsl:when>
+			<xsl:otherwise>
+				<zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates
+						select="rng:*|tei:*|text()|comment()" />
+				</zeroOrMore>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="rng:choice">
-    <xsl:choose>
-      <xsl:when test="count(rng:*)=1">
-        <xsl:apply-templates select="a:*|rng:*|tei:*|text()|comment()"/>
-      </xsl:when>
-      <xsl:otherwise>
-	<choice xmlns="http://relaxng.org/ns/structure/1.0">
-          <xsl:copy-of select="@*"/>
-          <xsl:apply-templates select="a:*|rng:*|tei:*|text()|comment()"/>
-	</choice>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
+	<xsl:template match="rng:choice">
+		<xsl:choose>
+			<xsl:when test="count(rng:*)=1">
+				<xsl:apply-templates
+					select="a:*|rng:*|tei:*|text()|comment()" />
+			</xsl:when>
+			<xsl:otherwise>
+				<choice xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates
+						select="a:*|rng:*|tei:*|text()|comment()" />
+				</choice>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="rng:group">
-    <!-- check if this group is identical to the last -->
-    <xsl:choose>
-      <xsl:when
-        test="count(rng:*)=1 and local-name(preceding-sibling::rng:*[1])='group' and rng:zeroOrMore">
-        <xsl:variable name="that">
-          <xsl:for-each select="preceding-sibling::rng:*[1]">
-            <xsl:apply-templates mode="decomposed"/>
-          </xsl:for-each>
-        </xsl:variable>
-        <xsl:variable name="this">
-          <xsl:apply-templates mode="decomposed"/>
-        </xsl:variable>
-        <xsl:choose>
-          <xsl:when test="$that=$this"/>
-	  <xsl:otherwise>
-	    <group xmlns="http://relaxng.org/ns/structure/1.0">
-              <xsl:copy-of select="@*"/>
-              <xsl:apply-templates select="rng:*|tei:*|text()|comment()"/>
-	    </group>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:element name="{local-name()}" xmlns="http://relaxng.org/ns/structure/1.0" >
-          <xsl:copy-of select="@*"/>
-          <xsl:apply-templates select="rng:*|tei:*|text()|comment()"/>
-	</xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
+	<xsl:template match="rng:group">
+		<!-- check if this group is identical to the last -->
+		<xsl:choose>
+			<xsl:when
+				test="count(rng:*)=1 and local-name(preceding-sibling::rng:*[1])='group' and rng:zeroOrMore">
+				<xsl:variable name="that">
+					<xsl:for-each select="preceding-sibling::rng:*[1]">
+						<xsl:apply-templates mode="decomposed" />
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:variable name="this">
+					<xsl:apply-templates mode="decomposed" />
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$that=$this" />
+					<xsl:otherwise>
+						<group xmlns="http://relaxng.org/ns/structure/1.0">
+							<xsl:copy-of select="@*" />
+							<xsl:apply-templates
+								select="rng:*|tei:*|text()|comment()" />
+						</group>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element name="{local-name()}"
+					xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates
+						select="rng:*|tei:*|text()|comment()" />
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="rng:*" mode="decomposed">
-    <xsl:value-of select="local-name(.)"/>
-    <xsl:for-each select="@*">
-      <xsl:text>@</xsl:text>
-      <xsl:value-of select="."/>
-    </xsl:for-each>
-    <xsl:apply-templates mode="decomposed"/>
-  </xsl:template>
 
+	<xsl:template match="rng:*" mode="decomposed">
+		<xsl:value-of select="local-name(.)" />
+		<xsl:for-each select="@*">
+			<xsl:text>@</xsl:text>
+			<xsl:value-of select="." />
+		</xsl:for-each>
+		<xsl:apply-templates mode="decomposed" />
+	</xsl:template>
 
-  <xsl:template match="tei:*" mode="tangle"/>
 
-  <xsl:template match="tei:attRef" mode="tangle">
-    <xsl:call-template name="makeRef">
-      <xsl:with-param name="lookup" select="substring-before(@name,'.attribute')"/>
-    </xsl:call-template>
-  </xsl:template>
+	<xsl:template match="tei:*" mode="tangle" />
 
-  <xsl:template match="tei:attDef" mode="tangle">
-    <xsl:param name="element"/>
-    <xsl:variable name="I">
-      <xsl:value-of select="translate(@ident,':','')"/>
-    </xsl:variable>
-    <xsl:if test="not(starts-with(@ident,'xmlns'))">
-      <xsl:choose>
-        <xsl:when test="ancestor::tei:elementSpec">
-          <xsl:call-template name="makeAnAttribute"/>
-        </xsl:when>
-        <xsl:when test="ancestor::tei:classSpec">
-          <define xmlns="http://relaxng.org/ns/structure/1.0"
-            name="{$element}.attribute.{translate(@ident,':','')}">
-            <xsl:call-template name="makeAnAttribute"/>
-          </define>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:if>
-    <xsl:apply-templates select="tei:constraintSpec"/>
+	<xsl:template match="tei:attRef" mode="tangle">
+		<xsl:call-template name="makeRef">
+			<xsl:with-param name="lookup"
+				select="substring-before(@name,'.attribute')" />
+		</xsl:call-template>
+	</xsl:template>
 
-  </xsl:template>
+	<xsl:template match="tei:attDef" mode="tangle">
+		<xsl:param name="element" />
+		<xsl:variable name="I">
+			<xsl:value-of select="translate(@ident,':','')" />
+		</xsl:variable>
+		<xsl:if test="not(starts-with(@ident,'xmlns'))">
+			<xsl:choose>
+				<xsl:when test="ancestor::tei:elementSpec">
+					<xsl:call-template name="makeAnAttribute" />
+				</xsl:when>
+				<xsl:when test="ancestor::tei:classSpec">
+					<define xmlns="http://relaxng.org/ns/structure/1.0"
+						name="{$element}.attribute.{translate(@ident,':','')}">
+						<xsl:call-template name="makeAnAttribute" />
+					</define>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:if>
+		<xsl:apply-templates select="tei:constraintSpec" />
 
-  <xsl:template match="tei:attList" mode="tangle">
-    <xsl:param name="element"/>
-    <xsl:choose>
-      <xsl:when test="count(*)=0"/>
-      <xsl:when test="@org='group' and         parent::tei:attList[@org='choice']">
-        <group xmlns="http://relaxng.org/ns/structure/1.0">
-          <xsl:apply-templates mode="tangle" select="tei:*">
-            <xsl:with-param name="element" select="$element"/>
-          </xsl:apply-templates>
-        </group>
-      </xsl:when>
+	</xsl:template>
 
-      <xsl:when test="@org='choice'">
-        <choice xmlns="http://relaxng.org/ns/structure/1.0">
-          <xsl:apply-templates mode="tangle" select="tei:*">
-            <xsl:with-param name="element" select="$element"/>
-          </xsl:apply-templates>
-        </choice>
-      </xsl:when>
+	<xsl:template match="tei:attList" mode="tangle">
+		<xsl:param name="element" />
+		<xsl:choose>
+			<xsl:when test="count(*)=0" />
+			<xsl:when
+				test="@org='group' and         parent::tei:attList[@org='choice']">
+				<group xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:apply-templates mode="tangle"
+						select="tei:*">
+						<xsl:with-param name="element" select="$element" />
+					</xsl:apply-templates>
+				</group>
+			</xsl:when>
 
-      <xsl:otherwise>
-        <xsl:apply-templates mode="tangle" select="tei:*">
-          <xsl:with-param name="element" select="$element"/>
-        </xsl:apply-templates>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			<xsl:when test="@org='choice'">
+				<choice xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:apply-templates mode="tangle"
+						select="tei:*">
+						<xsl:with-param name="element" select="$element" />
+					</xsl:apply-templates>
+				</choice>
+			</xsl:when>
 
+			<xsl:otherwise>
+				<xsl:apply-templates mode="tangle"
+					select="tei:*">
+					<xsl:with-param name="element" select="$element" />
+				</xsl:apply-templates>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:classSpec" mode="tangle">
-    <xsl:variable name="c">
-      <xsl:choose>
-	<xsl:when test="@prefix">
-	  <xsl:value-of select="@prefix"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="$generalPrefix"/>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:value-of select="@ident"/>
-    </xsl:variable>
 
-    <xsl:if test="$verbose='true'">
-      <xsl:message> classSpec <xsl:value-of select="@ident"/> (type <xsl:value-of select="@type"
-        />)</xsl:message>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="@type='model'">
-        <xsl:apply-templates mode="processModel" select=".">
-          <xsl:with-param name="declare">false</xsl:with-param>
-          <!--	    <xsl:choose>
-	      <xsl:when test="@module='tei'">true</xsl:when>
-	      <xsl:otherwise>false</xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:with-param>
--->
-        </xsl:apply-templates>
-      </xsl:when>
-      <xsl:when test="@type='atts'">
-        <xsl:call-template name="bitOut">
-          <xsl:with-param name="grammar">true</xsl:with-param>
-          <xsl:with-param name="content">
-            <Wrapper>
-              <xsl:variable name="contents">
-                <ROOT>
-                  <xsl:for-each select="tei:classes/tei:memberOf">
-                    <xsl:for-each select="key('IDENTS',@key)[1]">
-                      <xsl:if test="@type='atts'">
-                        <ref  xmlns="http://relaxng.org/ns/structure/1.0">
-			  <xsl:attribute name="name">
+	<xsl:template match="tei:classSpec" mode="tangle">
+		<xsl:variable name="c">
+			<xsl:choose>
+				<xsl:when test="@prefix">
+					<xsl:value-of select="@prefix" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$generalPrefix" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:value-of select="@ident" />
+		</xsl:variable>
+
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				classSpec
+				<xsl:value-of select="@ident" />
+				(type
+				<xsl:value-of select="@type" />
+				)
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@type='model'">
+				<xsl:apply-templates mode="processModel"
+					select=".">
+					<xsl:with-param name="declare">
+						false
+					</xsl:with-param>
+					<!-- <xsl:choose> <xsl:when test="@module='tei'">true</xsl:when> <xsl:otherwise>false</xsl:otherwise> 
+						</xsl:choose> </xsl:with-param> -->
+				</xsl:apply-templates>
+			</xsl:when>
+			<xsl:when test="@type='atts'">
+				<xsl:call-template name="bitOut">
+					<xsl:with-param name="grammar">
+						true
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<Wrapper>
+							<xsl:variable name="contents">
+								<ROOT>
+									<xsl:for-each select="tei:classes/tei:memberOf">
+										<xsl:for-each select="key('IDENTS',@key)[1]">
+											<xsl:if test="@type='atts'">
+												<ref xmlns="http://relaxng.org/ns/structure/1.0">
+													<xsl:attribute name="name">
 			    <xsl:choose>
 			      <xsl:when test="@prefix">
-				<xsl:value-of select="@prefix"/>
+				<xsl:value-of select="@prefix" />
 			      </xsl:when>
 			      <xsl:otherwise>
-				<xsl:value-of select="$generalPrefix"/>
+				<xsl:value-of select="$generalPrefix" />
 			      </xsl:otherwise>
 			    </xsl:choose>
-			    <xsl:value-of select="@ident"/>
+			    <xsl:value-of select="@ident" />
 			    <xsl:text>.attributes</xsl:text>
 			  </xsl:attribute>
-			</ref>
-                      </xsl:if>
-                    </xsl:for-each>
-                  </xsl:for-each>
-                  <xsl:for-each select="tei:attList//tei:attDef">
-                    <xsl:if test="not(starts-with(@ident,'xmlns'))">
-                      <ref xmlns="http://relaxng.org/ns/structure/1.0"
-                        name="{$c}.attribute.{translate(@ident,':','')}"/>
-                    </xsl:if>
-                  </xsl:for-each>
-                  <xsl:for-each select="tei:attList//tei:attRef">
-		    <xsl:call-template name="makeRef">
-		      <xsl:with-param name="lookup" select="substring-before(@name,'.attribute')"/>
-		    </xsl:call-template>
-                  </xsl:for-each>
-                </ROOT>
-              </xsl:variable>
-              <define xmlns="http://relaxng.org/ns/structure/1.0"
-		      name="{$c}.attributes">
-		<xsl:for-each select="$contents/ROOT">
-		  <xsl:apply-templates mode="justcopy"/>
-		  <xsl:if test="not($contents/ROOT/*)">
-		    <empty/>
-		  </xsl:if>
-		</xsl:for-each>
-              </define>
-              <xsl:apply-templates mode="tangle" select="tei:attList//tei:attDef">
-                <xsl:with-param name="element" select="$c"/>
-              </xsl:apply-templates>
-            </Wrapper>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+												</ref>
+											</xsl:if>
+										</xsl:for-each>
+									</xsl:for-each>
+									<xsl:for-each select="tei:attList//tei:attDef">
+										<xsl:if test="not(starts-with(@ident,'xmlns'))">
+											<ref xmlns="http://relaxng.org/ns/structure/1.0"
+												name="{$c}.attribute.{translate(@ident,':','')}" />
+										</xsl:if>
+									</xsl:for-each>
+									<xsl:for-each select="tei:attList//tei:attRef">
+										<xsl:call-template name="makeRef">
+											<xsl:with-param name="lookup"
+												select="substring-before(@name,'.attribute')" />
+										</xsl:call-template>
+									</xsl:for-each>
+								</ROOT>
+							</xsl:variable>
+							<define xmlns="http://relaxng.org/ns/structure/1.0"
+								name="{$c}.attributes">
+								<xsl:for-each select="$contents/ROOT">
+									<xsl:apply-templates mode="justcopy" />
+									<xsl:if test="not($contents/ROOT/*)">
+										<empty />
+									</xsl:if>
+								</xsl:for-each>
+							</define>
+							<xsl:apply-templates mode="tangle"
+								select="tei:attList//tei:attDef">
+								<xsl:with-param name="element" select="$c" />
+							</xsl:apply-templates>
+						</Wrapper>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:classSpec" mode="processModel">
-    <xsl:param name="declare">false</xsl:param>
-    <xsl:if test="$verbose='true'">
-      <xsl:message> .... model class <xsl:value-of select="@ident"/>
-      </xsl:message>
-    </xsl:if>
-    <xsl:call-template name="bitOut">
-      <xsl:with-param name="grammar">true</xsl:with-param>
-      <xsl:with-param name="content">
-        <Wrapper>
-          <xsl:call-template name="processClassDefinition">
-            <xsl:with-param name="type">
-              <xsl:choose>
-                <xsl:when test="@generate">
-                  <xsl:value-of select="@generate"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:text>&#10;			     NULL
+	<xsl:template match="tei:classSpec" mode="processModel">
+		<xsl:param name="declare">
+			false
+		</xsl:param>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				.... model class
+				<xsl:value-of select="@ident" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="bitOut">
+			<xsl:with-param name="grammar">
+				true
+			</xsl:with-param>
+			<xsl:with-param name="content">
+				<Wrapper>
+					<xsl:call-template name="processClassDefinition">
+						<xsl:with-param name="type">
+							<xsl:choose>
+								<xsl:when test="@generate">
+									<xsl:value-of select="@generate" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:text>&#10;			     NULL
 			     alternation
 			     sequence
 			     sequenceOptional
 			     sequenceOptionalRepeatable
 			   sequenceRepeatable</xsl:text>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="declare" select="$declare"/>
-          </xsl:call-template>
-        </Wrapper>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+						<xsl:with-param name="declare" select="$declare" />
+					</xsl:call-template>
+				</Wrapper>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
 
-  <xsl:template name="processClassDefinition">
-    <xsl:param name="type"/>
-    <xsl:param name="declare"/>
-    <xsl:variable name="Type">
-      <xsl:value-of select="normalize-space($type)"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="string-length($Type)=0">
-        <xsl:call-template name="makeClassDefinition">
-          <xsl:with-param name="type">NULL</xsl:with-param>
-          <xsl:with-param name="declare" select="$declare"/>
-        </xsl:call-template>
-      </xsl:when>
+	<xsl:template name="processClassDefinition">
+		<xsl:param name="type" />
+		<xsl:param name="declare" />
+		<xsl:variable name="Type">
+			<xsl:value-of select="normalize-space($type)" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="string-length($Type)=0">
+				<xsl:call-template name="makeClassDefinition">
+					<xsl:with-param name="type">
+						NULL
+					</xsl:with-param>
+					<xsl:with-param name="declare" select="$declare" />
+				</xsl:call-template>
+			</xsl:when>
 
-      <xsl:when test="contains($Type,' ')">
-        <xsl:call-template name="makeClassDefinition">
-          <xsl:with-param name="type" select="substring-before($Type,' ')"/>
-          <xsl:with-param name="declare" select="$declare"/>
-        </xsl:call-template>
-        <xsl:call-template name="processClassDefinition">
-          <xsl:with-param name="type" select="substring-after($Type,' ')"/>
-          <xsl:with-param name="declare" select="$declare"/>
-        </xsl:call-template>
-      </xsl:when>
+			<xsl:when test="contains($Type,' ')">
+				<xsl:call-template name="makeClassDefinition">
+					<xsl:with-param name="type"
+						select="substring-before($Type,' ')" />
+					<xsl:with-param name="declare" select="$declare" />
+				</xsl:call-template>
+				<xsl:call-template name="processClassDefinition">
+					<xsl:with-param name="type"
+						select="substring-after($Type,' ')" />
+					<xsl:with-param name="declare" select="$declare" />
+				</xsl:call-template>
+			</xsl:when>
 
-      <xsl:otherwise>
-        <xsl:call-template name="makeClassDefinition">
-          <xsl:with-param name="type" select="$Type"/>
-          <xsl:with-param name="declare" select="$declare"/>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			<xsl:otherwise>
+				<xsl:call-template name="makeClassDefinition">
+					<xsl:with-param name="type" select="$Type" />
+					<xsl:with-param name="declare" select="$declare" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template name="makeClassDefinition">
-    <xsl:param name="type"/>
-    <xsl:param name="declare"/>
-    <!--
-      alternation
-      sequence
-      sequenceOptional
-      sequenceOptionalRepeatable
-      sequenceRepeatable
-  -->
+	<xsl:template name="makeClassDefinition">
+		<xsl:param name="type" />
+		<xsl:param name="declare" />
+		<!-- alternation sequence sequenceOptional sequenceOptionalRepeatable sequenceRepeatable -->
 
-    <xsl:variable name="thisClass">
-      <xsl:value-of select="@ident"/>
-    </xsl:variable>
-    <xsl:variable name="localprefix">
-      <xsl:choose>
-	<xsl:when test="@prefix">
-	  <xsl:value-of select="@prefix"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="$generalPrefix"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
+		<xsl:variable name="thisClass">
+			<xsl:value-of select="@ident" />
+		</xsl:variable>
+		<xsl:variable name="localprefix">
+			<xsl:choose>
+				<xsl:when test="@prefix">
+					<xsl:value-of select="@prefix" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$generalPrefix" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-    <xsl:variable name="suffix">
-      <xsl:choose>
-        <xsl:when test="$type='NULL'"> </xsl:when>
-        <xsl:otherwise>
-          <xsl:text>_</xsl:text>
-          <xsl:value-of select="$type"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
+		<xsl:variable name="suffix">
+			<xsl:choose>
+				<xsl:when test="$type='NULL'">
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>_</xsl:text>
+					<xsl:value-of select="$type" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-    <xsl:choose>
-      <xsl:when test="$declare='true'">
-        <xsl:apply-templates mode="tangleModel" select="tei:classes/tei:memberOf"/>
-        <define xmlns="http://relaxng.org/ns/structure/1.0"
-          name="{$localprefix}{$thisClass}{$suffix}">
-          <xsl:if test="@predeclare='true'">
-            <xsl:attribute name="combine">choice</xsl:attribute>
-          </xsl:if>
-          <notAllowed/>
-        </define>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="makeDecls">
-          <xsl:call-template name="findUses">
-            <xsl:with-param name="pattern" select="$type"/>
-            <xsl:with-param name="class" select="$thisClass"/>
-          </xsl:call-template>
-        </xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$declare='true'">
+				<xsl:apply-templates mode="tangleModel"
+					select="tei:classes/tei:memberOf" />
+				<define xmlns="http://relaxng.org/ns/structure/1.0"
+					name="{$localprefix}{$thisClass}{$suffix}">
+					<xsl:if test="@predeclare='true'">
+						<xsl:attribute name="combine">choice</xsl:attribute>
+					</xsl:if>
+					<notAllowed />
+				</define>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="makeDecls">
+					<xsl:call-template name="findUses">
+						<xsl:with-param name="pattern" select="$type" />
+						<xsl:with-param name="class" select="$thisClass" />
+					</xsl:call-template>
+				</xsl:variable>
 
-        <!--<xsl:message>
+				<!--<xsl:message> DEBUG <xsl:value-of select="$thisClass"/><xsl:value-of 
+					select="$suffix"/> generated <xsl:value-of select="$makeDecls"/></xsl:message> -->
+				<xsl:choose>
+					<!-- <xsl:when test="$makeDecls=''"> <xsl:if test="$verbose='true'"> 
+						<xsl:message>Do NOT generate <xsl:value-of select="$thisClass"/> <xsl:value-of 
+						select="$suffix"/> (<xsl:value-of select="$type"/>) </xsl:message> </xsl:if> 
+						</xsl:when> -->
+					<xsl:when
+						test="count(key('CLASSMEMBERS',$thisClass))&gt;0">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								.... ... generate model
+								<xsl:value-of select="$thisClass" />
+								<xsl:value-of select="$suffix" />
+								(
+								<xsl:value-of select="$type" />
+								)
+							</xsl:message>
+						</xsl:if>
+						<define xmlns="http://relaxng.org/ns/structure/1.0"
+							name="{$localprefix}{$thisClass}{$suffix}">
+							<xsl:choose>
+								<xsl:when test="$type='sequence'">
+									<xsl:for-each
+										select="key('CLASSMEMBERS',$thisClass)">
+										<xsl:apply-templates select="."
+											mode="classmember">
+											<xsl:with-param name="theClass"
+												select="$thisClass" />
+											<xsl:with-param name="suffix" select="$type" />
+										</xsl:apply-templates>
+									</xsl:for-each>
+								</xsl:when>
+								<xsl:when test="$type='sequenceOptional'">
+									<xsl:for-each
+										select="key('CLASSMEMBERS',$thisClass)">
+										<optional>
+											<xsl:apply-templates select="."
+												mode="classmember">
+												<xsl:with-param name="theClass"
+													select="$thisClass" />
+												<xsl:with-param name="suffix" select="$type" />
+											</xsl:apply-templates>
+										</optional>
+									</xsl:for-each>
+								</xsl:when>
 
-DEBUG <xsl:value-of select="$thisClass"/><xsl:value-of
-select="$suffix"/> generated <xsl:value-of
-select="$makeDecls"/></xsl:message>
--->
-        <xsl:choose>
-          <!--
-               <xsl:when test="$makeDecls=''">
-                  <xsl:if test="$verbose='true'">
-                     <xsl:message>Do NOT generate <xsl:value-of select="$thisClass"/>
-                        <xsl:value-of select="$suffix"/> (<xsl:value-of select="$type"/>)                     </xsl:message>
-                  </xsl:if>
-               </xsl:when>
--->
-          <xsl:when test="count(key('CLASSMEMBERS',$thisClass))&gt;0">
-            <xsl:if test="$verbose='true'">
-              <xsl:message> .... ... generate model <xsl:value-of select="$thisClass"/>
-                <xsl:value-of select="$suffix"/> (<xsl:value-of select="$type"/>) </xsl:message>
-            </xsl:if>
-            <define xmlns="http://relaxng.org/ns/structure/1.0"
-              name="{$localprefix}{$thisClass}{$suffix}">
-              <xsl:choose>
-                <xsl:when test="$type='sequence'">
-                  <xsl:for-each select="key('CLASSMEMBERS',$thisClass)">
-                    <xsl:apply-templates select="."
-					 mode="classmember">
-                      <xsl:with-param name="theClass" select="$thisClass"/>
-                      <xsl:with-param name="suffix" select="$type"/>
-                    </xsl:apply-templates>
-                  </xsl:for-each>
-                </xsl:when>
-                <xsl:when test="$type='sequenceOptional'">
-                  <xsl:for-each select="key('CLASSMEMBERS',$thisClass)">
-                    <optional>
-                      <xsl:apply-templates select="."  mode="classmember">
-			<xsl:with-param name="theClass" select="$thisClass"/>
-                        <xsl:with-param name="suffix" select="$type"/>
-                      </xsl:apply-templates>
-                    </optional>
-                  </xsl:for-each>
-                </xsl:when>
+								<xsl:when test="$type='sequenceRepeatable'">
+									<xsl:for-each
+										select="key('CLASSMEMBERS',$thisClass)">
+										<oneOrMore>
+											<xsl:apply-templates select="."
+												mode="classmember">
+												<xsl:with-param name="theClass"
+													select="$thisClass" />
+												<xsl:with-param name="suffix" select="$type" />
+											</xsl:apply-templates>
+										</oneOrMore>
+									</xsl:for-each>
+								</xsl:when>
 
-                <xsl:when test="$type='sequenceRepeatable'">
-                  <xsl:for-each select="key('CLASSMEMBERS',$thisClass)">
-                    <oneOrMore>
-                      <xsl:apply-templates select="."  mode="classmember">
-			<xsl:with-param name="theClass" select="$thisClass"/>		   
-                        <xsl:with-param name="suffix" select="$type"/>
-                      </xsl:apply-templates>
-                    </oneOrMore>
-                  </xsl:for-each>
-                </xsl:when>
+								<xsl:when test="$type='sequenceOptionalRepeatable'">
+									<xsl:for-each
+										select="key('CLASSMEMBERS',$thisClass)">
+										<zeroOrMore>
+											<xsl:apply-templates select="."
+												mode="classmember">
+												<xsl:with-param name="suffix" select="$type" />
+												<xsl:with-param name="theClass"
+													select="$thisClass" />
+											</xsl:apply-templates>
+										</zeroOrMore>
+									</xsl:for-each>
+								</xsl:when>
 
-                <xsl:when test="$type='sequenceOptionalRepeatable'">
-                  <xsl:for-each select="key('CLASSMEMBERS',$thisClass)">
-                    <zeroOrMore>
-                      <xsl:apply-templates select="." mode="classmember">
-                        <xsl:with-param name="suffix" select="$type"/>
-			<xsl:with-param name="theClass" select="$thisClass"/>
-                      </xsl:apply-templates>
-                    </zeroOrMore>
-                  </xsl:for-each>
-                </xsl:when>
+								<xsl:otherwise>
+									<choice>
+										<xsl:for-each
+											select="key('CLASSMEMBERS',$thisClass)">
+											<xsl:apply-templates select="."
+												mode="classmember">
+												<xsl:with-param name="suffix" select="$type" />
+												<xsl:with-param name="theClass"
+													select="$thisClass" />
+											</xsl:apply-templates>
+										</xsl:for-each>
+									</choice>
+								</xsl:otherwise>
+							</xsl:choose>
+						</define>
+					</xsl:when>
+					<xsl:otherwise>
+						<define xmlns="http://relaxng.org/ns/structure/1.0"
+							name="{$localprefix}{$thisClass}{$suffix}">
+							<xsl:choose>
+								<xsl:when
+									test="$type='sequence' or     $type='sequenceOptional' or      $type='sequenceOptionalRepeatable'">
+									<empty />
+								</xsl:when>
+								<xsl:otherwise>
+									<notAllowed />
+								</xsl:otherwise>
+							</xsl:choose>
+						</define>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-                <xsl:otherwise>
-                  <choice>
-                    <xsl:for-each select="key('CLASSMEMBERS',$thisClass)">
-                      <xsl:apply-templates select="." mode="classmember">
-                        <xsl:with-param name="suffix" select="$type"/>
-			<xsl:with-param name="theClass" select="$thisClass"/>
-                      </xsl:apply-templates>
-                    </xsl:for-each>
-                  </choice>
-                </xsl:otherwise>
-              </xsl:choose>
-            </define>
-          </xsl:when>
-          <xsl:otherwise>
-            <define xmlns="http://relaxng.org/ns/structure/1.0"
-              name="{$localprefix}{$thisClass}{$suffix}">
-              <xsl:choose>
-                <xsl:when
-                  test="$type='sequence' or     $type='sequenceOptional' or      $type='sequenceOptionalRepeatable'">
-                  <empty/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <notAllowed/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </define>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
 
+	<xsl:template name="findUses">
+		<xsl:param name="pattern" />
+		<xsl:param name="class" />
+		<xsl:variable name="suffix">
+			<xsl:choose>
+				<xsl:when test="$pattern='NULL'" />
+				<xsl:otherwise>
+					<xsl:text>_</xsl:text>
+					<xsl:value-of select="$pattern" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-  <xsl:template name="findUses">
-    <xsl:param name="pattern"/>
-    <xsl:param name="class"/>
-    <xsl:variable name="suffix">
-      <xsl:choose>
-        <xsl:when test="$pattern='NULL'"/>
-        <xsl:otherwise>
-          <xsl:text>_</xsl:text>
-          <xsl:value-of select="$pattern"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
+		<xsl:choose>
+			<xsl:when test="not(ancestor::tei:schemaSpec)">
+				x
+			</xsl:when>
+			<xsl:when test="key('REFS',concat($class,$suffix))">
+				x
+			</xsl:when>
+			<xsl:when test="key('REFS',$class)">
+				x
+			</xsl:when>
+			<xsl:when test="not($suffix='')" />
+			<xsl:when test="tei:classes/tei:memberOf">
+				<xsl:for-each select="tei:classes/tei:memberOf">
+					<xsl:for-each select="key('CLASSES',@key)">
+						<xsl:call-template name="findUses">
+							<xsl:with-param name="pattern" />
+							<xsl:with-param name="class" select="@ident" />
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:choose>
-      <xsl:when test="not(ancestor::tei:schemaSpec)">x</xsl:when>
-      <xsl:when test="key('REFS',concat($class,$suffix))">x</xsl:when>
-      <xsl:when test="key('REFS',$class)">x</xsl:when>
-      <xsl:when test="not($suffix='')"/>
-      <xsl:when test="tei:classes/tei:memberOf">
-        <xsl:for-each select="tei:classes/tei:memberOf">
-          <xsl:for-each select="key('CLASSES',@key)">
-            <xsl:call-template name="findUses">
-              <xsl:with-param name="pattern"/>
-              <xsl:with-param name="class" select="@ident"/>
-            </xsl:call-template>
-          </xsl:for-each>
-        </xsl:for-each>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
 
+	<xsl:template match="tei:classSpec" mode="tangleadd">
+		<xsl:apply-templates mode="tangleadd" />
+	</xsl:template>
 
-  <xsl:template match="tei:classSpec" mode="tangleadd">
-    <xsl:apply-templates mode="tangleadd"/>
-  </xsl:template>
 
+	<xsl:template match="tei:classSpec/@ident" />
 
-  <xsl:template match="tei:classSpec/@ident"/>
 
+	<xsl:template match="tei:code">
+		<xsl:call-template name="typewriter">
+			<xsl:with-param name="text">
+				<xsl:apply-templates />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-  <xsl:template match="tei:code">
-    <xsl:call-template name="typewriter">
-      <xsl:with-param name="text">
-        <xsl:apply-templates/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
+	<xsl:template match="text()" mode="doc">
+		<xsl:value-of select="." />
+	</xsl:template>
 
-  <xsl:template match="text()" mode="doc">
-    <xsl:value-of select="."/>
-  </xsl:template>
+	<xsl:template match="tei:desc" mode="tangle" />
 
-  <xsl:template match="tei:desc" mode="tangle"/>
+	<xsl:template match="tei:classSpec" mode="classmember">
+		<xsl:param name="suffix" />
+		<xsl:variable name="localprefix">
+			<xsl:choose>
+				<xsl:when test="@prefix">
+					<xsl:value-of select="@prefix" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$generalPrefix" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-  <xsl:template match="tei:classSpec" mode="classmember">
-    <xsl:param name="suffix"/>
-    <xsl:variable name="localprefix">
-      <xsl:choose>
-	<xsl:when test="@prefix">
-	  <xsl:value-of select="@prefix"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="$generalPrefix"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$suffix='' or $suffix='NULL'">
+				<ref xmlns="http://relaxng.org/ns/structure/1.0"
+					name="{$localprefix}{@ident}" />
+			</xsl:when>
+			<xsl:otherwise>
+				<ref xmlns="http://relaxng.org/ns/structure/1.0"
+					name="{$localprefix}{@ident}_{$suffix}" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:choose>
-      <xsl:when test="$suffix='' or $suffix='NULL'">
-        <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$localprefix}{@ident}"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <ref xmlns="http://relaxng.org/ns/structure/1.0"
-	     name="{$localprefix}{@ident}_{$suffix}"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:elementSpec" mode="classmember">
+		<xsl:param name="theClass" />
 
-  <xsl:template match="tei:elementSpec" mode="classmember">
-    <xsl:param name="theClass"/>
+		<xsl:variable name="min"
+			select="tei:classes/tei:memberOf[@key=$theClass]/@min" />
+		<xsl:variable name="max"
+			select="tei:classes/tei:memberOf[@key=$theClass]/@max" />
 
-    <xsl:variable name="min" select="tei:classes/tei:memberOf[@key=$theClass]/@min"/>
-    <xsl:variable name="max" select="tei:classes/tei:memberOf[@key=$theClass]/@max"/>
+		<xsl:variable name="mini" as="xs:integer">
+			<xsl:choose>
+				<xsl:when test="not($min castable as xs:integer)">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$min" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="elementPrefix">
+			<xsl:choose>
+				<xsl:when test="@prefix">
+					<xsl:value-of select="@prefix" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$generalPrefix" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="ident" select="@ident" />
 
-    <xsl:variable name="mini" as="xs:integer">
-      <xsl:choose>
-        <xsl:when test="not($min castable as xs:integer)">1</xsl:when>
-        <xsl:otherwise><xsl:value-of select="$min"/></xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="elementPrefix">
-      <xsl:choose>
-        <xsl:when test="@prefix">
-          <xsl:value-of select="@prefix"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$generalPrefix"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="ident" select="@ident"/>
-    
-    <xsl:for-each select="for $i in 1 to $mini return $i">
-      <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$elementPrefix}{$ident}"/>
-    </xsl:for-each> 
-    <xsl:choose>
-      <xsl:when test="$max='unbounded'">
-        <zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
-          <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$elementPrefix}{$ident}"/>
-        </zeroOrMore>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="maxi" as="xs:integer">
-          <xsl:choose>
-            <xsl:when test="not($max castable as xs:integer)">1</xsl:when>
-            <xsl:otherwise><xsl:value-of select="$max"/></xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:for-each select="for $i in ($mini+1) to $maxi return $i">
-          <optional xmlns="http://relaxng.org/ns/structure/1.0">
-            <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$elementPrefix}{$ident}"/>
-          </optional>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose> 
-  </xsl:template>
+		<xsl:for-each select="for $i in 1 to $mini return $i">
+			<ref xmlns="http://relaxng.org/ns/structure/1.0"
+				name="{$elementPrefix}{$ident}" />
+		</xsl:for-each>
+		<xsl:choose>
+			<xsl:when test="$max='unbounded'">
+				<zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
+					<ref xmlns="http://relaxng.org/ns/structure/1.0"
+						name="{$elementPrefix}{$ident}" />
+				</zeroOrMore>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="maxi" as="xs:integer">
+					<xsl:choose>
+						<xsl:when test="not($max castable as xs:integer)">
+							1
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$max" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:for-each
+					select="for $i in ($mini+1) to $maxi return $i">
+					<optional xmlns="http://relaxng.org/ns/structure/1.0">
+						<ref xmlns="http://relaxng.org/ns/structure/1.0"
+							name="{$elementPrefix}{$ident}" />
+					</optional>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:elementSpec" mode="tangle">
-    <xsl:variable name="elementPrefix">
-      <xsl:choose>
-        <xsl:when test="@prefix">
-          <xsl:value-of select="@prefix"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$generalPrefix"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:if test="$verbose='true'">
-      <xsl:message> elementSpec [<xsl:value-of select="$elementPrefix"/>]<xsl:value-of select="@ident"/>
-        <xsl:if test="@xml:id">: <xsl:value-of select="@xml:id"/>
-        </xsl:if>
-      </xsl:message>
-    </xsl:if>
-    <xsl:call-template name="bitOut">
-      <xsl:with-param name="grammar"/>
-      <xsl:with-param name="content">
-        <Wrapper>
-          <xsl:variable name="name">
-            <xsl:choose>
-              <xsl:when test="tei:altIdent=@ident">
-                <xsl:value-of select="@ident"/>
-              </xsl:when>
-              <xsl:when test="tei:altIdent">
-                <xsl:value-of select="normalize-space(tei:altIdent)"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="@ident"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:variable>
-          <xsl:choose>
-            <xsl:when test="tei:content/rng:notAllowed">
-              <define xmlns="http://relaxng.org/ns/structure/1.0" name="{$elementPrefix}{@ident}">
-                <notAllowed/>
-              </define>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:variable name="Attributes">
-                <xsl:call-template name="summarizeAttributes"/>
-              </xsl:variable>
-              <define xmlns="http://relaxng.org/ns/structure/1.0" name="{$elementPrefix}{@ident}">
-                <element name="{$name}">
-                  <xsl:if test="@ns">
-                    <xsl:attribute name="ns">
-                      <xsl:value-of select="@ns"/>
+	<xsl:template match="tei:elementSpec" mode="tangle">
+		<xsl:variable name="elementPrefix">
+			<xsl:choose>
+				<xsl:when test="@prefix">
+					<xsl:value-of select="@prefix" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$generalPrefix" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				elementSpec [
+				<xsl:value-of select="$elementPrefix" />
+				]
+				<xsl:value-of select="@ident" />
+				<xsl:if test="@xml:id">
+					:
+					<xsl:value-of select="@xml:id" />
+				</xsl:if>
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="bitOut">
+			<xsl:with-param name="grammar" />
+			<xsl:with-param name="content">
+				<Wrapper>
+					<xsl:variable name="name">
+						<xsl:choose>
+							<xsl:when test="tei:altIdent=@ident">
+								<xsl:value-of select="@ident" />
+							</xsl:when>
+							<xsl:when test="tei:altIdent">
+								<xsl:value-of
+									select="normalize-space(tei:altIdent)" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@ident" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="tei:content/rng:notAllowed">
+							<define xmlns="http://relaxng.org/ns/structure/1.0"
+								name="{$elementPrefix}{@ident}">
+								<notAllowed />
+							</define>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:variable name="Attributes">
+								<xsl:call-template name="summarizeAttributes" />
+							</xsl:variable>
+							<define xmlns="http://relaxng.org/ns/structure/1.0"
+								name="{$elementPrefix}{@ident}">
+								<element name="{$name}">
+									<xsl:if test="@ns">
+										<xsl:attribute name="ns">
+                      <xsl:value-of select="@ns" />
                     </xsl:attribute>
-                  </xsl:if>
-                  <xsl:if test="not($oddmode='tei')">
-                    <a:documentation>
-                      <xsl:call-template name="makeDescription">
-                        <xsl:with-param name="includeValList">true</xsl:with-param>
-                        <xsl:with-param name="coded">false</xsl:with-param>
-                      </xsl:call-template>
-                    </a:documentation>
-                  </xsl:if>
-                  <xsl:choose>
-                    <xsl:when test="$parameterize='true'">
-                      <ref name="{$elementPrefix}{@ident}.content"/>
-                      <xsl:if test="not($Attributes='')">
-			<xsl:if test="$verbose='true'">
-			  <xsl:message>   refer to attributes: </xsl:message>
-			</xsl:if>
-                        <ref name="{$elementPrefix}{@ident}.localattributes"/>
-                      </xsl:if>
-		    </xsl:when>
-		    <xsl:otherwise>
-                      <xsl:call-template name="defineContent"/>
-                      <xsl:if test="not($Attributes='')">
-			<xsl:call-template name="defineAttributes"/>
-                      </xsl:if>
-                    </xsl:otherwise>
-                  </xsl:choose>
-                  <!--
-		  <xsl:if test="@ident='TEI' or @ident='teiCorpus'">
-		    <optional>
-		      <attribute name="schemaLocation"
-				     ns="http://www.w3.org/2001/XMLSchema-instance">
-			<text/>
-		      </attribute>
-		    </optional>
-		  </xsl:if>
--->
-                </element>
-              </define>
-              <xsl:if test="$parameterize='true'">
-                <define xmlns="http://relaxng.org/ns/structure/1.0"
-                  name="{$elementPrefix}{@ident}.content">
-                  <xsl:call-template name="defineContent"/>
-                </define>
-                <xsl:if test="not($Attributes='')">
-                  <define xmlns="http://relaxng.org/ns/structure/1.0"
-                    name="{$elementPrefix}{@ident}.localattributes">
-                    <xsl:call-template name="defineAttributes"/>
-                  </define>
-                </xsl:if>
-                <xsl:apply-templates mode="tangleModel" select="tei:classes/tei:memberOf"/>
-              </xsl:if>
-            </xsl:otherwise>
-          </xsl:choose>
-        </Wrapper>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
+									</xsl:if>
+									<xsl:if test="not($oddmode='tei')">
+										<a:documentation>
+											<xsl:call-template name="makeDescription">
+												<xsl:with-param name="includeValList">
+													true
+												</xsl:with-param>
+												<xsl:with-param name="coded">
+													false
+												</xsl:with-param>
+											</xsl:call-template>
+										</a:documentation>
+									</xsl:if>
+									<xsl:choose>
+										<xsl:when test="$parameterize='true'">
+											<ref name="{$elementPrefix}{@ident}.content" />
+											<xsl:if test="not($Attributes='')">
+												<xsl:if test="$verbose='true'">
+													<xsl:message>
+														refer to attributes:
+													</xsl:message>
+												</xsl:if>
+												<ref name="{$elementPrefix}{@ident}.localattributes" />
+											</xsl:if>
+										</xsl:when>
+										<xsl:otherwise>
+											<xsl:call-template name="defineContent" />
+											<xsl:if test="not($Attributes='')">
+												<xsl:call-template name="defineAttributes" />
+											</xsl:if>
+										</xsl:otherwise>
+									</xsl:choose>
+									<!-- <xsl:if test="@ident='TEI' or @ident='teiCorpus'"> <optional> 
+										<attribute name="schemaLocation" ns="http://www.w3.org/2001/XMLSchema-instance"> 
+										<text/> </attribute> </optional> </xsl:if> -->
+								</element>
+							</define>
+							<xsl:if test="$parameterize='true'">
+								<define xmlns="http://relaxng.org/ns/structure/1.0"
+									name="{$elementPrefix}{@ident}.content">
+									<xsl:call-template name="defineContent" />
+								</define>
+								<xsl:if test="not($Attributes='')">
+									<define xmlns="http://relaxng.org/ns/structure/1.0"
+										name="{$elementPrefix}{@ident}.localattributes">
+										<xsl:call-template name="defineAttributes" />
+									</define>
+								</xsl:if>
+								<xsl:apply-templates mode="tangleModel"
+									select="tei:classes/tei:memberOf" />
+							</xsl:if>
+						</xsl:otherwise>
+					</xsl:choose>
+				</Wrapper>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-  <xsl:template name="summarizeAttributes">
-    <xsl:for-each select=".//tei:attDef">x</xsl:for-each>
-    <xsl:for-each select="tei:classes/tei:memberOf">
-      <xsl:for-each select="key('CLASSES',@key)">
-        <xsl:if test="@type='atts'">x</xsl:if>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="summarizeAttributes">
+		<xsl:for-each select=".//tei:attDef">
+			x
+		</xsl:for-each>
+		<xsl:for-each select="tei:classes/tei:memberOf">
+			<xsl:for-each select="key('CLASSES',@key)">
+				<xsl:if test="@type='atts'">
+					x
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="defineAttributes">
-    <xsl:variable name="name">
-      <xsl:choose>
-	<xsl:when test="@prefix">
-	  <xsl:value-of select="@prefix"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="$generalPrefix"/>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:value-of select="@ident"/>
-    </xsl:variable>
-    <xsl:if test="$verbose='true'">
-      <xsl:message>   now define attributes for <xsl:value-of
-      select="@ident"/> (parameterize=<xsl:value-of select="$parameterize"/>)</xsl:message>
-    </xsl:if>
-    <xsl:if test="$parameterize='true'">
-      <xsl:if test="$autoGlobal='true'">
-        <ref xmlns="http://relaxng.org/ns/structure/1.0" name="att.global.attributes"/>
-      </xsl:if>
-      <xsl:for-each select="tei:classes/tei:memberOf">
-        <xsl:for-each select="key('CLASSES',@key)">
-          <xsl:if test="@type='atts'">
-            <ref xmlns="http://relaxng.org/ns/structure/1.0">
-	      <xsl:attribute name="name">
+	<xsl:template name="defineAttributes">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="@prefix">
+					<xsl:value-of select="@prefix" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$generalPrefix" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:value-of select="@ident" />
+		</xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				now define attributes for
+				<xsl:value-of select="@ident" />
+				(parameterize=
+				<xsl:value-of select="$parameterize" />
+				)
+			</xsl:message>
+		</xsl:if>
+		<xsl:if test="$parameterize='true'">
+			<xsl:if test="$autoGlobal='true'">
+				<ref xmlns="http://relaxng.org/ns/structure/1.0"
+					name="att.global.attributes" />
+			</xsl:if>
+			<xsl:for-each select="tei:classes/tei:memberOf">
+				<xsl:for-each select="key('CLASSES',@key)">
+					<xsl:if test="@type='atts'">
+						<ref xmlns="http://relaxng.org/ns/structure/1.0">
+							<xsl:attribute name="name">
 		<xsl:choose>
 		  <xsl:when test="@prefix">
-		    <xsl:value-of select="@prefix"/>
+		    <xsl:value-of select="@prefix" />
 		  </xsl:when>
 		  <xsl:otherwise>
-		    <xsl:value-of select="$generalPrefix"/>
+		    <xsl:value-of select="$generalPrefix" />
 		  </xsl:otherwise>
 		</xsl:choose>
-		<xsl:value-of select="@ident"/>
+		<xsl:value-of select="@ident" />
 		<xsl:text>.attributes</xsl:text>
 	      </xsl:attribute>
-	    </ref>
-          </xsl:if>
-        </xsl:for-each>
-      </xsl:for-each>
-    </xsl:if>
-    <xsl:apply-templates mode="tangle" select="tei:attList">
-      <xsl:with-param name="element">
-	<xsl:value-of select="$name"/>
-      </xsl:with-param>
-    </xsl:apply-templates>
-    <!-- place holder to make sure something gets into the
-	 pattern -->
-    <empty xmlns="http://relaxng.org/ns/structure/1.0"/>
-  </xsl:template>
+						</ref>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:if>
+		<xsl:apply-templates mode="tangle"
+			select="tei:attList">
+			<xsl:with-param name="element">
+				<xsl:value-of select="$name" />
+			</xsl:with-param>
+		</xsl:apply-templates>
+		<!-- place holder to make sure something gets into the pattern -->
+		<empty xmlns="http://relaxng.org/ns/structure/1.0" />
+	</xsl:template>
 
-  <xsl:template name="defineContent">
-    <xsl:variable name="Contents">
-      <TEMPTREE>
-        <xsl:choose>
-          <xsl:when test="tei:valList[@type='closed' and @repeatable='true']">
-            <list xmlns="http://relaxng.org/ns/structure/1.0">
-              <oneOrMore>
-                <choice>
-                  <xsl:call-template name="valListChildren"/>
-                </choice>
-              </oneOrMore>
-            </list>
-          </xsl:when>
-          <xsl:when test="tei:valList[@type='closed']">
-            <xsl:call-template name="valListChildren"/>
-          </xsl:when>
-          <xsl:when test="tei:content">
-            <xsl:apply-templates select="tei:content/*|tei:content/processing-instruction()"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <empty xmlns="http://relaxng.org/ns/structure/1.0"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </TEMPTREE>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="count($Contents/TEMPTREE/*)=0">
-        <empty xmlns="http://relaxng.org/ns/structure/1.0"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:for-each select="$Contents/TEMPTREE">
-          <xsl:apply-templates mode="justcopy"/>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:apply-templates select="tei:constraintSpec"/>
+	<xsl:template name="defineContent">
+		<xsl:variable name="Contents">
+			<TEMPTREE>
+				<xsl:choose>
+					<xsl:when
+						test="tei:valList[@type='closed' and @repeatable='true']">
+						<list xmlns="http://relaxng.org/ns/structure/1.0">
+							<oneOrMore>
+								<choice>
+									<xsl:call-template name="valListChildren" />
+								</choice>
+							</oneOrMore>
+						</list>
+					</xsl:when>
+					<xsl:when test="tei:valList[@type='closed']">
+						<xsl:call-template name="valListChildren" />
+					</xsl:when>
+					<xsl:when test="tei:content">
+						<xsl:apply-templates
+							select="tei:content/*|tei:content/processing-instruction()" />
+					</xsl:when>
+					<xsl:otherwise>
+						<empty xmlns="http://relaxng.org/ns/structure/1.0" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</TEMPTREE>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="count($Contents/TEMPTREE/*)=0">
+				<empty xmlns="http://relaxng.org/ns/structure/1.0" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="$Contents/TEMPTREE">
+					<xsl:apply-templates mode="justcopy" />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:apply-templates select="tei:constraintSpec" />
 
-  </xsl:template>
+	</xsl:template>
 
 
-  <xsl:template name="valListChildren">
-    <choice xmlns="http://relaxng.org/ns/structure/1.0">
-      <xsl:for-each select="tei:valList/tei:valItem">
-        <value>
-          <xsl:choose>
-            <xsl:when test="tei:altIdent=@ident">
-              <xsl:value-of select="@ident"/>
-            </xsl:when>
-            <xsl:when test="tei:altIdent">
-              <xsl:value-of select="normalize-space(tei:altIdent)"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@ident"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </value>
-        <xsl:if test="not($oddmode='tei')">
-          <a:documentation>
-            <xsl:call-template name="makeDescription">
-              <xsl:with-param name="includeValList">true</xsl:with-param>
-              <xsl:with-param name="coded">false</xsl:with-param>
-            </xsl:call-template>
-          </a:documentation>
-        </xsl:if>
-      </xsl:for-each>
-    </choice>
-  </xsl:template>
+	<xsl:template name="valListChildren">
+		<choice xmlns="http://relaxng.org/ns/structure/1.0">
+			<xsl:for-each select="tei:valList/tei:valItem">
+				<value>
+					<xsl:choose>
+						<xsl:when test="tei:altIdent=@ident">
+							<xsl:value-of select="@ident" />
+						</xsl:when>
+						<xsl:when test="tei:altIdent">
+							<xsl:value-of select="normalize-space(tei:altIdent)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@ident" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</value>
+				<xsl:if test="not($oddmode='tei')">
+					<a:documentation>
+						<xsl:call-template name="makeDescription">
+							<xsl:with-param name="includeValList">
+								true
+							</xsl:with-param>
+							<xsl:with-param name="coded">
+								false
+							</xsl:with-param>
+						</xsl:call-template>
+					</a:documentation>
+				</xsl:if>
+			</xsl:for-each>
+		</choice>
+	</xsl:template>
 
 
-  <xsl:template match="tei:elementSpec/@ident"/>
+	<xsl:template match="tei:elementSpec/@ident" />
 
-  <xsl:template match="tei:elementSpec/tei:desc"/>
+	<xsl:template match="tei:elementSpec/tei:desc" />
 
-  <xsl:template match="tei:classSpec/tei:desc"/>
+	<xsl:template match="tei:classSpec/tei:desc" />
 
-  <xsl:template match="tei:macroSpec/tei:desc"/>
+	<xsl:template match="tei:macroSpec/tei:desc" />
 
-  <xsl:template match="tei:elementSpec/tei:gloss"/>
+	<xsl:template match="tei:elementSpec/tei:gloss" />
 
-  <xsl:template match="tei:classSpec/tei:gloss"/>
+	<xsl:template match="tei:classSpec/tei:gloss" />
 
-  <xsl:template match="tei:macroSpec/tei:gloss"/>
+	<xsl:template match="tei:macroSpec/tei:gloss" />
 
 
-  <xsl:template match="tei:index">
-      <xsl:call-template name="makeAnchor">
-	<xsl:with-param name="name">IDX-<xsl:number level="any"/>
-	</xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
+	<xsl:template match="tei:index">
+		<xsl:call-template name="makeAnchor">
+			<xsl:with-param name="name">
+				IDX-
+				<xsl:number level="any" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
 
-  <xsl:template match="tei:macroSpec" mode="tangle">
-    <xsl:param name="filename"/>
-    <xsl:variable name="macroPrefix">
-      <xsl:choose>
-        <xsl:when test="@prefix">
-          <xsl:value-of select="@prefix"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$generalPrefix"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
+	<xsl:template match="tei:macroSpec" mode="tangle">
+		<xsl:param name="filename" />
+		<xsl:variable name="macroPrefix">
+			<xsl:choose>
+				<xsl:when test="@prefix">
+					<xsl:value-of select="@prefix" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$generalPrefix" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-    <xsl:variable name="entityContent">
-      <TEMPTREE>
-        <xsl:choose>
-	  <xsl:when test="tei:valList[@type='closed']">
-            <xsl:call-template name="valListChildren"/>
-	  </xsl:when>
-          <xsl:when test="tei:content/rng:group/rng:ref">
-	    <xsl:apply-templates select="tei:content/*|tei:content/processing-instruction()"/>	    
-	  </xsl:when>
-          <xsl:when test="tei:content/rng:group">
-            <choice xmlns="http://relaxng.org/ns/structure/1.0">
-              <xsl:apply-templates select="tei:content/rng:group/*"/>
-            </choice>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:apply-templates select="tei:content/*|tei:content/processing-instruction()"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </TEMPTREE>
-    </xsl:variable>
-    <xsl:variable name="entityCount">
-      <xsl:for-each select="$entityContent/TEMPTREE">
-        <xsl:value-of select="count(rng:*|processing-instruction())"/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="@ident=&#34;TEI.singleBase&#34;"/>
-      <xsl:when test="starts-with($entityContent,&#34;'&#34;)">
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Omit <xsl:value-of select="$entityContent"/> for <xsl:value-of select="@ident"/>
-          </xsl:message>
-        </xsl:if>
-      </xsl:when>
-      <xsl:when test="starts-with($entityContent,&#34;-&#34;)">
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Omit <xsl:value-of select="$entityContent"/> for <xsl:value-of select="@ident"/>
-          </xsl:message>
-        </xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:if test="$verbose='true'">
-          <xsl:message> macroSpec <xsl:value-of select="@ident"/>
-          </xsl:message>
-        </xsl:if>
-        <xsl:call-template name="bitOut">
-          <xsl:with-param name="grammar">true</xsl:with-param>
-          <xsl:with-param name="content">
-            <Wrapper>
-              <define xmlns="http://relaxng.org/ns/structure/1.0" name="{$macroPrefix}{@ident}">
-                <xsl:if test="$parameterize='true'">
-                  <xsl:if test="starts-with(@ident,'macro.component')     or @predeclare='true'">
-                    <xsl:attribute name="combine">choice</xsl:attribute>
-                  </xsl:if>
-                </xsl:if>
-                <xsl:choose>
-                  <xsl:when test="starts-with(@ident,'type')">
-                    <xsl:apply-templates mode="justcopy" select="$entityContent/TEMPTREE/node()"/>
-                  </xsl:when>
-                  <xsl:when test="$entityCount=0">
-                    <choice>
-                      <empty/>
-                    </choice>
-                  </xsl:when>
-                  <xsl:when test="$entityCount=1">
-                    <xsl:apply-templates mode="justcopy" select="$entityContent/TEMPTREE/node()"/>
-                  </xsl:when>
-                  <xsl:when test="tei:content/rng:text|tei:content/rng:ref">
-                    <choice>
-                      <xsl:apply-templates mode="justcopy" select="$entityContent/TEMPTREE/node()"/>
-                    </choice>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:apply-templates mode="justcopy"  select="$entityContent/TEMPTREE/node()"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </define>
-            </Wrapper>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+		<xsl:variable name="entityContent">
+			<TEMPTREE>
+				<xsl:choose>
+					<xsl:when test="tei:valList[@type='closed']">
+						<xsl:call-template name="valListChildren" />
+					</xsl:when>
+					<xsl:when test="tei:content/rng:group/rng:ref">
+						<xsl:apply-templates
+							select="tei:content/*|tei:content/processing-instruction()" />
+					</xsl:when>
+					<xsl:when test="tei:content/rng:group">
+						<choice xmlns="http://relaxng.org/ns/structure/1.0">
+							<xsl:apply-templates
+								select="tei:content/rng:group/*" />
+						</choice>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates
+							select="tei:content/*|tei:content/processing-instruction()" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</TEMPTREE>
+		</xsl:variable>
+		<xsl:variable name="entityCount">
+			<xsl:for-each select="$entityContent/TEMPTREE">
+				<xsl:value-of
+					select="count(rng:*|processing-instruction())" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="@ident=&#34;TEI.singleBase&#34;" />
+			<xsl:when test="starts-with($entityContent,&#34;'&#34;)">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Omit
+						<xsl:value-of select="$entityContent" />
+						for
+						<xsl:value-of select="@ident" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="starts-with($entityContent,&#34;-&#34;)">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Omit
+						<xsl:value-of select="$entityContent" />
+						for
+						<xsl:value-of select="@ident" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						macroSpec
+						<xsl:value-of select="@ident" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:call-template name="bitOut">
+					<xsl:with-param name="grammar">
+						true
+					</xsl:with-param>
+					<xsl:with-param name="content">
+						<Wrapper>
+							<define xmlns="http://relaxng.org/ns/structure/1.0"
+								name="{$macroPrefix}{@ident}">
+								<xsl:if test="$parameterize='true'">
+									<xsl:if
+										test="starts-with(@ident,'macro.component')     or @predeclare='true'">
+										<xsl:attribute name="combine">choice</xsl:attribute>
+									</xsl:if>
+								</xsl:if>
+								<xsl:choose>
+									<xsl:when test="starts-with(@ident,'type')">
+										<xsl:apply-templates mode="justcopy"
+											select="$entityContent/TEMPTREE/node()" />
+									</xsl:when>
+									<xsl:when test="$entityCount=0">
+										<choice>
+											<empty />
+										</choice>
+									</xsl:when>
+									<xsl:when test="$entityCount=1">
+										<xsl:apply-templates mode="justcopy"
+											select="$entityContent/TEMPTREE/node()" />
+									</xsl:when>
+									<xsl:when
+										test="tei:content/rng:text|tei:content/rng:ref">
+										<choice>
+											<xsl:apply-templates mode="justcopy"
+												select="$entityContent/TEMPTREE/node()" />
+										</choice>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:apply-templates mode="justcopy"
+											select="$entityContent/TEMPTREE/node()" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</define>
+						</Wrapper>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template match="tei:macroSpec/@ident"/>
+	<xsl:template match="tei:macroSpec/@ident" />
 
-  <xsl:template match="tei:macroSpec/content/rng:*"/>
+	<xsl:template match="tei:macroSpec/content/rng:*" />
 
-  <xsl:template match="tei:memberOf" mode="tangleModel">
-    <!--
-    <xsl:variable name="owner">
-      <xsl:value-of
-        select="ancestor::tei:elementSpec/@ident|ancestor::tei:classSpec/@ident"
-      />
-    </xsl:variable>
-    <xsl:for-each select="key('IDENTS',@key)">
-      <xsl:if test="@type='model'">
-        <define combine="choice" name="{@ident}"
-          xmlns="http://relaxng.org/ns/structure/1.0">
-          <ref name="{$generalPrefix}{$owner}"
-            xmlns="http://relaxng.org/ns/structure/1.0"/>
-        </define>
-      </xsl:if>
-    </xsl:for-each>
--->
-  </xsl:template>
+	<xsl:template match="tei:memberOf" mode="tangleModel">
+		<!-- <xsl:variable name="owner"> <xsl:value-of select="ancestor::tei:elementSpec/@ident|ancestor::tei:classSpec/@ident" 
+			/> </xsl:variable> <xsl:for-each select="key('IDENTS',@key)"> <xsl:if test="@type='model'"> 
+			<define combine="choice" name="{@ident}" xmlns="http://relaxng.org/ns/structure/1.0"> 
+			<ref name="{$generalPrefix}{$owner}" xmlns="http://relaxng.org/ns/structure/1.0"/> 
+			</define> </xsl:if> </xsl:for-each> -->
+	</xsl:template>
 
 
-  <xsl:template match="tei:moduleRef" mode="tangle">
-    <!-- save a reference to myself so I can access my attrs and -->
-    <!-- generated node ID later -->
-    <xsl:variable name="me-the-moduleRef" select="."/>
-    <xsl:variable name="This" select="@key"/>
-    <xsl:if test="$verbose='true'">
-      <xsl:message> .... import module [<xsl:value-of select="$This"/> <xsl:value-of select="@url"/>] </xsl:message>
-    </xsl:if>
-    <xsl:call-template name="bitOut">
-      <xsl:with-param name="grammar">true</xsl:with-param>
-      <xsl:with-param name="content">
-        <Wrapper>
-          <xsl:choose>
-            <xsl:when test="@url and $parameterize='true'">
-              <include xmlns="http://relaxng.org/ns/structure/1.0" href="{@url}">
-                <xsl:apply-templates mode="justcopy"  select="tei:content/*"/>
-              </include>
-            </xsl:when>
-            <xsl:when test="@url and $parameterize='false'">
-              <xsl:comment>Start of import of <xsl:value-of select="@url"/>
-              </xsl:comment>
-              <div xmlns="http://relaxng.org/ns/structure/1.0">
-                <xsl:for-each select="document(@url)/rng:grammar">
-                  <!-- the "expandRNG" processing changed 2011-08-25 by Syd Bauman: -->
-                  <!-- added a 'prefix' parameter which value is prefixed to pattern -->
-                  <!-- names in the included schema. This prevents collisions in the -->
-                  <!-- output RNG. -->
-                  <xsl:apply-templates mode="expandRNG" select="@*|node()">
-                    <xsl:with-param name="prefix">
-		      <xsl:if test="$me-the-moduleRef/@prefix">
-			<xsl:value-of select="$me-the-moduleRef/@prefix"/>
-		      </xsl:if>
-                    </xsl:with-param>
-                  </xsl:apply-templates>
-                </xsl:for-each>
-                <xsl:apply-templates mode="justcopy"  select="tei:content/*"/>
-              </div>
-              <xsl:comment>End of import of <xsl:value-of select="@url"/>
-              </xsl:comment>
-            </xsl:when>
-            <xsl:otherwise>
-              <include xmlns="http://relaxng.org/ns/structure/1.0"
-                href="{$schemaBaseURL}{$This}.rng">
-                <xsl:attribute name="ns">
+	<xsl:template match="tei:moduleRef" mode="tangle">
+		<!-- save a reference to myself so I can access my attrs and -->
+		<!-- generated node ID later -->
+		<xsl:variable name="me-the-moduleRef" select="." />
+		<xsl:variable name="This" select="@key" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				.... import module [
+				<xsl:value-of select="$This" />
+				<xsl:value-of select="@url" />
+				]
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="bitOut">
+			<xsl:with-param name="grammar">
+				true
+			</xsl:with-param>
+			<xsl:with-param name="content">
+				<Wrapper>
+					<xsl:choose>
+						<xsl:when test="@url and $parameterize='true'">
+							<include xmlns="http://relaxng.org/ns/structure/1.0"
+								href="{@url}">
+								<xsl:apply-templates mode="justcopy"
+									select="tei:content/*" />
+							</include>
+						</xsl:when>
+						<xsl:when test="@url and $parameterize='false'">
+							<xsl:comment>
+								Start of import of
+								<xsl:value-of select="@url" />
+							</xsl:comment>
+							<div xmlns="http://relaxng.org/ns/structure/1.0">
+								<xsl:for-each select="document(@url)/rng:grammar">
+									<!-- the "expandRNG" processing changed 2011-08-25 by Syd Bauman: -->
+									<!-- added a 'prefix' parameter which value is prefixed to pattern -->
+									<!-- names in the included schema. This prevents collisions in the -->
+									<!-- output RNG. -->
+									<xsl:apply-templates mode="expandRNG"
+										select="@*|node()">
+										<xsl:with-param name="prefix">
+											<xsl:if test="$me-the-moduleRef/@prefix">
+												<xsl:value-of
+													select="$me-the-moduleRef/@prefix" />
+											</xsl:if>
+										</xsl:with-param>
+									</xsl:apply-templates>
+								</xsl:for-each>
+								<xsl:apply-templates mode="justcopy"
+									select="tei:content/*" />
+							</div>
+							<xsl:comment>
+								End of import of
+								<xsl:value-of select="@url" />
+							</xsl:comment>
+						</xsl:when>
+						<xsl:otherwise>
+							<include xmlns="http://relaxng.org/ns/structure/1.0"
+								href="{$schemaBaseURL}{$This}.rng">
+								<xsl:attribute name="ns">
                   <xsl:choose>
-                    <xsl:when test="ancestor::tei:schemaSpec/@ns">
-                      <xsl:value-of select="ancestor::tei:schemaSpec/@ns"/>
+                    <xsl:when
+									test="ancestor::tei:schemaSpec/@ns">
+                      <xsl:value-of
+									select="ancestor::tei:schemaSpec/@ns" />
                     </xsl:when>
                     <xsl:otherwise>http://www.tei-c.org/ns/1.0</xsl:otherwise>
                   </xsl:choose>
                 </xsl:attribute>
-                <xsl:for-each select="../tei:*[@module=$This and not(@mode='add')]">
-                  <xsl:apply-templates mode="tangle" select="."/>
-                </xsl:for-each>
-              </include>
-            </xsl:otherwise>
-          </xsl:choose>
-        </Wrapper>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
+								<xsl:for-each
+									select="../tei:*[@module=$This and not(@mode='add')]">
+									<xsl:apply-templates mode="tangle"
+										select="." />
+								</xsl:for-each>
+							</include>
+						</xsl:otherwise>
+					</xsl:choose>
+				</Wrapper>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-  <!-- begin expand RELAX NG section -->
+	<!-- begin expand RELAX NG section -->
 
-  <xsl:template match="@*|text()|comment()|processing-instruction" mode="expandRNG">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="rng:start" mode="expandRNG"/>
-  
-  <xsl:template match="rng:include" mode="expandRNG">
-    <xsl:param name="prefix"/>
-    <xsl:if test="$verbose='true'">
-      <xsl:message> .... import <xsl:value-of select="@href"/></xsl:message>
-    </xsl:if>
-    <xsl:comment>Start of import of <xsl:value-of select="@href"/></xsl:comment>
-    <div xmlns="http://relaxng.org/ns/structure/1.0">
-      <xsl:for-each select="document(@href)/rng:grammar">
-        <xsl:apply-templates mode="expandRNG" select="@*|node()">
-          <xsl:with-param name="prefix" select="$prefix"/>
-        </xsl:apply-templates>
-      </xsl:for-each>
-    </div>
-    <xsl:comment>End of import of <xsl:value-of select="@href"/>
-    </xsl:comment>
-  </xsl:template>
-  
-  <xsl:template match="rng:define | rng:ref" mode="expandRNG">
-    <xsl:param name="prefix"/>
-    <xsl:if test="$verbose='true'">
-      <xsl:message>expanding rng:<xsl:value-of select="local-name(.)"/> name=<xsl:value-of select="@name"/>, giving it a prefix of '<xsl:value-of select="$prefix"/>'.</xsl:message>
-    </xsl:if>
-    <!-- generate a copy of this <define> or <ref> -->
-    <xsl:copy>
-      <!-- copy over all attributes (including @name) -->
-      <xsl:apply-templates select="@*" mode="expandRNG"/>
-      <xsl:if test="@name">
-        <!-- then replace the copied @name with our own that is the same -->
-        <!-- except has our prefix in the value -->
-        <xsl:attribute name="name" select="concat( $prefix, @name )"/>
-      </xsl:if>
-      <!-- then copy over any content -->
-      <xsl:apply-templates select="node()" mode="expandRNG">
-        <xsl:with-param name="prefix" select="$prefix"/>
-      </xsl:apply-templates>
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="*" mode="expandRNG">
-    <xsl:param name="prefix">erng_</xsl:param>
-    <xsl:copy>
-      <xsl:apply-templates mode="expandRNG" select="@*|node()">
-        <xsl:with-param name="prefix" select="$prefix"/>
-      </xsl:apply-templates>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction" mode="expandRNG">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <!-- end expand RELAX NG section -->
+	<xsl:template match="rng:start" mode="expandRNG" />
 
-  <xsl:template match="tei:remarks" mode="tangle"/>
+	<xsl:template match="rng:include" mode="expandRNG">
+		<xsl:param name="prefix" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				.... import
+				<xsl:value-of select="@href" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:comment>
+			Start of import of
+			<xsl:value-of select="@href" />
+		</xsl:comment>
+		<div xmlns="http://relaxng.org/ns/structure/1.0">
+			<xsl:for-each select="document(@href)/rng:grammar">
+				<xsl:apply-templates mode="expandRNG"
+					select="@*|node()">
+					<xsl:with-param name="prefix" select="$prefix" />
+				</xsl:apply-templates>
+			</xsl:for-each>
+		</div>
+		<xsl:comment>
+			End of import of
+			<xsl:value-of select="@href" />
+		</xsl:comment>
+	</xsl:template>
 
+	<xsl:template match="rng:define | rng:ref"
+		mode="expandRNG">
+		<xsl:param name="prefix" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				expanding rng:
+				<xsl:value-of select="local-name(.)" />
+				name=
+				<xsl:value-of select="@name" />
+				, giving it a prefix of '
+				<xsl:value-of select="$prefix" />
+				'.
+			</xsl:message>
+		</xsl:if>
+		<!-- generate a copy of this <define> or <ref> -->
+		<xsl:copy>
+			<!-- copy over all attributes (including @name) -->
+			<xsl:apply-templates select="@*" mode="expandRNG" />
+			<xsl:if test="@name">
+				<!-- then replace the copied @name with our own that is the same -->
+				<!-- except has our prefix in the value -->
+				<xsl:attribute name="name"
+					select="concat( $prefix, @name )" />
+			</xsl:if>
+			<!-- then copy over any content -->
+			<xsl:apply-templates select="node()"
+				mode="expandRNG">
+				<xsl:with-param name="prefix" select="$prefix" />
+			</xsl:apply-templates>
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="tei:specGrp" mode="ok">
-    <xsl:param name="filename"/>
-    <xsl:if test="$verbose='true'">
-      <xsl:message> processing specGrp <xsl:value-of select="@xml:id"/>
-      </xsl:message>
-    </xsl:if>
-    <xsl:call-template name="processSchemaFragment">
-      <xsl:with-param name="filename" select="$filename"/>
-    </xsl:call-template>
-  </xsl:template>
+	<xsl:template match="*" mode="expandRNG">
+		<xsl:param name="prefix">
+			erng_
+		</xsl:param>
+		<xsl:copy>
+			<xsl:apply-templates mode="expandRNG"
+				select="@*|node()">
+				<xsl:with-param name="prefix" select="$prefix" />
+			</xsl:apply-templates>
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="tei:tag">
-    <xsl:call-template name="typewriter">
-      <xsl:with-param name="text">
-        <xsl:text>&lt;</xsl:text>
-        <xsl:apply-templates/>
-        <xsl:text>&gt;</xsl:text>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
+	<!-- end expand RELAX NG section -->
 
-  <xsl:template name="compositeNumber">
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:div1">
-        <xsl:for-each select="ancestor::tei:div1">
-          <xsl:number/>
-        </xsl:for-each>
-        <xsl:text>.</xsl:text>
-        <xsl:number from="tei:div1" level="any"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:for-each select="ancestor::tei:div[1]">
-          <xsl:number count="tei:div" from="tei:text" level="multiple"/>
-        </xsl:for-each>
-        <xsl:text>.</xsl:text>
-        <xsl:number from="tei:div"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:remarks" mode="tangle" />
 
-  <xsl:template match="tei:p" mode="copyrighttext">
-    <xsl:text>&#10;</xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
 
-  <xsl:template match="tei:list" mode="copyrighttext">
-    <xsl:text>&#10;</xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:specGrp" mode="ok">
+		<xsl:param name="filename" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				processing specGrp
+				<xsl:value-of select="@xml:id" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="processSchemaFragment">
+			<xsl:with-param name="filename" select="$filename" />
+		</xsl:call-template>
+	</xsl:template>
 
-  <xsl:template match="tei:item" mode="copyrighttext">
-    <xsl:text>&#10; *</xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:tag">
+		<xsl:call-template name="typewriter">
+			<xsl:with-param name="text">
+				<xsl:text>&lt;</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>&gt;</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template name="compositeNumber">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:div1">
+				<xsl:for-each select="ancestor::tei:div1">
+					<xsl:number />
+				</xsl:for-each>
+				<xsl:text>.</xsl:text>
+				<xsl:number from="tei:div1" level="any" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="ancestor::tei:div[1]">
+					<xsl:number count="tei:div" from="tei:text"
+						level="multiple" />
+				</xsl:for-each>
+				<xsl:text>.</xsl:text>
+				<xsl:number from="tei:div" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
+	<xsl:template match="tei:p" mode="copyrighttext">
+		<xsl:text>&#10;</xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template name="attributeData">
-    <xsl:choose>
-      <xsl:when test="tei:valList[@type='closed']">
-        <choice xmlns="http://relaxng.org/ns/structure/1.0">
-          <xsl:for-each select="tei:valList/tei:valItem">
-            <value>
-              <xsl:choose>
-                <xsl:when test="tei:altIdent=@ident">
-                  <xsl:value-of select="@ident"/>
-                </xsl:when>
-                <xsl:when test="tei:altIdent">
-                  <xsl:value-of select="normalize-space(tei:altIdent)"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:value-of select="@ident"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </value>
-            <xsl:if test="not($oddmode='tei')">
-              <a:documentation>
-                <xsl:call-template name="makeDescription">
-                  <xsl:with-param name="includeValList">true</xsl:with-param>
-                  <xsl:with-param name="coded">false</xsl:with-param>
-                </xsl:call-template>
-              </a:documentation>
-            </xsl:if>
-          </xsl:for-each>
-        </choice>
-      </xsl:when>
-      <xsl:when test="tei:valList[@type='semi']">
-        <choice xmlns="http://relaxng.org/ns/structure/1.0">
-          <xsl:for-each select="tei:valList/tei:valItem">
-            <value>
-              <xsl:choose>
-                <xsl:when test="tei:altIdent=@ident">
-                  <xsl:value-of select="@ident"/>
-                </xsl:when>
-                <xsl:when test="tei:altIdent">
-                  <xsl:value-of select="normalize-space(tei:altIdent)"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:value-of select="@ident"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </value>
-            <xsl:if test="not($oddmode='tei')">
-              <a:documentation>
-                <xsl:call-template name="makeDescription">
-                  <xsl:with-param name="includeValList">true</xsl:with-param>
-                  <xsl:with-param name="coded">false</xsl:with-param>
-                </xsl:call-template>
-              </a:documentation>
-            </xsl:if>
-          </xsl:for-each>
-          <xsl:choose>
-            <xsl:when test="tei:datatype/rng:ref[@name='data.enumerated']">
-              <data type="Name"/>
-            </xsl:when>
-	    <xsl:when test="not(tei:datatype)">
-              <data type="Name"/>
-	    </xsl:when>
-            <xsl:otherwise>
-              <xsl:apply-templates select="tei:datatype/rng:*"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </choice>
-      </xsl:when>
-      <xsl:when test="tei:datatype/rng:*">
-        <xsl:apply-templates select="tei:datatype/rng:*"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <text xmlns="http://relaxng.org/ns/structure/1.0"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:list" mode="copyrighttext">
+		<xsl:text>&#10;</xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template name="makeSimpleAttribute">
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="tei:altIdent=@ident">
-          <xsl:value-of select="@ident"/>
-        </xsl:when>
-        <xsl:when test="tei:altIdent">
-          <xsl:value-of select="normalize-space(tei:altIdent)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:if test="@ns='http://www.w3.org/XML/1998/namespace'">xml:</xsl:if>
-          <xsl:value-of select="@ident"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <attribute xmlns="http://relaxng.org/ns/structure/1.0" name="{$name}">
-      <xsl:if test="@ns">
-        <xsl:copy-of select="@ns"/>
-      </xsl:if>
-      <xsl:if test="tei:defaultVal and not(tei:defaultVal='')">
-        <xsl:attribute name="a:defaultValue">
-          <xsl:value-of select="normalize-space(tei:defaultVal)"/>
+	<xsl:template match="tei:item" mode="copyrighttext">
+		<xsl:text>&#10; *</xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
+
+
+
+	<xsl:template name="attributeData">
+		<xsl:choose>
+			<xsl:when test="tei:valList[@type='closed']">
+				<choice xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:for-each select="tei:valList/tei:valItem">
+						<value>
+							<xsl:choose>
+								<xsl:when test="tei:altIdent=@ident">
+									<xsl:value-of select="@ident" />
+								</xsl:when>
+								<xsl:when test="tei:altIdent">
+									<xsl:value-of
+										select="normalize-space(tei:altIdent)" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@ident" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</value>
+						<xsl:if test="not($oddmode='tei')">
+							<a:documentation>
+								<xsl:call-template name="makeDescription">
+									<xsl:with-param name="includeValList">
+										true
+									</xsl:with-param>
+									<xsl:with-param name="coded">
+										false
+									</xsl:with-param>
+								</xsl:call-template>
+							</a:documentation>
+						</xsl:if>
+					</xsl:for-each>
+				</choice>
+			</xsl:when>
+			<xsl:when test="tei:valList[@type='semi']">
+				<choice xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:for-each select="tei:valList/tei:valItem">
+						<value>
+							<xsl:choose>
+								<xsl:when test="tei:altIdent=@ident">
+									<xsl:value-of select="@ident" />
+								</xsl:when>
+								<xsl:when test="tei:altIdent">
+									<xsl:value-of
+										select="normalize-space(tei:altIdent)" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@ident" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</value>
+						<xsl:if test="not($oddmode='tei')">
+							<a:documentation>
+								<xsl:call-template name="makeDescription">
+									<xsl:with-param name="includeValList">
+										true
+									</xsl:with-param>
+									<xsl:with-param name="coded">
+										false
+									</xsl:with-param>
+								</xsl:call-template>
+							</a:documentation>
+						</xsl:if>
+					</xsl:for-each>
+					<xsl:choose>
+						<xsl:when
+							test="tei:datatype/rng:ref[@name='data.enumerated']">
+							<data type="Name" />
+						</xsl:when>
+						<xsl:when test="not(tei:datatype)">
+							<data type="Name" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates
+								select="tei:datatype/rng:*" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</choice>
+			</xsl:when>
+			<xsl:when test="tei:datatype/rng:*">
+				<xsl:apply-templates select="tei:datatype/rng:*" />
+			</xsl:when>
+			<xsl:otherwise>
+				<text xmlns="http://relaxng.org/ns/structure/1.0" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="makeSimpleAttribute">
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="tei:altIdent=@ident">
+					<xsl:value-of select="@ident" />
+				</xsl:when>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="normalize-space(tei:altIdent)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:if test="@ns='http://www.w3.org/XML/1998/namespace'">
+						xml:
+					</xsl:if>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<attribute xmlns="http://relaxng.org/ns/structure/1.0"
+			name="{$name}">
+			<xsl:if test="@ns">
+				<xsl:copy-of select="@ns" />
+			</xsl:if>
+			<xsl:if test="tei:defaultVal and not(tei:defaultVal='')">
+				<xsl:attribute name="a:defaultValue">
+          <xsl:value-of
+					select="normalize-space(tei:defaultVal)" />
         </xsl:attribute>
-      </xsl:if>
-      <xsl:if test="not($oddmode='tei')">
-        <a:documentation>
-          <xsl:call-template name="makeDescription">
-            <xsl:with-param name="includeValList">true</xsl:with-param>
-            <xsl:with-param name="coded">false</xsl:with-param>
-          </xsl:call-template>
-        </a:documentation>
-      </xsl:if>
-      <!-- ************************************ -->
-      <!-- Ascertain minOccurs= and maxOccurs=. -->
-      <!-- ************************************ -->
-      <!-- get the value of minOccurs=, defaulting to "1" -->
-      <xsl:variable name="minOccurs">
-        <xsl:choose>
-          <xsl:when test="tei:datatype/@minOccurs">
-            <xsl:value-of select="tei:datatype/@minOccurs"/>
-          </xsl:when>
-          <xsl:otherwise>1</xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-      <!-- get the value of maxOccurs=, defaulting to "1" -->
-      <xsl:variable name="maxOccurs">
-        <xsl:choose>
-          <xsl:when test="tei:datatype/@maxOccurs">
-            <xsl:value-of select="tei:datatype/@maxOccurs"/>
-          </xsl:when>
-          <xsl:otherwise>1</xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-      <!-- We now have two _string_ representations of the attrs, but -->
-      <!-- we need integers. So cast them, converting "unbounded" to  -->
-      <!-- a special flag value (-1): -->
-      <xsl:variable name="min" select="xs:integer( $minOccurs )"/>
-      <xsl:variable name="max">
-        <xsl:choose>
-          <xsl:when test="$maxOccurs='unbounded'">
-            <xsl:value-of select="xs:integer( -1 )"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="xs:integer( $maxOccurs )"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-        <xsl:when test="tei:datatype/rng:text  or  not( tei:datatype )  or  $max=1">
-          <!-- If there is only going to be one output RELAX NG node   --> 
-          <!-- in the attribute definition, then we don't need to      -->
-          <!-- bother with the complex min & max code below (in the    -->
-          <!-- <xsl:otherwise>). Although it would generate the right  -->
-          <!-- number of RELAX NG constructs, it wraps them in a       -->
-          <!-- <list>, which makes no sense in some cases, and will    -->
-          <!-- cause an error if the RELAX NG node inside the list is  -->
-          <!-- <text>.                                                 -->
-          <!-- Cases we handle here:                                   -->
-          <!-- * my <datatype> child has an <rng:text> child: only 1   -->
-          <!--   output node (<rng:text>), which can't be wrapped in   -->
-          <!--   a <list>                                              -->
-          <!-- * I don't have a <datatype> child: the 'attributeData'  -->
-          <!--   template will spit out a single <rng:text> node (see  -->
-          <!--   the outermost <xsl:otherwise> of that template)       -->
-          <!-- * @maxOccurs=1: whatever ends up being generated, there -->
-          <!--   will only be 1 of them, so no need for a <list>       -->
-          <xsl:call-template name="attributeData"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <!-- Note that in the (erroneous) event   -->
-          <!-- that minOccurs= is greater than      -->
-          <!-- maxOccurs=, the latter is simply     -->
-          <!-- ignored.                             -->
-          <!-- Hack(?): -->
-          <!-- The 'attributeData' template needs to operate from this node; -->
-          <!-- However, once we've used for-each to "loop", we've lost the -->
-          <!-- current node (it has become one of the integers in the select= -->
-          <!-- range). So here we remember the current node, and re-set it -->
-          <!-- before calling 'attributeData'. Perhaps it would be better to -->
-          <!-- send it as a parameter to 'attributeData' and have it set the -->
-          <!-- current node, but since I didn't write 'attributeData', I've -->
-          <!-- chosen this method so I don't have to muck with it. -Syd -->
-          <xsl:variable name="thisNode" select="."/>
-          <list>
-            <xsl:if test="$min > 0">
-              <xsl:for-each select="1 to $min">
-                <xsl:for-each select="$thisNode">
-                  <xsl:call-template name="attributeData"/>
-                </xsl:for-each>
-              </xsl:for-each>
-            </xsl:if>
-            <xsl:choose>
-              <xsl:when test="$max= -1"><!-- i.e., unbounded -->
-                <zeroOrMore>
-                  <xsl:for-each select="$thisNode">
-                    <xsl:call-template name="attributeData"/>
-                  </xsl:for-each>
-                </zeroOrMore>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:for-each select="xs:integer( $min + 1 ) to $max">
-                  <optional>
-                    <xsl:for-each select="$thisNode">
-                      <xsl:call-template name="attributeData"/>
-                    </xsl:for-each>
-                  </optional>
-                </xsl:for-each>
-              </xsl:otherwise>
-            </xsl:choose>
-          </list>
-        </xsl:otherwise>
-      </xsl:choose>
-    </attribute>
-  </xsl:template>
+			</xsl:if>
+			<xsl:if test="not($oddmode='tei')">
+				<a:documentation>
+					<xsl:call-template name="makeDescription">
+						<xsl:with-param name="includeValList">
+							true
+						</xsl:with-param>
+						<xsl:with-param name="coded">
+							false
+						</xsl:with-param>
+					</xsl:call-template>
+				</a:documentation>
+			</xsl:if>
+			<!-- ************************************ -->
+			<!-- Ascertain minOccurs= and maxOccurs=. -->
+			<!-- ************************************ -->
+			<!-- get the value of minOccurs=, defaulting to "1" -->
+			<xsl:variable name="minOccurs">
+				<xsl:choose>
+					<xsl:when test="tei:datatype/@minOccurs">
+						<xsl:value-of select="tei:datatype/@minOccurs" />
+					</xsl:when>
+					<xsl:otherwise>
+						1
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<!-- get the value of maxOccurs=, defaulting to "1" -->
+			<xsl:variable name="maxOccurs">
+				<xsl:choose>
+					<xsl:when test="tei:datatype/@maxOccurs">
+						<xsl:value-of select="tei:datatype/@maxOccurs" />
+					</xsl:when>
+					<xsl:otherwise>
+						1
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<!-- We now have two _string_ representations of the attrs, but -->
+			<!-- we need integers. So cast them, converting "unbounded" to -->
+			<!-- a special flag value (-1): -->
+			<xsl:variable name="min"
+				select="xs:integer( $minOccurs )" />
+			<xsl:variable name="max">
+				<xsl:choose>
+					<xsl:when test="$maxOccurs='unbounded'">
+						<xsl:value-of select="xs:integer( -1 )" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="xs:integer( $maxOccurs )" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when
+					test="tei:datatype/rng:text  or  not( tei:datatype )  or  $max=1">
+					<!-- If there is only going to be one output RELAX NG node -->
+					<!-- in the attribute definition, then we don't need to -->
+					<!-- bother with the complex min & max code below (in the -->
+					<!-- <xsl:otherwise>). Although it would generate the right -->
+					<!-- number of RELAX NG constructs, it wraps them in a -->
+					<!-- <list>, which makes no sense in some cases, and will -->
+					<!-- cause an error if the RELAX NG node inside the list is -->
+					<!-- <text>. -->
+					<!-- Cases we handle here: -->
+					<!-- * my <datatype> child has an <rng:text> child: only 1 -->
+					<!-- output node (<rng:text>), which can't be wrapped in -->
+					<!-- a <list> -->
+					<!-- * I don't have a <datatype> child: the 'attributeData' -->
+					<!-- template will spit out a single <rng:text> node (see -->
+					<!-- the outermost <xsl:otherwise> of that template) -->
+					<!-- * @maxOccurs=1: whatever ends up being generated, there -->
+					<!-- will only be 1 of them, so no need for a <list> -->
+					<xsl:call-template name="attributeData" />
+				</xsl:when>
+				<xsl:otherwise>
+					<!-- Note that in the (erroneous) event -->
+					<!-- that minOccurs= is greater than -->
+					<!-- maxOccurs=, the latter is simply -->
+					<!-- ignored. -->
+					<!-- Hack(?): -->
+					<!-- The 'attributeData' template needs to operate from this node; -->
+					<!-- However, once we've used for-each to "loop", we've lost the -->
+					<!-- current node (it has become one of the integers in the select= -->
+					<!-- range). So here we remember the current node, and re-set it -->
+					<!-- before calling 'attributeData'. Perhaps it would be better to -->
+					<!-- send it as a parameter to 'attributeData' and have it set the -->
+					<!-- current node, but since I didn't write 'attributeData', I've -->
+					<!-- chosen this method so I don't have to muck with it. -Syd -->
+					<xsl:variable name="thisNode" select="." />
+					<list>
+						<xsl:if test="$min > 0">
+							<xsl:for-each select="1 to $min">
+								<xsl:for-each select="$thisNode">
+									<xsl:call-template name="attributeData" />
+								</xsl:for-each>
+							</xsl:for-each>
+						</xsl:if>
+						<xsl:choose>
+							<xsl:when test="$max= -1"><!-- i.e., unbounded -->
+								<zeroOrMore>
+									<xsl:for-each select="$thisNode">
+										<xsl:call-template name="attributeData" />
+									</xsl:for-each>
+								</zeroOrMore>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:for-each
+									select="xs:integer( $min + 1 ) to $max">
+									<optional>
+										<xsl:for-each select="$thisNode">
+											<xsl:call-template name="attributeData" />
+										</xsl:for-each>
+									</optional>
+								</xsl:for-each>
+							</xsl:otherwise>
+						</xsl:choose>
+					</list>
+				</xsl:otherwise>
+			</xsl:choose>
+		</attribute>
+	</xsl:template>
 
-  <xsl:template name="makeAnAttribute">
-    <xsl:choose>
-      <xsl:when test="@usage='req'">
-        <xsl:call-template name="makeSimpleAttribute"/>
-      </xsl:when>
-      <!--
-      <xsl:when test="parent::tei:attList[@org='choice']">
-        <xsl:call-template name="makeSimpleAttribute"/>
-      </xsl:when>
--->
-      <xsl:otherwise>
-        <optional xmlns="http://relaxng.org/ns/structure/1.0">
-          <xsl:call-template name="makeSimpleAttribute"/>
-        </optional>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="makeAnAttribute">
+		<xsl:choose>
+			<xsl:when test="@usage='req'">
+				<xsl:call-template name="makeSimpleAttribute" />
+			</xsl:when>
+			<!-- <xsl:when test="parent::tei:attList[@org='choice']"> <xsl:call-template 
+				name="makeSimpleAttribute"/> </xsl:when> -->
+			<xsl:otherwise>
+				<optional xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:call-template name="makeSimpleAttribute" />
+				</optional>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="generateClassParents">
-    <xsl:choose>
-      <xsl:when test="not(tei:classes)"> (none) </xsl:when>
-      <xsl:otherwise>
-        <xsl:for-each select="tei:classes/tei:memberOf">
-          <xsl:if test="preceding-sibling::tei:memberOf">
-            <xsl:text>: </xsl:text>
-          </xsl:if>
-          <xsl:choose>
-            <xsl:when test="key('CLASSES',@key)">
-              <xsl:for-each select="key('CLASSES',@key)">
-                <xsl:call-template name="linkTogether">
-                  <xsl:with-param name="name" select="@ident"/>
-                </xsl:call-template>
-              </xsl:for-each>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@key"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="generateClassParents">
+		<xsl:choose>
+			<xsl:when test="not(tei:classes)">
+				(none)
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="tei:classes/tei:memberOf">
+					<xsl:if test="preceding-sibling::tei:memberOf">
+						<xsl:text>: </xsl:text>
+					</xsl:if>
+					<xsl:choose>
+						<xsl:when test="key('CLASSES',@key)">
+							<xsl:for-each select="key('CLASSES',@key)">
+								<xsl:call-template name="linkTogether">
+									<xsl:with-param name="name" select="@ident" />
+								</xsl:call-template>
+							</xsl:for-each>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@key" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template name="linkStyle"/>
+	<xsl:template name="linkStyle" />
 
 
-  <xsl:template name="getSpecURL">
-    <xsl:param name="name"/>
-    <xsl:param name="type"/>
-    <xsl:choose>
-      <xsl:when test="$type='macro'">
-        <xsl:for-each select="id('REFENT')">
-          <xsl:apply-templates mode="generateLink" select="."/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:when test="$type='element'">
-        <xsl:for-each select="id('REFTAG')">
-          <xsl:apply-templates mode="generateLink" select="."/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:when test="$type='class'">
-        <xsl:for-each select="id('REFCLA')">
-          <xsl:apply-templates mode="generateLink" select="."/>
-        </xsl:for-each>
-      </xsl:when>
-    </xsl:choose>
-    <xsl:text>#</xsl:text>
-    <xsl:value-of select="$name"/>
-  </xsl:template>
+	<xsl:template name="getSpecURL">
+		<xsl:param name="name" />
+		<xsl:param name="type" />
+		<xsl:choose>
+			<xsl:when test="$type='macro'">
+				<xsl:for-each select="id('REFENT')">
+					<xsl:apply-templates mode="generateLink"
+						select="." />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="$type='element'">
+				<xsl:for-each select="id('REFTAG')">
+					<xsl:apply-templates mode="generateLink"
+						select="." />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="$type='class'">
+				<xsl:for-each select="id('REFCLA')">
+					<xsl:apply-templates mode="generateLink"
+						select="." />
+				</xsl:for-each>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:text>#</xsl:text>
+		<xsl:value-of select="$name" />
+	</xsl:template>
 
 
-  <xsl:template name="linkTogether">
-    <xsl:param name="name"/>
-    <xsl:param name="reftext"/>
-    <xsl:param name="class">link_odd</xsl:param>
+	<xsl:template name="linkTogether">
+		<xsl:param name="name" />
+		<xsl:param name="reftext" />
+		<xsl:param name="class">
+			link_odd
+		</xsl:param>
 
-    <xsl:variable name="documentationLanguage">
-      <xsl:call-template name="generateDoc"/>
-    </xsl:variable>
-    <xsl:variable name="partialname">
-      <xsl:choose>
-        <xsl:when test="contains($name,'_')">
-          <xsl:value-of select="substring-before($name,'_')"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$name"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="link">
-      <xsl:choose>
-        <xsl:when test="$reftext=''">
-          <xsl:value-of select="$name"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$reftext"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
+		<xsl:variable name="documentationLanguage">
+			<xsl:call-template name="generateDoc" />
+		</xsl:variable>
+		<xsl:variable name="partialname">
+			<xsl:choose>
+				<xsl:when test="contains($name,'_')">
+					<xsl:value-of select="substring-before($name,'_')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$name" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="link">
+			<xsl:choose>
+				<xsl:when test="$reftext=''">
+					<xsl:value-of select="$name" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$reftext" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-    <xsl:choose>
-      <xsl:when test="not(key('IDENTS',$partialname))">
-        <xsl:value-of select="$link"/>
-      </xsl:when>
-      <xsl:when test="$oddmode='html' and number($splitLevel)=-1">
-        <a xmlns="http://www.w3.org/1999/xhtml" class="{$class}" href="#{$partialname}">
-          <xsl:value-of select="$link"/>
-        </a>
-      </xsl:when>
-      <xsl:when test="$oddmode='html' and $STDOUT='true'">
-        <a xmlns="http://www.w3.org/1999/xhtml" class="{$class}">
-          <xsl:attribute name="href">
-            <xsl:for-each select="key('IDENTS',$partialname)">
+		<xsl:choose>
+			<xsl:when test="not(key('IDENTS',$partialname))">
+				<xsl:value-of select="$link" />
+			</xsl:when>
+			<xsl:when test="$oddmode='html' and number($splitLevel)=-1">
+				<a xmlns="http://www.w3.org/1999/xhtml" class="{$class}"
+					href="#{$partialname}">
+					<xsl:value-of select="$link" />
+				</a>
+			</xsl:when>
+			<xsl:when test="$oddmode='html' and $STDOUT='true'">
+				<a xmlns="http://www.w3.org/1999/xhtml" class="{$class}">
+					<xsl:attribute name="href">
+            <xsl:for-each
+						select="key('IDENTS',$partialname)">
               <xsl:call-template name="getSpecURL">
                 <xsl:with-param name="name">
-                  <xsl:value-of select="$partialname"/>
+                  <xsl:value-of select="$partialname" />
                 </xsl:with-param>
                 <xsl:with-param name="type">
-                  <xsl:value-of select="substring-before(local-name(),'Spec')"/>
+                  <xsl:value-of
+						select="substring-before(local-name(),'Spec')" />
                 </xsl:with-param>
               </xsl:call-template>
             </xsl:for-each>
           </xsl:attribute>
-          <xsl:value-of select="$link"/>
-        </a>
-      </xsl:when>
+					<xsl:value-of select="$link" />
+				</a>
+			</xsl:when>
 
 
-      <xsl:when test="$oddmode='html'">
-        <a xmlns="http://www.w3.org/1999/xhtml" class="{$class}"
-          href="{concat('ref-',$partialname,'.html')}">
-          <xsl:value-of select="$link"/>
-        </a>
-      </xsl:when>
+			<xsl:when test="$oddmode='html'">
+				<a xmlns="http://www.w3.org/1999/xhtml" class="{$class}"
+					href="{concat('ref-',$partialname,'.html')}">
+					<xsl:value-of select="$link" />
+				</a>
+			</xsl:when>
 
-      <xsl:when test="$oddmode='pdf'">
-        <fo:inline>
-          <xsl:value-of select="$link"/>
-        </fo:inline>
-      </xsl:when>
+			<xsl:when test="$oddmode='pdf'">
+				<fo:inline>
+					<xsl:value-of select="$link" />
+				</fo:inline>
+			</xsl:when>
 
-      <xsl:when test="$oddmode='tei'">
-        <tei:ref target="#{$partialname}">
-          <xsl:value-of select="$link"/>
-        </tei:ref>
-      </xsl:when>
+			<xsl:when test="$oddmode='tei'">
+				<tei:ref target="#{$partialname}">
+					<xsl:value-of select="$link" />
+				</tei:ref>
+			</xsl:when>
 
-      <xsl:otherwise>
-        <xsl:value-of select="$link"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			<xsl:otherwise>
+				<xsl:value-of select="$link" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template name="processSchemaFragment">
-    <xsl:param name="filename"/>
-    <xsl:variable name="secnum">
-      <xsl:call-template name="sectionNumber"/>
-    </xsl:variable>
-    <xsl:apply-templates mode="tangle"/>
-  </xsl:template>
+	<xsl:template name="processSchemaFragment">
+		<xsl:param name="filename" />
+		<xsl:variable name="secnum">
+			<xsl:call-template name="sectionNumber" />
+		</xsl:variable>
+		<xsl:apply-templates mode="tangle" />
+	</xsl:template>
 
 
-  <xsl:template name="make-ns-declaration">
-    <xsl:param name="is-default"/>
-    <xsl:param name="prefix"/>
-    <xsl:param name="uri"/>
-  </xsl:template>
+	<xsl:template name="make-ns-declaration">
+		<xsl:param name="is-default" />
+		<xsl:param name="prefix" />
+		<xsl:param name="uri" />
+	</xsl:template>
 
-  <xsl:template name="inhnamespace"/>
+	<xsl:template name="inhnamespace" />
 
-  <xsl:template match="tei:constraintSpec/tei:desc"/>
-  <xsl:template match="tei:constraintSpec/tei:gloss"/>
-  <xsl:template match="tei:constraintSpec/tei:equiv"/>
+	<xsl:template match="tei:constraintSpec/tei:desc" />
+	<xsl:template match="tei:constraintSpec/tei:gloss" />
+	<xsl:template match="tei:constraintSpec/tei:equiv" />
 
 
-  <xsl:template match="tei:constraintSpec"/>
+	<xsl:template match="tei:constraintSpec" />
 
-  <xsl:template match="tei:altIdent"/>
+	<xsl:template match="tei:altIdent" />
 
-  <xsl:template match="a:*">
-    <xsl:apply-templates mode="justcopy" select="."/>
-  </xsl:template>
+	<xsl:template match="a:*">
+		<xsl:apply-templates mode="justcopy" select="." />
+	</xsl:template>
 
-  <xsl:template match="tei:classSpec" mode="processDefaultAtts">
-    <xsl:if test="$verbose='true'">
-      <xsl:message> .. default attribute settings for <xsl:value-of select="@ident"/>
-      </xsl:message>
-    </xsl:if>
-    <xsl:call-template name="bitOut">
-      <xsl:with-param name="grammar">true</xsl:with-param>
-      <xsl:with-param name="content">
-        <Wrapper>
-	  <xsl:variable name="c">
-	    <xsl:choose>
-	      <xsl:when test="@prefix">
-		<xsl:value-of select="@prefix"/>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:value-of select="$generalPrefix"/>
-	      </xsl:otherwise>
-	    </xsl:choose>
-	    <xsl:value-of select="@ident"/>
-	  </xsl:variable>
-          <define xmlns="http://relaxng.org/ns/structure/1.0" combine="choice"
-            name="{$c}.attributes">
-            <empty/>
-          </define>
-        </Wrapper>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
+	<xsl:template match="tei:classSpec"
+		mode="processDefaultAtts">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				.. default attribute settings for
+				<xsl:value-of select="@ident" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="bitOut">
+			<xsl:with-param name="grammar">
+				true
+			</xsl:with-param>
+			<xsl:with-param name="content">
+				<Wrapper>
+					<xsl:variable name="c">
+						<xsl:choose>
+							<xsl:when test="@prefix">
+								<xsl:value-of select="@prefix" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="$generalPrefix" />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:value-of select="@ident" />
+					</xsl:variable>
+					<define xmlns="http://relaxng.org/ns/structure/1.0"
+						combine="choice" name="{$c}.attributes">
+						<empty />
+					</define>
+				</Wrapper>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element schemaSpec</desc>
-  </doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element schemaSpec</desc>
+	</doc>
 
-  <xsl:template match="tei:schemaSpec">
-    <xsl:call-template name="processSchemaFragment"/>
-  </xsl:template>
+	<xsl:template match="tei:schemaSpec">
+		<xsl:call-template name="processSchemaFragment" />
+	</xsl:template>
 
-  <xsl:template name="generateOutput">
-    <xsl:param name="body"/>
-    <xsl:param name="suffix"/>
-    <xsl:param name="method">xml</xsl:param>
-    <xsl:variable name="processor">
-      <xsl:value-of select="system-property('xsl:vendor')"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$outputDir='' or $outputDir='-'">
-        <xsl:copy-of select="$body"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:result-document href="{$outputDir}/{@ident}{$suffix}" method="{$method}">
-          <xsl:copy-of select="$body"/>
-        </xsl:result-document>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="generateOutput">
+		<xsl:param name="body" />
+		<xsl:param name="suffix" />
+		<xsl:param name="method">
+			xml
+		</xsl:param>
+		<xsl:variable name="processor">
+			<xsl:value-of select="system-property('xsl:vendor')" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$outputDir='' or $outputDir='-'">
+				<xsl:copy-of select="$body" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:result-document
+					href="{$outputDir}/{@ident}{$suffix}" method="{$method}">
+					<xsl:copy-of select="$body" />
+				</xsl:result-document>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template name="showDate">
-    <xsl:choose>
-      	<xsl:when test="$useFixedDate='true'">1970-01-01</xsl:when>
-	<xsl:otherwise>
-    <xsl:value-of
-	select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')"/>
-	</xsl:otherwise>
-    </xsl:choose>
-</xsl:template>
+	<xsl:template name="showDate">
+		<xsl:choose>
+			<xsl:when test="$useFixedDate='true'">
+				1970-01-01
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="sectionNumber">
-    <xsl:for-each
-      select="(ancestor::tei:div1|ancestor::tei:div2|ancestor::tei:div3|ancestor::tei:div4)[last()]">
-      <xsl:for-each select="ancestor-or-self::tei:div1">
-        <xsl:number from="tei:body" level="any"/>
-        <xsl:text>.</xsl:text>
-      </xsl:for-each>
-      <xsl:number count="tei:div2|tei:div3|tei:div4" from="tei:div1" level="multiple"/>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="sectionNumber">
+		<xsl:for-each
+			select="(ancestor::tei:div1|ancestor::tei:div2|ancestor::tei:div3|ancestor::tei:div4)[last()]">
+			<xsl:for-each select="ancestor-or-self::tei:div1">
+				<xsl:number from="tei:body" level="any" />
+				<xsl:text>.</xsl:text>
+			</xsl:for-each>
+			<xsl:number count="tei:div2|tei:div3|tei:div4"
+				from="tei:div1" level="multiple" />
+		</xsl:for-each>
+	</xsl:template>
 
 
-  <xsl:template match="*" mode="expandSpecs">
-    <xsl:apply-templates mode="justcopy" select="."/>
-  </xsl:template>
+	<xsl:template match="*" mode="expandSpecs">
+		<xsl:apply-templates mode="justcopy" select="." />
+	</xsl:template>
 
-  <xsl:template match="tei:specGrpRef" mode="expandSpecs">
-    <xsl:choose>
-      <xsl:when test="starts-with(@target,'#')">
-        <xsl:for-each select="id(substring(@target,2))">
-          <xsl:apply-templates mode="expandSpecs"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:for-each select="document(@target)">
-          <xsl:apply-templates mode="expandSpecs"/>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:specGrpRef" mode="expandSpecs">
+		<xsl:choose>
+			<xsl:when test="starts-with(@target,'#')">
+				<xsl:for-each select="id(substring(@target,2))">
+					<xsl:apply-templates mode="expandSpecs" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="document(@target)">
+					<xsl:apply-templates mode="expandSpecs" />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- list inside <desc> -->
-  <xsl:template match="tei:desc/tei:list/tei:item">
-    <xsl:text> * </xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
+	<!-- list inside <desc> -->
+	<xsl:template match="tei:desc/tei:list/tei:item">
+		<xsl:text> * </xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template name="makeTEIVersion">
-    <xsl:choose>
-      <xsl:when test="ancestor-or-self::tei:TEI/processing-instruction()[name()='TEIVERSION']">
-        <!-- JC Additions to form proper URL from version number -->
-        <xsl:variable name="TEIVersion"
-          select="ancestor-or-self::tei:TEI/processing-instruction()[name()='TEIVERSION'][1]"/>
-        <xsl:variable name="TEIVersion-edition"
-          select="substring-before($TEIVersion, ' Last')"/>
-        <xsl:variable name="TEIVersion-datestring"
-          select="concat(' Last',substring-after($TEIVersion, ' Last'))"/>
-        <xsl:variable name="TEIVersionWithoutFullStop">
-          <xsl:choose>
-            <xsl:when
-              test="substring($TEIVersion-edition,
+	<xsl:template name="makeTEIVersion">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/processing-instruction()[name()='TEIVERSION']">
+				<!-- JC Additions to form proper URL from version number -->
+				<xsl:variable name="TEIVersion"
+					select="ancestor-or-self::tei:TEI/processing-instruction()[name()='TEIVERSION'][1]" />
+				<xsl:variable name="TEIVersion-edition"
+					select="substring-before($TEIVersion, ' Last')" />
+				<xsl:variable name="TEIVersion-datestring"
+					select="concat(' Last',substring-after($TEIVersion, ' Last'))" />
+				<xsl:variable name="TEIVersionWithoutFullStop">
+					<xsl:choose>
+						<xsl:when
+							test="substring($TEIVersion-edition,
               string-length($TEIVersion-edition)) =
               '.' and matches($TEIVersion-edition, '\d\d*\.\d\d*\.\d\d*\.')">
-              <xsl:value-of
-                select="substring($TEIVersion-edition,0,string-length($TEIVersion-edition))"
-              />
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="$TEIVersion-edition"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:variable name="versionURL"
-          select="concat('http://www.tei-c.org/Vault/P5/', $TEIVersionWithoutFullStop, '/')"/>
-        <xsl:text>&#10;Edition: </xsl:text>
-        <xsl:value-of select="$TEIVersion"/>
-        <xsl:text>&#10;Edition Location: </xsl:text>
-        <xsl:value-of select="$versionURL"/>
-        <xsl:text>&#10;</xsl:text>
-        </xsl:when>
-      <xsl:when
-        test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
-        <xsl:text>&#10;Edition: </xsl:text>
-        <xsl:value-of
-          select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition"/>
-        <xsl:text>&#10;</xsl:text>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+							<xsl:value-of
+								select="substring($TEIVersion-edition,0,string-length($TEIVersion-edition))" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$TEIVersion-edition" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="versionURL"
+					select="concat('http://www.tei-c.org/Vault/P5/', $TEIVersionWithoutFullStop, '/')" />
+				<xsl:text>&#10;Edition: </xsl:text>
+				<xsl:value-of select="$TEIVersion" />
+				<xsl:text>&#10;Edition Location: </xsl:text>
+				<xsl:value-of select="$versionURL" />
+				<xsl:text>&#10;</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
+				<xsl:text>&#10;Edition: </xsl:text>
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition" />
+				<xsl:text>&#10;</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:gloss" mode="inLanguage">
-    <xsl:value-of select="."/>
-  </xsl:template>
-  <xsl:template match="tei:desc" mode="inLanguage">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:gloss" mode="inLanguage">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="tei:desc" mode="inLanguage">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template name="processSchematron">
-    <xsl:choose>
-      <xsl:when test="ancestor::teix:egXML"/>
-      <xsl:when test="self::s:ns">
-        <ns prefix="{@prefix}" uri="{@uri}" xmlns="http://www.ascc.net/xml/schematron"/>
-      </xsl:when>
-      <xsl:when test="(self::s:report or self::s:assert) and ancestor::tei:elementSpec">
-        <pattern xmlns="http://www.ascc.net/xml/schematron">
-          <xsl:attribute name="name">
-            <xsl:value-of select="ancestor::tei:elementSpec/@ident"/>
+	<xsl:template name="processSchematron">
+		<xsl:choose>
+			<xsl:when test="ancestor::teix:egXML" />
+			<xsl:when test="self::s:ns">
+				<ns prefix="{@prefix}" uri="{@uri}"
+					xmlns="http://www.ascc.net/xml/schematron" />
+			</xsl:when>
+			<xsl:when
+				test="(self::s:report or self::s:assert) and ancestor::tei:elementSpec">
+				<pattern xmlns="http://www.ascc.net/xml/schematron">
+					<xsl:attribute name="name">
+            <xsl:value-of
+						select="ancestor::tei:elementSpec/@ident" />
             <xsl:text>-constraint-</xsl:text>
-            <xsl:value-of select="ancestor::tei:constraintSpec/@ident"/>
+            <xsl:value-of
+						select="ancestor::tei:constraintSpec/@ident" />
             <xsl:if test="count(../s:report|s:assert) &gt;1">
-              <xsl:number/>
+              <xsl:number />
             </xsl:if>
           </xsl:attribute>
-          <rule>
-            <xsl:attribute name="context">
+					<rule>
+						<xsl:attribute name="context">
               <xsl:text>tei:</xsl:text>
-              <xsl:value-of select="ancestor::tei:elementSpec/@ident"/>
+              <xsl:value-of
+							select="ancestor::tei:elementSpec/@ident" />
             </xsl:attribute>
-            <xsl:apply-templates mode="justcopy" select="."/>
-          </rule>
-        </pattern>
-      </xsl:when>
-      <xsl:when test="self::s:pattern">
-        <xsl:apply-templates mode="justcopy" select="."/>
-      </xsl:when>
-      <xsl:when test="self::s:rule">
-        <pattern name="{ancestor::tei:constraintSpec/parent::*/@ident}-constraint-{ancestor::tei:constraintSpec/@ident}"
-          xmlns="http://www.ascc.net/xml/schematron">
-          <xsl:apply-templates mode="justcopy" select="."/>
-        </pattern>
-      </xsl:when>
-      <xsl:when test="self::sch:ns">
-        <ns prefix="{@prefix}" uri="{@uri}" xmlns="http://purl.oclc.org/dsdl/schematron"/>
-      </xsl:when>
-      <xsl:when test="self::sch:pattern">
-        <xsl:apply-templates mode="justcopy" select="."/>
-      </xsl:when>
-      <xsl:when test="self::sch:rule">
-        <pattern xmlns="http://purl.oclc.org/dsdl/schematron"
-          id="{ancestor::tei:constraintSpec/parent::*/@ident}-constraint-{ancestor::tei:constraintSpec/@ident}">
-          <xsl:apply-templates mode="justcopy" select="."/>
-        </pattern>
-      </xsl:when>
-      <xsl:when test="(self::sch:report or self::sch:assert) and ancestor::tei:elementSpec">
-        <pattern xmlns="http://purl.oclc.org/dsdl/schematron">
-          <xsl:attribute name="id">
-            <xsl:value-of select="ancestor::tei:elementSpec/@ident"/>
+						<xsl:apply-templates mode="justcopy"
+							select="." />
+					</rule>
+				</pattern>
+			</xsl:when>
+			<xsl:when test="self::s:pattern">
+				<xsl:apply-templates mode="justcopy" select="." />
+			</xsl:when>
+			<xsl:when test="self::s:rule">
+				<pattern
+					name="{ancestor::tei:constraintSpec/parent::*/@ident}-constraint-{ancestor::tei:constraintSpec/@ident}"
+					xmlns="http://www.ascc.net/xml/schematron">
+					<xsl:apply-templates mode="justcopy" select="." />
+				</pattern>
+			</xsl:when>
+			<xsl:when test="self::sch:ns">
+				<ns prefix="{@prefix}" uri="{@uri}"
+					xmlns="http://purl.oclc.org/dsdl/schematron" />
+			</xsl:when>
+			<xsl:when test="self::sch:pattern">
+				<xsl:apply-templates mode="justcopy" select="." />
+			</xsl:when>
+			<xsl:when test="self::sch:rule">
+				<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
+					id="{ancestor::tei:constraintSpec/parent::*/@ident}-constraint-{ancestor::tei:constraintSpec/@ident}">
+					<xsl:apply-templates mode="justcopy" select="." />
+				</pattern>
+			</xsl:when>
+			<xsl:when
+				test="(self::sch:report or self::sch:assert) and ancestor::tei:elementSpec">
+				<pattern xmlns="http://purl.oclc.org/dsdl/schematron">
+					<xsl:attribute name="id">
+            <xsl:value-of
+						select="ancestor::tei:elementSpec/@ident" />
             <xsl:text>-constraint-</xsl:text>
-            <xsl:value-of select="../../@ident"/>
-            <xsl:if test="count(../sch:report|../sch:assert) &gt;1">
-              <xsl:number/>
+            <xsl:value-of select="../../@ident" />
+            <xsl:if
+						test="count(../sch:report|../sch:assert) &gt;1">
+              <xsl:number />
             </xsl:if>
           </xsl:attribute>
-          <rule>
-            <xsl:attribute name="context">
+					<rule>
+						<xsl:attribute name="context">
               <xsl:text>tei:</xsl:text>
-              <xsl:value-of select="ancestor::tei:elementSpec/@ident"/>
+              <xsl:value-of
+							select="ancestor::tei:elementSpec/@ident" />
             </xsl:attribute>
-            <xsl:apply-templates mode="justcopy" select="."/>
-          </rule>
-        </pattern>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+						<xsl:apply-templates mode="justcopy"
+							select="." />
+					</rule>
+				</pattern>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
 
-   <xsl:template match="@*|text()" mode="justcopy">
-      <xsl:copy-of select="."/>
-   </xsl:template>
+	<xsl:template match="@*|text()" mode="justcopy">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-   <xsl:template match="processing-instruction()" mode="justcopy">
-      <xsl:copy-of select="."/>
-   </xsl:template>
+	<xsl:template match="processing-instruction()"
+		mode="justcopy">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-   <xsl:template match="*" mode="justcopy">
-     <xsl:copy>
-         <xsl:apply-templates
-	     select="*|@*|processing-instruction()|text()" mode="justcopy"/>
-     </xsl:copy>
-   </xsl:template>
+	<xsl:template match="*" mode="justcopy">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|text()" mode="justcopy" />
+		</xsl:copy>
+	</xsl:template>
 
-   <xsl:template match="a:*" mode="justcopy">
-      <xsl:element name="{name()}">
-         <xsl:apply-templates
-	     select="*|@*|processing-instruction()|text()" mode="justcopy"/>
-      </xsl:element>
-   </xsl:template>
+	<xsl:template match="a:*" mode="justcopy">
+		<xsl:element name="{name()}">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|text()" mode="justcopy" />
+		</xsl:element>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/RngToRnc.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/RngToRnc.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/RngToRnc.xsl	(revision 2397)
@@ -1,1502 +1,1381 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--*- XML -*-->
+<!--*- XML -* -->
 <!-- adapted by Sebastian Rahtz from: -->
 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 <!-- $Id: RngToRnc.xsl 9513 2011-10-17 08:55:51Z rahtz $ -->
 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- 
-  modified 2010-08-14 by Syd Bauman:
-     bug-fix: modified expressions defining 'pfx' variables
-     so that only 1 namespace is handed to name().
--->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-     Copyright (c) 2002, Pantor Engineering AB
-     All rights reserved.
-     
-     Redistribution and use in source and binary forms, with or
-     without modification, are permitted provided that the following
-     conditions are met:
-     
-     * Redistributions of source code must retain the above copyright
-       notice, this list of conditions and the following disclaimer. 
-
-     * Redistributions in binary form must reproduce the above
-       copyright notice, this list of conditions and the following
-       disclaimer in the documentation and/or other materials provided
-       with the distribution.
-
-     * Neither the name of Pantor Engineering AB nor the names of its
-       contributors may be used to endorse or promote products derived
-       from this software without specific prior written permission.
-     
-     THIS   SOFTWARE   IS PROVIDED BY    THE   COPYRIGHT  HOLDERS  AND
-     CONTRIBUTORS "AS IS"   AND ANY  EXPRESS OR  IMPLIED   WARRANTIES,
-     INCLUDING,  BUT  NOT LIMITED  TO,   THE  IMPLIED  WARRANTIES   OF
-     MERCHANTABILITY    AND  FITNESS  FOR   A  PARTICULAR  PURPOSE ARE
-     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-     BE  LIABLE   FOR ANY    DIRECT, INDIRECT,   INCIDENTAL,  SPECIAL,
-     EXEMPLARY, OR CONSEQUENTIAL DAMAGES  (INCLUDING, BUT NOT  LIMITED
-     TO, PROCUREMENT  OF  SUBSTITUTE GOODS OR  SERVICES;  LOSS OF USE,
-     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-     ANY THEORY OF  LIABILITY, WHETHER IN CONTRACT,  STRICT LIABILITY,
-     OR  TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING  IN ANY WAY
-     OUT OF  THE  USE OF   THIS  SOFTWARE,  EVEN IF ADVISED   OF   THE
-     POSSIBILITY OF SUCH DAMAGE.
-
-     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-     Created by David.Rosenborg@pantor.com
-     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-     RngToRncText.xsl converts a RELAX NG schema in XML syntax to the
-     compact syntax.
-
-     If the source document is a RELAX NG schema, an extension
-     function converting result tree fragments to node sets is
-     required. If the processor supports the exslt:node-set function,
-     no configuration should be needed. See RngToRncProcessorConfig.xsl
-     for further information.
-
-     This stylesheet can also be applied to the intermediate XML
-     representation of a compact schema as output by the
-     RngToRncXml.xsl stylesheet. In this case, no extension function
-     is required.
-
-     For a description of the underlying XML to compact syntax
-     transformation, see RngToRncXml.xsl.
-
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<xsl:transform xmlns:rng="http://relaxng.org/ns/structure/1.0"
-               xmlns:sch="http://purl.oclc.org/dsdl/schematron"
-               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-               xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-               version="2.0"
-               exclude-result-prefixes="rng sch a">
-  <xsl:param name="top"/>
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- Parameters -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- collapse-lines:
-     If true, output constructs spanning multiple lines will be
-     groupd into a single line unless it exceeds $line-width chars. -->
-  <xsl:param name="collapse-lines" select="true ()"/>
-   <!-- indent-width:
-     The number of characters to indent at each indentation level -->
-  <xsl:param name="indent-width" select="3"/>
-   <!-- line-width:
-     see the group-lines parameter. -->
-  <xsl:param name="line-width" select="80"/>
-   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- $Id: RngToRnc.xsl 9513 2011-10-17 08:55:51Z rahtz $ -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-     Copyright (c) 2002, Pantor Engineering AB
-     All rights reserved.
-     
-     Redistribution and use in source and binary forms, with or
-     without modification, are permitted provided that the following
-     conditions are met:
-     
-     * Redistributions of source code must retain the above copyright
-       notice, this list of conditions and the following disclaimer. 
-
-     * Redistributions in binary form must reproduce the above
-       copyright notice, this list of conditions and the following
-       disclaimer in the documentation and/or other materials provided
-       with the distribution.
-
-     * Neither the name of Pantor Engineering AB nor the names of its
-       contributors may be used to endorse or promote products derived
-       from this software without specific prior written permission.
-     
-     THIS   SOFTWARE   IS PROVIDED BY    THE   COPYRIGHT  HOLDERS  AND
-     CONTRIBUTORS "AS IS"   AND ANY  EXPRESS OR  IMPLIED   WARRANTIES,
-     INCLUDING,  BUT  NOT LIMITED  TO,   THE  IMPLIED  WARRANTIES   OF
-     MERCHANTABILITY    AND  FITNESS  FOR   A  PARTICULAR  PURPOSE ARE
-     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-     BE  LIABLE   FOR ANY    DIRECT, INDIRECT,   INCIDENTAL,  SPECIAL,
-     EXEMPLARY, OR CONSEQUENTIAL DAMAGES  (INCLUDING, BUT NOT  LIMITED
-     TO, PROCUREMENT  OF  SUBSTITUTE GOODS OR  SERVICES;  LOSS OF USE,
-     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-     ANY THEORY OF  LIABILITY, WHETHER IN CONTRACT,  STRICT LIABILITY,
-     OR  TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING  IN ANY WAY
-     OUT OF  THE  USE OF   THIS  SOFTWARE,  EVEN IF ADVISED   OF   THE
-     POSSIBILITY OF SUCH DAMAGE.
-
-     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-     Created by David.Rosenborg@pantor.com
-     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-     RngToRncXml.xsl converts a RELAX NG schema in XML syntax to an
-     XML representation of the compact syntax.
-
-     The output is an intermediate format suitable for further
-     transformation into, for example, plain text or HTML.
-
-     The default namespace declaration is chosen from the first
-     (in document order) occurrence of an ns attribute, unless
-     supplied as the parameter default-ns.
-
-     If the value of an href attribute ends with '.rng', the suffix
-     will be replace by the string '.rnc'. This feature can be
-     disabled by setting the stylesheet parameter rewrite-suffix to
-     false.
-
-     Current limitations/known deficiencies:
-
-     * Annotations are not handled in name classes
-
-     * Uses of namespace prefixes must be consistent throughout the
-       source schema. That is, a namespace prefix used in two QNames
-       must be declared to the same namespace URI for both
-       occurrences.
-
-     +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- Parameters -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- rewrite-suffix:
-     If true and the value of an href attribute ends with '.rng', the
-     suffix will be replace by the string '.rnc'. -->
-  <xsl:param name="rewrite-suffix" select="true ()"/>
-   <!-- retain-prefixes:
-     If true, namespace declarations will use prefixes from the source
-     document if possible. (Doesn't work with MSXML 4.0 or Xalan-J 2.4.0) -->
-  <xsl:param name="retain-prefixes"
-              select="system-property ('xsl:vendor') != 'Microsoft' and     not (starts-with (system-property ('xsl:vendor'), 'Apache'))"/>
-   <!-- default-ns:
-     The uri of the default namespace. There must be at least one
-     ns attribute in the schema containing this uri. -->
-  <xsl:param name="default-ns" select="string (/descendant::rng:*[@ns][1]/@ns)"/>
-   <!-- prefixes:
-    A space separated list of prefix mappings: prefix '=' namespace-uri.
-    Note: Since space is used as a delimiter, no space is allowed 
-    immediately before or after the equal sign. Example: 
-
-    "foo=http://example.org/ns/foo bar=http://example.org/ns/bar"
-
-    The prefixes will be used whenever a prefix is needed for the
-    corresponding namespace URI. Prefixes declared in this
-    parameter has higher precedence than the prefixes declared
-    in the prefix-map parameter and those found in the schema.
-  -->
-  <xsl:param name="prefixes"/>
-   <!-- prefix-map:
-     A node set containing element nodes like:
-
-     <ns prefix="x">http://example.org/x</ns>
-
-     The name of the element is not significant. Prefixes from this
-     map will be used in favor of generated and the ones found in the
-     source schema. A prefix must not be the empty string. Also, it
-     must not conflict with any other prefixes in the map or in the
-     schema. -->
-  <xsl:param name="prefix-map" select="/.."/>
-   <!-- recursive:
-     If true, recursively process includes and external
-     references. Note: no include logic is applied. The external
-     schemas are simply structurally included, wrapped in an <external>
-     element. -->
-  <xsl:param name="recursive" select="false ()"/>
-  <xsl:template name="str">
-      <xsl:param name="text"/>
-      <xsl:param name="quote" select="'&#34;'"/>
-      <xsl:param name="is-multiline" select="false ()"/>
-      <xsl:variable name="lit" select="concat ($quote, $text, $quote)"/>
-      <str size="{string-length ($lit)}">
-         <xsl:if test="$is-multiline">
-            <xsl:attribute name="multiline">yes</xsl:attribute>
-         </xsl:if>
-         <xsl:value-of select="$lit"/>
-      </str>
-  </xsl:template>
-  <xsl:template name="text">
-      <xsl:param name="text"/>
-      <xsl:attribute name="size">
-         <xsl:value-of select="string-length ($text)"/>
+<!-- modified 2010-08-14 by Syd Bauman: bug-fix: modified expressions defining 
+	'pfx' variables so that only 1 namespace is handed to name(). -->
+<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Copyright 
+	(c) 2002, Pantor Engineering AB All rights reserved. Redistribution and use 
+	in source and binary forms, with or without modification, are permitted provided 
+	that the following conditions are met: * Redistributions of source code must 
+	retain the above copyright notice, this list of conditions and the following 
+	disclaimer. * Redistributions in binary form must reproduce the above copyright 
+	notice, this list of conditions and the following disclaimer in the documentation 
+	and/or other materials provided with the distribution. * Neither the name 
+	of Pantor Engineering AB nor the names of its contributors may be used to 
+	endorse or promote products derived from this software without specific prior 
+	written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+	CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 
+	NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+	A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 
+	OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+	EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
+	OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
+	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+	ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+	OF SUCH DAMAGE. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Created 
+	by David.Rosenborg@pantor.com +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ RngToRncText.xsl 
+	converts a RELAX NG schema in XML syntax to the compact syntax. If the source 
+	document is a RELAX NG schema, an extension function converting result tree 
+	fragments to node sets is required. If the processor supports the exslt:node-set 
+	function, no configuration should be needed. See RngToRncProcessorConfig.xsl 
+	for further information. This stylesheet can also be applied to the intermediate 
+	XML representation of a compact schema as output by the RngToRncXml.xsl stylesheet. 
+	In this case, no extension function is required. For a description of the 
+	underlying XML to compact syntax transformation, see RngToRncXml.xsl. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<xsl:transform
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	version="2.0" exclude-result-prefixes="rng sch a">
+	<xsl:param name="top" />
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- Parameters -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- collapse-lines: If true, output constructs spanning multiple lines 
+		will be groupd into a single line unless it exceeds $line-width chars. -->
+	<xsl:param name="collapse-lines" select="true ()" />
+	<!-- indent-width: The number of characters to indent at each indentation 
+		level -->
+	<xsl:param name="indent-width" select="3" />
+	<!-- line-width: see the group-lines parameter. -->
+	<xsl:param name="line-width" select="80" />
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- $Id: RngToRnc.xsl 9513 2011-10-17 08:55:51Z rahtz $ -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Copyright 
+		(c) 2002, Pantor Engineering AB All rights reserved. Redistribution and use 
+		in source and binary forms, with or without modification, are permitted provided 
+		that the following conditions are met: * Redistributions of source code must 
+		retain the above copyright notice, this list of conditions and the following 
+		disclaimer. * Redistributions in binary form must reproduce the above copyright 
+		notice, this list of conditions and the following disclaimer in the documentation 
+		and/or other materials provided with the distribution. * Neither the name 
+		of Pantor Engineering AB nor the names of its contributors may be used to 
+		endorse or promote products derived from this software without specific prior 
+		written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+		CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 
+		NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+		A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 
+		OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+		EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
+		OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+		INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
+		STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+		ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+		OF SUCH DAMAGE. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Created 
+		by David.Rosenborg@pantor.com +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ RngToRncXml.xsl 
+		converts a RELAX NG schema in XML syntax to an XML representation of the 
+		compact syntax. The output is an intermediate format suitable for further 
+		transformation into, for example, plain text or HTML. The default namespace 
+		declaration is chosen from the first (in document order) occurrence of an 
+		ns attribute, unless supplied as the parameter default-ns. If the value of 
+		an href attribute ends with '.rng', the suffix will be replace by the string 
+		'.rnc'. This feature can be disabled by setting the stylesheet parameter 
+		rewrite-suffix to false. Current limitations/known deficiencies: * Annotations 
+		are not handled in name classes * Uses of namespace prefixes must be consistent 
+		throughout the source schema. That is, a namespace prefix used in two QNames 
+		must be declared to the same namespace URI for both occurrences. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- Parameters -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- rewrite-suffix: If true and the value of an href attribute ends with 
+		'.rng', the suffix will be replace by the string '.rnc'. -->
+	<xsl:param name="rewrite-suffix" select="true ()" />
+	<!-- retain-prefixes: If true, namespace declarations will use prefixes 
+		from the source document if possible. (Doesn't work with MSXML 4.0 or Xalan-J 
+		2.4.0) -->
+	<xsl:param name="retain-prefixes"
+		select="system-property ('xsl:vendor') != 'Microsoft' and     not (starts-with (system-property ('xsl:vendor'), 'Apache'))" />
+	<!-- default-ns: The uri of the default namespace. There must be at least 
+		one ns attribute in the schema containing this uri. -->
+	<xsl:param name="default-ns"
+		select="string (/descendant::rng:*[@ns][1]/@ns)" />
+	<!-- prefixes: A space separated list of prefix mappings: prefix '=' namespace-uri. 
+		Note: Since space is used as a delimiter, no space is allowed immediately 
+		before or after the equal sign. Example: "foo=http://example.org/ns/foo bar=http://example.org/ns/bar" 
+		The prefixes will be used whenever a prefix is needed for the corresponding 
+		namespace URI. Prefixes declared in this parameter has higher precedence 
+		than the prefixes declared in the prefix-map parameter and those found in 
+		the schema. -->
+	<xsl:param name="prefixes" />
+	<!-- prefix-map: A node set containing element nodes like: <ns prefix="x">http://example.org/x</ns> 
+		The name of the element is not significant. Prefixes from this map will be 
+		used in favor of generated and the ones found in the source schema. A prefix 
+		must not be the empty string. Also, it must not conflict with any other prefixes 
+		in the map or in the schema. -->
+	<xsl:param name="prefix-map" select="/.." />
+	<!-- recursive: If true, recursively process includes and external references. 
+		Note: no include logic is applied. The external schemas are simply structurally 
+		included, wrapped in an <external> element. -->
+	<xsl:param name="recursive" select="false ()" />
+	<xsl:template name="str">
+		<xsl:param name="text" />
+		<xsl:param name="quote" select="'&#34;'" />
+		<xsl:param name="is-multiline" select="false ()" />
+		<xsl:variable name="lit"
+			select="concat ($quote, $text, $quote)" />
+		<str size="{string-length ($lit)}">
+			<xsl:if test="$is-multiline">
+				<xsl:attribute name="multiline">yes</xsl:attribute>
+			</xsl:if>
+			<xsl:value-of select="$lit" />
+		</str>
+	</xsl:template>
+	<xsl:template name="text">
+		<xsl:param name="text" />
+		<xsl:attribute name="size">
+         <xsl:value-of select="string-length ($text)" />
       </xsl:attribute>
-      <xsl:value-of select="$text"/>
-  </xsl:template>
-   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-  <xsl:key name="prefix"
-            match="rng:element/@name [contains (., ':')] | rng:attribute/@name [contains (., ':')]"
-            use="substring-before (., ':')"/>
-  <xsl:key name="ns" match="*" use="namespace::*"/>
-  <xsl:key name="annot-ns" match="*[not (self::rng:*)]" use="namespace-uri (.)"/>
-  <xsl:key name="annot-ns" match="@*[namespace-uri (.) != '']" use="namespace-uri (.)"/>
-  <xsl:output method="xml" indent="yes"/>
-  <xsl:strip-space elements="rng:*"/>
-  <xsl:preserve-space elements="rng:value rng:param"/>
-  <xsl:variable name="xsd" select="'http://www.w3.org/2001/XMLSchema-datatypes'"/>
-  <xsl:variable name="default-ns-nd" select="/descendant::rng:*[@ns = $default-ns][1]/@ns"/>
-  <xsl:variable name="default-ns-id-rtf">
-      <xsl:call-template name="get-prefix">
-         <xsl:with-param name="nd" select="$default-ns-nd"/>
-      </xsl:call-template>
-  </xsl:variable>
-  <xsl:variable name="default-ns-id" select="string ($default-ns-id-rtf)"/>
-  <xsl:variable name="has-default-ns" select="boolean ($default-ns-nd)"/>
-  <xsl:variable name="has-local" select="not (key ('prefix', 'local'))"/>
-  <xsl:template name="make-compact-schema">
-      <compact-schema>
-<!-- Declarations -->
-      <xsl:if test="$has-default-ns">
-            <xsl:call-template name="make-ns-declaration">
-               <xsl:with-param name="is-default" select="true ()"/>
-               <xsl:with-param name="prefix" select="$default-ns-id"/>
-               <xsl:with-param name="uri" select="$default-ns"/>
-            </xsl:call-template>
-         </xsl:if>
-         <xsl:if test="$has-local">
-            <xsl:call-template name="make-ns-declaration">
-               <xsl:with-param name="prefix" select="'local'"/>
-               <xsl:with-param name="uri" select="''"/>
-            </xsl:call-template>
-         </xsl:if>
-         <xsl:call-template name="inhnamespace"/>
-         <!--
-      <xsl:choose>
-	<xsl:when test="$retain-prefixes">
-	  <xsl:for-each select="//*">
-	    <xsl:variable name="elm" select="self::*"/>
-	    <xsl:for-each select="namespace::*">
-	      <xsl:variable name="ns" select="string (.)"/>
-	      <xsl:if test="(not ($has-default-ns) or $ns != $default-ns) and
-		count (key ('ns', $ns)[1] | $elm) = 1 and
-		name (.) != 'xml' and 
-		((not ($ns = 'http://relaxng.org/ns/structure/1.0') and 
-		//*[namespace-uri (.) = $ns or @ns = $ns or 
-		@*[namespace-uri (.) = $ns]]) or 
-		//*[namespace-uri (.) != 
-		'http://relaxng.org/ns/structure/1.0']//
-		*[namespace-uri (.) = $ns or @*[namespace-uri (.) = $ns]] or
-		key ('prefix', name (.)))">
-		<xsl:call-template name="make-ns-declaration">
-		  <xsl:with-param name="prefix">
-		    <xsl:variable name="mapped">
-		      <xsl:call-template name="mapped-prefix">
-			<xsl:with-param name="ns" select="string (.)"/>
-		      </xsl:call-template>
-		    </xsl:variable>
-		    <xsl:choose>
-		      <xsl:when test="string ($mapped)">
-			<xsl:value-of select="$mapped"/>
-		      </xsl:when>
-		      <xsl:when test="name (.)">
-			<xsl:value-of select="name (.)"/>
-		      </xsl:when>
-		      <xsl:otherwise>
-			<xsl:value-of select="generate-id ($elm)"/>
-		      </xsl:otherwise>
-		    </xsl:choose>
-		  </xsl:with-param>
-		  <xsl:with-param name="uri" select="."/>
+		<xsl:value-of select="$text" />
+	</xsl:template>
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<xsl:key name="prefix"
+		match="rng:element/@name [contains (., ':')] | rng:attribute/@name [contains (., ':')]"
+		use="substring-before (., ':')" />
+	<xsl:key name="ns" match="*" use="namespace::*" />
+	<xsl:key name="annot-ns" match="*[not (self::rng:*)]"
+		use="namespace-uri (.)" />
+	<xsl:key name="annot-ns" match="@*[namespace-uri (.) != '']"
+		use="namespace-uri (.)" />
+	<xsl:output method="xml" indent="yes" />
+	<xsl:strip-space elements="rng:*" />
+	<xsl:preserve-space elements="rng:value rng:param" />
+	<xsl:variable name="xsd"
+		select="'http://www.w3.org/2001/XMLSchema-datatypes'" />
+	<xsl:variable name="default-ns-nd"
+		select="/descendant::rng:*[@ns = $default-ns][1]/@ns" />
+	<xsl:variable name="default-ns-id-rtf">
+		<xsl:call-template name="get-prefix">
+			<xsl:with-param name="nd" select="$default-ns-nd" />
 		</xsl:call-template>
-	      </xsl:if>
-	    </xsl:for-each>
-	  </xsl:for-each>
-	</xsl:when>
-
-	<xsl:otherwise>
-	  <xsl:for-each select=".//rng:element | .//rng:attribute">
-	    <xsl:if test="@name [contains (., ':')]">
-	      <xsl:variable name="pfx" select="substring-before (@name, ':')"/>
-	      <xsl:if test="count (key ('prefix', $pfx)[1] | @name) = 1">
+	</xsl:variable>
+	<xsl:variable name="default-ns-id"
+		select="string ($default-ns-id-rtf)" />
+	<xsl:variable name="has-default-ns"
+		select="boolean ($default-ns-nd)" />
+	<xsl:variable name="has-local"
+		select="not (key ('prefix', 'local'))" />
+	<xsl:template name="make-compact-schema">
+		<compact-schema>
+			<!-- Declarations -->
+			<xsl:if test="$has-default-ns">
+				<xsl:call-template name="make-ns-declaration">
+					<xsl:with-param name="is-default" select="true ()" />
+					<xsl:with-param name="prefix"
+						select="$default-ns-id" />
+					<xsl:with-param name="uri" select="$default-ns" />
+				</xsl:call-template>
+			</xsl:if>
+			<xsl:if test="$has-local">
+				<xsl:call-template name="make-ns-declaration">
+					<xsl:with-param name="prefix" select="'local'" />
+					<xsl:with-param name="uri" select="''" />
+				</xsl:call-template>
+			</xsl:if>
+			<xsl:call-template name="inhnamespace" />
+			<!-- <xsl:choose> <xsl:when test="$retain-prefixes"> <xsl:for-each select="//*"> 
+				<xsl:variable name="elm" select="self::*"/> <xsl:for-each select="namespace::*"> 
+				<xsl:variable name="ns" select="string (.)"/> <xsl:if test="(not ($has-default-ns) 
+				or $ns != $default-ns) and count (key ('ns', $ns)[1] | $elm) = 1 and name 
+				(.) != 'xml' and ((not ($ns = 'http://relaxng.org/ns/structure/1.0') and 
+				//*[namespace-uri (.) = $ns or @ns = $ns or @*[namespace-uri (.) = $ns]]) 
+				or //*[namespace-uri (.) != 'http://relaxng.org/ns/structure/1.0']// *[namespace-uri 
+				(.) = $ns or @*[namespace-uri (.) = $ns]] or key ('prefix', name (.)))"> 
+				<xsl:call-template name="make-ns-declaration"> <xsl:with-param name="prefix"> 
+				<xsl:variable name="mapped"> <xsl:call-template name="mapped-prefix"> <xsl:with-param 
+				name="ns" select="string (.)"/> </xsl:call-template> </xsl:variable> <xsl:choose> 
+				<xsl:when test="string ($mapped)"> <xsl:value-of select="$mapped"/> </xsl:when> 
+				<xsl:when test="name (.)"> <xsl:value-of select="name (.)"/> </xsl:when> 
+				<xsl:otherwise> <xsl:value-of select="generate-id ($elm)"/> </xsl:otherwise> 
+				</xsl:choose> </xsl:with-param> <xsl:with-param name="uri" select="."/> </xsl:call-template> 
+				</xsl:if> </xsl:for-each> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:for-each 
+				select=".//rng:element | .//rng:attribute"> <xsl:if test="@name [contains 
+				(., ':')]"> <xsl:variable name="pfx" select="substring-before (@name, ':')"/> 
+				<xsl:if test="count (key ('prefix', $pfx)[1] | @name) = 1"> <xsl:variable 
+				name="ns" select="string (namespace::*[name () = $pfx])"/> <xsl:call-template 
+				name="make-ns-declaration"> <xsl:with-param name="prefix"> <xsl:variable 
+				name="mapped"> <xsl:call-template name="mapped-prefix"> <xsl:with-param name="ns" 
+				select="$ns"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when 
+				test="string ($mapped)"> <xsl:value-of select="$mapped"/> </xsl:when> <xsl:otherwise> 
+				<xsl:value-of select="$pfx"/> </xsl:otherwise> </xsl:choose> </xsl:with-param> 
+				<xsl:with-param name="uri" select="$ns"/> </xsl:call-template> </xsl:if> 
+				</xsl:if> </xsl:for-each> <xsl:for-each select="//*[not (self::rng:*)] | 
+				//*/@*[namespace-uri (.) != '']"> <xsl:variable name="ns" select="namespace-uri 
+				(.)"/> <xsl:if test="count (key ('annot-ns', $ns)[1] | .) = 1"> <xsl:call-template 
+				name="make-ns-declaration"> <xsl:with-param name="prefix"> <xsl:variable 
+				name="mapped"> <xsl:call-template name="mapped-prefix"> <xsl:with-param name="ns" 
+				select="$ns"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when 
+				test="string ($mapped)"> <xsl:value-of select="$mapped"/> </xsl:when> <xsl:otherwise> 
+				<xsl:value-of select="generate-id (.)"/> </xsl:otherwise> </xsl:choose> </xsl:with-param> 
+				<xsl:with-param name="uri" select="$ns"/> </xsl:call-template> </xsl:if> 
+				</xsl:for-each> </xsl:otherwise> </xsl:choose> <xsl:for-each select="//@datatypeLibrary"> 
+				<xsl:if test=". != $xsd and . != ''"> <declaration size="9">datatypes</declaration> 
+				<sp size="1"/> <prefix> <xsl:call-template name="text"> <xsl:with-param name="text" 
+				select="generate-id (.)"/> </xsl:call-template> </prefix> <t size="3"> = 
+				</t> <xsl:call-template name="str"> <xsl:with-param name="text" select="."/> 
+				</xsl:call-template> <nl size="1"/> </xsl:if> </xsl:for-each> -->
+			<nl size="1" />
+			<!-- Pattern -->
+			<xsl:apply-templates mode="RNC" />
+		</compact-schema>
+	</xsl:template>
+	<xsl:template match="/rng:grammar">
+		<grammar>
+			<xsl:apply-templates mode="RNC" />
+		</grammar>
+	</xsl:template>
+	<xsl:template name="make-block">
+		<xsl:param name="head" />
+		<xsl:param name="body" />
+		<xsl:param name="collapse" select="true ()" />
+		<group>
+			<xsl:if test="not ($collapse)">
+				<xsl:attribute name="collapse">no</xsl:attribute>
+			</xsl:if>
+			<xsl:copy-of select="$head" />
+			<nl size="1" />
+			<t size="1">{</t>
+			<indent>
+				<nl size="1" />
+				<xsl:copy-of select="$body" />
+			</indent>
+			<nl size="1" />
+			<t size="1">}</t>
+		</group>
+	</xsl:template>
+	<xsl:template name="make-parenthesis">
+		<xsl:param name="body" />
+		<t size="1">(</t>
+		<indent>
+			<nl size="1" />
+			<xsl:copy-of select="$body" />
+		</indent>
+		<nl size="1" />
+		<t size="1">)</t>
+	</xsl:template>
+	<xsl:template match="rng:grammar" mode="RNC">
+		<grammar>
+			<group>
+				<xsl:call-template name="annotations" />
+				<xsl:call-template name="make-block">
+					<xsl:with-param name="collapse" select="false ()" />
+					<xsl:with-param name="head">
+						<keyword size="7">grammar</keyword>
+					</xsl:with-param>
+					<xsl:with-param name="body">
+						<xsl:apply-templates mode="RNC" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</group>
+		</grammar>
+	</xsl:template>
+	<xsl:template match="rng:list | rng:mixed" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<xsl:call-template name="make-block">
+				<xsl:with-param name="head">
+					<keyword>
+						<xsl:call-template name="text">
+							<xsl:with-param name="text"
+								select="local-name (.)" />
+						</xsl:call-template>
+					</keyword>
+				</xsl:with-param>
+				<xsl:with-param name="body">
+					<xsl:call-template name="group-body" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</group>
+	</xsl:template>
+	<xsl:template match="rng:start" mode="RNC">
+		<xsl:call-template name="annotations" />
+		<group>
+			<define size="5">
+				<xsl:copy-of select="@combine" />
+				<xsl:text>start</xsl:text>
+			</define>
+			<xsl:call-template name="assignment-op" />
+			<indent>
+				<nl size="1" />
+				<xsl:call-template name="group-body" />
+			</indent>
+		</group>
+		<xsl:call-template name="spacer" />
+	</xsl:template>
+	<xsl:template name="assignment-op">
+		<xsl:choose>
+			<xsl:when test="@combine = 'choice'">
+				<t size="3"> |=</t>
+			</xsl:when>
+			<xsl:when test="@combine = 'interleave'">
+				<t size="3"> &amp;=</t>
+			</xsl:when>
+			<xsl:otherwise>
+				<t size="2"> =</t>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="rng:define" mode="RNC">
+		<xsl:variable name="grammar"
+			select="ancestor::rng:grammar [1]" />
+		<xsl:call-template name="annotations" />
+		<group>
+			<define name="{@name}">
+				<xsl:copy-of select="@combine" />
+				<xsl:call-template name="text">
+					<xsl:with-param name="text">
+						<xsl:call-template name="quote-keyword">
+							<xsl:with-param name="name" select="@name" />
+						</xsl:call-template>
+					</xsl:with-param>
+				</xsl:call-template>
+			</define>
+			<xsl:call-template name="assignment-op" />
+			<indent>
+				<nl size="1" />
+				<xsl:call-template name="group-body" />
+			</indent>
+		</group>
+		<xsl:call-template name="spacer" />
+	</xsl:template>
+	<xsl:template match="rng:div" mode="RNC">
+		<xsl:call-template name="annotations" />
+		<xsl:call-template name="make-block">
+			<xsl:with-param name="collapse" select="false ()" />
+			<xsl:with-param name="head">
+				<keyword size="3">div</keyword>
+			</xsl:with-param>
+			<xsl:with-param name="body">
+				<xsl:apply-templates mode="RNC" />
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:call-template name="spacer" />
+	</xsl:template>
+	<xsl:template match="rng:include" mode="RNC">
+		<xsl:call-template name="annotations" />
+		<group collapse="no">
+			<keyword size="7">include</keyword>
+			<sp size="1" />
+			<include-href ref="{generate-id ()}">
+				<xsl:call-template name="external" />
+			</include-href>
+			<xsl:if test="*">
+				<nl size="1" />
+				<t size="1">{</t>
+				<indent>
+					<nl size="1" />
+					<xsl:apply-templates mode="RNC" />
+				</indent>
+				<nl size="1" />
+				<t size="1">}</t>
+			</xsl:if>
+		</group>
+		<xsl:call-template name="spacer" />
+		<xsl:if test="$recursive">
+			<include href="{@href}" id="{generate-id ()}">
+				<xsl:for-each select="document (@href)/rng:grammar">
+					<xsl:call-template name="make-compact-schema" />
+				</xsl:for-each>
+			</include>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="rng:externalRef" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<keyword size="8">external</keyword>
+			<sp size="1" />
+			<external-href ref="{generate-id ()}">
+				<xsl:call-template name="external" />
+			</external-href>
+		</group>
+		<xsl:if test="$recursive">
+			<external href="{@href}" id="{generate-id ()}">
+				<xsl:for-each select="document (@href)">
+					<xsl:call-template name="make-compact-schema" />
+				</xsl:for-each>
+			</external>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="make-inherit">
+		<xsl:param name="prefix" />
+		<sp size="1" />
+		<keyword size="7">inherit</keyword>
+		<t size="3"> = </t>
+		<prefix>
+			<xsl:call-template name="text">
+				<xsl:with-param name="text" select="$prefix" />
+			</xsl:call-template>
+		</prefix>
+	</xsl:template>
+	<xsl:template name="rewrite-suffix">
+		<xsl:param name="href" select="@href" />
+		<xsl:variable name="suffix"
+			select="substring ($href, (string-length ($href) - 4) + 1, 4)" />
+		<xsl:choose>
+			<xsl:when test="$rewrite-suffix and $suffix = '.rng'">
+				<xsl:value-of
+					select="substring ($href, 1, string-length ($href) - 4)" />
+				<xsl:text>.rnc</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$href" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="external">
+		<xsl:call-template name="str">
+			<xsl:with-param name="text">
+				<xsl:call-template name="rewrite-suffix" />
+			</xsl:with-param>
+		</xsl:call-template>
 		<xsl:variable name="ns"
-		  select="string (namespace::*[name () = $pfx])"/>
-		<xsl:call-template name="make-ns-declaration">
-		  <xsl:with-param name="prefix">
-		    <xsl:variable name="mapped">
-		      <xsl:call-template name="mapped-prefix">
-			<xsl:with-param name="ns" select="$ns"/>
-		      </xsl:call-template>
-		    </xsl:variable>
-		    <xsl:choose>
-		      <xsl:when test="string ($mapped)">
-			<xsl:value-of select="$mapped"/>
-		      </xsl:when>
-		      <xsl:otherwise>
-			<xsl:value-of select="$pfx"/>
-		      </xsl:otherwise>
-		    </xsl:choose>
-		  </xsl:with-param>
-		  <xsl:with-param name="uri" select="$ns"/>
+			select="ancestor-or-self::*[@ns][1]/@ns" />
+		<xsl:choose>
+			<xsl:when test="$has-default-ns and $ns = $default-ns" />
+			<xsl:when test="$has-local and $ns = ''">
+				<xsl:call-template name="make-inherit">
+					<xsl:with-param name="prefix">
+						local
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not($ns='')">
+				<xsl:call-template name="make-inherit">
+					<xsl:with-param name="prefix">
+						<xsl:call-template name="get-prefix">
+							<xsl:with-param name="nd" select="$ns" />
+						</xsl:call-template>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$has-default-ns">
+				<xsl:call-template name="make-inherit">
+					<xsl:with-param name="prefix">
+						inh
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="rng:ref" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<ref name="{@name}">
+				<xsl:call-template name="text">
+					<xsl:with-param name="text">
+						<xsl:call-template name="quote-keyword">
+							<xsl:with-param name="name" select="@name" />
+						</xsl:call-template>
+					</xsl:with-param>
+				</xsl:call-template>
+			</ref>
+		</group>
+	</xsl:template>
+	<xsl:template match="rng:parentRef" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<keyword size="6">parent</keyword>
+			<sp size="1" />
+			<parent-ref name="{@name}">
+				<xsl:call-template name="text">
+					<xsl:with-param name="text">
+						<xsl:call-template name="quote-keyword">
+							<xsl:with-param name="name" select="@name" />
+						</xsl:call-template>
+					</xsl:with-param>
+				</xsl:call-template>
+			</parent-ref>
+		</group>
+	</xsl:template>
+	<xsl:template match="rng:element | rng:attribute"
+		mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<group>
+				<xsl:variable name="head">
+					<keyword>
+						<xsl:call-template name="text">
+							<xsl:with-param name="text"
+								select="local-name (.)" />
+						</xsl:call-template>
+					</keyword>
+					<sp size="1" />
+					<xsl:call-template name="name-class">
+						<xsl:with-param name="is-attr"
+							select="boolean (self::rng:attribute)" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when
+						test="not (rng:*) or (count (rng:*) = 1 and not (@name))">
+						<xsl:copy-of select="$head" />
+						<t size="3"> { </t>
+						<atom size="4">text</atom>
+						<t size="2"> }</t>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="make-block">
+							<xsl:with-param name="head">
+								<xsl:copy-of select="$head" />
+							</xsl:with-param>
+							<xsl:with-param name="body">
+								<xsl:choose>
+									<xsl:when test="@name">
+										<xsl:call-template name="group-body" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:call-template name="group-body">
+											<xsl:with-param name="patterns"
+												select="rng:*[1]/following-sibling::rng:*" />
+										</xsl:call-template>
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</group>
+		</group>
+	</xsl:template>
+	<xsl:template name="expression">
+		<xsl:param name="operator" />
+		<xsl:param name="is-prefix-operator" select="false ()" />
+		<group>
+			<xsl:call-template name="annotations" />
+			<group>
+				<xsl:variable name="need-paren-rtf">
+					<xsl:call-template name="need-paren" />
+				</xsl:variable>
+				<xsl:variable name="need-paren"
+					select="boolean (string ($need-paren-rtf))" />
+				<xsl:choose>
+					<xsl:when test="$need-paren">
+						<xsl:call-template name="make-parenthesis">
+							<xsl:with-param name="body">
+								<xsl:call-template name="expression-body">
+									<xsl:with-param name="operator"
+										select="$operator" />
+									<xsl:with-param name="is-prefix-operator"
+										select="$is-prefix-operator" />
+								</xsl:call-template>
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="expression-body">
+							<xsl:with-param name="operator" select="$operator" />
+							<xsl:with-param name="is-prefix-operator"
+								select="$is-prefix-operator" />
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</group>
+		</group>
+	</xsl:template>
+	<xsl:template match="rng:group" mode="RNC">
+		<xsl:call-template name="expression">
+			<xsl:with-param name="operator" select="','" />
 		</xsl:call-template>
-	      </xsl:if>
-	    </xsl:if>
-	  </xsl:for-each>
-
-	  <xsl:for-each select="//*[not (self::rng:*)] | 
-	                        //*/@*[namespace-uri (.) != '']">
-	    <xsl:variable name="ns" select="namespace-uri (.)"/>
-	    <xsl:if test="count (key ('annot-ns', $ns)[1] | .) = 1">
-	      <xsl:call-template name="make-ns-declaration">
-		<xsl:with-param name="prefix">
-		  <xsl:variable name="mapped">
-		    <xsl:call-template name="mapped-prefix">
-		      <xsl:with-param name="ns" select="$ns"/>
-		    </xsl:call-template>
-		  </xsl:variable>
-		  <xsl:choose>
-		    <xsl:when test="string ($mapped)">
-		      <xsl:value-of select="$mapped"/>
-		    </xsl:when>
-		    <xsl:otherwise>
-		      <xsl:value-of select="generate-id (.)"/>
-		    </xsl:otherwise>
-		  </xsl:choose>
-		</xsl:with-param>
-		<xsl:with-param name="uri" select="$ns"/>
-	      </xsl:call-template>
-	    </xsl:if>
-	  </xsl:for-each>
-	</xsl:otherwise>
-      </xsl:choose>
-      
-      <xsl:for-each select="//@datatypeLibrary">
-	<xsl:if test=". != $xsd and . != ''">
-	  <declaration size="9">datatypes</declaration>
-	  <sp size="1"/>
-	  <prefix>
-	    <xsl:call-template name="text">
-	      <xsl:with-param name="text" select="generate-id (.)"/>
-	    </xsl:call-template>
-	  </prefix>
-	  <t size="3"> = </t>
-	  <xsl:call-template name="str">
-	    <xsl:with-param name="text" select="."/>
-	  </xsl:call-template>
-	  <nl size="1"/>
-	</xsl:if>
-      </xsl:for-each>
--->
-      <nl size="1"/>
-         <!-- Pattern -->
-      <xsl:apply-templates mode="RNC"/>
-      </compact-schema>
-  </xsl:template>
-  <xsl:template match="/rng:grammar">
-      <grammar>
-         <xsl:apply-templates mode="RNC"/>
-      </grammar>
-  </xsl:template>
-  <xsl:template name="make-block">
-      <xsl:param name="head"/>
-      <xsl:param name="body"/>
-      <xsl:param name="collapse" select="true ()"/>
-      <group>
-         <xsl:if test="not ($collapse)">
-            <xsl:attribute name="collapse">no</xsl:attribute>
-         </xsl:if>
-         <xsl:copy-of select="$head"/>
-         <nl size="1"/>
-         <t size="1">{</t>
-         <indent>
-            <nl size="1"/>
-            <xsl:copy-of select="$body"/>
-         </indent>
-         <nl size="1"/>
-         <t size="1">}</t>
-      </group>
-  </xsl:template>
-  <xsl:template name="make-parenthesis">
-      <xsl:param name="body"/>
-      <t size="1">(</t>
-      <indent>
-         <nl size="1"/>
-         <xsl:copy-of select="$body"/>
-      </indent>
-      <nl size="1"/>
-      <t size="1">)</t>
-  </xsl:template>
-  <xsl:template match="rng:grammar" mode="RNC">
-      <grammar>
-         <group>
-            <xsl:call-template name="annotations"/>
-            <xsl:call-template name="make-block">
-               <xsl:with-param name="collapse" select="false ()"/>
-               <xsl:with-param name="head">
-                  <keyword size="7">grammar</keyword>
-               </xsl:with-param>
-               <xsl:with-param name="body">
-                  <xsl:apply-templates mode="RNC"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </group>
-      </grammar>
-  </xsl:template>
-  <xsl:template match="rng:list | rng:mixed" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <xsl:call-template name="make-block">
-            <xsl:with-param name="head">
-               <keyword>
-                  <xsl:call-template name="text">
-                     <xsl:with-param name="text" select="local-name (.)"/>
-                  </xsl:call-template>
-               </keyword>
-            </xsl:with-param>
-            <xsl:with-param name="body">
-               <xsl:call-template name="group-body"/>
-            </xsl:with-param>
-         </xsl:call-template>
-      </group>
-  </xsl:template>
-  <xsl:template match="rng:start" mode="RNC">
-      <xsl:call-template name="annotations"/>
-      <group>
-         <define size="5">
-            <xsl:copy-of select="@combine"/>
-            <xsl:text>start</xsl:text>
-         </define>
-         <xsl:call-template name="assignment-op"/>
-         <indent>
-            <nl size="1"/>
-            <xsl:call-template name="group-body"/>
-         </indent>
-      </group>
-      <xsl:call-template name="spacer"/>
-  </xsl:template>
-  <xsl:template name="assignment-op">
-      <xsl:choose>
-         <xsl:when test="@combine = 'choice'">
-            <t size="3"> |=</t>
-         </xsl:when>
-         <xsl:when test="@combine = 'interleave'">
-            <t size="3"> &amp;=</t>
-         </xsl:when>
-         <xsl:otherwise>
-            <t size="2"> =</t>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="rng:define" mode="RNC">
-      <xsl:variable name="grammar" select="ancestor::rng:grammar [1]"/>
-      <xsl:call-template name="annotations"/>
-      <group>
-         <define name="{@name}">
-            <xsl:copy-of select="@combine"/>
-            <xsl:call-template name="text">
-               <xsl:with-param name="text">
-                  <xsl:call-template name="quote-keyword">
-                     <xsl:with-param name="name" select="@name"/>
-                  </xsl:call-template>
-               </xsl:with-param>
-            </xsl:call-template>
-         </define>
-         <xsl:call-template name="assignment-op"/>
-         <indent>
-            <nl size="1"/>
-            <xsl:call-template name="group-body"/>
-         </indent>
-      </group>
-      <xsl:call-template name="spacer"/>
-  </xsl:template>
-  <xsl:template match="rng:div" mode="RNC">
-      <xsl:call-template name="annotations"/>
-      <xsl:call-template name="make-block">
-         <xsl:with-param name="collapse" select="false ()"/>
-         <xsl:with-param name="head">
-            <keyword size="3">div</keyword>
-         </xsl:with-param>
-         <xsl:with-param name="body">
-            <xsl:apply-templates mode="RNC"/>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:call-template name="spacer"/>
-  </xsl:template>
-  <xsl:template match="rng:include" mode="RNC">
-      <xsl:call-template name="annotations"/>
-      <group collapse="no">
-         <keyword size="7">include</keyword>
-         <sp size="1"/>
-         <include-href ref="{generate-id ()}">
-            <xsl:call-template name="external"/>
-         </include-href>
-         <xsl:if test="*">
-            <nl size="1"/>
-            <t size="1">{</t>
-            <indent>
-               <nl size="1"/>
-               <xsl:apply-templates mode="RNC"/>
-            </indent>
-            <nl size="1"/>
-            <t size="1">}</t>
-         </xsl:if>
-      </group>
-      <xsl:call-template name="spacer"/>
-      <xsl:if test="$recursive">
-         <include href="{@href}" id="{generate-id ()}">
-            <xsl:for-each select="document (@href)/rng:grammar">
-               <xsl:call-template name="make-compact-schema"/>
-            </xsl:for-each>
-         </include>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="rng:externalRef" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <keyword size="8">external</keyword>
-         <sp size="1"/>
-         <external-href ref="{generate-id ()}">
-            <xsl:call-template name="external"/>
-         </external-href>
-      </group>
-      <xsl:if test="$recursive">
-         <external href="{@href}" id="{generate-id ()}">
-            <xsl:for-each select="document (@href)">
-               <xsl:call-template name="make-compact-schema"/>
-            </xsl:for-each>
-         </external>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="make-inherit">
-      <xsl:param name="prefix"/>
-      <sp size="1"/>
-      <keyword size="7">inherit</keyword>
-      <t size="3"> = </t>
-      <prefix>
-         <xsl:call-template name="text">
-            <xsl:with-param name="text" select="$prefix"/>
-         </xsl:call-template>
-      </prefix>
-  </xsl:template>
-  <xsl:template name="rewrite-suffix">
-      <xsl:param name="href" select="@href"/>
-      <xsl:variable name="suffix" select="substring ($href, (string-length ($href) - 4) + 1, 4)"/>
-      <xsl:choose>
-         <xsl:when test="$rewrite-suffix and $suffix = '.rng'">
-            <xsl:value-of select="substring ($href, 1, string-length ($href) - 4)"/>
-            <xsl:text>.rnc</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="$href"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="external">
-      <xsl:call-template name="str">
-         <xsl:with-param name="text">
-            <xsl:call-template name="rewrite-suffix"/>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:variable name="ns" select="ancestor-or-self::*[@ns][1]/@ns"/>
-      <xsl:choose>
-         <xsl:when test="$has-default-ns and $ns = $default-ns"/>
-         <xsl:when test="$has-local and $ns = ''">
-            <xsl:call-template name="make-inherit">
-               <xsl:with-param name="prefix">local</xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="not($ns='')">
-            <xsl:call-template name="make-inherit">
-               <xsl:with-param name="prefix">
-                  <xsl:call-template name="get-prefix">
-                     <xsl:with-param name="nd" select="$ns"/>
-                  </xsl:call-template>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$has-default-ns">
-            <xsl:call-template name="make-inherit">
-               <xsl:with-param name="prefix">inh</xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="rng:ref" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <ref name="{@name}">
-            <xsl:call-template name="text">
-               <xsl:with-param name="text">
-                  <xsl:call-template name="quote-keyword">
-                     <xsl:with-param name="name" select="@name"/>
-                  </xsl:call-template>
-               </xsl:with-param>
-            </xsl:call-template>
-         </ref>
-      </group>
-  </xsl:template>
-  <xsl:template match="rng:parentRef" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <keyword size="6">parent</keyword>
-         <sp size="1"/>
-         <parent-ref name="{@name}">
-            <xsl:call-template name="text">
-               <xsl:with-param name="text">
-                  <xsl:call-template name="quote-keyword">
-                     <xsl:with-param name="name" select="@name"/>
-                  </xsl:call-template>
-               </xsl:with-param>
-            </xsl:call-template>
-         </parent-ref>
-      </group>
-  </xsl:template>
-  <xsl:template match="rng:element | rng:attribute" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <group>
-            <xsl:variable name="head">
-               <keyword>
-                  <xsl:call-template name="text">
-                     <xsl:with-param name="text" select="local-name (.)"/>
-                  </xsl:call-template>
-               </keyword>
-               <sp size="1"/>
-               <xsl:call-template name="name-class">
-                  <xsl:with-param name="is-attr" select="boolean (self::rng:attribute)"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="not (rng:*) or (count (rng:*) = 1 and not (@name))">
-                  <xsl:copy-of select="$head"/>
-                  <t size="3"> { </t>
-                  <atom size="4">text</atom>
-                  <t size="2"> }</t>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:call-template name="make-block">
-                     <xsl:with-param name="head">
-                        <xsl:copy-of select="$head"/>
-                     </xsl:with-param>
-                     <xsl:with-param name="body">
-                        <xsl:choose>
-                           <xsl:when test="@name">
-                              <xsl:call-template name="group-body"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:call-template name="group-body">
-                                 <xsl:with-param name="patterns" select="rng:*[1]/following-sibling::rng:*"/>
-                              </xsl:call-template>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:otherwise>
-            </xsl:choose>
-         </group>
-      </group>
-  </xsl:template>
-  <xsl:template name="expression">
-      <xsl:param name="operator"/>
-      <xsl:param name="is-prefix-operator" select="false ()"/>
-      <group>
-         <xsl:call-template name="annotations"/>
-         <group>
-            <xsl:variable name="need-paren-rtf">
-               <xsl:call-template name="need-paren"/>
-            </xsl:variable>
-            <xsl:variable name="need-paren" select="boolean (string ($need-paren-rtf))"/>
-            <xsl:choose>
-               <xsl:when test="$need-paren">
-                  <xsl:call-template name="make-parenthesis">
-                     <xsl:with-param name="body">
-                        <xsl:call-template name="expression-body">
-                           <xsl:with-param name="operator" select="$operator"/>
-                           <xsl:with-param name="is-prefix-operator" select="$is-prefix-operator"/>
-                        </xsl:call-template>
-                     </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:call-template name="expression-body">
-                     <xsl:with-param name="operator" select="$operator"/>
-                     <xsl:with-param name="is-prefix-operator" select="$is-prefix-operator"/>
-                  </xsl:call-template>
-               </xsl:otherwise>
-            </xsl:choose>
-         </group>
-      </group>
-  </xsl:template>
-  <xsl:template match="rng:group" mode="RNC">
-      <xsl:call-template name="expression">
-         <xsl:with-param name="operator" select="','"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="rng:choice" mode="RNC" name="make-choice">
-      <xsl:call-template name="expression">
-         <xsl:with-param name="operator" select="'| '"/>
-         <xsl:with-param name="is-prefix-operator" select="true ()"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="rng:interleave" mode="RNC">
-      <xsl:call-template name="expression">
-         <xsl:with-param name="operator" select="'&amp; '"/>
-         <xsl:with-param name="is-prefix-operator" select="true ()"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="rng:optional" mode="RNC">
-      <xsl:call-template name="expression">
-         <xsl:with-param name="operator" select="','"/>
-      </xsl:call-template>
-      <t size="1">?</t>
-  </xsl:template>
-  <xsl:template match="rng:zeroOrMore" mode="RNC">
-      <xsl:call-template name="expression">
-         <xsl:with-param name="operator" select="','"/>
-      </xsl:call-template>
-      <t size="1">*</t>
-  </xsl:template>
-  <xsl:template match="rng:oneOrMore" mode="RNC">
-      <xsl:call-template name="expression">
-         <xsl:with-param name="operator" select="','"/>
-      </xsl:call-template>
-      <t size="1">+</t>
-  </xsl:template>
-  <xsl:template match="rng:text" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <atom size="4">text</atom>
-      </group>
-  </xsl:template>
-  <xsl:template match="rng:empty" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <atom size="5">empty</atom>
-      </group>
-  </xsl:template>
-  <xsl:template match="rng:notAllowed" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <atom size="10">notAllowed</atom>
-      </group>
-  </xsl:template>
-  <xsl:template match="rng:data" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <group>
-            <xsl:call-template name="type-name"/>
-            <xsl:if test="rng:param">
-               <nl size="1"/>
-               <t size="1">{</t>
-               <indent>
-                  <xsl:for-each select="rng:param">
-                     <nl size="1"/>
-                     <group>
-                        <xsl:call-template name="annotations"/>
-                        <param>
-                           <xsl:call-template name="text">
-                              <xsl:with-param name="text" select="@name"/>
-                           </xsl:call-template>
-                        </param>
-                        <t size="3"> = </t>
-                        <xsl:call-template name="make-string-literal"/>
-                     </group>
-                  </xsl:for-each>
-               </indent>
-               <nl size="1"/>
-               <t size="1">}</t>
-            </xsl:if>
-            <xsl:for-each select="rng:except">
-               <nl size="1"/>
-               <t size="1">-</t>
-               <nl size="1"/>
-               <xsl:choose>
-                  <xsl:when test="count (rng:*) &gt; 1">
-                     <xsl:call-template name="make-choice"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:apply-templates select="*" mode="RNC"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:for-each>
-         </group>
-      </group>
-  </xsl:template>
-  <xsl:template match="rng:value" mode="RNC">
-      <group>
-         <xsl:call-template name="annotations"/>
-         <xsl:variable name="type">
-            <xsl:call-template name="type-name"/>
-         </xsl:variable>
-         <xsl:if test="$type != 'token'">
-            <xsl:copy-of select="$type"/>
-            <sp size="1"/>
-         </xsl:if>
-         <xsl:call-template name="make-string-literal"/>
-      </group>
-  </xsl:template>
-  <xsl:template name="quote-quotes">
-      <xsl:param name="str"/>
-      <xsl:param name="pos" select="1"/>
-      <xsl:variable name="c" select="substring ($str, $pos, 1)"/>
-      <xsl:if test="$c">
-         <xsl:choose>
-            <xsl:when test="$c = '&#34;'">" '"' "</xsl:when>
-            <xsl:when test="$c = '&#xA;'">\x{A}</xsl:when>
-            <xsl:when test="$c = '&#xD;'">\x{D}</xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$c"/>
-            </xsl:otherwise>
-         </xsl:choose>
-         <xsl:call-template name="quote-quotes">
-            <xsl:with-param name="str" select="$str"/>
-            <xsl:with-param name="pos" select="$pos + 1"/>
-         </xsl:call-template>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="make-string-literal">
-      <xsl:choose>
-         <xsl:when test="not (contains (., '&#34;') or   contains (., &#34;'&#34;) or   contains (., '&#xA;') or contains (., '&#xD;'))">
-            <xsl:call-template name="str">
-               <xsl:with-param name="text" select="."/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="not (contains (., '&#34;&#34;&#34;'))">
-            <xsl:call-template name="str">
-               <xsl:with-param name="quote" select="'&#34;&#34;&#34;'"/>
-               <xsl:with-param name="text" select="."/>
-               <xsl:with-param name="is-multiline" select="true ()"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="not (contains (., &#34;'''&#34;))">
-            <xsl:call-template name="str">
-               <xsl:with-param name="quote">'''</xsl:with-param>
-               <xsl:with-param name="text" select="."/>
-               <xsl:with-param name="is-multiline" select="true ()"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="str">
-               <xsl:with-param name="text">
-                  <xsl:call-template name="quote-quotes">
-                     <xsl:with-param name="str" select="."/>
-                  </xsl:call-template>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="type-name">
-      <xsl:variable name="dt"
-                    select="ancestor-or-self::rng:*[@datatypeLibrary][1]/@datatypeLibrary"/>
-      <xsl:variable name="dts" select="string ($dt)"/>
-      <type>
-         <xsl:call-template name="text">
-            <xsl:with-param name="text">
-               <xsl:choose>
-                  <xsl:when test="self::rng:value and not (@type)">token</xsl:when>
-                  <xsl:when test="$dts = '' and @type= 'string'">string</xsl:when>
-                  <xsl:when test="$dts = '' and @type= 'token'">token</xsl:when>
-                  <xsl:when test="$dts = ''">
-                     <xsl:text>xsd:</xsl:text>
-                     <xsl:value-of select="@type"/>
-                  </xsl:when>
-                  <xsl:when test="$dts = $xsd">
-                     <xsl:text>xsd:</xsl:text>
-                     <xsl:value-of select="@type"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="generate-id ($dt)"/>
-                     <xsl:text>:</xsl:text>
-                     <xsl:value-of select="@type"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-         </xsl:call-template>
-      </type>
-  </xsl:template>
-  <xsl:template name="need-paren">
-      <xsl:choose>
-         <xsl:when test="self::rng:optional or  self::rng:zeroOrMore or  self::rng:oneOrMore">
-            <xsl:if test="count (rng:*) &gt; 1">true</xsl:if>
-         </xsl:when>
-         <xsl:when test="parent::rng:element[not (@name)] or   parent::rng:attribute [not (@name)]">
-            <xsl:if test="count (../rng:*) &gt; 2">true</xsl:if>
-         </xsl:when>
-         <xsl:when test="count (../rng:*) &gt; 1">true</xsl:when>
-         <xsl:when test="count (rng:*) &gt; 1 and (parent::rng:optional or   parent::rng:zeroOrMore or parent::rng:oneOrMore)">true</xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="expression-body">
-      <xsl:param name="patterns" select="rng:*"/>
-      <xsl:param name="operator"/>
-      <xsl:param name="is-prefix-operator" select="false ()"/>
-      <xsl:choose>
-         <xsl:when test="$is-prefix-operator">
-            <xsl:for-each select="$patterns">
-               <xsl:if test="position () != 1">
-                  <nl size="1"/>
-                  <op size="{string-length ($operator)}">
-                     <xsl:value-of select="$operator"/>
-                  </op>
-               </xsl:if>
-               <xsl:apply-templates select="." mode="RNC"/>
-               <xsl:call-template name="follow-annotations"/>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:for-each select="$patterns">
-               <xsl:if test="position () != 1">
-                  <op size="{string-length ($operator)}">
-                     <xsl:value-of select="$operator"/>
-                  </op>
-                  <nl size="1"/>
-               </xsl:if>
-               <xsl:apply-templates select="." mode="RNC"/>
-               <xsl:call-template name="follow-annotations"/>
-            </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="group-body">
-      <xsl:param name="patterns" select="rng:*"/>
-      <xsl:call-template name="expression-body">
-         <xsl:with-param name="patterns" select="$patterns"/>
-         <xsl:with-param name="operator" select="','"/>
-      </xsl:call-template>
-  </xsl:template>
-   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- Name class -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-  <xsl:template name="name-class">
-      <xsl:param name="is-attr" select="false ()"/>
-      <nc>
-         <xsl:call-template name="text">
-            <xsl:with-param name="text">
-               <xsl:choose>
-                  <xsl:when test="@name">
-                     <xsl:choose>
-                        <xsl:when test="not ($is-attr) and not (contains (@name, ':'))">
-                           <xsl:call-template name="make-name-nc">
-                              <xsl:with-param name="name" select="@name"/>
-                              <xsl:with-param name="is-attr" select="false ()"/>
-                           </xsl:call-template>
-                        </xsl:when>
-                        <xsl:when test="@ns">
-                           <xsl:text>[</xsl:text>
-                           <xsl:value-of select="@ns"/>
-                           <xsl:text>]</xsl:text>
-                           <xsl:value-of select="@name"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@name"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:apply-templates select="rng:*[1]" mode="name-class">
-                        <xsl:with-param name="is-attr" select="$is-attr"/>
-                     </xsl:apply-templates>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-         </xsl:call-template>
-      </nc>
-  </xsl:template>
-  <xsl:template match="rng:name" mode="name-class">
-      <xsl:param name="is-attr"/>
-      <xsl:call-template name="make-name-nc">
-         <xsl:with-param name="name" select="."/>
-         <xsl:with-param name="is-attr" select="$is-attr"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="rng:nsName" mode="name-class">
-      <xsl:param name="is-attr"/>
-      <xsl:variable name="ns" select="ancestor-or-self::rng:*[@ns][1]/@ns"/>
-      <xsl:choose>
-         <xsl:when test="$has-default-ns and $ns = $default-ns">
-            <xsl:value-of select="$default-ns-id"/>
-         </xsl:when>
-         <xsl:when test="$has-local and $ns = ''">local</xsl:when>
-         <xsl:when test="not($ns='')">
-            <xsl:call-template name="get-prefix">
-               <xsl:with-param name="nd" select="$ns"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>inh</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>:*</xsl:text>
-      <xsl:call-template name="nc-except">
-         <xsl:with-param name="is-attr" select="$is-attr"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="rng:anyName" mode="name-class">
-      <xsl:param name="is-attr"/>
-      <xsl:text>*</xsl:text>
-      <xsl:call-template name="nc-except">
-         <xsl:with-param name="is-attr" select="$is-attr"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="nc-except">
-      <xsl:param name="is-attr"/>
-      <xsl:for-each select="rng:except">
-         <xsl:text> - </xsl:text>
-         <xsl:choose>
-            <xsl:when test="count (rng:*) &gt; 1">
-               <xsl:text>(</xsl:text>
-               <xsl:call-template name="make-nc-choice">
-                  <xsl:with-param name="is-attr" select="$is-attr"/>
-               </xsl:call-template>
-               <xsl:text>)</xsl:text>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:apply-templates select="rng:*" mode="name-class">
-                  <xsl:with-param name="is-attr" select="$is-attr"/>
-               </xsl:apply-templates>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="rng:attribute/rng:choice | rng:element/rng:choice" mode="name-class"
-                 name="make-nc-choice">
-      <xsl:param name="is-attr"/>
-      <xsl:for-each select="rng:*">
-         <xsl:if test="position () != 1">
-            <xsl:text> | </xsl:text>
-         </xsl:if>
-         <xsl:apply-templates select="." mode="name-class">
-            <xsl:with-param name="is-attr" select="$is-attr"/>
-         </xsl:apply-templates>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="rng:choice" mode="name-class">
-      <xsl:param name="is-attr"/>
-      <xsl:text>(</xsl:text>
-      <xsl:call-template name="make-nc-choice">
-         <xsl:with-param name="is-attr" select="$is-attr"/>
-      </xsl:call-template>
-      <xsl:text>)</xsl:text>
-  </xsl:template>
-  <xsl:template name="make-name-nc">
-      <xsl:param name="is-attr"/>
-      <xsl:param name="name"/>
-      <xsl:variable name="ns" select="ancestor-or-self::rng:*[@ns][1]/@ns"/>
-      <xsl:choose>
-         <xsl:when test="not ($is-attr) and $has-default-ns and  $ns = $default-ns"/>
-         <xsl:when test="$is-attr and $ns = ''"/>
-         <xsl:when test="$is-attr and not($default-ns-id='') and $has-default-ns and $ns = $default-ns">
-            <xsl:value-of select="$default-ns-id"/>
-            <xsl:text>:</xsl:text>
-         </xsl:when>
-         <xsl:when test="string-length($ns)&gt;0">
-            <xsl:call-template name="get-prefix">
-               <xsl:with-param name="nd" select="$ns"/>
-            </xsl:call-template>
-            <xsl:text>:</xsl:text>
-         </xsl:when>
-         <!--
-      <xsl:when test="$is-attr or $has-default-ns">
-        <xsl:text>inh:</xsl:text>
-      </xsl:when>
--->
-    </xsl:choose>
-      <xsl:value-of select="$name"/>
-  </xsl:template>
-   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- Util -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-  <xsl:template name="last-token">
-      <xsl:param name="str"/>
-      <xsl:param name="pos" select="string-length ($str)"/>
-      <xsl:choose>
-         <xsl:when test="$pos = 0">
-            <xsl:value-of select="$str"/>
-         </xsl:when>
-         <xsl:when test="substring ($str, $pos, 1) = ' '">
-            <xsl:value-of select="substring ($str, $pos + 1)"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="last-token">
-               <xsl:with-param name="str" select="$str"/>
-               <xsl:with-param name="pos" select="$pos - 1"/>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:variable name="simple-prefix-map" select="concat (' ', $prefixes, ' ')"/>
-  <xsl:template name="mapped-prefix">
-      <xsl:param name="ns"/>
-      <xsl:variable name="simple-mapped"
-                    select="substring-before ($simple-prefix-map, concat ('=', $ns, ' '))"/>
-      <xsl:choose>
-         <xsl:when test="$simple-mapped">
-            <xsl:call-template name="last-token">
-               <xsl:with-param name="str" select="$simple-mapped"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="mapped" select="$prefix-map [string (.) = $ns][1]"/>
-            <xsl:if test="$mapped">
-               <xsl:value-of select="$mapped/@prefix"/>
-            </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="get-prefix">
-      <xsl:param name="nd" select="."/>
-      <xsl:variable name="ns" select="string ($nd)"/>
-      <xsl:variable name="mapped">
-         <xsl:call-template name="mapped-prefix">
-            <xsl:with-param name="ns" select="$ns"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="string ($mapped)">
-            <xsl:value-of select="$mapped"/>
-         </xsl:when>
-         <xsl:when test="not ($retain-prefixes)">
-            <xsl:value-of select="generate-id ($nd)"/>
-         </xsl:when>
-         <xsl:when test="key ('ns', $ns)">
-           <xsl:variable name="pfx" select="name ( (key ('ns', $ns)/namespace::*[. = $ns])[1] )"/>
-           <xsl:choose>
-               <xsl:when test="$pfx">
-                  <xsl:value-of select="$pfx"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="generate-id (key ('ns', $ns)[1])"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="generate-id ($nd)"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="spacer">
-      <xsl:if test="following-sibling::*">
-         <nl size="1"/>
-         <xsl:if test="not (parent::rng:include) and  not (parent::rng:grammar/../..) and   not (self::rng:include and   following-sibling::*[1][self::rng:include])">
-            <nl size="1"/>
-         </xsl:if>
-      </xsl:if>
-  </xsl:template>
-  <keywords xmlns="http://www.example.com">
-      <kw>attribute</kw>
-      <kw>default</kw>
-      <kw>datatypes</kw>
-      <kw>div</kw>
-      <kw>element</kw>
-      <kw>empty</kw>
-      <kw>external</kw>
-      <kw>grammar</kw>
-      <kw>include</kw>
-      <kw>inherit</kw>
-      <kw>list</kw>
-      <kw>mixed</kw>
-      <kw>namespace</kw>
-      <kw>notAllowed</kw>
-      <kw>parent</kw>
-      <kw>start</kw>
-      <kw>string</kw>
-      <kw>text</kw>
-      <kw>token</kw>
-  </keywords>
-  <xsl:variable xmlns:foo="http://www.example.com" name="keywords"  select="document ('')/*/foo:keywords/*"/>
-  <xsl:template name="quote-keyword">
-      <xsl:param name="name"/>
-      <xsl:if test="$name = $keywords">\</xsl:if>
-      <xsl:value-of select="$name"/>
-  </xsl:template>
-   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<!-- Annotations -->
-<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-  <xsl:template name="leading-documentation">
-      <xsl:param name="nd"/>
-      <!--
-    <xsl:choose>
-      <xsl:when test="not ($nd) or $nd/self::rng:*"/>
-
-      <xsl:when test="$nd/self::a:documentation">
-	<xsl:call-template name="doc-comment">
-	  <xsl:with-param name="comment" select="string ($nd)"/>
-	</xsl:call-template>
-	<nl size="1"/>
-	<xsl:call-template name="leading-documentation">
-	  <xsl:with-param name="nd" select="$nd/following-sibling::*[1]"/>
-	</xsl:call-template>
-      </xsl:when>
-
-      <xsl:otherwise>
-	<group>
-	  <t size="1">[</t>
-	  <indent>
-	    <xsl:call-template name="annotation-attributes"/>
-
-	    <xsl:call-template name="leading-annotations">
-	      <xsl:with-param name="nd" select="$nd"/>
-	    </xsl:call-template>
-	  </indent>
-	  <nl size="1"/>
-	  <t size="1">]</t>
-	</group>
-	<nl size="1"/>
-      </xsl:otherwise>
-    </xsl:choose>
--->
-  </xsl:template>
-  <xsl:template name="leading-annotations">
-      <xsl:param name="nd"/>
-      <xsl:if test="$nd and not ($nd/self::rng:*)">
-         <xsl:for-each select="$nd">
-            <xsl:call-template name="annotation-element"/>
-         </xsl:for-each>
-         <xsl:call-template name="leading-annotations">
-            <xsl:with-param name="nd" select="$nd/following-sibling::*[1]"/>
-         </xsl:call-template>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="annotations">
-<!--
-    <xsl:choose>
-      <xsl:when test="(self::rng:value or self::rng:param) and
-	following-sibling::*[1][not (self::rng:*)]">
-	<xsl:call-template name="leading-documentation">
-	  <xsl:with-param name="nd" select="following-sibling::*[1]"/>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:when test="*[1][not (self::rng:*)]">
-	<xsl:call-template name="leading-documentation">
-	  <xsl:with-param name="nd" select="*[1]"/>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:when test="@*[namespace-uri () != '']">
-	<group>
-	  <t size="1">[</t>
-	  <indent>
-	    <xsl:call-template name="annotation-attributes"/>
-	  </indent>
-	  <nl size="1"/>
-	  <t size="1">]</t>
-	</group>
-	<nl size="1"/>
-      </xsl:when>
-    </xsl:choose>
--->
-  </xsl:template>
-  <xsl:template name="doc-comment">
-      <xsl:param name="comment"/>
-      <!--
-    <xsl:if test="$comment">
-      <xsl:variable name="head" select="substring-before ($comment, '&#10;')"/>
-      <xsl:variable name="line">
-	<xsl:text>## </xsl:text>
-	<xsl:choose>
-	  <xsl:when test="$head">
-	    <xsl:value-of select="$head"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:value-of select="$comment"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:variable>
-      
-      <doc>
-	<xsl:call-template name="text">
-	  <xsl:with-param name="text" select="$line"/>
-	</xsl:call-template>
-      </doc>
-      <nl size="1"/>
-      <xsl:call-template name="doc-comment">
-	<xsl:with-param name="comment"
-	  select="substring-after ($comment, '&#10;')"/>
-      </xsl:call-template>
-    </xsl:if>
--->
-  </xsl:template>
-  <xsl:template match="rng:grammar/a:documentation | rng:div/a:documentation |     rng:include/a:documentation"
-                 priority="-15">
-      <xsl:if test="not (../../..) or        preceding-sibling::*[not (self::a:documentation)]">
-         <xsl:call-template name="annotation-element"/>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="rng:grammar/* | rng:div/* | rng:include/*" priority="-20">
-      <xsl:call-template name="annotation-element"/>
-  </xsl:template>
-  <xsl:template name="follow-annotations">
-      <xsl:param name="nd"
-                 select="self::*[not (self::rng:value or self::rng:param)]       /following-sibling::*[1][not (self::rng:*)]"/>
-      <xsl:if test="$nd">
-         <xsl:for-each select="$nd">
-            <nl size="1"/>
-            <xsl:call-template name="follow-annotation"/>
-            <xsl:call-template name="follow-annotations"/>
-         </xsl:for-each>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="rng:*" priority="-100" name="follow-annotation">
-      <xsl:if test="preceding-sibling::rng:*">
-         <t size="2">&gt;&gt;</t>
-         <xsl:call-template name="annotation-element"/>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="annotation-name">
-      <annot>
-         <xsl:call-template name="text">
-            <xsl:with-param name="text">
-               <xsl:variable name="ns" select="namespace-uri (.)"/>
-               <xsl:if test="not($ns='')">
-                  <xsl:variable name="mapped">
-                     <xsl:call-template name="mapped-prefix">
-                        <xsl:with-param name="ns" select="$ns"/>
-                     </xsl:call-template>
-                  </xsl:variable>
-                  <xsl:choose>
-                     <xsl:when test="string ($mapped)">
-                        <xsl:value-of select="$mapped"/>
-                     </xsl:when>
-                     <xsl:when test="$retain-prefixes">
-                       <xsl:variable name="pfx" select="name ( (key ('ns', $ns)/namespace::*[. = $ns])[1] )"/>
-                       <xsl:choose>
-                           <xsl:when test="$pfx">
-                              <xsl:value-of select="$pfx"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="generate-id (key ('ns', $ns)[1])"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="generate-id (key ('annot-ns', $ns)[1])"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-                  <xsl:text>:</xsl:text>
-               </xsl:if>
-               <xsl:value-of select="local-name (.)"/>
-            </xsl:with-param>
-         </xsl:call-template>
-      </annot>
-  </xsl:template>
-  <xsl:template name="annotation-attributes">
-      <xsl:for-each select="@*[namespace-uri () != '']">
-         <nl size="1"/>
-         <xsl:call-template name="annotation-name"/>
-         <t size="3"> = </t>
-         <xsl:call-template name="make-string-literal"/>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="rng:*" name="annotation-element" mode="annot">
-      <nl size="1"/>
-      <group>
-         <xsl:call-template name="annotation-name"/>
-         <nl size="1"/>
-         <t size="1">[</t>
-         <indent>
-            <xsl:for-each select="@*">
-               <nl size="1"/>
-               <xsl:call-template name="annotation-name"/>
-               <t size="3"> = </t>
-               <xsl:call-template name="make-string-literal"/>
-            </xsl:for-each>
-            <xsl:apply-templates mode="annot"/>
-         </indent>
-         <nl size="1"/>
-         <t size="1">]</t>
-      </group>
-      <xsl:if test="following-sibling::*">
-         <xsl:if test="parent::rng:grammar or parent::rng:div or   parent::rng:include">
-            <nl size="1"/>
-            <xsl:if test="following-sibling::*[1][self::rng:*]">
-               <nl size="1"/>
-            </xsl:if>
-         </xsl:if>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="text ()" mode="annot">
-      <nl size="1"/>
-      <xsl:call-template name="make-string-literal"/>
-  </xsl:template>
-  <xsl:template name="make-body-from-r-t-f">
-      <xsl:param name="schema"/>
-      <xsl:for-each select="$schema">
-         <xsl:call-template name="make-body"/>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="make-body">
-      <xsl:apply-templates mode="keep"/>
-  </xsl:template>
-  <xsl:template match="group" mode="keep">
-      <xsl:choose>
-         <xsl:when test="  not ($collapse-lines) or   @collapse = 'no' or  .//doc or   .//group [@collapse = 'no']">
-            <xsl:apply-templates mode="keep"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="size" select="sum (.//*/@size)"/>
-            <xsl:variable name="level" select="count (ancestor::indent)"/>
-            <xsl:choose>
-               <xsl:when test="$line-width &gt; ($size + ($level * $indent-width))">
-                  <xsl:apply-templates mode="flatten"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:apply-templates mode="keep"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="sp" mode="keep">
-      <xsl:text> </xsl:text>
-  </xsl:template>
-  <xsl:variable name="spaces"
-                 select="concat (     '                                        ',     '                                        '     )"/>
-  <xsl:template match="nl" mode="keep">
-      <xsl:text>&#10;</xsl:text>
-      <xsl:variable name="level" select="count (ancestor::indent)"/>
-      <xsl:variable name="following-op" select="following-sibling::*[1][self::op]"/>
-      <xsl:choose>
-         <xsl:when test="$following-op">
-            <xsl:value-of select="substring ($spaces, 1,     $level * $indent-width - $following-op/@size)"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="substring ($spaces, 1, $level * $indent-width)"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="sp | nl" mode="flatten">
-      <xsl:text> </xsl:text>
-  </xsl:template>
-  <xsl:template match="ref" mode="flatten">
-      <xsl:variable name="me">
-         <xsl:choose>
-            <xsl:when test="contains(@name,'.attributes')">
-               <xsl:value-of select="substring-before(@name,'.attributes')"/>
-            </xsl:when>
-            <xsl:when test="contains(@name,'.content')">
-               <xsl:value-of select="substring-before(.,'.content')"/>
-            </xsl:when>
-            <xsl:when test="contains(@name,'.attribute.')">
-               <xsl:value-of select="substring-before(@name,'.attribute.')"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="@name"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <!--
-<xsl:message>FROM <xsl:value-of select="@name"/> to <xsl:value-of
-    select="$me"/>, <xsl:for-each select="$top"><xsl:value-of 
-select="count(key('IDENTS',$me))"/></xsl:for-each></xsl:message>
--->
-    <xsl:variable name="n" select="@name"/>
-      <xsl:choose>
-         <xsl:when test="contains(.,'.localattributes')">
-            <xsl:value-of select="$n"/>
-         </xsl:when>
-         <xsl:when test="contains(@name,'.content')">
-            <xsl:value-of select="$n"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:for-each select="$top">
-               <xsl:call-template name="linkTogether">
-                  <xsl:with-param name="name">
-                     <xsl:value-of select="$me"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="reftext">
-                     <xsl:value-of select="$n"/>
-                  </xsl:with-param>
-               </xsl:call-template>
-            </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	</xsl:template>
+	<xsl:template match="rng:choice" mode="RNC"
+		name="make-choice">
+		<xsl:call-template name="expression">
+			<xsl:with-param name="operator" select="'| '" />
+			<xsl:with-param name="is-prefix-operator"
+				select="true ()" />
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="rng:interleave" mode="RNC">
+		<xsl:call-template name="expression">
+			<xsl:with-param name="operator" select="'&amp; '" />
+			<xsl:with-param name="is-prefix-operator"
+				select="true ()" />
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="rng:optional" mode="RNC">
+		<xsl:call-template name="expression">
+			<xsl:with-param name="operator" select="','" />
+		</xsl:call-template>
+		<t size="1">?</t>
+	</xsl:template>
+	<xsl:template match="rng:zeroOrMore" mode="RNC">
+		<xsl:call-template name="expression">
+			<xsl:with-param name="operator" select="','" />
+		</xsl:call-template>
+		<t size="1">*</t>
+	</xsl:template>
+	<xsl:template match="rng:oneOrMore" mode="RNC">
+		<xsl:call-template name="expression">
+			<xsl:with-param name="operator" select="','" />
+		</xsl:call-template>
+		<t size="1">+</t>
+	</xsl:template>
+	<xsl:template match="rng:text" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<atom size="4">text</atom>
+		</group>
+	</xsl:template>
+	<xsl:template match="rng:empty" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<atom size="5">empty</atom>
+		</group>
+	</xsl:template>
+	<xsl:template match="rng:notAllowed" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<atom size="10">notAllowed</atom>
+		</group>
+	</xsl:template>
+	<xsl:template match="rng:data" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<group>
+				<xsl:call-template name="type-name" />
+				<xsl:if test="rng:param">
+					<nl size="1" />
+					<t size="1">{</t>
+					<indent>
+						<xsl:for-each select="rng:param">
+							<nl size="1" />
+							<group>
+								<xsl:call-template name="annotations" />
+								<param>
+									<xsl:call-template name="text">
+										<xsl:with-param name="text" select="@name" />
+									</xsl:call-template>
+								</param>
+								<t size="3"> = </t>
+								<xsl:call-template name="make-string-literal" />
+							</group>
+						</xsl:for-each>
+					</indent>
+					<nl size="1" />
+					<t size="1">}</t>
+				</xsl:if>
+				<xsl:for-each select="rng:except">
+					<nl size="1" />
+					<t size="1">-</t>
+					<nl size="1" />
+					<xsl:choose>
+						<xsl:when test="count (rng:*) &gt; 1">
+							<xsl:call-template name="make-choice" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates select="*" mode="RNC" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</group>
+		</group>
+	</xsl:template>
+	<xsl:template match="rng:value" mode="RNC">
+		<group>
+			<xsl:call-template name="annotations" />
+			<xsl:variable name="type">
+				<xsl:call-template name="type-name" />
+			</xsl:variable>
+			<xsl:if test="$type != 'token'">
+				<xsl:copy-of select="$type" />
+				<sp size="1" />
+			</xsl:if>
+			<xsl:call-template name="make-string-literal" />
+		</group>
+	</xsl:template>
+	<xsl:template name="quote-quotes">
+		<xsl:param name="str" />
+		<xsl:param name="pos" select="1" />
+		<xsl:variable name="c" select="substring ($str, $pos, 1)" />
+		<xsl:if test="$c">
+			<xsl:choose>
+				<xsl:when test="$c = '&#34;'">
+					" '"' "
+				</xsl:when>
+				<xsl:when test="$c = '&#xA;'">
+					\x{A}
+				</xsl:when>
+				<xsl:when test="$c = '&#xD;'">
+					\x{D}
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$c" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:call-template name="quote-quotes">
+				<xsl:with-param name="str" select="$str" />
+				<xsl:with-param name="pos" select="$pos + 1" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="make-string-literal">
+		<xsl:choose>
+			<xsl:when
+				test="not (contains (., '&#34;') or   contains (., &#34;'&#34;) or   contains (., '&#xA;') or contains (., '&#xD;'))">
+				<xsl:call-template name="str">
+					<xsl:with-param name="text" select="." />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not (contains (., '&#34;&#34;&#34;'))">
+				<xsl:call-template name="str">
+					<xsl:with-param name="quote"
+						select="'&#34;&#34;&#34;'" />
+					<xsl:with-param name="text" select="." />
+					<xsl:with-param name="is-multiline" select="true ()" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not (contains (., &#34;'''&#34;))">
+				<xsl:call-template name="str">
+					<xsl:with-param name="quote">
+						'''
+					</xsl:with-param>
+					<xsl:with-param name="text" select="." />
+					<xsl:with-param name="is-multiline" select="true ()" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="str">
+					<xsl:with-param name="text">
+						<xsl:call-template name="quote-quotes">
+							<xsl:with-param name="str" select="." />
+						</xsl:call-template>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="type-name">
+		<xsl:variable name="dt"
+			select="ancestor-or-self::rng:*[@datatypeLibrary][1]/@datatypeLibrary" />
+		<xsl:variable name="dts" select="string ($dt)" />
+		<type>
+			<xsl:call-template name="text">
+				<xsl:with-param name="text">
+					<xsl:choose>
+						<xsl:when test="self::rng:value and not (@type)">
+							token
+						</xsl:when>
+						<xsl:when test="$dts = '' and @type= 'string'">
+							string
+						</xsl:when>
+						<xsl:when test="$dts = '' and @type= 'token'">
+							token
+						</xsl:when>
+						<xsl:when test="$dts = ''">
+							<xsl:text>xsd:</xsl:text>
+							<xsl:value-of select="@type" />
+						</xsl:when>
+						<xsl:when test="$dts = $xsd">
+							<xsl:text>xsd:</xsl:text>
+							<xsl:value-of select="@type" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="generate-id ($dt)" />
+							<xsl:text>:</xsl:text>
+							<xsl:value-of select="@type" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+			</xsl:call-template>
+		</type>
+	</xsl:template>
+	<xsl:template name="need-paren">
+		<xsl:choose>
+			<xsl:when
+				test="self::rng:optional or  self::rng:zeroOrMore or  self::rng:oneOrMore">
+				<xsl:if test="count (rng:*) &gt; 1">
+					true
+				</xsl:if>
+			</xsl:when>
+			<xsl:when
+				test="parent::rng:element[not (@name)] or   parent::rng:attribute [not (@name)]">
+				<xsl:if test="count (../rng:*) &gt; 2">
+					true
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="count (../rng:*) &gt; 1">
+				true
+			</xsl:when>
+			<xsl:when
+				test="count (rng:*) &gt; 1 and (parent::rng:optional or   parent::rng:zeroOrMore or parent::rng:oneOrMore)">
+				true
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="expression-body">
+		<xsl:param name="patterns" select="rng:*" />
+		<xsl:param name="operator" />
+		<xsl:param name="is-prefix-operator" select="false ()" />
+		<xsl:choose>
+			<xsl:when test="$is-prefix-operator">
+				<xsl:for-each select="$patterns">
+					<xsl:if test="position () != 1">
+						<nl size="1" />
+						<op size="{string-length ($operator)}">
+							<xsl:value-of select="$operator" />
+						</op>
+					</xsl:if>
+					<xsl:apply-templates select="." mode="RNC" />
+					<xsl:call-template name="follow-annotations" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="$patterns">
+					<xsl:if test="position () != 1">
+						<op size="{string-length ($operator)}">
+							<xsl:value-of select="$operator" />
+						</op>
+						<nl size="1" />
+					</xsl:if>
+					<xsl:apply-templates select="." mode="RNC" />
+					<xsl:call-template name="follow-annotations" />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="group-body">
+		<xsl:param name="patterns" select="rng:*" />
+		<xsl:call-template name="expression-body">
+			<xsl:with-param name="patterns" select="$patterns" />
+			<xsl:with-param name="operator" select="','" />
+		</xsl:call-template>
+	</xsl:template>
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- Name class -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<xsl:template name="name-class">
+		<xsl:param name="is-attr" select="false ()" />
+		<nc>
+			<xsl:call-template name="text">
+				<xsl:with-param name="text">
+					<xsl:choose>
+						<xsl:when test="@name">
+							<xsl:choose>
+								<xsl:when
+									test="not ($is-attr) and not (contains (@name, ':'))">
+									<xsl:call-template name="make-name-nc">
+										<xsl:with-param name="name" select="@name" />
+										<xsl:with-param name="is-attr"
+											select="false ()" />
+									</xsl:call-template>
+								</xsl:when>
+								<xsl:when test="@ns">
+									<xsl:text>[</xsl:text>
+									<xsl:value-of select="@ns" />
+									<xsl:text>]</xsl:text>
+									<xsl:value-of select="@name" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@name" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates select="rng:*[1]"
+								mode="name-class">
+								<xsl:with-param name="is-attr" select="$is-attr" />
+							</xsl:apply-templates>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+			</xsl:call-template>
+		</nc>
+	</xsl:template>
+	<xsl:template match="rng:name" mode="name-class">
+		<xsl:param name="is-attr" />
+		<xsl:call-template name="make-name-nc">
+			<xsl:with-param name="name" select="." />
+			<xsl:with-param name="is-attr" select="$is-attr" />
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="rng:nsName" mode="name-class">
+		<xsl:param name="is-attr" />
+		<xsl:variable name="ns"
+			select="ancestor-or-self::rng:*[@ns][1]/@ns" />
+		<xsl:choose>
+			<xsl:when test="$has-default-ns and $ns = $default-ns">
+				<xsl:value-of select="$default-ns-id" />
+			</xsl:when>
+			<xsl:when test="$has-local and $ns = ''">
+				local
+			</xsl:when>
+			<xsl:when test="not($ns='')">
+				<xsl:call-template name="get-prefix">
+					<xsl:with-param name="nd" select="$ns" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>inh</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>:*</xsl:text>
+		<xsl:call-template name="nc-except">
+			<xsl:with-param name="is-attr" select="$is-attr" />
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="rng:anyName" mode="name-class">
+		<xsl:param name="is-attr" />
+		<xsl:text>*</xsl:text>
+		<xsl:call-template name="nc-except">
+			<xsl:with-param name="is-attr" select="$is-attr" />
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="nc-except">
+		<xsl:param name="is-attr" />
+		<xsl:for-each select="rng:except">
+			<xsl:text> - </xsl:text>
+			<xsl:choose>
+				<xsl:when test="count (rng:*) &gt; 1">
+					<xsl:text>(</xsl:text>
+					<xsl:call-template name="make-nc-choice">
+						<xsl:with-param name="is-attr" select="$is-attr" />
+					</xsl:call-template>
+					<xsl:text>)</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="rng:*"
+						mode="name-class">
+						<xsl:with-param name="is-attr" select="$is-attr" />
+					</xsl:apply-templates>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template
+		match="rng:attribute/rng:choice | rng:element/rng:choice"
+		mode="name-class" name="make-nc-choice">
+		<xsl:param name="is-attr" />
+		<xsl:for-each select="rng:*">
+			<xsl:if test="position () != 1">
+				<xsl:text> | </xsl:text>
+			</xsl:if>
+			<xsl:apply-templates select="." mode="name-class">
+				<xsl:with-param name="is-attr" select="$is-attr" />
+			</xsl:apply-templates>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="rng:choice" mode="name-class">
+		<xsl:param name="is-attr" />
+		<xsl:text>(</xsl:text>
+		<xsl:call-template name="make-nc-choice">
+			<xsl:with-param name="is-attr" select="$is-attr" />
+		</xsl:call-template>
+		<xsl:text>)</xsl:text>
+	</xsl:template>
+	<xsl:template name="make-name-nc">
+		<xsl:param name="is-attr" />
+		<xsl:param name="name" />
+		<xsl:variable name="ns"
+			select="ancestor-or-self::rng:*[@ns][1]/@ns" />
+		<xsl:choose>
+			<xsl:when
+				test="not ($is-attr) and $has-default-ns and  $ns = $default-ns" />
+			<xsl:when test="$is-attr and $ns = ''" />
+			<xsl:when
+				test="$is-attr and not($default-ns-id='') and $has-default-ns and $ns = $default-ns">
+				<xsl:value-of select="$default-ns-id" />
+				<xsl:text>:</xsl:text>
+			</xsl:when>
+			<xsl:when test="string-length($ns)&gt;0">
+				<xsl:call-template name="get-prefix">
+					<xsl:with-param name="nd" select="$ns" />
+				</xsl:call-template>
+				<xsl:text>:</xsl:text>
+			</xsl:when>
+			<!-- <xsl:when test="$is-attr or $has-default-ns"> <xsl:text>inh:</xsl:text> 
+				</xsl:when> -->
+		</xsl:choose>
+		<xsl:value-of select="$name" />
+	</xsl:template>
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- Util -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<xsl:template name="last-token">
+		<xsl:param name="str" />
+		<xsl:param name="pos" select="string-length ($str)" />
+		<xsl:choose>
+			<xsl:when test="$pos = 0">
+				<xsl:value-of select="$str" />
+			</xsl:when>
+			<xsl:when test="substring ($str, $pos, 1) = ' '">
+				<xsl:value-of select="substring ($str, $pos + 1)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="last-token">
+					<xsl:with-param name="str" select="$str" />
+					<xsl:with-param name="pos" select="$pos - 1" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:variable name="simple-prefix-map"
+		select="concat (' ', $prefixes, ' ')" />
+	<xsl:template name="mapped-prefix">
+		<xsl:param name="ns" />
+		<xsl:variable name="simple-mapped"
+			select="substring-before ($simple-prefix-map, concat ('=', $ns, ' '))" />
+		<xsl:choose>
+			<xsl:when test="$simple-mapped">
+				<xsl:call-template name="last-token">
+					<xsl:with-param name="str" select="$simple-mapped" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="mapped"
+					select="$prefix-map [string (.) = $ns][1]" />
+				<xsl:if test="$mapped">
+					<xsl:value-of select="$mapped/@prefix" />
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="get-prefix">
+		<xsl:param name="nd" select="." />
+		<xsl:variable name="ns" select="string ($nd)" />
+		<xsl:variable name="mapped">
+			<xsl:call-template name="mapped-prefix">
+				<xsl:with-param name="ns" select="$ns" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="string ($mapped)">
+				<xsl:value-of select="$mapped" />
+			</xsl:when>
+			<xsl:when test="not ($retain-prefixes)">
+				<xsl:value-of select="generate-id ($nd)" />
+			</xsl:when>
+			<xsl:when test="key ('ns', $ns)">
+				<xsl:variable name="pfx"
+					select="name ( (key ('ns', $ns)/namespace::*[. = $ns])[1] )" />
+				<xsl:choose>
+					<xsl:when test="$pfx">
+						<xsl:value-of select="$pfx" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of
+							select="generate-id (key ('ns', $ns)[1])" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="generate-id ($nd)" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="spacer">
+		<xsl:if test="following-sibling::*">
+			<nl size="1" />
+			<xsl:if
+				test="not (parent::rng:include) and  not (parent::rng:grammar/../..) and   not (self::rng:include and   following-sibling::*[1][self::rng:include])">
+				<nl size="1" />
+			</xsl:if>
+		</xsl:if>
+	</xsl:template>
+	<keywords xmlns="http://www.example.com">
+		<kw>attribute</kw>
+		<kw>default</kw>
+		<kw>datatypes</kw>
+		<kw>div</kw>
+		<kw>element</kw>
+		<kw>empty</kw>
+		<kw>external</kw>
+		<kw>grammar</kw>
+		<kw>include</kw>
+		<kw>inherit</kw>
+		<kw>list</kw>
+		<kw>mixed</kw>
+		<kw>namespace</kw>
+		<kw>notAllowed</kw>
+		<kw>parent</kw>
+		<kw>start</kw>
+		<kw>string</kw>
+		<kw>text</kw>
+		<kw>token</kw>
+	</keywords>
+	<xsl:variable xmlns:foo="http://www.example.com"
+		name="keywords" select="document ('')/*/foo:keywords/*" />
+	<xsl:template name="quote-keyword">
+		<xsl:param name="name" />
+		<xsl:if test="$name = $keywords">
+			\
+		</xsl:if>
+		<xsl:value-of select="$name" />
+	</xsl:template>
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<!-- Annotations -->
+	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	<xsl:template name="leading-documentation">
+		<xsl:param name="nd" />
+		<!-- <xsl:choose> <xsl:when test="not ($nd) or $nd/self::rng:*"/> <xsl:when 
+			test="$nd/self::a:documentation"> <xsl:call-template name="doc-comment"> 
+			<xsl:with-param name="comment" select="string ($nd)"/> </xsl:call-template> 
+			<nl size="1"/> <xsl:call-template name="leading-documentation"> <xsl:with-param 
+			name="nd" select="$nd/following-sibling::*[1]"/> </xsl:call-template> </xsl:when> 
+			<xsl:otherwise> <group> <t size="1">[</t> <indent> <xsl:call-template name="annotation-attributes"/> 
+			<xsl:call-template name="leading-annotations"> <xsl:with-param name="nd" 
+			select="$nd"/> </xsl:call-template> </indent> <nl size="1"/> <t size="1">]</t> 
+			</group> <nl size="1"/> </xsl:otherwise> </xsl:choose> -->
+	</xsl:template>
+	<xsl:template name="leading-annotations">
+		<xsl:param name="nd" />
+		<xsl:if test="$nd and not ($nd/self::rng:*)">
+			<xsl:for-each select="$nd">
+				<xsl:call-template name="annotation-element" />
+			</xsl:for-each>
+			<xsl:call-template name="leading-annotations">
+				<xsl:with-param name="nd"
+					select="$nd/following-sibling::*[1]" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="annotations">
+		<!-- <xsl:choose> <xsl:when test="(self::rng:value or self::rng:param) 
+			and following-sibling::*[1][not (self::rng:*)]"> <xsl:call-template name="leading-documentation"> 
+			<xsl:with-param name="nd" select="following-sibling::*[1]"/> </xsl:call-template> 
+			</xsl:when> <xsl:when test="*[1][not (self::rng:*)]"> <xsl:call-template 
+			name="leading-documentation"> <xsl:with-param name="nd" select="*[1]"/> </xsl:call-template> 
+			</xsl:when> <xsl:when test="@*[namespace-uri () != '']"> <group> <t size="1">[</t> 
+			<indent> <xsl:call-template name="annotation-attributes"/> </indent> <nl 
+			size="1"/> <t size="1">]</t> </group> <nl size="1"/> </xsl:when> </xsl:choose> -->
+	</xsl:template>
+	<xsl:template name="doc-comment">
+		<xsl:param name="comment" />
+		<!-- <xsl:if test="$comment"> <xsl:variable name="head" select="substring-before 
+			($comment, '&#10;')"/> <xsl:variable name="line"> <xsl:text>## </xsl:text> 
+			<xsl:choose> <xsl:when test="$head"> <xsl:value-of select="$head"/> </xsl:when> 
+			<xsl:otherwise> <xsl:value-of select="$comment"/> </xsl:otherwise> </xsl:choose> 
+			</xsl:variable> <doc> <xsl:call-template name="text"> <xsl:with-param name="text" 
+			select="$line"/> </xsl:call-template> </doc> <nl size="1"/> <xsl:call-template 
+			name="doc-comment"> <xsl:with-param name="comment" select="substring-after 
+			($comment, '&#10;')"/> </xsl:call-template> </xsl:if> -->
+	</xsl:template>
+	<xsl:template
+		match="rng:grammar/a:documentation | rng:div/a:documentation |     rng:include/a:documentation"
+		priority="-15">
+		<xsl:if
+			test="not (../../..) or        preceding-sibling::*[not (self::a:documentation)]">
+			<xsl:call-template name="annotation-element" />
+		</xsl:if>
+	</xsl:template>
+	<xsl:template
+		match="rng:grammar/* | rng:div/* | rng:include/*" priority="-20">
+		<xsl:call-template name="annotation-element" />
+	</xsl:template>
+	<xsl:template name="follow-annotations">
+		<xsl:param name="nd"
+			select="self::*[not (self::rng:value or self::rng:param)]       /following-sibling::*[1][not (self::rng:*)]" />
+		<xsl:if test="$nd">
+			<xsl:for-each select="$nd">
+				<nl size="1" />
+				<xsl:call-template name="follow-annotation" />
+				<xsl:call-template name="follow-annotations" />
+			</xsl:for-each>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="rng:*" priority="-100"
+		name="follow-annotation">
+		<xsl:if test="preceding-sibling::rng:*">
+			<t size="2">&gt;&gt;</t>
+			<xsl:call-template name="annotation-element" />
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="annotation-name">
+		<annot>
+			<xsl:call-template name="text">
+				<xsl:with-param name="text">
+					<xsl:variable name="ns" select="namespace-uri (.)" />
+					<xsl:if test="not($ns='')">
+						<xsl:variable name="mapped">
+							<xsl:call-template name="mapped-prefix">
+								<xsl:with-param name="ns" select="$ns" />
+							</xsl:call-template>
+						</xsl:variable>
+						<xsl:choose>
+							<xsl:when test="string ($mapped)">
+								<xsl:value-of select="$mapped" />
+							</xsl:when>
+							<xsl:when test="$retain-prefixes">
+								<xsl:variable name="pfx"
+									select="name ( (key ('ns', $ns)/namespace::*[. = $ns])[1] )" />
+								<xsl:choose>
+									<xsl:when test="$pfx">
+										<xsl:value-of select="$pfx" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="generate-id (key ('ns', $ns)[1])" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of
+									select="generate-id (key ('annot-ns', $ns)[1])" />
+							</xsl:otherwise>
+						</xsl:choose>
+						<xsl:text>:</xsl:text>
+					</xsl:if>
+					<xsl:value-of select="local-name (.)" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</annot>
+	</xsl:template>
+	<xsl:template name="annotation-attributes">
+		<xsl:for-each select="@*[namespace-uri () != '']">
+			<nl size="1" />
+			<xsl:call-template name="annotation-name" />
+			<t size="3"> = </t>
+			<xsl:call-template name="make-string-literal" />
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="rng:*" name="annotation-element"
+		mode="annot">
+		<nl size="1" />
+		<group>
+			<xsl:call-template name="annotation-name" />
+			<nl size="1" />
+			<t size="1">[</t>
+			<indent>
+				<xsl:for-each select="@*">
+					<nl size="1" />
+					<xsl:call-template name="annotation-name" />
+					<t size="3"> = </t>
+					<xsl:call-template name="make-string-literal" />
+				</xsl:for-each>
+				<xsl:apply-templates mode="annot" />
+			</indent>
+			<nl size="1" />
+			<t size="1">]</t>
+		</group>
+		<xsl:if test="following-sibling::*">
+			<xsl:if
+				test="parent::rng:grammar or parent::rng:div or   parent::rng:include">
+				<nl size="1" />
+				<xsl:if test="following-sibling::*[1][self::rng:*]">
+					<nl size="1" />
+				</xsl:if>
+			</xsl:if>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="text ()" mode="annot">
+		<nl size="1" />
+		<xsl:call-template name="make-string-literal" />
+	</xsl:template>
+	<xsl:template name="make-body-from-r-t-f">
+		<xsl:param name="schema" />
+		<xsl:for-each select="$schema">
+			<xsl:call-template name="make-body" />
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="make-body">
+		<xsl:apply-templates mode="keep" />
+	</xsl:template>
+	<xsl:template match="group" mode="keep">
+		<xsl:choose>
+			<xsl:when
+				test="  not ($collapse-lines) or   @collapse = 'no' or  .//doc or   .//group [@collapse = 'no']">
+				<xsl:apply-templates mode="keep" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="size" select="sum (.//*/@size)" />
+				<xsl:variable name="level"
+					select="count (ancestor::indent)" />
+				<xsl:choose>
+					<xsl:when
+						test="$line-width &gt; ($size + ($level * $indent-width))">
+						<xsl:apply-templates mode="flatten" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates mode="keep" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="sp" mode="keep">
+		<xsl:text> </xsl:text>
+	</xsl:template>
+	<xsl:variable name="spaces"
+		select="concat (     '                                        ',     '                                        '     )" />
+	<xsl:template match="nl" mode="keep">
+		<xsl:text>&#10;</xsl:text>
+		<xsl:variable name="level"
+			select="count (ancestor::indent)" />
+		<xsl:variable name="following-op"
+			select="following-sibling::*[1][self::op]" />
+		<xsl:choose>
+			<xsl:when test="$following-op">
+				<xsl:value-of
+					select="substring ($spaces, 1,     $level * $indent-width - $following-op/@size)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="substring ($spaces, 1, $level * $indent-width)" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="sp | nl" mode="flatten">
+		<xsl:text> </xsl:text>
+	</xsl:template>
+	<xsl:template match="ref" mode="flatten">
+		<xsl:variable name="me">
+			<xsl:choose>
+				<xsl:when test="contains(@name,'.attributes')">
+					<xsl:value-of
+						select="substring-before(@name,'.attributes')" />
+				</xsl:when>
+				<xsl:when test="contains(@name,'.content')">
+					<xsl:value-of select="substring-before(.,'.content')" />
+				</xsl:when>
+				<xsl:when test="contains(@name,'.attribute.')">
+					<xsl:value-of
+						select="substring-before(@name,'.attribute.')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@name" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<!-- <xsl:message>FROM <xsl:value-of select="@name"/> to <xsl:value-of 
+			select="$me"/>, <xsl:for-each select="$top"><xsl:value-of select="count(key('IDENTS',$me))"/></xsl:for-each></xsl:message> -->
+		<xsl:variable name="n" select="@name" />
+		<xsl:choose>
+			<xsl:when test="contains(.,'.localattributes')">
+				<xsl:value-of select="$n" />
+			</xsl:when>
+			<xsl:when test="contains(@name,'.content')">
+				<xsl:value-of select="$n" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="$top">
+					<xsl:call-template name="linkTogether">
+						<xsl:with-param name="name">
+							<xsl:value-of select="$me" />
+						</xsl:with-param>
+						<xsl:with-param name="reftext">
+							<xsl:value-of select="$n" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 </xsl:transform>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2html.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2html.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2html.xsl	(revision 2397)
@@ -1,217 +1,302 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:s="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dbk="http://docbook.org/ns/docbook" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" exclude-result-prefixes="xlink dbk rng tei teix s xhtml sch a html xs xsl">
-  <xsl:import href="teiodds.xsl"/>
-  <xsl:import href="../xhtml2/tei.xsl"/>
-  <xsl:import href="../xhtml2/oddprocessing.xsl"/>
+<xsl:stylesheet
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:dbk="http://docbook.org/ns/docbook"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="xlink dbk rng tei teix s xhtml sch a html xs xsl">
+	<xsl:import href="teiodds.xsl" />
+	<xsl:import href="../xhtml2/tei.xsl" />
+	<xsl:import href="../xhtml2/oddprocessing.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for making HTML from ODD </p>
-      <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making HTML from ODD </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: odd2html.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:output method="xml" encoding="utf-8"/>
-  <xsl:param name="BITS">Bits</xsl:param>
-  <xsl:param name="STDOUT">true</xsl:param>
-  <xsl:param name="TAG"/>
-  <xsl:param name="alignNavigationPanel">left</xsl:param>
-  <xsl:param name="authorWord"/>
-  <xsl:param name="autoToc">true</xsl:param>
-  <xsl:param name="bottomNavigationPanel">true</xsl:param>
-  <xsl:param
-      name="cssFile">http://www.tei-c.org/release/xml/tei/stylesheet/tei.css</xsl:param>
-  <xsl:param name="dateWord"/>
-  <xsl:param name="displayMode">rnc</xsl:param>
-  <xsl:param name="feedbackWords">Contact</xsl:param>
-  <xsl:param name="footnoteBackLink">true</xsl:param>
-  <xsl:param name="footnoteFile">false</xsl:param>
-  <xsl:param name="homeURL">index.html</xsl:param>
-  <xsl:param name="indent-width" select="3"/>
-  <xsl:param name="line-width" select="80"/>
-  <xsl:param name="numberBackHeadings">A.1</xsl:param>
-  <xsl:param name="numberFrontHeadings"/>
-  <xsl:param name="pageLayout">Simple</xsl:param>
-  <xsl:param name="prenumberedHeadings">false</xsl:param>
-  <xsl:param name="searchURL"/>
-  <xsl:param name="searchWords"/>
-  <xsl:param name="showNamespaceDecls">false</xsl:param>
-  <xsl:param name="showTitleAuthor">1</xsl:param>
-  <xsl:param name="splitBackmatter">yes</xsl:param>
-  <xsl:param name="splitFrontmatter">yes</xsl:param>
-  <xsl:param name="splitLevel">-1</xsl:param>
-  <xsl:param name="subTocDepth">-1</xsl:param>
-  <xsl:param name="tocDepth">3</xsl:param>
-  <xsl:param name="tocElement">div</xsl:param>
-  <xsl:param name="topNavigationPanel"/>
-  <xsl:param name="useHeaderFrontMatter">true</xsl:param>
-  <xsl:param name="verbose">false</xsl:param>
-  <xsl:param name="doctypePublic">-//W3C//DTD XHTML 1.1//EN</xsl:param>
-  <xsl:param name="doctypeSystem">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</xsl:param>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <!-- these are ones to override -->
-  <xsl:param name="feedbackURL">#</xsl:param>
-  <xsl:param name="homeLabel">Home</xsl:param>
-  <xsl:param name="homeWords">Home</xsl:param>
-  <xsl:param name="institution"/>
-  <xsl:param name="outputDir"/>
-  <xsl:param name="parentURL">http://www.example.com/</xsl:param>
-  <xsl:param name="parentWords"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: odd2html.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output method="xml" encoding="utf-8" />
+	<xsl:param name="BITS">
+		Bits
+	</xsl:param>
+	<xsl:param name="STDOUT">
+		true
+	</xsl:param>
+	<xsl:param name="TAG" />
+	<xsl:param name="alignNavigationPanel">
+		left
+	</xsl:param>
+	<xsl:param name="authorWord" />
+	<xsl:param name="autoToc">
+		true
+	</xsl:param>
+	<xsl:param name="bottomNavigationPanel">
+		true
+	</xsl:param>
+	<xsl:param name="cssFile">
+		http://www.tei-c.org/release/xml/tei/stylesheet/tei.css
+	</xsl:param>
+	<xsl:param name="dateWord" />
+	<xsl:param name="displayMode">
+		rnc
+	</xsl:param>
+	<xsl:param name="feedbackWords">
+		Contact
+	</xsl:param>
+	<xsl:param name="footnoteBackLink">
+		true
+	</xsl:param>
+	<xsl:param name="footnoteFile">
+		false
+	</xsl:param>
+	<xsl:param name="homeURL">
+		index.html
+	</xsl:param>
+	<xsl:param name="indent-width" select="3" />
+	<xsl:param name="line-width" select="80" />
+	<xsl:param name="numberBackHeadings">
+		A.1
+	</xsl:param>
+	<xsl:param name="numberFrontHeadings" />
+	<xsl:param name="pageLayout">
+		Simple
+	</xsl:param>
+	<xsl:param name="prenumberedHeadings">
+		false
+	</xsl:param>
+	<xsl:param name="searchURL" />
+	<xsl:param name="searchWords" />
+	<xsl:param name="showNamespaceDecls">
+		false
+	</xsl:param>
+	<xsl:param name="showTitleAuthor">
+		1
+	</xsl:param>
+	<xsl:param name="splitBackmatter">
+		yes
+	</xsl:param>
+	<xsl:param name="splitFrontmatter">
+		yes
+	</xsl:param>
+	<xsl:param name="splitLevel">
+		-1
+	</xsl:param>
+	<xsl:param name="subTocDepth">
+		-1
+	</xsl:param>
+	<xsl:param name="tocDepth">
+		3
+	</xsl:param>
+	<xsl:param name="tocElement">
+		div
+	</xsl:param>
+	<xsl:param name="topNavigationPanel" />
+	<xsl:param name="useHeaderFrontMatter">
+		true
+	</xsl:param>
+	<xsl:param name="verbose">
+		false
+	</xsl:param>
+	<xsl:param name="doctypePublic">
+		-//W3C//DTD XHTML 1.1//EN
+	</xsl:param>
+	<xsl:param name="doctypeSystem">
+		http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
+	</xsl:param>
 
-  <xsl:template name="copyrightStatement"/>
+	<!-- these are ones to override -->
+	<xsl:param name="feedbackURL">
+		#
+	</xsl:param>
+	<xsl:param name="homeLabel">
+		Home
+	</xsl:param>
+	<xsl:param name="homeWords">
+		Home
+	</xsl:param>
+	<xsl:param name="institution" />
+	<xsl:param name="outputDir" />
+	<xsl:param name="parentURL">
+		http://www.example.com/
+	</xsl:param>
+	<xsl:param name="parentWords" />
 
-  <xsl:template match="processing-instruction()"/>
+	<xsl:template name="copyrightStatement" />
 
-  <xsl:template name="headingNumberSuffix">
-    <xsl:text> </xsl:text>
-  </xsl:template>
+	<xsl:template match="processing-instruction()" />
 
-  <xsl:template match="tei:divGen[@type='toc']">
-    <xsl:call-template name="mainTOC"/>
-  </xsl:template>
+	<xsl:template name="headingNumberSuffix">
+		<xsl:text> </xsl:text>
+	</xsl:template>
 
-  <xsl:template name="oddTocEntry">
-    <xsl:variable name="loc">
-      <xsl:choose>
-        <xsl:when test="number($splitLevel)=-1 or $STDOUT='true'">
-          <xsl:text>#</xsl:text>
-          <xsl:value-of select="@ident"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:text>ref-</xsl:text>
-          <xsl:value-of select="@ident"/>
-          <xsl:value-of select="$outputSuffix"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <div class="oddTocEntry">
-      <a href="{$loc}">
-        <xsl:value-of select="@ident"/>
-      </a>
-    </div>
-  </xsl:template>
+	<xsl:template match="tei:divGen[@type='toc']">
+		<xsl:call-template name="mainTOC" />
+	</xsl:template>
 
-  <xsl:template match="tei:divGen[@type='index']"/>
+	<xsl:template name="oddTocEntry">
+		<xsl:variable name="loc">
+			<xsl:choose>
+				<xsl:when test="number($splitLevel)=-1 or $STDOUT='true'">
+					<xsl:text>#</xsl:text>
+					<xsl:value-of select="@ident" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>ref-</xsl:text>
+					<xsl:value-of select="@ident" />
+					<xsl:value-of select="$outputSuffix" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<div class="oddTocEntry">
+			<a href="{$loc}">
+				<xsl:value-of select="@ident" />
+			</a>
+		</div>
+	</xsl:template>
 
-  <xsl:template name="logoPicture">
-    <img src="jaco001d.gif" alt="" width="180"/>
-  </xsl:template>
+	<xsl:template match="tei:divGen[@type='index']" />
 
-  <xsl:template name="hdr2">
-    <xsl:comment>no nav </xsl:comment>
-  </xsl:template>
+	<xsl:template name="logoPicture">
+		<img src="jaco001d.gif" alt="" width="180" />
+	</xsl:template>
 
-  <xsl:template match="tei:hi[@rend='math']">
-    <span class="math">
-      <xsl:apply-templates/>
-    </span>
-  </xsl:template>
+	<xsl:template name="hdr2">
+		<xsl:comment>
+			no nav
+		</xsl:comment>
+	</xsl:template>
 
-  <xsl:template name="makeHTMLHeading">
-    <xsl:param name="text"/>
-    <xsl:param name="class">title</xsl:param>
-    <xsl:param name="level">1</xsl:param>
-    <xsl:if test="not($text='')">
-      <xsl:choose>
-        <xsl:when test="$level='1'">
-          <xsl:element name="h1">
-            <xsl:attribute name="class">
-              <xsl:value-of select="$class"/>
+	<xsl:template match="tei:hi[@rend='math']">
+		<span class="math">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<xsl:template name="makeHTMLHeading">
+		<xsl:param name="text" />
+		<xsl:param name="class">
+			title
+		</xsl:param>
+		<xsl:param name="level">
+			1
+		</xsl:param>
+		<xsl:if test="not($text='')">
+			<xsl:choose>
+				<xsl:when test="$level='1'">
+					<xsl:element name="h1">
+						<xsl:attribute name="class">
+              <xsl:value-of select="$class" />
             </xsl:attribute>
-            <a href="index.html">
-              <xsl:value-of select="$text"/>
-            </a>
-          </xsl:element>
-        </xsl:when>
+						<a href="index.html">
+							<xsl:value-of select="$text" />
+						</a>
+					</xsl:element>
+				</xsl:when>
 
-        <xsl:otherwise>
-          <xsl:element name="h{$level}">
-            <xsl:attribute name="class">
-              <xsl:value-of select="$class"/>
+				<xsl:otherwise>
+					<xsl:element name="h{$level}">
+						<xsl:attribute name="class">
+              <xsl:value-of select="$class" />
             </xsl:attribute>
-            <xsl:value-of select="$text"/>
-          </xsl:element>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:if>
-  </xsl:template>
+						<xsl:value-of select="$text" />
+					</xsl:element>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template name="formatHeadingNumber">
-    <xsl:param name="text"/>
-    <xsl:param name="toc"/>
-    <span class="headingNumber">
-      <xsl:choose>
-        <xsl:when test="$toc =''">
-          <xsl:copy-of select="$text"/>
-        </xsl:when>
-        <xsl:when test="number(normalize-space($text))&lt;10">
-          <xsl:text> </xsl:text>
-          <xsl:copy-of select="$text"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:copy-of select="$text"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </span>
-  </xsl:template>
+	<xsl:template name="formatHeadingNumber">
+		<xsl:param name="text" />
+		<xsl:param name="toc" />
+		<span class="headingNumber">
+			<xsl:choose>
+				<xsl:when test="$toc =''">
+					<xsl:copy-of select="$text" />
+				</xsl:when>
+				<xsl:when test="number(normalize-space($text))&lt;10">
+					<xsl:text> </xsl:text>
+					<xsl:copy-of select="$text" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:copy-of select="$text" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
 
-  <xsl:template name="navInterSep"> </xsl:template>
+	<xsl:template name="navInterSep">
+	</xsl:template>
 
-  <xsl:template name="generateSubTitle">
-    <xsl:value-of select="tei:head"/>
-  </xsl:template>
+	<xsl:template name="generateSubTitle">
+		<xsl:value-of select="tei:head" />
+	</xsl:template>
 
-  <xsl:template name="printLink"/>
+	<xsl:template name="printLink" />
 
-  <xsl:template match="tei:titlePage" mode="paging">
-    <xsl:apply-templates select="."/>
-  </xsl:template>
+	<xsl:template match="tei:titlePage" mode="paging">
+		<xsl:apply-templates select="." />
+	</xsl:template>
 
-  <xsl:template name="generateEndLink">
-      <xsl:param name="where"/>
-      <xsl:choose>
-	<xsl:when test="id($where)">
-	  <xsl:apply-templates mode="generateLink" select="id($where)"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:text>[ID </xsl:text>
-	  <xsl:value-of select="$where"/>
-	  <xsl:text> in TEI Guidelines]</xsl:text>
-	</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<xsl:template name="generateEndLink">
+		<xsl:param name="where" />
+		<xsl:choose>
+			<xsl:when test="id($where)">
+				<xsl:apply-templates mode="generateLink"
+					select="id($where)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>[ID </xsl:text>
+				<xsl:value-of select="$where" />
+				<xsl:text> in TEI Guidelines]</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2odd.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2odd.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2odd.xsl	(revision 2397)
@@ -1,2351 +1,2854 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-    xmlns:sch="http://purl.oclc.org/dsdl/schematron" 
-    xmlns:s="http://www.ascc.net/xml/schematron" 
-    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-    xmlns:rng="http://relaxng.org/ns/structure/1.0"
-    xmlns:tei="http://www.tei-c.org/ns/1.0" 
-    xmlns:teix="http://www.tei-c.org/ns/Examples" 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    version="2.0" 
-    exclude-result-prefixes="teix a s tei xs rng sch xsi">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for simplifying TEI ODD markup </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="teix a s tei xs rng sch xsi">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for simplifying TEI ODD markup </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: odd2odd.xsl 10148 2012-03-06 23:51:20Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:output encoding="utf-8" indent="no"/>
-  <xsl:param name="autoGlobal">false</xsl:param>
-  <xsl:param name="selectedSchema"/>
-  <xsl:param name="verbose"/>
-  <xsl:param name="useVersionFromTEI">true</xsl:param>
-  <xsl:param name="stripped">false</xsl:param>
-  <xsl:param name="configDirectory"/>
-  <xsl:param name="currentDirectory"/>
-  <xsl:param name="defaultSource"></xsl:param>
-  <xsl:param name="defaultTEIVersion">current</xsl:param>
-  <xsl:param name="defaultTEIServer">http://www.tei-c.org/Vault/P5/</xsl:param>
-  <xsl:key name="odd2odd-CLASSREFS" match="tei:classRef" use="@key"/>
-  <xsl:key name="odd2odd-ATTCLASSES" match="tei:classSpec[(tei:attList or @type='atts') and not(@ident='tei.TEIform')]" use="@ident"/>
-  <xsl:key name="odd2odd-CHANGEATT" match="tei:attDef[@mode='change']" use="concat(../../@ident,'_',@ident)"/>
-  <xsl:key name="odd2odd-CHANGECONSTRAINT" match="tei:constraintSpec[@mode='change']" use="concat(../@ident,'_',@ident)"/>
-  <xsl:key name="odd2odd-CLASS_MEMBERED" use="tei:classes/tei:memberOf/@key" match="tei:classSpec"/>
-  <xsl:key name="odd2odd-ATTREFS" match="tei:attRef" use="concat(@name,'_',../../@ident)"/>
-  <xsl:key name="odd2odd-DELETEATT" match="tei:attDef[@mode='delete']" use="concat(ancestor::tei:elementSpec/@ident,'_',@ident)"/>
-  <xsl:key name="odd2odd-DELETEATT" match="tei:attDef[@mode='delete']" use="concat(ancestor::tei:classSpec/@ident,'_',@ident)"/>
-  <xsl:key name="odd2odd-DELETECONSTRAINT" match="tei:constraintSpec[@mode='delete']" use="concat(../@ident,'_',@ident)"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:key name="odd2odd-ELEMENT_MEMBERED" use="tei:classes/tei:memberOf/@key" match="tei:elementSpec"/>
-  <xsl:key name="odd2odd-IDS" match="tei:*[@xml:id]" use="@xml:id"/>
-  <xsl:key name="odd2odd-MACROS" use="@ident" match="tei:macroSpec"/>
-  <xsl:key name="odd2odd-MEMBEROFADD" match="tei:memberOf[not(@mode='delete')]" use="concat(../../@ident,@key)"/>
-  <xsl:key name="odd2odd-MEMBEROFDELETE" match="tei:memberOf[@mode='delete']" use="concat(../../@ident,@key)"/>
-  <xsl:key name="odd2odd-MODULES" match="tei:moduleRef" use="@key"/>
-  <xsl:key name="odd2odd-NEWATTCLASSES" match="tei:classSpec[@type='atts' and @mode='add']" use="@ident"/>
-  <xsl:key name="odd2odd-REFED" use="@name" match="rng:ref[parent::tei:datatype]"/>
-  <xsl:key name="odd2odd-REFED" use="@name" match="rng:ref[ancestor::tei:elementSpec]"/>
-  <xsl:key name="odd2odd-REFED" use="@name" match="rng:ref[ancestor::tei:macroSpec and not(@name=ancestor::tei:macroSpec/@ident)]"/>
-  <xsl:key name="odd2odd-REFED" use="substring-before(@name,'.attribute')" match="tei:attRef"/>
-  <xsl:key name="odd2odd-REFED" use="substring-before(@name,'_')" match="rng:ref[contains(@name,'_')]"/>
-  <xsl:key name="odd2odd-REPLACEATT" match="tei:attDef[@mode='replace']" use="concat(../../@ident,'_',@ident)"/>
-  <xsl:key name="odd2odd-REPLACECONSTRAINT" match="tei:constraintSpec[@mode='replace']" use="concat(../@ident,'_',@ident)"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: odd2odd.xsl 10148 2012-03-06 23:51:20Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output encoding="utf-8" indent="no" />
+	<xsl:param name="autoGlobal">
+		false
+	</xsl:param>
+	<xsl:param name="selectedSchema" />
+	<xsl:param name="verbose" />
+	<xsl:param name="useVersionFromTEI">
+		true
+	</xsl:param>
+	<xsl:param name="stripped">
+		false
+	</xsl:param>
+	<xsl:param name="configDirectory" />
+	<xsl:param name="currentDirectory" />
+	<xsl:param name="defaultSource"></xsl:param>
+	<xsl:param name="defaultTEIVersion">
+		current
+	</xsl:param>
+	<xsl:param name="defaultTEIServer">
+		http://www.tei-c.org/Vault/P5/
+	</xsl:param>
+	<xsl:key name="odd2odd-CLASSREFS" match="tei:classRef"
+		use="@key" />
+	<xsl:key name="odd2odd-ATTCLASSES"
+		match="tei:classSpec[(tei:attList or @type='atts') and not(@ident='tei.TEIform')]"
+		use="@ident" />
+	<xsl:key name="odd2odd-CHANGEATT"
+		match="tei:attDef[@mode='change']"
+		use="concat(../../@ident,'_',@ident)" />
+	<xsl:key name="odd2odd-CHANGECONSTRAINT"
+		match="tei:constraintSpec[@mode='change']"
+		use="concat(../@ident,'_',@ident)" />
+	<xsl:key name="odd2odd-CLASS_MEMBERED"
+		use="tei:classes/tei:memberOf/@key" match="tei:classSpec" />
+	<xsl:key name="odd2odd-ATTREFS" match="tei:attRef"
+		use="concat(@name,'_',../../@ident)" />
+	<xsl:key name="odd2odd-DELETEATT"
+		match="tei:attDef[@mode='delete']"
+		use="concat(ancestor::tei:elementSpec/@ident,'_',@ident)" />
+	<xsl:key name="odd2odd-DELETEATT"
+		match="tei:attDef[@mode='delete']"
+		use="concat(ancestor::tei:classSpec/@ident,'_',@ident)" />
+	<xsl:key name="odd2odd-DELETECONSTRAINT"
+		match="tei:constraintSpec[@mode='delete']"
+		use="concat(../@ident,'_',@ident)" />
 
-  <xsl:key name="odd2odd-MODULE_MEMBERS" match="tei:macroSpec"  use="@module"/>
-  <xsl:key name="odd2odd-MODULE_MEMBERS" match="tei:classSpec"  use="@module"/>
-  <xsl:key name="odd2odd-MODULE_MEMBERS" match="tei:elementSpec" use="@module"/>
+	<xsl:key name="odd2odd-ELEMENT_MEMBERED"
+		use="tei:classes/tei:memberOf/@key" match="tei:elementSpec" />
+	<xsl:key name="odd2odd-IDS" match="tei:*[@xml:id]"
+		use="@xml:id" />
+	<xsl:key name="odd2odd-MACROS" use="@ident"
+		match="tei:macroSpec" />
+	<xsl:key name="odd2odd-MEMBEROFADD"
+		match="tei:memberOf[not(@mode='delete')]"
+		use="concat(../../@ident,@key)" />
+	<xsl:key name="odd2odd-MEMBEROFDELETE"
+		match="tei:memberOf[@mode='delete']" use="concat(../../@ident,@key)" />
+	<xsl:key name="odd2odd-MODULES" match="tei:moduleRef"
+		use="@key" />
+	<xsl:key name="odd2odd-NEWATTCLASSES"
+		match="tei:classSpec[@type='atts' and @mode='add']" use="@ident" />
+	<xsl:key name="odd2odd-REFED" use="@name"
+		match="rng:ref[parent::tei:datatype]" />
+	<xsl:key name="odd2odd-REFED" use="@name"
+		match="rng:ref[ancestor::tei:elementSpec]" />
+	<xsl:key name="odd2odd-REFED" use="@name"
+		match="rng:ref[ancestor::tei:macroSpec and not(@name=ancestor::tei:macroSpec/@ident)]" />
+	<xsl:key name="odd2odd-REFED"
+		use="substring-before(@name,'.attribute')" match="tei:attRef" />
+	<xsl:key name="odd2odd-REFED" use="substring-before(@name,'_')"
+		match="rng:ref[contains(@name,'_')]" />
+	<xsl:key name="odd2odd-REPLACEATT"
+		match="tei:attDef[@mode='replace']"
+		use="concat(../../@ident,'_',@ident)" />
+	<xsl:key name="odd2odd-REPLACECONSTRAINT"
+		match="tei:constraintSpec[@mode='replace']"
+		use="concat(../@ident,'_',@ident)" />
 
-  <xsl:key name="odd2odd-MODULE_MEMBERS_MODEL" match="tei:classSpec" use="@module"/>
+	<xsl:key name="odd2odd-MODULE_MEMBERS" match="tei:macroSpec"
+		use="@module" />
+	<xsl:key name="odd2odd-MODULE_MEMBERS" match="tei:classSpec"
+		use="@module" />
+	<xsl:key name="odd2odd-MODULE_MEMBERS" match="tei:elementSpec"
+		use="@module" />
 
-  <xsl:key name="odd2odd-SCHEMASPECS" match="tei:schemaSpec" use="@ident"/>
+	<xsl:key name="odd2odd-MODULE_MEMBERS_MODEL"
+		match="tei:classSpec" use="@module" />
 
-  <xsl:key name="odd2odd-IDENTS" match="tei:macroSpec" use="@ident"/>
-  <xsl:key name="odd2odd-IDENTS" match="tei:classSpec" use="@ident"/>
-  <xsl:key name="odd2odd-IDENTS" match="tei:elementSpec" use="@ident"/>
+	<xsl:key name="odd2odd-SCHEMASPECS" match="tei:schemaSpec"
+		use="@ident" />
 
-   <!-- all of these use a combination of @ident _and_ @ns (where
-   present), in case of duplication of names across schemes -->
+	<xsl:key name="odd2odd-IDENTS" match="tei:macroSpec"
+		use="@ident" />
+	<xsl:key name="odd2odd-IDENTS" match="tei:classSpec"
+		use="@ident" />
+	<xsl:key name="odd2odd-IDENTS" match="tei:elementSpec"
+		use="@ident" />
 
-  <xsl:key name="odd2odd-CHANGE" match="tei:classSpec[@mode='change']" use="concat(@ns,@ident)"/>
-  <xsl:key name="odd2odd-CHANGE" match="tei:elementSpec[@mode='change']" use="concat(@ns,@ident)"/>
-  <xsl:key name="odd2odd-CHANGE" match="tei:macroSpec[@mode='change']" use="concat(@ns,@ident)"/>
-  <xsl:key name="odd2odd-DELETE" match="tei:classSpec[@mode='delete']" use="concat(@ns,@ident)"/>
-  <xsl:key name="odd2odd-DELETE" match="tei:elementSpec[@mode='delete']" use="concat(@ns,@ident)"/>
-  <xsl:key name="odd2odd-DELETE" match="tei:macroSpec[@mode='delete']" use="concat(@ns,@ident)"/>
-  <xsl:key name="odd2odd-REPLACE" match="tei:classSpec[@mode='replace']" use="concat(@ns,@ident)"/>
-  <xsl:key name="odd2odd-REPLACE" match="tei:elementSpec[@mode='replace']" use="concat(@ns,@ident)"/>
-  <xsl:key name="odd2odd-REPLACE" match="tei:macroSpec[@mode='replace']" use="concat(@ns,@ident)"/>
+	<!-- all of these use a combination of @ident _and_ @ns (where present), 
+		in case of duplication of names across schemes -->
 
-  <xsl:variable name="DEFAULTSOURCE">
-    <xsl:choose>
-      <xsl:when test="$defaultSource != ''">
-        <xsl:value-of select="$defaultSource"/>
-      </xsl:when>
-      <xsl:when test="$configDirectory != ''">
-        <xsl:value-of select="$configDirectory"/>
-        <xsl:text>odd/p5subset.xml</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="$defaultTEIServer"/>
-        <xsl:value-of select="$defaultTEIVersion"/>
-	<xsl:text>/xml/tei/odd/p5subset.xml</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  
-  <xsl:variable name="ODD">
-    <xsl:for-each select="/tei:TEI">
-      <xsl:copy>
-	<xsl:attribute name="xml:base" select="document-uri(/)"/>
-        <xsl:copy-of select="@*"/>
-        <xsl:if test="$useVersionFromTEI='true'">
-          <xsl:processing-instruction name="TEIVERSION">
-            <xsl:call-template name="odd2odd-getversion"/>
-          </xsl:processing-instruction>
-        </xsl:if>
-        <xsl:apply-templates mode="odd2odd-pass0"/>
-      </xsl:copy>
-    </xsl:for-each>
-  </xsl:variable>
+	<xsl:key name="odd2odd-CHANGE"
+		match="tei:classSpec[@mode='change']" use="concat(@ns,@ident)" />
+	<xsl:key name="odd2odd-CHANGE"
+		match="tei:elementSpec[@mode='change']" use="concat(@ns,@ident)" />
+	<xsl:key name="odd2odd-CHANGE"
+		match="tei:macroSpec[@mode='change']" use="concat(@ns,@ident)" />
+	<xsl:key name="odd2odd-DELETE"
+		match="tei:classSpec[@mode='delete']" use="concat(@ns,@ident)" />
+	<xsl:key name="odd2odd-DELETE"
+		match="tei:elementSpec[@mode='delete']" use="concat(@ns,@ident)" />
+	<xsl:key name="odd2odd-DELETE"
+		match="tei:macroSpec[@mode='delete']" use="concat(@ns,@ident)" />
+	<xsl:key name="odd2odd-REPLACE"
+		match="tei:classSpec[@mode='replace']" use="concat(@ns,@ident)" />
+	<xsl:key name="odd2odd-REPLACE"
+		match="tei:elementSpec[@mode='replace']" use="concat(@ns,@ident)" />
+	<xsl:key name="odd2odd-REPLACE"
+		match="tei:macroSpec[@mode='replace']" use="concat(@ns,@ident)" />
 
-  <xsl:variable name="top" select="/"/>
+	<xsl:variable name="DEFAULTSOURCE">
+		<xsl:choose>
+			<xsl:when test="$defaultSource != ''">
+				<xsl:value-of select="$defaultSource" />
+			</xsl:when>
+			<xsl:when test="$configDirectory != ''">
+				<xsl:value-of select="$configDirectory" />
+				<xsl:text>odd/p5subset.xml</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$defaultTEIServer" />
+				<xsl:value-of select="$defaultTEIVersion" />
+				<xsl:text>/xml/tei/odd/p5subset.xml</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
 
+	<xsl:variable name="ODD">
+		<xsl:for-each select="/tei:TEI">
+			<xsl:copy>
+				<xsl:attribute name="xml:base"
+					select="document-uri(/)" />
+				<xsl:copy-of select="@*" />
+				<xsl:if test="$useVersionFromTEI='true'">
+					<xsl:processing-instruction
+						name="TEIVERSION">
+						<xsl:call-template name="odd2odd-getversion" />
+					</xsl:processing-instruction>
+				</xsl:if>
+				<xsl:apply-templates mode="odd2odd-pass0" />
+			</xsl:copy>
+		</xsl:for-each>
+	</xsl:variable>
 
-  <xsl:template match="/">
-    <xsl:if test="$autoGlobal='true'">
-      <xsl:message>NOTE: all TEI elements will have global attributes added automatically</xsl:message>
-    </xsl:if>
-    <!--
-    <xsl:result-document href="/tmp/foo.xml">
-      <xsl:copy-of select="$ODD"/>
-    </xsl:result-document>
-    -->
-    <xsl:for-each select="$ODD">
-      <xsl:apply-templates mode="odd2odd-pass1"/>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:variable name="top" select="/" />
 
-  <!-- ******************* Pass 0, follow and expand specGrp ********************************* -->
-  <xsl:template match="tei:specGrp" mode="odd2odd-pass0">
-    <xsl:if test="$verbose='true'">
-      <xsl:message>Phase 0: summarize specGrp <xsl:value-of select="@xml:id"/>
-      </xsl:message>
-    </xsl:if>
-    <table xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:for-each select="*">
-        <row>
-          <xsl:choose>
-            <xsl:when test="self::tei:specGrpRef">
-              <cell>
-                <ref target="#{@target}">reference <xsl:value-of select="@target"/></ref>
-              </cell>
-              <cell/>
-            </xsl:when>
-            <xsl:when test="self::tei:elementSpec">
-              <cell>
-		Element <gi><xsl:value-of select="@ident"/></gi>
-	      </cell>
-              <cell>
-                <xsl:value-of select="@mode"/>
-              </cell>
-            </xsl:when>
-            <xsl:when test="self::tei:classSpec">
-              <cell>
-		Class <ident type="class"><xsl:value-of select="@ident"/></ident>
-	      </cell>
-              <cell>
-                <xsl:value-of select="@mode"/>
-              </cell>
-            </xsl:when>
-            <xsl:when test="self::tei:macroSpec">
-              <cell>
-		Macro <ident type="macro"><xsl:value-of select="@ident"/></ident>
-	      </cell>
-              <cell>
-                <xsl:value-of select="@mode"/>
-              </cell>
-            </xsl:when>
-            <xsl:when test="self::tei:moduleRef">
-              <cell>
-		Module <xsl:value-of select="@key"/>
-	      </cell>
-              <cell/>
-	    </xsl:when>
-          </xsl:choose>
-        </row>
-      </xsl:for-each>
-    </table>
-  </xsl:template>
 
-  <xsl:template match="tei:schemaSpec" mode="odd2odd-pass0">
-    <xsl:if test="@ident=$selectedSchema or ($selectedSchema='' and not(preceding-sibling::tei:schemaSpec))">
-      <xsl:copy>
-	<xsl:copy-of select="@*"/>
-	<xsl:choose>
-	<xsl:when test="@source">
-	<xsl:if test="$verbose='true'">
-	  <xsl:message>Source for TEI is <xsl:value-of select="@source"/></xsl:message>
-	</xsl:if>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:if test="$verbose='true'">
-	    <xsl:message>Source for TEI will be set to <xsl:value-of select="$DEFAULTSOURCE"/> </xsl:message>
-	  </xsl:if>
-	  <xsl:attribute name="source">
-	    <xsl:value-of select="$DEFAULTSOURCE"/>
+	<xsl:template match="/">
+		<xsl:if test="$autoGlobal='true'">
+			<xsl:message>
+				NOTE: all TEI elements will have global attributes added
+				automatically
+			</xsl:message>
+		</xsl:if>
+		<!-- <xsl:result-document href="/tmp/foo.xml"> <xsl:copy-of select="$ODD"/> 
+			</xsl:result-document> -->
+		<xsl:for-each select="$ODD">
+			<xsl:apply-templates mode="odd2odd-pass1" />
+		</xsl:for-each>
+	</xsl:template>
+
+	<!-- ******************* Pass 0, follow and expand specGrp ********************************* -->
+	<xsl:template match="tei:specGrp" mode="odd2odd-pass0">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Phase 0: summarize specGrp
+				<xsl:value-of select="@xml:id" />
+			</xsl:message>
+		</xsl:if>
+		<table xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:for-each select="*">
+				<row>
+					<xsl:choose>
+						<xsl:when test="self::tei:specGrpRef">
+							<cell>
+								<ref target="#{@target}">
+									reference
+									<xsl:value-of select="@target" />
+								</ref>
+							</cell>
+							<cell />
+						</xsl:when>
+						<xsl:when test="self::tei:elementSpec">
+							<cell>
+								Element
+								<gi>
+									<xsl:value-of select="@ident" />
+								</gi>
+							</cell>
+							<cell>
+								<xsl:value-of select="@mode" />
+							</cell>
+						</xsl:when>
+						<xsl:when test="self::tei:classSpec">
+							<cell>
+								Class
+								<ident type="class">
+									<xsl:value-of select="@ident" />
+								</ident>
+							</cell>
+							<cell>
+								<xsl:value-of select="@mode" />
+							</cell>
+						</xsl:when>
+						<xsl:when test="self::tei:macroSpec">
+							<cell>
+								Macro
+								<ident type="macro">
+									<xsl:value-of select="@ident" />
+								</ident>
+							</cell>
+							<cell>
+								<xsl:value-of select="@mode" />
+							</cell>
+						</xsl:when>
+						<xsl:when test="self::tei:moduleRef">
+							<cell>
+								Module
+								<xsl:value-of select="@key" />
+							</cell>
+							<cell />
+						</xsl:when>
+					</xsl:choose>
+				</row>
+			</xsl:for-each>
+		</table>
+	</xsl:template>
+
+	<xsl:template match="tei:schemaSpec" mode="odd2odd-pass0">
+		<xsl:if
+			test="@ident=$selectedSchema or ($selectedSchema='' and not(preceding-sibling::tei:schemaSpec))">
+			<xsl:copy>
+				<xsl:copy-of select="@*" />
+				<xsl:choose>
+					<xsl:when test="@source">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								Source for TEI is
+								<xsl:value-of select="@source" />
+							</xsl:message>
+						</xsl:if>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								Source for TEI will be set to
+								<xsl:value-of select="$DEFAULTSOURCE" />
+							</xsl:message>
+						</xsl:if>
+						<xsl:attribute name="source">
+	    <xsl:value-of select="$DEFAULTSOURCE" />
 	  </xsl:attribute>
-	</xsl:otherwise>
-	</xsl:choose>
-	<xsl:apply-templates select="*|text()|processing-instruction()" mode="odd2odd-pass0"/>
-      </xsl:copy>
-    </xsl:if>
-  </xsl:template>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:apply-templates
+					select="*|text()|processing-instruction()" mode="odd2odd-pass0" />
+			</xsl:copy>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="tei:specGrpRef" mode="odd2odd-pass0">
-    <xsl:if test="$verbose='true'">
-      <xsl:message>Phase 0: expand specGrpRef <xsl:value-of
-      select="@target"/> </xsl:message>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="starts-with(@target,'#')">
-	<xsl:apply-templates  mode="odd2odd-pass0"
-			      select="id(substring(@target,2))/*"/>
-      </xsl:when>
-      <xsl:otherwise>
-    <xsl:if test="$verbose='true'">
-      <xsl:message> ... read from <xsl:value-of select="resolve-uri(@target,base-uri(/tei:TEI))"/></xsl:message>
-    </xsl:if>
+	<xsl:template match="tei:specGrpRef" mode="odd2odd-pass0">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Phase 0: expand specGrpRef
+				<xsl:value-of select="@target" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="starts-with(@target,'#')">
+				<xsl:apply-templates mode="odd2odd-pass0"
+					select="id(substring(@target,2))/*" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						... read from
+						<xsl:value-of
+							select="resolve-uri(@target,base-uri(/tei:TEI))" />
+					</xsl:message>
+				</xsl:if>
 
-	<xsl:for-each 
-	    select="doc(resolve-uri(@target,base-uri(/tei:TEI)))">
-	  <xsl:choose>
-	    <xsl:when test="tei:specGrp">
-	      <xsl:apply-templates select="tei:specGrp/*" mode="odd2odd-pass0"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:apply-templates  mode="odd2odd-pass0"/>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="text()|@*" mode="odd2odd-pass0">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="processing-instruction()" mode="odd2odd-pass0">
-      <xsl:copy-of select="."/>
-  </xsl:template>
+				<xsl:for-each
+					select="doc(resolve-uri(@target,base-uri(/tei:TEI)))">
+					<xsl:choose>
+						<xsl:when test="tei:specGrp">
+							<xsl:apply-templates select="tei:specGrp/*"
+								mode="odd2odd-pass0" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates mode="odd2odd-pass0" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="*" mode="odd2odd-pass0">
-    <xsl:copy>
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates select="*|text()|processing-instruction()" mode="odd2odd-pass0"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="text()|@*" mode="odd2odd-pass0">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
+	<xsl:template match="processing-instruction()"
+		mode="odd2odd-pass0">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <!-- ******************* Pass 1, follow schemaSpec ********************************* -->
-  <xsl:template match="@*|processing-instruction()|text()" mode="odd2odd-pass1">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="*" mode="odd2odd-pass0">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates
+				select="*|text()|processing-instruction()" mode="odd2odd-pass0" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="*" mode="odd2odd-pass1">
-    <xsl:copy>
-      <xsl:apply-templates mode="odd2odd-pass1" select="*|@*|processing-instruction()|text()"/>
-    </xsl:copy>
-  </xsl:template>
 
-  <xsl:template match="tei:schemaSpec" mode="odd2odd-pass1">
-    <xsl:variable name="sourceDoc" select="tei:workOutSource(.)"/>
+	<!-- ******************* Pass 1, follow schemaSpec ********************************* -->
+	<xsl:template match="@*|processing-instruction()|text()"
+		mode="odd2odd-pass1">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-    <xsl:variable name="oddsource">
-      <xsl:copy>
-        <xsl:copy-of select="@*"/>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Schema <xsl:value-of select="@ident"/></xsl:message>
-        </xsl:if>
-        <!-- 
-	     it is important to process "tei" and "core" first 
-	     because of the order of declarations
-	-->
-	<xsl:for-each select="tei:moduleRef[@key='tei']">
-	  <xsl:call-template name="odd2odd-expandModule">
-	    <xsl:with-param name="Source" select="$sourceDoc" tunnel="yes"/>
-	  </xsl:call-template>
-	</xsl:for-each>
-	
-	<xsl:for-each select="tei:moduleRef[@key='core']">
-	  <xsl:call-template name="odd2odd-expandModule">
-	    <xsl:with-param name="Source" select="$sourceDoc"
-			tunnel="yes"/>
-	  </xsl:call-template>
-	</xsl:for-each>
-	
-	<xsl:for-each select="tei:moduleRef[@key]">
-	  <xsl:if test="not(@key='tei' or @key='core')">
-	    <xsl:call-template name="odd2odd-expandModule">
-	    <xsl:with-param name="Source" select="$sourceDoc"
-			tunnel="yes"/>
-	  </xsl:call-template>
-	  </xsl:if>
-	</xsl:for-each>
-	
-	<xsl:for-each select="tei:macroRef|tei:classRef|tei:elementRef">
-	    <xsl:call-template name="odd2odd-followRef">
-	  </xsl:call-template>
-	</xsl:for-each>
+	<xsl:template match="*" mode="odd2odd-pass1">
+		<xsl:copy>
+			<xsl:apply-templates mode="odd2odd-pass1"
+				select="*|@*|processing-instruction()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-	<xsl:for-each select="tei:classSpec[@mode='add' or not(@mode)]">
-	  <xsl:call-template name="odd2odd-createCopy">
-	    <xsl:with-param name="Source" select="$sourceDoc"
-			tunnel="yes"/>
-	  </xsl:call-template>
-	</xsl:for-each>
+	<xsl:template match="tei:schemaSpec" mode="odd2odd-pass1">
+		<xsl:variable name="sourceDoc"
+			select="tei:workOutSource(.)" />
 
-	<xsl:for-each select="tei:macroSpec[@mode='add' or not(@mode)]">
-	  <xsl:call-template name="odd2odd-createCopy">
-	    <xsl:with-param name="Source" select="$sourceDoc"
-			tunnel="yes"/>
-	  </xsl:call-template>
-	</xsl:for-each>
+		<xsl:variable name="oddsource">
+			<xsl:copy>
+				<xsl:copy-of select="@*" />
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Schema
+						<xsl:value-of select="@ident" />
+					</xsl:message>
+				</xsl:if>
+				<!-- it is important to process "tei" and "core" first because of the 
+					order of declarations -->
+				<xsl:for-each select="tei:moduleRef[@key='tei']">
+					<xsl:call-template name="odd2odd-expandModule">
+						<xsl:with-param name="Source" select="$sourceDoc"
+							tunnel="yes" />
+					</xsl:call-template>
+				</xsl:for-each>
 
-	<xsl:for-each select="tei:elementSpec[@mode='add' or not(@mode)]">
-	  <xsl:call-template name="odd2odd-createCopy">
-	    <xsl:with-param name="Source" select="$sourceDoc"
-			tunnel="yes"/>
-	  </xsl:call-template>
-	</xsl:for-each>
+				<xsl:for-each select="tei:moduleRef[@key='core']">
+					<xsl:call-template name="odd2odd-expandModule">
+						<xsl:with-param name="Source" select="$sourceDoc"
+							tunnel="yes" />
+					</xsl:call-template>
+				</xsl:for-each>
 
-	<xsl:apply-templates mode="odd2odd-justcopy" select="tei:moduleRef[@url]"/>
+				<xsl:for-each select="tei:moduleRef[@key]">
+					<xsl:if test="not(@key='tei' or @key='core')">
+						<xsl:call-template name="odd2odd-expandModule">
+							<xsl:with-param name="Source" select="$sourceDoc"
+								tunnel="yes" />
+						</xsl:call-template>
+					</xsl:if>
+				</xsl:for-each>
 
-      </xsl:copy>
+				<xsl:for-each
+					select="tei:macroRef|tei:classRef|tei:elementRef">
+					<xsl:call-template name="odd2odd-followRef">
+					</xsl:call-template>
+				</xsl:for-each>
 
-    </xsl:variable>
-    <xsl:for-each select="$oddsource">
-      <xsl:apply-templates mode="odd2odd-pass2"/>
-    </xsl:for-each>
-    <!-- constraints -->
-    <xsl:apply-templates mode="odd2odd-copy" select="tei:constraintSpec"/>
-  </xsl:template>
+				<xsl:for-each
+					select="tei:classSpec[@mode='add' or not(@mode)]">
+					<xsl:call-template name="odd2odd-createCopy">
+						<xsl:with-param name="Source" select="$sourceDoc"
+							tunnel="yes" />
+					</xsl:call-template>
+				</xsl:for-each>
 
+				<xsl:for-each
+					select="tei:macroSpec[@mode='add' or not(@mode)]">
+					<xsl:call-template name="odd2odd-createCopy">
+						<xsl:with-param name="Source" select="$sourceDoc"
+							tunnel="yes" />
+					</xsl:call-template>
+				</xsl:for-each>
 
-  <xsl:template name="odd2odd-expandModule">
-    <xsl:variable name="sourceDoc" select="tei:workOutSource(.)"/>
-    <xsl:variable name="name" select="@key"/>
-    <xsl:variable name="exc"
-		  select="concat(' ',normalize-space(@except),' ')"/>
-    <xsl:variable name="inc"  
-		  select="concat('/',translate(normalize-space(@include),' ','/'),'/')"/>
-      <xsl:choose>
-	<xsl:when test="not(@except) and not(@include)">
-	  <xsl:for-each select="document($sourceDoc,$top)">
-	    <xsl:for-each select="key('odd2odd-MODULE_MEMBERS',$name)">
-	      <xsl:call-template name="odd2odd-checkObject">
-		<xsl:with-param name="Source" select="$sourceDoc" tunnel="yes"/>
-		<xsl:with-param name="why"> module <xsl:value-of select="$name"/></xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:for-each>
-	  </xsl:for-each>
-	</xsl:when>
-	<xsl:when test="@include">
-	  <xsl:if test="$verbose='true'">
-	    <xsl:message>Process module reference to [<xsl:value-of
-	    select="@key"/>] with inclusion of [<xsl:value-of
-	    select="@include"/>]</xsl:message>
-	  </xsl:if>
-	  <!-- get model and attribute classes regardless -->
-	  <xsl:for-each select="document($sourceDoc,$top)">
-	    <xsl:for-each
-		select="key('odd2odd-MODULE_MEMBERS_MODEL',$name)">
-	      <xsl:call-template name="odd2odd-checkObject">
-		<xsl:with-param name="Source" select="$sourceDoc" tunnel="yes"/>
-		<xsl:with-param name="why">module (auto from include) <xsl:value-of select="$name"/></xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:for-each>
-	    <xsl:for-each
-		select="key('odd2odd-MODULE_MEMBERS',$name)">
-	      <xsl:choose>
-		<xsl:when test="self::tei:classSpec"/>
-		<xsl:when test="contains($inc,concat('/',@ident,'/'))">
-		  <xsl:call-template name="odd2odd-checkObject">
-		    <xsl:with-param name="Source" select="$sourceDoc" tunnel="yes"/>
-		    <xsl:with-param name="why">(inclusion) module <xsl:value-of select="$name"/></xsl:with-param>
-		  </xsl:call-template>
-		</xsl:when>
-	      </xsl:choose>
-	    </xsl:for-each>
-	  </xsl:for-each>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:if test="$verbose='true'">
-	    <xsl:message>Process module reference to [<xsl:value-of
-	    select="@key"/>] with exclusion of [<xsl:value-of select="@except"/>]</xsl:message>
-	  </xsl:if>
-	  <xsl:for-each select="document($sourceDoc,$top)">
-	    <xsl:for-each select="key('odd2odd-MODULE_MEMBERS',$name)">
-	      <xsl:if test="not(contains($exc,concat(' ',@ident,' ')))">
-		<xsl:call-template name="odd2odd-checkObject">
-		  <xsl:with-param name="Source" select="$sourceDoc" tunnel="yes"/>
-		  <xsl:with-param name="why">(exclusion) module <xsl:value-of select="$name"/></xsl:with-param>
-		</xsl:call-template>
-	      </xsl:if>
-	    </xsl:for-each>
-	    </xsl:for-each>
-	</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+				<xsl:for-each
+					select="tei:elementSpec[@mode='add' or not(@mode)]">
+					<xsl:call-template name="odd2odd-createCopy">
+						<xsl:with-param name="Source" select="$sourceDoc"
+							tunnel="yes" />
+					</xsl:call-template>
+				</xsl:for-each>
 
-  <xsl:template name="odd2odd-followRef">
-    <xsl:variable name="sourceDoc" select="tei:workOutSource(.)"/>
-    <xsl:variable name="name" select="@key"/>
-    <xsl:for-each select="document($sourceDoc,$top)">
-      <xsl:choose>
-	<xsl:when test="key('odd2odd-IDENTS',$name)">
-	  <xsl:for-each select="key('odd2odd-IDENTS',$name)">
-	    <xsl:call-template name="odd2odd-checkObject">
-		<xsl:with-param name="Source" select="$sourceDoc" tunnel="yes"/>
-		<xsl:with-param name="why">direct reference</xsl:with-param>
-	    </xsl:call-template>
-	  </xsl:for-each>
-	</xsl:when>
-	<xsl:otherwise>
-	<xsl:call-template name="die">
-	  <xsl:with-param name="message">
-	    <xsl:text>Reference to </xsl:text>
-	    <xsl:value-of select="$name"/>
-	    <xsl:text>: not found in source</xsl:text>
-	  </xsl:with-param>
-	</xsl:call-template>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
+				<xsl:apply-templates mode="odd2odd-justcopy"
+					select="tei:moduleRef[@url]" />
 
-<!-- pass2 -->      
-  <xsl:template match="rng:ref" mode="odd2odd-pass2">
-    <xsl:variable name="N">
-      <xsl:value-of select="@name"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="starts-with($N,'macro.') and $stripped='true'">
-        <xsl:for-each select="key('odd2odd-MACROS',$N)/tei:content/*">
-          <xsl:call-template name="odd2odd-simplifyRelax"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-	<ref xmlns="http://relaxng.org/ns/structure/1.0">
-	  <xsl:apply-templates select="@*|*|text()|processing-instruction()" mode="odd2odd-pass2"/>
-	</ref>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			</xsl:copy>
 
-  <xsl:template match="tei:valDesc|tei:equiv|tei:gloss|tei:desc|tei:remarks|tei:exemplum|tei:listRef" mode="odd2odd-pass2">
-    <xsl:choose>
-      <xsl:when test="$stripped='true'"> </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-	  <xsl:apply-templates select="@*|*|text()|processing-instruction()" mode="odd2odd-pass2"/>
-	</xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+		</xsl:variable>
+		<xsl:for-each select="$oddsource">
+			<xsl:apply-templates mode="odd2odd-pass2" />
+		</xsl:for-each>
+		<!-- constraints -->
+		<xsl:apply-templates mode="odd2odd-copy"
+			select="tei:constraintSpec" />
+	</xsl:template>
 
-  <xsl:template match="tei:ptr" mode="odd2odd-pass2">
-    <xsl:choose>
-      <xsl:when test="starts-with(@target,'#') and 
+
+	<xsl:template name="odd2odd-expandModule">
+		<xsl:variable name="sourceDoc"
+			select="tei:workOutSource(.)" />
+		<xsl:variable name="name" select="@key" />
+		<xsl:variable name="exc"
+			select="concat(' ',normalize-space(@except),' ')" />
+		<xsl:variable name="inc"
+			select="concat('/',translate(normalize-space(@include),' ','/'),'/')" />
+		<xsl:choose>
+			<xsl:when test="not(@except) and not(@include)">
+				<xsl:for-each select="document($sourceDoc,$top)">
+					<xsl:for-each
+						select="key('odd2odd-MODULE_MEMBERS',$name)">
+						<xsl:call-template name="odd2odd-checkObject">
+							<xsl:with-param name="Source" select="$sourceDoc"
+								tunnel="yes" />
+							<xsl:with-param name="why">
+								module
+								<xsl:value-of select="$name" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="@include">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Process module reference to [
+						<xsl:value-of select="@key" />
+						] with inclusion of [
+						<xsl:value-of select="@include" />
+						]
+					</xsl:message>
+				</xsl:if>
+				<!-- get model and attribute classes regardless -->
+				<xsl:for-each select="document($sourceDoc,$top)">
+					<xsl:for-each
+						select="key('odd2odd-MODULE_MEMBERS_MODEL',$name)">
+						<xsl:call-template name="odd2odd-checkObject">
+							<xsl:with-param name="Source" select="$sourceDoc"
+								tunnel="yes" />
+							<xsl:with-param name="why">
+								module (auto from include)
+								<xsl:value-of select="$name" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+					<xsl:for-each
+						select="key('odd2odd-MODULE_MEMBERS',$name)">
+						<xsl:choose>
+							<xsl:when test="self::tei:classSpec" />
+							<xsl:when test="contains($inc,concat('/',@ident,'/'))">
+								<xsl:call-template name="odd2odd-checkObject">
+									<xsl:with-param name="Source"
+										select="$sourceDoc" tunnel="yes" />
+									<xsl:with-param name="why">
+										(inclusion) module
+										<xsl:value-of select="$name" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:when>
+						</xsl:choose>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Process module reference to [
+						<xsl:value-of select="@key" />
+						] with exclusion of [
+						<xsl:value-of select="@except" />
+						]
+					</xsl:message>
+				</xsl:if>
+				<xsl:for-each select="document($sourceDoc,$top)">
+					<xsl:for-each
+						select="key('odd2odd-MODULE_MEMBERS',$name)">
+						<xsl:if test="not(contains($exc,concat(' ',@ident,' ')))">
+							<xsl:call-template name="odd2odd-checkObject">
+								<xsl:with-param name="Source" select="$sourceDoc"
+									tunnel="yes" />
+								<xsl:with-param name="why">
+									(exclusion) module
+									<xsl:value-of select="$name" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="odd2odd-followRef">
+		<xsl:variable name="sourceDoc"
+			select="tei:workOutSource(.)" />
+		<xsl:variable name="name" select="@key" />
+		<xsl:for-each select="document($sourceDoc,$top)">
+			<xsl:choose>
+				<xsl:when test="key('odd2odd-IDENTS',$name)">
+					<xsl:for-each select="key('odd2odd-IDENTS',$name)">
+						<xsl:call-template name="odd2odd-checkObject">
+							<xsl:with-param name="Source" select="$sourceDoc"
+								tunnel="yes" />
+							<xsl:with-param name="why">
+								direct reference
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="die">
+						<xsl:with-param name="message">
+							<xsl:text>Reference to </xsl:text>
+							<xsl:value-of select="$name" />
+							<xsl:text>: not found in source</xsl:text>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+
+	<!-- pass2 -->
+	<xsl:template match="rng:ref" mode="odd2odd-pass2">
+		<xsl:variable name="N">
+			<xsl:value-of select="@name" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="starts-with($N,'macro.') and $stripped='true'">
+				<xsl:for-each
+					select="key('odd2odd-MACROS',$N)/tei:content/*">
+					<xsl:call-template name="odd2odd-simplifyRelax" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<ref xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:apply-templates
+						select="@*|*|text()|processing-instruction()" mode="odd2odd-pass2" />
+				</ref>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template
+		match="tei:valDesc|tei:equiv|tei:gloss|tei:desc|tei:remarks|tei:exemplum|tei:listRef"
+		mode="odd2odd-pass2">
+		<xsl:choose>
+			<xsl:when test="$stripped='true'">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="@*|*|text()|processing-instruction()" mode="odd2odd-pass2" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="tei:ptr" mode="odd2odd-pass2">
+		<xsl:choose>
+			<xsl:when
+				test="starts-with(@target,'#') and 
 		      (ancestor::tei:remarks or ancestor::tei:listRef or ancestor::tei:valDesc) and
 		      not(id(substring(@target,2)))">
-	<xsl:variable name="target" select="substring(@target,2)"/>
-	<xsl:variable name="sourceDoc" select="tei:workOutSource(.)"/>
+				<xsl:variable name="target"
+					select="substring(@target,2)" />
+				<xsl:variable name="sourceDoc"
+					select="tei:workOutSource(.)" />
 
-	<xsl:choose>
-	  <xsl:when test="document($sourceDoc)/id($target)">
-	    <ref  xmlns="http://www.tei-c.org/ns/1.0"
-		  target="http://www.tei-c.org/release/doc/tei-p5-doc/en/html/{substring($target,1,2)}.html#{$target}">
-	      <xsl:for-each select="document($DEFAULTSOURCE)/id($target)">
-		<xsl:number count="tei:div" format="1.1.1."
-			    level="multiple"/>	  
-		<xsl:text> </xsl:text>
-		<xsl:value-of select="tei:head"/>
-	      </xsl:for-each>
-	    </ref>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:copy>
-	      <xsl:apply-templates select="@*|*|text()|processing-instruction()" mode="odd2odd-pass2"/>
-	    </xsl:copy>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:copy>
-	  <xsl:apply-templates select="@*|*|text()|processing-instruction()" mode="odd2odd-pass2"/>
-	</xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+				<xsl:choose>
+					<xsl:when test="document($sourceDoc)/id($target)">
+						<ref xmlns="http://www.tei-c.org/ns/1.0"
+							target="http://www.tei-c.org/release/doc/tei-p5-doc/en/html/{substring($target,1,2)}.html#{$target}">
+							<xsl:for-each
+								select="document($DEFAULTSOURCE)/id($target)">
+								<xsl:number count="tei:div" format="1.1.1."
+									level="multiple" />
+								<xsl:text> </xsl:text>
+								<xsl:value-of select="tei:head" />
+							</xsl:for-each>
+						</ref>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy>
+							<xsl:apply-templates
+								select="@*|*|text()|processing-instruction()"
+								mode="odd2odd-pass2" />
+						</xsl:copy>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="@*|*|text()|processing-instruction()" mode="odd2odd-pass2" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="@*|text()|comment()" mode="odd2odd-pass2">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="@*|text()|comment()"
+		mode="odd2odd-pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="*" mode="odd2odd-pass2">
-    <xsl:copy>
-      <xsl:copy-of select="@*"/>
-      <xsl:apply-templates mode="odd2odd-pass2"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="*" mode="odd2odd-pass2">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates mode="odd2odd-pass2" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="tei:content" mode="odd2odd-pass2">
-    <xsl:variable name="content">
-      <xsl:copy>
-        <xsl:copy-of select="@*"/>
-        <xsl:apply-templates mode="odd2odd-pass2"/>
-      </xsl:copy>
-    </xsl:variable>
-    <xsl:apply-templates select="$content" mode="odd2odd-pass3"/>
-  </xsl:template>
+	<xsl:template match="tei:content" mode="odd2odd-pass2">
+		<xsl:variable name="content">
+			<xsl:copy>
+				<xsl:copy-of select="@*" />
+				<xsl:apply-templates mode="odd2odd-pass2" />
+			</xsl:copy>
+		</xsl:variable>
+		<xsl:apply-templates select="$content"
+			mode="odd2odd-pass3" />
+	</xsl:template>
 
 
-  <xsl:template match="tei:classSpec" mode="odd2odd-pass2">
-    <xsl:variable name="used">
-      <xsl:call-template name="odd2odd-amINeeded"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$used=''">
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Reject unused class <xsl:value-of select="@ident"/>
-               </xsl:message>
-        </xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:copy-of select="@*"/>
-          <xsl:apply-templates mode="odd2odd-pass2"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="odd2odd-amINeeded">
-    <!--
-How can a class be ok?
-  a) if an element is a member of it
-  b) if its referred to in a content model
-  c) if some other class is a member of it, and that class is OK
--->
-    <xsl:variable name="k" select="@ident"/>
-    <xsl:choose>
-      <xsl:when test="$autoGlobal='true' and starts-with(@ident,'att.global')">y</xsl:when>
-      <xsl:when test="self::tei:classSpec and $stripped='true'">y</xsl:when>
-      <xsl:when test="key('odd2odd-ELEMENT_MEMBERED',$k)">y</xsl:when>
-      <xsl:when test="key('odd2odd-REFED',$k)">y</xsl:when>
-      <xsl:when test="key('odd2odd-CLASS_MEMBERED',$k)">
-        <xsl:for-each select="key('odd2odd-CLASS_MEMBERED',$k)">
-          <xsl:call-template name="odd2odd-amINeeded"/>
-        </xsl:for-each>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec" mode="odd2odd-pass2">
-    <xsl:variable name="k">
-      <xsl:value-of select="@prefix"/>
-      <xsl:value-of select="@ident"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$stripped='true' and starts-with($k,'macro.')"/>
-      <xsl:when test="key('odd2odd-REFED',$k)">
-	<macroSpec xmlns="http://www.tei-c.org/ns/1.0" >
-          <xsl:copy-of select="@*"/>
-          <xsl:apply-templates mode="odd2odd-pass2"/>
-	</macroSpec>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:if test="$verbose='true'">
-          <xsl:message>Reject unused macro <xsl:value-of select="$k"/></xsl:message>
-        </xsl:if>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:classSpec" mode="odd2odd-pass2">
+		<xsl:variable name="used">
+			<xsl:call-template name="odd2odd-amINeeded" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$used=''">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Reject unused class
+						<xsl:value-of select="@ident" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates mode="odd2odd-pass2" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="odd2odd-amINeeded">
+		<!-- How can a class be ok? a) if an element is a member of it b) if its 
+			referred to in a content model c) if some other class is a member of it, 
+			and that class is OK -->
+		<xsl:variable name="k" select="@ident" />
+		<xsl:choose>
+			<xsl:when
+				test="$autoGlobal='true' and starts-with(@ident,'att.global')">
+				y
+			</xsl:when>
+			<xsl:when test="self::tei:classSpec and $stripped='true'">
+				y
+			</xsl:when>
+			<xsl:when test="key('odd2odd-ELEMENT_MEMBERED',$k)">
+				y
+			</xsl:when>
+			<xsl:when test="key('odd2odd-REFED',$k)">
+				y
+			</xsl:when>
+			<xsl:when test="key('odd2odd-CLASS_MEMBERED',$k)">
+				<xsl:for-each select="key('odd2odd-CLASS_MEMBERED',$k)">
+					<xsl:call-template name="odd2odd-amINeeded" />
+				</xsl:for-each>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:macroSpec" mode="odd2odd-pass2">
+		<xsl:variable name="k">
+			<xsl:value-of select="@prefix" />
+			<xsl:value-of select="@ident" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="$stripped='true' and starts-with($k,'macro.')" />
+			<xsl:when test="key('odd2odd-REFED',$k)">
+				<macroSpec xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates mode="odd2odd-pass2" />
+				</macroSpec>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Reject unused macro
+						<xsl:value-of select="$k" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="odd2odd-checkObject">
-    <xsl:param name="why"/>
-    <xsl:param name="Source" tunnel="yes"/>
-    <!--
-        for every object
-         - if its in DELETE list, ignore
-         - if its in REPLACE list, use that
-         - if its in CHANGE list
-           (do the hard merge bit)
-         - otherwise copy 
-        done
-  -->
-      <xsl:variable name="Current" select="."/>
-      <xsl:variable name="specName">
-	<xsl:choose>
-	  <xsl:when test="@ns">
-	    <xsl:value-of select="@ns"/>
-	  </xsl:when>
-	  <xsl:when test="ancestor::tei:schemaSpec/@ns">
-	    <xsl:value-of select="ancestor::tei:schemaSpec/@ns"/>
-	  </xsl:when>
-	</xsl:choose>
-	<xsl:value-of select="@ident"/>
-      </xsl:variable>
-      <xsl:variable name="N" select="local-name(.)"/>
-      <xsl:for-each select="$ODD">
-        <xsl:choose>
-          <xsl:when test="key('odd2odd-DELETE',$specName)">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>Phase 1: remove <xsl:value-of select="$specName"/></xsl:message>
-            </xsl:if>
-          </xsl:when>
-	  <xsl:when test="key('odd2odd-REPLACE',$specName)">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>Phase 1: replace <xsl:value-of select="$specName"/></xsl:message>
-            </xsl:if>
-            <xsl:apply-templates mode="odd2odd-copy" select="key('odd2odd-REPLACE',$specName)"/>
-          </xsl:when>
-          <xsl:when test="key('odd2odd-CHANGE',$specName)">
-            <xsl:if test="$verbose='true'">
-              <xsl:message>Phase 1: change <xsl:value-of select="$specName"/></xsl:message>
-            </xsl:if>
-            <xsl:apply-templates mode="odd2odd-change" select="$Current"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:if test="$verbose='true'">
-	      <xsl:message>Phase 1: include <xsl:value-of
-	      select="$specName"/> from <xsl:value-of
-	      select="$Source"/> (<xsl:value-of select="$why"/>)</xsl:message>
-            </xsl:if>
-            <xsl:apply-templates mode="odd2odd-copy" select="$Current"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="odd2odd-checkObject">
+		<xsl:param name="why" />
+		<xsl:param name="Source" tunnel="yes" />
+		<!-- for every object - if its in DELETE list, ignore - if its in REPLACE 
+			list, use that - if its in CHANGE list (do the hard merge bit) - otherwise 
+			copy done -->
+		<xsl:variable name="Current" select="." />
+		<xsl:variable name="specName">
+			<xsl:choose>
+				<xsl:when test="@ns">
+					<xsl:value-of select="@ns" />
+				</xsl:when>
+				<xsl:when test="ancestor::tei:schemaSpec/@ns">
+					<xsl:value-of select="ancestor::tei:schemaSpec/@ns" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:value-of select="@ident" />
+		</xsl:variable>
+		<xsl:variable name="N" select="local-name(.)" />
+		<xsl:for-each select="$ODD">
+			<xsl:choose>
+				<xsl:when test="key('odd2odd-DELETE',$specName)">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Phase 1: remove
+							<xsl:value-of select="$specName" />
+						</xsl:message>
+					</xsl:if>
+				</xsl:when>
+				<xsl:when test="key('odd2odd-REPLACE',$specName)">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Phase 1: replace
+							<xsl:value-of select="$specName" />
+						</xsl:message>
+					</xsl:if>
+					<xsl:apply-templates mode="odd2odd-copy"
+						select="key('odd2odd-REPLACE',$specName)" />
+				</xsl:when>
+				<xsl:when test="key('odd2odd-CHANGE',$specName)">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Phase 1: change
+							<xsl:value-of select="$specName" />
+						</xsl:message>
+					</xsl:if>
+					<xsl:apply-templates mode="odd2odd-change"
+						select="$Current" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Phase 1: include
+							<xsl:value-of select="$specName" />
+							from
+							<xsl:value-of select="$Source" />
+							(
+							<xsl:value-of select="$why" />
+							)
+						</xsl:message>
+					</xsl:if>
+					<xsl:apply-templates mode="odd2odd-copy"
+						select="$Current" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template match="@*|processing-instruction()|text()" mode="odd2odd-change">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="@*|processing-instruction()|text()"
+		mode="odd2odd-change">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="*" mode="odd2odd-change">
-    <xsl:copy>
-      <xsl:apply-templates mode="odd2odd-change" select="*|@*|processing-instruction()|text()"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="*" mode="odd2odd-change">
+		<xsl:copy>
+			<xsl:apply-templates mode="odd2odd-change"
+				select="*|@*|processing-instruction()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="@*|processing-instruction()|text()" mode="odd2odd-copy">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="@*|processing-instruction()|text()"
+		mode="odd2odd-copy">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="tei:memberOf" mode="odd2odd-copy">
-    <xsl:variable name="k" select="@key"/>
-    <xsl:choose>
-      <xsl:when test="$ODD/key('odd2odd-DELETE',$k)"/>      
-      <xsl:otherwise>
-	<memberOf xmlns="http://www.tei-c.org/ns/1.0" key="{$k}">
-	  <xsl:copy-of select="@min|@max"/>
-	</memberOf>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:memberOf" mode="odd2odd-copy">
+		<xsl:variable name="k" select="@key" />
+		<xsl:choose>
+			<xsl:when test="$ODD/key('odd2odd-DELETE',$k)" />
+			<xsl:otherwise>
+				<memberOf xmlns="http://www.tei-c.org/ns/1.0" key="{$k}">
+					<xsl:copy-of select="@min|@max" />
+				</memberOf>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="*" mode="odd2odd-copy">
-    <xsl:copy>
-      <xsl:apply-templates mode="odd2odd-copy" select="*|@*|processing-instruction()|text()"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="*" mode="odd2odd-copy">
+		<xsl:copy>
+			<xsl:apply-templates mode="odd2odd-copy"
+				select="*|@*|processing-instruction()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="tei:elementSpec/@mode" mode="odd2odd-change">
-    <xsl:copy/>
-  </xsl:template>
+	<xsl:template match="tei:elementSpec/@mode"
+		mode="odd2odd-change">
+		<xsl:copy />
+	</xsl:template>
 
-  <xsl:template match="tei:listRef" mode="odd2odd-copy"/>
+	<xsl:template match="tei:listRef" mode="odd2odd-copy" />
 
-  <xsl:template match="tei:elementSpec" mode="odd2odd-copy">
-    <xsl:copy>
-      <xsl:choose>
-	<xsl:when test="@module"/>
-	<xsl:when test="ancestor::tei:schemaSpec/@module">
-	  <xsl:copy-of select="ancestor::tei:schemaSpec/@module"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:attribute name="module">
+	<xsl:template match="tei:elementSpec" mode="odd2odd-copy">
+		<xsl:copy>
+			<xsl:choose>
+				<xsl:when test="@module" />
+				<xsl:when test="ancestor::tei:schemaSpec/@module">
+					<xsl:copy-of select="ancestor::tei:schemaSpec/@module" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="module">
 	    <xsl:text>derived-module-</xsl:text>
-	    <xsl:value-of select="ancestor::tei:schemaSpec/@ident"/>
+	    <xsl:value-of
+						select="ancestor::tei:schemaSpec/@ident" />
 	  </xsl:attribute>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:call-template name="odd2odd-copyElementSpec">
-	<xsl:with-param name="n" select="'1'"/>
-      </xsl:call-template>
-    </xsl:copy>
-  </xsl:template>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:call-template name="odd2odd-copyElementSpec">
+				<xsl:with-param name="n" select="'1'" />
+			</xsl:call-template>
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template name="odd2odd-copyElementSpec">
-    <xsl:param name="n"/>
-    <xsl:param name="Source" tunnel="yes"/>
-      <xsl:variable name="orig" select="."/>
-      <xsl:apply-templates mode="odd2odd-copy" select="@*"/>
-      <xsl:apply-templates mode="odd2odd-justcopy" select="tei:altIdent"/>
-      <xsl:if test="$stripped='false'">
-        <xsl:apply-templates mode="odd2odd-copy" select="tei:equiv"/>
-        <xsl:apply-templates mode="odd2odd-justcopy" select="tei:gloss"/>
-        <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-      </xsl:if>
-      <xsl:apply-templates mode="odd2odd-justcopy" select="tei:classes"/>
-      <xsl:apply-templates mode="odd2odd-copy" select="tei:content"/>
-      <xsl:apply-templates mode="odd2odd-copy" select="tei:constraintSpec"/>
-      <attList xmlns="http://www.tei-c.org/ns/1.0">
-        <xsl:call-template name="odd2odd-addClassAttsToCopy"/>
-        <xsl:choose>
-          <xsl:when test="tei:attList[@org='choice']">
-            <xsl:for-each select="tei:attList">
-              <xsl:copy>
-                <xsl:copy-of select="@*"/>
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attDef[@mode='add' or not(@mode)]"/>
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attRef"/>
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attList"/>
-              </xsl:copy>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attList/tei:attDef[@mode='add' or not(@mode)]"/>
-            <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attList/tei:attRef"/>
-            <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attList/tei:attList"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </attList>
-      <xsl:if test="$stripped='false'">
-        <xsl:apply-templates mode="odd2odd-justcopy" select="tei:exemplum"/>
-        <xsl:apply-templates mode="odd2odd-justcopy" select="tei:remarks"/>
-        <xsl:apply-templates mode="odd2odd-justcopy" select="tei:listRef"/>
-      </xsl:if>
-  </xsl:template>
+	<xsl:template name="odd2odd-copyElementSpec">
+		<xsl:param name="n" />
+		<xsl:param name="Source" tunnel="yes" />
+		<xsl:variable name="orig" select="." />
+		<xsl:apply-templates mode="odd2odd-copy"
+			select="@*" />
+		<xsl:apply-templates mode="odd2odd-justcopy"
+			select="tei:altIdent" />
+		<xsl:if test="$stripped='false'">
+			<xsl:apply-templates mode="odd2odd-copy"
+				select="tei:equiv" />
+			<xsl:apply-templates mode="odd2odd-justcopy"
+				select="tei:gloss" />
+			<xsl:apply-templates mode="odd2odd-justcopy"
+				select="tei:desc" />
+		</xsl:if>
+		<xsl:apply-templates mode="odd2odd-justcopy"
+			select="tei:classes" />
+		<xsl:apply-templates mode="odd2odd-copy"
+			select="tei:content" />
+		<xsl:apply-templates mode="odd2odd-copy"
+			select="tei:constraintSpec" />
+		<attList xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:call-template
+				name="odd2odd-addClassAttsToCopy" />
+			<xsl:choose>
+				<xsl:when test="tei:attList[@org='choice']">
+					<xsl:for-each select="tei:attList">
+						<xsl:copy>
+							<xsl:copy-of select="@*" />
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:attDef[@mode='add' or not(@mode)]" />
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:attRef" />
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:attList" />
+						</xsl:copy>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:attList/tei:attDef[@mode='add' or not(@mode)]" />
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:attList/tei:attRef" />
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:attList/tei:attList" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</attList>
+		<xsl:if test="$stripped='false'">
+			<xsl:apply-templates mode="odd2odd-justcopy"
+				select="tei:exemplum" />
+			<xsl:apply-templates mode="odd2odd-justcopy"
+				select="tei:remarks" />
+			<xsl:apply-templates mode="odd2odd-justcopy"
+				select="tei:listRef" />
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template name="odd2odd-addClassAttsToCopy">
-    <xsl:if test="$autoGlobal='true' and (not(@ns) or @ns='http://www.tei-c.org/ns/1.0' or @ns='http://www.tei-c.org/ns/Examples')">
-      <xsl:call-template name="odd2odd-classAttributes">
-        <xsl:with-param name="whence">1</xsl:with-param>
-        <xsl:with-param name="elementName" select="@ident"/>
-        <xsl:with-param name="className" select="'att.global'"/>
-      </xsl:call-template>
-    </xsl:if>
-    <xsl:for-each select="tei:classes/tei:memberOf">
-      <xsl:call-template name="odd2odd-classAttributes">
-        <xsl:with-param name="whence">2</xsl:with-param>
-        <xsl:with-param name="elementName" select="../../@ident"/>
-        <xsl:with-param name="className" select="@key"/>
-      </xsl:call-template>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="tei:elementSpec" mode="odd2odd-change">
-    <xsl:variable name="elementName">
-      <xsl:value-of select="concat(@ns,@ident)"/>
-    </xsl:variable>
+	<xsl:template name="odd2odd-addClassAttsToCopy">
+		<xsl:if
+			test="$autoGlobal='true' and (not(@ns) or @ns='http://www.tei-c.org/ns/1.0' or @ns='http://www.tei-c.org/ns/Examples')">
+			<xsl:call-template name="odd2odd-classAttributes">
+				<xsl:with-param name="whence">
+					1
+				</xsl:with-param>
+				<xsl:with-param name="elementName" select="@ident" />
+				<xsl:with-param name="className"
+					select="'att.global'" />
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:for-each select="tei:classes/tei:memberOf">
+			<xsl:call-template name="odd2odd-classAttributes">
+				<xsl:with-param name="whence">
+					2
+				</xsl:with-param>
+				<xsl:with-param name="elementName"
+					select="../../@ident" />
+				<xsl:with-param name="className" select="@key" />
+			</xsl:call-template>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="tei:elementSpec"
+		mode="odd2odd-change">
+		<xsl:variable name="elementName">
+			<xsl:value-of select="concat(@ns,@ident)" />
+		</xsl:variable>
 
-    <xsl:variable name="ORIGINAL" select="."/>
-    <xsl:copy>
-      <xsl:attribute name="rend">change</xsl:attribute>
-      <xsl:apply-templates mode="odd2odd-change" select="@*"/>
-      <!-- 
-For each element, go through most of the sections one by one
-and see if they are present in the change mode version.
-If so, use them as is. The constraints and attributes are identifiable
-for change individually.
- -->
-      <xsl:for-each select="$ODD">
-        <xsl:for-each select="key('odd2odd-CHANGE',$elementName)">
-	  <xsl:if test="$verbose='true'">
-	    <xsl:message>Change <xsl:value-of select="$elementName"/></xsl:message>
-	  </xsl:if>
-          <xsl:copy-of select="@ns"/>
-          <!-- if there is an altIdent, use it -->
-          <xsl:apply-templates mode="odd2odd-justcopy" select="tei:altIdent"/>
-          <!-- equiv, gloss, desc trio -->
-          <xsl:choose>
-            <xsl:when test="tei:equiv">
-              <xsl:apply-templates mode="odd2odd-copy" select="tei:equiv"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-copy" select="tei:equiv"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="tei:gloss">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:gloss"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:gloss"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="$stripped='true'"/>
-            <xsl:when test="tei:desc">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <!-- classes -->
-          <classes xmlns="http://www.tei-c.org/ns/1.0">
-            <xsl:choose>
-              <xsl:when test="tei:classes[@mode='change']">
-                <xsl:for-each select="tei:classes/tei:memberOf">
-                  <xsl:choose>
-                    <xsl:when test="@mode='delete'"/>
-                    <xsl:when test="@mode='add' or not (@mode)">
-                      <memberOf key="{@key}">
-			<xsl:copy-of select="@min|@max"/>
-		      </memberOf>
-                    </xsl:when>
-                  </xsl:choose>
-                </xsl:for-each>
-                <xsl:for-each select="$ORIGINAL">
-                  <xsl:for-each select="tei:classes/tei:memberOf">
-                    <xsl:variable name="me">
-                      <xsl:value-of select="@key"/>
-                    </xsl:variable>
-                    <xsl:variable name="metoo">
-                      <xsl:value-of select="concat(../../@ident,@key)"/>
-                    </xsl:variable>
-                    <xsl:for-each select="$ODD">
-                      <xsl:choose>
-                        <xsl:when test="key('odd2odd-DELETE',$me)"> </xsl:when>
-                        <xsl:when test="key('odd2odd-MEMBEROFDELETE',$metoo)"> </xsl:when>
-                        <xsl:when test="key('odd2odd-MEMBEROFADD',$metoo)"> </xsl:when>
-                        <xsl:otherwise>
-                          <memberOf key="{$me}"/>
-                        </xsl:otherwise>
-                      </xsl:choose>
-                    </xsl:for-each>
-                  </xsl:for-each>
-                </xsl:for-each>
-              </xsl:when>
-              <xsl:when test="tei:classes">
-                <xsl:for-each select="tei:classes/tei:memberOf">
-                  <xsl:copy-of select="."/>
-                </xsl:for-each>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:for-each select="$ORIGINAL">
-                  <xsl:for-each select="tei:classes/tei:memberOf">
-                    <xsl:variable name="me">
-                      <xsl:value-of select="@key"/>
-                    </xsl:variable>
-                    <xsl:for-each select="$ODD">
-                      <xsl:if test="not(key('odd2odd-DELETE',$me))">
-                        <memberOf key="{$me}"/>
-                      </xsl:if>
-                    </xsl:for-each>
-                  </xsl:for-each>
-                </xsl:for-each>
-              </xsl:otherwise>
-            </xsl:choose>
-          </classes>
-          <!-- valList -->
-          <xsl:choose>
-            <xsl:when test="tei:valList[@mode='delete']"/>
-            <xsl:when test="tei:valList">
-              <xsl:apply-templates mode="odd2odd-copy" select="tei:valList[1]"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-copy" select="tei:valList"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <!-- element content -->
-          <content xmlns="http://www.tei-c.org/ns/1.0">
-            <xsl:choose>
-              <xsl:when test="tei:content/rng:*">
-                <xsl:apply-templates mode="odd2odd-copy" select="tei:content/*"/>
-              </xsl:when>
-              <xsl:when test="tei:content/tei:*">
-                <xsl:apply-templates mode="odd2odd-copy" select="tei:content/*"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:for-each select="$ORIGINAL">
-                  <xsl:apply-templates mode="odd2odd-copy" select="tei:content/*"/>
-                </xsl:for-each>
-              </xsl:otherwise>
-            </xsl:choose>
-          </content>
-          <!-- element constraints -->
-          <xsl:call-template name="odd2odd-processConstraints">
-            <xsl:with-param name="ORIGINAL" select="$ORIGINAL"/>
-            <xsl:with-param name="elementName" select="$elementName"/>
-          </xsl:call-template>
-          <!-- attList -->
-          <attList xmlns="http://www.tei-c.org/ns/1.0">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attList/@org"/>
-            <xsl:call-template name="odd2odd-processAttributes">
-              <xsl:with-param name="ORIGINAL" select="$ORIGINAL"/>
-              <xsl:with-param name="elementName" select="$elementName"/>
-            </xsl:call-template>
-          </attList>
-          <!-- exemplum, remarks and listRef are either replacements or not -->
-          <xsl:choose>
-            <xsl:when test="$stripped='true'"/>
-            <xsl:when test="tei:exemplum">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:exemplum"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:exemplum"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="$stripped='true'"/>
-            <xsl:when test="tei:remarks">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:remarks"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:remarks"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="tei:listRef">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:listRef"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:listRef"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each>
-      </xsl:for-each>
-    </xsl:copy>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec" mode="odd2odd-change">
-    <xsl:variable name="elementName">
-      <xsl:value-of select="concat(@ns,@ident)"/>
-    </xsl:variable>
-    <xsl:variable name="ORIGINAL" select="."/>
-    <xsl:copy>
-      <xsl:attribute name="rend">change</xsl:attribute>
-      <xsl:apply-templates mode="odd2odd-change" select="@*"/>
-      <!-- 
-	   For each macro, go through most of the sections one by one
-	   and see if they are present in the change mode version.
-	   If so, use them as is. 
-      -->
-      <xsl:for-each select="$ODD">
-        <xsl:for-each select="key('odd2odd-CHANGE',$elementName)">
-          <!-- if there is an altIdent, use it -->
-          <xsl:apply-templates mode="odd2odd-justcopy" select="tei:altIdent"/>
-          <!-- equiv, gloss, desc trio -->
-          <xsl:choose>
-            <xsl:when test="$stripped='true'"/>
-            <xsl:when test="tei:equiv">
-              <xsl:apply-templates mode="odd2odd-copy" select="tei:equiv"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-copy" select="tei:equiv"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="tei:gloss">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:gloss"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:gloss"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="$stripped='true'"/>
-            <xsl:when test="tei:desc">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <!-- content -->
-          <xsl:choose>
-            <xsl:when test="tei:content">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:content"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-copy" select="tei:content"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="tei:valList">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:valList[1]"/>
-            </xsl:when>
-            <xsl:when test="tei:stringVal">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:stringVal"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-copy" select="tei:stringVal"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <!-- exemplum, remarks and listRef are either replacements or not -->
-          <xsl:choose>
-            <xsl:when test="$stripped='true'"/>
-            <xsl:when test="tei:exemplum">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:exemplum"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:exemplum"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="tei:remarks">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:remarks"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:remarks"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="$stripped='true'"/>
-            <xsl:when test="tei:listRef">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:listRef"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:listRef"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each>
-      </xsl:for-each>
-    </xsl:copy>
-  </xsl:template>
-  <xsl:template match="tei:classSpec" mode="odd2odd-change">
-    <xsl:variable name="className">
-	<xsl:value-of select="concat(@ns,@ident)"/>
-    </xsl:variable>
-    <xsl:variable name="ORIGINAL" select="."/>
-    <xsl:copy>
-      <xsl:attribute name="rend">change</xsl:attribute>
-      <xsl:apply-templates mode="odd2odd-change" select="@*"/>
-      <!-- for each section of the class spec, 
-     go through the sections one by one
-     and see if they are present in the change mode version -->
-      <xsl:for-each select="$ODD">
-        <xsl:for-each select="key('odd2odd-CHANGE',$className)">
-          <!-- context is now a classSpec in change mode in the ODD spec -->
-          <!-- description -->
-          <xsl:choose>
-            <xsl:when test="$stripped='true'"/>
-            <xsl:when test="tei:desc">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:for-each select="$ORIGINAL">
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-              </xsl:for-each>
-            </xsl:otherwise>
-          </xsl:choose>
-          <!-- classes -->
-          <classes xmlns="http://www.tei-c.org/ns/1.0">
-            <xsl:choose>
-              <xsl:when test="tei:classes[@mode='change']">
-                <xsl:for-each select="tei:classes/tei:memberOf">
-                  <xsl:choose>
-                    <xsl:when test="@mode='delete'"/>
-                    <xsl:when test="@mode='add' or not (@mode)">
-                      <memberOf key="{@key}"/>
-                    </xsl:when>
-                  </xsl:choose>
-                </xsl:for-each>
-                <xsl:for-each select="$ORIGINAL">
-                  <xsl:for-each select="tei:classes/tei:memberOf">
-                    <xsl:variable name="me">
-                      <xsl:value-of select="@key"/>
-                    </xsl:variable>
-                    <xsl:variable name="metoo">
-                      <xsl:value-of select="concat(../../@ident,@key)"/>
-                    </xsl:variable>
-                    <xsl:for-each select="$ODD">
-                      <xsl:choose>
-                        <xsl:when test="key('odd2odd-DELETE',$me)"> </xsl:when>
-                        <xsl:when test="key('odd2odd-MEMBEROFDELETE',$metoo)"> </xsl:when>
-                        <xsl:when test="key('odd2odd-MEMBEROFADD',$metoo)"> </xsl:when>
-                        <xsl:otherwise>
-                          <memberOf key="{$me}"/>
-                        </xsl:otherwise>
-                      </xsl:choose>
-                    </xsl:for-each>
-                  </xsl:for-each>
-                </xsl:for-each>
-              </xsl:when>
-              <xsl:when test="tei:classes">
-                <xsl:for-each select="tei:classes/tei:memberOf">
-                  <xsl:copy-of select="."/>
-                </xsl:for-each>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:for-each select="$ORIGINAL">
-                  <xsl:for-each select="tei:classes/tei:memberOf">
-                    <xsl:variable name="me">
-                      <xsl:value-of select="@key"/>
-                    </xsl:variable>
-                    <xsl:for-each select="$ODD">
-                      <xsl:if test="not(key('odd2odd-DELETE',$me))">
-                        <memberOf key="{$me}"/>
-                      </xsl:if>
-                    </xsl:for-each>
-                  </xsl:for-each>
-                </xsl:for-each>
-              </xsl:otherwise>
-            </xsl:choose>
-          </classes>
-          <!-- attList -->
-          <attList xmlns="http://www.tei-c.org/ns/1.0">
-            <xsl:call-template name="odd2odd-processAttributes">
-              <xsl:with-param name="ORIGINAL" select="$ORIGINAL"/>
-              <xsl:with-param name="elementName" select="''"/>
-            </xsl:call-template>
-            <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attList/tei:attRef"/>
-          </attList>
-        </xsl:for-each>
-      </xsl:for-each>
-    </xsl:copy>
-  </xsl:template>
-  <xsl:template match="rng:choice|rng:list|rng:group|rng:optional|rng:oneOrMore|rng:zeroOrMore" mode="odd2odd-copy">
-    <xsl:call-template name="odd2odd-simplifyRelax"/>
-  </xsl:template>
-  <xsl:template name="odd2odd-simplifyRelax">
-    <xsl:variable name="element">
-      <xsl:value-of select="local-name(.)"/>
-    </xsl:variable>
-    <!-- 
-for each RELAX NG content model,
-remove reference to any elements which have been
-deleted, or to classes which are empty.
-This may make the container empty,
-so that is only put back in if there is some content
--->
-    <xsl:variable name="contents">
-      <WHAT>
-        <xsl:for-each select="a:*|rng:*|processing-instruction()">
-          <xsl:choose>
-            <xsl:when test="self::a:*">
-              <xsl:copy-of select="."/>
-            </xsl:when>
-            <xsl:when test="self::processing-instruction()">
-              <xsl:copy-of select="."/>
-            </xsl:when>
-            <xsl:when test="self::rng:element">
-              <element xmlns="http://relaxng.org/ns/structure/1.0">
-                <xsl:copy-of select="@*"/>
-                <xsl:apply-templates mode="odd2odd-copy"/>
-              </element>
-            </xsl:when>
-            <xsl:when test="self::rng:name">
-              <name xmlns="http://relaxng.org/ns/structure/1.0">
-                <xsl:copy-of select="@*"/>
-                <xsl:apply-templates mode="odd2odd-copy"/>
-              </name>
-            </xsl:when>
-            <xsl:when test="self::rng:attribute">
-              <attribute xmlns="http://relaxng.org/ns/structure/1.0">
-                <xsl:copy-of select="@*"/>
-                <xsl:apply-templates mode="odd2odd-copy"/>
-              </attribute>
-            </xsl:when>
-            <xsl:when test="self::rng:data">
-              <data xmlns="http://relaxng.org/ns/structure/1.0">
-                <xsl:copy-of select="@*"/>
-                <xsl:apply-templates mode="odd2odd-copy"/>
-              </data>
-            </xsl:when>
-            <xsl:when test="self::rng:text">
-              <text xmlns="http://relaxng.org/ns/structure/1.0"/>
-            </xsl:when>
-            <xsl:when test="self::rng:value">
-              <value xmlns="http://relaxng.org/ns/structure/1.0">
-                <xsl:apply-templates/>
-              </value>
-            </xsl:when>
-            <xsl:when test="self::rng:ref">
-              <xsl:variable name="N" select="@name"/>
-              <xsl:for-each select="$ODD">
-                <xsl:choose>
-                  <xsl:when test="$stripped='true'">
-                    <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$N}"/>
-                  </xsl:when>
-                  <xsl:when test="key('odd2odd-DELETE',$N)"/>
-                  <xsl:otherwise>
-                    <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$N}"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </xsl:for-each>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:call-template name="odd2odd-simplifyRelax"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each>
-      </WHAT>
-    </xsl:variable>
-    <xsl:variable name="entCount">
-      <xsl:for-each select="$contents/WHAT">
-        <xsl:value-of select="count(*)"/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:for-each select="$contents/WHAT">
-      <xsl:choose>
-        <xsl:when test="$entCount=1     and local-name(*)=$element">
-          <xsl:copy-of select="*|@*|text()|processing-instruction()"/>
-        </xsl:when>
-        <xsl:when test="$element='optional'     and $entCount=1     and rng:zeroOrMore">
-          <xsl:copy-of select="*|@*|text()|processing-instruction()"/>
-        </xsl:when>
-        <xsl:when test="$element='optional'     and $entCount=1     and rng:oneOrMore">
-          <xsl:copy-of select="*|@*|text()|processing-instruction()"/>
-        </xsl:when>
-        <xsl:when test="$element='oneOrMore'     and $entCount=1     and rng:zeroOrMore">
-          <oneOrMore xmlns="http://relaxng.org/ns/structure/1.0">
-            <xsl:copy-of select="rng:zeroOrMore/*"/>
-          </oneOrMore>
-        </xsl:when>
-        <xsl:when test="self::rng:zeroOrMore/rng:ref/@name='model.global'        and preceding-sibling::rng:*[1][self::rng:zeroOrMore/rng:ref/@name='model.global']"/>
-        <xsl:when test="$entCount&gt;0 or $stripped='true'">
-          <xsl:element xmlns="http://relaxng.org/ns/structure/1.0" name="{$element}">
-            <xsl:copy-of select="*|@*|text()|processing-instruction()"/>
-          </xsl:element>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
+		<xsl:variable name="ORIGINAL" select="." />
+		<xsl:copy>
+			<xsl:attribute name="rend">change</xsl:attribute>
+			<xsl:apply-templates mode="odd2odd-change"
+				select="@*" />
+			<!-- For each element, go through most of the sections one by one and 
+				see if they are present in the change mode version. If so, use them as is. 
+				The constraints and attributes are identifiable for change individually. -->
+			<xsl:for-each select="$ODD">
+				<xsl:for-each
+					select="key('odd2odd-CHANGE',$elementName)">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Change
+							<xsl:value-of select="$elementName" />
+						</xsl:message>
+					</xsl:if>
+					<xsl:copy-of select="@ns" />
+					<!-- if there is an altIdent, use it -->
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:altIdent" />
+					<!-- equiv, gloss, desc trio -->
+					<xsl:choose>
+						<xsl:when test="tei:equiv">
+							<xsl:apply-templates mode="odd2odd-copy"
+								select="tei:equiv" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-copy"
+									select="tei:equiv" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="tei:gloss">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:gloss" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:gloss" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="$stripped='true'" />
+						<xsl:when test="tei:desc">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:desc" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:desc" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- classes -->
+					<classes xmlns="http://www.tei-c.org/ns/1.0">
+						<xsl:choose>
+							<xsl:when test="tei:classes[@mode='change']">
+								<xsl:for-each select="tei:classes/tei:memberOf">
+									<xsl:choose>
+										<xsl:when test="@mode='delete'" />
+										<xsl:when test="@mode='add' or not (@mode)">
+											<memberOf key="{@key}">
+												<xsl:copy-of select="@min|@max" />
+											</memberOf>
+										</xsl:when>
+									</xsl:choose>
+								</xsl:for-each>
+								<xsl:for-each select="$ORIGINAL">
+									<xsl:for-each select="tei:classes/tei:memberOf">
+										<xsl:variable name="me">
+											<xsl:value-of select="@key" />
+										</xsl:variable>
+										<xsl:variable name="metoo">
+											<xsl:value-of select="concat(../../@ident,@key)" />
+										</xsl:variable>
+										<xsl:for-each select="$ODD">
+											<xsl:choose>
+												<xsl:when test="key('odd2odd-DELETE',$me)">
+												</xsl:when>
+												<xsl:when
+													test="key('odd2odd-MEMBEROFDELETE',$metoo)">
+												</xsl:when>
+												<xsl:when test="key('odd2odd-MEMBEROFADD',$metoo)">
+												</xsl:when>
+												<xsl:otherwise>
+													<memberOf key="{$me}" />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:for-each>
+									</xsl:for-each>
+								</xsl:for-each>
+							</xsl:when>
+							<xsl:when test="tei:classes">
+								<xsl:for-each select="tei:classes/tei:memberOf">
+									<xsl:copy-of select="." />
+								</xsl:for-each>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:for-each select="$ORIGINAL">
+									<xsl:for-each select="tei:classes/tei:memberOf">
+										<xsl:variable name="me">
+											<xsl:value-of select="@key" />
+										</xsl:variable>
+										<xsl:for-each select="$ODD">
+											<xsl:if test="not(key('odd2odd-DELETE',$me))">
+												<memberOf key="{$me}" />
+											</xsl:if>
+										</xsl:for-each>
+									</xsl:for-each>
+								</xsl:for-each>
+							</xsl:otherwise>
+						</xsl:choose>
+					</classes>
+					<!-- valList -->
+					<xsl:choose>
+						<xsl:when test="tei:valList[@mode='delete']" />
+						<xsl:when test="tei:valList">
+							<xsl:apply-templates mode="odd2odd-copy"
+								select="tei:valList[1]" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-copy"
+									select="tei:valList" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- element content -->
+					<content xmlns="http://www.tei-c.org/ns/1.0">
+						<xsl:choose>
+							<xsl:when test="tei:content/rng:*">
+								<xsl:apply-templates mode="odd2odd-copy"
+									select="tei:content/*" />
+							</xsl:when>
+							<xsl:when test="tei:content/tei:*">
+								<xsl:apply-templates mode="odd2odd-copy"
+									select="tei:content/*" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:for-each select="$ORIGINAL">
+									<xsl:apply-templates mode="odd2odd-copy"
+										select="tei:content/*" />
+								</xsl:for-each>
+							</xsl:otherwise>
+						</xsl:choose>
+					</content>
+					<!-- element constraints -->
+					<xsl:call-template
+						name="odd2odd-processConstraints">
+						<xsl:with-param name="ORIGINAL" select="$ORIGINAL" />
+						<xsl:with-param name="elementName"
+							select="$elementName" />
+					</xsl:call-template>
+					<!-- attList -->
+					<attList xmlns="http://www.tei-c.org/ns/1.0">
+						<xsl:apply-templates mode="odd2odd-justcopy"
+							select="tei:attList/@org" />
+						<xsl:call-template
+							name="odd2odd-processAttributes">
+							<xsl:with-param name="ORIGINAL" select="$ORIGINAL" />
+							<xsl:with-param name="elementName"
+								select="$elementName" />
+						</xsl:call-template>
+					</attList>
+					<!-- exemplum, remarks and listRef are either replacements or not -->
+					<xsl:choose>
+						<xsl:when test="$stripped='true'" />
+						<xsl:when test="tei:exemplum">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:exemplum" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:exemplum" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="$stripped='true'" />
+						<xsl:when test="tei:remarks">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:remarks" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:remarks" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="tei:listRef">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:listRef" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:listRef" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template match="tei:macroSpec" mode="odd2odd-change">
+		<xsl:variable name="elementName">
+			<xsl:value-of select="concat(@ns,@ident)" />
+		</xsl:variable>
+		<xsl:variable name="ORIGINAL" select="." />
+		<xsl:copy>
+			<xsl:attribute name="rend">change</xsl:attribute>
+			<xsl:apply-templates mode="odd2odd-change"
+				select="@*" />
+			<!-- For each macro, go through most of the sections one by one and see 
+				if they are present in the change mode version. If so, use them as is. -->
+			<xsl:for-each select="$ODD">
+				<xsl:for-each
+					select="key('odd2odd-CHANGE',$elementName)">
+					<!-- if there is an altIdent, use it -->
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:altIdent" />
+					<!-- equiv, gloss, desc trio -->
+					<xsl:choose>
+						<xsl:when test="$stripped='true'" />
+						<xsl:when test="tei:equiv">
+							<xsl:apply-templates mode="odd2odd-copy"
+								select="tei:equiv" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-copy"
+									select="tei:equiv" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="tei:gloss">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:gloss" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:gloss" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="$stripped='true'" />
+						<xsl:when test="tei:desc">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:desc" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:desc" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- content -->
+					<xsl:choose>
+						<xsl:when test="tei:content">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:content" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-copy"
+									select="tei:content" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="tei:valList">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:valList[1]" />
+						</xsl:when>
+						<xsl:when test="tei:stringVal">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:stringVal" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-copy"
+									select="tei:stringVal" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- exemplum, remarks and listRef are either replacements or not -->
+					<xsl:choose>
+						<xsl:when test="$stripped='true'" />
+						<xsl:when test="tei:exemplum">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:exemplum" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:exemplum" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="tei:remarks">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:remarks" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:remarks" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="$stripped='true'" />
+						<xsl:when test="tei:listRef">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:listRef" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:listRef" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template match="tei:classSpec" mode="odd2odd-change">
+		<xsl:variable name="className">
+			<xsl:value-of select="concat(@ns,@ident)" />
+		</xsl:variable>
+		<xsl:variable name="ORIGINAL" select="." />
+		<xsl:copy>
+			<xsl:attribute name="rend">change</xsl:attribute>
+			<xsl:apply-templates mode="odd2odd-change"
+				select="@*" />
+			<!-- for each section of the class spec, go through the sections one by 
+				one and see if they are present in the change mode version -->
+			<xsl:for-each select="$ODD">
+				<xsl:for-each select="key('odd2odd-CHANGE',$className)">
+					<!-- context is now a classSpec in change mode in the ODD spec -->
+					<!-- description -->
+					<xsl:choose>
+						<xsl:when test="$stripped='true'" />
+						<xsl:when test="tei:desc">
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:desc" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="$ORIGINAL">
+								<xsl:apply-templates mode="odd2odd-justcopy"
+									select="tei:desc" />
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- classes -->
+					<classes xmlns="http://www.tei-c.org/ns/1.0">
+						<xsl:choose>
+							<xsl:when test="tei:classes[@mode='change']">
+								<xsl:for-each select="tei:classes/tei:memberOf">
+									<xsl:choose>
+										<xsl:when test="@mode='delete'" />
+										<xsl:when test="@mode='add' or not (@mode)">
+											<memberOf key="{@key}" />
+										</xsl:when>
+									</xsl:choose>
+								</xsl:for-each>
+								<xsl:for-each select="$ORIGINAL">
+									<xsl:for-each select="tei:classes/tei:memberOf">
+										<xsl:variable name="me">
+											<xsl:value-of select="@key" />
+										</xsl:variable>
+										<xsl:variable name="metoo">
+											<xsl:value-of select="concat(../../@ident,@key)" />
+										</xsl:variable>
+										<xsl:for-each select="$ODD">
+											<xsl:choose>
+												<xsl:when test="key('odd2odd-DELETE',$me)">
+												</xsl:when>
+												<xsl:when
+													test="key('odd2odd-MEMBEROFDELETE',$metoo)">
+												</xsl:when>
+												<xsl:when test="key('odd2odd-MEMBEROFADD',$metoo)">
+												</xsl:when>
+												<xsl:otherwise>
+													<memberOf key="{$me}" />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:for-each>
+									</xsl:for-each>
+								</xsl:for-each>
+							</xsl:when>
+							<xsl:when test="tei:classes">
+								<xsl:for-each select="tei:classes/tei:memberOf">
+									<xsl:copy-of select="." />
+								</xsl:for-each>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:for-each select="$ORIGINAL">
+									<xsl:for-each select="tei:classes/tei:memberOf">
+										<xsl:variable name="me">
+											<xsl:value-of select="@key" />
+										</xsl:variable>
+										<xsl:for-each select="$ODD">
+											<xsl:if test="not(key('odd2odd-DELETE',$me))">
+												<memberOf key="{$me}" />
+											</xsl:if>
+										</xsl:for-each>
+									</xsl:for-each>
+								</xsl:for-each>
+							</xsl:otherwise>
+						</xsl:choose>
+					</classes>
+					<!-- attList -->
+					<attList xmlns="http://www.tei-c.org/ns/1.0">
+						<xsl:call-template
+							name="odd2odd-processAttributes">
+							<xsl:with-param name="ORIGINAL" select="$ORIGINAL" />
+							<xsl:with-param name="elementName" select="''" />
+						</xsl:call-template>
+						<xsl:apply-templates mode="odd2odd-justcopy"
+							select="tei:attList/tei:attRef" />
+					</attList>
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template
+		match="rng:choice|rng:list|rng:group|rng:optional|rng:oneOrMore|rng:zeroOrMore"
+		mode="odd2odd-copy">
+		<xsl:call-template name="odd2odd-simplifyRelax" />
+	</xsl:template>
+	<xsl:template name="odd2odd-simplifyRelax">
+		<xsl:variable name="element">
+			<xsl:value-of select="local-name(.)" />
+		</xsl:variable>
+		<!-- for each RELAX NG content model, remove reference to any elements 
+			which have been deleted, or to classes which are empty. This may make the 
+			container empty, so that is only put back in if there is some content -->
+		<xsl:variable name="contents">
+			<WHAT>
+				<xsl:for-each
+					select="a:*|rng:*|processing-instruction()">
+					<xsl:choose>
+						<xsl:when test="self::a:*">
+							<xsl:copy-of select="." />
+						</xsl:when>
+						<xsl:when test="self::processing-instruction()">
+							<xsl:copy-of select="." />
+						</xsl:when>
+						<xsl:when test="self::rng:element">
+							<element xmlns="http://relaxng.org/ns/structure/1.0">
+								<xsl:copy-of select="@*" />
+								<xsl:apply-templates mode="odd2odd-copy" />
+							</element>
+						</xsl:when>
+						<xsl:when test="self::rng:name">
+							<name xmlns="http://relaxng.org/ns/structure/1.0">
+								<xsl:copy-of select="@*" />
+								<xsl:apply-templates mode="odd2odd-copy" />
+							</name>
+						</xsl:when>
+						<xsl:when test="self::rng:attribute">
+							<attribute xmlns="http://relaxng.org/ns/structure/1.0">
+								<xsl:copy-of select="@*" />
+								<xsl:apply-templates mode="odd2odd-copy" />
+							</attribute>
+						</xsl:when>
+						<xsl:when test="self::rng:data">
+							<data xmlns="http://relaxng.org/ns/structure/1.0">
+								<xsl:copy-of select="@*" />
+								<xsl:apply-templates mode="odd2odd-copy" />
+							</data>
+						</xsl:when>
+						<xsl:when test="self::rng:text">
+							<text xmlns="http://relaxng.org/ns/structure/1.0" />
+						</xsl:when>
+						<xsl:when test="self::rng:value">
+							<value xmlns="http://relaxng.org/ns/structure/1.0">
+								<xsl:apply-templates />
+							</value>
+						</xsl:when>
+						<xsl:when test="self::rng:ref">
+							<xsl:variable name="N" select="@name" />
+							<xsl:for-each select="$ODD">
+								<xsl:choose>
+									<xsl:when test="$stripped='true'">
+										<ref xmlns="http://relaxng.org/ns/structure/1.0"
+											name="{$N}" />
+									</xsl:when>
+									<xsl:when test="key('odd2odd-DELETE',$N)" />
+									<xsl:otherwise>
+										<ref xmlns="http://relaxng.org/ns/structure/1.0"
+											name="{$N}" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:for-each>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template name="odd2odd-simplifyRelax" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</WHAT>
+		</xsl:variable>
+		<xsl:variable name="entCount">
+			<xsl:for-each select="$contents/WHAT">
+				<xsl:value-of select="count(*)" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:for-each select="$contents/WHAT">
+			<xsl:choose>
+				<xsl:when test="$entCount=1     and local-name(*)=$element">
+					<xsl:copy-of
+						select="*|@*|text()|processing-instruction()" />
+				</xsl:when>
+				<xsl:when
+					test="$element='optional'     and $entCount=1     and rng:zeroOrMore">
+					<xsl:copy-of
+						select="*|@*|text()|processing-instruction()" />
+				</xsl:when>
+				<xsl:when
+					test="$element='optional'     and $entCount=1     and rng:oneOrMore">
+					<xsl:copy-of
+						select="*|@*|text()|processing-instruction()" />
+				</xsl:when>
+				<xsl:when
+					test="$element='oneOrMore'     and $entCount=1     and rng:zeroOrMore">
+					<oneOrMore xmlns="http://relaxng.org/ns/structure/1.0">
+						<xsl:copy-of select="rng:zeroOrMore/*" />
+					</oneOrMore>
+				</xsl:when>
+				<xsl:when
+					test="self::rng:zeroOrMore/rng:ref/@name='model.global'        and preceding-sibling::rng:*[1][self::rng:zeroOrMore/rng:ref/@name='model.global']" />
+				<xsl:when test="$entCount&gt;0 or $stripped='true'">
+					<xsl:element
+						xmlns="http://relaxng.org/ns/structure/1.0" name="{$element}">
+						<xsl:copy-of
+							select="*|@*|text()|processing-instruction()" />
+					</xsl:element>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="odd2odd-classAttributes">
-    <xsl:param name="elementName"/>
-    <xsl:param name="className"/>
-    <xsl:param name="whence"/>
-    <xsl:param name="Source" tunnel="yes"/>
+	<xsl:template name="odd2odd-classAttributes">
+		<xsl:param name="elementName" />
+		<xsl:param name="className" />
+		<xsl:param name="whence" />
+		<xsl:param name="Source" tunnel="yes" />
 
-    <!-- 
-    On entry, we are sitting on an <elementSpec> or <classSpec> 
-    and seeing if we can pick up some attributes for 
-    $elementName. We travel to the ODD first
-    to see if it has some overrides
-    -->
-    <xsl:for-each select="$ODD">
-      <xsl:choose>
-        <xsl:when test="key('odd2odd-MEMBEROFDELETE',concat($elementName,$className))"> </xsl:when>
-        <!-- the class is referenced in the ODD and has redefined <classes>-->
-        <xsl:when test="key('odd2odd-ATTCLASSES',$className)/tei:classes">
-          <xsl:for-each select="key('odd2odd-ATTCLASSES',$className)">
-            <xsl:call-template name="odd2odd-processClassAttributes">
-              <xsl:with-param name="elementName" select="$elementName"/>
-              <xsl:with-param name="className" select="$className"/>
-              <xsl:with-param name="whence" select="$whence"/>
-              <xsl:with-param name="fromODD">true</xsl:with-param>
-            </xsl:call-template>
-          </xsl:for-each>
-        </xsl:when>
-        <!-- the class is referenced in the ODD and has redefined <attList>-->
-        <xsl:when test="key('odd2odd-ATTCLASSES',$className)/tei:attList">
-          <xsl:for-each select="key('odd2odd-ATTCLASSES',$className)">
-            <xsl:call-template name="odd2odd-processClassAttributes">
-              <xsl:with-param name="elementName" select="$elementName"/>
-              <xsl:with-param name="className" select="$className"/>
-              <xsl:with-param name="whence" select="$whence"/>
-              <xsl:with-param name="fromODD">true</xsl:with-param>
-            </xsl:call-template>
-          </xsl:for-each>
-        </xsl:when>
-        <!-- otherwise, we'll revert to source
-	     (assuming the class is of type 'atts')
-	-->
-        <xsl:otherwise>
-          <xsl:for-each select="document($Source)/tei:TEI">
-            <xsl:for-each select="key('odd2odd-ATTCLASSES',$className)">
-              <xsl:call-template name="odd2odd-processClassAttributes">
-                <xsl:with-param name="elementName" select="$elementName"/>
-                <xsl:with-param name="className" select="$className"/>
-                <xsl:with-param name="whence" select="$whence"/>
-                <xsl:with-param name="fromODD">false</xsl:with-param>
-              </xsl:call-template>
-            </xsl:for-each>
-          </xsl:for-each>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
+		<!-- On entry, we are sitting on an <elementSpec> or <classSpec> and seeing 
+			if we can pick up some attributes for $elementName. We travel to the ODD 
+			first to see if it has some overrides -->
+		<xsl:for-each select="$ODD">
+			<xsl:choose>
+				<xsl:when
+					test="key('odd2odd-MEMBEROFDELETE',concat($elementName,$className))">
+				</xsl:when>
+				<!-- the class is referenced in the ODD and has redefined <classes> -->
+				<xsl:when
+					test="key('odd2odd-ATTCLASSES',$className)/tei:classes">
+					<xsl:for-each
+						select="key('odd2odd-ATTCLASSES',$className)">
+						<xsl:call-template
+							name="odd2odd-processClassAttributes">
+							<xsl:with-param name="elementName"
+								select="$elementName" />
+							<xsl:with-param name="className"
+								select="$className" />
+							<xsl:with-param name="whence" select="$whence" />
+							<xsl:with-param name="fromODD">
+								true
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:when>
+				<!-- the class is referenced in the ODD and has redefined <attList> -->
+				<xsl:when
+					test="key('odd2odd-ATTCLASSES',$className)/tei:attList">
+					<xsl:for-each
+						select="key('odd2odd-ATTCLASSES',$className)">
+						<xsl:call-template
+							name="odd2odd-processClassAttributes">
+							<xsl:with-param name="elementName"
+								select="$elementName" />
+							<xsl:with-param name="className"
+								select="$className" />
+							<xsl:with-param name="whence" select="$whence" />
+							<xsl:with-param name="fromODD">
+								true
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:when>
+				<!-- otherwise, we'll revert to source (assuming the class is of type 
+					'atts') -->
+				<xsl:otherwise>
+					<xsl:for-each select="document($Source)/tei:TEI">
+						<xsl:for-each
+							select="key('odd2odd-ATTCLASSES',$className)">
+							<xsl:call-template
+								name="odd2odd-processClassAttributes">
+								<xsl:with-param name="elementName"
+									select="$elementName" />
+								<xsl:with-param name="className"
+									select="$className" />
+								<xsl:with-param name="whence" select="$whence" />
+								<xsl:with-param name="fromODD">
+									false
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:for-each>
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="odd2odd-processClassAttributes">
-    <xsl:param name="elementName"/>
-    <xsl:param name="className"/>
-    <xsl:param name="fromODD">false</xsl:param>
-    <xsl:param name="whence"/>
-    <xsl:param name="Source" tunnel="yes"/>
+	<xsl:template name="odd2odd-processClassAttributes">
+		<xsl:param name="elementName" />
+		<xsl:param name="className" />
+		<xsl:param name="fromODD">
+			false
+		</xsl:param>
+		<xsl:param name="whence" />
+		<xsl:param name="Source" tunnel="yes" />
 
-    <!-- we are sitting on a attribute classSpec, could be in the ODD
-	 or could be in the source -->
-    <xsl:variable name="M" select="@module"/>
-    <!-- decide whether to proceed with this class at all. if we don't
-    include this class specifically, don't have this module, or we
-    have deleted the class, 
-    we can bypass it now.-->
-    <xsl:variable name="use">
-      <xsl:choose>
-        <xsl:when test="$fromODD='true' and (not(@mode) or @mode='add')">
-          <xsl:text>true</xsl:text>
-        </xsl:when>
-        <xsl:when test="not(@module)">
-          <xsl:text>true</xsl:text>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:for-each select="$ODD">
-            <xsl:choose>
-              <xsl:when test="key('odd2odd-DELETE',$className)">false</xsl:when>
-              <xsl:when test="key('odd2odd-CLASSREFS',$className)">true</xsl:when>
-              <xsl:when test="key('odd2odd-MODULES',$M)">
-                <xsl:text>true</xsl:text>
-              </xsl:when>
-	      <xsl:otherwise>false</xsl:otherwise>
-            </xsl:choose>
-          </xsl:for-each>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <!-- DEBUG-->
-    <!--
-    <xsl:message>START <xsl:value-of select="$whence"/>: <xsl:value-of select="$elementName"/> + <xsl:value-of
-    select="$className"/> [<xsl:value-of select="$M"/>] + <xsl:value-of
-    select="$fromODD"/>, so use=<xsl:value-of select="$use"/></xsl:message>
-    -->
-    <xsl:if test="$use='true'">
-      <!-- 
-	   We need to put in the class attributes. We'll 
-	   use the value of $fromODD to see whether this is in the
-	   current ODD or the source.
-	   
-	   a) the class is new in this customization, add all attributes regardless
-	   b) the class is marked for deletion. do nothing
-	   c) the class is marked for replacement. reference attributes from the replacement
-	   d) the class is marked for change. compare attributes (tedious)
-	   e) the class has no replacement; reference its attributes
-	   
-	   In each case, once we have a potential attribute, we have to check
-	   back to see if it is changed in the element (mergeClassAttribute)
-	   
-	   First, establish whether any attributes in the class,
-	   inherited or otherwise, are changed in the ODD. We will
-	   use this information later
-      -->
-      <xsl:variable name="anyChanged">
-        <xsl:choose>
-          <xsl:when test="$fromODD='false'">
-            <xsl:call-template name="odd2odd-checkClassAttribute">
-              <xsl:with-param name="element" select="$elementName"/>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:for-each select="document($Source)/tei:TEI">
-              <xsl:for-each select="key('odd2odd-ATTCLASSES',$className)">
-                <xsl:call-template name="odd2odd-checkClassAttribute">
-                  <xsl:with-param name="element" select="$elementName"/>
-                </xsl:call-template>
-              </xsl:for-each>
-            </xsl:for-each>
-	  </xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-      <!--
-	  <xsl:message>Class <xsl:value-of select="$className"/>, element
-	  <xsl:value-of select="$elementName"/>: has changes: <xsl:value-of
-	  select="$anyChanged"/></xsl:message>
-      -->
-      <xsl:choose>
-        <!-- a) new class in ODD -->
-        <xsl:when test="$fromODD='true' and (not(@mode) or @mode='add')">
-          <attRef xmlns="http://www.tei-c.org/ns/1.0" n="1" name="{$className}.attributes"/>
-        </xsl:when>
-        <!-- b) its deleted -->
-        <xsl:when test="@mode='delete'"/>
-        <!-- c) its a replacement -->
-        <xsl:when test="@mode='replace'">
-          <xsl:for-each select="tei:attList/tei:attDef">
-            <xsl:call-template name="odd2odd-mergeClassAttribute">
-              <xsl:with-param name="source">1</xsl:with-param>
-              <xsl:with-param name="element" select="$elementName"/>
-              <xsl:with-param name="class" select="$className"/>
-              <xsl:with-param name="fromODD">
-                <xsl:value-of select="$fromODD"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:for-each>
-          <xsl:for-each select="tei:attList/tei:attList">
-            <attList xmlns="http://www.tei-c.org/ns/1.0">
-              <xsl:copy-of select="@org"/>
-              <xsl:for-each select="tei:attDef">
-                <xsl:call-template name="odd2odd-mergeClassAttribute">
-                  <xsl:with-param name="source">2</xsl:with-param>
-                  <xsl:with-param name="element" select="$elementName"/>
-                  <xsl:with-param name="class" select="$className"/>
-                  <xsl:with-param name="fromODD">
-                    <xsl:value-of select="$fromODD"/>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </xsl:for-each>
-            </attList>
-          </xsl:for-each>
-        </xsl:when>
-        <!-- d) there are changes to attributes in the class spec itself,
-	but the element makes no override -->
-        <xsl:when test="@mode='change' and tei:attList and not (contains($anyChanged,':element-'))">
-          <xsl:if test="$verbose='true'">
-            <xsl:message>Phase 1 check d) Class <xsl:value-of select="$className"/> for <xsl:value-of select="$elementName"/> has no changes in element, refer by name</xsl:message>
-          </xsl:if>
-          <attRef xmlns="http://www.tei-c.org/ns/1.0" n="5" name="{$className}.attributes"/>
-        </xsl:when>
-        <!-- e) there are changes to attributes in the class spec itself -->
-        <xsl:when test="@mode='change' and tei:attList">
-          <!-- always references attributes in add mode -->
-          <xsl:for-each select="tei:attList/tei:attDef[@mode='add']">
-            <attRef xmlns="http://www.tei-c.org/ns/1.0" n="2" name="{$className}.attribute.{translate(@ident,':','')}"/>
-          </xsl:for-each>
-          <!-- go back to original and proceed from there -->
-	  <xsl:for-each select="document($Source)/tei:TEI">
-	    <xsl:for-each select="key('odd2odd-ATTCLASSES',$className)">
-	      <xsl:call-template name="odd2odd-tryAttributes">
-		<xsl:with-param name="elementName" select="$elementName"/>
-		<xsl:with-param name="className" select="$className"/>
-		<xsl:with-param name="fromODD">
-		  <xsl:value-of select="$fromODD"/>
-		</xsl:with-param>
-	      </xsl:call-template>
-	    </xsl:for-each>
-	  </xsl:for-each>
-          <xsl:for-each select="tei:attList/tei:attRef">
-            <xsl:copy-of select="."/>
-          </xsl:for-each>
-        </xsl:when>
-        <!-- there are no changes to the attributes in the odd-->
-        <xsl:when test="$anyChanged=''">
-          <xsl:if test="$verbose='true'">
-            <xsl:message>Phase 1 check f) Class <xsl:value-of select="$className"/> for <xsl:value-of select="$elementName"/> has no changes, refer by name</xsl:message>
-          </xsl:if>
-          <attRef xmlns="http://www.tei-c.org/ns/1.0" n="4" name="{$className}.attributes"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:if test="$verbose='true'">
-            <xsl:message>Phase 1 check g) Class <xsl:value-of select="$className"/> for <xsl:value-of select="$elementName"/> has changes in odd, refer by values</xsl:message>
-          </xsl:if>
-          <!-- attributes here -->
-          <xsl:for-each select="tei:attList/tei:attDef">
-            <xsl:call-template name="odd2odd-mergeClassAttribute">
-              <xsl:with-param name="source">7</xsl:with-param>
-              <xsl:with-param name="element" select="$elementName"/>
-              <xsl:with-param name="class" select="$className"/>
-              <xsl:with-param name="fromODD">
-                <xsl:value-of select="$fromODD"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:for-each>
-          <!-- embedded attribute lists  -->
-          <xsl:for-each select="tei:attList/tei:attList">
-            <attList xmlns="http://www.tei-c.org/ns/1.0">
-              <xsl:copy-of select="@org"/>
-              <xsl:for-each select="tei:attDef">
-                <xsl:call-template name="odd2odd-mergeClassAttribute">
-                  <xsl:with-param name="source">8</xsl:with-param>
-                  <xsl:with-param name="element" select="$elementName"/>
-                  <xsl:with-param name="class" select="$className"/>
-                  <xsl:with-param name="fromODD">
-                    <xsl:value-of select="$fromODD"/>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </xsl:for-each>
-            </attList>
-          </xsl:for-each>
-        </xsl:otherwise>
-      </xsl:choose>
-      <!-- Now attributes referenced from classes we are a member
-     of. Again, check whether we are in ODD or not. If
-     we have not tinkered with the superclass, this is not
-     needed, obviously.
-      -->
-      <!-- DEBUG
-      <xsl:message>Now time to look at subclasses of <xsl:value-of
-      select="@ident"/> whose changes status was <xsl:value-of
-      select="$anyChanged"/>; we are in fromOdd <xsl:value-of
-      select="$fromODD"/></xsl:message>
--->
-      <xsl:choose>
-        <xsl:when test="@mode='change' and tei:attList and not (contains($anyChanged,':element-'))"/>
-        <xsl:when test="$fromODD='false' and $anyChanged =''"/>
-        <xsl:when test="$fromODD='true' and not(.//tei:attDef)"/>
-        <xsl:when test="$fromODD='true' and tei:classes[@mode='replace']">
-          <xsl:for-each select="tei:classes/tei:memberOf">
-            <xsl:call-template name="odd2odd-classAttributes">
-              <xsl:with-param name="whence">3</xsl:with-param>
-              <xsl:with-param name="elementName" select="$elementName"/>
-              <xsl:with-param name="className" select="@key"/>
-            </xsl:call-template>
-          </xsl:for-each>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:if test="$fromODD='true' and tei:classes[@mode='change']">
-            <xsl:for-each select="tei:classes/tei:memberOf[@mode='add']">
-              <xsl:call-template name="odd2odd-classAttributes">
-                <xsl:with-param name="whence">4</xsl:with-param>
-                <xsl:with-param name="elementName" select="$elementName"/>
-                <xsl:with-param name="className" select="@key"/>
-              </xsl:call-template>
-            </xsl:for-each>
-          </xsl:if>
-	  <xsl:for-each select="document($Source)/tei:TEI">
-	    <xsl:for-each select="key('odd2odd-ATTCLASSES',$className)">
-	      <xsl:for-each select="tei:classes/tei:memberOf">
-		<xsl:call-template name="odd2odd-classAttributes">
-		  <xsl:with-param name="whence">5</xsl:with-param>
-		  <xsl:with-param name="elementName" select="$elementName"/>
-		  <xsl:with-param name="className" select="@key"/>
-		</xsl:call-template>
-	      </xsl:for-each>
-	    </xsl:for-each>
-	  </xsl:for-each>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template name="odd2odd-tryAttributes">
-    <xsl:param name="elementName"/>
-    <xsl:param name="className"/>
-    <xsl:param name="fromODD"/>
-    <xsl:for-each select="tei:attList/tei:attDef">
-      <xsl:call-template name="odd2odd-mergeClassAttribute">
-        <xsl:with-param name="source">3</xsl:with-param>
-        <xsl:with-param name="element" select="$elementName"/>
-        <xsl:with-param name="class" select="$className"/>
-        <xsl:with-param name="fromODD">
-          <xsl:value-of select="$fromODD"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:for-each>
-    <xsl:for-each select="tei:attList/tei:attList">
-      <attList xmlns="http://www.tei-c.org/ns/1.0">
-        <xsl:copy-of select="@org"/>
-        <xsl:for-each select="tei:attDef">
-          <xsl:call-template name="odd2odd-mergeClassAttribute">
-            <xsl:with-param name="source">4</xsl:with-param>
-            <xsl:with-param name="element" select="$elementName"/>
-            <xsl:with-param name="class" select="$className"/>
-            <xsl:with-param name="fromODD">
-              <xsl:value-of select="$fromODD"/>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:for-each>
-      </attList>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="odd2odd-mergeClassAttribute">
-    <!-- 
-	 sitting on a source class. look at the 
-	 attribute and see whether it has changed
-	 in the customization
-    -->
-    <xsl:param name="source"/>
-    <xsl:param name="element"/>
-    <xsl:param name="class"/>
-    <xsl:param name="fromODD"/>
-    <xsl:variable name="att" select="@ident"/>
-    <xsl:variable name="wherefrom" select="."/>
-    <xsl:variable name="attRef">
-      <xsl:value-of select="concat($class,'.attribute.' ,translate($att,':',''),'_',$element)"/>
-    </xsl:variable>
-    <xsl:variable name="lookingAt">
-      <xsl:value-of select="concat($element,'_',@ident)"/>
-    </xsl:variable>
-    <xsl:for-each select="$ODD">
-      <xsl:choose>
-        <!-- deleted in the customization at the class level -->
-        <xsl:when test="key('odd2odd-DELETEATT',concat($class,'_',$att))"/>
-        <!-- deleted in the customization at the element level -->
-        <xsl:when test="key('odd2odd-DELETEATT',$lookingAt)"/>
-        <!-- replaced in the customization at the element level -->
-        <xsl:when test="key('odd2odd-REPLACEATT',$lookingAt)"/>
-        <!-- changed in the customization by the element -->
-        <xsl:when test="key('odd2odd-CHANGEATT',$lookingAt)">
-          <xsl:call-template name="odd2odd-mergeAttribute">
-            <xsl:with-param name="New" select="key('odd2odd-CHANGEATT',$lookingAt)"/>
-            <xsl:with-param name="Old" select="$wherefrom"/>
-          </xsl:call-template>
-        </xsl:when>
-        <xsl:otherwise>
+		<!-- we are sitting on a attribute classSpec, could be in the ODD or could 
+			be in the source -->
+		<xsl:variable name="M" select="@module" />
+		<!-- decide whether to proceed with this class at all. if we don't include 
+			this class specifically, don't have this module, or we have deleted the class, 
+			we can bypass it now. -->
+		<xsl:variable name="use">
+			<xsl:choose>
+				<xsl:when
+					test="$fromODD='true' and (not(@mode) or @mode='add')">
+					<xsl:text>true</xsl:text>
+				</xsl:when>
+				<xsl:when test="not(@module)">
+					<xsl:text>true</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:for-each select="$ODD">
+						<xsl:choose>
+							<xsl:when test="key('odd2odd-DELETE',$className)">
+								false
+							</xsl:when>
+							<xsl:when test="key('odd2odd-CLASSREFS',$className)">
+								true
+							</xsl:when>
+							<xsl:when test="key('odd2odd-MODULES',$M)">
+								<xsl:text>true</xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								false
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<!-- DEBUG -->
+		<!-- <xsl:message>START <xsl:value-of select="$whence"/>: <xsl:value-of 
+			select="$elementName"/> + <xsl:value-of select="$className"/> [<xsl:value-of 
+			select="$M"/>] + <xsl:value-of select="$fromODD"/>, so use=<xsl:value-of 
+			select="$use"/></xsl:message> -->
+		<xsl:if test="$use='true'">
+			<!-- We need to put in the class attributes. We'll use the value of $fromODD 
+				to see whether this is in the current ODD or the source. a) the class is 
+				new in this customization, add all attributes regardless b) the class is 
+				marked for deletion. do nothing c) the class is marked for replacement. reference 
+				attributes from the replacement d) the class is marked for change. compare 
+				attributes (tedious) e) the class has no replacement; reference its attributes 
+				In each case, once we have a potential attribute, we have to check back to 
+				see if it is changed in the element (mergeClassAttribute) First, establish 
+				whether any attributes in the class, inherited or otherwise, are changed 
+				in the ODD. We will use this information later -->
+			<xsl:variable name="anyChanged">
+				<xsl:choose>
+					<xsl:when test="$fromODD='false'">
+						<xsl:call-template
+							name="odd2odd-checkClassAttribute">
+							<xsl:with-param name="element"
+								select="$elementName" />
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:for-each select="document($Source)/tei:TEI">
+							<xsl:for-each
+								select="key('odd2odd-ATTCLASSES',$className)">
+								<xsl:call-template
+									name="odd2odd-checkClassAttribute">
+									<xsl:with-param name="element"
+										select="$elementName" />
+								</xsl:call-template>
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<!-- <xsl:message>Class <xsl:value-of select="$className"/>, element <xsl:value-of 
+				select="$elementName"/>: has changes: <xsl:value-of select="$anyChanged"/></xsl:message> -->
+			<xsl:choose>
+				<!-- a) new class in ODD -->
+				<xsl:when
+					test="$fromODD='true' and (not(@mode) or @mode='add')">
+					<attRef xmlns="http://www.tei-c.org/ns/1.0" n="1"
+						name="{$className}.attributes" />
+				</xsl:when>
+				<!-- b) its deleted -->
+				<xsl:when test="@mode='delete'" />
+				<!-- c) its a replacement -->
+				<xsl:when test="@mode='replace'">
+					<xsl:for-each select="tei:attList/tei:attDef">
+						<xsl:call-template
+							name="odd2odd-mergeClassAttribute">
+							<xsl:with-param name="source">
+								1
+							</xsl:with-param>
+							<xsl:with-param name="element"
+								select="$elementName" />
+							<xsl:with-param name="class" select="$className" />
+							<xsl:with-param name="fromODD">
+								<xsl:value-of select="$fromODD" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+					<xsl:for-each select="tei:attList/tei:attList">
+						<attList xmlns="http://www.tei-c.org/ns/1.0">
+							<xsl:copy-of select="@org" />
+							<xsl:for-each select="tei:attDef">
+								<xsl:call-template
+									name="odd2odd-mergeClassAttribute">
+									<xsl:with-param name="source">
+										2
+									</xsl:with-param>
+									<xsl:with-param name="element"
+										select="$elementName" />
+									<xsl:with-param name="class" select="$className" />
+									<xsl:with-param name="fromODD">
+										<xsl:value-of select="$fromODD" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+						</attList>
+					</xsl:for-each>
+				</xsl:when>
+				<!-- d) there are changes to attributes in the class spec itself, but 
+					the element makes no override -->
+				<xsl:when
+					test="@mode='change' and tei:attList and not (contains($anyChanged,':element-'))">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Phase 1 check d) Class
+							<xsl:value-of select="$className" />
+							for
+							<xsl:value-of select="$elementName" />
+							has no changes in element, refer by name
+						</xsl:message>
+					</xsl:if>
+					<attRef xmlns="http://www.tei-c.org/ns/1.0" n="5"
+						name="{$className}.attributes" />
+				</xsl:when>
+				<!-- e) there are changes to attributes in the class spec itself -->
+				<xsl:when test="@mode='change' and tei:attList">
+					<!-- always references attributes in add mode -->
+					<xsl:for-each
+						select="tei:attList/tei:attDef[@mode='add']">
+						<attRef xmlns="http://www.tei-c.org/ns/1.0" n="2"
+							name="{$className}.attribute.{translate(@ident,':','')}" />
+					</xsl:for-each>
+					<!-- go back to original and proceed from there -->
+					<xsl:for-each select="document($Source)/tei:TEI">
+						<xsl:for-each
+							select="key('odd2odd-ATTCLASSES',$className)">
+							<xsl:call-template name="odd2odd-tryAttributes">
+								<xsl:with-param name="elementName"
+									select="$elementName" />
+								<xsl:with-param name="className"
+									select="$className" />
+								<xsl:with-param name="fromODD">
+									<xsl:value-of select="$fromODD" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:for-each>
+					</xsl:for-each>
+					<xsl:for-each select="tei:attList/tei:attRef">
+						<xsl:copy-of select="." />
+					</xsl:for-each>
+				</xsl:when>
+				<!-- there are no changes to the attributes in the odd -->
+				<xsl:when test="$anyChanged=''">
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Phase 1 check f) Class
+							<xsl:value-of select="$className" />
+							for
+							<xsl:value-of select="$elementName" />
+							has no changes, refer by name
+						</xsl:message>
+					</xsl:if>
+					<attRef xmlns="http://www.tei-c.org/ns/1.0" n="4"
+						name="{$className}.attributes" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:if test="$verbose='true'">
+						<xsl:message>
+							Phase 1 check g) Class
+							<xsl:value-of select="$className" />
+							for
+							<xsl:value-of select="$elementName" />
+							has changes in odd, refer by values
+						</xsl:message>
+					</xsl:if>
+					<!-- attributes here -->
+					<xsl:for-each select="tei:attList/tei:attDef">
+						<xsl:call-template
+							name="odd2odd-mergeClassAttribute">
+							<xsl:with-param name="source">
+								7
+							</xsl:with-param>
+							<xsl:with-param name="element"
+								select="$elementName" />
+							<xsl:with-param name="class" select="$className" />
+							<xsl:with-param name="fromODD">
+								<xsl:value-of select="$fromODD" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:for-each>
+					<!-- embedded attribute lists -->
+					<xsl:for-each select="tei:attList/tei:attList">
+						<attList xmlns="http://www.tei-c.org/ns/1.0">
+							<xsl:copy-of select="@org" />
+							<xsl:for-each select="tei:attDef">
+								<xsl:call-template
+									name="odd2odd-mergeClassAttribute">
+									<xsl:with-param name="source">
+										8
+									</xsl:with-param>
+									<xsl:with-param name="element"
+										select="$elementName" />
+									<xsl:with-param name="class" select="$className" />
+									<xsl:with-param name="fromODD">
+										<xsl:value-of select="$fromODD" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+						</attList>
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+			<!-- Now attributes referenced from classes we are a member of. Again, 
+				check whether we are in ODD or not. If we have not tinkered with the superclass, 
+				this is not needed, obviously. -->
+			<!-- DEBUG <xsl:message>Now time to look at subclasses of <xsl:value-of 
+				select="@ident"/> whose changes status was <xsl:value-of select="$anyChanged"/>; 
+				we are in fromOdd <xsl:value-of select="$fromODD"/></xsl:message> -->
+			<xsl:choose>
+				<xsl:when
+					test="@mode='change' and tei:attList and not (contains($anyChanged,':element-'))" />
+				<xsl:when test="$fromODD='false' and $anyChanged =''" />
+				<xsl:when test="$fromODD='true' and not(.//tei:attDef)" />
+				<xsl:when
+					test="$fromODD='true' and tei:classes[@mode='replace']">
+					<xsl:for-each select="tei:classes/tei:memberOf">
+						<xsl:call-template
+							name="odd2odd-classAttributes">
+							<xsl:with-param name="whence">
+								3
+							</xsl:with-param>
+							<xsl:with-param name="elementName"
+								select="$elementName" />
+							<xsl:with-param name="className" select="@key" />
+						</xsl:call-template>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:if
+						test="$fromODD='true' and tei:classes[@mode='change']">
+						<xsl:for-each
+							select="tei:classes/tei:memberOf[@mode='add']">
+							<xsl:call-template
+								name="odd2odd-classAttributes">
+								<xsl:with-param name="whence">
+									4
+								</xsl:with-param>
+								<xsl:with-param name="elementName"
+									select="$elementName" />
+								<xsl:with-param name="className" select="@key" />
+							</xsl:call-template>
+						</xsl:for-each>
+					</xsl:if>
+					<xsl:for-each select="document($Source)/tei:TEI">
+						<xsl:for-each
+							select="key('odd2odd-ATTCLASSES',$className)">
+							<xsl:for-each select="tei:classes/tei:memberOf">
+								<xsl:call-template
+									name="odd2odd-classAttributes">
+									<xsl:with-param name="whence">
+										5
+									</xsl:with-param>
+									<xsl:with-param name="elementName"
+										select="$elementName" />
+									<xsl:with-param name="className" select="@key" />
+								</xsl:call-template>
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="odd2odd-tryAttributes">
+		<xsl:param name="elementName" />
+		<xsl:param name="className" />
+		<xsl:param name="fromODD" />
+		<xsl:for-each select="tei:attList/tei:attDef">
+			<xsl:call-template
+				name="odd2odd-mergeClassAttribute">
+				<xsl:with-param name="source">
+					3
+				</xsl:with-param>
+				<xsl:with-param name="element" select="$elementName" />
+				<xsl:with-param name="class" select="$className" />
+				<xsl:with-param name="fromODD">
+					<xsl:value-of select="$fromODD" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:for-each>
+		<xsl:for-each select="tei:attList/tei:attList">
+			<attList xmlns="http://www.tei-c.org/ns/1.0">
+				<xsl:copy-of select="@org" />
+				<xsl:for-each select="tei:attDef">
+					<xsl:call-template
+						name="odd2odd-mergeClassAttribute">
+						<xsl:with-param name="source">
+							4
+						</xsl:with-param>
+						<xsl:with-param name="element"
+							select="$elementName" />
+						<xsl:with-param name="class" select="$className" />
+						<xsl:with-param name="fromODD">
+							<xsl:value-of select="$fromODD" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+			</attList>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="odd2odd-mergeClassAttribute">
+		<!-- sitting on a source class. look at the attribute and see whether it 
+			has changed in the customization -->
+		<xsl:param name="source" />
+		<xsl:param name="element" />
+		<xsl:param name="class" />
+		<xsl:param name="fromODD" />
+		<xsl:variable name="att" select="@ident" />
+		<xsl:variable name="wherefrom" select="." />
+		<xsl:variable name="attRef">
+			<xsl:value-of
+				select="concat($class,'.attribute.' ,translate($att,':',''),'_',$element)" />
+		</xsl:variable>
+		<xsl:variable name="lookingAt">
+			<xsl:value-of select="concat($element,'_',@ident)" />
+		</xsl:variable>
+		<xsl:for-each select="$ODD">
+			<xsl:choose>
+				<!-- deleted in the customization at the class level -->
+				<xsl:when
+					test="key('odd2odd-DELETEATT',concat($class,'_',$att))" />
+				<!-- deleted in the customization at the element level -->
+				<xsl:when test="key('odd2odd-DELETEATT',$lookingAt)" />
+				<!-- replaced in the customization at the element level -->
+				<xsl:when test="key('odd2odd-REPLACEATT',$lookingAt)" />
+				<!-- changed in the customization by the element -->
+				<xsl:when test="key('odd2odd-CHANGEATT',$lookingAt)">
+					<xsl:call-template name="odd2odd-mergeAttribute">
+						<xsl:with-param name="New"
+							select="key('odd2odd-CHANGEATT',$lookingAt)" />
+						<xsl:with-param name="Old" select="$wherefrom" />
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:choose>
+						<xsl:when test="$fromODD='false'">
+							<xsl:for-each select="$wherefrom">
+								<xsl:call-template name="odd2odd-unChangedAtt">
+									<xsl:with-param name="debug">
+										1
+									</xsl:with-param>
+									<xsl:with-param name="lookingAt">
+										<xsl:value-of select="$lookingAt" />
+									</xsl:with-param>
+									<xsl:with-param name="att">
+										<xsl:value-of select="$att" />
+									</xsl:with-param>
+									<xsl:with-param name="attRef">
+										<xsl:value-of select="$attRef" />
+									</xsl:with-param>
+									<xsl:with-param name="class">
+										<xsl:value-of select="$class" />
+									</xsl:with-param>
+									<xsl:with-param name="orig">
+										<xsl:value-of select="$wherefrom" />
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:for-each>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template name="odd2odd-unChangedAtt">
+								<xsl:with-param name="debug">
+									2
+								</xsl:with-param>
+								<xsl:with-param name="lookingAt">
+									<xsl:value-of select="$lookingAt" />
+								</xsl:with-param>
+								<xsl:with-param name="att">
+									<xsl:value-of select="$att" />
+								</xsl:with-param>
+								<xsl:with-param name="attRef">
+									<xsl:value-of select="$attRef" />
+								</xsl:with-param>
+								<xsl:with-param name="class">
+									<xsl:value-of select="$class" />
+								</xsl:with-param>
+								<xsl:with-param name="orig">
+									<xsl:value-of select="$wherefrom" />
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="odd2odd-unChangedAtt">
+		<xsl:param name="lookingAt" />
+		<xsl:param name="att" />
+		<xsl:param name="class" />
+		<xsl:param name="orig" />
+		<xsl:param name="attRef" />
+		<xsl:param name="debug" />
+		<xsl:choose>
+			<!-- don't make another reference to a class attribute if we already have 
+				an attRef -->
+			<xsl:when test="key('odd2odd-ATTREFS',$attRef)" />
+			<xsl:otherwise>
+				<attRef xmlns="http://www.tei-c.org/ns/1.0" n="3-{$debug}"
+					name="{$class}.attribute.{translate($att,':','')}" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="odd2odd-checkClassAttribute">
+		<xsl:param name="element" />
+		<!-- look at each attribute in turn, and then repeat for any inherited 
+			classes -->
+		<xsl:variable name="class" select="@ident" />
+		<xsl:variable name="mode" select="@mode" />
+		<xsl:for-each select="tei:attList//tei:attDef">
+			<xsl:variable name="att" select="@ident" />
+			<xsl:for-each select="$ODD">
+				<xsl:choose>
+					<!-- deleted in the customization at the class level -->
+					<xsl:when
+						test="key('odd2odd-DELETEATT',concat($class,'_',$att))">
+						<xsl:text>:class-del-</xsl:text>
+						<xsl:value-of select="$att" />
+					</xsl:when>
+					<!-- deleted in the customization at the element level -->
+					<xsl:when
+						test="key('odd2odd-DELETEATT',concat($element,'_',$att))">
+						<xsl:text>:element-del-</xsl:text>
+						<xsl:value-of select="$att" />
+					</xsl:when>
+					<!-- replaced in the customization at the element level -->
+					<xsl:when
+						test="key('odd2odd-REPLACEATT',concat($element,'_',$att))">
+						<xsl:text>:element-replace-</xsl:text>
+						<xsl:value-of select="$att" />
+					</xsl:when>
+					<!-- changed in the customization by the element -->
+					<xsl:when
+						test="key('odd2odd-CHANGEATT',concat($element,'_',$att))">
+						<xsl:text>:element-change-</xsl:text>
+						<xsl:value-of select="$att" />
+					</xsl:when>
+				</xsl:choose>
+			</xsl:for-each>
+		</xsl:for-each>
+		<xsl:for-each select="tei:classes/tei:memberOf">
+			<xsl:for-each select="key('odd2odd-ATTCLASSES',@key)">
+				<xsl:call-template
+					name="odd2odd-checkClassAttribute">
+					<xsl:with-param name="element" select="$element" />
+				</xsl:call-template>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="odd2odd-processAttributes">
+		<xsl:param name="ORIGINAL" />
+		<xsl:param name="elementName" />
+		<!-- first put in the ones we know take precedence -->
+		<xsl:apply-templates mode="odd2odd-justcopy"
+			select="tei:attList/tei:attDef[@mode='add' or not(@mode)]" />
+		<xsl:apply-templates mode="odd2odd-justcopy"
+			select="tei:attList/tei:attDef[@mode='replace']" />
+		<xsl:for-each select="$ORIGINAL/tei:attList">
+			<!-- original source context -->
+			<xsl:for-each select="tei:attList">
+				<attList xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:copy-of select="@org" />
+					<xsl:for-each select="tei:attDef">
+						<xsl:variable name="ATT" select="." />
+						<xsl:variable name="lookingAt">
+							<xsl:value-of
+								select="concat(../../../@ident,'_',@ident)" />
+						</xsl:variable>
+						<xsl:for-each select="$ODD">
+							<xsl:choose>
+								<xsl:when test="key('odd2odd-DELETEATT',$lookingAt)" />
+								<xsl:when test="key('odd2odd-REPLACEATT',$lookingAt)" />
+								<xsl:when test="key('odd2odd-CHANGEATT',$lookingAt)">
+									<xsl:call-template
+										name="odd2odd-mergeAttribute">
+										<xsl:with-param name="New"
+											select="key('odd2odd-CHANGEATT',$lookingAt)" />
+										<xsl:with-param name="Old" select="$ATT" />
+									</xsl:call-template>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:copy-of select="$ATT" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:for-each>
+					</xsl:for-each>
+				</attList>
+			</xsl:for-each>
+			<xsl:variable name="atts">
+				<xsl:for-each select="tei:attDef">
+					<xsl:variable name="ATT" select="." />
+					<xsl:variable name="lookingAt">
+						<xsl:value-of
+							select="concat(../../@ident,'_',@ident)" />
+					</xsl:variable>
+					<xsl:for-each select="$ODD">
+						<xsl:choose>
+							<xsl:when test="key('odd2odd-DELETEATT',$lookingAt)" />
+							<xsl:when test="key('odd2odd-REPLACEATT',$lookingAt)" />
+							<xsl:when test="key('odd2odd-CHANGEATT',$lookingAt)">
+								<xsl:call-template
+									name="odd2odd-mergeAttribute">
+									<xsl:with-param name="New"
+										select="key('odd2odd-CHANGEATT',$lookingAt)" />
+									<xsl:with-param name="Old" select="$ATT" />
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:copy-of select="$ATT" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when test="@org">
+					<attList xmlns="http://www.tei-c.org/ns/1.0">
+						<xsl:copy-of select="@org" />
+						<xsl:copy-of select="$atts" />
+					</attList>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:copy-of select="$atts" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+		<!-- now we need to go back to the classes of which this element is a member 
+			and reference their untouched attributes -->
+		<xsl:choose>
+			<xsl:when test="$elementName=''" />
+			<xsl:otherwise>
+				<xsl:if test="$autoGlobal='true'">
+					<xsl:call-template name="odd2odd-classAttributes">
+						<xsl:with-param name="whence">
+							7
+						</xsl:with-param>
+						<xsl:with-param name="elementName"
+							select="$elementName" />
+						<xsl:with-param name="className"
+							select="'att.global'" />
+					</xsl:call-template>
+				</xsl:if>
+				<xsl:variable name="classMembership">
+					<x>
+						<xsl:choose>
+							<xsl:when test="tei:classes[@mode='change']">
+								<xsl:for-each
+									select="tei:classes/tei:memberOf[not(@mode='delete')]">
+									<xsl:copy-of select="." />
+								</xsl:for-each>
+								<xsl:for-each select="$ORIGINAL">
+									<xsl:for-each select="tei:classes/tei:memberOf">
+										<xsl:copy-of select="." />
+									</xsl:for-each>
+								</xsl:for-each>
+							</xsl:when>
+							<xsl:when test="tei:classes">
+								<xsl:for-each select="tei:classes/tei:memberOf">
+									<xsl:copy-of select="." />
+								</xsl:for-each>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:for-each select="$ORIGINAL">
+									<xsl:for-each select="tei:classes/tei:memberOf">
+										<xsl:copy-of select="." />
+									</xsl:for-each>
+								</xsl:for-each>
+							</xsl:otherwise>
+						</xsl:choose>
+					</x>
+				</xsl:variable>
+				<xsl:for-each select="$classMembership/x/tei:memberOf">
+					<xsl:if
+						test="not(preceding-sibling::tei:memberOf[@key=current()/@key])">
+						<xsl:call-template
+							name="odd2odd-classAttributes">
+							<xsl:with-param name="whence">
+								8
+							</xsl:with-param>
+							<xsl:with-param name="elementName"
+								select="$elementName" />
+							<xsl:with-param name="className" select="@key" />
+						</xsl:call-template>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="odd2odd-mergeAttribute">
+		<xsl:param name="New" />
+		<xsl:param name="Old" />
+		<attDef xmlns="http://www.tei-c.org/ns/1.0">
+			<xsl:attribute name="ident" select="$Old/@ident" />
+			<xsl:attribute name="usage">
           <xsl:choose>
-            <xsl:when test="$fromODD='false'">
-              <xsl:for-each select="$wherefrom">
-                <xsl:call-template name="odd2odd-unChangedAtt">
-                  <xsl:with-param name="debug">1</xsl:with-param>
-                  <xsl:with-param name="lookingAt">
-                    <xsl:value-of select="$lookingAt"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="att">
-                    <xsl:value-of select="$att"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="attRef">
-                    <xsl:value-of select="$attRef"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="class">
-                    <xsl:value-of select="$class"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="orig">
-                    <xsl:value-of select="$wherefrom"/>
-                  </xsl:with-param>
-                </xsl:call-template>
-              </xsl:for-each>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:call-template name="odd2odd-unChangedAtt">
-                <xsl:with-param name="debug">2</xsl:with-param>
-                <xsl:with-param name="lookingAt">
-                  <xsl:value-of select="$lookingAt"/>
-                </xsl:with-param>
-                <xsl:with-param name="att">
-                  <xsl:value-of select="$att"/>
-                </xsl:with-param>
-                <xsl:with-param name="attRef">
-                  <xsl:value-of select="$attRef"/>
-                </xsl:with-param>
-                <xsl:with-param name="class">
-                  <xsl:value-of select="$class"/>
-                </xsl:with-param>
-                <xsl:with-param name="orig">
-                  <xsl:value-of select="$wherefrom"/>
-                </xsl:with-param>
-              </xsl:call-template>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="odd2odd-unChangedAtt">
-    <xsl:param name="lookingAt"/>
-    <xsl:param name="att"/>
-    <xsl:param name="class"/>
-    <xsl:param name="orig"/>
-    <xsl:param name="attRef"/>
-    <xsl:param name="debug"/>
-    <xsl:choose>
-      <!-- don't make another reference to a class attribute 
-	 if we already have an attRef -->
-      <xsl:when test="key('odd2odd-ATTREFS',$attRef)"/>
-      <xsl:otherwise>
-        <attRef xmlns="http://www.tei-c.org/ns/1.0" n="3-{$debug}" name="{$class}.attribute.{translate($att,':','')}"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="odd2odd-checkClassAttribute">
-    <xsl:param name="element"/>
-    <!-- look at each attribute in turn, and then repeat for any
-	 inherited classes -->
-    <xsl:variable name="class" select="@ident"/>
-    <xsl:variable name="mode" select="@mode"/>
-    <xsl:for-each select="tei:attList//tei:attDef">
-      <xsl:variable name="att" select="@ident"/>
-      <xsl:for-each select="$ODD">
-        <xsl:choose>
-          <!-- deleted in the customization at the class level -->
-          <xsl:when test="key('odd2odd-DELETEATT',concat($class,'_',$att))">
-            <xsl:text>:class-del-</xsl:text>
-            <xsl:value-of select="$att"/>
-          </xsl:when>
-          <!-- deleted in the customization at the element level -->
-          <xsl:when test="key('odd2odd-DELETEATT',concat($element,'_',$att))">
-            <xsl:text>:element-del-</xsl:text>
-            <xsl:value-of select="$att"/>
-          </xsl:when>
-          <!-- replaced in the customization at the element level -->
-          <xsl:when test="key('odd2odd-REPLACEATT',concat($element,'_',$att))">
-            <xsl:text>:element-replace-</xsl:text>
-            <xsl:value-of select="$att"/>
-          </xsl:when>
-          <!-- changed in the customization by the element -->
-          <xsl:when test="key('odd2odd-CHANGEATT',concat($element,'_',$att))">
-            <xsl:text>:element-change-</xsl:text>
-            <xsl:value-of select="$att"/>
-          </xsl:when>
-        </xsl:choose>
-      </xsl:for-each>
-    </xsl:for-each>
-    <xsl:for-each select="tei:classes/tei:memberOf">
-      <xsl:for-each select="key('odd2odd-ATTCLASSES',@key)">
-        <xsl:call-template name="odd2odd-checkClassAttribute">
-          <xsl:with-param name="element" select="$element"/>
-        </xsl:call-template>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="odd2odd-processAttributes">
-    <xsl:param name="ORIGINAL"/>
-    <xsl:param name="elementName"/>
-    <!-- first put in the ones we know take precedence -->
-    <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attList/tei:attDef[@mode='add' or not(@mode)]"/>
-    <xsl:apply-templates mode="odd2odd-justcopy" select="tei:attList/tei:attDef[@mode='replace']"/>
-    <xsl:for-each select="$ORIGINAL/tei:attList">
-      <!-- original source  context -->
-      <xsl:for-each select="tei:attList">
-        <attList xmlns="http://www.tei-c.org/ns/1.0">
-          <xsl:copy-of select="@org"/>
-          <xsl:for-each select="tei:attDef">
-            <xsl:variable name="ATT" select="."/>
-            <xsl:variable name="lookingAt">
-              <xsl:value-of select="concat(../../../@ident,'_',@ident)"/>
-            </xsl:variable>
-            <xsl:for-each select="$ODD">
-              <xsl:choose>
-                <xsl:when test="key('odd2odd-DELETEATT',$lookingAt)"/>
-                <xsl:when test="key('odd2odd-REPLACEATT',$lookingAt)"/>
-                <xsl:when test="key('odd2odd-CHANGEATT',$lookingAt)">
-                  <xsl:call-template name="odd2odd-mergeAttribute">
-                    <xsl:with-param name="New" select="key('odd2odd-CHANGEATT',$lookingAt)"/>
-                    <xsl:with-param name="Old" select="$ATT"/>
-                  </xsl:call-template>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:copy-of select="$ATT"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:for-each>
-          </xsl:for-each>
-        </attList>
-      </xsl:for-each>
-      <xsl:variable name="atts">
-        <xsl:for-each select="tei:attDef">
-          <xsl:variable name="ATT" select="."/>
-          <xsl:variable name="lookingAt">
-            <xsl:value-of select="concat(../../@ident,'_',@ident)"/>
-          </xsl:variable>
-          <xsl:for-each select="$ODD">
-            <xsl:choose>
-              <xsl:when test="key('odd2odd-DELETEATT',$lookingAt)"/>
-              <xsl:when test="key('odd2odd-REPLACEATT',$lookingAt)"/>
-              <xsl:when test="key('odd2odd-CHANGEATT',$lookingAt)">
-                <xsl:call-template name="odd2odd-mergeAttribute">
-                  <xsl:with-param name="New" select="key('odd2odd-CHANGEATT',$lookingAt)"/>
-                  <xsl:with-param name="Old" select="$ATT"/>
-                </xsl:call-template>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:copy-of select="$ATT"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:for-each>
-        </xsl:for-each>
-      </xsl:variable>
-      <xsl:choose>
-        <xsl:when test="@org">
-          <attList xmlns="http://www.tei-c.org/ns/1.0">
-            <xsl:copy-of select="@org"/>
-            <xsl:copy-of select="$atts"/>
-          </attList>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:copy-of select="$atts"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-    <!-- now we need to go back to the classes of which this 
-       element is a member and reference their untouched attributes -->
-    <xsl:choose>
-      <xsl:when test="$elementName=''"/>
-      <xsl:otherwise>
-	<xsl:if test="$autoGlobal='true'">
-	  <xsl:call-template name="odd2odd-classAttributes">
-	    <xsl:with-param name="whence">7</xsl:with-param>
-	    <xsl:with-param name="elementName" select="$elementName"/>
-	    <xsl:with-param name="className" select="'att.global'"/>
-	  </xsl:call-template>
-	</xsl:if>
-        <xsl:variable name="classMembership">
-          <x>
-            <xsl:choose>
-              <xsl:when test="tei:classes[@mode='change']">
-                <xsl:for-each select="tei:classes/tei:memberOf[not(@mode='delete')]">
-                  <xsl:copy-of select="."/>
-                </xsl:for-each>
-                <xsl:for-each select="$ORIGINAL">
-                  <xsl:for-each select="tei:classes/tei:memberOf">
-                    <xsl:copy-of select="."/>
-                  </xsl:for-each>
-                </xsl:for-each>
-              </xsl:when>
-              <xsl:when test="tei:classes">
-                <xsl:for-each select="tei:classes/tei:memberOf">
-                  <xsl:copy-of select="."/>
-                </xsl:for-each>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:for-each select="$ORIGINAL">
-                  <xsl:for-each select="tei:classes/tei:memberOf">
-                    <xsl:copy-of select="."/>
-                  </xsl:for-each>
-                </xsl:for-each>
-              </xsl:otherwise>
-            </xsl:choose>
-          </x>
-        </xsl:variable>
-        <xsl:for-each select="$classMembership/x/tei:memberOf">
-          <xsl:if test="not(preceding-sibling::tei:memberOf[@key=current()/@key])">
-            <xsl:call-template name="odd2odd-classAttributes">
-              <xsl:with-param name="whence">8</xsl:with-param>
-              <xsl:with-param name="elementName" select="$elementName"/>
-              <xsl:with-param name="className" select="@key"/>
-            </xsl:call-template>
-          </xsl:if>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="odd2odd-mergeAttribute">
-    <xsl:param name="New"/>
-    <xsl:param name="Old"/>
-    <attDef xmlns="http://www.tei-c.org/ns/1.0">
-      <xsl:attribute name="ident" select="$Old/@ident"/>
-       <xsl:attribute name="usage">
-          <xsl:choose>
             <xsl:when test="$New/@usage">
-              <xsl:value-of select="$New/@usage"/>
+              <xsl:value-of select="$New/@usage" />
             </xsl:when>
             <xsl:otherwise>
-              <xsl:value-of select="$Old/@usage"/>
+              <xsl:value-of select="$Old/@usage" />
             </xsl:otherwise>
           </xsl:choose>
         </xsl:attribute>
-        <xsl:if test="$New/tei:altIdent">
-          <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:altIdent"/>
-        </xsl:if>
-        <!-- equiv, gloss, desc trio -->
-        <xsl:choose>
-          <xsl:when test="$stripped='true'"/>
-          <xsl:when test="$New/tei:equiv">
-            <xsl:apply-templates mode="odd2odd-copy" select="$New/tei:equiv"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:apply-templates mode="odd2odd-copy" select="$Old/tei:equiv"/>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="$New/tei:gloss">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:gloss"/>
-          </xsl:when>
-          <xsl:otherwise>
-              <xsl:apply-templates mode="odd2odd-justcopy" select="$Old/tei:gloss"/>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="$stripped='true'"/>
-          <xsl:when test="$New/tei:desc">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:desc"/>
-          </xsl:when>
-          <xsl:otherwise>
-              <xsl:apply-templates mode="odd2odd-justcopy" select="$Old/tei:desc"/>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="$New/tei:constraintSpec">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:constraintSpec"/>
-          </xsl:when>
-          <xsl:when test="$Old/tei:constraintSpec">
-            <xsl:copy-of select="$Old/tei:constraintSpec"/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="$New/tei:datatype">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:datatype"/>
-          </xsl:when>
-          <xsl:when test="$Old/tei:datatype">
-            <xsl:copy-of select="$Old/tei:datatype"/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="$New/tei:defaultVal">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:defaultVal"/>
-          </xsl:when>
-          <xsl:when test="$Old/tei:defaultVal">
-            <xsl:copy-of select="$Old/tei:defaultVal"/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="$New/tei:valDesc">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:valDesc"/>
-          </xsl:when>
-          <xsl:when test="$Old/tei:valDesc">
-            <xsl:copy-of select="$Old/tei:valDesc"/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:choose>
-	  <xsl:when test="$New/tei:valList[@mode='delete']"/>
-          <xsl:when test="$New/tei:valList[@mode='add' or @mode='replace']">
-            <xsl:for-each select="$New/tei:valList[1]">
-              <xsl:copy>
-                <xsl:copy-of select="@type"/>
-                <xsl:copy-of select="@repeatable"/>
-                <xsl:copy-of select="*"/>
-              </xsl:copy>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:when test="$New/tei:valList[@mode='change']">
-            <xsl:for-each select="$New/tei:valList[1]">
-              <xsl:copy>
-                <xsl:copy-of select="@*"/>
-                <xsl:for-each select="$Old/tei:valList/tei:valItem">
-                  <xsl:variable name="thisme" select="@ident"/>
-                  <xsl:if test="not($New/tei:valList[1]/tei:valItem[@ident=$thisme and (@mode='delete' or @mode='replace')])">
-                    <xsl:copy>
-                      <xsl:copy-of select="@*"/>
-                      <xsl:for-each select="$New/tei:valList[1]/tei:valItem[@ident=$thisme]">
-                        <xsl:choose>
-                          <xsl:when test="tei:equiv">
-                            <xsl:apply-templates mode="odd2odd-copy" select="tei:equiv"/>
-                          </xsl:when>
-                          <xsl:otherwise>
-                            <xsl:for-each select="$Old/tei:valList/tei:valItem[@ident=$thisme]">
-                              <xsl:apply-templates mode="odd2odd-copy" select="tei:equiv"/>
-                            </xsl:for-each>
-                          </xsl:otherwise>
-                        </xsl:choose>
-                        <xsl:choose>
-                          <xsl:when test="tei:gloss">
-                            <xsl:apply-templates mode="odd2odd-justcopy" select="tei:gloss"/>
-                          </xsl:when>
-                          <xsl:otherwise>
-                            <xsl:for-each select="$Old/tei:valList/tei:valItem[@ident=$thisme]">
-                              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:gloss"/>
-                            </xsl:for-each>
-                          </xsl:otherwise>
-                        </xsl:choose>
-                        <xsl:choose>
-                          <xsl:when test="$stripped='true'"/>
-                          <xsl:when test="tei:desc">
-                            <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-                          </xsl:when>
-                          <xsl:otherwise>
-                            <xsl:for-each select="$Old/tei:valList/tei:valItem[@ident=$thisme]">
-                              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-                            </xsl:for-each>
-                          </xsl:otherwise>
-                        </xsl:choose>
-                      </xsl:for-each>
-                    </xsl:copy>
-                  </xsl:if>
-                </xsl:for-each>
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:valItem[@mode='add']"/>
-                <xsl:apply-templates mode="odd2odd-justcopy" select="tei:valItem[@mode='replace']"/>
-              </xsl:copy>
-            </xsl:for-each>
-          </xsl:when>
-          <xsl:when test="$Old/tei:valList">
-            <xsl:copy-of select="$Old/tei:valList"/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="$stripped='true'"/>
-          <xsl:when test="$New/tei:exemplum">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:exemplum"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:for-each select="$Old">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:exemplum"/>
-            </xsl:for-each>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="$stripped='true'"/>
-          <xsl:when test="$New/tei:remarks">
-            <xsl:apply-templates mode="odd2odd-justcopy" select="$New/tei:remarks"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:for-each select="$Old">
-              <xsl:apply-templates mode="odd2odd-justcopy" select="tei:remarks"/>
-            </xsl:for-each>
-          </xsl:otherwise>
-        </xsl:choose>
-    </attDef>
-  </xsl:template>
-  <xsl:template match="tei:specGrp">
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:schemaSpec"> </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:apply-templates/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:specGrpRef"/>
-  <xsl:template match="tei:macroSpec|tei:classSpec">
-    <xsl:if test="not(ancestor::tei:schemaSpec)">
-      <xsl:copy-of select="."/>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:attDef[@mode]"/>
-  <xsl:template match="tei:elementSpec">
-    <xsl:if test="not(//tei:schemaSpec)">
-      <xsl:variable name="elementName">
-        <xsl:value-of select="@ident"/>
-      </xsl:variable>
-      <xsl:copy>
-        <xsl:apply-templates mode="odd2odd-copy" select="@*"/>
-        <xsl:apply-templates mode="odd2odd-justcopy" select="tei:altIdent"/>
-        <xsl:if test="$stripped='false'">
-          <xsl:apply-templates mode="odd2odd-copy" select="tei:equiv"/>
-          <xsl:apply-templates mode="odd2odd-justcopy" select="tei:gloss"/>
-          <xsl:apply-templates mode="odd2odd-justcopy" select="tei:desc"/>
-        </xsl:if>
-        <xsl:apply-templates mode="odd2odd-justcopy" select="tei:classes"/>
-        <xsl:apply-templates mode="odd2odd-copy" select="tei:content"/>
-        <xsl:apply-templates mode="odd2odd-copy" select="tei:constraintSpec"/>
-        <attList xmlns="http://www.tei-c.org/ns/1.0">
-	  <xsl:if test="$autoGlobal='true' and not(tei:classes/tei:memberOf[@key='att.global'])">
-	    <xsl:comment>1.</xsl:comment>
-	    <xsl:call-template name="odd2odd-classAttributesSimple">
-	      <xsl:with-param name="whence">9</xsl:with-param>
-	      <xsl:with-param name="elementName" select="$elementName"/>
-	      <xsl:with-param name="className" select="'att.global'"/>
-	    </xsl:call-template>
-	  </xsl:if>
-          <xsl:comment>2.</xsl:comment>
-          <xsl:for-each select="tei:classes/tei:memberOf">
-            <xsl:comment>3: <xsl:value-of select="@key"/>
-                  </xsl:comment>
-            <xsl:call-template name="odd2odd-classAttributesSimple">
-              <xsl:with-param name="whence">10</xsl:with-param>
-              <xsl:with-param name="elementName" select="$elementName"/>
-              <xsl:with-param name="className" select="@key"/>
-            </xsl:call-template>
-          </xsl:for-each>
-          <xsl:comment>4.</xsl:comment>
-          <xsl:apply-templates select="tei:attList"/>
-          <xsl:comment>5.</xsl:comment>
-        </attList>
-        <xsl:if test="$stripped='false'">
-          <xsl:apply-templates mode="odd2odd-justcopy" select="tei:exemplum"/>
-          <xsl:apply-templates mode="odd2odd-justcopy" select="tei:remarks"/>
-          <xsl:apply-templates mode="odd2odd-justcopy" select="tei:listRef"/>
-        </xsl:if>
-      </xsl:copy>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:moduleRef[@url]">
-    <p>Include external module <xsl:value-of select="@url"/>.</p>
-  </xsl:template>
-  <xsl:template match="tei:moduleRef[@key]">
-    <p>Internal module <xsl:value-of select="@key"/> was located and expanded.</p>
-  </xsl:template>
-  <xsl:template match="@*|processing-instruction()|text()">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  <xsl:template match="*">
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|text()"/>
-    </xsl:copy>
-  </xsl:template>
-  <xsl:template name="odd2odd-classAttributesSimple">
-    <xsl:param name="elementName"/>
-    <xsl:param name="className"/>
-    <xsl:param name="whence"/>
-    <xsl:comment>START on <xsl:value-of select="$className"/>
-      </xsl:comment>
-    <xsl:for-each select="key('odd2odd-ATTCLASSES',$className)">
-      <xsl:variable name="CURRENTCLASS" select="."/>
-      <xsl:for-each select="tei:attList/tei:attDef">
-        <xsl:call-template name="odd2odd-mergeClassAttribute">
-          <xsl:with-param name="source">9</xsl:with-param>
-          <xsl:with-param name="element" select="$elementName"/>
-          <xsl:with-param name="class" select="$className"/>
-        </xsl:call-template>
-      </xsl:for-each>
-      <xsl:if test="tei:classes/tei:memberOf">
-        <xsl:for-each select="tei:classes/tei:memberOf">
-          <xsl:variable name="cName" select="@key"/>
-          <xsl:call-template name="odd2odd-classAttributesSimple">
-            <xsl:with-param name="whence">11</xsl:with-param>
-            <xsl:with-param name="elementName" select="$elementName"/>
-            <xsl:with-param name="className" select="$cName"/>
-          </xsl:call-template>
-        </xsl:for-each>
-      </xsl:if>
-    </xsl:for-each>
-    <xsl:comment>FINISH <xsl:value-of select="$className"/>
-      </xsl:comment>
-  </xsl:template>
+			<xsl:if test="$New/tei:altIdent">
+				<xsl:apply-templates mode="odd2odd-justcopy"
+					select="$New/tei:altIdent" />
+			</xsl:if>
+			<!-- equiv, gloss, desc trio -->
+			<xsl:choose>
+				<xsl:when test="$stripped='true'" />
+				<xsl:when test="$New/tei:equiv">
+					<xsl:apply-templates mode="odd2odd-copy"
+						select="$New/tei:equiv" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="odd2odd-copy"
+						select="$Old/tei:equiv" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$New/tei:gloss">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$New/tei:gloss" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$Old/tei:gloss" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$stripped='true'" />
+				<xsl:when test="$New/tei:desc">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$New/tei:desc" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$Old/tei:desc" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$New/tei:constraintSpec">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$New/tei:constraintSpec" />
+				</xsl:when>
+				<xsl:when test="$Old/tei:constraintSpec">
+					<xsl:copy-of select="$Old/tei:constraintSpec" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$New/tei:datatype">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$New/tei:datatype" />
+				</xsl:when>
+				<xsl:when test="$Old/tei:datatype">
+					<xsl:copy-of select="$Old/tei:datatype" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$New/tei:defaultVal">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$New/tei:defaultVal" />
+				</xsl:when>
+				<xsl:when test="$Old/tei:defaultVal">
+					<xsl:copy-of select="$Old/tei:defaultVal" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$New/tei:valDesc">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$New/tei:valDesc" />
+				</xsl:when>
+				<xsl:when test="$Old/tei:valDesc">
+					<xsl:copy-of select="$Old/tei:valDesc" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$New/tei:valList[@mode='delete']" />
+				<xsl:when
+					test="$New/tei:valList[@mode='add' or @mode='replace']">
+					<xsl:for-each select="$New/tei:valList[1]">
+						<xsl:copy>
+							<xsl:copy-of select="@type" />
+							<xsl:copy-of select="@repeatable" />
+							<xsl:copy-of select="*" />
+						</xsl:copy>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="$New/tei:valList[@mode='change']">
+					<xsl:for-each select="$New/tei:valList[1]">
+						<xsl:copy>
+							<xsl:copy-of select="@*" />
+							<xsl:for-each select="$Old/tei:valList/tei:valItem">
+								<xsl:variable name="thisme" select="@ident" />
+								<xsl:if
+									test="not($New/tei:valList[1]/tei:valItem[@ident=$thisme and (@mode='delete' or @mode='replace')])">
+									<xsl:copy>
+										<xsl:copy-of select="@*" />
+										<xsl:for-each
+											select="$New/tei:valList[1]/tei:valItem[@ident=$thisme]">
+											<xsl:choose>
+												<xsl:when test="tei:equiv">
+													<xsl:apply-templates
+														mode="odd2odd-copy" select="tei:equiv" />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:for-each
+														select="$Old/tei:valList/tei:valItem[@ident=$thisme]">
+														<xsl:apply-templates
+															mode="odd2odd-copy" select="tei:equiv" />
+													</xsl:for-each>
+												</xsl:otherwise>
+											</xsl:choose>
+											<xsl:choose>
+												<xsl:when test="tei:gloss">
+													<xsl:apply-templates
+														mode="odd2odd-justcopy" select="tei:gloss" />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:for-each
+														select="$Old/tei:valList/tei:valItem[@ident=$thisme]">
+														<xsl:apply-templates
+															mode="odd2odd-justcopy" select="tei:gloss" />
+													</xsl:for-each>
+												</xsl:otherwise>
+											</xsl:choose>
+											<xsl:choose>
+												<xsl:when test="$stripped='true'" />
+												<xsl:when test="tei:desc">
+													<xsl:apply-templates
+														mode="odd2odd-justcopy" select="tei:desc" />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:for-each
+														select="$Old/tei:valList/tei:valItem[@ident=$thisme]">
+														<xsl:apply-templates
+															mode="odd2odd-justcopy" select="tei:desc" />
+													</xsl:for-each>
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:for-each>
+									</xsl:copy>
+								</xsl:if>
+							</xsl:for-each>
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:valItem[@mode='add']" />
+							<xsl:apply-templates mode="odd2odd-justcopy"
+								select="tei:valItem[@mode='replace']" />
+						</xsl:copy>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="$Old/tei:valList">
+					<xsl:copy-of select="$Old/tei:valList" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$stripped='true'" />
+				<xsl:when test="$New/tei:exemplum">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$New/tei:exemplum" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:for-each select="$Old">
+						<xsl:apply-templates mode="odd2odd-justcopy"
+							select="tei:exemplum" />
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$stripped='true'" />
+				<xsl:when test="$New/tei:remarks">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="$New/tei:remarks" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:for-each select="$Old">
+						<xsl:apply-templates mode="odd2odd-justcopy"
+							select="tei:remarks" />
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+		</attDef>
+	</xsl:template>
+	<xsl:template match="tei:specGrp">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:schemaSpec">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:specGrpRef" />
+	<xsl:template match="tei:macroSpec|tei:classSpec">
+		<xsl:if test="not(ancestor::tei:schemaSpec)">
+			<xsl:copy-of select="." />
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="tei:attDef[@mode]" />
+	<xsl:template match="tei:elementSpec">
+		<xsl:if test="not(//tei:schemaSpec)">
+			<xsl:variable name="elementName">
+				<xsl:value-of select="@ident" />
+			</xsl:variable>
+			<xsl:copy>
+				<xsl:apply-templates mode="odd2odd-copy"
+					select="@*" />
+				<xsl:apply-templates mode="odd2odd-justcopy"
+					select="tei:altIdent" />
+				<xsl:if test="$stripped='false'">
+					<xsl:apply-templates mode="odd2odd-copy"
+						select="tei:equiv" />
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:gloss" />
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:desc" />
+				</xsl:if>
+				<xsl:apply-templates mode="odd2odd-justcopy"
+					select="tei:classes" />
+				<xsl:apply-templates mode="odd2odd-copy"
+					select="tei:content" />
+				<xsl:apply-templates mode="odd2odd-copy"
+					select="tei:constraintSpec" />
+				<attList xmlns="http://www.tei-c.org/ns/1.0">
+					<xsl:if
+						test="$autoGlobal='true' and not(tei:classes/tei:memberOf[@key='att.global'])">
+						<xsl:comment>
+							1.
+						</xsl:comment>
+						<xsl:call-template
+							name="odd2odd-classAttributesSimple">
+							<xsl:with-param name="whence">
+								9
+							</xsl:with-param>
+							<xsl:with-param name="elementName"
+								select="$elementName" />
+							<xsl:with-param name="className"
+								select="'att.global'" />
+						</xsl:call-template>
+					</xsl:if>
+					<xsl:comment>
+						2.
+					</xsl:comment>
+					<xsl:for-each select="tei:classes/tei:memberOf">
+						<xsl:comment>
+							3:
+							<xsl:value-of select="@key" />
+						</xsl:comment>
+						<xsl:call-template
+							name="odd2odd-classAttributesSimple">
+							<xsl:with-param name="whence">
+								10
+							</xsl:with-param>
+							<xsl:with-param name="elementName"
+								select="$elementName" />
+							<xsl:with-param name="className" select="@key" />
+						</xsl:call-template>
+					</xsl:for-each>
+					<xsl:comment>
+						4.
+					</xsl:comment>
+					<xsl:apply-templates select="tei:attList" />
+					<xsl:comment>
+						5.
+					</xsl:comment>
+				</attList>
+				<xsl:if test="$stripped='false'">
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:exemplum" />
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:remarks" />
+					<xsl:apply-templates mode="odd2odd-justcopy"
+						select="tei:listRef" />
+				</xsl:if>
+			</xsl:copy>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="tei:moduleRef[@url]">
+		<p>
+			Include external module
+			<xsl:value-of select="@url" />
+			.
+		</p>
+	</xsl:template>
+	<xsl:template match="tei:moduleRef[@key]">
+		<p>
+			Internal module
+			<xsl:value-of select="@key" />
+			was located and expanded.
+		</p>
+	</xsl:template>
+	<xsl:template match="@*|processing-instruction()|text()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|text()" />
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template name="odd2odd-classAttributesSimple">
+		<xsl:param name="elementName" />
+		<xsl:param name="className" />
+		<xsl:param name="whence" />
+		<xsl:comment>
+			START on
+			<xsl:value-of select="$className" />
+		</xsl:comment>
+		<xsl:for-each
+			select="key('odd2odd-ATTCLASSES',$className)">
+			<xsl:variable name="CURRENTCLASS" select="." />
+			<xsl:for-each select="tei:attList/tei:attDef">
+				<xsl:call-template
+					name="odd2odd-mergeClassAttribute">
+					<xsl:with-param name="source">
+						9
+					</xsl:with-param>
+					<xsl:with-param name="element" select="$elementName" />
+					<xsl:with-param name="class" select="$className" />
+				</xsl:call-template>
+			</xsl:for-each>
+			<xsl:if test="tei:classes/tei:memberOf">
+				<xsl:for-each select="tei:classes/tei:memberOf">
+					<xsl:variable name="cName" select="@key" />
+					<xsl:call-template
+						name="odd2odd-classAttributesSimple">
+						<xsl:with-param name="whence">
+							11
+						</xsl:with-param>
+						<xsl:with-param name="elementName"
+							select="$elementName" />
+						<xsl:with-param name="className" select="$cName" />
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:if>
+		</xsl:for-each>
+		<xsl:comment>
+			FINISH
+			<xsl:value-of select="$className" />
+		</xsl:comment>
+	</xsl:template>
 
-  <xsl:template name="odd2odd-createCopy">
-    <xsl:param name="Source"  tunnel="yes"/>
-    <xsl:if test="$verbose='true'">
-      <xsl:message>Create <xsl:value-of select="local-name()"/> named <xsl:value-of select="@ident"/>            </xsl:message>
-    </xsl:if>
-    <xsl:element xmlns="http://www.tei-c.org/ns/1.0" name="{local-name()}">
-      <xsl:choose>
-	<xsl:when test="@module"/>
-	<xsl:when test="ancestor::tei:schemaSpec/@module">
-	  <xsl:copy-of select="ancestor::tei:schemaSpec/@module"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:attribute name="module">
+	<xsl:template name="odd2odd-createCopy">
+		<xsl:param name="Source" tunnel="yes" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Create
+				<xsl:value-of select="local-name()" />
+				named
+				<xsl:value-of select="@ident" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:element xmlns="http://www.tei-c.org/ns/1.0"
+			name="{local-name()}">
+			<xsl:choose>
+				<xsl:when test="@module" />
+				<xsl:when test="ancestor::tei:schemaSpec/@module">
+					<xsl:copy-of select="ancestor::tei:schemaSpec/@module" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="module">
 	    <xsl:text>derived-module-</xsl:text>
-	    <xsl:value-of select="ancestor::tei:schemaSpec/@ident"/>
+	    <xsl:value-of
+						select="ancestor::tei:schemaSpec/@ident" />
 	  </xsl:attribute>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:choose>
-	<xsl:when test="local-name()='classSpec'">
-	  <xsl:if test="@type='model' and not(@predeclare)">
-	    <xsl:attribute name="predeclare">true</xsl:attribute>
-	  </xsl:if>
-	  <xsl:apply-templates mode="odd2odd-copy" select="@*|*|processing-instruction()|text()"/>
-	</xsl:when>
-	<xsl:when test="local-name()='macroSpec'">
-	  <xsl:apply-templates mode="odd2odd-copy" select="@*|*|processing-instruction()|text()"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:call-template name="odd2odd-copyElementSpec">
-	    <xsl:with-param name="n" select="'2'"/>
-	  </xsl:call-template>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:element>
-  </xsl:template>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="local-name()='classSpec'">
+					<xsl:if test="@type='model' and not(@predeclare)">
+						<xsl:attribute name="predeclare">true</xsl:attribute>
+					</xsl:if>
+					<xsl:apply-templates mode="odd2odd-copy"
+						select="@*|*|processing-instruction()|text()" />
+				</xsl:when>
+				<xsl:when test="local-name()='macroSpec'">
+					<xsl:apply-templates mode="odd2odd-copy"
+						select="@*|*|processing-instruction()|text()" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="odd2odd-copyElementSpec">
+						<xsl:with-param name="n" select="'2'" />
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
 
-  <xsl:template name="odd2odd-getversion">
-    <xsl:choose>
-      <xsl:when test="key('odd2odd-SCHEMASPECS',$selectedSchema)">
-	<xsl:for-each
-	    select="key('odd2odd-SCHEMASPECS',$selectedSchema)">
-	  <xsl:variable name="source" select="tei:workOutSource(.)"/>
-	  <xsl:for-each select="document($source)/tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
-	    <xsl:value-of select="."/>
-	  </xsl:for-each>
-	</xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:for-each select="document($DEFAULTSOURCE)/tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
-	  <xsl:value-of select="."/>
-	</xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="odd2odd-getversion">
+		<xsl:choose>
+			<xsl:when test="key('odd2odd-SCHEMASPECS',$selectedSchema)">
+				<xsl:for-each
+					select="key('odd2odd-SCHEMASPECS',$selectedSchema)">
+					<xsl:variable name="source"
+						select="tei:workOutSource(.)" />
+					<xsl:for-each
+						select="document($source)/tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
+						<xsl:value-of select="." />
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each
+					select="document($DEFAULTSOURCE)/tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
+					<xsl:value-of select="." />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="odd2odd-processConstraints">
-    <xsl:param name="ORIGINAL"/>
-    <xsl:param name="elementName"/>
-    <!-- first put in the ones we know take precedence -->
-    <xsl:apply-templates mode="odd2odd-justcopy" select="tei:constraintSpec[@mode='add' or not(@mode)]"/>
-    <xsl:apply-templates mode="odd2odd-justcopy" select="tei:constraintSpec[@mode='replace']"/>
-    <xsl:apply-templates mode="odd2odd-justcopy" select="tei:constraintSpec[@mode='change']"/>
-    <xsl:for-each select="$ORIGINAL">
-      <!-- original source  context -->
-      <xsl:for-each select="tei:constraintSpec">
-        <xsl:variable name="CONSTRAINT" select="."/>
-        <xsl:variable name="lookingAt">
-          <xsl:value-of select="concat(../@ident,'_',@ident)"/>
-        </xsl:variable>
-        <xsl:for-each select="$ODD">
-          <xsl:choose>
-            <xsl:when test="key('odd2odd-DELETECONSTRAINT',$lookingAt)"/>
-            <xsl:when test="key('odd2odd-REPLACECONSTRAINT',$lookingAt)"/>
-            <xsl:when test="key('odd2odd-CHANGECONSTRAINT',$lookingAt)"/>
-            <xsl:otherwise>
-              <xsl:copy-of select="$CONSTRAINT"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="odd2odd-processConstraints">
+		<xsl:param name="ORIGINAL" />
+		<xsl:param name="elementName" />
+		<!-- first put in the ones we know take precedence -->
+		<xsl:apply-templates mode="odd2odd-justcopy"
+			select="tei:constraintSpec[@mode='add' or not(@mode)]" />
+		<xsl:apply-templates mode="odd2odd-justcopy"
+			select="tei:constraintSpec[@mode='replace']" />
+		<xsl:apply-templates mode="odd2odd-justcopy"
+			select="tei:constraintSpec[@mode='change']" />
+		<xsl:for-each select="$ORIGINAL">
+			<!-- original source context -->
+			<xsl:for-each select="tei:constraintSpec">
+				<xsl:variable name="CONSTRAINT" select="." />
+				<xsl:variable name="lookingAt">
+					<xsl:value-of select="concat(../@ident,'_',@ident)" />
+				</xsl:variable>
+				<xsl:for-each select="$ODD">
+					<xsl:choose>
+						<xsl:when
+							test="key('odd2odd-DELETECONSTRAINT',$lookingAt)" />
+						<xsl:when
+							test="key('odd2odd-REPLACECONSTRAINT',$lookingAt)" />
+						<xsl:when
+							test="key('odd2odd-CHANGECONSTRAINT',$lookingAt)" />
+						<xsl:otherwise>
+							<xsl:copy-of select="$CONSTRAINT" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
 
 
-   <xsl:template match="@*|text()|processing-instruction()" mode="odd2odd-justcopy">
-      <xsl:copy-of select="."/>
-   </xsl:template>
+	<xsl:template match="@*|text()|processing-instruction()"
+		mode="odd2odd-justcopy">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-   <xsl:template match="*" mode="odd2odd-justcopy">
-      <xsl:copy>
-         <xsl:apply-templates
-	     select="*|@*|processing-instruction()|text()" mode="odd2odd-justcopy"/>
-      </xsl:copy>
-   </xsl:template>
+	<xsl:template match="*" mode="odd2odd-justcopy">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|text()"
+				mode="odd2odd-justcopy" />
+		</xsl:copy>
+	</xsl:template>
 
 
-  <xsl:template match="processing-instruction()" mode="odd2odd-pass2">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="processing-instruction()"
+		mode="odd2odd-pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
 
-  <xsl:template match="processing-instruction()" mode="odd2odd-pass3">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="processing-instruction()"
+		mode="odd2odd-pass3">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="@*|text()" mode="odd2odd-pass3">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="@*|text()" mode="odd2odd-pass3">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="*" mode="odd2odd-pass3">
-    <xsl:choose>
-      <xsl:when test="self::rng:optional     and count(rng:zeroOrMore)=2    and count(*)=2">
-        <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="odd2odd-pass3"/>
-      </xsl:when>
-      <xsl:when test="count(*)=1">
-        <xsl:variable name="element" select="local-name()"/>
-        <xsl:choose>
-          <xsl:when test="*[local-name()=$element]">
-            <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="odd2odd-pass3"/>
-          </xsl:when>
-          <xsl:when test="$element='optional'         and rng:zeroOrMore">
-            <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="odd2odd-pass3"/>
-          </xsl:when>
-          <xsl:when test="$element='optional'         and rng:oneOrMore">
-            <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="odd2odd-pass3"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:copy>
-              <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="odd2odd-pass3"/>
-            </xsl:copy>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy>
-          <xsl:apply-templates select="*|@*|text()|processing-instruction()" mode="odd2odd-pass3"/>
-        </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="*" mode="odd2odd-pass3">
+		<xsl:choose>
+			<xsl:when
+				test="self::rng:optional     and count(rng:zeroOrMore)=2    and count(*)=2">
+				<xsl:apply-templates
+					select="*|@*|text()|processing-instruction()" mode="odd2odd-pass3" />
+			</xsl:when>
+			<xsl:when test="count(*)=1">
+				<xsl:variable name="element" select="local-name()" />
+				<xsl:choose>
+					<xsl:when test="*[local-name()=$element]">
+						<xsl:apply-templates
+							select="*|@*|text()|processing-instruction()"
+							mode="odd2odd-pass3" />
+					</xsl:when>
+					<xsl:when
+						test="$element='optional'         and rng:zeroOrMore">
+						<xsl:apply-templates
+							select="*|@*|text()|processing-instruction()"
+							mode="odd2odd-pass3" />
+					</xsl:when>
+					<xsl:when
+						test="$element='optional'         and rng:oneOrMore">
+						<xsl:apply-templates
+							select="*|@*|text()|processing-instruction()"
+							mode="odd2odd-pass3" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy>
+							<xsl:apply-templates
+								select="*|@*|text()|processing-instruction()"
+								mode="odd2odd-pass3" />
+						</xsl:copy>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|text()|processing-instruction()" mode="odd2odd-pass3" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:function name="tei:workOutSource" as="xs:string">
-    <xsl:param name="e"/>
-    <xsl:variable name="loc">
-      <xsl:choose>
-	<xsl:when test="$e/@source">
-	  <xsl:value-of select="$e/@source"/>
-	</xsl:when>
-	<xsl:when test="$e/ancestor::tei:schemaSpec/@source">
-	  <xsl:value-of select="$e/ancestor::tei:schemaSpec/@source"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="$DEFAULTSOURCE"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="source">
-      <xsl:choose>
-	<xsl:when test="starts-with($loc,'/')">
-	  <xsl:value-of select="$loc"/>
-	</xsl:when>
-	<xsl:when test="starts-with($loc,'file:')">
-	  <xsl:value-of select="$loc"/>
-	</xsl:when>
-	<xsl:when test="starts-with($loc,'http:')">
-	  <xsl:value-of select="$loc"/>
-	</xsl:when>
-	<xsl:when test="starts-with($loc,'https:')">
-	  <xsl:value-of select="$loc"/>
-	</xsl:when>
-	<xsl:when test="starts-with($loc,'tei:')">
-	  <xsl:value-of
-	      select="replace($loc,'tei:',$defaultTEIServer)"/>
-	  <xsl:text>/xml/tei/odd/p5subset.xml</xsl:text>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="$currentDirectory"/>
-	  <xsl:value-of select="$loc"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="not(doc-available($source))">
-	<xsl:call-template name="die">
-	  <xsl:with-param name="message">
-	    <xsl:text>Source </xsl:text>
-	   <xsl:value-of select='$source'/>
-	   <xsl:text> not readable</xsl:text>
-	  </xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:if test="$verbose='true'">
-	  <xsl:message>
-	    <xsl:text>Setting source document to </xsl:text>
-	    <xsl:value-of  select="$source"/>
-	  </xsl:message>
-	</xsl:if>
-	<xsl:value-of select="$source"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:function>
+	<xsl:function name="tei:workOutSource" as="xs:string">
+		<xsl:param name="e" />
+		<xsl:variable name="loc">
+			<xsl:choose>
+				<xsl:when test="$e/@source">
+					<xsl:value-of select="$e/@source" />
+				</xsl:when>
+				<xsl:when test="$e/ancestor::tei:schemaSpec/@source">
+					<xsl:value-of
+						select="$e/ancestor::tei:schemaSpec/@source" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$DEFAULTSOURCE" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="source">
+			<xsl:choose>
+				<xsl:when test="starts-with($loc,'/')">
+					<xsl:value-of select="$loc" />
+				</xsl:when>
+				<xsl:when test="starts-with($loc,'file:')">
+					<xsl:value-of select="$loc" />
+				</xsl:when>
+				<xsl:when test="starts-with($loc,'http:')">
+					<xsl:value-of select="$loc" />
+				</xsl:when>
+				<xsl:when test="starts-with($loc,'https:')">
+					<xsl:value-of select="$loc" />
+				</xsl:when>
+				<xsl:when test="starts-with($loc,'tei:')">
+					<xsl:value-of
+						select="replace($loc,'tei:',$defaultTEIServer)" />
+					<xsl:text>/xml/tei/odd/p5subset.xml</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$currentDirectory" />
+					<xsl:value-of select="$loc" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="not(doc-available($source))">
+				<xsl:call-template name="die">
+					<xsl:with-param name="message">
+						<xsl:text>Source </xsl:text>
+						<xsl:value-of select='$source' />
+						<xsl:text> not readable</xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						<xsl:text>Setting source document to </xsl:text>
+						<xsl:value-of select="$source" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:value-of select="$source" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
 
-  <xsl:template name="die">
-    <xsl:param name="message"/>
-    <xsl:message terminate="yes">
-      <xsl:text>Error: odd2odd.xsl: </xsl:text> 
-      <xsl:value-of select="$message"/>
-    </xsl:message>
-  </xsl:template>
+	<xsl:template name="die">
+		<xsl:param name="message" />
+		<xsl:message terminate="yes">
+			<xsl:text>Error: odd2odd.xsl: </xsl:text>
+			<xsl:value-of select="$message" />
+		</xsl:message>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-isosch.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-isosch.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-isosch.xsl	(revision 2397)
@@ -1,173 +1,182 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xi="http://www.w3.org/2001/XInclude"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:sch="http://purl.oclc.org/dsdl/schematron"
-                xmlns="http://purl.oclc.org/dsdl/schematron"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="tei rng teix sch xi
+<xsl:stylesheet
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns="http://purl.oclc.org/dsdl/schematron"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="tei rng teix sch xi
 					 #default">
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for simplifying TEI ODD markup </p>
-      <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for simplifying TEI ODD markup </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: extract-isosch.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2011, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:output encoding="utf-8" indent="yes" method="xml"/>
-  <xsl:param name="lang"></xsl:param>
-  <xsl:key name="NS" 
-	   match="sch:ns"
-	   use="1"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: extract-isosch.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:key name="PATTERNS"
-	   match="sch:pattern"
-	   use="1"/>
+	<xsl:output encoding="utf-8" indent="yes" method="xml" />
+	<xsl:param name="lang"></xsl:param>
+	<xsl:key name="NS" match="sch:ns" use="1" />
 
-  <xsl:key name="CONSTRAINTS"
-	   match="tei:constraint"
-	   use="1"/>
+	<xsl:key name="PATTERNS" match="sch:pattern" use="1" />
 
+	<xsl:key name="CONSTRAINTS" match="tei:constraint" use="1" />
 
-  <xsl:template match="/">
-      <schema queryBinding="xslt2">
-         <title>ISO Schematron rules</title>
-         <xsl:for-each select="key('NS',1)">
-            <xsl:choose>
-               <xsl:when test="ancestor::teix:egXML"/>
-	       <xsl:when test="ancestor::tei:constraintSpec/@xml:lang
-		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)"/>
-               <xsl:otherwise>
-                  <xsl:apply-templates select="."/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:for-each>
 
-         <xsl:for-each select="key('PATTERNS',1)">
-            <xsl:choose>
-               <xsl:when test="ancestor::teix:egXML"/>
-	       <xsl:when test="ancestor::tei:constraintSpec/@xml:lang
-		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)"/>
-               <xsl:otherwise>
-                  <xsl:apply-templates select="."/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:for-each>
+	<xsl:template match="/">
+		<schema queryBinding="xslt2">
+			<title>ISO Schematron rules</title>
+			<xsl:for-each select="key('NS',1)">
+				<xsl:choose>
+					<xsl:when test="ancestor::teix:egXML" />
+					<xsl:when
+						test="ancestor::tei:constraintSpec/@xml:lang
+		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)" />
+					<xsl:otherwise>
+						<xsl:apply-templates select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
 
-         <xsl:for-each select="key('CONSTRAINTS',1)">
-            <xsl:choose>
-               <xsl:when test="ancestor::teix:egXML"/>
-	       <xsl:when test="ancestor::tei:constraintSpec/@xml:lang
-		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)"/>
-               <xsl:otherwise>
-		 <xsl:variable name="patID">
-		   <xsl:choose>
-		     <xsl:when test="ancestor::tei:elementSpec">
-		       <xsl:value-of select="concat(ancestor::tei:elementSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)"/>
-		     </xsl:when>
-		     <xsl:when test="ancestor::tei:classSpec">
-		       <xsl:value-of select="concat(ancestor::tei:classSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)"/>
-		     </xsl:when>
-		     <xsl:when test="ancestor::tei:macroSpec">
-		       <xsl:value-of select="concat(ancestor::tei:macroSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)"/>
-		     </xsl:when>
-                        <xsl:otherwise>
-                          <!-- Added 2010-07-03 by Syd Bauman to handle the case in which <constraintSpec> -->
-                          <!-- is a direct child of <schemaSpec>. -->
-                          <xsl:text>constraint-</xsl:text>
-                          <xsl:value-of select="ancestor::tei:constraintSpec/@ident"/>
-                          <xsl:if test="count( ../sch:rule ) > 1">
-                            <xsl:text>-</xsl:text>
-                            <xsl:number/>
-                          </xsl:if>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:variable>
-		 <xsl:if test="sch:rule">
-		   <pattern id="{$patID}">
-		     <xsl:apply-templates select="sch:rule"/>
-		   </pattern>
-		 </xsl:if>
-		 <xsl:if test="sch:assert|sch:report">
-		   <pattern id="{$patID}">
-		     <rule>
-		       <xsl:attribute name="context">
+			<xsl:for-each select="key('PATTERNS',1)">
+				<xsl:choose>
+					<xsl:when test="ancestor::teix:egXML" />
+					<xsl:when
+						test="ancestor::tei:constraintSpec/@xml:lang
+		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)" />
+					<xsl:otherwise>
+						<xsl:apply-templates select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+
+			<xsl:for-each select="key('CONSTRAINTS',1)">
+				<xsl:choose>
+					<xsl:when test="ancestor::teix:egXML" />
+					<xsl:when
+						test="ancestor::tei:constraintSpec/@xml:lang
+		 and not(ancestor::tei:constraintSpec/@xml:lang = $lang)" />
+					<xsl:otherwise>
+						<xsl:variable name="patID">
+							<xsl:choose>
+								<xsl:when test="ancestor::tei:elementSpec">
+									<xsl:value-of
+										select="concat(ancestor::tei:elementSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)" />
+								</xsl:when>
+								<xsl:when test="ancestor::tei:classSpec">
+									<xsl:value-of
+										select="concat(ancestor::tei:classSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)" />
+								</xsl:when>
+								<xsl:when test="ancestor::tei:macroSpec">
+									<xsl:value-of
+										select="concat(ancestor::tei:macroSpec/@ident,'-constraint-',ancestor::tei:constraintSpec/@ident)" />
+								</xsl:when>
+								<xsl:otherwise>
+									<!-- Added 2010-07-03 by Syd Bauman to handle the case in which 
+										<constraintSpec> -->
+									<!-- is a direct child of <schemaSpec>. -->
+									<xsl:text>constraint-</xsl:text>
+									<xsl:value-of
+										select="ancestor::tei:constraintSpec/@ident" />
+									<xsl:if test="count( ../sch:rule ) > 1">
+										<xsl:text>-</xsl:text>
+										<xsl:number />
+									</xsl:if>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:variable>
+						<xsl:if test="sch:rule">
+							<pattern id="{$patID}">
+								<xsl:apply-templates select="sch:rule" />
+							</pattern>
+						</xsl:if>
+						<xsl:if test="sch:assert|sch:report">
+							<pattern id="{$patID}">
+								<rule>
+									<xsl:attribute name="context">
 			 <xsl:text>tei:</xsl:text>
 			 <xsl:choose>
 			   <xsl:when test="ancestor::tei:elementSpec">
 			     <xsl:value-of
-				 select="ancestor::tei:elementSpec/@ident"/>
+										select="ancestor::tei:elementSpec/@ident" />
 			   </xsl:when>
 			   <xsl:otherwise>*</xsl:otherwise>
 			 </xsl:choose>
 		       </xsl:attribute>
-		       <xsl:apply-templates select="sch:assert|sch:report"/>
-		     </rule>
-		   </pattern>
-		 </xsl:if>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:for-each>
-      </schema>
-  </xsl:template>
-  
-  <xsl:template match="sch:rule[not(@context)]">
-    <rule>
-      <xsl:attribute name="context">
+									<xsl:apply-templates
+										select="sch:assert|sch:report" />
+								</rule>
+							</pattern>
+						</xsl:if>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</schema>
+	</xsl:template>
+
+	<xsl:template match="sch:rule[not(@context)]">
+		<rule>
+			<xsl:attribute name="context">
 	<xsl:text>tei:</xsl:text>
-	<xsl:value-of select="ancestor::tei:elementSpec/@ident"/>
+	<xsl:value-of select="ancestor::tei:elementSpec/@ident" />
       </xsl:attribute>
-      <xsl:apply-templates/>
-    </rule>
-  </xsl:template>
-  
-  
-  <xsl:template match="@*|text()|comment()|processing-instruction()">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  
-  <xsl:template match="sch:*">
-    <xsl:element name="{local-name()}">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
-  
+			<xsl:apply-templates />
+		</rule>
+	</xsl:template>
+
+
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+
+	<xsl:template match="sch:*">
+		<xsl:element name="{local-name()}">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/translate-odd.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/translate-odd.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/translate-odd.xsl	(revision 2397)
@@ -1,118 +1,113 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- 
-Text Encoding Initiative Consortium XSLT stylesheet family
-$Date: 2011-09-20 10:47:43 +0100 (Tue, 20 Sep 2011) $, $Revision: 9329 $, $Author: rahtz $
-
-XSL stylesheet to process TEI documents using ODD markup
-
- 
-##LICENSE
---><xsl:stylesheet xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei"
-                version="2.0">
-  <xsl:output method="xml" indent="yes" encoding="utf-8"/>
-  <xsl:param name="verbose"/>
-  <xsl:param name="lang">es</xsl:param>
-  <xsl:key name="ELEMENTS" match="element" use="@ident"/>
-  <xsl:key name="ATTRIBUTES" match="attribute" use="@ident"/>
-  <xsl:param name="TEISERVER">http://localhost/Query/</xsl:param>
-  <xsl:param name="I18N">../i18n.xml</xsl:param>
-  <xsl:variable name="i18n">
-      <xsl:choose>
-         <xsl:when test="$I18N=''">
-            <xsl:value-of select="$TEISERVER"/>
-            <xsl:text>i18n.xql</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="$I18N"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:variable>
-  <xsl:template match="/">
-      <xsl:if test="$verbose='true'">
-         <xsl:message>Translate database: <xsl:value-of select="$i18n"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="*">
-      <xsl:copy>
-         <xsl:apply-templates select="@*|*|text()|comment()|processing-instruction()"/>
-      </xsl:copy>
-  </xsl:template>
-  <xsl:template match="@*|comment()|text()|processing-instruction()">
-      <xsl:copy/>
-  </xsl:template>
-  <xsl:template match="tei:elementSpec">
-      <xsl:copy>
-         <xsl:copy-of select="@*"/>
-         <xsl:variable name="me" select="@ident"/>
-         <xsl:if test="not(tei:altIdent)">
-            <xsl:for-each select="document($i18n)">
-               <xsl:for-each select="key('ELEMENTS',$me)/equiv[@xml:lang=$lang][not(@value='')]">
-                  <xsl:if test="$verbose='true'">
-                     <xsl:message>
-                        <xsl:value-of select="$me"/> ... <xsl:value-of select="@value"/>
-                     </xsl:message>
-                  </xsl:if>
-                  <altIdent xmlns="http://www.tei-c.org/ns/1.0" type="lang">
-                     <xsl:value-of select="@value"/>
-                  </altIdent>
-               </xsl:for-each>
-            </xsl:for-each>
-         </xsl:if>
-         <xsl:apply-templates select="*|text()|comment()|processing-instruction()"/>
-      </xsl:copy>
-  </xsl:template>
-   <!--
-  <xsl:template match="tei:elementSpec/tei:desc">
-    <xsl:variable name="me" select="../@ident"/>
-    <xsl:variable name="trans">
-      <xsl:for-each select="document($i18n)">
-        <xsl:for-each select="key('ELEMENTS',$me)/desc[@xml:lang=$lang]">
-          <xsl:if test="not(.='.')">
-            <xsl:if test="$verbose='true'">
-              <xsl:message><xsl:value-of select="$me"/> ... <xsl:value-of select="."/></xsl:message>
-            </xsl:if>
-            <desc xmlns="http://www.tei-c.org/ns/1.0">
-              <xsl:value-of select="."/>
-            </desc>
-          </xsl:if>
-        </xsl:for-each>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$trans=''">
-        <xsl:copy-of select="."/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy-of select="$trans"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
--->
-  <xsl:template match="tei:attDef">
-      <xsl:copy>
-         <xsl:copy-of select="@*"/>
-         <xsl:variable name="me" select="@ident"/>
-         <xsl:if test="not(tei:altIdent)">
-            <xsl:for-each select="document($i18n)">
-               <xsl:for-each select="key('ATTRIBUTES',$me)/equiv[@xml:lang=$lang][not(@value='')]">
-                  <xsl:if test="$verbose='true'">
-                     <xsl:message>
-                        <xsl:value-of select="$me"/> ... <xsl:value-of select="@value"/>
-                     </xsl:message>
-                  </xsl:if>
-                  <altIdent xmlns="http://www.tei-c.org/ns/1.0" type="lang">
-                     <xsl:value-of select="@value"/>
-                  </altIdent>
-               </xsl:for-each>
-            </xsl:for-each>
-         </xsl:if>
-         <xsl:apply-templates select="*|text()|comment()|processing-instruction()"/>
-      </xsl:copy>
-  </xsl:template>
+<!-- Text Encoding Initiative Consortium XSLT stylesheet family $Date: 2011-09-20 
+	10:47:43 +0100 (Tue, 20 Sep 2011) $, $Revision: 9329 $, $Author: rahtz $ 
+	XSL stylesheet to process TEI documents using ODD markup ##LICENSE -->
+<xsl:stylesheet
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
+	<xsl:output method="xml" indent="yes" encoding="utf-8" />
+	<xsl:param name="verbose" />
+	<xsl:param name="lang">
+		es
+	</xsl:param>
+	<xsl:key name="ELEMENTS" match="element" use="@ident" />
+	<xsl:key name="ATTRIBUTES" match="attribute" use="@ident" />
+	<xsl:param name="TEISERVER">
+		http://localhost/Query/
+	</xsl:param>
+	<xsl:param name="I18N">
+		../i18n.xml
+	</xsl:param>
+	<xsl:variable name="i18n">
+		<xsl:choose>
+			<xsl:when test="$I18N=''">
+				<xsl:value-of select="$TEISERVER" />
+				<xsl:text>i18n.xql</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$I18N" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	<xsl:template match="/">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				Translate database:
+				<xsl:value-of select="$i18n" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction()" />
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template
+		match="@*|comment()|text()|processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
+	<xsl:template match="tei:elementSpec">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:variable name="me" select="@ident" />
+			<xsl:if test="not(tei:altIdent)">
+				<xsl:for-each select="document($i18n)">
+					<xsl:for-each
+						select="key('ELEMENTS',$me)/equiv[@xml:lang=$lang][not(@value='')]">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								<xsl:value-of select="$me" />
+								...
+								<xsl:value-of select="@value" />
+							</xsl:message>
+						</xsl:if>
+						<altIdent xmlns="http://www.tei-c.org/ns/1.0" type="lang">
+							<xsl:value-of select="@value" />
+						</altIdent>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:if>
+			<xsl:apply-templates
+				select="*|text()|comment()|processing-instruction()" />
+		</xsl:copy>
+	</xsl:template>
+	<!-- <xsl:template match="tei:elementSpec/tei:desc"> <xsl:variable name="me" 
+		select="../@ident"/> <xsl:variable name="trans"> <xsl:for-each select="document($i18n)"> 
+		<xsl:for-each select="key('ELEMENTS',$me)/desc[@xml:lang=$lang]"> <xsl:if 
+		test="not(.='.')"> <xsl:if test="$verbose='true'"> <xsl:message><xsl:value-of 
+		select="$me"/> ... <xsl:value-of select="."/></xsl:message> </xsl:if> <desc 
+		xmlns="http://www.tei-c.org/ns/1.0"> <xsl:value-of select="."/> </desc> </xsl:if> 
+		</xsl:for-each> </xsl:for-each> </xsl:variable> <xsl:choose> <xsl:when test="$trans=''"> 
+		<xsl:copy-of select="."/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$trans"/> 
+		</xsl:otherwise> </xsl:choose> </xsl:template> -->
+	<xsl:template match="tei:attDef">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:variable name="me" select="@ident" />
+			<xsl:if test="not(tei:altIdent)">
+				<xsl:for-each select="document($i18n)">
+					<xsl:for-each
+						select="key('ATTRIBUTES',$me)/equiv[@xml:lang=$lang][not(@value='')]">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								<xsl:value-of select="$me" />
+								...
+								<xsl:value-of select="@value" />
+							</xsl:message>
+						</xsl:if>
+						<altIdent xmlns="http://www.tei-c.org/ns/1.0" type="lang">
+							<xsl:value-of select="@value" />
+						</altIdent>
+					</xsl:for-each>
+				</xsl:for-each>
+			</xsl:if>
+			<xsl:apply-templates
+				select="*|text()|comment()|processing-instruction()" />
+		</xsl:copy>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2json.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2json.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2json.xsl	(revision 2397)
@@ -1,270 +1,301 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-    xmlns:fo="http://www.w3.org/1999/XSL/Format" 
-    xmlns:html="http://www.w3.org/1999/xhtml" 
-    xmlns:i="http://www.iso.org/ns/1.0"
-    xmlns:rng="http://relaxng.org/ns/structure/1.0"
-    xmlns:s="http://www.ascc.net/xml/schematron" 
-    xmlns:sch="http://purl.oclc.org/dsdl/schematron" 
-    xmlns="http://www.tei-c.org/ns/1.0"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:teix="http://www.tei-c.org/ns/Examples" 
-    xmlns:xi="http://www.w3.org/2001/XInclude"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl" 
-    version="2.0">
-  <xsl:import href="teiodds.xsl"/>
-  <xsl:import href="../common2/i18n.xsl"/>
-  <xsl:import href="../common2/tei-param.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making JSON from ODD </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:i="http://www.iso.org/ns/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl"
+	version="2.0">
+	<xsl:import href="teiodds.xsl" />
+	<xsl:import href="../common2/i18n.xsl" />
+	<xsl:import href="../common2/tei-param.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making JSON from ODD </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: odd2json.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:output encoding="utf-8" indent="yes" method="text"/>
-  <xsl:strip-space elements="*"/>
-  <xsl:param name="TEIC">false</xsl:param>
-  <xsl:param name="verbose"/>
-  <xsl:param name="outputDir"/>
-  <xsl:param name="appendixWords"/>
-  <xsl:template name="makeAnchor">
-      <xsl:param name="name"/>
-  </xsl:template>
-  <xsl:param name="splitLevel">-1</xsl:param>
-  <xsl:variable name="oddmode">dtd</xsl:variable>
-  <xsl:variable name="filesuffix"/>
-   <!-- get list of output files -->
-  <xsl:variable name="linkColor"/>
-  <xsl:template match="tei:moduleSpec[@type='decls']"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:variable name="dq">"</xsl:variable>
-  <xsl:variable name="escdq">\\"</xsl:variable>
-  <xsl:template match="/">
-    <xsl:text>{"title": "</xsl:text>
-    <xsl:call-template name="generateTitle"/>
-    <xsl:text>","edition": "</xsl:text>
-    <xsl:call-template name="generateEdition"/>
-    <xsl:text>","generator": "oddj2son",
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: odd2json.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output encoding="utf-8" indent="yes" method="text" />
+	<xsl:strip-space elements="*" />
+	<xsl:param name="TEIC">
+		false
+	</xsl:param>
+	<xsl:param name="verbose" />
+	<xsl:param name="outputDir" />
+	<xsl:param name="appendixWords" />
+	<xsl:template name="makeAnchor">
+		<xsl:param name="name" />
+	</xsl:template>
+	<xsl:param name="splitLevel">
+		-1
+	</xsl:param>
+	<xsl:variable name="oddmode">
+		dtd
+	</xsl:variable>
+	<xsl:variable name="filesuffix" />
+	<!-- get list of output files -->
+	<xsl:variable name="linkColor" />
+	<xsl:template match="tei:moduleSpec[@type='decls']" />
+
+	<xsl:variable name="dq">
+		"
+	</xsl:variable>
+	<xsl:variable name="escdq">
+		\\"
+	</xsl:variable>
+	<xsl:template match="/">
+		<xsl:text>{"title": "</xsl:text>
+		<xsl:call-template name="generateTitle" />
+		<xsl:text>","edition": "</xsl:text>
+		<xsl:call-template name="generateEdition" />
+		<xsl:text>","generator": "oddj2son",
     "date":"</xsl:text>
-    <xsl:call-template name="showDate"/>
-    <xsl:text>","modules": [</xsl:text>
-    <xsl:for-each select="key('Modules',1)">
-      <xsl:sort select="@ident"/>
-      <xsl:text>{"ident":"</xsl:text>
-      <xsl:value-of select="@ident"/>
-      <xsl:text>",</xsl:text>
-      <xsl:call-template name="desc"/>
-      <xsl:text>}</xsl:text>
-      <xsl:if test="not(position() = last())">,</xsl:if>
-      <xsl:text>&#10;</xsl:text>
-    </xsl:for-each>
-    <xsl:text>],</xsl:text>
+		<xsl:call-template name="showDate" />
+		<xsl:text>","modules": [</xsl:text>
+		<xsl:for-each select="key('Modules',1)">
+			<xsl:sort select="@ident" />
+			<xsl:text>{"ident":"</xsl:text>
+			<xsl:value-of select="@ident" />
+			<xsl:text>",</xsl:text>
+			<xsl:call-template name="desc" />
+			<xsl:text>}</xsl:text>
+			<xsl:if test="not(position() = last())">
+				,
+			</xsl:if>
+			<xsl:text>&#10;</xsl:text>
+		</xsl:for-each>
+		<xsl:text>],</xsl:text>
 
-    <xsl:text>"elements": [</xsl:text>
-    <xsl:for-each select="key('ELEMENTDOCS',1)">
-      <xsl:sort select="@ident"/>
-      <xsl:text>{"ident":"</xsl:text>
-      <xsl:value-of select="@ident"/>
-      <xsl:text>",</xsl:text>
-      <xsl:text>"module":"</xsl:text>
-      <xsl:value-of select="@module"/>
-      <xsl:text>",</xsl:text>
-      <xsl:call-template name="desc"/>
-      <xsl:if test="tei:classes">
-	<xsl:text>,"classes":[</xsl:text>
-	<xsl:for-each select="tei:classes/tei:memberOf">
-	  <xsl:text>{"</xsl:text>
-	  <xsl:value-of select="@key"/>
-	  <xsl:text>":"</xsl:text>
-	  <xsl:for-each select="key('IDENTS',@key)">
-	    <xsl:value-of select="@type"/>
-	  </xsl:for-each>
-	  <xsl:text>"}</xsl:text>
-	  <xsl:if test="following-sibling::tei:memberOf">,</xsl:if>
-	</xsl:for-each>
-	<xsl:text>]</xsl:text>
-      </xsl:if>
-      <xsl:text>,"attributes":[</xsl:text>
-      <xsl:variable name="a">
-	<xsl:call-template name="atts"/>
-      </xsl:variable>
-      <xsl:for-each select="$a/tei:attDef">
-	<xsl:text>{"ident":"</xsl:text>
-	<xsl:value-of select="@ident"/>
-	<xsl:text>",</xsl:text>
-	<xsl:value-of select="tei:desc"/>
-	<xsl:text>}</xsl:text>
-	<xsl:if test="following-sibling::tei:attDef">,</xsl:if>
-      </xsl:for-each>
-      <xsl:text>]</xsl:text>
-      <xsl:text>}</xsl:text>
-      <xsl:if test="not(position() = last())">,</xsl:if>
-      <xsl:text>&#10;</xsl:text>
-    </xsl:for-each>
-    <xsl:text>],</xsl:text>
+		<xsl:text>"elements": [</xsl:text>
+		<xsl:for-each select="key('ELEMENTDOCS',1)">
+			<xsl:sort select="@ident" />
+			<xsl:text>{"ident":"</xsl:text>
+			<xsl:value-of select="@ident" />
+			<xsl:text>",</xsl:text>
+			<xsl:text>"module":"</xsl:text>
+			<xsl:value-of select="@module" />
+			<xsl:text>",</xsl:text>
+			<xsl:call-template name="desc" />
+			<xsl:if test="tei:classes">
+				<xsl:text>,"classes":[</xsl:text>
+				<xsl:for-each select="tei:classes/tei:memberOf">
+					<xsl:text>{"</xsl:text>
+					<xsl:value-of select="@key" />
+					<xsl:text>":"</xsl:text>
+					<xsl:for-each select="key('IDENTS',@key)">
+						<xsl:value-of select="@type" />
+					</xsl:for-each>
+					<xsl:text>"}</xsl:text>
+					<xsl:if test="following-sibling::tei:memberOf">
+						,
+					</xsl:if>
+				</xsl:for-each>
+				<xsl:text>]</xsl:text>
+			</xsl:if>
+			<xsl:text>,"attributes":[</xsl:text>
+			<xsl:variable name="a">
+				<xsl:call-template name="atts" />
+			</xsl:variable>
+			<xsl:for-each select="$a/tei:attDef">
+				<xsl:text>{"ident":"</xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text>",</xsl:text>
+				<xsl:value-of select="tei:desc" />
+				<xsl:text>}</xsl:text>
+				<xsl:if test="following-sibling::tei:attDef">
+					,
+				</xsl:if>
+			</xsl:for-each>
+			<xsl:text>]</xsl:text>
+			<xsl:text>}</xsl:text>
+			<xsl:if test="not(position() = last())">
+				,
+			</xsl:if>
+			<xsl:text>&#10;</xsl:text>
+		</xsl:for-each>
+		<xsl:text>],</xsl:text>
 
-    <xsl:text>"attclasses": [</xsl:text>
-    <xsl:for-each select="key('ATTCLASSDOCS',1)">
-      <xsl:sort select="@ident"/>
-      <xsl:text>{"ident":"</xsl:text>
-      <xsl:value-of  select="@ident"/>
-      <xsl:text>",</xsl:text>
-      <xsl:text>"type":"</xsl:text>
-      <xsl:value-of  select="@type"/>
-      <xsl:text>",</xsl:text>
-      <xsl:call-template name="desc"/>
-      <xsl:text>}</xsl:text>
-      <xsl:if test="not(position() = last())">,</xsl:if>
-      <xsl:text>&#10;</xsl:text>
-    </xsl:for-each>
-    <xsl:text>],</xsl:text>
+		<xsl:text>"attclasses": [</xsl:text>
+		<xsl:for-each select="key('ATTCLASSDOCS',1)">
+			<xsl:sort select="@ident" />
+			<xsl:text>{"ident":"</xsl:text>
+			<xsl:value-of select="@ident" />
+			<xsl:text>",</xsl:text>
+			<xsl:text>"type":"</xsl:text>
+			<xsl:value-of select="@type" />
+			<xsl:text>",</xsl:text>
+			<xsl:call-template name="desc" />
+			<xsl:text>}</xsl:text>
+			<xsl:if test="not(position() = last())">
+				,
+			</xsl:if>
+			<xsl:text>&#10;</xsl:text>
+		</xsl:for-each>
+		<xsl:text>],</xsl:text>
 
-    <xsl:text>"modelclasses": [</xsl:text>
-    <xsl:for-each select="key('MODELCLASSDOCS',1)">
-      <xsl:sort select="@ident"/>
-      <xsl:text>{"ident":"</xsl:text>
-      <xsl:value-of  select="@ident"/>
-      <xsl:text>",</xsl:text>
-      <xsl:text>"type":"</xsl:text>
-      <xsl:value-of  select="@type"/>
-      <xsl:text>",</xsl:text>
-      <xsl:call-template name="desc"/>
-      <xsl:text>}</xsl:text>
-      <xsl:if test="not(position() = last())">,</xsl:if>
-      <xsl:text>&#10;</xsl:text>
-    </xsl:for-each>
-    <xsl:text>],</xsl:text>
+		<xsl:text>"modelclasses": [</xsl:text>
+		<xsl:for-each select="key('MODELCLASSDOCS',1)">
+			<xsl:sort select="@ident" />
+			<xsl:text>{"ident":"</xsl:text>
+			<xsl:value-of select="@ident" />
+			<xsl:text>",</xsl:text>
+			<xsl:text>"type":"</xsl:text>
+			<xsl:value-of select="@type" />
+			<xsl:text>",</xsl:text>
+			<xsl:call-template name="desc" />
+			<xsl:text>}</xsl:text>
+			<xsl:if test="not(position() = last())">
+				,
+			</xsl:if>
+			<xsl:text>&#10;</xsl:text>
+		</xsl:for-each>
+		<xsl:text>],</xsl:text>
 
-    <xsl:text>"macros": [</xsl:text>
-    <xsl:for-each select="key('MACRODOCS',1)">
-      <xsl:sort select="@ident"/>
-      <xsl:text>{"ident":"</xsl:text>
-      <xsl:value-of select="@ident"/>
-      <xsl:text>",</xsl:text>
-      <xsl:text>"type":"</xsl:text>
-      <xsl:value-of select="@type"/>
-      <xsl:text>",</xsl:text>
-      <xsl:call-template name="desc"/>
-      <xsl:text>}</xsl:text>
-      <xsl:if test="not(position() = last())">,</xsl:if>
-      <xsl:text>&#10;</xsl:text>
-    </xsl:for-each>
-    <xsl:text>]</xsl:text>
-    <xsl:text>}</xsl:text>
-  </xsl:template>
+		<xsl:text>"macros": [</xsl:text>
+		<xsl:for-each select="key('MACRODOCS',1)">
+			<xsl:sort select="@ident" />
+			<xsl:text>{"ident":"</xsl:text>
+			<xsl:value-of select="@ident" />
+			<xsl:text>",</xsl:text>
+			<xsl:text>"type":"</xsl:text>
+			<xsl:value-of select="@type" />
+			<xsl:text>",</xsl:text>
+			<xsl:call-template name="desc" />
+			<xsl:text>}</xsl:text>
+			<xsl:if test="not(position() = last())">
+				,
+			</xsl:if>
+			<xsl:text>&#10;</xsl:text>
+		</xsl:for-each>
+		<xsl:text>]</xsl:text>
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-  <xsl:template name="bitOut">
-      <xsl:param name="grammar"/>
-      <xsl:param name="element"/>
-      <xsl:param name="content"/>
-      <xsl:value-of select="normalize-space($content)"/>
-  </xsl:template>
+	<xsl:template name="bitOut">
+		<xsl:param name="grammar" />
+		<xsl:param name="element" />
+		<xsl:param name="content" />
+		<xsl:value-of select="normalize-space($content)" />
+	</xsl:template>
 
-  <xsl:template name="typewriter">
-    <xsl:param name="text"/>
-    <xsl:value-of select="$text"/>
-  </xsl:template>
+	<xsl:template name="typewriter">
+		<xsl:param name="text" />
+		<xsl:value-of select="$text" />
+	</xsl:template>
 
-  <xsl:template name="desc">
-    <xsl:variable name="d">      
-      <xsl:call-template name="makeDescription"/>
-    </xsl:variable>
-    <xsl:text>"desc":"</xsl:text>
-    <xsl:value-of select="replace(normalize-space($d),$dq,$escdq)"/>
-    <xsl:text>"</xsl:text>
-  </xsl:template>
+	<xsl:template name="desc">
+		<xsl:variable name="d">
+			<xsl:call-template name="makeDescription" />
+		</xsl:variable>
+		<xsl:text>"desc":"</xsl:text>
+		<xsl:value-of
+			select="replace(normalize-space($d),$dq,$escdq)" />
+		<xsl:text>"</xsl:text>
+	</xsl:template>
 
-  <xsl:template name="atts">
-    <xsl:call-template name="listAtts"/>
-    <xsl:if test="$TEIC='true'">
-      <xsl:call-template name="classA">
-	<xsl:with-param name="i">att.global</xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-    <xsl:for-each select="tei:classes/tei:memberOf">
-      <xsl:call-template name="classA">
-	<xsl:with-param name="i" select="@key"/>
-      </xsl:call-template>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="atts">
+		<xsl:call-template name="listAtts" />
+		<xsl:if test="$TEIC='true'">
+			<xsl:call-template name="classA">
+				<xsl:with-param name="i">
+					att.global
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:for-each select="tei:classes/tei:memberOf">
+			<xsl:call-template name="classA">
+				<xsl:with-param name="i" select="@key" />
+			</xsl:call-template>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="listAtts">
-    <xsl:for-each select=".//tei:attDef">
-      <tei:attDef ident="{@ident}">
-	<desc>
-	  <xsl:call-template name="desc"/>
-	</desc>
-      </tei:attDef>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="listAtts">
+		<xsl:for-each select=".//tei:attDef">
+			<tei:attDef ident="{@ident}">
+				<desc>
+					<xsl:call-template name="desc" />
+				</desc>
+			</tei:attDef>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="classA">
-    <xsl:param name="i"/>
-    <xsl:for-each select="key('CLASSES',$i)">
-      <xsl:call-template name="listAtts"/>
-      <xsl:for-each select="tei:classes/tei:memberOf">
-	<xsl:call-template name="classA">
-	  <xsl:with-param name="i" select="@key"/>
-	</xsl:call-template>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="classA">
+		<xsl:param name="i" />
+		<xsl:for-each select="key('CLASSES',$i)">
+			<xsl:call-template name="listAtts" />
+			<xsl:for-each select="tei:classes/tei:memberOf">
+				<xsl:call-template name="classA">
+					<xsl:with-param name="i" select="@key" />
+				</xsl:call-template>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
 
 
-    <xsl:template name="generateEdition">
-      <xsl:value-of
-	  select="tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition"/>
-    </xsl:template>
+	<xsl:template name="generateEdition">
+		<xsl:value-of
+			select="tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition" />
+	</xsl:template>
 
-    <xsl:template name="generateTitle">
-      <xsl:for-each
-	  select="tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt">
-	<xsl:choose>
-	  <xsl:when test="tei:title[@type='main']">
-	    <xsl:apply-templates select="tei:title"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:apply-templates select="tei:title"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:for-each>
-    </xsl:template>
+	<xsl:template name="generateTitle">
+		<xsl:for-each
+			select="tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt">
+			<xsl:choose>
+				<xsl:when test="tei:title[@type='main']">
+					<xsl:apply-templates select="tei:title" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="tei:title" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-schemaSpec-ident.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-schemaSpec-ident.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/extract-schemaSpec-ident.xsl	(revision 2397)
@@ -1,30 +1,29 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- ********************************************************************** -->
-<!--                                                                        -->
-<!-- Routine to return the value of the ident= attributes of any            -->
-<!-- <schemaSpec> elements in a TEI document.                               -->
-<!--                                                                        -->
-<!-- Input: an XML file, presumably an ODD file, i.e., one that's in the    -->
-<!--        tei namespace and that uses the tagset for tagset documentation -->
-<!--                                                                        -->
-<!-- Output: a newline-separated list of the values of the ident=           -->
-<!--         attribute of each <schemaSpec> element found.                  -->
-<!--                                                                        -->
-<!-- Used by the Roma shell script to ascertain the schema name             -->
-<!--                                                                        -->
-<!-- Written 2005-01-18 by Syd Bauman                                       -->
-<!--                                                                        -->
+<!-- -->
+<!-- Routine to return the value of the ident= attributes of any -->
+<!-- <schemaSpec> elements in a TEI document. -->
+<!-- -->
+<!-- Input: an XML file, presumably an ODD file, i.e., one that's in the -->
+<!-- tei namespace and that uses the tagset for tagset documentation -->
+<!-- -->
+<!-- Output: a newline-separated list of the values of the ident= -->
+<!-- attribute of each <schemaSpec> element found. -->
+<!-- -->
+<!-- Used by the Roma shell script to ascertain the schema name -->
+<!-- -->
+<!-- Written 2005-01-18 by Syd Bauman -->
+<!-- -->
 <!-- ********************************************************************** -->
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0">
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
 
-  <xsl:output encoding="utf8" method="text"/>
-  <xsl:template match="/">
-      <xsl:for-each select=".//tei:schemaSpec">
-         <xsl:value-of select="@ident"/>
-         <xsl:text>&#x0A;</xsl:text>
-      </xsl:for-each>
-  </xsl:template>
+	<xsl:output encoding="utf8" method="text" />
+	<xsl:template match="/">
+		<xsl:for-each select=".//tei:schemaSpec">
+			<xsl:value-of select="@ident" />
+			<xsl:text>&#x0A;</xsl:text>
+		</xsl:for-each>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2dtd.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2dtd.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2dtd.xsl	(revision 2397)
@@ -1,1644 +1,1815 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:t="http://www.thaiopensource.com/ns/annotations"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a t tei fo rng xs"
-                version="2.0">
-  <xsl:import href="teiodds.xsl"/>
-  <xsl:import href="../common2/i18n.xsl"/>
-  <xsl:import href="../common2/tei-param.xsl"/>
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:t="http://www.thaiopensource.com/ns/annotations"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making DTD from ODD </p>
-         <p>This software is dual-licensed:
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a t tei fo rng xs" version="2.0">
+	<xsl:import href="teiodds.xsl" />
+	<xsl:import href="../common2/i18n.xsl" />
+	<xsl:import href="../common2/tei-param.xsl" />
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making DTD from ODD </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: odd2dtd.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:output method="text"/>
-  <xsl:param name="autoGlobal">false</xsl:param>
-  <xsl:param name="verbose"/>
-  <xsl:param name="outputDir"/>
-  <xsl:param name="appendixWords"> </xsl:param>
-  <xsl:param name="filesuffix"/>
-  <xsl:template name="headingNumberSuffix">
-      <xsl:text> </xsl:text>
-  </xsl:template>
-  <xsl:param name="numberBackHeadings"> </xsl:param>
-  <xsl:param name="numberFrontHeadings"> </xsl:param>
-  <xsl:param name="numberHeadings"> </xsl:param>
-  <xsl:param name="numberHeadingsDepth"> </xsl:param>
-  <xsl:param name="oddmode">dtd</xsl:param>
-  <xsl:param name="prenumberedHeadings">false</xsl:param>
-  <xsl:param name="splitLevel">-1</xsl:param>
-  <xsl:param name="generateNamespacePrefix">false</xsl:param>
-  <xsl:param name="namespacePrefix"/>
-  <xsl:key match="tei:moduleSpec" name="Modules" use="1"/>
-  <xsl:variable name="nsPrefix">
-      <xsl:choose>
-         <xsl:when test="generateNamespacePrefix='false'"/>
-         <xsl:when test="not($namespacePrefix='')">
-            <xsl:value-of select="$namespacePrefix"/>
-         </xsl:when>
-         <xsl:when test="key('LISTSCHEMASPECS',$whichSchemaSpec)/@ns">
-            <xsl:variable name="n" select="key('LISTSCHEMASPECS',whichSchemaSpec)/@ns"/>
-            <xsl:choose>
-               <xsl:when test="$n='http://www.w3.org/2005/11/its'">its:</xsl:when>
-               <xsl:when test="$n='http://www.tei-c.org/ns/1.0'">tei:</xsl:when>
-            </xsl:choose>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:variable>
-  <xsl:key name="NSELEMENTS" match="tei:elementSpec[@ns]|tei:attDef[@ns]" use="1"/>
-  <xsl:key match="tei:moduleSpec[@ident]" name="FILES" use="@ident"/>
-  <xsl:template match="/">
-      <xsl:choose>
-         <xsl:when test="key('SCHEMASPECS',1)">
-            <xsl:apply-templates select="key('LISTSCHEMASPECS',$whichSchemaSpec)"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="byModule"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="byModule">
-      <xsl:for-each select="key('Modules',1)">
-         <xsl:sort order="descending" select="@ident"/>
-         <xsl:if test="$verbose='true'">
-            <xsl:message> File [<xsl:value-of select="@ident"/>] </xsl:message>
-         </xsl:if>
-         <xsl:call-template name="generateOutput">
-            <xsl:with-param name="suffix">.dtd</xsl:with-param>
-            <xsl:with-param name="method">text</xsl:with-param>
-            <xsl:with-param name="body">
-               <xsl:call-template name="dtdComment">
-                  <xsl:with-param name="text"> 
-	                    <xsl:text>DTD module </xsl:text>
-	                    <xsl:value-of select="@ident"/>
-	                    <xsl:text>. Generated </xsl:text>
-	                    <xsl:call-template name="showDate"/>
-	                    <xsl:text>. </xsl:text>
-			    <xsl:call-template name="copyright"/>
-	                    <xsl:call-template name="makeTEIVersion"/>
-	                    <xsl:call-template name="makeDescription"/>
-	                 </xsl:with-param>
-               </xsl:call-template>
-               <xsl:choose>
-                  <xsl:when test="@type='core'">
-		    <xsl:text>&lt;!ENTITY % TEI.extensions.ent '' &gt;&#10;</xsl:text>
-		    <xsl:text>%TEI.extensions.ent;&#10;</xsl:text>
-		    <xsl:call-template name="dtdComment">
-		      <xsl:with-param name="text">
-			<xsl:text>list of element names</xsl:text>
-                        </xsl:with-param>
-		    </xsl:call-template>
-		    <xsl:if test="$parameterize='true' and count(key('NSELEMENTS',1))&gt;0">
-		      <xsl:text>&lt;!ENTITY % NS '</xsl:text>
-		      <xsl:value-of select="$nsPrefix"/>
-		      <xsl:text>' &gt;&#10;</xsl:text>
-		    </xsl:if>
-		    <xsl:if test="$parameterize='true'">
-		      <xsl:call-template name="NameList"/>
-		    </xsl:if>
-		    <xsl:call-template name="datatypeMacros"/>
-		    <xsl:call-template name="omissability"/>
-		    <xsl:call-template name="entityModules"/>
-		    <xsl:call-template name="predeclaredClasses"/>
-		    <xsl:call-template name="predeclaredMacros"/>
-		    <xsl:call-template name="normalClasses"/>
-		    <xsl:call-template name="normalMacros"/>
-		    <xsl:text>&#10;&lt;!ENTITY % TEI.extensions.dtd '' &gt;&#10;</xsl:text>
-		    <xsl:text>%TEI.extensions.dtd;&#10;</xsl:text>
-		    <xsl:apply-templates mode="tangle" select="key('ElementModule',@ident)">
-		      <xsl:sort select="@ident"/>
-		    </xsl:apply-templates>
-		    <xsl:call-template name="elementModules"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:apply-templates mode="tangle" select="key('ElementModule',@ident)">
-                        <xsl:sort select="@ident"/>
-                     </xsl:apply-templates>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-         </xsl:call-template>
-         <xsl:if test="not(@type='core')">
-            <xsl:call-template name="generateOutput">
-               <xsl:with-param name="suffix">-decl.dtd</xsl:with-param>
-               <xsl:with-param name="method">text</xsl:with-param>
-               <xsl:with-param name="body">
-                  <xsl:call-template name="dtdComment">
-                     <xsl:with-param name="text">
-		                      <xsl:text>TEI P5 entity declaration module for </xsl:text>
-		                      <xsl:value-of select="@ident"/>
-		                      <xsl:text>. Generated </xsl:text>
-		                      <xsl:call-template name="showDate"/>
-		                      <xsl:text>.&#10;</xsl:text>
-				      <xsl:call-template name="copyright"/>
-		                      <xsl:call-template name="makeTEIVersion"/>
-		                      <xsl:call-template name="makeDescription"/>
-	                    </xsl:with-param>
-                  </xsl:call-template>
-                  <xsl:call-template name="datatypeMacros"/>
-                  <xsl:call-template name="normalClasses"/>
-                  <xsl:call-template name="normalMacros"/>
-                  <xsl:call-template name="predeclaredMacros"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:if>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="elementModules">
-      <xsl:for-each select="key('Modules',1)">
-         <xsl:sort order="descending" select="@ident"/>
-         <xsl:if test="not(@type='core')">
-            <xsl:text>&#10;&lt;![%TEI.</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text>;[
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: odd2dtd.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output method="text" />
+	<xsl:param name="autoGlobal">
+		false
+	</xsl:param>
+	<xsl:param name="verbose" />
+	<xsl:param name="outputDir" />
+	<xsl:param name="appendixWords">
+	</xsl:param>
+	<xsl:param name="filesuffix" />
+	<xsl:template name="headingNumberSuffix">
+		<xsl:text> </xsl:text>
+	</xsl:template>
+	<xsl:param name="numberBackHeadings">
+	</xsl:param>
+	<xsl:param name="numberFrontHeadings">
+	</xsl:param>
+	<xsl:param name="numberHeadings">
+	</xsl:param>
+	<xsl:param name="numberHeadingsDepth">
+	</xsl:param>
+	<xsl:param name="oddmode">
+		dtd
+	</xsl:param>
+	<xsl:param name="prenumberedHeadings">
+		false
+	</xsl:param>
+	<xsl:param name="splitLevel">
+		-1
+	</xsl:param>
+	<xsl:param name="generateNamespacePrefix">
+		false
+	</xsl:param>
+	<xsl:param name="namespacePrefix" />
+	<xsl:key match="tei:moduleSpec" name="Modules" use="1" />
+	<xsl:variable name="nsPrefix">
+		<xsl:choose>
+			<xsl:when test="generateNamespacePrefix='false'" />
+			<xsl:when test="not($namespacePrefix='')">
+				<xsl:value-of select="$namespacePrefix" />
+			</xsl:when>
+			<xsl:when test="key('LISTSCHEMASPECS',$whichSchemaSpec)/@ns">
+				<xsl:variable name="n"
+					select="key('LISTSCHEMASPECS',whichSchemaSpec)/@ns" />
+				<xsl:choose>
+					<xsl:when test="$n='http://www.w3.org/2005/11/its'">
+						its:
+					</xsl:when>
+					<xsl:when test="$n='http://www.tei-c.org/ns/1.0'">
+						tei:
+					</xsl:when>
+				</xsl:choose>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:variable>
+	<xsl:key name="NSELEMENTS"
+		match="tei:elementSpec[@ns]|tei:attDef[@ns]" use="1" />
+	<xsl:key match="tei:moduleSpec[@ident]" name="FILES"
+		use="@ident" />
+	<xsl:template match="/">
+		<xsl:choose>
+			<xsl:when test="key('SCHEMASPECS',1)">
+				<xsl:apply-templates
+					select="key('LISTSCHEMASPECS',$whichSchemaSpec)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="byModule" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="byModule">
+		<xsl:for-each select="key('Modules',1)">
+			<xsl:sort order="descending" select="@ident" />
+			<xsl:if test="$verbose='true'">
+				<xsl:message>
+					File [
+					<xsl:value-of select="@ident" />
+					]
+				</xsl:message>
+			</xsl:if>
+			<xsl:call-template name="generateOutput">
+				<xsl:with-param name="suffix">
+					.dtd
+				</xsl:with-param>
+				<xsl:with-param name="method">
+					text
+				</xsl:with-param>
+				<xsl:with-param name="body">
+					<xsl:call-template name="dtdComment">
+						<xsl:with-param name="text">
+							<xsl:text>DTD module </xsl:text>
+							<xsl:value-of select="@ident" />
+							<xsl:text>. Generated </xsl:text>
+							<xsl:call-template name="showDate" />
+							<xsl:text>. </xsl:text>
+							<xsl:call-template name="copyright" />
+							<xsl:call-template name="makeTEIVersion" />
+							<xsl:call-template name="makeDescription" />
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:choose>
+						<xsl:when test="@type='core'">
+							<xsl:text>&lt;!ENTITY % TEI.extensions.ent '' &gt;&#10;</xsl:text>
+							<xsl:text>%TEI.extensions.ent;&#10;</xsl:text>
+							<xsl:call-template name="dtdComment">
+								<xsl:with-param name="text">
+									<xsl:text>list of element names</xsl:text>
+								</xsl:with-param>
+							</xsl:call-template>
+							<xsl:if
+								test="$parameterize='true' and count(key('NSELEMENTS',1))&gt;0">
+								<xsl:text>&lt;!ENTITY % NS '</xsl:text>
+								<xsl:value-of select="$nsPrefix" />
+								<xsl:text>' &gt;&#10;</xsl:text>
+							</xsl:if>
+							<xsl:if test="$parameterize='true'">
+								<xsl:call-template name="NameList" />
+							</xsl:if>
+							<xsl:call-template name="datatypeMacros" />
+							<xsl:call-template name="omissability" />
+							<xsl:call-template name="entityModules" />
+							<xsl:call-template name="predeclaredClasses" />
+							<xsl:call-template name="predeclaredMacros" />
+							<xsl:call-template name="normalClasses" />
+							<xsl:call-template name="normalMacros" />
+							<xsl:text>&#10;&lt;!ENTITY % TEI.extensions.dtd '' &gt;&#10;</xsl:text>
+							<xsl:text>%TEI.extensions.dtd;&#10;</xsl:text>
+							<xsl:apply-templates mode="tangle"
+								select="key('ElementModule',@ident)">
+								<xsl:sort select="@ident" />
+							</xsl:apply-templates>
+							<xsl:call-template name="elementModules" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates mode="tangle"
+								select="key('ElementModule',@ident)">
+								<xsl:sort select="@ident" />
+							</xsl:apply-templates>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:if test="not(@type='core')">
+				<xsl:call-template name="generateOutput">
+					<xsl:with-param name="suffix">
+						-decl.dtd
+					</xsl:with-param>
+					<xsl:with-param name="method">
+						text
+					</xsl:with-param>
+					<xsl:with-param name="body">
+						<xsl:call-template name="dtdComment">
+							<xsl:with-param name="text">
+								<xsl:text>TEI P5 entity declaration module for </xsl:text>
+								<xsl:value-of select="@ident" />
+								<xsl:text>. Generated </xsl:text>
+								<xsl:call-template name="showDate" />
+								<xsl:text>.&#10;</xsl:text>
+								<xsl:call-template name="copyright" />
+								<xsl:call-template name="makeTEIVersion" />
+								<xsl:call-template name="makeDescription" />
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="datatypeMacros" />
+						<xsl:call-template name="normalClasses" />
+						<xsl:call-template name="normalMacros" />
+						<xsl:call-template name="predeclaredMacros" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="elementModules">
+		<xsl:for-each select="key('Modules',1)">
+			<xsl:sort order="descending" select="@ident" />
+			<xsl:if test="not(@type='core')">
+				<xsl:text>&#10;&lt;![%TEI.</xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text>;[
 	&lt;!ENTITY % file.</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text> PUBLIC '-//TEI P5//ELEMENTS </xsl:text>
-            <xsl:value-of select="tei:altIdent[@type='FPI']"/>
-            <xsl:text>//EN' '</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text>.dtd' &gt;
+				<xsl:value-of select="@ident" />
+				<xsl:text> PUBLIC '-//TEI P5//ELEMENTS </xsl:text>
+				<xsl:value-of select="tei:altIdent[@type='FPI']" />
+				<xsl:text>//EN' '</xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text>.dtd' &gt;
 	%file.</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text>;
+				<xsl:value-of select="@ident" />
+				<xsl:text>;
 	]]&gt;&#10;</xsl:text>
-         </xsl:if>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="entityModules">
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>Module declarations</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:for-each select="key('Modules',1)">
-         <xsl:sort order="descending" select="@ident"/>
-         <xsl:if test="not(@type='core')">
-            <xsl:text>&lt;!ENTITY % TEI.</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text> 'IGNORE' &gt;&#10;</xsl:text>
-            <xsl:text>&lt;![%TEI.</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text>;[
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="entityModules">
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>Module declarations</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:for-each select="key('Modules',1)">
+			<xsl:sort order="descending" select="@ident" />
+			<xsl:if test="not(@type='core')">
+				<xsl:text>&lt;!ENTITY % TEI.</xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text> 'IGNORE' &gt;&#10;</xsl:text>
+				<xsl:text>&lt;![%TEI.</xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text>;[
 	&lt;!ENTITY % file.</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text>-decl PUBLIC '-//TEI P5//ENTITIES </xsl:text>
-            <xsl:value-of select="tei:altIdent[@type='FPI']"/>
-            <xsl:text>//EN' '</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text>-decl.dtd' &gt;
+				<xsl:value-of select="@ident" />
+				<xsl:text>-decl PUBLIC '-//TEI P5//ENTITIES </xsl:text>
+				<xsl:value-of select="tei:altIdent[@type='FPI']" />
+				<xsl:text>//EN' '</xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text>-decl.dtd' &gt;
 	%file.</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text>-decl;
+				<xsl:value-of select="@ident" />
+				<xsl:text>-decl;
 	]]&gt;&#10;</xsl:text>
-         </xsl:if>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="omissability">
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>legacy declaration of omissability indicators</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:text>&lt;!ENTITY % TEI.XML 'INCLUDE' &gt;&#10;</xsl:text>
-      <xsl:text>&lt;![%TEI.XML;[&#10;</xsl:text>
-      <xsl:text>&lt;!ENTITY % om.RO '' &gt;&#10;</xsl:text>
-      <xsl:text>&lt;!ENTITY % om.RR '' &gt;&#10;</xsl:text>
-      <xsl:text>]]&gt;&#10;</xsl:text>
-      <xsl:text>&lt;!ENTITY % om.RO '- o' &gt;&#10;</xsl:text>
-      <xsl:text>&lt;!ENTITY % om.RR '- -' &gt;&#10;</xsl:text>
-  </xsl:template>
-  <xsl:template name="datatypeMacros">
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>Start datatype macro declarations</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:for-each select="key('MacroModule',@ident)">
-         <xsl:if test="@type='dt'">
-            <xsl:apply-templates mode="tangle" select="."/>
-         </xsl:if>
-      </xsl:for-each>
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>End of datatype macro declarations</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="predeclaredMacros">
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>Start of pre-declared macros</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:for-each select="key('PredeclareMacrosModule',@ident)">
-         <xsl:apply-templates mode="tangle" select="."/>
-      </xsl:for-each>
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>End of pre-declared macros</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="normalClasses">
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>Start of classes</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:apply-templates mode="tangle" select="key('ClassModule',@ident)"/>
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>End of classes</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="predeclaredClasses">
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>Start of pre-declared classes</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:for-each select="key('predeclaredClasses',1)">
-         <xsl:choose>
-            <xsl:when test="@type='atts'">
-               <xsl:call-template name="classAtt">
-                  <xsl:with-param name="declare">false</xsl:with-param>
-               </xsl:call-template>
-            </xsl:when>
-            <xsl:when test="@type='model'">
-               <xsl:call-template name="classModel"/>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:for-each>
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>End of pre-declared classes</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="normalMacros">
-      <xsl:if test="@type='core'">
-         <xsl:call-template name="dtdComment">
-            <xsl:with-param name="text">
-               <xsl:text>Global pre-declared macros</xsl:text>
-            </xsl:with-param>
-         </xsl:call-template>
-         <xsl:for-each select="key('PredeclareAllMacros',1)">
-            <xsl:text>&#10;&lt;!ENTITY % </xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text> ''</xsl:text>
-            <xsl:text>&gt;&#10;</xsl:text>
-         </xsl:for-each>
-      </xsl:if>
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>Start rest of  macro declarations</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:for-each select="key('MacroModule',@ident)">
-         <xsl:if test="not(@type='dt')">
-            <xsl:choose>
-               <xsl:when test="@predeclare='true'"/>
-               <!--	    <xsl:when test="key('PredeclareMacros',@ident)"/>-->
-	       <xsl:otherwise>
-		 <xsl:apply-templates mode="tangle" select="."/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:if>
-      </xsl:for-each>
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>End macros</xsl:text>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:schemaSpec">
-      <xsl:if test="$verbose='true'">
-         <xsl:message>schemaSpec <xsl:value-of select="@ident"/>
-			      </xsl:message>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="$outputDir='' or $outputDir='-'">
-            <xsl:call-template name="schemaOut"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="generateOutput">
-               <xsl:with-param name="suffix">.dtd</xsl:with-param>
-               <xsl:with-param name="method">text</xsl:with-param>
-               <xsl:with-param name="body">
-                  <xsl:call-template name="schemaOut"/>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="schemaOut">
-      <xsl:call-template name="dtdComment">
-         <xsl:with-param name="text">
-            <xsl:text>DTD Generated </xsl:text>
-            <xsl:call-template name="showDate"/>
-            <xsl:text>. </xsl:text>
-	    <xsl:call-template name="copyright"/>
-            <xsl:call-template name="makeTEIVersion"/>
-            <xsl:call-template name="makeDescription"/>
-         </xsl:with-param>
-      </xsl:call-template>
-      <xsl:choose>
-         <xsl:when test="tei:specGrpRef">
-            <xsl:variable name="SPECS">
-               <tei:schemaSpec>
-                  <xsl:copy-of select="@*"/>
-                  <xsl:apply-templates mode="expandSpecs"/>
-               </tei:schemaSpec>
-            </xsl:variable>
-            <xsl:for-each select="$SPECS/tei:schemaSpec">
-               <xsl:call-template name="schemaSpecBody"/>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="schemaSpecBody"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="schemaSpecBody">
-      <xsl:if test="$parameterize='true' and      count(key('NSELEMENTS',1))&gt;0">
-         <xsl:text>&lt;!ENTITY % NS '</xsl:text>
-         <xsl:value-of select="$nsPrefix"/>
-         <xsl:text>' &gt;&#10;</xsl:text>
-      </xsl:if>
-      <xsl:if test="$parameterize='true'">
-         <xsl:call-template name="NameList"/>
-      </xsl:if>
-      <xsl:text>&#10;&lt;!-- start datatypes --&gt;&#10;</xsl:text>
-      <xsl:apply-templates mode="tangle" select="tei:macroSpec[@type='dt']"/>
-      <xsl:text>&#10;&lt;!-- end datatypes --&gt;&#10;</xsl:text>
-      <xsl:if test="tei:classSpec[@predeclare='true']">
-         <xsl:text>&#10;&lt;!--predeclared classes --&gt;&#10;</xsl:text>
-         <xsl:for-each select="tei:classSpec[@predeclare='true']">
-	   <xsl:choose>
-	     <xsl:when test="@type='atts'">
-	       <xsl:call-template name="classAtt">
-		 <xsl:with-param name="declare">true</xsl:with-param>
-	       </xsl:call-template>
-	     </xsl:when>
-	     <xsl:when test="@type='model' and $parameterize='false'">
-	       <xsl:call-template name="classModel">
-		 <xsl:with-param name="declare">true</xsl:with-param>
-	       </xsl:call-template>
-	     </xsl:when>
-	   </xsl:choose>
-         </xsl:for-each>
-         <xsl:text>&#10;&lt;!--end of predeclared classes --&gt;&#10;</xsl:text>
-         <xsl:apply-templates mode="tangle" select="tei:classSpec"/>
-      </xsl:if>
-      <xsl:text>&#10;&lt;!-- start predeclared patterns --&gt;&#10;</xsl:text>
-      <xsl:for-each select="tei:macroSpec">
-	<xsl:if test="@predeclare='true'">
-	  <xsl:apply-templates mode="tangle" select="."/>
-	</xsl:if>
-      </xsl:for-each>
-      <xsl:text>&#10;&lt;!-- end predeclared patterns --&gt;&#10;</xsl:text>
-      <xsl:text>&#10;&lt;!-- start rest of patterns --&gt;&#10;</xsl:text>
-      <xsl:for-each select="tei:macroSpec">
-	<xsl:choose>
-	  <xsl:when test="@predeclare='true'"/>
-	  <xsl:when test="@type='dt'"/>
-	  <xsl:otherwise>
-	    <xsl:apply-templates mode="tangle" select="."/>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:for-each>
-      <xsl:text>&#10;&lt;!-- end patterns --&gt;&#10;</xsl:text>
-      <xsl:if test="not(tei:classSpec[@predeclare='true'])">
-         <xsl:text>&#10;&lt;!-- start classes --&gt;&#10;</xsl:text>
-         <xsl:apply-templates mode="tangle" select="tei:classSpec[@type='atts']"/>
-         <xsl:apply-templates mode="tangle" select="tei:classSpec[@type='model']"/>
-         <xsl:text>&#10;&lt;!-- stop classes --&gt;&#10;</xsl:text>
-      </xsl:if>
-      <xsl:text>&#10;&lt;!-- start elements --&gt;&#10;</xsl:text>
-      <xsl:apply-templates mode="tangle" select="tei:elementSpec">
-         <xsl:sort select="@ident"/>
-      </xsl:apply-templates>
-      <xsl:text>&#10;&lt;!-- end elements --&gt;&#10;</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec[@xml:id='TEIGIS']" mode="tangle"/>
-  <xsl:template name="NameList">
-      <xsl:choose>
-         <xsl:when test="self::tei:schemaSpec">
-            <xsl:for-each select="tei:elementSpec">
-               <xsl:sort select="@ident"/>
-               <xsl:call-template name="declareAnElement"/>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:for-each select="key('ELEMENTDOCS',1)">
-               <xsl:sort select="@ident"/>
-               <xsl:call-template name="declareAnElement"/>
-            </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-      <!-- walk over all the elementSpec elements and make list of 
-	 elements -->
-  </xsl:template>
-  <xsl:template name="declareAnElement">
-      <xsl:if test="not(starts-with(@ident,'%'))">
-         <xsl:text>&lt;!ENTITY % n.</xsl:text>
-         <xsl:value-of select="@ident"/>
-         <xsl:text> "</xsl:text>
-         <xsl:if test="$parameterize='true' and (@ns)">
-            <xsl:text>%NS;</xsl:text>
-         </xsl:if>
-         <xsl:choose>
-            <xsl:when test="tei:altIdent=@ident">
-               <xsl:value-of select="@ident"/>
-            </xsl:when>
-            <xsl:when test="tei:altIdent">
-               <xsl:value-of select="tei:altIdent"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="@ident"/>
-            </xsl:otherwise>
-         </xsl:choose>
-         <xsl:text>"&gt;&#10;</xsl:text>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="linkStyle"/>
-  <xsl:template name="makeAnchor">
-      <xsl:param name="name"/>
-  </xsl:template>
-  <xsl:template match="rng:element[rng:anyName]">
-      <xsl:text>#PCDATA</xsl:text>
-  </xsl:template>
-  <xsl:template match="rng:zeroOrMore">
-      <xsl:variable name="body">
-         <xsl:call-template name="content">
-            <xsl:with-param name="sep" select="','"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:if test="not($body='')">
-         <xsl:call-template name="checkStart"/>
-         <xsl:value-of select="$body"/>
-         <xsl:text>*</xsl:text>
-         <xsl:call-template name="checkEnd"/>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="rng:oneOrMore">
-      <xsl:variable name="body">
-         <xsl:call-template name="content">
-            <xsl:with-param name="sep" select="','"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:if test="not($body='')">
-         <xsl:call-template name="checkStart"/>
-         <xsl:value-of select="$body"/>
-         <xsl:text>+</xsl:text>
-         <xsl:call-template name="checkEnd"/>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="rng:optional">
-      <xsl:variable name="body">
-         <xsl:call-template name="content">
-            <xsl:with-param name="sep" select="','"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$body=''"> </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="checkStart"/>
-            <xsl:value-of select="$body"/>
-            <xsl:text>?</xsl:text>
-            <xsl:call-template name="checkEnd"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="rng:choice">
-      <xsl:call-template name="checkStart"/>
-      <xsl:choose>
-         <xsl:when test="rng:value and ancestor::tei:elementSpec">
-            <xsl:text>(#PCDATA)</xsl:text>
-         </xsl:when>
-         <xsl:when test="rng:value">
-            <xsl:text> (</xsl:text>
-            <xsl:for-each select="rng:value">
-               <xsl:value-of select="."/>
-               <xsl:if test="following-sibling::rng:value">
-                  <xsl:text>|&#10;</xsl:text>
-               </xsl:if>
-            </xsl:for-each>) </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="content">
-               <xsl:with-param name="sep" select="' |&#xA; '"/>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:call-template name="checkEnd"/>
-  </xsl:template>
-  <xsl:template match="rng:group|rng:mixed">
-      <xsl:call-template name="content">
-         <xsl:with-param name="sep" select="','"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="rng:interleave">
-      <xsl:call-template name="content">
-         <xsl:with-param name="sep" select="','"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="content">
-      <xsl:param name="sep"/>
-        <xsl:variable name="parent" select="local-name(..)"/>
-        <xsl:variable name="contentbody">
-          <xsl:variable name="members">
-            <M>
-              <xsl:for-each select="rng:*|processing-instruction()">
-                  <xsl:variable name="F">
-                     <xsl:choose>
-                        <xsl:when test="self::processing-instruction()">
-                           <xsl:apply-templates select="."/>
-                        </xsl:when>
-                        <xsl:when test="self::rng:ref and $parameterize='false'">
-                           <xsl:choose>
-                              <xsl:when test="key('CLASSES',@name)">
-                                 <xsl:variable name="exists">
-                                    <xsl:call-template name="checkClass">
-                                       <xsl:with-param name="id" select="@name"/>
-                                    </xsl:call-template>
-                                 </xsl:variable>
-                                 <xsl:choose>
-                                    <xsl:when test="$exists=''">
-                                       <xsl:text>_DUMMY_</xsl:text>
-                                       <xsl:value-of select="@name"/>
-                                    </xsl:when>
-                                    <xsl:otherwise>
-                                       <xsl:apply-templates select="."/>
-                                    </xsl:otherwise>
-                                 </xsl:choose>
-                              </xsl:when>
-                              <xsl:when test="key('CLASSES',substring-before(@name,'_'))">
-                                 <xsl:variable name="exists">
-                                    <xsl:call-template name="checkClass">
-                                       <xsl:with-param name="id" select="substring-before(@name,'_')"/>
-                                    </xsl:call-template>
-                                 </xsl:variable>
-                                 <xsl:choose>
-                                    <xsl:when test="$exists=''">
-                                       <xsl:text>_DUMMY_</xsl:text>
-                                       <xsl:value-of select="@name"/>
-                                    </xsl:when>
-                                    <xsl:otherwise>
-                                       <xsl:apply-templates select="."/>
-                                    </xsl:otherwise>
-                                 </xsl:choose>
-                              </xsl:when>
-                              <xsl:when test="key('MACROS',@name)">
-                                 <xsl:apply-templates select="."/>
-                              </xsl:when>
-                              <xsl:when test="key('ELEMENTS',@name)">
-                                 <xsl:apply-templates select="."/>
-                              </xsl:when>
-                           </xsl:choose>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:apply-templates select="."/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:variable>
-                  <xsl:if test="not($F='')">
-                     <N>
-                        <xsl:value-of select="$F"/>
-                     </N>
-                  </xsl:if>
-              </xsl:for-each>
-            </M>
-          </xsl:variable>
-          <xsl:for-each select="$members/M">
-            <xsl:choose>
-              <xsl:when test="starts-with(N[1],'(') and count(N)=1"/>
-              <xsl:when test="$parent='content' and count(N)=1 and starts-with(N[1],'%macro.')"/>
-              <xsl:when test="$parent='content' and count(N)=1">
-                  <xsl:text>(</xsl:text>
-              </xsl:when>
-              <xsl:when test="count(N)=1 and starts-with(N,'%')">
-                  <xsl:text>(</xsl:text>
-              </xsl:when>
-              <xsl:when test="count(N)&gt;1">
-                  <xsl:text>(</xsl:text>
-              </xsl:when>
-            </xsl:choose>
-            <xsl:for-each select="N">
-              <xsl:choose>
-                  <xsl:when test="starts-with(.,'_DUMMY_') and .=preceding-sibling::N[1]"/>
-                  <xsl:otherwise>
-                     <xsl:value-of select="."/>
-                     <xsl:choose>
-                        <xsl:when test="self::N[1]='|&#xA;'"/>
-                        <xsl:when test="self::N[1]='('"/>
-                        <xsl:when test="self::N[1]=')' and position() &lt; last()">
-                           <xsl:value-of select="$sep"/>
-                        </xsl:when>
-                        <xsl:when test="following-sibling::N[1]='('"/>
-                        <xsl:when test="following-sibling::N[1]=')'"/>
-                        <xsl:when test="following-sibling::N[1]='|&#xA;'"/>
-                        <xsl:when test="position() &lt; last()">
-                           <xsl:value-of select="$sep"/>
-                        </xsl:when>
-                     </xsl:choose>
-                  </xsl:otherwise>
-              </xsl:choose>
-            </xsl:for-each>
-            <xsl:choose>
-              <xsl:when test="starts-with(N[1],'(') and count(N)=1"/>
-              <xsl:when test="$parent='content' and count(N)=1 and starts-with(N[1],'%macro.')"/>
-              <xsl:when test="$parent='content' and count(N)=1">
-                  <xsl:text>)</xsl:text>
-              </xsl:when>
-              <xsl:when test="count(N)=1 and starts-with(N,'%')">
-                  <xsl:text>)</xsl:text>
-              </xsl:when>
-              <xsl:when test="count(N)&gt;1">
-                  <xsl:text>)</xsl:text>
-              </xsl:when>
-            </xsl:choose>
-          </xsl:for-each>
-        </xsl:variable>
-        <xsl:choose>
-          <xsl:when test="$contentbody=''"/>
-          <xsl:when test="$contentbody='()'"/>
-	        <!-- some special cases of known evil -->
-          <xsl:when test="$contentbody='(#PCDATA |  #PCDATA)'">
-            <xsl:text>(#PCDATA)</xsl:text>
-          </xsl:when>
-          <xsl:when test="contains($contentbody,'#PCDATA') and contains($contentbody,'%macro.anyXML;')">
-            <xsl:text>(#PCDATA)</xsl:text>
-          </xsl:when>
-          <xsl:when test="contains($contentbody, '| ()')">
-            <xsl:value-of select="substring-before($contentbody,'| ()')"/>
-            <xsl:value-of select="substring-after($contentbody,'| ()')"/>
-          </xsl:when>
-          <xsl:when test="contains($contentbody, ',)')">
-            <xsl:value-of select="substring-before($contentbody,',)')"/>
-	           <xsl:text>)</xsl:text>
-            <xsl:value-of select="substring-after($contentbody,',)')"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="$contentbody"/>
-          </xsl:otherwise>
-        </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:datatype">
-      <xsl:choose>
-         <xsl:when test="rng:data/@type='ID'">
-            <xsl:text> ID</xsl:text>
-         </xsl:when>
-         <xsl:when test="rng:data/@type='IDREF'">
-            <xsl:text> IDREF</xsl:text>
-         </xsl:when>
-         <xsl:when test="rng:data/@type='IDREFS'">
-            <xsl:text> IDREFS</xsl:text>
-         </xsl:when>
-         <xsl:when test="rng:data/@type='NMTOKEN'">
-            <xsl:text> NMTOKEN</xsl:text>
-         </xsl:when>
-         <xsl:when test="rng:data/@type='NMTOKENS'">
-            <xsl:text> NMTOKENS</xsl:text>
-         </xsl:when>
-         <xsl:when test="rng:data/@type='boolean'">
-            <xsl:text> (true | false) </xsl:text>
-         </xsl:when>
-         <xsl:when test="rng:ref">
-            <xsl:text> %</xsl:text>
-            <xsl:value-of select="rng:ref/@name"/>
-            <xsl:text>; </xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text> CDATA</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="rng:element">
-      <xsl:choose>
-         <xsl:when test="parent::tei:content/parent::tei:macroSpec">
-            <xsl:call-template name="topLevel"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="@name"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-   <!--  
-       <xsl:template match="tei:text()"/>-->
-  <xsl:template match="rng:empty">
-      <xsl:text>EMPTY</xsl:text>
-  </xsl:template>
-  <xsl:template match="rng:data">
-      <xsl:choose>
-         <xsl:when test="parent::tei:content/parent::tei:macroSpec[@type='dt']">
-            <xsl:text> CDATA </xsl:text>
-         </xsl:when>
-         <xsl:when test="parent::tei:content">
-            <xsl:text> (#PCDATA)</xsl:text>
-         </xsl:when>
-         <xsl:when test="@type='ID'"> ID </xsl:when>
-         <xsl:when test="@type='IDREF'"> IDREF </xsl:when>
-         <xsl:when test="@type='IDREFS'"> IDREFS </xsl:when>
-         <xsl:otherwise> CDATA </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="rng:text">
-      <xsl:choose>
-         <xsl:when test="parent::tei:content/parent::tei:macroSpec">
-            <xsl:call-template name="topLevel"/>
-         </xsl:when>
-         <xsl:when test="parent::tei:content">
-            <xsl:text> (#PCDATA)</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text> #PCDATA</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec[@type='dt']/tei:content/rng:text">
-      <xsl:text> CDATA</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec[@type='dt']/tei:content/rng:data">
-      <xsl:text> CDATA</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec[@type='epe']/tei:content/rng:text">
-      <xsl:text>CDATA</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec[@type='dt']/tei:content/rng:list">
-      <xsl:text> CDATA</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec[@type='dt']/tei:content/rng:choice">
-      <xsl:choose>
-         <xsl:when test="rng:value">
-            <xsl:text>(</xsl:text>
-            <xsl:for-each select="rng:value">
-               <xsl:value-of select="."/>
-               <xsl:if test="following-sibling::rng:value">|
-</xsl:if>
-            </xsl:for-each>
-            <xsl:if test="rng:data/@type='boolean'">
-               <xsl:text> | true | false</xsl:text>
-            </xsl:if>
-            <xsl:text>)</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text> CDATA</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="rng:text" mode="simple">
-      <xsl:choose>
-         <xsl:when test="parent::tei:content/parent::tei:macroSpec[@type='dt']">
-            <xsl:text> CDATA</xsl:text>
-         </xsl:when>
-         <xsl:when test="parent::tei:content/parent::tei:macroSpec[@type='pe']">
-            <xsl:text>#PCDATA</xsl:text>
-         </xsl:when>
-         <xsl:when test="parent::tei:content and not(following-sibling::rng:*) and not (preceding-sibling::rng:*)">
-            <xsl:text>(#PCDATA)</xsl:text>
-         </xsl:when>
-         <xsl:when test="parent::tei:content and not(following-sibling::rng:*) and not (preceding-sibling::rng:*)">
-            <xsl:text>(#PCDATA)</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>#PCDATA</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="processing-instruction()[name(.)='teidtd']">
-      <xsl:value-of select="."/>
-  </xsl:template>
-  <xsl:template match="processing-instruction()[name(.)='teidtd']" mode="tangle">
-      <xsl:value-of select="."/>
-  </xsl:template>
-  <xsl:template match="rng:ref">
-      <xsl:choose>
-         <xsl:when test="parent::tei:content/parent::tei:macroSpec">
-            <xsl:call-template name="topLevel"/>
-         </xsl:when>
-         <xsl:when test="count(parent::tei:content/rng:*)&gt;1">
-            <xsl:choose>
-               <xsl:when test="not(preceding-sibling::rng:*)">
-                  <xsl:text>(</xsl:text>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:text>,</xsl:text>
-               </xsl:otherwise>
-            </xsl:choose>
-            <xsl:call-template name="refbody"/>
-            <xsl:if test="not(following-sibling::rng:*)">
-               <xsl:text>)</xsl:text>
-            </xsl:if>
-         </xsl:when>
-         <xsl:when test="key('MACROS',@name)">
-            <xsl:call-template name="refbody"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:if test="parent::tei:content">(</xsl:if>
-            <xsl:call-template name="refbody"/>
-            <xsl:if test="parent::tei:content">)</xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="rng:ref" mode="simple">
-      <xsl:call-template name="refbody"/>
-  </xsl:template>
-  <xsl:template name="refbody">
-      <xsl:variable name="R">
-         <xsl:choose>
-            <xsl:when test="$parameterize='false'">
-               <xsl:choose>
-                  <xsl:when test="key('CLASSES',@name)">
-                     <xsl:variable name="exists">
-                        <xsl:call-template name="checkClass">
-                           <xsl:with-param name="id" select="@name"/>
-                        </xsl:call-template>
-                     </xsl:variable>
-                     <xsl:choose>
-                        <xsl:when test="$exists=''">
-                           <xsl:text>_DUMMY_</xsl:text>
-                           <xsl:value-of select="@name"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:text>%</xsl:text>
-                           <xsl:value-of select="@name"/>
-                           <xsl:text>;</xsl:text>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:when test="key('CLASSES',substring-before(@name,'_'))">
-                     <xsl:variable name="exists">
-                        <xsl:call-template name="checkClass">
-                           <xsl:with-param name="id" select="substring-before(@name,'_')"/>
-                        </xsl:call-template>
-                     </xsl:variable>
-                     <xsl:choose>
-                        <xsl:when test="$exists=''">
-                           <xsl:text>_DUMMY_</xsl:text>
-                           <xsl:value-of select="@name"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:text>%</xsl:text>
-                           <xsl:value-of select="@name"/>
-                           <xsl:text>;</xsl:text>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:when test="key('MACROS',@name)">
-                     <xsl:text>%</xsl:text>
-                     <xsl:value-of select="@name"/>
-                     <xsl:text>;</xsl:text>
-                  </xsl:when>
-                  <xsl:when test="key('ELEMENTS',@name)">
-                     <xsl:for-each select="key('ELEMENTS',@name)">
-                        <xsl:choose>
-                           <xsl:when test="tei:altIdent=@ident">
-                              <xsl:value-of select="@ident"/>
-                           </xsl:when>
-                           <xsl:when test="tei:altIdent">
-                              <xsl:value-of select="normalize-space(tei:altIdent)"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@ident"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:for-each>
-                  </xsl:when>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:when test="@name='IGNORE' or @name='INCLUDE'">
-               <xsl:value-of select="@name"/>
-            </xsl:when>
-            <xsl:when test="contains(@name, '.')">
-               <xsl:text>%</xsl:text>
-               <xsl:value-of select="@name"/>
-               <xsl:text>;</xsl:text>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:text>%n.</xsl:text>
-               <xsl:value-of select="@name"/>
-               <xsl:text>;</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:value-of select="$R"/>
-  </xsl:template>
-  <xsl:template name="topLevel">
-      <xsl:variable name="unit">
-         <xsl:apply-templates mode="simple" select="."/>
-      </xsl:variable>
-      <xsl:if test="not($unit='')">
-         <xsl:if test="preceding-sibling::rng:*">
-            <xsl:choose>
-               <xsl:when test="preceding-sibling::processing-instruction()"/>
-               <xsl:otherwise>
-                  <xsl:text>|&#10;</xsl:text>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:if>
-         <xsl:value-of select="$unit"/>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="rng:element" mode="simple">
-      <xsl:choose>
-         <xsl:when test="@name">
-            <xsl:value-of select="@name"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>ANY</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:macroSpec" mode="tangle">
-      <xsl:choose>
-         <xsl:when test="@depend and $parameterize='true'">
-            <xsl:if test="$verbose='true'">
-               <xsl:message>Dependency on <xsl:value-of select="@depend"/> for <xsl:value-of select="@ident"/>
-               </xsl:message>
-            </xsl:if>
-            <xsl:text>&#10; &lt;![%TEI.</xsl:text>
-            <xsl:value-of select="@depend"/>;[ <xsl:call-template name="macroBody"/>
-            <xsl:text>&#10;]]&gt;</xsl:text>
-         </xsl:when>
-         <xsl:when test="@depend and count(key('ElementModule',@depend))=0">
-            <xsl:if test="$verbose='true'">
-               <xsl:message>Dependency on <xsl:value-of select="@depend"/>, but not used in
-						this schema </xsl:message>
-            </xsl:if>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="macroBody"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="macroBody">
-      <xsl:text>&#10;&lt;!ENTITY </xsl:text>
-      <xsl:if test="not(@type) or @type='defaultpe' or @type='pe' or @type='epe' or @type='dt'">
-         <xsl:text>%</xsl:text>
-      </xsl:if>
-      <xsl:text> </xsl:text>
-      <xsl:value-of select="@ident"/>
-      <xsl:text> '</xsl:text>
-      <xsl:for-each select="tei:content">
-	<xsl:choose>
-	  <xsl:when test=".//rng:anyName">
-	    <xsl:text> ANY</xsl:text>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:apply-templates
-		select="tei:*|rng:*|processing-instruction()"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:for-each>
-      <xsl:text>' &gt;&#10;</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:elementSpec" mode="tangle">
-      <xsl:if test="$verbose='true'">
-         <xsl:message> .... elementSpec <xsl:value-of select="@ident"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="starts-with(@ident,'%')">
-            <xsl:call-template name="elementBody"/>
-         </xsl:when>
-         <xsl:when test="$parameterize='false'">
-            <xsl:call-template name="elementBody"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>&#10;&lt;!ENTITY % </xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text> 'INCLUDE' &gt;&#10;&lt;![ %</xsl:text>
-            <xsl:value-of select="@ident"/>
-            <xsl:text>; [&#10;</xsl:text>
-            <xsl:call-template name="elementBody"/>
-            <xsl:text>&#10;]]&gt;&#10;</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="elementBody">
-      <xsl:variable name="ename">
-         <xsl:choose>
-            <xsl:when test="$parameterize='false'">
-               <xsl:choose>
-                  <xsl:when test="@ns='http://www.w3.org/1999/xhtml'">
-                     <xsl:text>html:</xsl:text>
-                     <xsl:value-of select="@ident"/>
-                  </xsl:when>
-                  <xsl:when test="tei:altIdent=@ident">
-                     <xsl:value-of select="@ident"/>
-                  </xsl:when>
-                  <xsl:when test="tei:altIdent">
-                     <xsl:value-of select="normalize-space(tei:altIdent)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@ident"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:when test="starts-with(@ident,'%')">
-               <xsl:value-of select="@ident"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:text>%n.</xsl:text>
-               <xsl:value-of select="@ident"/>
-               <xsl:text>;</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:text>&#10;&lt;!--doc:</xsl:text>
-      <xsl:call-template name="makeDescription">
-         <xsl:with-param name="includeValList">true</xsl:with-param>
-         <xsl:with-param name="coded">false</xsl:with-param>
-      </xsl:call-template>
-      <xsl:text> --&gt;&#10;</xsl:text>
-      <xsl:text>&lt;!ELEMENT </xsl:text>
-      <xsl:value-of select="$ename"/>
-      <xsl:if test="$parameterize='true'">
-         <xsl:text> %om.RR;</xsl:text>
-      </xsl:if>
-      <xsl:text> </xsl:text>
-      <xsl:variable name="Contents">
-         <BLAH>
-            <xsl:choose>
-	      <xsl:when test="tei:content/rng:element[rng:anyName]">
-		<xsl:text> (#PCDATA)</xsl:text>
-	      </xsl:when>
-	      <xsl:when test="tei:content/rng:element">
-                  <xsl:text> ANY</xsl:text>
-	      </xsl:when>
-	      <xsl:when test="tei:valList[@type='closed']">
-		<xsl:text> (#PCDATA)</xsl:text>
-	      </xsl:when>
-	      <xsl:when test="tei:content">
-		<xsl:apply-templates select="tei:content/*"/>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:text/>
-	      </xsl:otherwise>
-            </xsl:choose>
-         </BLAH>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$Contents=''">
-            <xsl:text> EMPTY</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="$Contents"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>&gt;</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@ns and @ns=''"> </xsl:when>
-         <xsl:when test="key('LISTSCHEMASPECS',$whichSchemaSpec)/@ns=''"> </xsl:when>
-         <xsl:when test="@ns">
-            <xsl:text>&#10;&lt;!ATTLIST </xsl:text>
-            <xsl:value-of select="$ename"/>
-            <xsl:text> xmlns CDATA "</xsl:text>
-            <xsl:value-of select="@ns"/>
-            <xsl:text>"</xsl:text>
-            <xsl:text>&gt;</xsl:text>
-         </xsl:when>
-         <xsl:when test="key('LISTSCHEMASPECS',$whichSchemaSpec)/@ns">
-            <xsl:text>&#10;&lt;!ATTLIST </xsl:text>
-            <xsl:value-of select="$ename"/>
-            <xsl:text> xmlns CDATA "</xsl:text>
-            <xsl:value-of select="ancestor::tei:schemaSpec/@ns"/>
-            <xsl:text>"</xsl:text>
-            <xsl:text>&gt;</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>&#10;&lt;!ATTLIST </xsl:text>
-            <xsl:value-of select="$ename"/>
-            <xsl:text> xmlns CDATA "http://www.tei-c.org/ns/1.0"</xsl:text>
-            <xsl:text>&gt;</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:variable name="maybeatts">
-         <xsl:if test="$parameterize='true' and $autoGlobal='true'">
-            <xsl:text>&#10; %att.global.attributes;</xsl:text>
-         </xsl:if>
-         <xsl:if test="$parameterize='true'">
-            <xsl:apply-templates mode="tangleAtts" select="tei:classes/tei:memberOf"/>
-         </xsl:if>
-         <xsl:call-template name="attributeList"/>
-    </xsl:variable>
-      <xsl:if test="string-length($maybeatts) &gt;0">
-         <xsl:text>&#10;&lt;!ATTLIST </xsl:text>
-         <xsl:value-of select="$ename"/>
-         <xsl:value-of select="$maybeatts"/>
-         <xsl:text> &gt;</xsl:text>
-      </xsl:if>
-      <xsl:if test="@ident='TEI' or @ident='teiCorpus'">
-         <xsl:text>&#10;&lt;!ATTLIST </xsl:text>
-         <xsl:value-of select="$ename"/>
-         <xsl:text> xsi:schemaLocation CDATA #IMPLIED&#10;</xsl:text>
-         <xsl:text> xmlns:xsi CDATA #FIXED 'http://www.w3.org/2001/XMLSchema-instance'&#10;</xsl:text>
-         <xsl:text> &gt;</xsl:text>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="attclasses">
-      <xsl:for-each select="tei:classes/tei:memberOf">
-         <xsl:for-each select="key('IDENTS',@key)[1]">
-            <xsl:if test="@type='atts'"> %<xsl:value-of select="@ident"/>
-					          <xsl:text>.attributes;</xsl:text>
-				        </xsl:if>
-         </xsl:for-each>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="classAtt">
-      <xsl:param name="declare">true</xsl:param>
-      <xsl:if test="$verbose='true'">
-         <xsl:message> .... <xsl:value-of select="@ident"/>.attributes</xsl:message>
-      </xsl:if>
-      <xsl:variable name="thisclass">
-         <xsl:value-of select="@ident"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$declare='false'">
-            <xsl:text>&#10;&lt;!ENTITY % </xsl:text>
-            <xsl:value-of select="$thisclass"/>
-            <xsl:text>.attributes</xsl:text>
-            <xsl:text> ''&gt;</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="$parameterize='true'">
-                  <xsl:text>&#10;&lt;!ENTITY % </xsl:text>
-                  <xsl:value-of select="$thisclass"/>
-                  <xsl:text>.attributes '</xsl:text>
-                  <xsl:call-template name="attclasses"/>
-                  <xsl:call-template name="attributeList"/>
-                  <xsl:text>'&gt; </xsl:text>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:text>&lt;!ENTITY % </xsl:text>
-                  <xsl:value-of select="$thisclass"/>
-                  <xsl:text>.attributes '</xsl:text>
-                  <xsl:call-template name="attclasses"/>
-                  <xsl:call-template name="attributeList"/>
-                  <xsl:text>'&gt; </xsl:text>
-                  <xsl:for-each select="tei:attList/tei:attDef">
-                     <xsl:text>&#10;&lt;!ENTITY % </xsl:text>
-                     <xsl:value-of select="$thisclass"/>
-                     <xsl:text>.attribute.</xsl:text>
-                     <xsl:value-of select="translate(@ident,':','')"/>
-                     <xsl:text> '</xsl:text>
-                     <xsl:apply-templates mode="tangle" select="."/>
-                     <xsl:text>'&gt;&#10;</xsl:text>
-                  </xsl:for-each>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:classSpec" mode="tagatts">
-      <xsl:if test="@type='atts'">
-         <xsl:if test="$verbose='true'">
-            <xsl:message> .... added contents of [%<xsl:value-of select="@ident"/>.attributes;]</xsl:message>
-         </xsl:if>
-         <xsl:text>&#10; %</xsl:text>
-         <xsl:value-of select="@ident"/>
-         <xsl:text>.attributes;</xsl:text>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:moduleRef[@key]" mode="tangle">
-      <xsl:if test="$verbose='true'">
-         <xsl:message> moduleRef to <xsl:value-of select="@key"/>
-			      </xsl:message>
-      </xsl:if>
-      <xsl:text>&#10;&lt;!ENTITY %</xsl:text>
-      <xsl:text> file.</xsl:text>
-      <xsl:value-of select="@key"/>
-      <xsl:text> </xsl:text>
-      <xsl:text>PUBLIC</xsl:text>
-      <xsl:text> '-//TEI P5//</xsl:text>
-      <xsl:value-of select="key('FILES',@key)/tei:altIdent[@type='FPI']"/>
-      <xsl:text>//EN' '</xsl:text>
-      <xsl:value-of select="@key"/>
-      <xsl:text>.dtd'</xsl:text>
-      <xsl:text> &gt;&#10;</xsl:text>
-      <xsl:text>%file.</xsl:text>
-      <xsl:value-of select="@key"/>
-      <xsl:text>;&#10;</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:classSpec" mode="tangle">
-      <xsl:if test="$verbose='true'">
-         <xsl:message> .. classSpec <xsl:value-of select="@ident"/>,<xsl:value-of select="@type"/></xsl:message>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="@type='atts'">
-            <xsl:call-template name="classAtt"/>
-         </xsl:when>
-         <xsl:when test="@type='model'">
-            <xsl:call-template name="classModel"/>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:classSpec" mode="process">
-      <xsl:choose>
-         <xsl:when test="@type='atts'">
-            <xsl:call-template name="classAtt"/>
-         </xsl:when>
-         <xsl:when test="@type='model'">
-            <xsl:call-template name="classModel"/>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="classModel">
-      <xsl:param name="declare">false</xsl:param>
-      <xsl:call-template name="processClassDefinition">
-         <xsl:with-param name="type">
-            <xsl:choose>
-               <xsl:when test="@generate">
-                  <xsl:value-of select="@generate"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:text>alternation
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="omissability">
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>legacy declaration of omissability indicators</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:text>&lt;!ENTITY % TEI.XML 'INCLUDE' &gt;&#10;</xsl:text>
+		<xsl:text>&lt;![%TEI.XML;[&#10;</xsl:text>
+		<xsl:text>&lt;!ENTITY % om.RO '' &gt;&#10;</xsl:text>
+		<xsl:text>&lt;!ENTITY % om.RR '' &gt;&#10;</xsl:text>
+		<xsl:text>]]&gt;&#10;</xsl:text>
+		<xsl:text>&lt;!ENTITY % om.RO '- o' &gt;&#10;</xsl:text>
+		<xsl:text>&lt;!ENTITY % om.RR '- -' &gt;&#10;</xsl:text>
+	</xsl:template>
+	<xsl:template name="datatypeMacros">
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>Start datatype macro declarations</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:for-each select="key('MacroModule',@ident)">
+			<xsl:if test="@type='dt'">
+				<xsl:apply-templates mode="tangle" select="." />
+			</xsl:if>
+		</xsl:for-each>
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>End of datatype macro declarations</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="predeclaredMacros">
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>Start of pre-declared macros</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:for-each
+			select="key('PredeclareMacrosModule',@ident)">
+			<xsl:apply-templates mode="tangle" select="." />
+		</xsl:for-each>
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>End of pre-declared macros</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="normalClasses">
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>Start of classes</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:apply-templates mode="tangle"
+			select="key('ClassModule',@ident)" />
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>End of classes</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="predeclaredClasses">
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>Start of pre-declared classes</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:for-each select="key('predeclaredClasses',1)">
+			<xsl:choose>
+				<xsl:when test="@type='atts'">
+					<xsl:call-template name="classAtt">
+						<xsl:with-param name="declare">
+							false
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:when test="@type='model'">
+					<xsl:call-template name="classModel" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>End of pre-declared classes</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="normalMacros">
+		<xsl:if test="@type='core'">
+			<xsl:call-template name="dtdComment">
+				<xsl:with-param name="text">
+					<xsl:text>Global pre-declared macros</xsl:text>
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:for-each select="key('PredeclareAllMacros',1)">
+				<xsl:text>&#10;&lt;!ENTITY % </xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text> ''</xsl:text>
+				<xsl:text>&gt;&#10;</xsl:text>
+			</xsl:for-each>
+		</xsl:if>
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>Start rest of  macro declarations</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:for-each select="key('MacroModule',@ident)">
+			<xsl:if test="not(@type='dt')">
+				<xsl:choose>
+					<xsl:when test="@predeclare='true'" />
+					<!-- <xsl:when test="key('PredeclareMacros',@ident)"/> -->
+					<xsl:otherwise>
+						<xsl:apply-templates mode="tangle" select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:for-each>
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>End macros</xsl:text>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:schemaSpec">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				schemaSpec
+				<xsl:value-of select="@ident" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="$outputDir='' or $outputDir='-'">
+				<xsl:call-template name="schemaOut" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="generateOutput">
+					<xsl:with-param name="suffix">
+						.dtd
+					</xsl:with-param>
+					<xsl:with-param name="method">
+						text
+					</xsl:with-param>
+					<xsl:with-param name="body">
+						<xsl:call-template name="schemaOut" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="schemaOut">
+		<xsl:call-template name="dtdComment">
+			<xsl:with-param name="text">
+				<xsl:text>DTD Generated </xsl:text>
+				<xsl:call-template name="showDate" />
+				<xsl:text>. </xsl:text>
+				<xsl:call-template name="copyright" />
+				<xsl:call-template name="makeTEIVersion" />
+				<xsl:call-template name="makeDescription" />
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:choose>
+			<xsl:when test="tei:specGrpRef">
+				<xsl:variable name="SPECS">
+					<tei:schemaSpec>
+						<xsl:copy-of select="@*" />
+						<xsl:apply-templates mode="expandSpecs" />
+					</tei:schemaSpec>
+				</xsl:variable>
+				<xsl:for-each select="$SPECS/tei:schemaSpec">
+					<xsl:call-template name="schemaSpecBody" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="schemaSpecBody" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="schemaSpecBody">
+		<xsl:if
+			test="$parameterize='true' and      count(key('NSELEMENTS',1))&gt;0">
+			<xsl:text>&lt;!ENTITY % NS '</xsl:text>
+			<xsl:value-of select="$nsPrefix" />
+			<xsl:text>' &gt;&#10;</xsl:text>
+		</xsl:if>
+		<xsl:if test="$parameterize='true'">
+			<xsl:call-template name="NameList" />
+		</xsl:if>
+		<xsl:text>&#10;&lt;!-- start datatypes --&gt;&#10;</xsl:text>
+		<xsl:apply-templates mode="tangle"
+			select="tei:macroSpec[@type='dt']" />
+		<xsl:text>&#10;&lt;!-- end datatypes --&gt;&#10;</xsl:text>
+		<xsl:if test="tei:classSpec[@predeclare='true']">
+			<xsl:text>&#10;&lt;!--predeclared classes --&gt;&#10;</xsl:text>
+			<xsl:for-each select="tei:classSpec[@predeclare='true']">
+				<xsl:choose>
+					<xsl:when test="@type='atts'">
+						<xsl:call-template name="classAtt">
+							<xsl:with-param name="declare">
+								true
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when test="@type='model' and $parameterize='false'">
+						<xsl:call-template name="classModel">
+							<xsl:with-param name="declare">
+								true
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:for-each>
+			<xsl:text>&#10;&lt;!--end of predeclared classes --&gt;&#10;</xsl:text>
+			<xsl:apply-templates mode="tangle"
+				select="tei:classSpec" />
+		</xsl:if>
+		<xsl:text>&#10;&lt;!-- start predeclared patterns --&gt;&#10;</xsl:text>
+		<xsl:for-each select="tei:macroSpec">
+			<xsl:if test="@predeclare='true'">
+				<xsl:apply-templates mode="tangle" select="." />
+			</xsl:if>
+		</xsl:for-each>
+		<xsl:text>&#10;&lt;!-- end predeclared patterns --&gt;&#10;</xsl:text>
+		<xsl:text>&#10;&lt;!-- start rest of patterns --&gt;&#10;</xsl:text>
+		<xsl:for-each select="tei:macroSpec">
+			<xsl:choose>
+				<xsl:when test="@predeclare='true'" />
+				<xsl:when test="@type='dt'" />
+				<xsl:otherwise>
+					<xsl:apply-templates mode="tangle" select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+		<xsl:text>&#10;&lt;!-- end patterns --&gt;&#10;</xsl:text>
+		<xsl:if test="not(tei:classSpec[@predeclare='true'])">
+			<xsl:text>&#10;&lt;!-- start classes --&gt;&#10;</xsl:text>
+			<xsl:apply-templates mode="tangle"
+				select="tei:classSpec[@type='atts']" />
+			<xsl:apply-templates mode="tangle"
+				select="tei:classSpec[@type='model']" />
+			<xsl:text>&#10;&lt;!-- stop classes --&gt;&#10;</xsl:text>
+		</xsl:if>
+		<xsl:text>&#10;&lt;!-- start elements --&gt;&#10;</xsl:text>
+		<xsl:apply-templates mode="tangle"
+			select="tei:elementSpec">
+			<xsl:sort select="@ident" />
+		</xsl:apply-templates>
+		<xsl:text>&#10;&lt;!-- end elements --&gt;&#10;</xsl:text>
+	</xsl:template>
+	<xsl:template match="tei:macroSpec[@xml:id='TEIGIS']"
+		mode="tangle" />
+	<xsl:template name="NameList">
+		<xsl:choose>
+			<xsl:when test="self::tei:schemaSpec">
+				<xsl:for-each select="tei:elementSpec">
+					<xsl:sort select="@ident" />
+					<xsl:call-template name="declareAnElement" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="key('ELEMENTDOCS',1)">
+					<xsl:sort select="@ident" />
+					<xsl:call-template name="declareAnElement" />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+		<!-- walk over all the elementSpec elements and make list of elements -->
+	</xsl:template>
+	<xsl:template name="declareAnElement">
+		<xsl:if test="not(starts-with(@ident,'%'))">
+			<xsl:text>&lt;!ENTITY % n.</xsl:text>
+			<xsl:value-of select="@ident" />
+			<xsl:text> "</xsl:text>
+			<xsl:if test="$parameterize='true' and (@ns)">
+				<xsl:text>%NS;</xsl:text>
+			</xsl:if>
+			<xsl:choose>
+				<xsl:when test="tei:altIdent=@ident">
+					<xsl:value-of select="@ident" />
+				</xsl:when>
+				<xsl:when test="tei:altIdent">
+					<xsl:value-of select="tei:altIdent" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@ident" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>"&gt;&#10;</xsl:text>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="linkStyle" />
+	<xsl:template name="makeAnchor">
+		<xsl:param name="name" />
+	</xsl:template>
+	<xsl:template match="rng:element[rng:anyName]">
+		<xsl:text>#PCDATA</xsl:text>
+	</xsl:template>
+	<xsl:template match="rng:zeroOrMore">
+		<xsl:variable name="body">
+			<xsl:call-template name="content">
+				<xsl:with-param name="sep" select="','" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:if test="not($body='')">
+			<xsl:call-template name="checkStart" />
+			<xsl:value-of select="$body" />
+			<xsl:text>*</xsl:text>
+			<xsl:call-template name="checkEnd" />
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="rng:oneOrMore">
+		<xsl:variable name="body">
+			<xsl:call-template name="content">
+				<xsl:with-param name="sep" select="','" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:if test="not($body='')">
+			<xsl:call-template name="checkStart" />
+			<xsl:value-of select="$body" />
+			<xsl:text>+</xsl:text>
+			<xsl:call-template name="checkEnd" />
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="rng:optional">
+		<xsl:variable name="body">
+			<xsl:call-template name="content">
+				<xsl:with-param name="sep" select="','" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$body=''">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="checkStart" />
+				<xsl:value-of select="$body" />
+				<xsl:text>?</xsl:text>
+				<xsl:call-template name="checkEnd" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="rng:choice">
+		<xsl:call-template name="checkStart" />
+		<xsl:choose>
+			<xsl:when test="rng:value and ancestor::tei:elementSpec">
+				<xsl:text>(#PCDATA)</xsl:text>
+			</xsl:when>
+			<xsl:when test="rng:value">
+				<xsl:text> (</xsl:text>
+				<xsl:for-each select="rng:value">
+					<xsl:value-of select="." />
+					<xsl:if test="following-sibling::rng:value">
+						<xsl:text>|&#10;</xsl:text>
+					</xsl:if>
+				</xsl:for-each>
+				)
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="content">
+					<xsl:with-param name="sep" select="' |&#xA; '" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:call-template name="checkEnd" />
+	</xsl:template>
+	<xsl:template match="rng:group|rng:mixed">
+		<xsl:call-template name="content">
+			<xsl:with-param name="sep" select="','" />
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="rng:interleave">
+		<xsl:call-template name="content">
+			<xsl:with-param name="sep" select="','" />
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="content">
+		<xsl:param name="sep" />
+		<xsl:variable name="parent" select="local-name(..)" />
+		<xsl:variable name="contentbody">
+			<xsl:variable name="members">
+				<M>
+					<xsl:for-each select="rng:*|processing-instruction()">
+						<xsl:variable name="F">
+							<xsl:choose>
+								<xsl:when test="self::processing-instruction()">
+									<xsl:apply-templates select="." />
+								</xsl:when>
+								<xsl:when
+									test="self::rng:ref and $parameterize='false'">
+									<xsl:choose>
+										<xsl:when test="key('CLASSES',@name)">
+											<xsl:variable name="exists">
+												<xsl:call-template name="checkClass">
+													<xsl:with-param name="id" select="@name" />
+												</xsl:call-template>
+											</xsl:variable>
+											<xsl:choose>
+												<xsl:when test="$exists=''">
+													<xsl:text>_DUMMY_</xsl:text>
+													<xsl:value-of select="@name" />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:apply-templates select="." />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:when>
+										<xsl:when
+											test="key('CLASSES',substring-before(@name,'_'))">
+											<xsl:variable name="exists">
+												<xsl:call-template name="checkClass">
+													<xsl:with-param name="id"
+														select="substring-before(@name,'_')" />
+												</xsl:call-template>
+											</xsl:variable>
+											<xsl:choose>
+												<xsl:when test="$exists=''">
+													<xsl:text>_DUMMY_</xsl:text>
+													<xsl:value-of select="@name" />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:apply-templates select="." />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:when>
+										<xsl:when test="key('MACROS',@name)">
+											<xsl:apply-templates select="." />
+										</xsl:when>
+										<xsl:when test="key('ELEMENTS',@name)">
+											<xsl:apply-templates select="." />
+										</xsl:when>
+									</xsl:choose>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:apply-templates select="." />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:variable>
+						<xsl:if test="not($F='')">
+							<N>
+								<xsl:value-of select="$F" />
+							</N>
+						</xsl:if>
+					</xsl:for-each>
+				</M>
+			</xsl:variable>
+			<xsl:for-each select="$members/M">
+				<xsl:choose>
+					<xsl:when test="starts-with(N[1],'(') and count(N)=1" />
+					<xsl:when
+						test="$parent='content' and count(N)=1 and starts-with(N[1],'%macro.')" />
+					<xsl:when test="$parent='content' and count(N)=1">
+						<xsl:text>(</xsl:text>
+					</xsl:when>
+					<xsl:when test="count(N)=1 and starts-with(N,'%')">
+						<xsl:text>(</xsl:text>
+					</xsl:when>
+					<xsl:when test="count(N)&gt;1">
+						<xsl:text>(</xsl:text>
+					</xsl:when>
+				</xsl:choose>
+				<xsl:for-each select="N">
+					<xsl:choose>
+						<xsl:when
+							test="starts-with(.,'_DUMMY_') and .=preceding-sibling::N[1]" />
+						<xsl:otherwise>
+							<xsl:value-of select="." />
+							<xsl:choose>
+								<xsl:when test="self::N[1]='|&#xA;'" />
+								<xsl:when test="self::N[1]='('" />
+								<xsl:when
+									test="self::N[1]=')' and position() &lt; last()">
+									<xsl:value-of select="$sep" />
+								</xsl:when>
+								<xsl:when test="following-sibling::N[1]='('" />
+								<xsl:when test="following-sibling::N[1]=')'" />
+								<xsl:when test="following-sibling::N[1]='|&#xA;'" />
+								<xsl:when test="position() &lt; last()">
+									<xsl:value-of select="$sep" />
+								</xsl:when>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+				<xsl:choose>
+					<xsl:when test="starts-with(N[1],'(') and count(N)=1" />
+					<xsl:when
+						test="$parent='content' and count(N)=1 and starts-with(N[1],'%macro.')" />
+					<xsl:when test="$parent='content' and count(N)=1">
+						<xsl:text>)</xsl:text>
+					</xsl:when>
+					<xsl:when test="count(N)=1 and starts-with(N,'%')">
+						<xsl:text>)</xsl:text>
+					</xsl:when>
+					<xsl:when test="count(N)&gt;1">
+						<xsl:text>)</xsl:text>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$contentbody=''" />
+			<xsl:when test="$contentbody='()'" />
+			<!-- some special cases of known evil -->
+			<xsl:when test="$contentbody='(#PCDATA |  #PCDATA)'">
+				<xsl:text>(#PCDATA)</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="contains($contentbody,'#PCDATA') and contains($contentbody,'%macro.anyXML;')">
+				<xsl:text>(#PCDATA)</xsl:text>
+			</xsl:when>
+			<xsl:when test="contains($contentbody, '| ()')">
+				<xsl:value-of
+					select="substring-before($contentbody,'| ()')" />
+				<xsl:value-of
+					select="substring-after($contentbody,'| ()')" />
+			</xsl:when>
+			<xsl:when test="contains($contentbody, ',)')">
+				<xsl:value-of
+					select="substring-before($contentbody,',)')" />
+				<xsl:text>)</xsl:text>
+				<xsl:value-of
+					select="substring-after($contentbody,',)')" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$contentbody" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:datatype">
+		<xsl:choose>
+			<xsl:when test="rng:data/@type='ID'">
+				<xsl:text> ID</xsl:text>
+			</xsl:when>
+			<xsl:when test="rng:data/@type='IDREF'">
+				<xsl:text> IDREF</xsl:text>
+			</xsl:when>
+			<xsl:when test="rng:data/@type='IDREFS'">
+				<xsl:text> IDREFS</xsl:text>
+			</xsl:when>
+			<xsl:when test="rng:data/@type='NMTOKEN'">
+				<xsl:text> NMTOKEN</xsl:text>
+			</xsl:when>
+			<xsl:when test="rng:data/@type='NMTOKENS'">
+				<xsl:text> NMTOKENS</xsl:text>
+			</xsl:when>
+			<xsl:when test="rng:data/@type='boolean'">
+				<xsl:text> (true | false) </xsl:text>
+			</xsl:when>
+			<xsl:when test="rng:ref">
+				<xsl:text> %</xsl:text>
+				<xsl:value-of select="rng:ref/@name" />
+				<xsl:text>; </xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text> CDATA</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="rng:element">
+		<xsl:choose>
+			<xsl:when test="parent::tei:content/parent::tei:macroSpec">
+				<xsl:call-template name="topLevel" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="@name" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- <xsl:template match="tei:text()"/> -->
+	<xsl:template match="rng:empty">
+		<xsl:text>EMPTY</xsl:text>
+	</xsl:template>
+	<xsl:template match="rng:data">
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:content/parent::tei:macroSpec[@type='dt']">
+				<xsl:text> CDATA </xsl:text>
+			</xsl:when>
+			<xsl:when test="parent::tei:content">
+				<xsl:text> (#PCDATA)</xsl:text>
+			</xsl:when>
+			<xsl:when test="@type='ID'">
+				ID
+			</xsl:when>
+			<xsl:when test="@type='IDREF'">
+				IDREF
+			</xsl:when>
+			<xsl:when test="@type='IDREFS'">
+				IDREFS
+			</xsl:when>
+			<xsl:otherwise>
+				CDATA
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="rng:text">
+		<xsl:choose>
+			<xsl:when test="parent::tei:content/parent::tei:macroSpec">
+				<xsl:call-template name="topLevel" />
+			</xsl:when>
+			<xsl:when test="parent::tei:content">
+				<xsl:text> (#PCDATA)</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text> #PCDATA</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template
+		match="tei:macroSpec[@type='dt']/tei:content/rng:text">
+		<xsl:text> CDATA</xsl:text>
+	</xsl:template>
+	<xsl:template
+		match="tei:macroSpec[@type='dt']/tei:content/rng:data">
+		<xsl:text> CDATA</xsl:text>
+	</xsl:template>
+	<xsl:template
+		match="tei:macroSpec[@type='epe']/tei:content/rng:text">
+		<xsl:text>CDATA</xsl:text>
+	</xsl:template>
+	<xsl:template
+		match="tei:macroSpec[@type='dt']/tei:content/rng:list">
+		<xsl:text> CDATA</xsl:text>
+	</xsl:template>
+	<xsl:template
+		match="tei:macroSpec[@type='dt']/tei:content/rng:choice">
+		<xsl:choose>
+			<xsl:when test="rng:value">
+				<xsl:text>(</xsl:text>
+				<xsl:for-each select="rng:value">
+					<xsl:value-of select="." />
+					<xsl:if test="following-sibling::rng:value">
+						|
+					</xsl:if>
+				</xsl:for-each>
+				<xsl:if test="rng:data/@type='boolean'">
+					<xsl:text> | true | false</xsl:text>
+				</xsl:if>
+				<xsl:text>)</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text> CDATA</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="rng:text" mode="simple">
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:content/parent::tei:macroSpec[@type='dt']">
+				<xsl:text> CDATA</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:content/parent::tei:macroSpec[@type='pe']">
+				<xsl:text>#PCDATA</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:content and not(following-sibling::rng:*) and not (preceding-sibling::rng:*)">
+				<xsl:text>(#PCDATA)</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:content and not(following-sibling::rng:*) and not (preceding-sibling::rng:*)">
+				<xsl:text>(#PCDATA)</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>#PCDATA</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template
+		match="processing-instruction()[name(.)='teidtd']">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template
+		match="processing-instruction()[name(.)='teidtd']" mode="tangle">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="rng:ref">
+		<xsl:choose>
+			<xsl:when test="parent::tei:content/parent::tei:macroSpec">
+				<xsl:call-template name="topLevel" />
+			</xsl:when>
+			<xsl:when test="count(parent::tei:content/rng:*)&gt;1">
+				<xsl:choose>
+					<xsl:when test="not(preceding-sibling::rng:*)">
+						<xsl:text>(</xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>,</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:call-template name="refbody" />
+				<xsl:if test="not(following-sibling::rng:*)">
+					<xsl:text>)</xsl:text>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="key('MACROS',@name)">
+				<xsl:call-template name="refbody" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="parent::tei:content">
+					(
+				</xsl:if>
+				<xsl:call-template name="refbody" />
+				<xsl:if test="parent::tei:content">
+					)
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="rng:ref" mode="simple">
+		<xsl:call-template name="refbody" />
+	</xsl:template>
+	<xsl:template name="refbody">
+		<xsl:variable name="R">
+			<xsl:choose>
+				<xsl:when test="$parameterize='false'">
+					<xsl:choose>
+						<xsl:when test="key('CLASSES',@name)">
+							<xsl:variable name="exists">
+								<xsl:call-template name="checkClass">
+									<xsl:with-param name="id" select="@name" />
+								</xsl:call-template>
+							</xsl:variable>
+							<xsl:choose>
+								<xsl:when test="$exists=''">
+									<xsl:text>_DUMMY_</xsl:text>
+									<xsl:value-of select="@name" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:text>%</xsl:text>
+									<xsl:value-of select="@name" />
+									<xsl:text>;</xsl:text>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:when
+							test="key('CLASSES',substring-before(@name,'_'))">
+							<xsl:variable name="exists">
+								<xsl:call-template name="checkClass">
+									<xsl:with-param name="id"
+										select="substring-before(@name,'_')" />
+								</xsl:call-template>
+							</xsl:variable>
+							<xsl:choose>
+								<xsl:when test="$exists=''">
+									<xsl:text>_DUMMY_</xsl:text>
+									<xsl:value-of select="@name" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:text>%</xsl:text>
+									<xsl:value-of select="@name" />
+									<xsl:text>;</xsl:text>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:when test="key('MACROS',@name)">
+							<xsl:text>%</xsl:text>
+							<xsl:value-of select="@name" />
+							<xsl:text>;</xsl:text>
+						</xsl:when>
+						<xsl:when test="key('ELEMENTS',@name)">
+							<xsl:for-each select="key('ELEMENTS',@name)">
+								<xsl:choose>
+									<xsl:when test="tei:altIdent=@ident">
+										<xsl:value-of select="@ident" />
+									</xsl:when>
+									<xsl:when test="tei:altIdent">
+										<xsl:value-of
+											select="normalize-space(tei:altIdent)" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@ident" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:for-each>
+						</xsl:when>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:when test="@name='IGNORE' or @name='INCLUDE'">
+					<xsl:value-of select="@name" />
+				</xsl:when>
+				<xsl:when test="contains(@name, '.')">
+					<xsl:text>%</xsl:text>
+					<xsl:value-of select="@name" />
+					<xsl:text>;</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>%n.</xsl:text>
+					<xsl:value-of select="@name" />
+					<xsl:text>;</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:value-of select="$R" />
+	</xsl:template>
+	<xsl:template name="topLevel">
+		<xsl:variable name="unit">
+			<xsl:apply-templates mode="simple" select="." />
+		</xsl:variable>
+		<xsl:if test="not($unit='')">
+			<xsl:if test="preceding-sibling::rng:*">
+				<xsl:choose>
+					<xsl:when
+						test="preceding-sibling::processing-instruction()" />
+					<xsl:otherwise>
+						<xsl:text>|&#10;</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+			<xsl:value-of select="$unit" />
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="rng:element" mode="simple">
+		<xsl:choose>
+			<xsl:when test="@name">
+				<xsl:value-of select="@name" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>ANY</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:macroSpec" mode="tangle">
+		<xsl:choose>
+			<xsl:when test="@depend and $parameterize='true'">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Dependency on
+						<xsl:value-of select="@depend" />
+						for
+						<xsl:value-of select="@ident" />
+					</xsl:message>
+				</xsl:if>
+				<xsl:text>&#10; &lt;![%TEI.</xsl:text>
+				<xsl:value-of select="@depend" />
+				;[
+				<xsl:call-template name="macroBody" />
+				<xsl:text>&#10;]]&gt;</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="@depend and count(key('ElementModule',@depend))=0">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Dependency on
+						<xsl:value-of select="@depend" />
+						, but not used in
+						this schema
+					</xsl:message>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="macroBody" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="macroBody">
+		<xsl:text>&#10;&lt;!ENTITY </xsl:text>
+		<xsl:if
+			test="not(@type) or @type='defaultpe' or @type='pe' or @type='epe' or @type='dt'">
+			<xsl:text>%</xsl:text>
+		</xsl:if>
+		<xsl:text> </xsl:text>
+		<xsl:value-of select="@ident" />
+		<xsl:text> '</xsl:text>
+		<xsl:for-each select="tei:content">
+			<xsl:choose>
+				<xsl:when test=".//rng:anyName">
+					<xsl:text> ANY</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates
+						select="tei:*|rng:*|processing-instruction()" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+		<xsl:text>' &gt;&#10;</xsl:text>
+	</xsl:template>
+	<xsl:template match="tei:elementSpec" mode="tangle">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				.... elementSpec
+				<xsl:value-of select="@ident" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="starts-with(@ident,'%')">
+				<xsl:call-template name="elementBody" />
+			</xsl:when>
+			<xsl:when test="$parameterize='false'">
+				<xsl:call-template name="elementBody" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>&#10;&lt;!ENTITY % </xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text> 'INCLUDE' &gt;&#10;&lt;![ %</xsl:text>
+				<xsl:value-of select="@ident" />
+				<xsl:text>; [&#10;</xsl:text>
+				<xsl:call-template name="elementBody" />
+				<xsl:text>&#10;]]&gt;&#10;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="elementBody">
+		<xsl:variable name="ename">
+			<xsl:choose>
+				<xsl:when test="$parameterize='false'">
+					<xsl:choose>
+						<xsl:when test="@ns='http://www.w3.org/1999/xhtml'">
+							<xsl:text>html:</xsl:text>
+							<xsl:value-of select="@ident" />
+						</xsl:when>
+						<xsl:when test="tei:altIdent=@ident">
+							<xsl:value-of select="@ident" />
+						</xsl:when>
+						<xsl:when test="tei:altIdent">
+							<xsl:value-of select="normalize-space(tei:altIdent)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@ident" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:when test="starts-with(@ident,'%')">
+					<xsl:value-of select="@ident" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>%n.</xsl:text>
+					<xsl:value-of select="@ident" />
+					<xsl:text>;</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:text>&#10;&lt;!--doc:</xsl:text>
+		<xsl:call-template name="makeDescription">
+			<xsl:with-param name="includeValList">
+				true
+			</xsl:with-param>
+			<xsl:with-param name="coded">
+				false
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:text> --&gt;&#10;</xsl:text>
+		<xsl:text>&lt;!ELEMENT </xsl:text>
+		<xsl:value-of select="$ename" />
+		<xsl:if test="$parameterize='true'">
+			<xsl:text> %om.RR;</xsl:text>
+		</xsl:if>
+		<xsl:text> </xsl:text>
+		<xsl:variable name="Contents">
+			<BLAH>
+				<xsl:choose>
+					<xsl:when test="tei:content/rng:element[rng:anyName]">
+						<xsl:text> (#PCDATA)</xsl:text>
+					</xsl:when>
+					<xsl:when test="tei:content/rng:element">
+						<xsl:text> ANY</xsl:text>
+					</xsl:when>
+					<xsl:when test="tei:valList[@type='closed']">
+						<xsl:text> (#PCDATA)</xsl:text>
+					</xsl:when>
+					<xsl:when test="tei:content">
+						<xsl:apply-templates select="tei:content/*" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text />
+					</xsl:otherwise>
+				</xsl:choose>
+			</BLAH>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$Contents=''">
+				<xsl:text> EMPTY</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$Contents" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>&gt;</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@ns and @ns=''">
+			</xsl:when>
+			<xsl:when
+				test="key('LISTSCHEMASPECS',$whichSchemaSpec)/@ns=''">
+			</xsl:when>
+			<xsl:when test="@ns">
+				<xsl:text>&#10;&lt;!ATTLIST </xsl:text>
+				<xsl:value-of select="$ename" />
+				<xsl:text> xmlns CDATA "</xsl:text>
+				<xsl:value-of select="@ns" />
+				<xsl:text>"</xsl:text>
+				<xsl:text>&gt;</xsl:text>
+			</xsl:when>
+			<xsl:when test="key('LISTSCHEMASPECS',$whichSchemaSpec)/@ns">
+				<xsl:text>&#10;&lt;!ATTLIST </xsl:text>
+				<xsl:value-of select="$ename" />
+				<xsl:text> xmlns CDATA "</xsl:text>
+				<xsl:value-of select="ancestor::tei:schemaSpec/@ns" />
+				<xsl:text>"</xsl:text>
+				<xsl:text>&gt;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>&#10;&lt;!ATTLIST </xsl:text>
+				<xsl:value-of select="$ename" />
+				<xsl:text> xmlns CDATA "http://www.tei-c.org/ns/1.0"</xsl:text>
+				<xsl:text>&gt;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:variable name="maybeatts">
+			<xsl:if test="$parameterize='true' and $autoGlobal='true'">
+				<xsl:text>&#10; %att.global.attributes;</xsl:text>
+			</xsl:if>
+			<xsl:if test="$parameterize='true'">
+				<xsl:apply-templates mode="tangleAtts"
+					select="tei:classes/tei:memberOf" />
+			</xsl:if>
+			<xsl:call-template name="attributeList" />
+		</xsl:variable>
+		<xsl:if test="string-length($maybeatts) &gt;0">
+			<xsl:text>&#10;&lt;!ATTLIST </xsl:text>
+			<xsl:value-of select="$ename" />
+			<xsl:value-of select="$maybeatts" />
+			<xsl:text> &gt;</xsl:text>
+		</xsl:if>
+		<xsl:if test="@ident='TEI' or @ident='teiCorpus'">
+			<xsl:text>&#10;&lt;!ATTLIST </xsl:text>
+			<xsl:value-of select="$ename" />
+			<xsl:text> xsi:schemaLocation CDATA #IMPLIED&#10;</xsl:text>
+			<xsl:text> xmlns:xsi CDATA #FIXED 'http://www.w3.org/2001/XMLSchema-instance'&#10;</xsl:text>
+			<xsl:text> &gt;</xsl:text>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="attclasses">
+		<xsl:for-each select="tei:classes/tei:memberOf">
+			<xsl:for-each select="key('IDENTS',@key)[1]">
+				<xsl:if test="@type='atts'">
+					%
+					<xsl:value-of select="@ident" />
+					<xsl:text>.attributes;</xsl:text>
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="classAtt">
+		<xsl:param name="declare">
+			true
+		</xsl:param>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				....
+				<xsl:value-of select="@ident" />
+				.attributes
+			</xsl:message>
+		</xsl:if>
+		<xsl:variable name="thisclass">
+			<xsl:value-of select="@ident" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$declare='false'">
+				<xsl:text>&#10;&lt;!ENTITY % </xsl:text>
+				<xsl:value-of select="$thisclass" />
+				<xsl:text>.attributes</xsl:text>
+				<xsl:text> ''&gt;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$parameterize='true'">
+						<xsl:text>&#10;&lt;!ENTITY % </xsl:text>
+						<xsl:value-of select="$thisclass" />
+						<xsl:text>.attributes '</xsl:text>
+						<xsl:call-template name="attclasses" />
+						<xsl:call-template name="attributeList" />
+						<xsl:text>'&gt; </xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>&lt;!ENTITY % </xsl:text>
+						<xsl:value-of select="$thisclass" />
+						<xsl:text>.attributes '</xsl:text>
+						<xsl:call-template name="attclasses" />
+						<xsl:call-template name="attributeList" />
+						<xsl:text>'&gt; </xsl:text>
+						<xsl:for-each select="tei:attList/tei:attDef">
+							<xsl:text>&#10;&lt;!ENTITY % </xsl:text>
+							<xsl:value-of select="$thisclass" />
+							<xsl:text>.attribute.</xsl:text>
+							<xsl:value-of select="translate(@ident,':','')" />
+							<xsl:text> '</xsl:text>
+							<xsl:apply-templates mode="tangle" select="." />
+							<xsl:text>'&gt;&#10;</xsl:text>
+						</xsl:for-each>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:classSpec" mode="tagatts">
+		<xsl:if test="@type='atts'">
+			<xsl:if test="$verbose='true'">
+				<xsl:message>
+					.... added contents of [%
+					<xsl:value-of select="@ident" />
+					.attributes;]
+				</xsl:message>
+			</xsl:if>
+			<xsl:text>&#10; %</xsl:text>
+			<xsl:value-of select="@ident" />
+			<xsl:text>.attributes;</xsl:text>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="tei:moduleRef[@key]" mode="tangle">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				moduleRef to
+				<xsl:value-of select="@key" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:text>&#10;&lt;!ENTITY %</xsl:text>
+		<xsl:text> file.</xsl:text>
+		<xsl:value-of select="@key" />
+		<xsl:text> </xsl:text>
+		<xsl:text>PUBLIC</xsl:text>
+		<xsl:text> '-//TEI P5//</xsl:text>
+		<xsl:value-of
+			select="key('FILES',@key)/tei:altIdent[@type='FPI']" />
+		<xsl:text>//EN' '</xsl:text>
+		<xsl:value-of select="@key" />
+		<xsl:text>.dtd'</xsl:text>
+		<xsl:text> &gt;&#10;</xsl:text>
+		<xsl:text>%file.</xsl:text>
+		<xsl:value-of select="@key" />
+		<xsl:text>;&#10;</xsl:text>
+	</xsl:template>
+	<xsl:template match="tei:classSpec" mode="tangle">
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				.. classSpec
+				<xsl:value-of select="@ident" />
+				,
+				<xsl:value-of select="@type" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@type='atts'">
+				<xsl:call-template name="classAtt" />
+			</xsl:when>
+			<xsl:when test="@type='model'">
+				<xsl:call-template name="classModel" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:classSpec" mode="process">
+		<xsl:choose>
+			<xsl:when test="@type='atts'">
+				<xsl:call-template name="classAtt" />
+			</xsl:when>
+			<xsl:when test="@type='model'">
+				<xsl:call-template name="classModel" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="classModel">
+		<xsl:param name="declare">
+			false
+		</xsl:param>
+		<xsl:call-template name="processClassDefinition">
+			<xsl:with-param name="type">
+				<xsl:choose>
+					<xsl:when test="@generate">
+						<xsl:value-of select="@generate" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>alternation
 	    sequence
 	    sequenceOptional
 	    sequenceOptionalRepeatable
 	    sequenceRepeatable</xsl:text>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:with-param>
-         <xsl:with-param name="declare" select="$declare"/>
-      </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="makeClassDefinition">
-      <xsl:param name="type">alternation</xsl:param>
-      <xsl:param name="declare"/>
-      <xsl:variable name="IDENT">
-         <xsl:value-of select="@ident"/>
-         <xsl:choose>
-            <xsl:when test="$type='alternation'"/>
-            <xsl:otherwise>
-               <xsl:text>_</xsl:text>
-               <xsl:value-of select="$type"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:if test="$verbose='true'">
-         <xsl:message> .... ... generate model <xsl:value-of select="$type"/> for <xsl:value-of select="@ident"/>
-			      </xsl:message>
-      </xsl:if>
-      <xsl:if test="$parameterize='true'">
-         <xsl:text>&#10;&lt;!ENTITY % x.</xsl:text>
-         <xsl:value-of select="$IDENT"/>
-         <xsl:text> "" &gt;</xsl:text>
-      </xsl:if>
-      <xsl:text>&#10;&lt;!ENTITY % </xsl:text>
-      <xsl:value-of select="$IDENT"/>
-      <xsl:text> "</xsl:text>
-      <xsl:if test="$parameterize='true'">
-         <xsl:text>%x.</xsl:text>
-         <xsl:value-of select="$IDENT"/>
-         <xsl:text>; </xsl:text>
-      </xsl:if>
-      <xsl:variable name="generate" select="@generate"/>
-      <xsl:variable name="members">
-         <M>
-            <xsl:for-each select="key('CLASSMEMBERS',@ident)">
-               <xsl:variable name="N">
-                  <xsl:choose>
-                     <xsl:when test="$parameterize='false'">
-                        <xsl:choose>
-                           <xsl:when test="key('CLASSES',@ident)">
-                              <xsl:variable name="exists">
-                                 <xsl:call-template name="checkClass">
-                                    <xsl:with-param name="id" select="@ident"/>
-                                 </xsl:call-template>
-                              </xsl:variable>
-                              <xsl:if test="not($exists='')">
-                                 <xsl:text>%</xsl:text>
-                                 <xsl:value-of select="@ident"/>
-                                 <xsl:text>;</xsl:text>
-                              </xsl:if>
-                           </xsl:when>
-                           <xsl:when test="key('MACROS',@ident)">
-                              <xsl:text>%</xsl:text>
-                              <xsl:value-of select="@ident"/>
-                              <xsl:text>;</xsl:text>
-                           </xsl:when>
-                           <xsl:when test="key('ELEMENTS',@ident)">
-                              <xsl:choose>
-                                 <xsl:when test="tei:altIdent=@ident">
-                                    <xsl:value-of select="@ident"/>
-                                 </xsl:when>
-                                 <xsl:when test="tei:altIdent">
-                                    <xsl:value-of select="normalize-space(tei:altIdent)"/>
-                                 </xsl:when>
-                                 <xsl:otherwise>
-                                    <xsl:value-of select="@ident"/>
-                                 </xsl:otherwise>
-                              </xsl:choose>
-                           </xsl:when>
-                        </xsl:choose>
-                     </xsl:when>
-                     <xsl:when test="self::tei:elementSpec">
-                        <xsl:if test="$parameterize='true'">
-                           <xsl:text>%n.</xsl:text>
-                        </xsl:if>
-                        <xsl:value-of select="@ident"/>
-                        <xsl:if test="$parameterize='true'">
-                           <xsl:text>;</xsl:text>
-                        </xsl:if>
-                     </xsl:when>
-                     <xsl:when test="self::tei:classSpec">
-                        <xsl:text>%</xsl:text>
-                        <xsl:value-of select="@ident"/>
-                        <xsl:text>;</xsl:text>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@ident"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:variable>
-               <xsl:if test="not($N='')">
-                  <N>
-                     <xsl:if test="starts-with($N,'%tei.')">
-                        <xsl:attribute name="type">class</xsl:attribute>
-                     </xsl:if>
-                     <xsl:if test="starts-with($N,'%model.')">
-                        <xsl:attribute name="type">class</xsl:attribute>
-                     </xsl:if>
-                     <xsl:value-of select="$N"/>
-                  </N>
-               </xsl:if>
-            </xsl:for-each>
-         </M>
-      </xsl:variable>
-      <xsl:for-each select="$members/M">
-         <xsl:call-template name="memberOfClassDefinition">
-            <xsl:with-param name="type" select="$type"/>
-         </xsl:call-template>
-      </xsl:for-each>
-      <xsl:text>"&gt; </xsl:text>
-  </xsl:template>
-  <xsl:template name="memberOfClassDefinition">
-      <xsl:param name="type"/>
-      <!-- does a class model need bracketing if all its members are also classes?
-	 <xsl:if test="count(N[@type='class'])=count(N) and count(N) &gt; 2">
-	 <xsl:text>(</xsl:text>
-	 </xsl:if>
-    -->
-    <xsl:for-each select="N">
-         <xsl:value-of select="."/>
-         <xsl:choose>
-            <xsl:when test="$type='sequence'">
-               <xsl:if test="position() &lt; last()">, </xsl:if>
-            </xsl:when>
-            <xsl:when test="$type='sequenceOptional'">
-               <xsl:text>?</xsl:text>
-               <xsl:if test="position() &lt; last()">, </xsl:if>
-            </xsl:when>
-            <xsl:when test="$type='sequenceRepeatable'">
-               <xsl:text>+</xsl:text>
-               <xsl:if test="position() &lt; last()">, </xsl:if>
-            </xsl:when>
-            <xsl:when test="$type='sequenceOptionalRepeatable'">
-               <xsl:text>*</xsl:text>
-               <xsl:if test="position() &lt; last()">, </xsl:if>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:if test="position() &lt; last()"> |
- </xsl:if>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:for-each>
-      <!-- see above
-	 <xsl:if test="count(N[@type='class'])=count(N) and count(N) &gt; 2">
-	 <xsl:text>)</xsl:text>
-	 </xsl:if>
-    -->
-  </xsl:template>
-  <xsl:template match="tei:commDecl" mode="tangle">
-      <xsl:text>&#10;  &lt;!--</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>--&gt;</xsl:text>
-  </xsl:template>
-  <xsl:template name="attributeList">
-      <xsl:apply-templates mode="tangle" select="tei:attList/tei:*"/>
-  </xsl:template>
-  <xsl:template match="tei:attDef" mode="tangle">
-      <xsl:text>&#10;</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@ns='http://www.w3.org/XML/1998/namespace'">
-            <xsl:text>xml:</xsl:text>
-         </xsl:when>
-         <xsl:when test="@ns='http://www.w3.org/1999/xlink'">
-            <xsl:text>xlink:</xsl:text>
-         </xsl:when>
-         <xsl:when test="$parameterize='true' and (@ns) and not($nsPrefix='') and not(starts-with(@ident,'xmlns'))">
-            <xsl:text>%NS;</xsl:text>
-         </xsl:when>
-      </xsl:choose>
-      <xsl:choose>
-         <xsl:when test="tei:altIdent=@ident">
-            <xsl:value-of select="@ident"/>
-         </xsl:when>
-         <xsl:when test="tei:altIdent">
-            <xsl:value-of select="normalize-space(tei:altIdent)"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="@ident"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:choose>
-         <xsl:when test="(number(tei:datatype/@maxOccurs) &gt; 1 or tei:datatype/@maxOccurs='unbounded') and tei:datatype/rng:ref[@name='data.enumerated']">
-            <xsl:text> NMTOKENS </xsl:text>
-         </xsl:when>
-         <xsl:when test="(number(tei:datatype/@maxOccurs) &gt; 1 or  tei:datatype/@maxOccurs='unbounded') and tei:datatype/rng:ref[@name='data.name']">
-            <xsl:text> NMTOKENS </xsl:text>
-         </xsl:when>
-         <xsl:when test="(number(tei:datatype/@maxOccurs) &gt; 1 or  tei:datatype/@maxOccurs='unbounded') and tei:datatype/rng:data[@type='Name']">
-            <xsl:text> NMTOKENS </xsl:text>
-         </xsl:when>
-         <xsl:when test="tei:valList[@type='closed']">
-            <xsl:text> (</xsl:text>
-            <xsl:for-each select="tei:valList/tei:valItem">
-               <xsl:value-of select="@ident"/>
-               <xsl:if test="following-sibling::tei:valItem">
-		 <xsl:text>|</xsl:text>
-	       </xsl:if>
-            </xsl:for-each>
-            <xsl:text>)</xsl:text>
-         </xsl:when>
-         <xsl:when test="tei:datatype/rng:data[@type='Name']">
-            <xsl:text> NMTOKEN </xsl:text>
-         </xsl:when>
-         <xsl:when test="tei:datatype/@minOccurs or tei:datatype/@maxOccurs">
-            <xsl:text> CDATA </xsl:text>
-         </xsl:when>
-         <xsl:when test="tei:datatype/rng:*">
-            <xsl:apply-templates select="tei:datatype"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text> CDATA </xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:choose>
-         <xsl:when test="string-length(tei:defaultVal) &gt;0">
-            <xsl:text> "</xsl:text>
-            <xsl:value-of select="tei:defaultVal"/>
-            <xsl:text>" </xsl:text>
-         </xsl:when>
-         <xsl:when test="parent::tei:attList[@org='choice']">
-            <xsl:text> #IMPLIED</xsl:text>
-         </xsl:when>
-         <xsl:when test="@usage='req'">
-            <xsl:text> #REQUIRED</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text> #IMPLIED</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="bitOut">
-      <xsl:param name="grammar"/>
-      <xsl:param name="element"/>
-      <xsl:param name="content"/>
-      <xsl:copy-of select="$content"/>
-  </xsl:template>
-  <xsl:template name="CR">
-      <xsl:text>&#10;</xsl:text>
-  </xsl:template>
-  <xsl:template match="tei:memberOf" mode="tangleAtts">
-      <xsl:variable name="ident">
-         <xsl:value-of select="ancestor::tei:elementSpec/@ident|ancestor::tei:classSpec/@ident"/>
-      </xsl:variable>
-      <xsl:variable name="K" select="@key"/>
-      <xsl:choose>
-         <xsl:when test="key('IDENTS',$K)">
-            <xsl:for-each select="key('IDENTS',@key)[1]">
-               <xsl:apply-templates mode="tagatts" select="."/>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:otherwise>
-	   <xsl:for-each select="document($localsource)/tei:TEI">
-	     <xsl:apply-templates mode="tagatts" select="key('LOCALIDENTS',$K)"/>
-	   </xsl:for-each>
-	 </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:attRef" mode="tangle">
-      <xsl:text>&#10; %</xsl:text>
-      <xsl:value-of select="@name"/>
-      <xsl:text>;</xsl:text>
-  </xsl:template>
-  <xsl:template name="checkClass">
-      <xsl:param name="id"/>
-      <!-- should a class be included?
-	 * it must exist in the ODD spec
-	 * it must have other classes which point to it
-	 * whatever it points to must have members which are in the ODD
-    -->
-    <xsl:for-each select="key('CLASSMEMBERS',$id)">
-         <xsl:choose>
-            <xsl:when test="self::tei:elementSpec and key('ELEMENTS',@ident)">
-               <xsl:text>true</xsl:text>
-            </xsl:when>
-            <xsl:when test="self::tei:macroSpec and key('MACROS',@ident)">
-               <xsl:text>true</xsl:text>
-            </xsl:when>
-            <xsl:when test="self::tei:classSpec and key('CLASSES',@ident)">
-               <xsl:call-template name="checkClass">
-                  <xsl:with-param name="id" select="@ident"/>
-               </xsl:call-template>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="dtdComment">
-      <xsl:param name="text"/>
-      <xsl:text>&#10;&lt;!--&#10;</xsl:text>
-      <xsl:value-of select="$text"/>
-      <xsl:text>&#10;--&gt;&#10;</xsl:text>
-  </xsl:template>
-  <xsl:template name="checkEnd">
-      <xsl:if test="count(parent::tei:content[parent::tei:elementSpec]/rng:*)&gt;1 and     not(following-sibling::rng:*)">
-         <xsl:text>)</xsl:text>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="checkStart">
-      <xsl:if test="count(parent::tei:content[parent::tei:elementSpec]/rng:*)&gt;1">
-         <xsl:choose>
-            <xsl:when test="preceding-sibling::rng:*">
-               <xsl:text>,</xsl:text>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:text>(</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-  </xsl:template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:with-param>
+			<xsl:with-param name="declare" select="$declare" />
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="makeClassDefinition">
+		<xsl:param name="type">
+			alternation
+		</xsl:param>
+		<xsl:param name="declare" />
+		<xsl:variable name="IDENT">
+			<xsl:value-of select="@ident" />
+			<xsl:choose>
+				<xsl:when test="$type='alternation'" />
+				<xsl:otherwise>
+					<xsl:text>_</xsl:text>
+					<xsl:value-of select="$type" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				.... ... generate model
+				<xsl:value-of select="$type" />
+				for
+				<xsl:value-of select="@ident" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:if test="$parameterize='true'">
+			<xsl:text>&#10;&lt;!ENTITY % x.</xsl:text>
+			<xsl:value-of select="$IDENT" />
+			<xsl:text> "" &gt;</xsl:text>
+		</xsl:if>
+		<xsl:text>&#10;&lt;!ENTITY % </xsl:text>
+		<xsl:value-of select="$IDENT" />
+		<xsl:text> "</xsl:text>
+		<xsl:if test="$parameterize='true'">
+			<xsl:text>%x.</xsl:text>
+			<xsl:value-of select="$IDENT" />
+			<xsl:text>; </xsl:text>
+		</xsl:if>
+		<xsl:variable name="generate" select="@generate" />
+		<xsl:variable name="members">
+			<M>
+				<xsl:for-each select="key('CLASSMEMBERS',@ident)">
+					<xsl:variable name="N">
+						<xsl:choose>
+							<xsl:when test="$parameterize='false'">
+								<xsl:choose>
+									<xsl:when test="key('CLASSES',@ident)">
+										<xsl:variable name="exists">
+											<xsl:call-template name="checkClass">
+												<xsl:with-param name="id" select="@ident" />
+											</xsl:call-template>
+										</xsl:variable>
+										<xsl:if test="not($exists='')">
+											<xsl:text>%</xsl:text>
+											<xsl:value-of select="@ident" />
+											<xsl:text>;</xsl:text>
+										</xsl:if>
+									</xsl:when>
+									<xsl:when test="key('MACROS',@ident)">
+										<xsl:text>%</xsl:text>
+										<xsl:value-of select="@ident" />
+										<xsl:text>;</xsl:text>
+									</xsl:when>
+									<xsl:when test="key('ELEMENTS',@ident)">
+										<xsl:choose>
+											<xsl:when test="tei:altIdent=@ident">
+												<xsl:value-of select="@ident" />
+											</xsl:when>
+											<xsl:when test="tei:altIdent">
+												<xsl:value-of
+													select="normalize-space(tei:altIdent)" />
+											</xsl:when>
+											<xsl:otherwise>
+												<xsl:value-of select="@ident" />
+											</xsl:otherwise>
+										</xsl:choose>
+									</xsl:when>
+								</xsl:choose>
+							</xsl:when>
+							<xsl:when test="self::tei:elementSpec">
+								<xsl:if test="$parameterize='true'">
+									<xsl:text>%n.</xsl:text>
+								</xsl:if>
+								<xsl:value-of select="@ident" />
+								<xsl:if test="$parameterize='true'">
+									<xsl:text>;</xsl:text>
+								</xsl:if>
+							</xsl:when>
+							<xsl:when test="self::tei:classSpec">
+								<xsl:text>%</xsl:text>
+								<xsl:value-of select="@ident" />
+								<xsl:text>;</xsl:text>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@ident" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:if test="not($N='')">
+						<N>
+							<xsl:if test="starts-with($N,'%tei.')">
+								<xsl:attribute name="type">class</xsl:attribute>
+							</xsl:if>
+							<xsl:if test="starts-with($N,'%model.')">
+								<xsl:attribute name="type">class</xsl:attribute>
+							</xsl:if>
+							<xsl:value-of select="$N" />
+						</N>
+					</xsl:if>
+				</xsl:for-each>
+			</M>
+		</xsl:variable>
+		<xsl:for-each select="$members/M">
+			<xsl:call-template name="memberOfClassDefinition">
+				<xsl:with-param name="type" select="$type" />
+			</xsl:call-template>
+		</xsl:for-each>
+		<xsl:text>"&gt; </xsl:text>
+	</xsl:template>
+	<xsl:template name="memberOfClassDefinition">
+		<xsl:param name="type" />
+		<!-- does a class model need bracketing if all its members are also classes? 
+			<xsl:if test="count(N[@type='class'])=count(N) and count(N) &gt; 2"> <xsl:text>(</xsl:text> 
+			</xsl:if> -->
+		<xsl:for-each select="N">
+			<xsl:value-of select="." />
+			<xsl:choose>
+				<xsl:when test="$type='sequence'">
+					<xsl:if test="position() &lt; last()">
+						,
+					</xsl:if>
+				</xsl:when>
+				<xsl:when test="$type='sequenceOptional'">
+					<xsl:text>?</xsl:text>
+					<xsl:if test="position() &lt; last()">
+						,
+					</xsl:if>
+				</xsl:when>
+				<xsl:when test="$type='sequenceRepeatable'">
+					<xsl:text>+</xsl:text>
+					<xsl:if test="position() &lt; last()">
+						,
+					</xsl:if>
+				</xsl:when>
+				<xsl:when test="$type='sequenceOptionalRepeatable'">
+					<xsl:text>*</xsl:text>
+					<xsl:if test="position() &lt; last()">
+						,
+					</xsl:if>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:if test="position() &lt; last()">
+						|
+					</xsl:if>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+		<!-- see above <xsl:if test="count(N[@type='class'])=count(N) and count(N) 
+			&gt; 2"> <xsl:text>)</xsl:text> </xsl:if> -->
+	</xsl:template>
+	<xsl:template match="tei:commDecl" mode="tangle">
+		<xsl:text>&#10;  &lt;!--</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>--&gt;</xsl:text>
+	</xsl:template>
+	<xsl:template name="attributeList">
+		<xsl:apply-templates mode="tangle"
+			select="tei:attList/tei:*" />
+	</xsl:template>
+	<xsl:template match="tei:attDef" mode="tangle">
+		<xsl:text>&#10;</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@ns='http://www.w3.org/XML/1998/namespace'">
+				<xsl:text>xml:</xsl:text>
+			</xsl:when>
+			<xsl:when test="@ns='http://www.w3.org/1999/xlink'">
+				<xsl:text>xlink:</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="$parameterize='true' and (@ns) and not($nsPrefix='') and not(starts-with(@ident,'xmlns'))">
+				<xsl:text>%NS;</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="tei:altIdent=@ident">
+				<xsl:value-of select="@ident" />
+			</xsl:when>
+			<xsl:when test="tei:altIdent">
+				<xsl:value-of select="normalize-space(tei:altIdent)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="@ident" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when
+				test="(number(tei:datatype/@maxOccurs) &gt; 1 or tei:datatype/@maxOccurs='unbounded') and tei:datatype/rng:ref[@name='data.enumerated']">
+				<xsl:text> NMTOKENS </xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="(number(tei:datatype/@maxOccurs) &gt; 1 or  tei:datatype/@maxOccurs='unbounded') and tei:datatype/rng:ref[@name='data.name']">
+				<xsl:text> NMTOKENS </xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="(number(tei:datatype/@maxOccurs) &gt; 1 or  tei:datatype/@maxOccurs='unbounded') and tei:datatype/rng:data[@type='Name']">
+				<xsl:text> NMTOKENS </xsl:text>
+			</xsl:when>
+			<xsl:when test="tei:valList[@type='closed']">
+				<xsl:text> (</xsl:text>
+				<xsl:for-each select="tei:valList/tei:valItem">
+					<xsl:value-of select="@ident" />
+					<xsl:if test="following-sibling::tei:valItem">
+						<xsl:text>|</xsl:text>
+					</xsl:if>
+				</xsl:for-each>
+				<xsl:text>)</xsl:text>
+			</xsl:when>
+			<xsl:when test="tei:datatype/rng:data[@type='Name']">
+				<xsl:text> NMTOKEN </xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="tei:datatype/@minOccurs or tei:datatype/@maxOccurs">
+				<xsl:text> CDATA </xsl:text>
+			</xsl:when>
+			<xsl:when test="tei:datatype/rng:*">
+				<xsl:apply-templates select="tei:datatype" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text> CDATA </xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="string-length(tei:defaultVal) &gt;0">
+				<xsl:text> "</xsl:text>
+				<xsl:value-of select="tei:defaultVal" />
+				<xsl:text>" </xsl:text>
+			</xsl:when>
+			<xsl:when test="parent::tei:attList[@org='choice']">
+				<xsl:text> #IMPLIED</xsl:text>
+			</xsl:when>
+			<xsl:when test="@usage='req'">
+				<xsl:text> #REQUIRED</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text> #IMPLIED</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="bitOut">
+		<xsl:param name="grammar" />
+		<xsl:param name="element" />
+		<xsl:param name="content" />
+		<xsl:copy-of select="$content" />
+	</xsl:template>
+	<xsl:template name="CR">
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
+	<xsl:template match="tei:memberOf" mode="tangleAtts">
+		<xsl:variable name="ident">
+			<xsl:value-of
+				select="ancestor::tei:elementSpec/@ident|ancestor::tei:classSpec/@ident" />
+		</xsl:variable>
+		<xsl:variable name="K" select="@key" />
+		<xsl:choose>
+			<xsl:when test="key('IDENTS',$K)">
+				<xsl:for-each select="key('IDENTS',@key)[1]">
+					<xsl:apply-templates mode="tagatts" select="." />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="document($localsource)/tei:TEI">
+					<xsl:apply-templates mode="tagatts"
+						select="key('LOCALIDENTS',$K)" />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:attRef" mode="tangle">
+		<xsl:text>&#10; %</xsl:text>
+		<xsl:value-of select="@name" />
+		<xsl:text>;</xsl:text>
+	</xsl:template>
+	<xsl:template name="checkClass">
+		<xsl:param name="id" />
+		<!-- should a class be included? * it must exist in the ODD spec * it must 
+			have other classes which point to it * whatever it points to must have members 
+			which are in the ODD -->
+		<xsl:for-each select="key('CLASSMEMBERS',$id)">
+			<xsl:choose>
+				<xsl:when
+					test="self::tei:elementSpec and key('ELEMENTS',@ident)">
+					<xsl:text>true</xsl:text>
+				</xsl:when>
+				<xsl:when
+					test="self::tei:macroSpec and key('MACROS',@ident)">
+					<xsl:text>true</xsl:text>
+				</xsl:when>
+				<xsl:when
+					test="self::tei:classSpec and key('CLASSES',@ident)">
+					<xsl:call-template name="checkClass">
+						<xsl:with-param name="id" select="@ident" />
+					</xsl:call-template>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="dtdComment">
+		<xsl:param name="text" />
+		<xsl:text>&#10;&lt;!--&#10;</xsl:text>
+		<xsl:value-of select="$text" />
+		<xsl:text>&#10;--&gt;&#10;</xsl:text>
+	</xsl:template>
+	<xsl:template name="checkEnd">
+		<xsl:if
+			test="count(parent::tei:content[parent::tei:elementSpec]/rng:*)&gt;1 and     not(following-sibling::rng:*)">
+			<xsl:text>)</xsl:text>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="checkStart">
+		<xsl:if
+			test="count(parent::tei:content[parent::tei:elementSpec]/rng:*)&gt;1">
+			<xsl:choose>
+				<xsl:when test="preceding-sibling::rng:*">
+					<xsl:text>,</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>(</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
 
-  <xsl:template name="copyright">
-    <xsl:for-each
-	select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability">
-      <xsl:if test="count(tei:licence)&gt;1">
-	<xsl:text>This material is dual-licensed.&#10;</xsl:text>
-      </xsl:if>
-      <xsl:apply-templates/>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="copyright">
+		<xsl:for-each
+			select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability">
+			<xsl:if test="count(tei:licence)&gt;1">
+				<xsl:text>This material is dual-licensed.&#10;</xsl:text>
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template match="tei:licence">
-    <xsl:if test="@target">
-      <xsl:text>[</xsl:text>
-      <xsl:value-of select="@target"/>
-      <xsl:text>] </xsl:text>
-    </xsl:if>
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:licence">
+		<xsl:if test="@target">
+			<xsl:text>[</xsl:text>
+			<xsl:value-of select="@target" />
+			<xsl:text>] </xsl:text>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template name="typewriter">
-    <xsl:param name="text"/>
-  </xsl:template>
+	<xsl:template name="typewriter">
+		<xsl:param name="text" />
+	</xsl:template>
 
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2relax.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2relax.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odds2/odd2relax.xsl	(revision 2397)
@@ -1,583 +1,675 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-    xmlns:fo="http://www.w3.org/1999/XSL/Format" 
-    xmlns:html="http://www.w3.org/1999/xhtml" 
-    xmlns:i="http://www.iso.org/ns/1.0"
-    xmlns:rng="http://relaxng.org/ns/structure/1.0"
-    xmlns:s="http://www.ascc.net/xml/schematron" 
-    xmlns:sch="http://purl.oclc.org/dsdl/schematron" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:teix="http://www.tei-c.org/ns/Examples" 
-    xmlns:xi="http://www.w3.org/2001/XInclude"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl" 
-    version="2.0">
-  <xsl:import href="teiodds.xsl"/>
-  <xsl:import href="../common2/i18n.xsl"/>
-  <xsl:import href="../common2/tei-param.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Relax NG schema from ODD </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:i="http://www.iso.org/ns/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl"
+	version="2.0">
+	<xsl:import href="teiodds.xsl" />
+	<xsl:import href="../common2/i18n.xsl" />
+	<xsl:import href="../common2/tei-param.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Relax NG schema from ODD </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: odd2relax.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:output encoding="utf-8" indent="yes" method="xml"/>
-  <xsl:key name="PATTERNS" match="rng:define[rng:element/@name]" use="'true'"/>
-  <xsl:key name="REFED" match="rng:ref" use="@name"/>
-  <xsl:key name="DEFED" match="rng:define" use="@name"/>
-  <xsl:key name="EDEF" match="rng:define[rng:element]" use="1"/>
-  <xsl:param name="verbose"/>
-  <xsl:param name="outputDir"/>
-  <xsl:param name="appendixWords"/>
-  <xsl:template name="makeAnchor">
-      <xsl:param name="name"/>
-  </xsl:template>
-  <xsl:param name="splitLevel">-1</xsl:param>
-  <xsl:variable name="oddmode">dtd</xsl:variable>
-  <xsl:variable name="filesuffix"/>
-   <!-- get list of output files -->
-  <xsl:variable name="linkColor"/>
-  <xsl:template match="tei:moduleSpec[@type='decls']"/>
-  <xsl:template match="/">
-      <xsl:choose>
-         <xsl:when test="key('SCHEMASPECS',1)">
-            <xsl:apply-templates select="key('LISTSCHEMASPECS',$whichSchemaSpec)"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates select="key('Modules',1)"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template match="tei:schemaSpec">
-      <xsl:variable name="documentationLanguage">
-         <xsl:call-template name="generateDoc"/>
-      </xsl:variable>
-      <xsl:if test="$verbose='true'">
-         <xsl:message> 
-	           <xsl:text>I18N setup: Pattern prefix: </xsl:text>
-	           <xsl:value-of select="$generalPrefix"/> 
-	           <xsl:text>. Target  language: </xsl:text>
-	           <xsl:value-of select="$targetLanguage"/>
-	           <xsl:text>. Documentation language: </xsl:text>
-	           <xsl:value-of select="$documentationLanguage"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:variable name="filename" select="@ident"/>
-      <xsl:if test="$verbose='true'">
-         <xsl:message> process schemaSpec [<xsl:value-of select="@ident"/>] </xsl:message>
-      </xsl:if>
-      <xsl:call-template name="generateOutput">
-         <xsl:with-param name="method">xml</xsl:with-param>
-         <xsl:with-param name="suffix">.rng</xsl:with-param>
-         <xsl:with-param name="body">
-            <grammar xmlns="http://relaxng.org/ns/structure/1.0"
-		     xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-		     xmlns:xlink="http://www.w3.org/1999/xlink"
-                     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-               <xsl:attribute name="ns">
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: odd2relax.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output encoding="utf-8" indent="yes" method="xml" />
+	<xsl:key name="PATTERNS" match="rng:define[rng:element/@name]"
+		use="'true'" />
+	<xsl:key name="REFED" match="rng:ref" use="@name" />
+	<xsl:key name="DEFED" match="rng:define" use="@name" />
+	<xsl:key name="EDEF" match="rng:define[rng:element]" use="1" />
+	<xsl:param name="verbose" />
+	<xsl:param name="outputDir" />
+	<xsl:param name="appendixWords" />
+	<xsl:template name="makeAnchor">
+		<xsl:param name="name" />
+	</xsl:template>
+	<xsl:param name="splitLevel">
+		-1
+	</xsl:param>
+	<xsl:variable name="oddmode">
+		dtd
+	</xsl:variable>
+	<xsl:variable name="filesuffix" />
+	<!-- get list of output files -->
+	<xsl:variable name="linkColor" />
+	<xsl:template match="tei:moduleSpec[@type='decls']" />
+	<xsl:template match="/">
+		<xsl:choose>
+			<xsl:when test="key('SCHEMASPECS',1)">
+				<xsl:apply-templates
+					select="key('LISTSCHEMASPECS',$whichSchemaSpec)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="key('Modules',1)" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="tei:schemaSpec">
+		<xsl:variable name="documentationLanguage">
+			<xsl:call-template name="generateDoc" />
+		</xsl:variable>
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				<xsl:text>I18N setup: Pattern prefix: </xsl:text>
+				<xsl:value-of select="$generalPrefix" />
+				<xsl:text>. Target  language: </xsl:text>
+				<xsl:value-of select="$targetLanguage" />
+				<xsl:text>. Documentation language: </xsl:text>
+				<xsl:value-of select="$documentationLanguage" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:variable name="filename" select="@ident" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				process schemaSpec [
+				<xsl:value-of select="@ident" />
+				]
+			</xsl:message>
+		</xsl:if>
+		<xsl:call-template name="generateOutput">
+			<xsl:with-param name="method">
+				xml
+			</xsl:with-param>
+			<xsl:with-param name="suffix">
+				.rng
+			</xsl:with-param>
+			<xsl:with-param name="body">
+				<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+					xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+					xmlns:xlink="http://www.w3.org/1999/xlink"
+					datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+					<xsl:attribute name="ns">
                   <xsl:choose>
                      <xsl:when test="@ns">
-                        <xsl:value-of select="@ns"/>
+                        <xsl:value-of select="@ns" />
                      </xsl:when>
                      <xsl:otherwise>
                         <xsl:text>http://www.tei-c.org/ns/1.0</xsl:text>
 		     </xsl:otherwise>
                   </xsl:choose>
                </xsl:attribute>
-               <xsl:comment>
-                  <xsl:text>&#10;Schema generated from ODD source </xsl:text>
-                  <xsl:call-template name="showDate"/>
-                  <xsl:text>. </xsl:text>
-                  <xsl:call-template name="makeTEIVersion"/>
-                  <xsl:call-template name="makeDescription"/>
-                  <xsl:text>&#10;</xsl:text>
-               </xsl:comment>
-	       <xsl:comment>
-		 <xsl:call-template name="copyright"/>
-	       </xsl:comment>
-               <xsl:choose>
-                  <xsl:when test="tei:specGrpRef">
-                     <xsl:variable name="SPECS">
-                        <tei:schemaSpec>
-                           <xsl:copy-of select="@*"/>
-                           <xsl:apply-templates mode="expandSpecs"/>
-                        </tei:schemaSpec>
-                     </xsl:variable>
-                     <xsl:for-each select="$SPECS/tei:schemaSpec">
-                        <xsl:call-template name="schemaSpecBody"/>
-                     </xsl:for-each>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:call-template name="schemaSpecBody"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-	              <xsl:apply-templates select="tei:constraintSpec"/>
-            </grammar>
-         </xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
+					<xsl:comment>
+						<xsl:text>&#10;Schema generated from ODD source </xsl:text>
+						<xsl:call-template name="showDate" />
+						<xsl:text>. </xsl:text>
+						<xsl:call-template name="makeTEIVersion" />
+						<xsl:call-template name="makeDescription" />
+						<xsl:text>&#10;</xsl:text>
+					</xsl:comment>
+					<xsl:comment>
+						<xsl:call-template name="copyright" />
+					</xsl:comment>
+					<xsl:choose>
+						<xsl:when test="tei:specGrpRef">
+							<xsl:variable name="SPECS">
+								<tei:schemaSpec>
+									<xsl:copy-of select="@*" />
+									<xsl:apply-templates mode="expandSpecs" />
+								</tei:schemaSpec>
+							</xsl:variable>
+							<xsl:for-each select="$SPECS/tei:schemaSpec">
+								<xsl:call-template name="schemaSpecBody" />
+							</xsl:for-each>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template name="schemaSpecBody" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:apply-templates
+						select="tei:constraintSpec" />
+				</grammar>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-  <xsl:template name="schemaSpecBody">
-      <xsl:variable name="pass1">
-         <root>
-	   <xsl:if test="$verbose='true'">
-	     <xsl:message>start importing moduleRef components</xsl:message>
-	   </xsl:if>
-	   <xsl:apply-templates mode="tangle" select="tei:moduleRef"/>
-	   <xsl:for-each select="tei:macroSpec">
-	     <xsl:apply-templates mode="tangle" select="."/>
-	   </xsl:for-each>
-	   <xsl:apply-templates mode="tangle" select="tei:elementSpec|tei:classSpec"/>
-	   <xsl:choose>
-	     <xsl:when test="@start and @start=''"/>
-	     <xsl:when test="@start and contains(@start,' ')">
-	       <start xmlns="http://relaxng.org/ns/structure/1.0">
-		 <choice>
-		   <xsl:call-template name="startNames">
-		     <xsl:with-param name="toks" select="@start"/>
-		   </xsl:call-template>
-		 </choice>
-	       </start>
-	     </xsl:when>
-	     <xsl:when test="@start">
-	       <start xmlns="http://relaxng.org/ns/structure/1.0">
-		 <ref name="{$generalPrefix}{@start}"/>
-	       </start>
-	     </xsl:when>
-	     <xsl:when test="key('IDENTS','teiCorpus')">
-	       <start xmlns="http://relaxng.org/ns/structure/1.0">
-		 <choice>
-		   <ref name="{$generalPrefix}TEI"/>
-		   <ref name="{$generalPrefix}teiCorpus"/>
-		 </choice>
-	       </start>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <start xmlns="http://relaxng.org/ns/structure/1.0">
-		 <ref name="{$generalPrefix}TEI"/>
-	       </start>
-	     </xsl:otherwise>
-	   </xsl:choose>
-         </root>
-      </xsl:variable>
+	<xsl:template name="schemaSpecBody">
+		<xsl:variable name="pass1">
+			<root>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						start importing moduleRef components
+					</xsl:message>
+				</xsl:if>
+				<xsl:apply-templates mode="tangle"
+					select="tei:moduleRef" />
+				<xsl:for-each select="tei:macroSpec">
+					<xsl:apply-templates mode="tangle" select="." />
+				</xsl:for-each>
+				<xsl:apply-templates mode="tangle"
+					select="tei:elementSpec|tei:classSpec" />
+				<xsl:choose>
+					<xsl:when test="@start and @start=''" />
+					<xsl:when test="@start and contains(@start,' ')">
+						<start xmlns="http://relaxng.org/ns/structure/1.0">
+							<choice>
+								<xsl:call-template name="startNames">
+									<xsl:with-param name="toks" select="@start" />
+								</xsl:call-template>
+							</choice>
+						</start>
+					</xsl:when>
+					<xsl:when test="@start">
+						<start xmlns="http://relaxng.org/ns/structure/1.0">
+							<ref name="{$generalPrefix}{@start}" />
+						</start>
+					</xsl:when>
+					<xsl:when test="key('IDENTS','teiCorpus')">
+						<start xmlns="http://relaxng.org/ns/structure/1.0">
+							<choice>
+								<ref name="{$generalPrefix}TEI" />
+								<ref name="{$generalPrefix}teiCorpus" />
+							</choice>
+						</start>
+					</xsl:when>
+					<xsl:otherwise>
+						<start xmlns="http://relaxng.org/ns/structure/1.0">
+							<ref name="{$generalPrefix}TEI" />
+						</start>
+					</xsl:otherwise>
+				</xsl:choose>
+			</root>
+		</xsl:variable>
 
-      <!-- in 2nd and 3rd  passes, throw away any RNG <define> elements
-    which do not have a <ref>, any <ref> which has no <define>
-    to point to, and any empty <choice> -->
-      <xsl:variable name="pass2">
-	<xsl:for-each select="$pass1/root">
-	  <root>
-	    <xsl:apply-templates mode="pass2"/>
-	  </root>
-	</xsl:for-each>
-      </xsl:variable>
-      <xsl:for-each select="$pass2/root">
-	<xsl:apply-templates mode="pass3"/>
-      </xsl:for-each>
-  </xsl:template>
+		<!-- in 2nd and 3rd passes, throw away any RNG <define> elements which 
+			do not have a <ref>, any <ref> which has no <define> to point to, and any 
+			empty <choice> -->
+		<xsl:variable name="pass2">
+			<xsl:for-each select="$pass1/root">
+				<root>
+					<xsl:apply-templates mode="pass2" />
+				</root>
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:for-each select="$pass2/root">
+			<xsl:apply-templates mode="pass3" />
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="startNames">
-      <xsl:param name="toks"/>
-      <xsl:if test="not($toks='')">
-         <xsl:choose>
-            <xsl:when test="contains($toks,' ')">
-               <ref xmlns="http://relaxng.org/ns/structure/1.0"
-                    name="{$generalPrefix}{substring-before($toks, ' ')}"/>
-               <xsl:call-template name="startNames">
-                  <xsl:with-param name="toks" select="substring-after($toks, ' ')"/>
-               </xsl:call-template>
-            </xsl:when>
-            <xsl:otherwise>
-               <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{$generalPrefix}{$toks}"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:moduleSpec">
-      <xsl:if test="@ident and not(@mode='change' or @mode='replace' or   @mode='delete')">
-         <xsl:choose>
-            <xsl:when test="parent::tei:schemaSpec">
-               <xsl:call-template name="moduleSpec-body"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:call-template name="generateOutput">
-                  <xsl:with-param name="method">xml</xsl:with-param>
-                  <xsl:with-param name="suffix">.rng</xsl:with-param>
-                  <xsl:with-param name="body">
-                     <grammar xmlns="http://relaxng.org/ns/structure/1.0"
-                              datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-                        <xsl:comment>
-                           <xsl:text>Schema generated </xsl:text>
-                           <xsl:call-template name="showDate"/>
-                           <xsl:call-template name="makeTEIVersion"/>
-			   <xsl:call-template name="copyright"/>
-                           <xsl:call-template name="makeDescription"/>
-                        </xsl:comment>
-                        <xsl:call-template name="moduleSpec-body"/>
-                     </grammar>
-                  </xsl:with-param>
-               </xsl:call-template>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="moduleSpec-body">
-      <xsl:variable name="filename" select="@ident"/>
-      <xsl:comment>Definitions from module <xsl:value-of select="@ident"/>
-      </xsl:comment>
-      <xsl:comment>Set global predeclared macros</xsl:comment>
-      <xsl:if test="@type='core'">
-         <xsl:call-template name="NameList"/>
-         <xsl:for-each select="key('PredeclareAllMacros',1)">
-            <define xmlns="http://relaxng.org/ns/structure/1.0" name="{@ident}">
-               <choice>
-                  <notAllowed/>
-               </choice>
-            </define>
-         </xsl:for-each>
-      </xsl:if>
-      <xsl:comment>Set predeclared macros</xsl:comment>
-      <xsl:for-each select="key('PredeclareMacrosModule',@ident)">
-         <xsl:apply-templates mode="tangle" select="."/>
-      </xsl:for-each>
-      <xsl:if test="@type='core'">
-         <xsl:call-template name="predeclare-classes"/>
-      </xsl:if>
-      <xsl:comment>0. predeclared macros</xsl:comment>
-      <xsl:for-each select="key('PredeclareMacrosModule',@ident)">
-         <xsl:apply-templates mode="tangle" select="."/>
-      </xsl:for-each>
-      <xsl:comment>1. classes</xsl:comment>
-      <xsl:for-each select="key('ClassModule',@ident)">
-         <xsl:choose>
-            <xsl:when test="@module='core' and @predeclare='true'"> </xsl:when>
-            <xsl:otherwise>
-               <xsl:apply-templates mode="tangle" select="."/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:for-each>
-      <xsl:comment>2. elements</xsl:comment>
-      <xsl:apply-templates mode="tangle" select="key('ElementModule',@ident)">
-         <xsl:sort select="@ident"/>
-      </xsl:apply-templates>
-      <xsl:comment>3. macros</xsl:comment>
-      <xsl:for-each select="key('MacroModule',@ident)">
-         <xsl:choose>
-            <xsl:when test="@predeclare='true'"/>
-            <!--	<xsl:when test="key('PredeclareMacros',@ident)"/>-->
-        <xsl:otherwise>
-               <xsl:apply-templates mode="tangle" select="."/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="NameList">
-<!-- walk over all the elementSpec elements and make list of 
-       elements -->
-    <xsl:for-each select="key('ELEMENTDOCS',1)">
-         <xsl:sort select="@ident"/>
-         <define xmlns="http://relaxng.org/ns/structure/1.0" combine="choice" name="{@ident}">
-            <notAllowed/>
-         </define>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="predeclare-classes">
-      <xsl:comment>0. predeclared classes</xsl:comment>
-      <xsl:for-each select="key('predeclaredClasses',1)">
-         <xsl:choose>
-            <xsl:when test="@type='model'">
-               <xsl:apply-templates mode="processModel" select=".">
-                  <xsl:with-param name="declare">true</xsl:with-param>
-               </xsl:apply-templates>
-            </xsl:when>
-            <xsl:when test="@type='atts'">
-               <xsl:apply-templates mode="processDefaultAtts" select="."/>
-            </xsl:when>
-         </xsl:choose>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="tei:specGrpRef" mode="tangle">
-      <xsl:param name="filename"/>
-      <xsl:if test="$verbose='true'">
-         <xsl:message> specGrpRef to <xsl:value-of select="@target"/>
-         </xsl:message>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="starts-with(@target,'#')">
-            <xsl:for-each select="id(substring(@target,2))">
-               <xsl:apply-templates mode="ok" select=".">
-                  <xsl:with-param name="filename" select="$filename"/>
-               </xsl:apply-templates>
-            </xsl:for-each>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:for-each select="document(@target)/tei:specGrp">
-               <xsl:apply-templates mode="ok" select=".">
-                  <xsl:with-param name="filename" select="$filename"/>
-               </xsl:apply-templates>
-            </xsl:for-each>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="bitOut">
-      <xsl:param name="grammar"/>
-      <xsl:param name="element"/>
-      <xsl:param name="content"/>
-      <xsl:for-each select="$content/Wrapper">
-         <xsl:apply-templates mode="justcopy" select="*"/>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="refdoc"/>
-  <xsl:template name="typewriter">
-      <xsl:param name="text"/>
-  </xsl:template>
+	<xsl:template name="startNames">
+		<xsl:param name="toks" />
+		<xsl:if test="not($toks='')">
+			<xsl:choose>
+				<xsl:when test="contains($toks,' ')">
+					<ref xmlns="http://relaxng.org/ns/structure/1.0"
+						name="{$generalPrefix}{substring-before($toks, ' ')}" />
+					<xsl:call-template name="startNames">
+						<xsl:with-param name="toks"
+							select="substring-after($toks, ' ')" />
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:otherwise>
+					<ref xmlns="http://relaxng.org/ns/structure/1.0"
+						name="{$generalPrefix}{$toks}" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="tei:moduleSpec">
+		<xsl:if
+			test="@ident and not(@mode='change' or @mode='replace' or   @mode='delete')">
+			<xsl:choose>
+				<xsl:when test="parent::tei:schemaSpec">
+					<xsl:call-template name="moduleSpec-body" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="generateOutput">
+						<xsl:with-param name="method">
+							xml
+						</xsl:with-param>
+						<xsl:with-param name="suffix">
+							.rng
+						</xsl:with-param>
+						<xsl:with-param name="body">
+							<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+								datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+								<xsl:comment>
+									<xsl:text>Schema generated </xsl:text>
+									<xsl:call-template name="showDate" />
+									<xsl:call-template name="makeTEIVersion" />
+									<xsl:call-template name="copyright" />
+									<xsl:call-template name="makeDescription" />
+								</xsl:comment>
+								<xsl:call-template name="moduleSpec-body" />
+							</grammar>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="moduleSpec-body">
+		<xsl:variable name="filename" select="@ident" />
+		<xsl:comment>
+			Definitions from module
+			<xsl:value-of select="@ident" />
+		</xsl:comment>
+		<xsl:comment>
+			Set global predeclared macros
+		</xsl:comment>
+		<xsl:if test="@type='core'">
+			<xsl:call-template name="NameList" />
+			<xsl:for-each select="key('PredeclareAllMacros',1)">
+				<define xmlns="http://relaxng.org/ns/structure/1.0"
+					name="{@ident}">
+					<choice>
+						<notAllowed />
+					</choice>
+				</define>
+			</xsl:for-each>
+		</xsl:if>
+		<xsl:comment>
+			Set predeclared macros
+		</xsl:comment>
+		<xsl:for-each
+			select="key('PredeclareMacrosModule',@ident)">
+			<xsl:apply-templates mode="tangle" select="." />
+		</xsl:for-each>
+		<xsl:if test="@type='core'">
+			<xsl:call-template name="predeclare-classes" />
+		</xsl:if>
+		<xsl:comment>
+			0. predeclared macros
+		</xsl:comment>
+		<xsl:for-each
+			select="key('PredeclareMacrosModule',@ident)">
+			<xsl:apply-templates mode="tangle" select="." />
+		</xsl:for-each>
+		<xsl:comment>
+			1. classes
+		</xsl:comment>
+		<xsl:for-each select="key('ClassModule',@ident)">
+			<xsl:choose>
+				<xsl:when test="@module='core' and @predeclare='true'">
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="tangle" select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+		<xsl:comment>
+			2. elements
+		</xsl:comment>
+		<xsl:apply-templates mode="tangle"
+			select="key('ElementModule',@ident)">
+			<xsl:sort select="@ident" />
+		</xsl:apply-templates>
+		<xsl:comment>
+			3. macros
+		</xsl:comment>
+		<xsl:for-each select="key('MacroModule',@ident)">
+			<xsl:choose>
+				<xsl:when test="@predeclare='true'" />
+				<!-- <xsl:when test="key('PredeclareMacros',@ident)"/> -->
+				<xsl:otherwise>
+					<xsl:apply-templates mode="tangle" select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="NameList">
+		<!-- walk over all the elementSpec elements and make list of elements -->
+		<xsl:for-each select="key('ELEMENTDOCS',1)">
+			<xsl:sort select="@ident" />
+			<define xmlns="http://relaxng.org/ns/structure/1.0"
+				combine="choice" name="{@ident}">
+				<notAllowed />
+			</define>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="predeclare-classes">
+		<xsl:comment>
+			0. predeclared classes
+		</xsl:comment>
+		<xsl:for-each select="key('predeclaredClasses',1)">
+			<xsl:choose>
+				<xsl:when test="@type='model'">
+					<xsl:apply-templates mode="processModel"
+						select=".">
+						<xsl:with-param name="declare">
+							true
+						</xsl:with-param>
+					</xsl:apply-templates>
+				</xsl:when>
+				<xsl:when test="@type='atts'">
+					<xsl:apply-templates mode="processDefaultAtts"
+						select="." />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="tei:specGrpRef" mode="tangle">
+		<xsl:param name="filename" />
+		<xsl:if test="$verbose='true'">
+			<xsl:message>
+				specGrpRef to
+				<xsl:value-of select="@target" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="starts-with(@target,'#')">
+				<xsl:for-each select="id(substring(@target,2))">
+					<xsl:apply-templates mode="ok" select=".">
+						<xsl:with-param name="filename" select="$filename" />
+					</xsl:apply-templates>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="document(@target)/tei:specGrp">
+					<xsl:apply-templates mode="ok" select=".">
+						<xsl:with-param name="filename" select="$filename" />
+					</xsl:apply-templates>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="bitOut">
+		<xsl:param name="grammar" />
+		<xsl:param name="element" />
+		<xsl:param name="content" />
+		<xsl:for-each select="$content/Wrapper">
+			<xsl:apply-templates mode="justcopy" select="*" />
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="refdoc" />
+	<xsl:template name="typewriter">
+		<xsl:param name="text" />
+	</xsl:template>
 
-  <xsl:template match="processing-instruction()" mode="tangle">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="processing-instruction()"
+		mode="tangle">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="tei:constraintSpec[@scheme='schematron']">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template
+		match="tei:constraintSpec[@scheme='schematron']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="tei:constraintSpec[@scheme='isoschematron']">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template
+		match="tei:constraintSpec[@scheme='isoschematron']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="s:*">
-      <xsl:call-template name="processSchematron"/>
-  </xsl:template>
+	<xsl:template match="s:*">
+		<xsl:call-template name="processSchematron" />
+	</xsl:template>
 
-  <xsl:template match="sch:*">
-      <xsl:call-template name="processSchematron"/>
-  </xsl:template>
+	<xsl:template match="sch:*">
+		<xsl:call-template name="processSchematron" />
+	</xsl:template>
 
 
-<!-- pass 2, clean up unused elements -->
-  <xsl:template
-      match="rng:anyName[parent::rng:define]"
-      mode='pass2'>
-    <zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
-      <choice>
-	<xsl:for-each select="key('EDEF',1)">	  
-	  <ref name="{@name}"/>
-	</xsl:for-each>
-      </choice>
-    </zeroOrMore>
-  </xsl:template>
+	<!-- pass 2, clean up unused elements -->
+	<xsl:template match="rng:anyName[parent::rng:define]"
+		mode='pass2'>
+		<zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
+			<choice>
+				<xsl:for-each select="key('EDEF',1)">
+					<ref name="{@name}" />
+				</xsl:for-each>
+			</choice>
+		</zeroOrMore>
+	</xsl:template>
 
-  <xsl:template match="processing-instruction()" mode="pass2">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="processing-instruction()"
+		mode="pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="@*|text()|comment()" mode="pass2">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-    
-  <xsl:template match="*" mode="pass2">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-      </xsl:copy>
-  </xsl:template>
+	<xsl:template match="@*|text()|comment()" mode="pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="rng:define" mode="pass2">
-      <xsl:choose>
-         <xsl:when test="key('REFED',@name)">
-	   <define xmlns="http://relaxng.org/ns/structure/1.0" >
-	     <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-	   </define>
-	 </xsl:when>
-	 <xsl:otherwise>
-	   <xsl:if test="$verbose='true'">
-	     <xsl:message>ZAP definition of unused pattern <xsl:value-of select="@name"/></xsl:message>
-	   </xsl:if>
-	 </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="rng:ref" mode="pass2">
-      <xsl:choose>
-	<!--
-	<xsl:when test="(ancestor::rng:element[@name='egXML' or
-			 @name='constraint']         or
-			 ancestor::rng:define[contains(@name,'macro.schemaPattern')])
-			 and         starts-with(@name, 'macro.any')">
-	           <xsl:for-each select="key('DEFED', @name)">
-	              <xsl:apply-templates mode="justcopy"
-					   select="*"/>
-	           </xsl:for-each>
-         </xsl:when>
-	 -->
-         <xsl:when test="key('DEFED',@name)">
-	   <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{@name}"/>
-         </xsl:when>
-	 <xsl:when test="ancestor::tei:content[@autoPrefix='false']">
-	   <ref xmlns="http://relaxng.org/ns/structure/1.0" name="{@name}"/>
-         </xsl:when>
-         <xsl:when test="count(parent::*/*)=1">
-	   <xsl:if test="$verbose='true'">
-	     <xsl:message>ZAP reference to undefined [<xsl:value-of select="@name"/>] and leave empty behind</xsl:message>
-	   </xsl:if>
-	   <empty xmlns="http://relaxng.org/ns/structure/1.0"/>
-         </xsl:when>
-         <xsl:otherwise>
-	   <xsl:if test="$verbose='true'">
-	     <xsl:message>ZAP reference to undefined [<xsl:value-of select="@name"/>]</xsl:message>
-	   </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<xsl:template match="*" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass2" />
+		</xsl:copy>
+	</xsl:template>
 
-<!-- and again -->
+	<xsl:template match="rng:define" mode="pass2">
+		<xsl:choose>
+			<xsl:when test="key('REFED',@name)">
+				<define xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()"
+						mode="pass2" />
+				</define>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						ZAP definition of unused pattern
+						<xsl:value-of select="@name" />
+					</xsl:message>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="processing-instruction()" mode="pass3">
-    <xsl:choose>
-      <xsl:when test="name()='NameList'">
-	<xsl:if test="$verbose='true'">
-	  <xsl:message>Expand 'NameList' processing-instruction</xsl:message>
-	</xsl:if>
-	<choice xmlns="http://relaxng.org/ns/structure/1.0">
-	  <xsl:for-each select="key('PATTERNS','true')">
-	    <ref name="{@name}" />
-	  </xsl:for-each>
-	</choice>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="rng:ref" mode="pass2">
+		<xsl:choose>
+			<!-- <xsl:when test="(ancestor::rng:element[@name='egXML' or @name='constraint'] 
+				or ancestor::rng:define[contains(@name,'macro.schemaPattern')]) and starts-with(@name, 
+				'macro.any')"> <xsl:for-each select="key('DEFED', @name)"> <xsl:apply-templates 
+				mode="justcopy" select="*"/> </xsl:for-each> </xsl:when> -->
+			<xsl:when test="key('DEFED',@name)">
+				<ref xmlns="http://relaxng.org/ns/structure/1.0" name="{@name}" />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:content[@autoPrefix='false']">
+				<ref xmlns="http://relaxng.org/ns/structure/1.0" name="{@name}" />
+			</xsl:when>
+			<xsl:when test="count(parent::*/*)=1">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						ZAP reference to undefined [
+						<xsl:value-of select="@name" />
+						] and leave empty behind
+					</xsl:message>
+				</xsl:if>
+				<empty xmlns="http://relaxng.org/ns/structure/1.0" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						ZAP reference to undefined [
+						<xsl:value-of select="@name" />
+						]
+					</xsl:message>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="rng:choice" mode="pass3">
-      <xsl:choose>
-	<xsl:when test="rng:value|rng:name|.//rng:ref|.//rng:text|.//rng:data">
-	   <choice xmlns="http://relaxng.org/ns/structure/1.0">
-	     <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-	   </choice>
-	</xsl:when>
-	<xsl:otherwise>
-      <xsl:if test="$verbose='true'">
-        <xsl:message>KILLED <xsl:copy-of select="."/></xsl:message>
-      </xsl:if>
-	  <empty xmlns="http://relaxng.org/ns/structure/1.0"/>
-	</xsl:otherwise>
-      </xsl:choose>			   
-  </xsl:template>
+	<!-- and again -->
 
-  <xsl:template match="rng:optional" mode="pass3">
-      <xsl:choose>
-	<xsl:when test="rng:zeroOrMore and count(*)=1">
-	     <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-	</xsl:when>
-	<xsl:when test="count(*)=1 and rng:group[count(*)=1 and	rng:zeroOrMore]">
-	     <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <optional xmlns="http://relaxng.org/ns/structure/1.0">
-	     <xsl:apply-templates
-		 select="*|@*|processing-instruction()|comment()|text()"
-		 mode="pass3"/>
-	  </optional>
-	</xsl:otherwise>
-      </xsl:choose>			   
-  </xsl:template>
+	<xsl:template match="processing-instruction()"
+		mode="pass3">
+		<xsl:choose>
+			<xsl:when test="name()='NameList'">
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						Expand 'NameList' processing-instruction
+					</xsl:message>
+				</xsl:if>
+				<choice xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:for-each select="key('PATTERNS','true')">
+						<ref name="{@name}" />
+					</xsl:for-each>
+				</choice>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="rng:oneOrMore" mode="pass3">
-      <xsl:choose>
-	<xsl:when test="rng:zeroOrMore and count(*)=1">
-	     <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-	</xsl:when>
-	<xsl:when test="count(*)=1 and rng:group[count(*)=1 and	rng:zeroOrMore]">
-	     <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <oneOrMore xmlns="http://relaxng.org/ns/structure/1.0">
-	     <xsl:apply-templates
-		 select="*|@*|processing-instruction()|comment()|text()"
-		 mode="pass3"/>
-	  </oneOrMore>
-	</xsl:otherwise>
-      </xsl:choose>			   
-  </xsl:template>
+	<xsl:template match="rng:choice" mode="pass3">
+		<xsl:choose>
+			<xsl:when
+				test="rng:value|rng:name|.//rng:ref|.//rng:text|.//rng:data">
+				<choice xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()"
+						mode="pass3" />
+				</choice>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$verbose='true'">
+					<xsl:message>
+						KILLED
+						<xsl:copy-of select="." />
+					</xsl:message>
+				</xsl:if>
+				<empty xmlns="http://relaxng.org/ns/structure/1.0" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="rng:zeroOrMore" mode="pass3">
-      <xsl:choose>
-	<xsl:when test="rng:zeroOrMore and count(*)=1">
-	     <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-	</xsl:when>
-	<xsl:when test="count(*)=1 and rng:group[count(*)=1 and	rng:zeroOrMore]">
-	     <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
-	     <xsl:apply-templates
-		 select="*|@*|processing-instruction()|comment()|text()"
-		 mode="pass3"/>
-	  </zeroOrMore>
-	</xsl:otherwise>
-      </xsl:choose>			   
-  </xsl:template>
+	<xsl:template match="rng:optional" mode="pass3">
+		<xsl:choose>
+			<xsl:when test="rng:zeroOrMore and count(*)=1">
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()"
+					mode="pass3" />
+			</xsl:when>
+			<xsl:when
+				test="count(*)=1 and rng:group[count(*)=1 and	rng:zeroOrMore]">
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()"
+					mode="pass3" />
+			</xsl:when>
+			<xsl:otherwise>
+				<optional xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()"
+						mode="pass3" />
+				</optional>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="@*|text()|comment()" mode="pass3">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-    
-  <xsl:template match="*" mode="pass3">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-      </xsl:copy>
-  </xsl:template>
+	<xsl:template match="rng:oneOrMore" mode="pass3">
+		<xsl:choose>
+			<xsl:when test="rng:zeroOrMore and count(*)=1">
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()"
+					mode="pass3" />
+			</xsl:when>
+			<xsl:when
+				test="count(*)=1 and rng:group[count(*)=1 and	rng:zeroOrMore]">
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()"
+					mode="pass3" />
+			</xsl:when>
+			<xsl:otherwise>
+				<oneOrMore xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()"
+						mode="pass3" />
+				</oneOrMore>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="copyright">
-    <xsl:for-each
-	select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability">
-      <xsl:if test="count(tei:licence)&gt;1">
-	<xsl:text>This material is dual-licensed.&#10;</xsl:text>
-      </xsl:if>
-      <xsl:apply-templates/>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template match="rng:zeroOrMore" mode="pass3">
+		<xsl:choose>
+			<xsl:when test="rng:zeroOrMore and count(*)=1">
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()"
+					mode="pass3" />
+			</xsl:when>
+			<xsl:when
+				test="count(*)=1 and rng:group[count(*)=1 and	rng:zeroOrMore]">
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()"
+					mode="pass3" />
+			</xsl:when>
+			<xsl:otherwise>
+				<zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()"
+						mode="pass3" />
+				</zeroOrMore>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:licence">
-    <xsl:if test="@target">
-      <xsl:text>[</xsl:text>
-      <xsl:value-of select="@target"/>
-      <xsl:text>] </xsl:text>
-    </xsl:if>
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="@*|text()|comment()" mode="pass3">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
+	<xsl:template match="*" mode="pass3">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass3" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template name="copyright">
+		<xsl:for-each
+			select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability">
+			<xsl:if test="count(tei:licence)&gt;1">
+				<xsl:text>This material is dual-licensed.&#10;</xsl:text>
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:for-each>
+	</xsl:template>
+
+	<xsl:template match="tei:licence">
+		<xsl:if test="@target">
+			<xsl:text>[</xsl:text>
+			<xsl:value-of select="@target" />
+			<xsl:text>] </xsl:text>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/dtd/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/dtd/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/dtd/build-to.xml	(revision 2397)
@@ -1,91 +1,89 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitodtd">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9887 2011-12-04 22:52:05Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into HTML files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output schema file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="odd2dtd"
-	    value="../profiles/${profile}/dtd/to.xsl"/>
-  <property name="odd2oddxsl" value="../odds2/odd2odd.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
-  <target name="odd">
-    <echo>Do ODD processing</echo>
-    <xslt force="yes" style="${odd2oddxsl}" in="${inputFile}" out="${outputTempDir}/tmp1.xml" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="lang" expression="${lang}" if="lang"/>
-      <param name="defaultSource" expression="${defaultSource}" if="defaultSource"/>
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
-  <target name="dist" depends="setup,odd,convert,cleanup"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9887 2011-12-04 22:52:05Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into HTML files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output schema file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="odd2dtd"
+		value="../profiles/${profile}/dtd/to.xsl" />
+	<property name="odd2oddxsl" value="../odds2/odd2odd.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
+	<target name="odd">
+		<echo>Do ODD processing</echo>
+		<xslt force="yes" style="${odd2oddxsl}" in="${inputFile}"
+			out="${outputTempDir}/tmp1.xml" classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="lang" expression="${lang}" if="lang" />
+			<param name="defaultSource" expression="${defaultSource}"
+				if="defaultSource" />
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
+	<target name="dist" depends="setup,odd,convert,cleanup" />
 
-  <target name="convert">
-    <!-- Recreate temporary output directory -->
-    <!-- The transformation for HTML output. -->
-    <echo level="info">XSLT generate DTD files</echo>
-    <xslt force="yes" style="${odd2dtd}" in="${outputTempDir}/tmp1.xml" out="${outputFile}" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
+	<target name="convert">
+		<!-- Recreate temporary output directory -->
+		<!-- The transformation for HTML output. -->
+		<echo level="info">XSLT generate DTD files</echo>
+		<xslt force="yes" style="${odd2dtd}"
+			in="${outputTempDir}/tmp1.xml" out="${outputFile}"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub-print.css
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub-print.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/epub-print.css	(revision 2397)
@@ -17,62 +17,58 @@
 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 */
-
 @import url(stylesheet.css);
 
 /* elements */
 
-  /* Use Helvetica by preference for most body text. Style hyperlinks with 
+/* Use Helvetica by preference for most body text. Style hyperlinks with 
      color only. Use white-space:pre-wrap or equivalent for code blocks
      so text doesn't get cut off. */
-
 a {
-   text-decoration: none;
+	text-decoration: none;
 }
 
 a:visited {
-   color:inherit;
+	color: inherit;
 }
 
-body { 
-   font-family: Helvetica, Arial, sans-serif;
-   font-size: 10pt;
+body {
+	font-family: Helvetica, Arial, sans-serif;
+	font-size: 10pt;
 }
 
 div.pre, div.pre_eg, pre.eg {
-   font-family: courier, "Courier New", fixed, monospace;
-   font-size: 9pt;
-   /* see http://cheeaun.phoenity.com/weblog/2005/06/whitespace-and-generated-content.html
+	font-family: courier, "Courier New", fixed, monospace;
+	font-size: 9pt;
+	/* see http://cheeaun.phoenity.com/weblog/2005/06/whitespace-and-generated-content.html
       for explanation of the white-space property cascade. pre-wrap is needed so long
       lines won't be cut off in print. When browser support for CSS 2.1 is solid, proprietary
       properties may be removed. */
-   white-space: pre; /* CSS2 */
-   white-space: -moz-pre-wrap; /* Mozilla */
-   white-space: -o-pre-wrap; /* Opera 7 */
-   white-space: pre-wrap; /* CSS 2.1 */
-   white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
-   word-wrap: break-word; /* IE */
-   }
+	white-space: pre; /* CSS2 */
+	white-space: -moz-pre-wrap; /* Mozilla */
+	white-space: -o-pre-wrap; /* Opera 7 */
+	white-space: pre-wrap; /* CSS 2.1 */
+	white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
+	word-wrap: break-word; /* IE */
+}
 
 div.pre_eg, pre.eg {
-   page-break-inside:avoid;
+	page-break-inside: avoid;
 }
 
-
 td {
-   font-size: 10pt;
+	font-size: 10pt;
 }
 
 td.maintext, td.maintext p {
-   font-family: Helvetica, Arial, sans-serif;
+	font-family: Helvetica, Arial, sans-serif;
 }
-   
-/* classes */
 
+/* classes */
 .plain {
-   font-family: Helvetica, Arial, sans-serif;
+	font-family: Helvetica, Arial, sans-serif;
 }
 
 div.pagebreak {
-    page-break-before: always;
+	page-break-before: always;
 }
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/i18n.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/i18n.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/i18n.xml	(revision 2397)
@@ -1,2072 +1,2115 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- interface translations for TEI XSL stylesheets -->
 <i18n>
-  <codes>
-    <code xml:lang="hr" lang3="hrv">
-      <desc>Croatian</desc>
-      <name>Neven Jovanović</name>
-      <email>neven.jovanovic@ffzg.hr</email>
-    </code>
-    <code xml:lang="ko" lang3="kor">
-      <desc>Korean</desc>
-      <name>Beom-mo Kang</name>
-      <email>bmkang@korea.ac.kr</email>
-    </code>
-    <code xml:lang="la" lang3="lat">
-      <desc>Latin</desc>
-      <name>Neven Jovanović</name>
-      <email>neven.jovanovic@ffzg.hr</email>
-    </code>
-    <code xml:lang="ru" lang3="rus">
-      <desc>Russian</desc>
-      <name>Ivan A Derzhanski</name>
-      <email>iad@math.bas.bg</email>
-    </code>
-    <code xml:lang="tr" lang3="tur">
-      <desc>Turkish</desc>
-      <name>Ivan A Derzhanski</name>
-      <email>iad@math.bas.bg</email>
-    </code>
-    <code xml:lang="el" lang3="ell">
-      <desc>Greek</desc>
-      <name>Ivan A Derzhanski</name>
-      <email>iad@math.bas.bg</email>
-    </code>
-    <code xml:lang="bg" lang3="bul">
-      <desc>Bulgarian</desc>
-      <name>Ivan A Derzhanski</name>
-      <email>iad@math.bas.bg</email>
-    </code>
-    <code xml:lang="nl" lang3="nld">
-      <desc>Dutch</desc>
-      <name>Bert Van Elsacker</name>
-      <email>bertvanelsacker@yahoo.com</email>
-    </code>
-    <code xml:lang="de" lang3="deu">
-      <desc>German</desc>
-      <name>Christian Wittern, Torsten Schassan </name>
-      <email>wittern@kanji.zinbun.kyoto-u.ac.jp,schassan@hab.de</email>
-    </code>
-    <code xml:lang="ja" lang3="jpn">
-      <desc>Japanese</desc>
-      <name>Christian Wittern and Ohya Kazushi</name>
-      <email>wittern@kanji.zinbun.kyoto-u.ac.jp,ohyakazushi@gmail.com</email>
-    </code>
-    <code xml:lang="ro" lang3="ron">
-      <desc>Romanian</desc>
-      <name>Adrian Dimulescu</name>
-      <email>adrian.dimulescu@free.fr</email>
-    </code>
-    <code xml:lang="fr" lang3="fra">
-      <desc>French</desc>
-      <name>Laurent Romary</name>
-      <email>Laurent.Romary@loria.fr</email>
-    </code>
-    <code xml:lang="pt" lang3="por">
-      <desc>Portuguese</desc>
-      <name>Leonor Barroca</name>
-      <email>l.barroca@open.ac.uk</email>
-    </code>
-    <code xml:lang="es" lang3="spa">
-      <desc>Spanish</desc>
-      <name>Carmen Arronis Llopis</name>
-      <email>arronis@ua.es</email>
-    </code>
-    <code xml:lang="it" lang3="ita">
-      <desc>Italian</desc>
-      <name>Fabio Ciotti, Arianna Ciula, Elena Pierazzo</name>
-      <email>fabio.ciott@uniroma1.it</email>
-    </code>
-    <code xml:lang="sl" lang3="slv">
-      <desc>Slovenian</desc>
-      <name>Matija Ogrin</name>
-      <email>matija.ogrin@zrc-sazu.si</email>
-    </code>
-    <code xml:lang="pl" lang3="pol">
-      <desc>Polish</desc>
-      <name>Radosław Moszczyński</name>
-      <email>r.moszczynski@uw.edu.pl</email>
-    </code>
-    <code xml:lang="sv" lang3="swe">
-      <desc>Swedish</desc>
-      <name>Monica Langerth Zetterman and Matthew Zimmerman</name>
-      <email>monica.langerth@ped.uu.se,matthew.zimmerman@nyu.edu</email>
-    </code>
-    <code xml:lang="no" lang3="nor">
-      <desc>Norwegian</desc>
-      <name>Øyvind Eide</name>
-      <email>oyvind.eide@muspro.uio.no</email>
-    </code>
-    <code xml:lang="zh-TW">
-      <desc>Chinese</desc>
-      <name>Marcus Bingenheimer</name>
-      <email>m.bingenheimer@gmail.com</email>
-    </code>
-    <code xml:lang="sr" lang3="srp">
-      <desc>Serbian</desc>
-      <name>Cvetana Krstev</name>
-      <email>cvetana@poincare.matf.bg.ac.yu</email>
-    </code>
-    <code xml:lang="hi" lang3="hin">
-      <desc>Hindi</desc>
-      <name>Paul Richards</name>
-      <email>paul.richards@ugs.com</email>
-    </code>
-    <code xml:lang="th" lang3="tha">
-      <desc>Thai</desc>
-      <name>Mananya Patamasoontorn</name>
-      <email>mananyap@hotmail.com</email>
-    </code>
-    <code xml:lang="ca" lang3="cat">
-      <desc>Catalan</desc>
-      <name>Mikel L. Forcada</name>
-      <email>mlf@dlsi.ua.es</email>
-    </code>
-  </codes>
-  <entry>
-    <key>TEI</key>
-    <text xml:lang="en" lang3="eng">Text Encoding Initiative</text>
-    <text xml:lang="de" lang3="deu">Text Encoding Initiative</text>
-    <text xml:lang="ro" lang3="ron">Iniţiativa de Codificare a Textului</text>
-    <text xml:lang="pt" lang3="por">Iniciativa de Codificação de Texto</text>
-    <text xml:lang="es" lang3="spa">Iniciativa de Codificación de Textos</text>
-    <text xml:lang="it" lang3="ita">Text Encoding Initiative</text>
-    <text xml:lang="sv" lang3="swe">Text Encoding Initiative</text>
-    <text xml:lang="no" lang3="nor">Text Encoding Initiative</text>
-    <text xml:lang="sr" lang3="srp">Podsticaj obeležavanju teksta</text>
-    <text xml:lang="pl" lang3="pol">Inicjatywa Kodowania Tekstów</text>
-    <text xml:lang="hi" lang3="hin">viShaya anuvAda prathama kAryavAhI</text>
-    <text xml:lang="th" lang3="tha">รหัสวิชา</text>
-    <text xml:lang="nl" lang3="nld">Tekstcoderingsinitiatief</text>
-    <text xml:lang="ru" lang3="rus">Инициатива по кодированию текстов</text>
-    <text xml:lang="tr" lang3="tur">Metin Kodlaması Girişimi</text>
-    <text xml:lang="bg" lang3="bul">Инициатива за кодиране на текстове</text>
-    <text xml:lang="el" lang3="ell">Πρωτοβουλία για την Κωδικοποίησης Κειμενών</text>
-    <text xml:lang="ca" lang3="cat">Iniciativa de Codificació de Textos</text>
-    <text xml:lang="la" lang3="lat">Stimulus textibus annotandis</text>
-    <text xml:lang="hr" lang3="hrv">Inicijativa za obilježavanje tekstova</text>
-    <text xml:lang="ko" lang3="kor">텍스트 부호화 주도</text>
-  </entry>
-  <entry>
-    <key>Attributes</key>
-    <text xml:lang="en" lang3="eng">Attributes</text>
-    <text xml:lang="de" lang3="deu">Attribute</text>
-    <text xml:lang="ro" lang3="ron">Atribute</text>
-    <text xml:lang="fr" lang3="fra">Attributs</text>
-    <text xml:lang="pt" lang3="por">Atributos</text>
-    <text xml:lang="es" lang3="spa">Atributos</text>
-    <text xml:lang="it" lang3="ita">Attributi</text>
-    <text xml:lang="sl" lang3="slv">Atributi</text>
-    <text xml:lang="sv" lang3="swe">Attribut</text>
-    <text xml:lang="no" lang3="nor">Attributt</text>
-    <text xml:lang="zh-TW">屬性</text>
-    <text xml:lang="sr" lang3="srp">Atributi</text>
-    <text xml:lang="ja" lang3="jpn">属性</text>
-    <text xml:lang="pl" lang3="pol">Atrybuty</text>
-    <text xml:lang="hi" lang3="hin">guNa</text>
-    <text xml:lang="th" lang3="tha">คุณสมบัติ</text>
-    <text xml:lang="nl" lang3="nld">Attributen</text>
-    <text xml:lang="ru" lang3="rus">Атрибуты</text>
-    <text xml:lang="tr" lang3="tur">Öznitelikler</text>
-    <text xml:lang="bg" lang3="bul">Атрибути</text>
-    <text xml:lang="el" lang3="ell">Χαρακτηριστικά</text>
-    <text xml:lang="ca" lang3="cat">Atributs</text>
-    <text xml:lang="la" lang3="lat">Attributa</text>
-    <text xml:lang="hr" lang3="hrv">Atributi</text>
-    <text xml:lang="ko" lang3="kor">속성</text>
-  </entry>
-  <entry>
-    <key>Class</key>
-    <text xml:lang="en" lang3="eng">Class</text>
-    <text xml:lang="de" lang3="deu">Klasse</text>
-    <text xml:lang="ro" lang3="ron">Clasă</text>
-    <text xml:lang="fr" lang3="fra">Classe</text>
-    <text xml:lang="pt" lang3="por">Classe</text>
-    <text xml:lang="es" lang3="spa">Clase</text>
-    <text xml:lang="it" lang3="ita">Classe</text>
-    <text xml:lang="sl" lang3="slv">Razred</text>
-    <text xml:lang="sv" lang3="swe">Klass</text>
-    <text xml:lang="no" lang3="nor">Klasse</text>
-    <text xml:lang="zh-TW">分類</text>
-    <text xml:lang="sr" lang3="srp">Klasa</text>
-    <text xml:lang="ja" lang3="jpn">クラス</text>
-    <text xml:lang="pl" lang3="pol">Klasa</text>
-    <text xml:lang="hi" lang3="hin">shreNI</text>
-    <text xml:lang="th" lang3="tha">ชั้นเรียน</text>
-    <text xml:lang="nl" lang3="nld">Klasse</text>
-    <text xml:lang="ru" lang3="rus">Класс</text>
-    <text xml:lang="tr" lang3="tur">Sınıf</text>
-    <text xml:lang="bg" lang3="bul">Клас</text>
-    <text xml:lang="el" lang3="ell">Κλάση</text>
-    <text xml:lang="ca" lang3="cat">Classe</text>
-    <text xml:lang="la" lang3="lat">Classis</text>
-    <text xml:lang="hr" lang3="hrv">Razred</text>
-    <text xml:lang="ko" lang3="kor">부류</text>
-  </entry>
-  <entry>
-    <key>Classes defined</key>
-    <text xml:lang="en" lang3="eng">Classes defined</text>
-    <text xml:lang="de" lang3="deu">Definierte Klassen</text>
-    <text xml:lang="ro" lang3="ron">Clase definite</text>
-    <text xml:lang="fr" lang3="fra">Classes définies</text>
-    <text xml:lang="pt" lang3="por">Classes definidas</text>
-    <text xml:lang="es" lang3="spa">Clases definidas</text>
-    <text xml:lang="it" lang3="ita">Classi definite</text>
-    <text xml:lang="sl" lang3="slv">Definirani razredi</text>
-    <text xml:lang="sv" lang3="swe">Definierade klasser</text>
-    <text xml:lang="no" lang3="nor">Definerte klasser klasser</text>
-    <text xml:lang="zh-TW">被定義的分類</text>
-    <text xml:lang="sr" lang3="srp">Definisane klase</text>
-    <text xml:lang="ja" lang3="jpn">定義済みクラス</text>
-    <text xml:lang="pl" lang3="pol">Zdefiniowane klasy</text>
-    <text xml:lang="hi" lang3="hin">Paribashith shreNI</text>
-    <text xml:lang="th" lang3="tha">หมายเลขชั้นเรียน</text>
-    <text xml:lang="nl" lang3="nld">Gedefinieerde klassen</text>
-    <text xml:lang="ru" lang3="rus">Описанные классы</text>
-    <text xml:lang="tr" lang3="tur">Tanımlı sınıflar</text>
-    <text xml:lang="bg" lang3="bul">Описани класове</text>
-    <text xml:lang="el" lang3="ell">Οριζόμενες κλάσες</text>
-    <text xml:lang="ca" lang3="cat">Classes definides</text>
-    <text xml:lang="la" lang3="lat">Classes definitae</text>
-    <text xml:lang="hr" lang3="hrv">Definirani razredi</text>
-    <text xml:lang="ko" lang3="kor">정의 부류</text>
-  </entry>
-  <entry>
-    <key>Datatype</key>
-    <text xml:lang="en" lang3="eng">Datatype</text>
-    <text xml:lang="de" lang3="deu">Datentyp</text>
-    <text xml:lang="ro" lang3="ron">Tipuri de date</text>
-    <text xml:lang="fr" lang3="fra">Type de données</text>
-    <text xml:lang="pt" lang3="por">Tipo de Dados</text>
-    <text xml:lang="es" lang3="spa">Tipo de datos</text>
-    <text xml:lang="it" lang3="ita">Tipo di dati</text>
-    <text xml:lang="sl" lang3="slv">Podatkovni tip</text>
-    <text xml:lang="sv" lang3="swe">Datatyp</text>
-    <text xml:lang="no" lang3="nor">Datatype</text>
-    <text xml:lang="zh-TW">資料類型</text>
-    <text xml:lang="sr" lang3="srp">Podatkovni tip</text>
-    <text xml:lang="ja" lang3="jpn">データ型</text>
-    <text xml:lang="pl" lang3="pol">Typ danych</text>
-    <text xml:lang="hi" lang3="hin">NirDishta varga</text>
-    <text xml:lang="th" lang3="tha">ชนิดของข้อมูล</text>
-    <text xml:lang="nl" lang3="nld">Datatype</text>
-    <text xml:lang="ru" lang3="rus">Тип данных</text>
-    <text xml:lang="tr" lang3="tur">Veri Türü</text>
-    <text xml:lang="bg" lang3="bul">Тип данни</text>
-    <text xml:lang="el" lang3="ell">Τύπος δεδομένων</text>
-    <text xml:lang="ca" lang3="cat">Tipus de dades</text>
-    <text xml:lang="la" lang3="lat">Datorum qualitas</text>
-    <text xml:lang="hr" lang3="hrv">Vrsta podataka</text>
-    <text xml:lang="ko" lang3="kor">자료 유형</text>
-  </entry>
-  <entry>
-    <key>Declaration</key>
-    <text xml:lang="en" lang3="eng">Declaration</text>
-    <text xml:lang="de" lang3="deu">Deklaration</text>
-    <text xml:lang="ro" lang3="ron">Declaraţie</text>
-    <text xml:lang="fr" lang3="fra">Declaration</text>
-    <text xml:lang="pt" lang3="por">Declaração</text>
-    <text xml:lang="es" lang3="spa">Declaración</text>
-    <text xml:lang="it" lang3="ita">Dichiarazione</text>
-    <text xml:lang="sl" lang3="slv">Deklaracija</text>
-    <text xml:lang="sv" lang3="swe">Deklaration</text>
-    <text xml:lang="no" lang3="nor">Deklarasjon</text>
-    <text xml:lang="zh-TW">宣告</text>
-    <text xml:lang="sr" lang3="srp">Deklaracija</text>
-    <text xml:lang="ja" lang3="jpn">宣言</text>
-    <text xml:lang="pl" lang3="pol">Deklaracja</text>
-    <text xml:lang="hi" lang3="hin">ghoShaNA</text>
-    <text xml:lang="th" lang3="tha">คำประกาศ</text>
-    <text xml:lang="nl" lang3="nld">Declaratie</text>
-    <text xml:lang="ru" lang3="rus">Описание</text>
-    <text xml:lang="tr" lang3="tur">Bildirim</text>
-    <text xml:lang="bg" lang3="bul">Декларация</text>
-    <text xml:lang="el" lang3="ell">Δήλωση</text>
-    <text xml:lang="ca" lang3="cat">Declaració</text>
-    <text xml:lang="la" lang3="lat">Declaratio</text>
-    <text xml:lang="hr" lang3="hrv">Deklaracija</text>
-    <text xml:lang="ko" lang3="kor">선언</text>
-  </entry>
-  <entry>
-    <key>Default</key>
-    <text xml:lang="en" lang3="eng">Default</text>
-    <text xml:lang="de" lang3="deu">Vorgabe</text>
-    <text xml:lang="ro" lang3="ron">Implicit</text>
-    <text xml:lang="fr" lang3="fra">Valeur par défaut</text>
-    <text xml:lang="pt" lang3="por">Valor por defeito</text>
-    <text xml:lang="es" lang3="spa">Por defecto</text>
-    <text xml:lang="it" lang3="ita">Valore di default</text>
-    <text xml:lang="sl" lang3="slv">Privzeta vrednost</text>
-    <text xml:lang="sv" lang3="swe">Standard</text>
-    <text xml:lang="no" lang3="nor">Standard</text>
-    <text xml:lang="zh-TW">預設值</text>
-    <text xml:lang="sr" lang3="srp">Pretpostavljena vrednost</text>
-    <text xml:lang="ja" lang3="jpn">初期値</text>
-    <text xml:lang="pl" lang3="pol">Wartość domyślna</text>
-    <text xml:lang="hi" lang3="hin">aparAdha</text>
-    <text xml:lang="th" lang3="tha">ค่าตั้งเริ่มต้น</text>
-    <text xml:lang="nl" lang3="nld">Defaultwaarde</text>
-    <text xml:lang="ru" lang3="rus">Величина по умолчанию</text>
-    <text xml:lang="tr" lang3="tur">Varsayılan</text>
-    <text xml:lang="bg" lang3="bul">Стойност по подразбиране</text>
-    <text xml:lang="el" lang3="ell">Προεπιλεγμένη τιμή</text>
-    <text xml:lang="ca" lang3="cat">Implícit</text>
-    <text xml:lang="la" lang3="lat">Valores implicitae</text>
-    <text xml:lang="hr" lang3="hrv">Polazne vrijednosti</text>
-    <text xml:lang="ko" lang3="kor">기본값</text>
-  </entry>
-  <entry>
-    <key>Element</key>
-    <text xml:lang="en" lang3="eng">Element</text>
-    <text xml:lang="de" lang3="deu">Element</text>
-    <text xml:lang="ro" lang3="ron">Element</text>
-    <text xml:lang="fr" lang3="fra">Elément</text>
-    <text xml:lang="pt" lang3="por">Elemento</text>
-    <text xml:lang="es" lang3="spa">Elemento</text>
-    <text xml:lang="it" lang3="ita">Elemento</text>
-    <text xml:lang="sl" lang3="slv">Element</text>
-    <text xml:lang="sv" lang3="swe">Element</text>
-    <text xml:lang="no" lang3="nor">Element</text>
-    <text xml:lang="zh-TW">元素</text>
-    <text xml:lang="sr" lang3="srp">Element</text>
-    <text xml:lang="ja" lang3="jpn">要素</text>
-    <text xml:lang="pl" lang3="pol">Element</text>
-    <text xml:lang="hi" lang3="hin">mUla</text>
-    <text xml:lang="nl" lang3="nld">Element</text>
-    <text xml:lang="ru" lang3="rus">Элемент</text>
-    <text xml:lang="tr" lang3="tur">Öğe</text>
-    <text xml:lang="bg" lang3="bul">Елемент</text>
-    <text xml:lang="el" lang3="ell">Στοιχείο</text>
-    <text xml:lang="ca" lang3="cat">Element</text>
-    <text xml:lang="la" lang3="lat">Elementum</text>
-    <text xml:lang="hr" lang3="hrv">Element</text>
-    <text xml:lang="ko" lang3="kor">요소</text>
-  </entry>
-  <entry>
-    <key>Elements defined</key>
-    <text xml:lang="en" lang3="eng">Elements defined</text>
-    <text xml:lang="de" lang3="deu">Definierte Elemente</text>
-    <text xml:lang="ro" lang3="ron">Elemente definite</text>
-    <text xml:lang="fr" lang3="fra">Eléments définis</text>
-    <text xml:lang="pt" lang3="por">Elementos definidos</text>
-    <text xml:lang="es" lang3="spa">Elementos definidos</text>
-    <text xml:lang="it" lang3="ita">Elementi definiti</text>
-    <text xml:lang="sl" lang3="slv">Definirani elementi</text>
-    <text xml:lang="sv" lang3="swe">Definierade element</text>
-    <text xml:lang="no" lang3="nor">Definerte elementer</text>
-    <text xml:lang="zh-TW">被定義的元素</text>
-    <text xml:lang="sr" lang3="srp">Definisani elementi</text>
-    <text xml:lang="ja" lang3="jpn">定義済み要素</text>
-    <text xml:lang="pl" lang3="pol">Zdefiniowane elementy</text>
-    <text xml:lang="hi" lang3="hin">Paribhasith Mula</text>
-    <text xml:lang="th" lang3="tha">ระบุเนื้อหา</text>
-    <text xml:lang="nl" lang3="nld">Gedefinieerde elementen</text>
-    <text xml:lang="ru" lang3="rus">Описанные элементы</text>
-    <text xml:lang="tr" lang3="tur">Tanımlı öğeler</text>
-    <text xml:lang="bg" lang3="bul">Описани елементи</text>
-    <text xml:lang="el" lang3="ell">Οριζόμενα στοιχεία</text>
-    <text xml:lang="ca" lang3="cat">Elements definits</text>
-    <text xml:lang="la" lang3="lat">Elementa definita</text>
-    <text xml:lang="hr" lang3="hrv">Definirani elementi</text>
-    <text xml:lang="ko" lang3="kor">정의 요소</text>
-  </entry>
-  <entry>
-    <key>Example</key>
-    <text xml:lang="en" lang3="eng">Example</text>
-    <text xml:lang="de" lang3="deu">Beispiel</text>
-    <text xml:lang="ro" lang3="ron">Exemplu</text>
-    <text xml:lang="fr" lang3="fra">Exemple</text>
-    <text xml:lang="pt" lang3="por">Exemplo</text>
-    <text xml:lang="es" lang3="spa">Ejemplo</text>
-    <text xml:lang="it" lang3="ita">Esempio</text>
-    <text xml:lang="sl" lang3="slv">Primer</text>
-    <text xml:lang="sv" lang3="swe">Exempel</text>
-    <text xml:lang="no" lang3="nor">Eksempel</text>
-    <text xml:lang="zh-TW">例子</text>
-    <text xml:lang="sr" lang3="srp">Primer</text>
-    <text xml:lang="ja" lang3="jpn">例</text>
-    <text xml:lang="pl" lang3="pol">Przykład</text>
-    <text xml:lang="hi" lang3="hin">udAharaNa</text>
-    <text xml:lang="th" lang3="tha">ตัวอย่าง</text>
-    <text xml:lang="nl" lang3="nld">Voorbeeld</text>
-    <text xml:lang="ru" lang3="rus">Пример</text>
-    <text xml:lang="tr" lang3="tur">Örnek</text>
-    <text xml:lang="bg" lang3="bul">Пример</text>
-    <text xml:lang="el" lang3="ell">Παράδειγμα</text>
-    <text xml:lang="ca" lang3="cat">Exemple</text>
-    <text xml:lang="la" lang3="lat">Exemplum</text>
-    <text xml:lang="hr" lang3="hrv">Primjer</text>
-    <text xml:lang="ko" lang3="kor">예</text>
-  </entry>
-  <entry>
-    <key>Global attributes and those inherited from</key>
-    <text xml:lang="es" lang3="spa">Atributos globales y los heredados de</text>
-    <text xml:lang="ca" lang3="cat">Atributs globals i els heretats de</text>
-    <text xml:lang="en" lang3="eng">Global attributes and those inherited from</text>
-    <text xml:lang="de" lang3="deu">Global gültige Attribute und solche ererbt von ...</text>
-    <text xml:lang="ro" lang3="ron">Atributele globale şi cele moştenite din</text>
-    <text xml:lang="fr" lang3="fra">Attributs globaux et hérités</text>
-    <text xml:lang="pt" lang3="por">Atributos globais e herdados de...</text>
-    <text xml:lang="it" lang3="ita">Attributi globali e quelli ereditati da</text>
-    <text xml:lang="sl" lang3="slv">Globalni atributi in tisti, sprejeti iz</text>
-    <text xml:lang="sv" lang3="swe">Globala attribut samt de som ärvts från</text>
-    <text xml:lang="no" lang3="nor">Globale attributter og de som arves fra</text>
-    <text xml:lang="zh-TW">全域屬性和從...繼承的屬性</text>
-    <text xml:lang="sr" lang3="srp">Globalni atributi i atributi koji se nasledjuju</text>
-    <text xml:lang="ja" lang3="jpn">グローバル属性または継承した属性</text>
-    <text xml:lang="pl" lang3="pol">Atrybuty globalne i odziedziczone po...</text>
-    <text xml:lang="hi" lang3="hin">Vishva Guna Aur Jinmese Adhikara Paya</text>
-    <text xml:lang="th" lang3="tha">คุณสมบัติโดยรวมและที่เทียบโอนมา</text>
-    <text xml:lang="nl" lang3="nld">Globale attributen en attributen geërfd van</text>
-    <text xml:lang="ru" lang3="rus">Глобальные атрибуты и атрибуты, унаследованные от</text>
-    <text xml:lang="tr" lang3="tur">Genel ve ~'dan kalıtsal öznitelikler</text>
-    <text xml:lang="bg" lang3="bul">Глобални атрибути и атрибути, наследени от</text>
-    <text xml:lang="el" lang3="ell">Χαρακτηριστικά καθολικά και κληρονομικά από</text>
-    <text xml:lang="ca" lang3="cat">Atributs globals i aquells heretats de</text>
-    <text xml:lang="la" lang3="lat">Attributa universalia et haereditaria</text>
-    <text xml:lang="hr" lang3="hrv">Globalni i naslijeđeni atributi</text>
-    <text xml:lang="ko" lang3="kor">전반적 속성 및 상속 속성</text>
-  </entry>
-  <entry>
-    <key>Global attributes only</key>
-    <text xml:lang="ca" lang3="cat">A més dels atributs globals i dels heretats de</text>
-    <text xml:lang="en" lang3="eng">Global attributes only</text>
-    <text xml:lang="de" lang3="deu">Nur global gültige Attribute</text>
-    <text xml:lang="ro" lang3="ron">Numai atributele globale</text>
-    <text xml:lang="fr" lang3="fra">Attributs globaux seulement</text>
-    <text xml:lang="pt" lang3="por">Só atributos globais</text>
-    <text xml:lang="es" lang3="spa">Solo atributos globales</text>
-    <text xml:lang="it" lang3="ita">Solo attributi globali</text>
-    <text xml:lang="sl" lang3="slv">Samo globalni atributi</text>
-    <text xml:lang="sv" lang3="swe">Endast globala attribut</text>
-    <text xml:lang="no" lang3="nor">Kun globale attributter</text>
-    <text xml:lang="zh-TW">僅全域屬性</text>
-    <text xml:lang="sr" lang3="srp">Isključivo globalni atributi</text>
-    <text xml:lang="ja" lang3="jpn">グローバル属性のみ</text>
-    <text xml:lang="pl" lang3="pol">Wyłącznie atrybuty globalne</text>
-    <text xml:lang="hi" lang3="hin">Keval Vishva Guna</text>
-    <text xml:lang="th" lang3="tha">คุณสมบัติโดยรวมเท่านั้น</text>
-    <text xml:lang="nl" lang3="nld">Enkel globale attributen</text>
-    <text xml:lang="ru" lang3="rus">Только глобальные атрибуты</text>
-    <text xml:lang="tr" lang3="tur">Sadece genel öznitelikler</text>
-    <text xml:lang="bg" lang3="bul">Само глобални атрибути</text>
-    <text xml:lang="el" lang3="ell">Μόνο καθολικά χαρακτηριστικά</text>
-    <text xml:lang="ca" lang3="cat">Només atributs globals</text>
-    <text xml:lang="la" lang3="lat">Attributa universalia tantum</text>
-    <text xml:lang="hr" lang3="hrv">Samo globalni atributi</text>
-    <text xml:lang="ko" lang3="kor">전체 속성만 허용</text>
-  </entry>
-  <entry>
-    <key>In addition to global attributes</key>
-    <text xml:lang="ca" lang3="cat">Els valors suggerits inclouen</text>
-    <text xml:lang="en" lang3="eng">In addition to global attributes</text>
-    <text xml:lang="de" lang3="deu">Neben global gültigen Attributen</text>
-    <text xml:lang="ro" lang3="ron">În plus faţă de atributele globale</text>
-    <text xml:lang="fr" lang3="fra">En complément des attributs globaux</text>
-    <text xml:lang="pt" lang3="por">Para além de atributos globais</text>
-    <text xml:lang="es" lang3="spa">Además de los atributos globales</text>
-    <text xml:lang="it" lang3="ita">Oltre agli attributi globali</text>
-    <text xml:lang="sl" lang3="slv">Poleg globalnih atributov</text>
-    <text xml:lang="sv" lang3="swe">Förutom globala attribut</text>
-    <text xml:lang="no" lang3="nor">I tillegg til globale attributter</text>
-    <text xml:lang="zh-TW">除全域屬性以外</text>
-    <text xml:lang="sr" lang3="srp">Pored globalnih atributa</text>
-    <text xml:lang="ja" lang3="jpn">グローバル属性の他</text>
-    <text xml:lang="pl" lang3="pol">Oprócz atrybutów globalnych</text>
-    <text xml:lang="hi" lang3="hin">Vishva Guna Ke Alava</text>
-    <text xml:lang="th" lang3="tha">คุณสมบัติโดยรวมเพิ่มเติม</text>
-    <text xml:lang="nl" lang3="nld">Naast de globale attributen</text>
-    <text xml:lang="ru" lang3="rus">Вдобавок к глобальным атрибутам</text>
-    <text xml:lang="tr" lang3="tur">Genel özniteliklerden başka</text>
-    <text xml:lang="bg" lang3="bul">Освен глобалните атрибути</text>
-    <text xml:lang="el" lang3="ell">Πλήν των καθολικών χαρακτηριστικών</text>
-    <text xml:lang="ca" lang3="cat">A més dels atributs globals</text>
-    <text xml:lang="la" lang3="lat">Praeter attributa universalia</text>
-    <text xml:lang="hr" lang3="hrv">Uz globalne atribute</text>
-    <text xml:lang="ko" lang3="kor">전체 속성에 부가</text>
-  </entry>
-  <entry>
-    <key>In addition to global attributes and those inherited from</key>
-    <text xml:lang="en" lang3="eng">In addition to global attributes and those inherited from</text>
-    <text xml:lang="de" lang3="deu">Neben global gültigen Attributen und solchen ererbt von ...</text>
-    <text xml:lang="ro" lang3="ron">În plus faţă de atributele globale şi de cele moştenite din</text>
-    <text xml:lang="fr" lang3="fra">En complément des attributs globaux et hérités</text>
-    <text xml:lang="pt" lang3="por">Para além de atributos globais e herdados de...</text>
-    <text xml:lang="it" lang3="ita">Oltre agli attributi globali e a quelli ereditati da</text>
-    <text xml:lang="sl" lang3="slv">Poleg globalnih atributov in tistih, sprejetih iz</text>
-    <text xml:lang="sv" lang3="swe">Förutom globala attribut samt de som ärvts från</text>
-    <text xml:lang="no" lang3="nor">I tillegg til globale attributter og de som arves fra</text>
-    <text xml:lang="zh-TW">除全域屬性和從...繼承的屬性以外</text>
-    <text xml:lang="sr" lang3="srp">Pored globalnih atributa i onih koji se nasledjuju</text>
-    <text xml:lang="ja" lang3="jpn">グローバル属性または継承した属性の他</text>
-    <text xml:lang="pl" lang3="pol">Oprócz atrybutów globalnych i odziedziczonych po...</text>
-    <text xml:lang="hi" lang3="hin">Vishva Guna Ke Alava Aur Jinmese Adhikara Paya</text>
-    <text xml:lang="th" lang3="tha">คุณสมบัติโดยรวมและที่เทียบโอนมาเพิ่มเติม</text>
-    <text xml:lang="nl" lang3="nld">Naast de globale attributen en de attributen geërfd van</text>
-    <text xml:lang="ru" lang3="rus">Вдобавок к глобальным атрибутам и атрибутам, унаследованным от</text>
-    <text xml:lang="tr" lang3="tur">Genel ve ~'dan kalıtsal özniteliklerden başka</text>
-    <text xml:lang="bg" lang3="bul">Освен глобалните атрибути и атрибутите, наследени от</text>
-    <text xml:lang="el" lang3="ell">Πλήν τωνχαρακτηριστικών καθολικών και κληρονομικών από</text>
-    <text xml:lang="ca" lang3="cat">A més dels atributs globals i els heretats de</text>
-    <text xml:lang="es" lang3="spa">Además de los atributos globales y los heredados de</text>
-    <text xml:lang="ko" lang3="kor">&gt;전체 속성 및 상속 속성에 부가</text>
-  </entry>
-  <entry>
-    <key>Legal values are</key>
-    <text xml:lang="en" lang3="eng">Legal values are</text>
-    <text xml:lang="de" lang3="deu">Gültige Werte</text>
-    <text xml:lang="ro" lang3="ron">Valorile admise sunt</text>
-    <text xml:lang="fr" lang3="fra">Les valeurs autorisées sont</text>
-    <text xml:lang="pt" lang3="por">Valores permitidos são</text>
-    <text xml:lang="es" lang3="spa">Los valores admitidos son</text>
-    <text xml:lang="it" lang3="ita">I valori legali sono</text>
-    <text xml:lang="sl" lang3="slv">Veljavne vrednosti so</text>
-    <text xml:lang="sv" lang3="swe">Tillåtna värden är</text>
-    <text xml:lang="no" lang3="nor">Lovlige verdier er</text>
-    <text xml:lang="zh-TW">合法的值是</text>
-    <text xml:lang="sr" lang3="srp">Dozvoljene vrednosti su</text>
-    <text xml:lang="ja" lang3="jpn">正当な値</text>
-    <text xml:lang="pl" lang3="pol">Dozwolone wartości to</text>
-    <text xml:lang="hi" lang3="hin">niyamAnukUla guNa Hai</text>
-    <text xml:lang="th" lang3="tha">คุณค่าทางกฎหมายคือ</text>
-    <text xml:lang="nl" lang3="nld">Geldige waarden zijn</text>
-    <text xml:lang="ru" lang3="rus">Разрешенные величины:</text>
-    <text xml:lang="tr" lang3="tur">Geçerli değerler:</text>
-    <text xml:lang="bg" lang3="bul">Разрешените стойности са</text>
-    <text xml:lang="el" lang3="ell">Οι νόμιμες τιμές είναι</text>
-    <text xml:lang="ca" lang3="cat">Els valors permesos són</text>
-    <text xml:lang="la" lang3="lat">Valores permissae</text>
-    <text xml:lang="hr" lang3="hrv">Dozvoljene su vrijednosti</text>
-    <text xml:lang="ko" lang3="kor">적법한 값은</text>
-  </entry>
-  <entry>
-    <key>Macros defined</key>
-    <text xml:lang="en" lang3="eng">Macros defined</text>
-    <text xml:lang="de" lang3="deu">Definierte Makros</text>
-    <text xml:lang="ro" lang3="ron">Macrouri definite</text>
-    <text xml:lang="fr" lang3="fra">Macros définies</text>
-    <text xml:lang="pt" lang3="por">Macros definidas</text>
-    <text xml:lang="es" lang3="spa">Macros definidas</text>
-    <text xml:lang="it" lang3="ita">Macro definite</text>
-    <text xml:lang="sl" lang3="slv">Definirani makri</text>
-    <text xml:lang="sv" lang3="swe">Definierade makron</text>
-    <text xml:lang="no" lang3="nor">Definerete makroer</text>
-    <text xml:lang="zh-TW">被定義的巨指令</text>
-    <text xml:lang="sr" lang3="srp">Definisani makroi</text>
-    <text xml:lang="ja" lang3="jpn">定義済みマクロ</text>
-    <text xml:lang="pl" lang3="pol">Zdefiniowane makra</text>
-    <text xml:lang="th" lang3="tha">โคร</text>
-    <text xml:lang="nl" lang3="nld">Gedefinieerde macro's</text>
-    <text xml:lang="ru" lang3="rus">Определенные макросы</text>
-    <text xml:lang="tr" lang3="tur">Tanımlı makrolar</text>
-    <text xml:lang="bg" lang3="bul">Дефинирани макроси</text>
-    <text xml:lang="el" lang3="ell">Οριζόμενες μακροεντολές</text>
-    <text xml:lang="ca" lang3="cat">Macros definides</text>
-    <text xml:lang="la" lang3="lat">Macromandata definita</text>
-    <text xml:lang="hr" lang3="hrv">Definirane makronaredbe</text>
-    <text xml:lang="ko" lang3="kor">정의 크로</text>
-  </entry>
-  <entry>
-    <key>Mandatory when applicable</key>
-    <text xml:lang="en" lang3="eng">Mandatory when applicable</text>
-    <text xml:lang="de" lang3="deu">Obligatorisch wenn zutreffend</text>
-    <text xml:lang="ro" lang3="ron">Obligatoriu dacă se potriveşte</text>
-    <text xml:lang="fr" lang3="fra">Obligatoire quand applicable</text>
-    <text xml:lang="pt" lang3="por">Obrigatório quando aplicável</text>
-    <text xml:lang="es" lang3="spa">Obligatorios cuando se aplican</text>
-    <text xml:lang="it" lang3="ita">Obbligatorio se applicabile</text>
-    <text xml:lang="sl" lang3="slv">Obvezen, če ustreza</text>
-    <text xml:lang="sv" lang3="swe">Obligatorisk om användbar</text>
-    <text xml:lang="no" lang3="nor">Obligatorisk når aktuelt</text>
-    <text xml:lang="zh-TW">可應用時必備的</text>
-    <text xml:lang="sr" lang3="srp">Obavezan, ako se može primeniti</text>
-    <text xml:lang="ja" lang3="jpn">使えるならば必須</text>
-    <text xml:lang="pl" lang3="pol">Obowiązkowe w stosownych przypadkach</text>
-    <text xml:lang="hi" lang3="hin">anivArya JaHa uchita</text>
-    <text xml:lang="th" lang3="tha">ต้องได้รับการอนุมัติเมื่อสมัครเรียน</text>
-    <text xml:lang="nl" lang3="nld">Verplicht indien van toepassing</text>
-    <text xml:lang="ru" lang3="rus">Обязательный, если применим</text>
-    <text xml:lang="tr" lang3="tur">Uygulanabilirse zorunlu</text>
-    <text xml:lang="bg" lang3="bul">Задължителен, ако е приложим</text>
-    <text xml:lang="el" lang3="ell">Υποχρεωτικός αν είναι εφαρμόσιμος</text>
-    <text xml:lang="ca" lang3="cat">Obligatoris quan siga possible</text>
-    <text xml:lang="la" lang3="lat">Obligatoria in loco proprio</text>
-    <text xml:lang="hr" lang3="hrv">Obavezno na odgovarajućem mjestu</text>
-    <text xml:lang="ko" lang3="kor">의무적 적용</text>
-  </entry>
-  <entry>
-    <key>Members</key>
-    <text xml:lang="en" lang3="eng">Members</text>
-    <text xml:lang="de" lang3="deu">Mitglieder</text>
-    <text xml:lang="ro" lang3="ron">Membri</text>
-    <text xml:lang="fr" lang3="fra">Membres</text>
-    <text xml:lang="pt" lang3="por">Membros</text>
-    <text xml:lang="es" lang3="spa">Miembros</text>
-    <text xml:lang="it" lang3="ita">Membri</text>
-    <text xml:lang="sl" lang3="slv">Člani</text>
-    <text xml:lang="sv" lang3="swe">Medlemmar</text>
-    <text xml:lang="no" lang3="nor">Medlemmer</text>
-    <text xml:lang="zh-TW"> 成員</text>
-    <text xml:lang="sr" lang3="srp">Članovi</text>
-    <text xml:lang="ja" lang3="jpn">構成</text>
-    <text xml:lang="pl" lang3="pol">Członkowie</text>
-    <text xml:lang="hi" lang3="hin">sadasya</text>
-    <text xml:lang="th" lang3="tha">สมาชิก</text>
-    <text xml:lang="nl" lang3="nld">Leden</text>
-    <text xml:lang="ru" lang3="rus">Члены</text>
-    <text xml:lang="tr" lang3="tur">Üyeler</text>
-    <text xml:lang="bg" lang3="bul">Членове</text>
-    <text xml:lang="el" lang3="ell">Μέλη</text>
-    <text xml:lang="ca" lang3="cat">Membres</text>
-    <text xml:lang="la" lang3="lat">Membra</text>
-    <text xml:lang="hr" lang3="hrv">Članovi</text>
-    <text xml:lang="ko" lang3="kor">원소</text>
-  </entry>
-  <entry>
-    <key>Module</key>
-    <text xml:lang="en" lang3="eng">Module</text>
-    <text xml:lang="de" lang3="deu">Modul</text>
-    <text xml:lang="ro" lang3="ron">Modul</text>
-    <text xml:lang="fr" lang3="fra">Module</text>
-    <text xml:lang="pt" lang3="por">Módulo</text>
-    <text xml:lang="es" lang3="spa">Módulo</text>
-    <text xml:lang="it" lang3="ita">Modulo</text>
-    <text xml:lang="sl" lang3="slv">Modul</text>
-    <text xml:lang="sv" lang3="swe">Modul</text>
-    <text xml:lang="no" lang3="nor">Modul</text>
-    <text xml:lang="zh-TW">組件</text>
-    <text xml:lang="sr" lang3="srp">Modul</text>
-    <text xml:lang="ja" lang3="jpn">モジュール</text>
-    <text xml:lang="pl" lang3="pol">Moduł</text>
-    <text xml:lang="th" lang3="tha">หลักสูตรการศึกษา</text>
-    <text xml:lang="nl" lang3="nld">Module</text>
-    <text xml:lang="ru" lang3="rus">Модуль</text>
-    <text xml:lang="tr" lang3="tur">Modül</text>
-    <text xml:lang="bg" lang3="bul">Модул</text>
-    <text xml:lang="el" lang3="ell">Στοιχείο</text>
-    <text xml:lang="ca" lang3="cat">Mòdul</text>
-    <text xml:lang="la" lang3="lat">Modulus</text>
-    <text xml:lang="hr" lang3="hrv">Modul</text>
-    <text xml:lang="ko" lang3="kor">모듈</text>
-  </entry>
-  <entry>
-    <key>Note</key>
-    <text xml:lang="en" lang3="eng">Note</text>
-    <text xml:lang="de" lang3="deu">Anmerkung</text>
-    <text xml:lang="ro" lang3="ron">Notă</text>
-    <text xml:lang="fr" lang3="fra">Note</text>
-    <text xml:lang="pt" lang3="por">Nota</text>
-    <text xml:lang="es" lang3="spa">Nota</text>
-    <text xml:lang="it" lang3="ita">Nota</text>
-    <text xml:lang="sl" lang3="slv">Opomba</text>
-    <text xml:lang="sv" lang3="swe">Notering</text>
-    <text xml:lang="no" lang3="nor">Note</text>
-    <text xml:lang="zh-TW">註</text>
-    <text xml:lang="sr" lang3="srp">Napomena</text>
-    <text xml:lang="ja" lang3="jpn">解説</text>
-    <text xml:lang="pl" lang3="pol">Uwagi</text>
-    <text xml:lang="hi" lang3="hin">lekha</text>
-    <text xml:lang="th" lang3="tha">หมายเหตุ</text>
-    <text xml:lang="nl" lang3="nld">Opmerking</text>
-    <text xml:lang="ru" lang3="rus">Примечание</text>
-    <text xml:lang="tr" lang3="tur">Not</text>
-    <text xml:lang="bg" lang3="bul">Забележка</text>
-    <text xml:lang="el" lang3="ell">Σχόλιο</text>
-    <text xml:lang="ca" lang3="cat">Nota</text>
-    <text xml:lang="la" lang3="lat">Notula</text>
-    <text xml:lang="hr" lang3="hrv">Bilješka</text>
-    <text xml:lang="ko" lang3="kor">주석</text>
-  </entry>
-  <entry>
-    <key>Optional</key>
-    <text xml:lang="en" lang3="eng">Optional</text>
-    <text xml:lang="de" lang3="deu">Optional</text>
-    <text xml:lang="ro" lang3="ron">Opţional</text>
-    <text xml:lang="fr" lang3="fra">Optionel</text>
-    <text xml:lang="pt" lang3="por">Opcional</text>
-    <text xml:lang="es" lang3="spa">Opcional</text>
-    <text xml:lang="it" lang3="ita">Opzionale</text>
-    <text xml:lang="sl" lang3="slv">Neobvezen</text>
-    <text xml:lang="sv" lang3="swe">Valfri</text>
-    <text xml:lang="no" lang3="nor">Valgfritt</text>
-    <text xml:lang="zh-TW">非必備的</text>
-    <text xml:lang="sr" lang3="srp">Neobavezan</text>
-    <text xml:lang="ja" lang3="jpn">任意</text>
-    <text xml:lang="pl" lang3="pol">Opcjonalny</text>
-    <text xml:lang="hi" lang3="hin">vaikalpika</text>
-    <text xml:lang="th" lang3="tha">ตัวเลือก</text>
-    <text xml:lang="nl" lang3="nld">Optioneel</text>
-    <text xml:lang="ru" lang3="rus">Факультативный</text>
-    <text xml:lang="tr" lang3="tur">Seçmeli</text>
-    <text xml:lang="bg" lang3="bul">Незадължителен</text>
-    <text xml:lang="el" lang3="ell">Προαιρετικός</text>
-    <text xml:lang="ca" lang3="cat">Opcional</text>
-    <text xml:lang="la" lang3="lat">Si libet</text>
-    <text xml:lang="hr" lang3="hrv">Po želji</text>
-    <text xml:lang="ko" lang3="kor">수의적</text>
-  </entry>
-  <entry>
-    <entry>
-      <key>Required</key>
-      <text xml:lang="en" lang3="eng">Required</text>
-      <text xml:lang="de" lang3="deu">Obligatorisch</text>
-      <text xml:lang="ro" lang3="ron">Obligatoriu</text>
-      <text xml:lang="fr" lang3="fra">Requis</text>
-      <text xml:lang="pt" lang3="por">Obrigatório</text>
-      <text xml:lang="es" lang3="spa">Necesario</text>
-      <text xml:lang="it" lang3="ita">Richiesto</text>
-      <text xml:lang="sl" lang3="slv">Zahtevan</text>
-      <text xml:lang="sv" lang3="swe">Nödvändig</text>
-      <text xml:lang="no" lang3="nor">Obligatorisk</text>
-      <text xml:lang="zh-TW">必備的</text>
-      <text xml:lang="sr" lang3="srp">Tražen</text>
-      <text xml:lang="ja" lang3="jpn">必須</text>
-      <text xml:lang="pl" lang3="pol">Wymagany</text>
-      <text xml:lang="hi" lang3="hin">Avashyaka</text>
-      <text xml:lang="th" lang3="tha">ต้องการข้อมูล</text>
-      <text xml:lang="nl" lang3="nld">Verplicht</text>
-      <text xml:lang="ru" lang3="rus">Обязательный</text>
-      <text xml:lang="tr" lang3="tur">Gerekli</text>
-      <text xml:lang="bg" lang3="bul">Задължителен</text>
-      <text xml:lang="el" lang3="ell">Απαραίτητος</text>
-      <text xml:lang="ca" lang3="cat">Requerit</text>
-      <text xml:lang="la" lang3="lat">Necessarium</text>
-      <text xml:lang="hr" lang3="hrv">Obavezno</text>
-      <text xml:lang="ko" lang3="kor">필수적</text>
-    </entry>
-    <key>Recommended</key>
-    <text xml:lang="en" lang3="eng">Recommended</text>
-    <text xml:lang="de" lang3="deu">Empfohlen</text>
-    <text xml:lang="ro" lang3="ron">Recomandat</text>
-    <text xml:lang="fr" lang3="fra">Recommendé</text>
-    <text xml:lang="pt" lang3="por">Recomendado</text>
-    <text xml:lang="es" lang3="spa">Recomendado</text>
-    <text xml:lang="it" lang3="ita">Consigliato</text>
-    <text xml:lang="sl" lang3="slv">Priporočen</text>
-    <text xml:lang="sv" lang3="swe">Rekommenderad</text>
-    <text xml:lang="no" lang3="nor">Anbefalt</text>
-    <text xml:lang="zh-TW">推薦的</text>
-    <text xml:lang="sr" lang3="srp">Preporučen</text>
-    <text xml:lang="ja" lang3="jpn">推薦される</text>
-    <text xml:lang="pl" lang3="pol">Zalecany</text>
-    <text xml:lang="hi" lang3="hin">svIkArniYa</text>
-    <text xml:lang="th" lang3="tha">คำแนะนำ</text>
-    <text xml:lang="nl" lang3="nld">Aanbevolen</text>
-    <text xml:lang="ru" lang3="rus">Рекомендуемый</text>
-    <text xml:lang="tr" lang3="tur">Önerilen</text>
-    <text xml:lang="bg" lang3="bul">Препоръчителен</text>
-    <text xml:lang="el" lang3="ell">Συστημένος</text>
-    <text xml:lang="ca" lang3="cat">Recomanat</text>
-    <text xml:lang="la" lang3="lat">Commendata</text>
-    <text xml:lang="hr" lang3="hrv">Preporučeno</text>
-    <text xml:lang="ko" lang3="kor">권고적</text>
-  </entry>
-  <entry>
-    <key>Recommended when applicable</key>
-    <text xml:lang="en" lang3="eng">Recommended when applicable</text>
-    <text xml:lang="de" lang3="deu">Empfohlen wenn zutreffend</text>
-    <text xml:lang="ro" lang3="ron">Recomandat dacă se potriveşte</text>
-    <text xml:lang="fr" lang3="fra">Recommendé quand applicable</text>
-    <text xml:lang="pt" lang3="por">Recomendado quando aplicável</text>
-    <text xml:lang="es" lang3="spa">Recomendado cuando se aplica</text>
-    <text xml:lang="it" lang3="ita">Consigliato se applicabile</text>
-    <text xml:lang="sl" lang3="slv">Priporočen, če ustreza</text>
-    <text xml:lang="sv" lang3="swe">Rekommenderad om användbar</text>
-    <text xml:lang="no" lang3="nor">Anbefalt når aktuelt</text>
-    <text xml:lang="zh-TW">可應用時推薦應用</text>
-    <text xml:lang="sr" lang3="srp">Preporučen, ako se može primeniti</text>
-    <text xml:lang="ja" lang3="jpn">利用できる場合は推奨．</text>
-    <text xml:lang="pl" lang3="pol">Zalecany w stosownych przypadkach</text>
-    <text xml:lang="hi" lang3="hin">Avashyaka JaHa uchita</text>
-    <text xml:lang="th" lang3="tha">ต้องการข้อมูลเมื่อสมัคร</text>
-    <text xml:lang="nl" lang3="nld">Aanbevolen indien van toepassing</text>
-    <text xml:lang="ca" lang3="cat">Recomanat quan siga possible</text>
-    <text xml:lang="la" lang3="lat">Commendata in loco proprio</text>
-    <text xml:lang="hr" lang3="hrv">Preporučeno na odgovarajućem mjestu</text>
-    <text xml:lang="ru" lang3="rus">Желателен, если применим</text>
-    <text xml:lang="tr" lang3="tur">Önerilen gereken</text>
-    <text xml:lang="bg" lang3="bul">Препоръчителен, където е приложим</text>
-    <text xml:lang="el" lang3="ell">Συνιστώμενος αν είναι εφαρμόσιμος</text>
-  </entry>
+	<codes>
+		<code xml:lang="hr" lang3="hrv">
+			<desc>Croatian</desc>
+			<name>Neven Jovanović</name>
+			<email>neven.jovanovic@ffzg.hr</email>
+		</code>
+		<code xml:lang="ko" lang3="kor">
+			<desc>Korean</desc>
+			<name>Beom-mo Kang</name>
+			<email>bmkang@korea.ac.kr</email>
+		</code>
+		<code xml:lang="la" lang3="lat">
+			<desc>Latin</desc>
+			<name>Neven Jovanović</name>
+			<email>neven.jovanovic@ffzg.hr</email>
+		</code>
+		<code xml:lang="ru" lang3="rus">
+			<desc>Russian</desc>
+			<name>Ivan A Derzhanski</name>
+			<email>iad@math.bas.bg</email>
+		</code>
+		<code xml:lang="tr" lang3="tur">
+			<desc>Turkish</desc>
+			<name>Ivan A Derzhanski</name>
+			<email>iad@math.bas.bg</email>
+		</code>
+		<code xml:lang="el" lang3="ell">
+			<desc>Greek</desc>
+			<name>Ivan A Derzhanski</name>
+			<email>iad@math.bas.bg</email>
+		</code>
+		<code xml:lang="bg" lang3="bul">
+			<desc>Bulgarian</desc>
+			<name>Ivan A Derzhanski</name>
+			<email>iad@math.bas.bg</email>
+		</code>
+		<code xml:lang="nl" lang3="nld">
+			<desc>Dutch</desc>
+			<name>Bert Van Elsacker</name>
+			<email>bertvanelsacker@yahoo.com</email>
+		</code>
+		<code xml:lang="de" lang3="deu">
+			<desc>German</desc>
+			<name>Christian Wittern, Torsten Schassan </name>
+			<email>wittern@kanji.zinbun.kyoto-u.ac.jp,schassan@hab.de</email>
+		</code>
+		<code xml:lang="ja" lang3="jpn">
+			<desc>Japanese</desc>
+			<name>Christian Wittern and Ohya Kazushi</name>
+			<email>wittern@kanji.zinbun.kyoto-u.ac.jp,ohyakazushi@gmail.com</email>
+		</code>
+		<code xml:lang="ro" lang3="ron">
+			<desc>Romanian</desc>
+			<name>Adrian Dimulescu</name>
+			<email>adrian.dimulescu@free.fr</email>
+		</code>
+		<code xml:lang="fr" lang3="fra">
+			<desc>French</desc>
+			<name>Laurent Romary</name>
+			<email>Laurent.Romary@loria.fr</email>
+		</code>
+		<code xml:lang="pt" lang3="por">
+			<desc>Portuguese</desc>
+			<name>Leonor Barroca</name>
+			<email>l.barroca@open.ac.uk</email>
+		</code>
+		<code xml:lang="es" lang3="spa">
+			<desc>Spanish</desc>
+			<name>Carmen Arronis Llopis</name>
+			<email>arronis@ua.es</email>
+		</code>
+		<code xml:lang="it" lang3="ita">
+			<desc>Italian</desc>
+			<name>Fabio Ciotti, Arianna Ciula, Elena Pierazzo</name>
+			<email>fabio.ciott@uniroma1.it</email>
+		</code>
+		<code xml:lang="sl" lang3="slv">
+			<desc>Slovenian</desc>
+			<name>Matija Ogrin</name>
+			<email>matija.ogrin@zrc-sazu.si</email>
+		</code>
+		<code xml:lang="pl" lang3="pol">
+			<desc>Polish</desc>
+			<name>Radosław Moszczyński</name>
+			<email>r.moszczynski@uw.edu.pl</email>
+		</code>
+		<code xml:lang="sv" lang3="swe">
+			<desc>Swedish</desc>
+			<name>Monica Langerth Zetterman and Matthew Zimmerman</name>
+			<email>monica.langerth@ped.uu.se,matthew.zimmerman@nyu.edu</email>
+		</code>
+		<code xml:lang="no" lang3="nor">
+			<desc>Norwegian</desc>
+			<name>Øyvind Eide</name>
+			<email>oyvind.eide@muspro.uio.no</email>
+		</code>
+		<code xml:lang="zh-TW">
+			<desc>Chinese</desc>
+			<name>Marcus Bingenheimer</name>
+			<email>m.bingenheimer@gmail.com</email>
+		</code>
+		<code xml:lang="sr" lang3="srp">
+			<desc>Serbian</desc>
+			<name>Cvetana Krstev</name>
+			<email>cvetana@poincare.matf.bg.ac.yu</email>
+		</code>
+		<code xml:lang="hi" lang3="hin">
+			<desc>Hindi</desc>
+			<name>Paul Richards</name>
+			<email>paul.richards@ugs.com</email>
+		</code>
+		<code xml:lang="th" lang3="tha">
+			<desc>Thai</desc>
+			<name>Mananya Patamasoontorn</name>
+			<email>mananyap@hotmail.com</email>
+		</code>
+		<code xml:lang="ca" lang3="cat">
+			<desc>Catalan</desc>
+			<name>Mikel L. Forcada</name>
+			<email>mlf@dlsi.ua.es</email>
+		</code>
+	</codes>
+	<entry>
+		<key>TEI</key>
+		<text xml:lang="en" lang3="eng">Text Encoding Initiative</text>
+		<text xml:lang="de" lang3="deu">Text Encoding Initiative</text>
+		<text xml:lang="ro" lang3="ron">Iniţiativa de Codificare a Textului</text>
+		<text xml:lang="pt" lang3="por">Iniciativa de Codificação de Texto</text>
+		<text xml:lang="es" lang3="spa">Iniciativa de Codificación de Textos</text>
+		<text xml:lang="it" lang3="ita">Text Encoding Initiative</text>
+		<text xml:lang="sv" lang3="swe">Text Encoding Initiative</text>
+		<text xml:lang="no" lang3="nor">Text Encoding Initiative</text>
+		<text xml:lang="sr" lang3="srp">Podsticaj obeležavanju teksta</text>
+		<text xml:lang="pl" lang3="pol">Inicjatywa Kodowania Tekstów</text>
+		<text xml:lang="hi" lang3="hin">viShaya anuvAda prathama kAryavAhI</text>
+		<text xml:lang="th" lang3="tha">รหัสวิชา</text>
+		<text xml:lang="nl" lang3="nld">Tekstcoderingsinitiatief</text>
+		<text xml:lang="ru" lang3="rus">Инициатива по кодированию текстов</text>
+		<text xml:lang="tr" lang3="tur">Metin Kodlaması Girişimi</text>
+		<text xml:lang="bg" lang3="bul">Инициатива за кодиране на текстове</text>
+		<text xml:lang="el" lang3="ell">Πρωτοβουλία για την Κωδικοποίησης
+			Κειμενών</text>
+		<text xml:lang="ca" lang3="cat">Iniciativa de Codificació de Textos</text>
+		<text xml:lang="la" lang3="lat">Stimulus textibus annotandis</text>
+		<text xml:lang="hr" lang3="hrv">Inicijativa za obilježavanje tekstova</text>
+		<text xml:lang="ko" lang3="kor">텍스트 부호화 주도</text>
+	</entry>
+	<entry>
+		<key>Attributes</key>
+		<text xml:lang="en" lang3="eng">Attributes</text>
+		<text xml:lang="de" lang3="deu">Attribute</text>
+		<text xml:lang="ro" lang3="ron">Atribute</text>
+		<text xml:lang="fr" lang3="fra">Attributs</text>
+		<text xml:lang="pt" lang3="por">Atributos</text>
+		<text xml:lang="es" lang3="spa">Atributos</text>
+		<text xml:lang="it" lang3="ita">Attributi</text>
+		<text xml:lang="sl" lang3="slv">Atributi</text>
+		<text xml:lang="sv" lang3="swe">Attribut</text>
+		<text xml:lang="no" lang3="nor">Attributt</text>
+		<text xml:lang="zh-TW">屬性</text>
+		<text xml:lang="sr" lang3="srp">Atributi</text>
+		<text xml:lang="ja" lang3="jpn">属性</text>
+		<text xml:lang="pl" lang3="pol">Atrybuty</text>
+		<text xml:lang="hi" lang3="hin">guNa</text>
+		<text xml:lang="th" lang3="tha">คุณสมบัติ</text>
+		<text xml:lang="nl" lang3="nld">Attributen</text>
+		<text xml:lang="ru" lang3="rus">Атрибуты</text>
+		<text xml:lang="tr" lang3="tur">Öznitelikler</text>
+		<text xml:lang="bg" lang3="bul">Атрибути</text>
+		<text xml:lang="el" lang3="ell">Χαρακτηριστικά</text>
+		<text xml:lang="ca" lang3="cat">Atributs</text>
+		<text xml:lang="la" lang3="lat">Attributa</text>
+		<text xml:lang="hr" lang3="hrv">Atributi</text>
+		<text xml:lang="ko" lang3="kor">속성</text>
+	</entry>
+	<entry>
+		<key>Class</key>
+		<text xml:lang="en" lang3="eng">Class</text>
+		<text xml:lang="de" lang3="deu">Klasse</text>
+		<text xml:lang="ro" lang3="ron">Clasă</text>
+		<text xml:lang="fr" lang3="fra">Classe</text>
+		<text xml:lang="pt" lang3="por">Classe</text>
+		<text xml:lang="es" lang3="spa">Clase</text>
+		<text xml:lang="it" lang3="ita">Classe</text>
+		<text xml:lang="sl" lang3="slv">Razred</text>
+		<text xml:lang="sv" lang3="swe">Klass</text>
+		<text xml:lang="no" lang3="nor">Klasse</text>
+		<text xml:lang="zh-TW">分類</text>
+		<text xml:lang="sr" lang3="srp">Klasa</text>
+		<text xml:lang="ja" lang3="jpn">クラス</text>
+		<text xml:lang="pl" lang3="pol">Klasa</text>
+		<text xml:lang="hi" lang3="hin">shreNI</text>
+		<text xml:lang="th" lang3="tha">ชั้นเรียน</text>
+		<text xml:lang="nl" lang3="nld">Klasse</text>
+		<text xml:lang="ru" lang3="rus">Класс</text>
+		<text xml:lang="tr" lang3="tur">Sınıf</text>
+		<text xml:lang="bg" lang3="bul">Клас</text>
+		<text xml:lang="el" lang3="ell">Κλάση</text>
+		<text xml:lang="ca" lang3="cat">Classe</text>
+		<text xml:lang="la" lang3="lat">Classis</text>
+		<text xml:lang="hr" lang3="hrv">Razred</text>
+		<text xml:lang="ko" lang3="kor">부류</text>
+	</entry>
+	<entry>
+		<key>Classes defined</key>
+		<text xml:lang="en" lang3="eng">Classes defined</text>
+		<text xml:lang="de" lang3="deu">Definierte Klassen</text>
+		<text xml:lang="ro" lang3="ron">Clase definite</text>
+		<text xml:lang="fr" lang3="fra">Classes définies</text>
+		<text xml:lang="pt" lang3="por">Classes definidas</text>
+		<text xml:lang="es" lang3="spa">Clases definidas</text>
+		<text xml:lang="it" lang3="ita">Classi definite</text>
+		<text xml:lang="sl" lang3="slv">Definirani razredi</text>
+		<text xml:lang="sv" lang3="swe">Definierade klasser</text>
+		<text xml:lang="no" lang3="nor">Definerte klasser klasser</text>
+		<text xml:lang="zh-TW">被定義的分類</text>
+		<text xml:lang="sr" lang3="srp">Definisane klase</text>
+		<text xml:lang="ja" lang3="jpn">定義済みクラス</text>
+		<text xml:lang="pl" lang3="pol">Zdefiniowane klasy</text>
+		<text xml:lang="hi" lang3="hin">Paribashith shreNI</text>
+		<text xml:lang="th" lang3="tha">หมายเลขชั้นเรียน</text>
+		<text xml:lang="nl" lang3="nld">Gedefinieerde klassen</text>
+		<text xml:lang="ru" lang3="rus">Описанные классы</text>
+		<text xml:lang="tr" lang3="tur">Tanımlı sınıflar</text>
+		<text xml:lang="bg" lang3="bul">Описани класове</text>
+		<text xml:lang="el" lang3="ell">Οριζόμενες κλάσες</text>
+		<text xml:lang="ca" lang3="cat">Classes definides</text>
+		<text xml:lang="la" lang3="lat">Classes definitae</text>
+		<text xml:lang="hr" lang3="hrv">Definirani razredi</text>
+		<text xml:lang="ko" lang3="kor">정의 부류</text>
+	</entry>
+	<entry>
+		<key>Datatype</key>
+		<text xml:lang="en" lang3="eng">Datatype</text>
+		<text xml:lang="de" lang3="deu">Datentyp</text>
+		<text xml:lang="ro" lang3="ron">Tipuri de date</text>
+		<text xml:lang="fr" lang3="fra">Type de données</text>
+		<text xml:lang="pt" lang3="por">Tipo de Dados</text>
+		<text xml:lang="es" lang3="spa">Tipo de datos</text>
+		<text xml:lang="it" lang3="ita">Tipo di dati</text>
+		<text xml:lang="sl" lang3="slv">Podatkovni tip</text>
+		<text xml:lang="sv" lang3="swe">Datatyp</text>
+		<text xml:lang="no" lang3="nor">Datatype</text>
+		<text xml:lang="zh-TW">資料類型</text>
+		<text xml:lang="sr" lang3="srp">Podatkovni tip</text>
+		<text xml:lang="ja" lang3="jpn">データ型</text>
+		<text xml:lang="pl" lang3="pol">Typ danych</text>
+		<text xml:lang="hi" lang3="hin">NirDishta varga</text>
+		<text xml:lang="th" lang3="tha">ชนิดของข้อมูล</text>
+		<text xml:lang="nl" lang3="nld">Datatype</text>
+		<text xml:lang="ru" lang3="rus">Тип данных</text>
+		<text xml:lang="tr" lang3="tur">Veri Türü</text>
+		<text xml:lang="bg" lang3="bul">Тип данни</text>
+		<text xml:lang="el" lang3="ell">Τύπος δεδομένων</text>
+		<text xml:lang="ca" lang3="cat">Tipus de dades</text>
+		<text xml:lang="la" lang3="lat">Datorum qualitas</text>
+		<text xml:lang="hr" lang3="hrv">Vrsta podataka</text>
+		<text xml:lang="ko" lang3="kor">자료 유형</text>
+	</entry>
+	<entry>
+		<key>Declaration</key>
+		<text xml:lang="en" lang3="eng">Declaration</text>
+		<text xml:lang="de" lang3="deu">Deklaration</text>
+		<text xml:lang="ro" lang3="ron">Declaraţie</text>
+		<text xml:lang="fr" lang3="fra">Declaration</text>
+		<text xml:lang="pt" lang3="por">Declaração</text>
+		<text xml:lang="es" lang3="spa">Declaración</text>
+		<text xml:lang="it" lang3="ita">Dichiarazione</text>
+		<text xml:lang="sl" lang3="slv">Deklaracija</text>
+		<text xml:lang="sv" lang3="swe">Deklaration</text>
+		<text xml:lang="no" lang3="nor">Deklarasjon</text>
+		<text xml:lang="zh-TW">宣告</text>
+		<text xml:lang="sr" lang3="srp">Deklaracija</text>
+		<text xml:lang="ja" lang3="jpn">宣言</text>
+		<text xml:lang="pl" lang3="pol">Deklaracja</text>
+		<text xml:lang="hi" lang3="hin">ghoShaNA</text>
+		<text xml:lang="th" lang3="tha">คำประกาศ</text>
+		<text xml:lang="nl" lang3="nld">Declaratie</text>
+		<text xml:lang="ru" lang3="rus">Описание</text>
+		<text xml:lang="tr" lang3="tur">Bildirim</text>
+		<text xml:lang="bg" lang3="bul">Декларация</text>
+		<text xml:lang="el" lang3="ell">Δήλωση</text>
+		<text xml:lang="ca" lang3="cat">Declaració</text>
+		<text xml:lang="la" lang3="lat">Declaratio</text>
+		<text xml:lang="hr" lang3="hrv">Deklaracija</text>
+		<text xml:lang="ko" lang3="kor">선언</text>
+	</entry>
+	<entry>
+		<key>Default</key>
+		<text xml:lang="en" lang3="eng">Default</text>
+		<text xml:lang="de" lang3="deu">Vorgabe</text>
+		<text xml:lang="ro" lang3="ron">Implicit</text>
+		<text xml:lang="fr" lang3="fra">Valeur par défaut</text>
+		<text xml:lang="pt" lang3="por">Valor por defeito</text>
+		<text xml:lang="es" lang3="spa">Por defecto</text>
+		<text xml:lang="it" lang3="ita">Valore di default</text>
+		<text xml:lang="sl" lang3="slv">Privzeta vrednost</text>
+		<text xml:lang="sv" lang3="swe">Standard</text>
+		<text xml:lang="no" lang3="nor">Standard</text>
+		<text xml:lang="zh-TW">預設值</text>
+		<text xml:lang="sr" lang3="srp">Pretpostavljena vrednost</text>
+		<text xml:lang="ja" lang3="jpn">初期値</text>
+		<text xml:lang="pl" lang3="pol">Wartość domyślna</text>
+		<text xml:lang="hi" lang3="hin">aparAdha</text>
+		<text xml:lang="th" lang3="tha">ค่าตั้งเริ่มต้น</text>
+		<text xml:lang="nl" lang3="nld">Defaultwaarde</text>
+		<text xml:lang="ru" lang3="rus">Величина по умолчанию</text>
+		<text xml:lang="tr" lang3="tur">Varsayılan</text>
+		<text xml:lang="bg" lang3="bul">Стойност по подразбиране</text>
+		<text xml:lang="el" lang3="ell">Προεπιλεγμένη τιμή</text>
+		<text xml:lang="ca" lang3="cat">Implícit</text>
+		<text xml:lang="la" lang3="lat">Valores implicitae</text>
+		<text xml:lang="hr" lang3="hrv">Polazne vrijednosti</text>
+		<text xml:lang="ko" lang3="kor">기본값</text>
+	</entry>
+	<entry>
+		<key>Element</key>
+		<text xml:lang="en" lang3="eng">Element</text>
+		<text xml:lang="de" lang3="deu">Element</text>
+		<text xml:lang="ro" lang3="ron">Element</text>
+		<text xml:lang="fr" lang3="fra">Elément</text>
+		<text xml:lang="pt" lang3="por">Elemento</text>
+		<text xml:lang="es" lang3="spa">Elemento</text>
+		<text xml:lang="it" lang3="ita">Elemento</text>
+		<text xml:lang="sl" lang3="slv">Element</text>
+		<text xml:lang="sv" lang3="swe">Element</text>
+		<text xml:lang="no" lang3="nor">Element</text>
+		<text xml:lang="zh-TW">元素</text>
+		<text xml:lang="sr" lang3="srp">Element</text>
+		<text xml:lang="ja" lang3="jpn">要素</text>
+		<text xml:lang="pl" lang3="pol">Element</text>
+		<text xml:lang="hi" lang3="hin">mUla</text>
+		<text xml:lang="nl" lang3="nld">Element</text>
+		<text xml:lang="ru" lang3="rus">Элемент</text>
+		<text xml:lang="tr" lang3="tur">Öğe</text>
+		<text xml:lang="bg" lang3="bul">Елемент</text>
+		<text xml:lang="el" lang3="ell">Στοιχείο</text>
+		<text xml:lang="ca" lang3="cat">Element</text>
+		<text xml:lang="la" lang3="lat">Elementum</text>
+		<text xml:lang="hr" lang3="hrv">Element</text>
+		<text xml:lang="ko" lang3="kor">요소</text>
+	</entry>
+	<entry>
+		<key>Elements defined</key>
+		<text xml:lang="en" lang3="eng">Elements defined</text>
+		<text xml:lang="de" lang3="deu">Definierte Elemente</text>
+		<text xml:lang="ro" lang3="ron">Elemente definite</text>
+		<text xml:lang="fr" lang3="fra">Eléments définis</text>
+		<text xml:lang="pt" lang3="por">Elementos definidos</text>
+		<text xml:lang="es" lang3="spa">Elementos definidos</text>
+		<text xml:lang="it" lang3="ita">Elementi definiti</text>
+		<text xml:lang="sl" lang3="slv">Definirani elementi</text>
+		<text xml:lang="sv" lang3="swe">Definierade element</text>
+		<text xml:lang="no" lang3="nor">Definerte elementer</text>
+		<text xml:lang="zh-TW">被定義的元素</text>
+		<text xml:lang="sr" lang3="srp">Definisani elementi</text>
+		<text xml:lang="ja" lang3="jpn">定義済み要素</text>
+		<text xml:lang="pl" lang3="pol">Zdefiniowane elementy</text>
+		<text xml:lang="hi" lang3="hin">Paribhasith Mula</text>
+		<text xml:lang="th" lang3="tha">ระบุเนื้อหา</text>
+		<text xml:lang="nl" lang3="nld">Gedefinieerde elementen</text>
+		<text xml:lang="ru" lang3="rus">Описанные элементы</text>
+		<text xml:lang="tr" lang3="tur">Tanımlı öğeler</text>
+		<text xml:lang="bg" lang3="bul">Описани елементи</text>
+		<text xml:lang="el" lang3="ell">Οριζόμενα στοιχεία</text>
+		<text xml:lang="ca" lang3="cat">Elements definits</text>
+		<text xml:lang="la" lang3="lat">Elementa definita</text>
+		<text xml:lang="hr" lang3="hrv">Definirani elementi</text>
+		<text xml:lang="ko" lang3="kor">정의 요소</text>
+	</entry>
+	<entry>
+		<key>Example</key>
+		<text xml:lang="en" lang3="eng">Example</text>
+		<text xml:lang="de" lang3="deu">Beispiel</text>
+		<text xml:lang="ro" lang3="ron">Exemplu</text>
+		<text xml:lang="fr" lang3="fra">Exemple</text>
+		<text xml:lang="pt" lang3="por">Exemplo</text>
+		<text xml:lang="es" lang3="spa">Ejemplo</text>
+		<text xml:lang="it" lang3="ita">Esempio</text>
+		<text xml:lang="sl" lang3="slv">Primer</text>
+		<text xml:lang="sv" lang3="swe">Exempel</text>
+		<text xml:lang="no" lang3="nor">Eksempel</text>
+		<text xml:lang="zh-TW">例子</text>
+		<text xml:lang="sr" lang3="srp">Primer</text>
+		<text xml:lang="ja" lang3="jpn">例</text>
+		<text xml:lang="pl" lang3="pol">Przykład</text>
+		<text xml:lang="hi" lang3="hin">udAharaNa</text>
+		<text xml:lang="th" lang3="tha">ตัวอย่าง</text>
+		<text xml:lang="nl" lang3="nld">Voorbeeld</text>
+		<text xml:lang="ru" lang3="rus">Пример</text>
+		<text xml:lang="tr" lang3="tur">Örnek</text>
+		<text xml:lang="bg" lang3="bul">Пример</text>
+		<text xml:lang="el" lang3="ell">Παράδειγμα</text>
+		<text xml:lang="ca" lang3="cat">Exemple</text>
+		<text xml:lang="la" lang3="lat">Exemplum</text>
+		<text xml:lang="hr" lang3="hrv">Primjer</text>
+		<text xml:lang="ko" lang3="kor">예</text>
+	</entry>
+	<entry>
+		<key>Global attributes and those inherited from</key>
+		<text xml:lang="es" lang3="spa">Atributos globales y los heredados de</text>
+		<text xml:lang="ca" lang3="cat">Atributs globals i els heretats de</text>
+		<text xml:lang="en" lang3="eng">Global attributes and those inherited
+			from</text>
+		<text xml:lang="de" lang3="deu">Global gültige Attribute und solche
+			ererbt von ...</text>
+		<text xml:lang="ro" lang3="ron">Atributele globale şi cele moştenite
+			din</text>
+		<text xml:lang="fr" lang3="fra">Attributs globaux et hérités</text>
+		<text xml:lang="pt" lang3="por">Atributos globais e herdados de...</text>
+		<text xml:lang="it" lang3="ita">Attributi globali e quelli ereditati da</text>
+		<text xml:lang="sl" lang3="slv">Globalni atributi in tisti, sprejeti iz</text>
+		<text xml:lang="sv" lang3="swe">Globala attribut samt de som ärvts från</text>
+		<text xml:lang="no" lang3="nor">Globale attributter og de som arves fra</text>
+		<text xml:lang="zh-TW">全域屬性和從...繼承的屬性</text>
+		<text xml:lang="sr" lang3="srp">Globalni atributi i atributi koji se
+			nasledjuju</text>
+		<text xml:lang="ja" lang3="jpn">グローバル属性または継承した属性</text>
+		<text xml:lang="pl" lang3="pol">Atrybuty globalne i odziedziczone po...</text>
+		<text xml:lang="hi" lang3="hin">Vishva Guna Aur Jinmese Adhikara Paya</text>
+		<text xml:lang="th" lang3="tha">คุณสมบัติโดยรวมและที่เทียบโอนมา</text>
+		<text xml:lang="nl" lang3="nld">Globale attributen en attributen geërfd
+			van</text>
+		<text xml:lang="ru" lang3="rus">Глобальные атрибуты и атрибуты,
+			унаследованные от</text>
+		<text xml:lang="tr" lang3="tur">Genel ve ~'dan kalıtsal öznitelikler</text>
+		<text xml:lang="bg" lang3="bul">Глобални атрибути и атрибути, наследени
+			от</text>
+		<text xml:lang="el" lang3="ell">Χαρακτηριστικά καθολικά και κληρονομικά
+			από</text>
+		<text xml:lang="ca" lang3="cat">Atributs globals i aquells heretats de</text>
+		<text xml:lang="la" lang3="lat">Attributa universalia et haereditaria</text>
+		<text xml:lang="hr" lang3="hrv">Globalni i naslijeđeni atributi</text>
+		<text xml:lang="ko" lang3="kor">전반적 속성 및 상속 속성</text>
+	</entry>
+	<entry>
+		<key>Global attributes only</key>
+		<text xml:lang="ca" lang3="cat">A més dels atributs globals i dels
+			heretats de</text>
+		<text xml:lang="en" lang3="eng">Global attributes only</text>
+		<text xml:lang="de" lang3="deu">Nur global gültige Attribute</text>
+		<text xml:lang="ro" lang3="ron">Numai atributele globale</text>
+		<text xml:lang="fr" lang3="fra">Attributs globaux seulement</text>
+		<text xml:lang="pt" lang3="por">Só atributos globais</text>
+		<text xml:lang="es" lang3="spa">Solo atributos globales</text>
+		<text xml:lang="it" lang3="ita">Solo attributi globali</text>
+		<text xml:lang="sl" lang3="slv">Samo globalni atributi</text>
+		<text xml:lang="sv" lang3="swe">Endast globala attribut</text>
+		<text xml:lang="no" lang3="nor">Kun globale attributter</text>
+		<text xml:lang="zh-TW">僅全域屬性</text>
+		<text xml:lang="sr" lang3="srp">Isključivo globalni atributi</text>
+		<text xml:lang="ja" lang3="jpn">グローバル属性のみ</text>
+		<text xml:lang="pl" lang3="pol">Wyłącznie atrybuty globalne</text>
+		<text xml:lang="hi" lang3="hin">Keval Vishva Guna</text>
+		<text xml:lang="th" lang3="tha">คุณสมบัติโดยรวมเท่านั้น</text>
+		<text xml:lang="nl" lang3="nld">Enkel globale attributen</text>
+		<text xml:lang="ru" lang3="rus">Только глобальные атрибуты</text>
+		<text xml:lang="tr" lang3="tur">Sadece genel öznitelikler</text>
+		<text xml:lang="bg" lang3="bul">Само глобални атрибути</text>
+		<text xml:lang="el" lang3="ell">Μόνο καθολικά χαρακτηριστικά</text>
+		<text xml:lang="ca" lang3="cat">Només atributs globals</text>
+		<text xml:lang="la" lang3="lat">Attributa universalia tantum</text>
+		<text xml:lang="hr" lang3="hrv">Samo globalni atributi</text>
+		<text xml:lang="ko" lang3="kor">전체 속성만 허용</text>
+	</entry>
+	<entry>
+		<key>In addition to global attributes</key>
+		<text xml:lang="ca" lang3="cat">Els valors suggerits inclouen</text>
+		<text xml:lang="en" lang3="eng">In addition to global attributes</text>
+		<text xml:lang="de" lang3="deu">Neben global gültigen Attributen</text>
+		<text xml:lang="ro" lang3="ron">În plus faţă de atributele globale</text>
+		<text xml:lang="fr" lang3="fra">En complément des attributs globaux</text>
+		<text xml:lang="pt" lang3="por">Para além de atributos globais</text>
+		<text xml:lang="es" lang3="spa">Además de los atributos globales</text>
+		<text xml:lang="it" lang3="ita">Oltre agli attributi globali</text>
+		<text xml:lang="sl" lang3="slv">Poleg globalnih atributov</text>
+		<text xml:lang="sv" lang3="swe">Förutom globala attribut</text>
+		<text xml:lang="no" lang3="nor">I tillegg til globale attributter</text>
+		<text xml:lang="zh-TW">除全域屬性以外</text>
+		<text xml:lang="sr" lang3="srp">Pored globalnih atributa</text>
+		<text xml:lang="ja" lang3="jpn">グローバル属性の他</text>
+		<text xml:lang="pl" lang3="pol">Oprócz atrybutów globalnych</text>
+		<text xml:lang="hi" lang3="hin">Vishva Guna Ke Alava</text>
+		<text xml:lang="th" lang3="tha">คุณสมบัติโดยรวมเพิ่มเติม</text>
+		<text xml:lang="nl" lang3="nld">Naast de globale attributen</text>
+		<text xml:lang="ru" lang3="rus">Вдобавок к глобальным атрибутам</text>
+		<text xml:lang="tr" lang3="tur">Genel özniteliklerden başka</text>
+		<text xml:lang="bg" lang3="bul">Освен глобалните атрибути</text>
+		<text xml:lang="el" lang3="ell">Πλήν των καθολικών χαρακτηριστικών</text>
+		<text xml:lang="ca" lang3="cat">A més dels atributs globals</text>
+		<text xml:lang="la" lang3="lat">Praeter attributa universalia</text>
+		<text xml:lang="hr" lang3="hrv">Uz globalne atribute</text>
+		<text xml:lang="ko" lang3="kor">전체 속성에 부가</text>
+	</entry>
+	<entry>
+		<key>In addition to global attributes and those inherited from</key>
+		<text xml:lang="en" lang3="eng">In addition to global attributes and
+			those inherited from</text>
+		<text xml:lang="de" lang3="deu">Neben global gültigen Attributen und
+			solchen ererbt von ...</text>
+		<text xml:lang="ro" lang3="ron">În plus faţă de atributele globale şi
+			de cele moştenite din</text>
+		<text xml:lang="fr" lang3="fra">En complément des attributs globaux et
+			hérités</text>
+		<text xml:lang="pt" lang3="por">Para além de atributos globais e
+			herdados de...</text>
+		<text xml:lang="it" lang3="ita">Oltre agli attributi globali e a quelli
+			ereditati da</text>
+		<text xml:lang="sl" lang3="slv">Poleg globalnih atributov in tistih,
+			sprejetih iz</text>
+		<text xml:lang="sv" lang3="swe">Förutom globala attribut samt de som
+			ärvts från</text>
+		<text xml:lang="no" lang3="nor">I tillegg til globale attributter og de
+			som arves fra</text>
+		<text xml:lang="zh-TW">除全域屬性和從...繼承的屬性以外</text>
+		<text xml:lang="sr" lang3="srp">Pored globalnih atributa i onih koji se
+			nasledjuju</text>
+		<text xml:lang="ja" lang3="jpn">グローバル属性または継承した属性の他</text>
+		<text xml:lang="pl" lang3="pol">Oprócz atrybutów globalnych i
+			odziedziczonych po...</text>
+		<text xml:lang="hi" lang3="hin">Vishva Guna Ke Alava Aur Jinmese
+			Adhikara Paya</text>
+		<text xml:lang="th" lang3="tha">คุณสมบัติโดยรวมและที่เทียบโอนมาเพิ่มเติม</text>
+		<text xml:lang="nl" lang3="nld">Naast de globale attributen en de
+			attributen geërfd van</text>
+		<text xml:lang="ru" lang3="rus">Вдобавок к глобальным атрибутам и
+			атрибутам, унаследованным от</text>
+		<text xml:lang="tr" lang3="tur">Genel ve ~'dan kalıtsal özniteliklerden
+			başka</text>
+		<text xml:lang="bg" lang3="bul">Освен глобалните атрибути и атрибутите,
+			наследени от</text>
+		<text xml:lang="el" lang3="ell">Πλήν τωνχαρακτηριστικών καθολικών και
+			κληρονομικών από</text>
+		<text xml:lang="ca" lang3="cat">A més dels atributs globals i els
+			heretats de</text>
+		<text xml:lang="es" lang3="spa">Además de los atributos globales y los
+			heredados de</text>
+		<text xml:lang="ko" lang3="kor">&gt;전체 속성 및 상속 속성에 부가</text>
+	</entry>
+	<entry>
+		<key>Legal values are</key>
+		<text xml:lang="en" lang3="eng">Legal values are</text>
+		<text xml:lang="de" lang3="deu">Gültige Werte</text>
+		<text xml:lang="ro" lang3="ron">Valorile admise sunt</text>
+		<text xml:lang="fr" lang3="fra">Les valeurs autorisées sont</text>
+		<text xml:lang="pt" lang3="por">Valores permitidos são</text>
+		<text xml:lang="es" lang3="spa">Los valores admitidos son</text>
+		<text xml:lang="it" lang3="ita">I valori legali sono</text>
+		<text xml:lang="sl" lang3="slv">Veljavne vrednosti so</text>
+		<text xml:lang="sv" lang3="swe">Tillåtna värden är</text>
+		<text xml:lang="no" lang3="nor">Lovlige verdier er</text>
+		<text xml:lang="zh-TW">合法的值是</text>
+		<text xml:lang="sr" lang3="srp">Dozvoljene vrednosti su</text>
+		<text xml:lang="ja" lang3="jpn">正当な値</text>
+		<text xml:lang="pl" lang3="pol">Dozwolone wartości to</text>
+		<text xml:lang="hi" lang3="hin">niyamAnukUla guNa Hai</text>
+		<text xml:lang="th" lang3="tha">คุณค่าทางกฎหมายคือ</text>
+		<text xml:lang="nl" lang3="nld">Geldige waarden zijn</text>
+		<text xml:lang="ru" lang3="rus">Разрешенные величины:</text>
+		<text xml:lang="tr" lang3="tur">Geçerli değerler:</text>
+		<text xml:lang="bg" lang3="bul">Разрешените стойности са</text>
+		<text xml:lang="el" lang3="ell">Οι νόμιμες τιμές είναι</text>
+		<text xml:lang="ca" lang3="cat">Els valors permesos són</text>
+		<text xml:lang="la" lang3="lat">Valores permissae</text>
+		<text xml:lang="hr" lang3="hrv">Dozvoljene su vrijednosti</text>
+		<text xml:lang="ko" lang3="kor">적법한 값은</text>
+	</entry>
+	<entry>
+		<key>Macros defined</key>
+		<text xml:lang="en" lang3="eng">Macros defined</text>
+		<text xml:lang="de" lang3="deu">Definierte Makros</text>
+		<text xml:lang="ro" lang3="ron">Macrouri definite</text>
+		<text xml:lang="fr" lang3="fra">Macros définies</text>
+		<text xml:lang="pt" lang3="por">Macros definidas</text>
+		<text xml:lang="es" lang3="spa">Macros definidas</text>
+		<text xml:lang="it" lang3="ita">Macro definite</text>
+		<text xml:lang="sl" lang3="slv">Definirani makri</text>
+		<text xml:lang="sv" lang3="swe">Definierade makron</text>
+		<text xml:lang="no" lang3="nor">Definerete makroer</text>
+		<text xml:lang="zh-TW">被定義的巨指令</text>
+		<text xml:lang="sr" lang3="srp">Definisani makroi</text>
+		<text xml:lang="ja" lang3="jpn">定義済みマクロ</text>
+		<text xml:lang="pl" lang3="pol">Zdefiniowane makra</text>
+		<text xml:lang="th" lang3="tha">โคร</text>
+		<text xml:lang="nl" lang3="nld">Gedefinieerde macro's</text>
+		<text xml:lang="ru" lang3="rus">Определенные макросы</text>
+		<text xml:lang="tr" lang3="tur">Tanımlı makrolar</text>
+		<text xml:lang="bg" lang3="bul">Дефинирани макроси</text>
+		<text xml:lang="el" lang3="ell">Οριζόμενες μακροεντολές</text>
+		<text xml:lang="ca" lang3="cat">Macros definides</text>
+		<text xml:lang="la" lang3="lat">Macromandata definita</text>
+		<text xml:lang="hr" lang3="hrv">Definirane makronaredbe</text>
+		<text xml:lang="ko" lang3="kor">정의 크로</text>
+	</entry>
+	<entry>
+		<key>Mandatory when applicable</key>
+		<text xml:lang="en" lang3="eng">Mandatory when applicable</text>
+		<text xml:lang="de" lang3="deu">Obligatorisch wenn zutreffend</text>
+		<text xml:lang="ro" lang3="ron">Obligatoriu dacă se potriveşte</text>
+		<text xml:lang="fr" lang3="fra">Obligatoire quand applicable</text>
+		<text xml:lang="pt" lang3="por">Obrigatório quando aplicável</text>
+		<text xml:lang="es" lang3="spa">Obligatorios cuando se aplican</text>
+		<text xml:lang="it" lang3="ita">Obbligatorio se applicabile</text>
+		<text xml:lang="sl" lang3="slv">Obvezen, če ustreza</text>
+		<text xml:lang="sv" lang3="swe">Obligatorisk om användbar</text>
+		<text xml:lang="no" lang3="nor">Obligatorisk når aktuelt</text>
+		<text xml:lang="zh-TW">可應用時必備的</text>
+		<text xml:lang="sr" lang3="srp">Obavezan, ako se može primeniti</text>
+		<text xml:lang="ja" lang3="jpn">使えるならば必須</text>
+		<text xml:lang="pl" lang3="pol">Obowiązkowe w stosownych przypadkach</text>
+		<text xml:lang="hi" lang3="hin">anivArya JaHa uchita</text>
+		<text xml:lang="th" lang3="tha">ต้องได้รับการอนุมัติเมื่อสมัครเรียน</text>
+		<text xml:lang="nl" lang3="nld">Verplicht indien van toepassing</text>
+		<text xml:lang="ru" lang3="rus">Обязательный, если применим</text>
+		<text xml:lang="tr" lang3="tur">Uygulanabilirse zorunlu</text>
+		<text xml:lang="bg" lang3="bul">Задължителен, ако е приложим</text>
+		<text xml:lang="el" lang3="ell">Υποχρεωτικός αν είναι εφαρμόσιμος</text>
+		<text xml:lang="ca" lang3="cat">Obligatoris quan siga possible</text>
+		<text xml:lang="la" lang3="lat">Obligatoria in loco proprio</text>
+		<text xml:lang="hr" lang3="hrv">Obavezno na odgovarajućem mjestu</text>
+		<text xml:lang="ko" lang3="kor">의무적 적용</text>
+	</entry>
+	<entry>
+		<key>Members</key>
+		<text xml:lang="en" lang3="eng">Members</text>
+		<text xml:lang="de" lang3="deu">Mitglieder</text>
+		<text xml:lang="ro" lang3="ron">Membri</text>
+		<text xml:lang="fr" lang3="fra">Membres</text>
+		<text xml:lang="pt" lang3="por">Membros</text>
+		<text xml:lang="es" lang3="spa">Miembros</text>
+		<text xml:lang="it" lang3="ita">Membri</text>
+		<text xml:lang="sl" lang3="slv">Člani</text>
+		<text xml:lang="sv" lang3="swe">Medlemmar</text>
+		<text xml:lang="no" lang3="nor">Medlemmer</text>
+		<text xml:lang="zh-TW"> 成員</text>
+		<text xml:lang="sr" lang3="srp">Članovi</text>
+		<text xml:lang="ja" lang3="jpn">構成</text>
+		<text xml:lang="pl" lang3="pol">Członkowie</text>
+		<text xml:lang="hi" lang3="hin">sadasya</text>
+		<text xml:lang="th" lang3="tha">สมาชิก</text>
+		<text xml:lang="nl" lang3="nld">Leden</text>
+		<text xml:lang="ru" lang3="rus">Члены</text>
+		<text xml:lang="tr" lang3="tur">Üyeler</text>
+		<text xml:lang="bg" lang3="bul">Членове</text>
+		<text xml:lang="el" lang3="ell">Μέλη</text>
+		<text xml:lang="ca" lang3="cat">Membres</text>
+		<text xml:lang="la" lang3="lat">Membra</text>
+		<text xml:lang="hr" lang3="hrv">Članovi</text>
+		<text xml:lang="ko" lang3="kor">원소</text>
+	</entry>
+	<entry>
+		<key>Module</key>
+		<text xml:lang="en" lang3="eng">Module</text>
+		<text xml:lang="de" lang3="deu">Modul</text>
+		<text xml:lang="ro" lang3="ron">Modul</text>
+		<text xml:lang="fr" lang3="fra">Module</text>
+		<text xml:lang="pt" lang3="por">Módulo</text>
+		<text xml:lang="es" lang3="spa">Módulo</text>
+		<text xml:lang="it" lang3="ita">Modulo</text>
+		<text xml:lang="sl" lang3="slv">Modul</text>
+		<text xml:lang="sv" lang3="swe">Modul</text>
+		<text xml:lang="no" lang3="nor">Modul</text>
+		<text xml:lang="zh-TW">組件</text>
+		<text xml:lang="sr" lang3="srp">Modul</text>
+		<text xml:lang="ja" lang3="jpn">モジュール</text>
+		<text xml:lang="pl" lang3="pol">Moduł</text>
+		<text xml:lang="th" lang3="tha">หลักสูตรการศึกษา</text>
+		<text xml:lang="nl" lang3="nld">Module</text>
+		<text xml:lang="ru" lang3="rus">Модуль</text>
+		<text xml:lang="tr" lang3="tur">Modül</text>
+		<text xml:lang="bg" lang3="bul">Модул</text>
+		<text xml:lang="el" lang3="ell">Στοιχείο</text>
+		<text xml:lang="ca" lang3="cat">Mòdul</text>
+		<text xml:lang="la" lang3="lat">Modulus</text>
+		<text xml:lang="hr" lang3="hrv">Modul</text>
+		<text xml:lang="ko" lang3="kor">모듈</text>
+	</entry>
+	<entry>
+		<key>Note</key>
+		<text xml:lang="en" lang3="eng">Note</text>
+		<text xml:lang="de" lang3="deu">Anmerkung</text>
+		<text xml:lang="ro" lang3="ron">Notă</text>
+		<text xml:lang="fr" lang3="fra">Note</text>
+		<text xml:lang="pt" lang3="por">Nota</text>
+		<text xml:lang="es" lang3="spa">Nota</text>
+		<text xml:lang="it" lang3="ita">Nota</text>
+		<text xml:lang="sl" lang3="slv">Opomba</text>
+		<text xml:lang="sv" lang3="swe">Notering</text>
+		<text xml:lang="no" lang3="nor">Note</text>
+		<text xml:lang="zh-TW">註</text>
+		<text xml:lang="sr" lang3="srp">Napomena</text>
+		<text xml:lang="ja" lang3="jpn">解説</text>
+		<text xml:lang="pl" lang3="pol">Uwagi</text>
+		<text xml:lang="hi" lang3="hin">lekha</text>
+		<text xml:lang="th" lang3="tha">หมายเหตุ</text>
+		<text xml:lang="nl" lang3="nld">Opmerking</text>
+		<text xml:lang="ru" lang3="rus">Примечание</text>
+		<text xml:lang="tr" lang3="tur">Not</text>
+		<text xml:lang="bg" lang3="bul">Забележка</text>
+		<text xml:lang="el" lang3="ell">Σχόλιο</text>
+		<text xml:lang="ca" lang3="cat">Nota</text>
+		<text xml:lang="la" lang3="lat">Notula</text>
+		<text xml:lang="hr" lang3="hrv">Bilješka</text>
+		<text xml:lang="ko" lang3="kor">주석</text>
+	</entry>
+	<entry>
+		<key>Optional</key>
+		<text xml:lang="en" lang3="eng">Optional</text>
+		<text xml:lang="de" lang3="deu">Optional</text>
+		<text xml:lang="ro" lang3="ron">Opţional</text>
+		<text xml:lang="fr" lang3="fra">Optionel</text>
+		<text xml:lang="pt" lang3="por">Opcional</text>
+		<text xml:lang="es" lang3="spa">Opcional</text>
+		<text xml:lang="it" lang3="ita">Opzionale</text>
+		<text xml:lang="sl" lang3="slv">Neobvezen</text>
+		<text xml:lang="sv" lang3="swe">Valfri</text>
+		<text xml:lang="no" lang3="nor">Valgfritt</text>
+		<text xml:lang="zh-TW">非必備的</text>
+		<text xml:lang="sr" lang3="srp">Neobavezan</text>
+		<text xml:lang="ja" lang3="jpn">任意</text>
+		<text xml:lang="pl" lang3="pol">Opcjonalny</text>
+		<text xml:lang="hi" lang3="hin">vaikalpika</text>
+		<text xml:lang="th" lang3="tha">ตัวเลือก</text>
+		<text xml:lang="nl" lang3="nld">Optioneel</text>
+		<text xml:lang="ru" lang3="rus">Факультативный</text>
+		<text xml:lang="tr" lang3="tur">Seçmeli</text>
+		<text xml:lang="bg" lang3="bul">Незадължителен</text>
+		<text xml:lang="el" lang3="ell">Προαιρετικός</text>
+		<text xml:lang="ca" lang3="cat">Opcional</text>
+		<text xml:lang="la" lang3="lat">Si libet</text>
+		<text xml:lang="hr" lang3="hrv">Po želji</text>
+		<text xml:lang="ko" lang3="kor">수의적</text>
+	</entry>
+	<entry>
+		<entry>
+			<key>Required</key>
+			<text xml:lang="en" lang3="eng">Required</text>
+			<text xml:lang="de" lang3="deu">Obligatorisch</text>
+			<text xml:lang="ro" lang3="ron">Obligatoriu</text>
+			<text xml:lang="fr" lang3="fra">Requis</text>
+			<text xml:lang="pt" lang3="por">Obrigatório</text>
+			<text xml:lang="es" lang3="spa">Necesario</text>
+			<text xml:lang="it" lang3="ita">Richiesto</text>
+			<text xml:lang="sl" lang3="slv">Zahtevan</text>
+			<text xml:lang="sv" lang3="swe">Nödvändig</text>
+			<text xml:lang="no" lang3="nor">Obligatorisk</text>
+			<text xml:lang="zh-TW">必備的</text>
+			<text xml:lang="sr" lang3="srp">Tražen</text>
+			<text xml:lang="ja" lang3="jpn">必須</text>
+			<text xml:lang="pl" lang3="pol">Wymagany</text>
+			<text xml:lang="hi" lang3="hin">Avashyaka</text>
+			<text xml:lang="th" lang3="tha">ต้องการข้อมูล</text>
+			<text xml:lang="nl" lang3="nld">Verplicht</text>
+			<text xml:lang="ru" lang3="rus">Обязательный</text>
+			<text xml:lang="tr" lang3="tur">Gerekli</text>
+			<text xml:lang="bg" lang3="bul">Задължителен</text>
+			<text xml:lang="el" lang3="ell">Απαραίτητος</text>
+			<text xml:lang="ca" lang3="cat">Requerit</text>
+			<text xml:lang="la" lang3="lat">Necessarium</text>
+			<text xml:lang="hr" lang3="hrv">Obavezno</text>
+			<text xml:lang="ko" lang3="kor">필수적</text>
+		</entry>
+		<key>Recommended</key>
+		<text xml:lang="en" lang3="eng">Recommended</text>
+		<text xml:lang="de" lang3="deu">Empfohlen</text>
+		<text xml:lang="ro" lang3="ron">Recomandat</text>
+		<text xml:lang="fr" lang3="fra">Recommendé</text>
+		<text xml:lang="pt" lang3="por">Recomendado</text>
+		<text xml:lang="es" lang3="spa">Recomendado</text>
+		<text xml:lang="it" lang3="ita">Consigliato</text>
+		<text xml:lang="sl" lang3="slv">Priporočen</text>
+		<text xml:lang="sv" lang3="swe">Rekommenderad</text>
+		<text xml:lang="no" lang3="nor">Anbefalt</text>
+		<text xml:lang="zh-TW">推薦的</text>
+		<text xml:lang="sr" lang3="srp">Preporučen</text>
+		<text xml:lang="ja" lang3="jpn">推薦される</text>
+		<text xml:lang="pl" lang3="pol">Zalecany</text>
+		<text xml:lang="hi" lang3="hin">svIkArniYa</text>
+		<text xml:lang="th" lang3="tha">คำแนะนำ</text>
+		<text xml:lang="nl" lang3="nld">Aanbevolen</text>
+		<text xml:lang="ru" lang3="rus">Рекомендуемый</text>
+		<text xml:lang="tr" lang3="tur">Önerilen</text>
+		<text xml:lang="bg" lang3="bul">Препоръчителен</text>
+		<text xml:lang="el" lang3="ell">Συστημένος</text>
+		<text xml:lang="ca" lang3="cat">Recomanat</text>
+		<text xml:lang="la" lang3="lat">Commendata</text>
+		<text xml:lang="hr" lang3="hrv">Preporučeno</text>
+		<text xml:lang="ko" lang3="kor">권고적</text>
+	</entry>
+	<entry>
+		<key>Recommended when applicable</key>
+		<text xml:lang="en" lang3="eng">Recommended when applicable</text>
+		<text xml:lang="de" lang3="deu">Empfohlen wenn zutreffend</text>
+		<text xml:lang="ro" lang3="ron">Recomandat dacă se potriveşte</text>
+		<text xml:lang="fr" lang3="fra">Recommendé quand applicable</text>
+		<text xml:lang="pt" lang3="por">Recomendado quando aplicável</text>
+		<text xml:lang="es" lang3="spa">Recomendado cuando se aplica</text>
+		<text xml:lang="it" lang3="ita">Consigliato se applicabile</text>
+		<text xml:lang="sl" lang3="slv">Priporočen, če ustreza</text>
+		<text xml:lang="sv" lang3="swe">Rekommenderad om användbar</text>
+		<text xml:lang="no" lang3="nor">Anbefalt når aktuelt</text>
+		<text xml:lang="zh-TW">可應用時推薦應用</text>
+		<text xml:lang="sr" lang3="srp">Preporučen, ako se može primeniti</text>
+		<text xml:lang="ja" lang3="jpn">利用できる場合は推奨．</text>
+		<text xml:lang="pl" lang3="pol">Zalecany w stosownych przypadkach</text>
+		<text xml:lang="hi" lang3="hin">Avashyaka JaHa uchita</text>
+		<text xml:lang="th" lang3="tha">ต้องการข้อมูลเมื่อสมัคร</text>
+		<text xml:lang="nl" lang3="nld">Aanbevolen indien van toepassing</text>
+		<text xml:lang="ca" lang3="cat">Recomanat quan siga possible</text>
+		<text xml:lang="la" lang3="lat">Commendata in loco proprio</text>
+		<text xml:lang="hr" lang3="hrv">Preporučeno na odgovarajućem mjestu</text>
+		<text xml:lang="ru" lang3="rus">Желателен, если применим</text>
+		<text xml:lang="tr" lang3="tur">Önerilen gereken</text>
+		<text xml:lang="bg" lang3="bul">Препоръчителен, където е приложим</text>
+		<text xml:lang="el" lang3="ell">Συνιστώμενος αν είναι εφαρμόσιμος</text>
+	</entry>
 
-  <entry>
-    <key>Sample values include</key>
-    <text xml:lang="en" lang3="eng">Sample values include</text>
-    <text xml:lang="de" lang3="deu">Beispielwerte sind etwa</text>
-    <text xml:lang="ro" lang3="ron">De exemplu, valorile pot fi</text>
-    <text xml:lang="fr" lang3="fra">Exemple de valeurs possibles</text>
-    <text xml:lang="pt" lang3="por">Exemplos de valores incluidos</text>
-    <text xml:lang="es" lang3="spa">Posibles valores</text>
-    <text xml:lang="it" lang3="ita">I valori esemplificativi includono</text>
-    <text xml:lang="sl" lang3="slv">Možne vrednosti so denimo</text>
-    <text xml:lang="sv" lang3="swe">Exempel på värden som kan inkluderas</text>
-    <text xml:lang="no" lang3="nor">Eksempler på mulige verdier er</text>
-    <text xml:lang="zh-TW">實例值包含</text>
-    <text xml:lang="sr" lang3="srp">Neke moguće vrednosti su</text>
-    <text xml:lang="ja" lang3="jpn">例としての値は以下の通り</text>
-    <text xml:lang="pl" lang3="pol">Przykładowe wartości obejmują</text>
-    <text xml:lang="hi" lang3="hin">misAla guNa mein Sammil Hai</text>
-    <text xml:lang="th" lang3="tha">รวมค่าตัวอย่าง</text>
-    <text xml:lang="nl" lang3="nld">Voorbeeldwaarden zijn onder meer</text>
-    <text xml:lang="ru" lang3="rus">Примерные величины включают</text>
-    <text xml:lang="tr" lang3="tur">Örnek değerler arasında</text>
-    <text xml:lang="bg" lang3="bul">Примерните стойности включват</text>
-    <text xml:lang="el" lang3="ell">Οι δειγματικές τιμές συμπεριλαμβάνουν</text>
-    <text xml:lang="ca" lang3="cat">Exemples de valors possibles</text>
-    <text xml:lang="la" lang3="lat">Valores exemplares</text>
-    <text xml:lang="hr" lang3="hrv">Primjer vrijednosti</text>
-    <text xml:lang="ko" lang3="kor">샘플 값은 다음을 포함한다 Sample values include</text>
-  </entry>
-  <entry>
-    <key>Status</key>
-    <text xml:lang="en" lang3="eng">Status</text>
-    <text xml:lang="de" lang3="deu">Zustand</text>
-    <text xml:lang="ro" lang3="ron">Stare</text>
-    <text xml:lang="fr" lang3="fra">Statut</text>
-    <text xml:lang="pt" lang3="por">Status</text>
-    <text xml:lang="es" lang3="spa">Estado</text>
-    <text xml:lang="it" lang3="ita">Stato</text>
-    <text xml:lang="sl" lang3="slv">Stanje</text>
-    <text xml:lang="sv" lang3="swe">Status</text>
-    <text xml:lang="no" lang3="nor">Status</text>
-    <text xml:lang="zh-TW">狀態</text>
-    <text xml:lang="sr" lang3="srp">Status</text>
-    <text xml:lang="ja" lang3="jpn">状態</text>
-    <text xml:lang="pl" lang3="pol">Status</text>
-    <text xml:lang="th" lang3="tha">สถานะ</text>
-    <text xml:lang="nl" lang3="nld">Status</text>
-    <text xml:lang="ru" lang3="rus">Состояние</text>
-    <text xml:lang="tr" lang3="tur">Durum</text>
-    <text xml:lang="bg" lang3="bul">Състояние</text>
-    <text xml:lang="el" lang3="ell">Κατάσταση</text>
-    <text xml:lang="ca" lang3="cat">Estat</text>
-    <text xml:lang="la" lang3="lat">Status</text>
-    <text xml:lang="hr" lang3="hrv">Stanje</text>
-    <text xml:lang="ko" lang3="kor">상태</text>
-  </entry>
-  <entry>
-    <key>Suggested values include</key>
-    <text xml:lang="es" lang3="spa">Los valores sugeridos incluyen</text>
-    <text xml:lang="en" lang3="eng">Suggested values include</text>
-    <text xml:lang="de" lang3="deu">Empfohlene Werte sind</text>
-    <text xml:lang="ro" lang3="ron">Valori recomandate sunt</text>
-    <text xml:lang="fr" lang3="fra">Les valeurs suggérées comprennent</text>
-    <text xml:lang="pt" lang3="por">Os valores sugeridos incluem</text>
-    <text xml:lang="it" lang3="ita">I valori suggeriti includono</text>
-    <text xml:lang="sl" lang3="slv">Priporočene vrednosti so denimo</text>
-    <text xml:lang="sv" lang3="swe">Förslag på värden som bör inkluderas</text>
-    <text xml:lang="no" lang3="nor">Eksempler på verdier som foreslås er</text>
-    <text xml:lang="zh-TW">被推薦的值包含</text>
-    <text xml:lang="sr" lang3="srp">Preporučene vrednosti su</text>
-    <text xml:lang="ja" lang3="jpn">提案する値は以下の通り</text>
-    <text xml:lang="pl" lang3="pol">Sugerowane wartości obejmują</text>
-    <text xml:lang="hi" lang3="hin">sujheeT guNa mein Sammil Hai</text>
-    <text xml:lang="th" lang3="tha">รวมค่าแนะนำ</text>
-    <text xml:lang="nl" lang3="nld">Voorgestelde waarden</text>
-    <text xml:lang="ru" lang3="rus">Рекомендуемые величины включают</text>
-    <text xml:lang="tr" lang3="tur">Önerilen değerler arasında</text>
-    <text xml:lang="bg" lang3="bul">Препоръчваните стойности включват</text>
-    <text xml:lang="el" lang3="ell">Οι συστημένες τιμές συμπεριλαμβάνουν</text>
-    <text xml:lang="ca" lang3="cat">Exemples de valors suggerits</text>
-    <text xml:lang="la" lang3="lat">Valores propositae sunt</text>
-    <text xml:lang="hr" lang3="hrv">Predložene su vrijednosti</text>
-    <text xml:lang="ko" lang3="kor">제안값은 다음을 포함한다</text>
-  </entry>
-  <entry>
-    <key>Values</key>
-    <text xml:lang="en" lang3="eng">Values</text>
-    <text xml:lang="de" lang3="deu">Werte</text>
-    <text xml:lang="ro" lang3="ron">Valori</text>
-    <text xml:lang="fr" lang3="fra">Valeurs</text>
-    <text xml:lang="pt" lang3="por">Valores</text>
-    <text xml:lang="es" lang3="spa">Valores</text>
-    <text xml:lang="it" lang3="ita">Valori</text>
-    <text xml:lang="sl" lang3="slv">Vrednosti</text>
-    <text xml:lang="sv" lang3="swe">Värden</text>
-    <text xml:lang="no" lang3="nor">Verdier</text>
-    <text xml:lang="zh-TW">值</text>
-    <text xml:lang="sr" lang3="srp">Vrednosti</text>
-    <text xml:lang="ja" lang3="jpn">値</text>
-    <text xml:lang="pl" lang3="pol">Wartości</text>
-    <text xml:lang="hi" lang3="hin">guNa</text>
-    <text xml:lang="nl" lang3="nld">Waarden</text>
-    <text xml:lang="ru" lang3="rus">Величины</text>
-    <text xml:lang="tr" lang3="tur">Değerler</text>
-    <text xml:lang="bg" lang3="bul">Стойности</text>
-    <text xml:lang="el" lang3="ell">Τιμές</text>
-    <text xml:lang="ca" lang3="cat">Valors</text>
-    <text xml:lang="la" lang3="lat">Valores</text>
-    <text xml:lang="hr" lang3="hrv">Vrijednosti</text>
-    <text xml:lang="ko" lang3="kor">값</text>
-  </entry>
-  <entry>
-    <key>include</key>
-    <text xml:lang="en" lang3="eng">include</text>
-    <text xml:lang="de" lang3="deu">enthalten</text>
-    <text xml:lang="ro" lang3="ron">conţin</text>
-    <text xml:lang="fr" lang3="fra">inclure</text>
-    <text xml:lang="pt" lang3="por">inclui (incluem)</text>
-    <text xml:lang="es" lang3="spa">incluir</text>
-    <text xml:lang="it" lang3="ita">include</text>
-    <text xml:lang="sl" lang3="slv">vsebuje</text>
-    <text xml:lang="sv" lang3="swe">inkludera</text>
-    <text xml:lang="no" lang3="nor">inkludere</text>
-    <text xml:lang="zh-TW">包含</text>
-    <text xml:lang="sr" lang3="srp">uključuje</text>
-    <text xml:lang="ja" lang3="jpn">含む</text>
-    <text xml:lang="pl" lang3="pol">włącz</text>
-    <text xml:lang="hi" lang3="hin">sammil</text>
-    <text xml:lang="th" lang3="tha">รวมถึง</text>
-    <text xml:lang="nl" lang3="nld">zijn onder meer</text>
-    <text xml:lang="ru" lang3="rus">включить</text>
-    <text xml:lang="tr" lang3="tur">içer</text>
-    <text xml:lang="bg" lang3="bul">включи</text>
-    <text xml:lang="el" lang3="ell">ενσωμάτωσης</text>
-    <text xml:lang="ca" lang3="cat">inclou</text>
-    <text xml:lang="la" lang3="lat">inclusum est</text>
-    <text xml:lang="hr" lang3="hrv">sadrži</text>
-    <text xml:lang="ko" lang3="kor">포함한다</text>
-  </entry>
-  <entry>
-    <key>appendixWords</key>
-    <text xml:lang="en" lang3="eng">Appendix</text>
-    <text xml:lang="de" lang3="deu">Anhang</text>
-    <text xml:lang="ro" lang3="ron">Apendice</text>
-    <text xml:lang="fr" lang3="fra">Annexe</text>
-    <text xml:lang="pt" lang3="por">Apêndice</text>
-    <text xml:lang="es" lang3="spa">Apéndice</text>
-    <text xml:lang="it" lang3="ita">Appendice</text>
-    <text xml:lang="sl" lang3="slv">Dodatek</text>
-    <text xml:lang="sv" lang3="swe">Bilaga</text>
-    <text xml:lang="no" lang3="nor">Vedlegg</text>
-    <text xml:lang="zh-TW">附錄</text>
-    <text xml:lang="sr" lang3="srp">Dodatak</text>
-    <text xml:lang="ja" lang3="jpn">付録</text>
-    <text xml:lang="pl" lang3="pol">Dodatek</text>
-    <text xml:lang="hi" lang3="hin">Atirikta</text>
-    <text xml:lang="th" lang3="tha">ภาคผนวก</text>
-    <text xml:lang="nl" lang3="nld">Appendix</text>
-    <text xml:lang="ru" lang3="rus">Приложение</text>
-    <text xml:lang="tr" lang3="tur">Ek</text>
-    <text xml:lang="bg" lang3="bul">Приложение</text>
-    <text xml:lang="el" lang3="ell">Παράρτημα</text>
-    <text xml:lang="ca" lang3="cat">Apèndix</text>
-    <text xml:lang="la" lang3="lat">Appendix</text>
-    <text xml:lang="hr" lang3="hrv">Dodatak</text>
-    <text xml:lang="ko" lang3="kor">부록</text>
-  </entry>
-  <entry>
-    <key>editorWord</key>
-    <text xml:lang="en" lang3="eng">Editor</text> 
-  </entry>
-  <entry>
-    <key>authorWord</key>
-    <text xml:lang="en" lang3="eng">Author</text>
-   <text xml:lang="de" lang3="deu">Autor</text>
-    <text xml:lang="ro" lang3="ron">Autor</text>
-    <text xml:lang="fr" lang3="fra">Auteur</text>
-    <text xml:lang="pt" lang3="por">Autor</text>
-    <text xml:lang="es" lang3="spa">Autor</text>
-    <text xml:lang="it" lang3="ita">Autore</text>
-    <text xml:lang="sl" lang3="slv">Avtor</text>
-    <text xml:lang="sv" lang3="swe">Författare</text>
-    <text xml:lang="no" lang3="nor">Forfatter</text>
-    <text xml:lang="zh-TW">作者</text>
-    <text xml:lang="sr" lang3="srp">Autor</text>
-    <text xml:lang="ja" lang3="jpn">著者</text>
-    <text xml:lang="pl" lang3="pol">Autor</text>
-    <text xml:lang="hi" lang3="hin">Lekhaka</text>
-    <text xml:lang="th" lang3="tha">ผู้แต่ง</text>
-    <text xml:lang="nl" lang3="nld">Auteur</text>
-    <text xml:lang="ru" lang3="rus">Автор</text>
-    <text xml:lang="tr" lang3="tur">Yazar</text>
-    <text xml:lang="bg" lang3="bul">Автор</text>
-    <text xml:lang="el" lang3="ell">Δημιουργός</text>
-    <text xml:lang="ca" lang3="cat">Autor</text>
-    <text xml:lang="la" lang3="lat">Auctor</text>
-    <text xml:lang="hr" lang3="hrv">Autor</text>
-    <text xml:lang="ko" lang3="kor">저자</text>
-  </entry>
-  <entry>
-    <key>biblioWords</key>
-    <text xml:lang="en" lang3="eng">Bibliography</text>
-    <text xml:lang="de" lang3="deu">Bibliographie</text>
-    <text xml:lang="ro" lang3="ron">Bibliografie</text>
-    <text xml:lang="fr" lang3="fra">Bibliographie</text>
-    <text xml:lang="pt" lang3="por">Bibiografia</text>
-    <text xml:lang="es" lang3="spa">Bibliografía</text>
-    <text xml:lang="it" lang3="ita">Bibliografia</text>
-    <text xml:lang="sl" lang3="slv">Bibliografija</text>
-    <text xml:lang="sv" lang3="swe">Bibliografi</text>
-    <text xml:lang="no" lang3="nor">Bibliografi</text>
-    <text xml:lang="zh-TW">參考書目</text>
-    <text xml:lang="sr" lang3="srp">Bibliografija</text>
-    <text xml:lang="ja" lang3="jpn">目録</text>
-    <text xml:lang="pl" lang3="pol">Bibliografia</text>
-    <text xml:lang="hi" lang3="hin">Bibliography</text>
-    <text xml:lang="th" lang3="tha">บรรณานุกรม</text>
-    <text xml:lang="nl" lang3="nld">Bibliografie</text>
-    <text xml:lang="ru" lang3="rus">Библиография</text>
-    <text xml:lang="tr" lang3="tur">Bibliyografya</text>
-    <text xml:lang="bg" lang3="bul">Литература</text>
-    <text xml:lang="el" lang3="ell">Βιβλιογραφία</text>
-    <text xml:lang="ca" lang3="cat">Bibliografia</text>
-    <text xml:lang="la" lang3="lat">Auctores</text>
-    <text xml:lang="hr" lang3="hrv">Bibliografija</text>
-    <text xml:lang="ko" lang3="kor">서지목록</text>
-  </entry>
-  <entry>
-    <key>contentsHeading</key>
-    <text xml:lang="en" lang3="eng">Sections in this document:</text>
-    <text xml:lang="de" lang3="deu">Abschnitte in diesem Dokument:</text>
-    <text xml:lang="ro" lang3="ron">Capitolele acestui document:</text>
-    <text xml:lang="fr" lang3="fra">Sections de ce document:</text>
-    <text xml:lang="pt" lang3="por">Índice geral:</text>
-    <text xml:lang="es" lang3="spa">Secciones en este documento:</text>
-    <text xml:lang="it" lang3="ita">Sommario di questo documento:</text>
-    <text xml:lang="sl" lang3="slv">Razdelki v tem dokumentu:</text>
-    <text xml:lang="sv" lang3="swe">Sektioner i detta dokument</text>
-    <text xml:lang="no" lang3="nor">Deler i dette dokumentet:</text>
-    <text xml:lang="zh-TW">本文章節:</text>
-    <text xml:lang="sr" lang3="srp">Odeljci u ovom dokumentu:</text>
-    <text xml:lang="ja" lang3="jpn">表題</text>
-    <text xml:lang="pl" lang3="pol">Sekcje zawarte w bieżącym dokumencie:</text>
-    <text xml:lang="th" lang3="tha">บทในเอกสารนี้</text>
-    <text xml:lang="nl" lang3="nld">Onderdelen van dit document:</text>
-    <text xml:lang="ru" lang3="rus">Разделы в этом документе:</text>
-    <text xml:lang="tr" lang3="tur">Bu belgenin bölümleri:</text>
-    <text xml:lang="bg" lang3="bul">Раздели в този документ:</text>
-    <text xml:lang="el" lang3="ell">Τμήματα αυτού του εγγράφου:</text>
-    <text xml:lang="ca" lang3="cat">Seccions en aquest document:</text>
-    <text xml:lang="la" lang3="lat">Capitula textus:</text>
-    <text xml:lang="hr" lang3="hrv">Odjeljci ovog dokumenta:</text>
-    <text xml:lang="ko" lang3="kor">본 문서의 절</text>
-  </entry>
-  <entry>
-    <key>contentsWord</key>
-    <text xml:lang="en" lang3="eng">Contents</text>
-    <text xml:lang="de" lang3="deu">Inhalt</text>
-    <text xml:lang="ro" lang3="ron">Cuprins</text>
-    <text xml:lang="fr" lang3="fra">Contenu</text>
-    <text xml:lang="pt" lang3="por">Índice geral</text>
-    <text xml:lang="es" lang3="spa">Contenidos</text>
-    <text xml:lang="sl" lang3="slv">Vsebina</text>
-    <text xml:lang="sv" lang3="swe">Innehåll</text>
-    <text xml:lang="no" lang3="nor">Innhold</text>
-    <text xml:lang="zh-TW">內容</text>
-    <text xml:lang="sr" lang3="srp">Sadržaj</text>
-    <text xml:lang="ja" lang3="jpn">目次</text>
-    <text xml:lang="pl" lang3="pol">Spis treści</text>
-    <text xml:lang="hi" lang3="hin">Mula Shabda</text>
-    <text xml:lang="th" lang3="tha">เนื้อหา</text>
-    <text xml:lang="nl" lang3="nld">Inhoud</text>
-    <text xml:lang="ru" lang3="rus">Оглавление</text>
-    <text xml:lang="tr" lang3="tur">İçerik</text>
-    <text xml:lang="bg" lang3="bul">Съдържание</text>
-    <text xml:lang="el" lang3="ell">Περιεχόμενα</text>
-    <text xml:lang="ca" lang3="cat">Índex general</text>
-    <text xml:lang="it" lang3="ita">Argomenti</text>
-    <text xml:lang="la" lang3="lat">Tabula contentorum</text>
-    <text xml:lang="hr" lang3="hrv">Sadržaj</text>
-    <text xml:lang="ko" lang3="kor">내용</text>
-  </entry>
-  <entry>
-    <key>dateWord</key>
-    <text xml:lang="en" lang3="eng">Date</text>
-    <text xml:lang="de" lang3="deu">Datum</text>
-    <text xml:lang="ro" lang3="ron">Data</text>
-    <text xml:lang="fr" lang3="fra">Date</text>
-    <text xml:lang="pt" lang3="por">Data</text>
-    <text xml:lang="es" lang3="spa">Fecha</text>
-    <text xml:lang="it" lang3="ita">Data</text>
-    <text xml:lang="sl" lang3="slv">Datum</text>
-    <text xml:lang="sv" lang3="swe">Datum</text>
-    <text xml:lang="no" lang3="nor">Dato</text>
-    <text xml:lang="zh-TW">日期</text>
-    <text xml:lang="sr" lang3="srp">Datum</text>
-    <text xml:lang="ja" lang3="jpn">日付</text>
-    <text xml:lang="pl" lang3="pol">Data</text>
-    <text xml:lang="hi" lang3="hin">Tarikha</text>
-    <text xml:lang="th" lang3="tha">วันที่</text>
-    <text xml:lang="nl" lang3="nld">Datum</text>
-    <text xml:lang="ru" lang3="rus">Дата</text>
-    <text xml:lang="tr" lang3="tur">Tarih</text>
-    <text xml:lang="bg" lang3="bul">Дата</text>
-    <text xml:lang="el" lang3="ell">Ημερομηνία</text>
-    <text xml:lang="ca" lang3="cat">Dataa</text>
-    <text xml:lang="la" lang3="lat">Die dato</text>
-    <text xml:lang="hr" lang3="hrv">Datum</text>
-    <text xml:lang="ko" lang3="kor">날짜</text>
-  </entry>
-  <entry>
-    <key>feedbackWords</key>
-    <text xml:lang="en" lang3="eng">Feedback</text>
-    <text xml:lang="de" lang3="deu">Kommentare</text>
-    <text xml:lang="ro" lang3="ron">Retur</text>
-    <text xml:lang="fr" lang3="fra">Commentaires</text>
-    <text xml:lang="pt" lang3="por">Comentários</text>
-    <text xml:lang="es" lang3="spa">Comentarios</text>
-    <text xml:lang="it" lang3="ita">Commenti e suggerimenti</text>
-    <text xml:lang="sl" lang3="slv">Odzivi</text>
-    <text xml:lang="sv" lang3="swe">Kommentarer</text>
-    <text xml:lang="no" lang3="nor">Kommentarer</text>
-    <text xml:lang="zh-TW">回饋</text>
-    <text xml:lang="sr" lang3="srp">Komentari</text>
-    <text xml:lang="ja" lang3="jpn">ご意見・ご感想</text>
-    <text xml:lang="pl" lang3="pol">Komentarze</text>
-    <text xml:lang="hi" lang3="hin">Tippani</text>
-    <text xml:lang="th" lang3="tha">ตอบกลับ</text>
-    <text xml:lang="nl" lang3="nld">Feedback</text>
-    <text xml:lang="ru" lang3="rus">Отзывы</text>
-    <text xml:lang="tr" lang3="tur">Geri besleme</text>
-    <text xml:lang="bg" lang3="bul">Коментари</text>
-    <text xml:lang="el" lang3="ell">Γνώμες</text>
-    <text xml:lang="ca" lang3="cat">Comentaris</text>
-    <text xml:lang="la" lang3="lat">Responsiones</text>
-    <text xml:lang="hr" lang3="hrv">Komentari</text>
-    <text xml:lang="ko" lang3="kor">피드백</text>
-  </entry>
-  <entry>
-    <key>figureWord</key>
-    <text xml:lang="en" lang3="eng">Figure</text>
-    <text xml:lang="de" lang3="deu">Abbildung</text>
-    <text xml:lang="ro" lang3="ron">Figura</text>
-    <text xml:lang="fr" lang3="fra">Figure</text>
-    <text xml:lang="pt" lang3="por">Figura</text>
-    <text xml:lang="es" lang3="spa">Imagen</text>
-    <text xml:lang="it" lang3="ita">Figura</text>
-    <text xml:lang="sl" lang3="slv">Slika</text>
-    <text xml:lang="sv" lang3="swe">Figur</text>
-    <text xml:lang="no" lang3="nor">Figur</text>
-    <text xml:lang="zh-TW">圖表</text>
-    <text xml:lang="sr" lang3="srp">Slika</text>
-    <text xml:lang="ja" lang3="jpn">図</text>
-    <text xml:lang="pl" lang3="pol">Rysunek</text>
-    <text xml:lang="hi" lang3="hin">Chitr</text>
-    <text xml:lang="th" lang3="tha">ภาพ</text>
-    <text xml:lang="nl" lang3="nld">Afbeelding</text>
-    <text xml:lang="ru" lang3="rus">Фигура</text>
-    <text xml:lang="tr" lang3="tur">Şekil</text>
-    <text xml:lang="bg" lang3="bul">Фигура</text>
-    <text xml:lang="el" lang3="ell">Σχήμα</text>
-    <text xml:lang="ca" lang3="cat">Figura</text>
-    <text xml:lang="la" lang3="lat">Figura</text>
-    <text xml:lang="hr" lang3="hrv">Ilustracija</text>
-    <text xml:lang="ko" lang3="kor">그림</text>
-  </entry>
-  <entry>
-    <key>figureWords</key>
-    <text xml:lang="en" lang3="eng">Figures</text>
-    <text xml:lang="de" lang3="deu">Abbildungen</text>
-    <text xml:lang="ro" lang3="ron">Figuri</text>
-    <text xml:lang="fr" lang3="fra">Figures</text>
-    <text xml:lang="pt" lang3="por">Figuras</text>
-    <text xml:lang="es" lang3="spa">Imágenes</text>
-    <text xml:lang="it" lang3="ita">Figure</text>
-    <text xml:lang="sl" lang3="slv">Slike</text>
-    <text xml:lang="sv" lang3="swe">Figurer</text>
-    <text xml:lang="no" lang3="nor">Figurer</text>
-    <text xml:lang="zh-TW">圖表</text>
-    <text xml:lang="sr" lang3="srp">Slike</text>
-    <text xml:lang="ja" lang3="jpn">図</text>
-    <text xml:lang="pl" lang3="pol">Rysunki</text>
-    <text xml:lang="hi" lang3="hin">Chitr</text>
-    <text xml:lang="th" lang3="tha">ภาพ</text>
-    <text xml:lang="nl" lang3="nld">Afbeeldingen</text>
-    <text xml:lang="ru" lang3="rus">Фигуры</text>
-    <text xml:lang="tr" lang3="tur">Şekiller</text>
-    <text xml:lang="bg" lang3="bul">Фигури</text>
-    <text xml:lang="el" lang3="ell">Σχήματα</text>
-    <text xml:lang="ca" lang3="cat">Figures</text>
-    <text xml:lang="la" lang3="lat">Figurae</text>
-    <text xml:lang="hr" lang3="hrv">Ilustracije</text>
-    <text xml:lang="ko" lang3="kor">그림들</text>
-  </entry>
-  <entry>
-    <key>nextWord</key>
-    <text xml:lang="en" lang3="eng">Next</text>
-    <text xml:lang="de" lang3="deu">Nächstes</text>
-    <text xml:lang="ro" lang3="ron">Următorul</text>
-    <text xml:lang="fr" lang3="fra">Suivant</text>
-    <text xml:lang="pt" lang3="por">Seguinte</text>
-    <text xml:lang="es" lang3="spa">Siguiente</text>
-    <text xml:lang="it" lang3="ita">Seguente</text>
-    <text xml:lang="sl" lang3="slv">Naslednji</text>
-    <text xml:lang="sv" lang3="swe">Nästa</text>
-    <text xml:lang="no" lang3="nor">Neste</text>
-    <text xml:lang="zh-TW">下一頁</text>
-    <text xml:lang="sr" lang3="srp">Sledeći</text>
-    <text xml:lang="ja" lang3="jpn">次</text>
-    <text xml:lang="pl" lang3="pol">Następny</text>
-    <text xml:lang="hi" lang3="hin">Agala</text>
-    <text xml:lang="th" lang3="tha">ต่อไป</text>
-    <text xml:lang="nl" lang3="nld">Volgende</text>
-    <text xml:lang="ru" lang3="rus">Следующий</text>
-    <text xml:lang="tr" lang3="tur">Sonraki</text>
-    <text xml:lang="bg" lang3="bul">Следващ</text>
-    <text xml:lang="el" lang3="ell">Επόμενος</text>
-    <text xml:lang="ca" lang3="cat">Següent</text>
-    <text xml:lang="la" lang3="lat">Porro</text>
-    <text xml:lang="hr" lang3="hrv">Dalje</text>
-    <text xml:lang="ko" lang3="kor">다음</text>
-  </entry>
-  <entry>
-    <key>noteHeading</key>
-    <text xml:lang="en" lang3="eng">Notes</text>
-    <text xml:lang="de" lang3="deu">Noten</text>
-    <text xml:lang="ro" lang3="ron">Note</text>
-    <text xml:lang="fr" lang3="fra">Notes</text>
-    <text xml:lang="pt" lang3="por">Nota</text>
-    <text xml:lang="es" lang3="spa">Notas</text>
-    <text xml:lang="it" lang3="ita">Note</text>
-    <text xml:lang="sl" lang3="slv">Opombe</text>
-    <text xml:lang="sv" lang3="swe">Noteringar</text>
-    <text xml:lang="no" lang3="nor">Noter</text>
-    <text xml:lang="zh-TW">註解</text>
-    <text xml:lang="sr" lang3="srp">Napomene</text>
-    <text xml:lang="ja" lang3="jpn">注釈</text>
-    <text xml:lang="pl" lang3="pol">Uwagi</text>
-    <text xml:lang="hi" lang3="hin">Dhyan</text>
-    <text xml:lang="th" lang3="tha">หมายเหตุ</text>
-    <text xml:lang="nl" lang3="nld">Opmerkingen</text>
-    <text xml:lang="ru" lang3="rus">Примечания</text>
-    <text xml:lang="tr" lang3="tur">Notlar</text>
-    <text xml:lang="bg" lang3="bul">Забележки</text>
-    <text xml:lang="el" lang3="ell">Σχόλια</text>
-    <text xml:lang="ca" lang3="cat">Notes</text>
-    <text xml:lang="la" lang3="lat">Notae</text>
-    <text xml:lang="hr" lang3="hrv">Bilješke</text>
-    <text xml:lang="ko" lang3="kor">주석</text>
-  </entry>
-  <entry>
-    <key>previousWord</key>
-    <text xml:lang="en" lang3="eng">Previous</text>
-    <text xml:lang="de" lang3="deu">Vorheriges</text>
-    <text xml:lang="ro" lang3="ron">Precedentul</text>
-    <text xml:lang="fr" lang3="fra">Précédent</text>
-    <text xml:lang="pt" lang3="por">Prévio</text>
-    <text xml:lang="es" lang3="spa">Anterior</text>
-    <text xml:lang="it" lang3="ita">Precedente</text>
-    <text xml:lang="sl" lang3="slv">Prejšnji</text>
-    <text xml:lang="sv" lang3="swe">Föregående</text>
-    <text xml:lang="no" lang3="nor">Forrige</text>
-    <text xml:lang="zh-TW">上一頁</text>
-    <text xml:lang="sr" lang3="srp">Prethodni</text>
-    <text xml:lang="ja" lang3="jpn">前</text>
-    <text xml:lang="pl" lang3="pol">Poprzedni</text>
-    <text xml:lang="hi" lang3="hin">Purva"</text>
-    <text xml:lang="nl" lang3="nld">Vorige</text>
-    <text xml:lang="ru" lang3="rus">Предыдущий</text>
-    <text xml:lang="tr" lang3="tur">Önceki</text>
-    <text xml:lang="bg" lang3="bul">Предходен</text>
-    <text xml:lang="el" lang3="ell">Προηγούμενος</text>
-    <text xml:lang="ca" lang3="cat">Anterior</text>
-    <text xml:lang="la" lang3="lat">Retro</text>
-    <text xml:lang="hr" lang3="hrv">Natrag</text>
-    <text xml:lang="ko" lang3="kor">이전</text>
-  </entry>
-  <entry>
-    <key>revisedWord</key>
-    <text xml:lang="en" lang3="eng">revised</text>
-    <text xml:lang="de" lang3="deu">überarbeitet</text>
-    <text xml:lang="ro" lang3="ron">revăzut</text>
-    <text xml:lang="fr" lang3="fra">révisé</text>
-    <text xml:lang="pt" lang3="por">revisto</text>
-    <text xml:lang="es" lang3="spa">Revisado</text>
-    <text xml:lang="it" lang3="ita">revisionato</text>
-    <text xml:lang="sl" lang3="slv">dopolnjeno</text>
-    <text xml:lang="sv" lang3="swe">Ändrad</text>
-    <text xml:lang="no" lang3="nor">Revidert</text>
-    <text xml:lang="zh-TW">修訂</text>
-    <text xml:lang="sr" lang3="srp">izmenjeno</text>
-    <text xml:lang="ja" lang3="jpn">改訂</text>
-    <text xml:lang="pl" lang3="pol">poprawione</text>
-    <text xml:lang="hi" lang3="hin">duharAnA</text>
-    <text xml:lang="th" lang3="tha">ทบทวน</text>
-    <text xml:lang="nl" lang3="nld">herzien</text>
-    <text xml:lang="ru" lang3="rus">Пересмотрено</text>
-    <text xml:lang="tr" lang3="tur">Düzeltilmiş</text>
-    <text xml:lang="bg" lang3="bul">Променено</text>
-    <text xml:lang="el" lang3="ell">Μετάβλητο</text>
-    <text xml:lang="ca" lang3="cat">Revisat</text>
-    <text xml:lang="la" lang3="lat">Accurate revisum</text>
-    <text xml:lang="hr" lang3="hrv">Pregledano</text>
-    <text xml:lang="ko" lang3="kor">수정</text>
-  </entry>
-  <entry>
-    <key>searchWords</key>
-    <text xml:lang="en" lang3="eng">Search</text>
-    <text xml:lang="de" lang3="deu">Suche</text>
-    <text xml:lang="ro" lang3="ron">Caută</text>
-    <text xml:lang="fr" lang3="fra">Recherche</text>
-    <text xml:lang="pt" lang3="por">Pesquisa</text>
-    <text xml:lang="es" lang3="spa">Buscar</text>
-    <text xml:lang="it" lang3="ita">Cerca</text>
-    <text xml:lang="sl" lang3="slv">Iskanje</text>
-    <text xml:lang="sv" lang3="swe">Sök</text>
-    <text xml:lang="no" lang3="nor">Sok</text>
-    <text xml:lang="zh-TW">搜尋</text>
-    <text xml:lang="sr" lang3="srp">Pretraga</text>
-    <text xml:lang="ja" lang3="jpn">検索</text>
-    <text xml:lang="pl" lang3="pol">Szukaj</text>
-    <text xml:lang="hi" lang3="hin">Khoj</text>
-    <text xml:lang="th" lang3="tha">ค้นหา</text>
-    <text xml:lang="nl" lang3="nld">Zoeken</text>
-    <text xml:lang="ru" lang3="rus">Поиск</text>
-    <text xml:lang="tr" lang3="tur">Ara</text>
-    <text xml:lang="bg" lang3="bul">Търси</text>
-    <text xml:lang="el" lang3="ell">Ψάχνε</text>
-    <text xml:lang="ca" lang3="cat">Cercar</text>
-    <text xml:lang="la" lang3="lat">Quaere</text>
-    <text xml:lang="hr" lang3="hrv">Pretraživanje</text>
-    <text xml:lang="ko" lang3="kor">검색</text>
-  </entry>
-  <entry>
-    <key>tableWord</key>
-    <text xml:lang="en" lang3="eng">Table</text>
-    <text xml:lang="de" lang3="deu">Tabelle</text>
-    <text xml:lang="ro" lang3="ron">Tabel</text>
-    <text xml:lang="fr" lang3="fra">Table</text>
-    <text xml:lang="pt" lang3="por">Tabela</text>
-    <text xml:lang="es" lang3="spa">Tabla</text>
-    <text xml:lang="it" lang3="ita">Tavola</text>
-    <text xml:lang="sl" lang3="slv">Tabela</text>
-    <text xml:lang="sv" lang3="swe">Tabell</text>
-    <text xml:lang="no" lang3="nor">Tabell</text>
-    <text xml:lang="zh-TW">表格</text>
-    <text xml:lang="sr" lang3="srp">Tabela</text>
-    <text xml:lang="ja" lang3="jpn">表</text>
-    <text xml:lang="pl" lang3="pol">Tabela</text>
-    <text xml:lang="hi" lang3="hin">Patti</text>
-    <text xml:lang="th" lang3="tha">ตาราง</text>
-    <text xml:lang="nl" lang3="nld">Tabel</text>
-    <text xml:lang="ru" lang3="rus">Таблица</text>
-    <text xml:lang="tr" lang3="tur">Tablo</text>
-    <text xml:lang="bg" lang3="bul">Таблица</text>
-    <text xml:lang="el" lang3="ell">Πίνακας</text>
-    <text xml:lang="ca" lang3="cat">Taula</text>
-    <text xml:lang="la" lang3="lat">Tabella</text>
-    <text xml:lang="hr" lang3="hrv">Tablica</text>
-    <text xml:lang="ko" lang3="kor">표</text>
-  </entry>
-  <entry>
-    <key>tableWords</key>
-    <text xml:lang="en" lang3="eng">Tables</text>
-    <text xml:lang="de" lang3="deu">Tabellen</text>
-    <text xml:lang="ro" lang3="ron">Tabele</text>
-    <text xml:lang="fr" lang3="fra">Tables</text>
-    <text xml:lang="pt" lang3="por">Tabelas</text>
-    <text xml:lang="es" lang3="spa">Tablas</text>
-    <text xml:lang="it" lang3="ita">Tavole</text>
-    <text xml:lang="sl" lang3="slv">Tabele</text>
-    <text xml:lang="sv" lang3="swe">Tabeller</text>
-    <text xml:lang="no" lang3="nor">Tabeller</text>
-    <text xml:lang="zh-TW">表格</text>
-    <text xml:lang="sr" lang3="srp">Tabele</text>
-    <text xml:lang="ja" lang3="jpn">表</text>
-    <text xml:lang="pl" lang3="pol">Tabele</text>
-    <text xml:lang="hi" lang3="hin">Pattiya</text>
-    <text xml:lang="th" lang3="tha">คาราง</text>
-    <text xml:lang="nl" lang3="nld">Tabellen</text>
-    <text xml:lang="ru" lang3="rus">Таблицы</text>
-    <text xml:lang="tr" lang3="tur">Tablolar</text>
-    <text xml:lang="bg" lang3="bul">Таблици</text>
-    <text xml:lang="el" lang3="ell">Πίνακες</text>
-    <text xml:lang="ca" lang3="cat">Taules</text>
-    <text xml:lang="la" lang3="lat">Tabellae</text>
-    <text xml:lang="hr" lang3="hrv">Tablice</text>
-    <text xml:lang="ko" lang3="kor">표들</text>
-  </entry>
-  <entry>
-    <key>tocWords</key>
-    <text xml:lang="en" lang3="eng">Table of contents</text>
-    <text xml:lang="de" lang3="deu">Inhalt</text>
-    <text xml:lang="ro" lang3="ron">Cuprins</text>
-    <text xml:lang="fr" lang3="fra">Contenu</text>
-    <text xml:lang="pt" lang3="por">Índice geral</text>
-    <text xml:lang="es" lang3="spa">Índice</text>
-    <text xml:lang="it" lang3="ita">Indice</text>
-    <text xml:lang="sl" lang3="slv">Kazalo</text>
-    <text xml:lang="sv" lang3="swe">Innehåll</text>
-    <text xml:lang="no" lang3="nor">Innhold</text>
-    <text xml:lang="zh-TW">內容</text>
-    <text xml:lang="sr" lang3="srp">Sadržaj</text>
-    <text xml:lang="ja" lang3="jpn">目次</text>
-    <text xml:lang="pl" lang3="pol">Spis treści</text>
-    <text xml:lang="hi" lang3="hin">mula</text>
-    <text xml:lang="th" lang3="tha">สารบัญ</text>
-    <text xml:lang="nl" lang3="nld">Inhoud</text>
-    <text xml:lang="ru" lang3="rus">Оглавление</text>
-    <text xml:lang="tr" lang3="tur">İçerik</text>
-    <text xml:lang="bg" lang3="bul">Съдържание</text>
-    <text xml:lang="el" lang3="ell">Περιεχόμενα</text>
-    <text xml:lang="ca" lang3="cat">Índice general</text>
-    <text xml:lang="la" lang3="lat">Tabula contentorum</text>
-    <text xml:lang="hr" lang3="hrv">Sadržaj</text>
-    <text xml:lang="ko" lang3="kor">목차</text>
-  </entry>
-  <entry>
-    <key>upWord</key>
-    <text xml:lang="en" lang3="eng">Up</text>
-    <text xml:lang="de" lang3="deu">Aufwärts</text>
-    <text xml:lang="ro" lang3="ron">Sus</text>
-    <text xml:lang="fr" lang3="fra">Haut</text>
-    <text xml:lang="pt" lang3="por">Topo</text>
-    <text xml:lang="es" lang3="spa">Arriba</text>
-    <text xml:lang="it" lang3="ita">Su</text>
-    <text xml:lang="sl" lang3="slv">Gor</text>
-    <text xml:lang="sv" lang3="swe">Upp</text>
-    <text xml:lang="no" lang3="nor">Opp</text>
-    <text xml:lang="zh-TW">往上</text>
-    <text xml:lang="sr" lang3="srp">Gore</text>
-    <text xml:lang="ja" lang3="jpn">上</text>
-    <text xml:lang="pl" lang3="pol">W górę</text>
-    <text xml:lang="hi" lang3="hin">Upara Shabda</text>
-    <text xml:lang="th" lang3="tha">ไปข้างบน</text>
-    <text xml:lang="nl" lang3="nld">Hoger</text>
-    <text xml:lang="ru" lang3="rus">Вверх</text>
-    <text xml:lang="tr" lang3="tur">Yukarı</text>
-    <text xml:lang="bg" lang3="bul">Нагоре</text>
-    <text xml:lang="el" lang3="ell">Ανω</text>
-    <text xml:lang="ca" lang3="cat">Amunt</text>
-    <text xml:lang="la" lang3="lat">Sursum</text>
-    <text xml:lang="hr" lang3="hrv">Gore</text>
-    <text xml:lang="ko" lang3="kor">상위</text>
-  </entry>
-  <entry>
-    <key>appearsintheoriginalas</key>
-    <text xml:lang="en" lang3="eng">Appears in the original as</text>
-    <text xml:lang="es" lang3="spa">Aparece en el original como</text>
-    <text xml:lang="ca" lang3="cat">Apareix en l'original com</text>
-    <text xml:lang="de" lang3="deu">Erscheint im Original als</text>
-    <text xml:lang="la" lang3="lat">In exemplari legitur</text>
-    <text xml:lang="hr" lang3="hrv">U izvorniku se pojavljuje kao</text>
-    <text xml:lang="ko" lang3="kor">와 같이 원본에 나타난다</text>
-  </entry>
-  <text xml:lang="it" lang3="ita">Nell'originale appare come</text>
-  <entry>
-    <key>shouldbereadas</key>
-    <text xml:lang="en" lang3="eng">Should be read as</text>
-    <text xml:lang="es" lang3="spa">Debería leerse como</text>
-    <text xml:lang="ca" lang3="cat">S'hi hauria de llegir</text>
-    <text xml:lang="it" lang3="ita">Da leggersi come</text>
-    <text xml:lang="de" lang3="deu">Sollte gelesen werden als</text>
-    <text xml:lang="la" lang3="lat">Legendum est</text>
-    <text xml:lang="hr" lang3="hrv">Čita se kao</text>
-    <text xml:lang="ko" lang3="kor">와 같이 해석해야 한다</text>
-  </entry>
-  <entry>
-    <key>page</key>
-    <text xml:lang="en" lang3="eng">Page</text>
-    <text xml:lang="es" lang3="spa">Página</text>
-    <text xml:lang="ca" lang3="cat">Pàgina</text>
-    <text xml:lang="it" lang3="ita">Pagina</text>
-    <text xml:lang="de" lang3="deu">Seite</text>
-    <text xml:lang="la" lang3="lat">Pagina</text>
-    <text xml:lang="hr" lang3="hrv">Stranica</text>
-    <text xml:lang="ko" lang3="kor">쪽</text>
-  </entry>
-  <entry>
-    <key>asfoundin</key>
-    <text xml:lang="en" lang3="eng">As found in</text>
-    <text xml:lang="es" lang3="spa">Tal como se encuentra en</text>
-    <text xml:lang="ca" lang3="cat">Tal com es troba en</text>
-    <text xml:lang="de" lang3="deu">So wie gefunden in</text>
-    <text xml:lang="it" lang3="ita">Da riferirsi a</text>
-    <text xml:lang="la" lang3="lat">Ut legitur in</text>
-    <text xml:lang="hr" lang3="hrv">Prema izvoru</text>
-    <text xml:lang="ko" lang3="kor">에서와 같이 발견된</text>
-  </entry>
-  <entry>
-    <key>otherreadings</key>
-    <text xml:lang="en" lang3="eng">Other readings</text>
-    <text xml:lang="es" lang3="spa">Otras lecturas</text>
-    <text xml:lang="ca" lang3="cat">D'altres lectures</text>
-    <text xml:lang="de" lang3="deu">Andere Lesarten</text>
-    <text xml:lang="it" lang3="ita">Altre intepretazioni</text>
-    <text xml:lang="la" lang3="lat">Aliae lectiones</text>
-    <text xml:lang="hr" lang3="hrv">Druga čitanja</text>
-    <text xml:lang="ko" lang3="kor">다른 해석</text>
-  </entry>
-  <entry>
-    <key>homeWord</key>
-    <text xml:lang="ca" lang3="cat">Principal</text>
-    <text xml:lang="en" lang3="eng">Home</text>
-    <text xml:lang="fr" lang3="fra">Accueil</text>
-    <text xml:lang="pl" lang3="pol">Strona główna</text>
-    <text xml:lang="sw" lang3="swe">Hem</text>
-    <text xml:lang="th" lang3="tha">หน้าแรก</text>
-    <text xml:lang="de" lang3="deu">Anfang</text>
-    <text xml:lang="pt" lang3="por">Página inicial</text>
-    <text xml:lang="ja" lang3="jpn">ホーム</text>
-    <text xml:lang="sl" lang3="slv">Domov</text>
-    <text xml:lang="zh-TW">首頁</text>
-    <text xml:lang="no" lang3="nor">Hjem</text>
-    <text xml:lang="ro" lang3="ron">Acasă</text>
-    <text xml:lang="it" lang3="ita">Home</text>
-    <text xml:lang="es" lang3="spa">Principal</text>
-    <text xml:lang="ko" lang3="kor">가정</text>
-  </entry>
-  <entry>
-    <key>Used by</key>
-    <text xml:lang="ca" lang3="cat">Usat per</text>
-    <text xml:lang="en" lang3="eng">Used by</text>
-    <text xml:lang="pl" lang3="pol">Użyto w</text>
-    <text xml:lang="sw" lang3="swe">Används av</text>
-    <text xml:lang="de" lang3="deu">Verwendet von</text>
-    <text xml:lang="pt" lang3="por">Usado por</text>
-    <text xml:lang="no" lang3="nor">Brukt av</text>
-    <text xml:lang="sl" lang3="slv">Uporabljen v</text>
-    <text xml:lang="ja" lang3="jpn">当該モジュールを使用するもの</text>
-    <text xml:lang="zh-TW">屬於</text>
-    <text xml:lang="th" lang3="tha">ใช้โดย</text>
-    <text xml:lang="ro" lang3="ron">Folosit de</text>
-    <text xml:lang="fr" lang3="fra">Utilisé par</text>
-    <text xml:lang="it" lang3="ita">Usato da</text>
-    <text xml:lang="es" lang3="spa">Usado por</text>
-    <text xml:lang="ko" lang3="kor">에 의해 사용된</text>
-  </entry>
-  <entry>
-    <key>May contain</key>
-    <text xml:lang="ca" lang3="cat">Pot contenir</text>
-    <text xml:lang="en" lang3="eng">May contain</text>
-    <text xml:lang="pl" lang3="pol">Może zawierać</text>
-    <text xml:lang="sw" lang3="swe">Kan innehålla</text>
-    <text xml:lang="de" lang3="deu">Kann enthalten</text>
-    <text xml:lang="pt" lang3="por">Pode conter</text>
-    <text xml:lang="th" lang3="tha">ประกอบด้วย</text>
-    <text xml:lang="ja" lang3="jpn">下位</text>
-    <text xml:lang="sl" lang3="slv">Lahko vsebuje</text>
-    <text xml:lang="zh-TW">可包含</text>
-    <text xml:lang="no" lang3="nor">Kan inneholde</text>
-    <text xml:lang="ro" lang3="ron">Poate conţine</text>
-    <text xml:lang="fr" lang3="fra">Peut contenir</text>
-    <text xml:lang="it" lang3="ita">Può contenere</text>
-    <text xml:lang="es" lang3="spa">Puede contener</text>
-    <text xml:lang="ko" lang3="kor">포함할 수 있다</text>
-  </entry>
-  <entry>
-    <key>Contained by</key>
-    <text xml:lang="ca" lang3="cat">Contingut en</text>
-    <text xml:lang="ro" lang3="ron">Conţinut de</text>
-    <text xml:lang="en" lang3="eng">Contained by</text>
-    <text xml:lang="pl" lang3="pol">Zawiera się w</text>
-    <text xml:lang="sw" lang3="swe">Ingår i</text>
-    <text xml:lang="de" lang3="deu">Enthalten in</text>
-    <text xml:lang="pt" lang3="por">Contido em</text>
-    <text xml:lang="sl" lang3="slv">Vsebovan v</text>
-    <text xml:lang="ja" lang3="jpn">上位</text>
-    <text xml:lang="zh-TW">可包含在於</text>
-    <text xml:lang="no" lang3="nor">Er en del av</text>
-    <text xml:lang="th" lang3="tha">บรรจุอยู่ใน</text>
-    <text xml:lang="fr" lang3="fra">Contenu dans</text>
-    <text xml:lang="it" lang3="ita">Contenuto in</text>
-    <text xml:lang="es" lang3="spa">Contenido en</text>
-    <text xml:lang="ko" lang3="kor">에 의해 포함된</text>
-  </entry>
-  <entry>
-    <key>Compact to XML format</key>
-    <text xml:lang="ca" lang3="cat">De format compacte a XML</text>
-    <text xml:lang="en" lang3="eng">Compact to XML format</text>
-    <text xml:lang="zh-TW">簡潔式轉到XML式</text>
-    <text xml:lang="it" lang3="ita">Compatta in formato XML</text>
-    <text xml:lang="fr" lang3="fra">Transformer en syntaxe XML</text>
-    <text xml:lang="pt" lang3="por">De Compact para formato XML</text>
-    <text xml:lang="ja" lang3="jpn">XML表記</text>
-    <text xml:lang="es" lang3="spa">De formato compacto a XML</text>
-    <text xml:lang="de" lang3="deu">Vom kompakten zum XML-Format</text>
-    <text xml:lang="ko" lang3="kor">XML 형식에 따른 규약?</text>
-  </entry>
-  <entry>
-    <key>XML format to compact</key>
-    <text xml:lang="ca" lang3="cat">De format XML a compacte</text>
-    <text xml:lang="en" lang3="eng">XML format to compact</text>
-    <text xml:lang="fr" lang3="fra">Transformer en syntaxe compact</text>
-    <text xml:lang="zh-TW">XML式轉到簡潔式</text>
-    <text xml:lang="it" lang3="ita">Formato XML da compattare</text>
-    <text xml:lang="pt" lang3="por">De formato XML para Compact</text>
-    <text xml:lang="ja" lang3="jpn">簡易表記</text>
-    <text xml:lang="es" lang3="spa">De formato XML a compacto</text>
-    <text xml:lang="de" lang3="deu">Vom XML-Format zum kompakten</text>
-    <text xml:lang="ko" lang3="kor">규약에 대한 XML 형식?</text>
-  </entry>
-  <entry>
-    <key>Empty element</key>
-    <text xml:lang="ca" lang3="cat">Element buit</text>
-    <text xml:lang="en" lang3="eng">Empty element</text>
-    <text xml:lang="fr" lang3="fra">Elément vide</text>
-    <text xml:lang="zh-TW">空白元素</text>
-    <text xml:lang="it" lang3="ita">Elemento vuoto</text>
-    <text xml:lang="pt" lang3="por">Elemento vazio</text>
-    <text xml:lang="ja" lang3="jpn">空要素</text>
-    <text xml:lang="es" lang3="spa">Elemento vacío</text>
-    <text xml:lang="de" lang3="deu">Leeres Element</text>
-    <text xml:lang="ko" lang3="kor">공백 요소</text>
-  </entry>
-  <entry>
-    <key>Character data only</key>
-    <text xml:lang="ca" lang3="cat">Sols dades de caràcters</text>
-    <text xml:lang="en" lang3="eng">Character data only</text>
-    <text xml:lang="fr" lang3="fra">Des données textuelles uniquement</text>
-    <text xml:lang="zh-TW">僅文字符號資料</text>
-    <text xml:lang="it" lang3="ita">Ammessi soltanto caratteri di testo</text>
-    <text xml:lang="ja" lang3="jpn">文字データのみ</text>
-    <text xml:lang="es" lang3="spa">Sólo datos de caracteres</text>
-    <text xml:lang="de" lang3="deu">Nur Zeichen</text>
-    <text xml:lang="ko" lang3="kor">문자 자료만 허용</text>
-  </entry>
-  <entry>
-    <key>separated by whitespace</key>
-    <text xml:lang="ca" lang3="cat">separat per espai en blanc</text>
-    <text xml:lang="en" lang3="eng">separated by whitespace</text>
-    <text xml:lang="fr" lang3="fra">séparé par un espace</text>
-    <text xml:lang="zh-TW">以空白鍵隔開</text>
-    <text xml:lang="it" lang3="ita">separato da spazio bianco</text>
-    <text xml:lang="pt" lang3="por">separado por espaços</text>
-    <text xml:lang="ja" lang3="jpn">空白文字で区切られる</text>
-    <text xml:lang="es" lang3="spa">separado por espacio en blanco</text>
-    <text xml:lang="de" lang3="deu">Durch Leerzeichen getrennt</text>
-    <text xml:lang="ko" lang3="kor">공백문자로 분리됨</text>
-  </entry>
-  <entry>
-    <key>Text body</key>
-    <text xml:lang="ca" lang3="cat">Cos del text</text>
-    <text xml:lang="en" lang3="eng">Text body</text>
-    <text xml:lang="fr" lang3="fra">Corps du texte</text>
-    <text xml:lang="zh-TW">正文</text>
-    <text xml:lang="it" lang3="ita">Corpo del testo</text>
-    <text xml:lang="pt" lang3="por">Texto</text>
-    <text xml:lang="ja" lang3="jpn">本文</text>
-    <text xml:lang="es" lang3="spa">Cuerpo del texto</text>
-    <text xml:lang="de" lang3="deu">Textkörper</text>
-    <text xml:lang="ko" lang3="kor">텍스트 본문</text>
-  </entry>
-  <entry>
-    <key>Back Matter</key>
-    <text xml:lang="ca" lang3="cat">Material final</text>
-    <text xml:lang="en" lang3="eng">Back Matter</text>
-    <text xml:lang="fr" lang3="fra">Annexes</text>
-    <text xml:lang="zh-TW">正文後資訊</text>
-    <text xml:lang="ja" lang3="jpn">後付</text>
-    <text xml:lang="it" lang3="ita">Sezioni conclusive</text>
-    <text xml:lang="pt" lang3="por">Anexos</text>
-    <text xml:lang="es" lang3="spa">Material final</text>
-    <text xml:lang="de" lang3="deu">Nachspann</text>
-    <text xml:lang="ko" lang3="kor">권말 부분</text>
-  </entry>
-  <entry>
-    <key>Front Matter</key>
-    <text xml:lang="ca" lang3="cat">Material preliminar</text>
-    <text xml:lang="en" lang3="eng">Front Matter</text>
-    <text xml:lang="fr" lang3="fra">Pièces liminaires</text>
-    <text xml:lang="zh-TW">正文前資訊</text>
-    <text xml:lang="it" lang3="ita">Sezioni preliminari</text>
-    <text xml:lang="pt" lang3="por">Front Matter</text>
-    <text xml:lang="ja" lang3="jpn">前付</text>
-    <text xml:lang="es" lang3="spa">Material preliminar</text>
-    <text xml:lang="de" lang3="deu">Vorspann</text>
-    <text xml:lang="ko" lang3="kor">책 앞부분</text>
-  </entry>
-  <entry>
-    <key>Getting the most recent version</key>
-    <text xml:lang="ca" lang3="cat">Obtenir la versió més recent</text>
-    <text xml:lang="en" lang3="eng">Getting the most recent version</text>
-    <text xml:lang="fr" lang3="fra">Obtenir la dernière version</text>
-    <text xml:lang="zh-TW">取得最新版本</text>
-    <text xml:lang="it" lang3="ita">Otteni la versione più recente</text>
-    <text xml:lang="pt" lang3="por">Como obter a versão mais recente</text>
-    <text xml:lang="ja" lang3="jpn">最新版の入手方法</text>
-    <text xml:lang="es" lang3="spa">Obtener la versión más reciente</text>
-    <text xml:lang="de" lang3="deu">Die aktuellste Version holen</text>
-    <text xml:lang="ko" lang3="kor">최신 버전 얻기</text>
-  </entry>
-  <entry>
-    <key>Sourceforge Subversion Repository</key>
-    <text xml:lang="ca" lang3="cat">Magatzem Subversion en Sourceforge</text>
-    <text xml:lang="en" lang3="eng">Sourceforge Subversion Repository</text>
-    <text xml:lang="fr" lang3="fra">Répertoire Subversion dans Sourceforge</text>
-    <text xml:lang="zh-TW">P5原始檔典藏@Sourceforge</text>
-    <text xml:lang="it" lang3="ita">Sourceforge Subversion Repository</text>
-    <text xml:lang="pt" lang3="por">Sourceforge Subversion Repository</text>
-    <text xml:lang="ja" lang3="jpn">各種データ(Sourceforge)</text>
-    <text xml:lang="es" lang3="spa">Almacén Subversion en Sourceforge</text>
-    <text xml:lang="de" lang3="deu">Sourceforge Subversion Repositorium</text>
-    <text xml:lang="ko" lang3="kor">소스 하위 버전 저장소 Sourceforge Subversion Repository</text>
-  </entry>
-  <entry>
-    <key>BugsFeatures</key>
-    <text xml:lang="ca" lang3="cat">Informes d'errors, peticions de característiques</text>
-    <text xml:lang="en" lang3="eng">Bug Reports, Feature Requests, etc.</text>
-    <text xml:lang="ja" lang3="jpn">バグ報告や要望など</text>
-    <text xml:lang="fr" lang3="fra">Rapports d'erreurs, demandes de modifications etc</text>
-    <text xml:lang="zh-TW">錯誤回報、功能要求等等。</text>
-    <text xml:lang="it" lang3="ita">Liste di bug, Richieste di nuove funzionalità, etc.</text>
-    <text xml:lang="pt" lang3="por">Relatório de Erros, Pedidos de Modificaçoes, etc.</text>
-    <text xml:lang="es" lang3="spa">Informes de errores, peticiones de características</text>
-    <text xml:lang="de" lang3="deu">Fehlerberichte, Anfragen zu Funktionen, etc.</text>
-    <text xml:lang="ko" lang3="kor">버그 보고, 특성 요구 등</text>
-  </entry>
-  <entry>
-    <key>Some Popular Sections</key>
-    <text xml:lang="ca" lang3="cat">Seccions populars</text>
-    <text xml:lang="ja" lang3="jpn">代表的な章</text>
-    <text xml:lang="en" lang3="eng">Some Popular Sections</text>
-    <text xml:lang="fr" lang3="fra">Parties les plus visitées</text>
-    <text xml:lang="zh-TW">一些受歡迎的章節</text>
-    <text xml:lang="it" lang3="ita">Alcune fra le sezioni più richieste</text>
-    <text xml:lang="pt" lang3="por">Algumas Secçoes Populares</text>
-    <text xml:lang="es" lang3="spa">Secciones populares</text>
-    <text xml:lang="de" lang3="deu">Einige beliebte Sektionen</text>
-    <text xml:lang="ko" lang3="kor">인기있는 절</text>
-  </entry>
-  <entry>
-    <key>GuidelinesTEI</key>
-    <text xml:lang="ca" lang3="cat">Directrius per a la codificació i l'intercanvi de textos electrònics</text>
-    <text xml:lang="ja" lang3="jpn">TEIガイドライン</text>
-    <text xml:lang="en" lang3="eng">Guidelines for Electronic Text Encoding and Interchange</text>
-    <text xml:lang="fr" lang3="fra">Principes directeurs pour l'encodage et l'échange de textes électroniques</text>
-    <text xml:lang="zh-TW">TEI指引</text>
-    <text xml:lang="it" lang3="ita">Linee guida per la codifica e l'interscambio del testo elettronico</text>
-    <text xml:lang="pt" lang3="por">Instruçoes para Electronic Text Encoding and Interchange</text>
-    <text xml:lang="es" lang3="spa">Directrices para la codificación y el intercambio de textos electrónicos</text>
-    <text xml:lang="de" lang3="deu">Richtlinien für die Auszeichnung und den Austausch elektronischer Texte</text>
-    <text xml:lang="ko" lang3="kor">전자 텍스트 부호화 및 교환에 대한 지침</text>
-  </entry>
-  <entry>
-    <key>edited by</key>
-    <text xml:lang="ca" lang3="cat">editat per</text>
-    <text xml:lang="en" lang3="eng">edited by</text>
-    <text xml:lang="fr" lang3="fra">édité par</text>
-    <text xml:lang="zh-TW">編輯者：</text>
-    <text xml:lang="it" lang3="ita">edito da</text>
-    <text xml:lang="pt" lang3="por">editado por</text>
-    <text xml:lang="ja" lang3="jpn">監修</text>
-    <text xml:lang="es" lang3="spa">editado por</text>
-    <text xml:lang="de" lang3="deu">ediert von</text>
-    <text xml:lang="ko" lang3="kor">에 의해 편집</text>
-  </entry>
-  <entry>
-    <key>Versions of the Guidelines</key>
-    <text xml:lang="ca" lang3="cat">Versions de les directrius</text>
-    <text xml:lang="en" lang3="eng">Versions of the Guidelines</text>
-    <text xml:lang="fr" lang3="fra">Versions des Principes directeurs</text>
-    <text xml:lang="zh-TW">指引版本</text>
-    <text xml:lang="it" lang3="ita">Versioni delle Linee guida</text>
-    <text xml:lang="pt" lang3="por">Versoes das instruçoes</text>
-    <text xml:lang="ko" lang3="kor">지침 버전</text>
-    <text xml:lang="ja" lang3="jpn">ガイドラインについて</text>
-    <text xml:lang="es" lang3="spa">Versiones de las directrices</text>
-    <text xml:lang="de" lang3="deu">Versionen der Richtlinien</text>
-  </entry>
-  <entry>
-    <key>Sorted alphabetically</key>
-    <text xml:lang="ca" lang3="cat">Ordenat alfabèticament</text>
-    <text xml:lang="en" lang3="eng">Sorted alphabetically</text>
-    <text xml:lang="it" lang3="ita">In ordine alfabetico</text>
-    <text xml:lang="zh-TW">按羅馬字母排序</text>
-    <text xml:lang="fr" lang3="fra">Trié alphabétiquement</text>
-    <text xml:lang="pt" lang3="por">Ordenado alfabeticamente</text>
-    <text xml:lang="ja" lang3="jpn">アルファベット順</text>
-    <text xml:lang="es" lang3="spa">Ordenado alfabéticamente</text>
-    <text xml:lang="de" lang3="deu">Alphabetisch geordnet</text>
-    <text xml:lang="ko" lang3="kor">알파벳 순</text>
-  </entry>
-  <entry>
-    <key>Show all</key>
-    <text xml:lang="ca" lang3="cat">Mostrar tot</text>
-    <text xml:lang="en" lang3="eng">Show all</text>
-    <text xml:lang="it" lang3="ita">Mostra tutto</text>
-    <text xml:lang="zh-TW">全部顯示</text>
-    <text xml:lang="fr" lang3="fra">Toute la liste</text>
-    <text xml:lang="pt" lang3="por">Mostre tudo</text>
-    <text xml:lang="ja" lang3="jpn">一括表示</text>
-    <text xml:lang="es" lang3="spa">Mostrar todo</text>
-    <text xml:lang="de" lang3="deu">Alle anzeigen</text>
-    <text xml:lang="ko" lang3="kor">모두 보기</text>
-  </entry>
-  <entry>
-    <key>Show by module</key>
-    <text xml:lang="ca" lang3="cat">Mostrar per mòdul</text>
-    <text xml:lang="en" lang3="eng">Show by module</text>
-    <text xml:lang="it" lang3="ita">Mostra modulo per modulo</text>
-    <text xml:lang="zh-TW">按模組顯示</text>
-    <text xml:lang="fr" lang3="fra">Par module</text>
-    <text xml:lang="pt" lang3="por">Mostre por módulo</text>
-    <text xml:lang="ja" lang3="jpn">モジュール別表示</text>
-    <text xml:lang="es" lang3="spa">Mostrar por módulo</text>
-    <text xml:lang="de" lang3="deu">Nach Modulen geordnet anzeigen</text>
-    <text xml:lang="ko" lang3="kor">모듈로 보기</text>
-  </entry>
-  <entry>
-    <key>occurrences of</key>
-    <text xml:lang="ca" lang3="cat">aparicions de</text>
-    <text xml:lang="en" lang3="eng">occurrences of</text>
-    <text xml:lang="es" lang3="spa">apariciones de</text>
-    <text xml:lang="de" lang3="deu">Vorkommen von</text>
-    <text xml:lang="it" lang3="ita">occorrenze di</text>
-    <text xml:lang="zh-TW">次可出現:</text>
-    <text xml:lang="ko" lang3="kor">출현</text>
-  </entry>
-  <entry>
-    <key>author</key>
-    <text xml:lang="en" lang3="eng">Author</text>
-    <text xml:lang="de" lang3="deu">Verfasser</text>
-    <text xml:lang="fr" lang3="fra">Auteur</text>
-    <text xml:lang="it" lang3="ita">Autore</text>
-    <text xml:lang="ko" lang3="kor">저자</text>
-  </entry>
-  <entry>
-    <key>title</key>
-    <text xml:lang="en" lang3="eng">Title</text>
-    <text xml:lang="de" lang3="deu">Titel</text>
-    <text xml:lang="fr" lang3="fra">Titre</text>
-    <text xml:lang="it" lang3="ita">Titolo</text>
-    <text xml:lang="ko" lang3="kor">제목</text>
-  </entry>
-  <entry>
-    <key>remarks</key>
-    <text xml:lang="en" lang3="eng">Remarks</text>
-    <text xml:lang="de" lang3="deu">Bemerkungen</text>
-    <text xml:lang="fr" lang3="fra">Remarques</text>
-    <text xml:lang="it" lang3="ita">Osservazioni</text>
-    <text xml:lang="ko" lang3="kor">해설</text>
-  </entry>
-  <entry>
-    <key>physDesc</key>
-    <text xml:lang="en" lang3="eng">Physical description</text>
-    <text xml:lang="de" lang3="deu">Äußere Beschreibung</text>
-    <text xml:lang="fr" lang3="fra">Description physique</text>
-    <text xml:lang="it" lang3="ita">Descrizione fisica</text>
-    <text xml:lang="ko" lang3="kor">물리적 기술</text>
-  </entry>
-  <entry>
-    <key>watermarks</key>
-    <text xml:lang="en" lang3="eng">Watermarks</text>
-    <text xml:lang="de" lang3="deu">Wasserzeichen</text>
-    <text xml:lang="fr" lang3="fra">Filigrane</text>
-    <text xml:lang="it" lang3="ita">Filigrana</text>
-    <text xml:lang="ko" lang3="kor">투명 표식</text>
-  </entry>
-  <entry>
-    <key>musicNotations</key>
-    <text xml:lang="en" lang3="eng">Musical notations</text>
-    <text xml:lang="de" lang3="deu">Musikalische Notationen</text>
-    <text xml:lang="fr" lang3="fra">Notation musicale</text>
-    <text xml:lang="it" lang3="ita">Notazioni musicali</text>
-    <text xml:lang="ko" lang3="kor">음악 표기법</text>
-  </entry>
-  <entry>
-    <key>history</key>
-    <text xml:lang="en" lang3="eng">History of the manuscript</text>
-    <text xml:lang="de" lang3="deu">Geschichte der Handschrift</text>
-    <text xml:lang="fr" lang3="fra">Histoire du manuscrit</text>
-    <text xml:lang="it" lang3="ita">Storia del manoscritto</text>
-    <text xml:lang="ko" lang3="kor">필사본 역사</text>
-  </entry>
-  <entry>
-    <key>availability</key>
-    <text xml:lang="en" lang3="eng">With kind permission of </text>
-    <text xml:lang="fr" lang3="fra">With kind permission of </text>
-    <text xml:lang="it" lang3="ita">With kind permission of </text>
-    <text xml:lang="de" lang3="deu">Mit freundlicher Genehmigung von</text>
-    <text xml:lang="ko" lang3="kor">친절한 허용</text>
-  </entry>
-  <entry>
-    <key>acquisition</key>
-    <text xml:lang="en" lang3="eng">Acquisition of the manuscript</text>
-    <text xml:lang="fr" lang3="fra">Acquisition du manuscrit</text>
-    <text xml:lang="it" lang3="ita">Acquisizione del manoscritto</text>
-    <text xml:lang="de" lang3="deu">Erwerb der Handschrift</text>
-    <text xml:lang="ko" lang3="kor">필사본의의 입수</text>
-  </entry>
-  <entry>
-    <key>additions</key>
-    <text xml:lang="en" lang3="eng">Additions</text>
-    <text xml:lang="fr" lang3="fra">Compléments à posteriori</text>
-    <text xml:lang="it" lang3="ita">Aggiunte</text>
-    <text xml:lang="de" lang3="deu">Spätere Ergänzungen</text>
-    <text xml:lang="ko" lang3="kor">추가사항</text>
-  </entry>
-  <entry>
-    <key>altIdentifier[@type="formerShelfmark"]</key>
-    <text xml:lang="en" lang3="eng">Former shelfmark</text>
-    <text xml:lang="fr" lang3="fra">Cote</text>
-    <text xml:lang="it" lang3="ita">segnatura</text>
-    <text xml:lang="de" lang3="deu">Frühere Signatur</text>
-    <text xml:lang="ko" lang3="kor">이전 서가기호</text>
-  </entry>
-  <entry>
-    <key>msPart</key>
-    <text xml:lang="en" lang3="eng">Manuscript part</text>
-    <text xml:lang="fr" lang3="fra">Partie du manuscrit</text>
-    <text xml:lang="it" lang3="ita">Sezione del manoscritto</text>
-    <text xml:lang="de" lang3="deu">Handschriftenteil</text>
-    <text xml:lang="ko" lang3="kor">필사본 부분</text>
-  </entry>
-  <entry>
-    <key>binding</key>
-    <text xml:lang="en" lang3="eng">Binding</text>
-    <text xml:lang="fr" lang3="fra">Couverture</text>
-    <text xml:lang="it" lang3="ita">Legatura</text>
-    <text xml:lang="de" lang3="deu">Einband</text>
-    <text xml:lang="ko" lang3="kor">제책</text>
-  </entry>
-  <entry>
-    <key>collation</key>
-    <text xml:lang="en" lang3="eng">Collation</text>
-    <text xml:lang="fr" lang3="fra">Composition des fascicules</text>
-    <text xml:lang="it" lang3="ita">Composizione dei fascicoli</text>
-    <text xml:lang="de" lang3="deu">Lagenstruktur</text>
-    <text xml:lang="ko" lang3="kor">쪽 순서 대조</text>
-  </entry>
-  <entry>
-    <key>condition</key>
-    <text xml:lang="en" lang3="eng">Condition</text>
-    <text xml:lang="fr" lang3="fra">Etat</text>
-    <text xml:lang="it" lang3="ita">Condizioni</text>
-    <text xml:lang="de" lang3="deu">Zustand</text>
-    <text xml:lang="ko" lang3="kor">상태</text>
-  </entry>
-  <entry>
-    <key>decoDesc</key>
-    <text xml:lang="en" lang3="eng">Decoration</text>
-    <text xml:lang="fr" lang3="fra">Reliure d'art</text>
-    <text xml:lang="it" lang3="ita">Decorazione</text>
-    <text xml:lang="de" lang3="deu">Buchschmuck</text>
-    <text xml:lang="ko" lang3="kor">장식</text>
-  </entry>
-  <entry>
-    <key>extent</key>
-    <text xml:lang="en" lang3="eng">Extent</text>
-    <text xml:lang="fr" lang3="fra">Volume</text>
-    <text xml:lang="it" lang3="ita">Dimensioni</text>
-    <text xml:lang="de" lang3="deu">Umfang</text>
-    <text xml:lang="ko" lang3="kor">분량</text>
-  </entry>
-  <entry>
-    <key>foliation</key>
-    <text xml:lang="en" lang3="eng">Foliation</text>
-    <text xml:lang="fr" lang3="fra">Numérotation des pages</text>
-    <text xml:lang="it" lang3="ita">Numerazione delle pagine</text>
-    <text xml:lang="de" lang3="deu">Seitennummerierung</text>
-    <text xml:lang="ko" lang3="kor">쪽수</text>
-  </entry>
-  <entry>
-    <key>handDesc</key>
-    <text xml:lang="en" lang3="eng">Writing and hands</text>
-    <text xml:lang="fr" lang3="fra">Type d'écritures et copistes</text>
-    <text xml:lang="it" lang3="ita">Tipo di scrittura e e mani</text>
-    <text xml:lang="de" lang3="deu">Schrift und Hände</text>
-    <text xml:lang="ko" lang3="kor">집필과 필체</text>
-  </entry>
-  <entry>
-    <key>msDesc/head/title</key>
-    <text xml:lang="en" lang3="eng">Author and title</text>
-    <text xml:lang="fr" lang3="fra">Auteur et titre</text>
-    <text xml:lang="it" lang3="ita">Autore e titolo</text>
-    <text xml:lang="de" lang3="deu">Autor und Titel</text>
-    <text xml:lang="ko" lang3="kor">저자와 제목</text>
-  </entry>
-  <entry>
-    <key>origPlace</key>
-    <text xml:lang="en" lang3="eng">Place of origin</text>
-    <text xml:lang="fr" lang3="fra">Origine</text>
-    <text xml:lang="it" lang3="ita">Luogo di origine</text>
-    <text xml:lang="de" lang3="deu">Entstehungsort</text>
-    <text xml:lang="ko" lang3="kor">원본 생산 장소</text>
-  </entry>
-  <entry>
-    <key>origDate</key>
-    <text xml:lang="en" lang3="eng">Date of origin</text>
-    <text xml:lang="fr" lang3="fra">Période</text>
-    <text xml:lang="it" lang3="ita">Datazione</text>
-    <text xml:lang="de" lang3="deu">Entstehungszeit</text>
-    <text xml:lang="ko" lang3="kor">원본 생산 날짜 </text>
-  </entry>
-  <entry>
-    <key>msDesc/head/note[@type="respStmt"]</key>
-    <text xml:lang="en" lang3="eng">Writer</text>
-    <text xml:lang="fr" lang3="fra">Scribe</text>
-    <text xml:lang="it" lang3="ita">Copista</text>
-    <text xml:lang="de" lang3="deu">Schreiber</text>
-    <text xml:lang="ko" lang3="kor">작가</text>
-  </entry>
-  <entry>
-    <key>provenance</key>
-    <text xml:lang="en" lang3="eng">Provenance of the manuscript</text>
-    <text xml:lang="fr" lang3="fra">Provenance du manuscrit</text>
-    <text xml:lang="it" lang3="ita">Provenienza del manoscritto</text>
-    <text xml:lang="de" lang3="deu">Provenienz der Handschrift</text>
-    <text xml:lang="ko" lang3="kor">필사본의 출처</text>
-  </entry>
-  <entry>
-    <key>layoutDesc | layout</key>
-    <text xml:lang="en" lang3="eng">Page layout</text>
-    <text xml:lang="fr" lang3="fra">Mise en page</text>
-    <text xml:lang="it" lang3="ita">Disposizione della pagina</text>
-    <text xml:lang="de" lang3="deu">Seiteneinrichtung</text>
-    <text xml:lang="ko" lang3="kor">페이지 레이아웃</text>
-  </entry>
-  <entry>
-    <key>msDesc/additional/listBibl</key>
-    <text xml:lang="en" lang3="eng">Bibliography</text>
-    <text xml:lang="fr" lang3="fra">Bibliographie</text>
-    <text xml:lang="it" lang3="ita">Bibliografia</text>
-    <text xml:lang="de" lang3="deu">Literaturverzeichnis</text>
-    <text xml:lang="ko" lang3="kor">서지항목</text>
-  </entry>
-  <entry>
-    <key>measure[@type="leaveSize"]</key>
-    <text xml:lang="en" lang3="eng">Format</text>
-    <text xml:lang="fr" lang3="fra">Format</text>
-    <text xml:lang="it" lang3="ita">Formato</text>
-    <text xml:lang="de" lang3="deu">Format</text>
-    <text xml:lang="ko" lang3="kor">형식</text>
-  </entry>
-  <entry>
-    <key>msContents</key>
-    <text xml:lang="en" lang3="eng">Contents</text>
-    <text xml:lang="fr" lang3="fra">Sommaire</text>
-    <text xml:lang="it" lang3="ita">Contenuto</text>
-    <text xml:lang="de" lang3="deu">Inhaltsangabe</text>
-    <text xml:lang="ko" lang3="kor">내용</text>
-  </entry>
-  <entry>
-    <key>origin</key>
-    <text xml:lang="en" lang3="eng">Origin of the manuscript</text>
-    <text xml:lang="fr" lang3="fra">Parution du manuscrit</text>
-    <text xml:lang="it" lang3="ita">Origine del manoscritto</text>
-    <text xml:lang="de" lang3="deu">Entstehung der Handschrift</text>
-    <text xml:lang="ko" lang3="kor">필사본의 유래</text>
-  </entry>
-  <entry>
-    <key>support</key>
-    <text xml:lang="en" lang3="eng">Support</text>
-    <text xml:lang="fr" lang3="fra">Support de substitution</text>
-    <text xml:lang="it" lang3="ita">Supporto materiale</text>
-    <text xml:lang="de" lang3="deu">Beschreibstoff</text>
-    <text xml:lang="ko" lang3="kor">지원</text>
-  </entry>
-  <entry>
-    <key>surrogates</key>
-    <text xml:lang="en" lang3="eng">Surrogates</text>
-    <text xml:lang="fr" lang3="fra">Surrogates</text>
-    <text xml:lang="it" lang3="ita">Surrogates</text>
-    <text xml:lang="de" lang3="deu">Sekundärformen</text>
-    <text xml:lang="ko" lang3="kor">대용</text>
-  </entry>
-  <entry>
-    <key>textLang</key>
-    <text xml:lang="en" lang3="eng">Main language</text>
-    <text xml:lang="fr" lang3="fra">Langue principale</text>
-    <text xml:lang="it" lang3="ita">Lingua principale</text>
-    <text xml:lang="de" lang3="deu">Hauptsprache</text>
-    <text xml:lang="ko" lang3="kor">주 언어</text>
-  </entry>
-  <entry>
-    <key>and</key>
-    <text xml:lang="en" lang3="eng">and</text>
-    <text xml:lang="de" lang3="deu">und</text>
-    <text xml:lang="es" lang3="spa">y</text>
-  </entry>
+	<entry>
+		<key>Sample values include</key>
+		<text xml:lang="en" lang3="eng">Sample values include</text>
+		<text xml:lang="de" lang3="deu">Beispielwerte sind etwa</text>
+		<text xml:lang="ro" lang3="ron">De exemplu, valorile pot fi</text>
+		<text xml:lang="fr" lang3="fra">Exemple de valeurs possibles</text>
+		<text xml:lang="pt" lang3="por">Exemplos de valores incluidos</text>
+		<text xml:lang="es" lang3="spa">Posibles valores</text>
+		<text xml:lang="it" lang3="ita">I valori esemplificativi includono</text>
+		<text xml:lang="sl" lang3="slv">Možne vrednosti so denimo</text>
+		<text xml:lang="sv" lang3="swe">Exempel på värden som kan inkluderas</text>
+		<text xml:lang="no" lang3="nor">Eksempler på mulige verdier er</text>
+		<text xml:lang="zh-TW">實例值包含</text>
+		<text xml:lang="sr" lang3="srp">Neke moguće vrednosti su</text>
+		<text xml:lang="ja" lang3="jpn">例としての値は以下の通り</text>
+		<text xml:lang="pl" lang3="pol">Przykładowe wartości obejmują</text>
+		<text xml:lang="hi" lang3="hin">misAla guNa mein Sammil Hai</text>
+		<text xml:lang="th" lang3="tha">รวมค่าตัวอย่าง</text>
+		<text xml:lang="nl" lang3="nld">Voorbeeldwaarden zijn onder meer</text>
+		<text xml:lang="ru" lang3="rus">Примерные величины включают</text>
+		<text xml:lang="tr" lang3="tur">Örnek değerler arasında</text>
+		<text xml:lang="bg" lang3="bul">Примерните стойности включват</text>
+		<text xml:lang="el" lang3="ell">Οι δειγματικές τιμές συμπεριλαμβάνουν</text>
+		<text xml:lang="ca" lang3="cat">Exemples de valors possibles</text>
+		<text xml:lang="la" lang3="lat">Valores exemplares</text>
+		<text xml:lang="hr" lang3="hrv">Primjer vrijednosti</text>
+		<text xml:lang="ko" lang3="kor">샘플 값은 다음을 포함한다 Sample values include</text>
+	</entry>
+	<entry>
+		<key>Status</key>
+		<text xml:lang="en" lang3="eng">Status</text>
+		<text xml:lang="de" lang3="deu">Zustand</text>
+		<text xml:lang="ro" lang3="ron">Stare</text>
+		<text xml:lang="fr" lang3="fra">Statut</text>
+		<text xml:lang="pt" lang3="por">Status</text>
+		<text xml:lang="es" lang3="spa">Estado</text>
+		<text xml:lang="it" lang3="ita">Stato</text>
+		<text xml:lang="sl" lang3="slv">Stanje</text>
+		<text xml:lang="sv" lang3="swe">Status</text>
+		<text xml:lang="no" lang3="nor">Status</text>
+		<text xml:lang="zh-TW">狀態</text>
+		<text xml:lang="sr" lang3="srp">Status</text>
+		<text xml:lang="ja" lang3="jpn">状態</text>
+		<text xml:lang="pl" lang3="pol">Status</text>
+		<text xml:lang="th" lang3="tha">สถานะ</text>
+		<text xml:lang="nl" lang3="nld">Status</text>
+		<text xml:lang="ru" lang3="rus">Состояние</text>
+		<text xml:lang="tr" lang3="tur">Durum</text>
+		<text xml:lang="bg" lang3="bul">Състояние</text>
+		<text xml:lang="el" lang3="ell">Κατάσταση</text>
+		<text xml:lang="ca" lang3="cat">Estat</text>
+		<text xml:lang="la" lang3="lat">Status</text>
+		<text xml:lang="hr" lang3="hrv">Stanje</text>
+		<text xml:lang="ko" lang3="kor">상태</text>
+	</entry>
+	<entry>
+		<key>Suggested values include</key>
+		<text xml:lang="es" lang3="spa">Los valores sugeridos incluyen</text>
+		<text xml:lang="en" lang3="eng">Suggested values include</text>
+		<text xml:lang="de" lang3="deu">Empfohlene Werte sind</text>
+		<text xml:lang="ro" lang3="ron">Valori recomandate sunt</text>
+		<text xml:lang="fr" lang3="fra">Les valeurs suggérées comprennent</text>
+		<text xml:lang="pt" lang3="por">Os valores sugeridos incluem</text>
+		<text xml:lang="it" lang3="ita">I valori suggeriti includono</text>
+		<text xml:lang="sl" lang3="slv">Priporočene vrednosti so denimo</text>
+		<text xml:lang="sv" lang3="swe">Förslag på värden som bör inkluderas</text>
+		<text xml:lang="no" lang3="nor">Eksempler på verdier som foreslås er</text>
+		<text xml:lang="zh-TW">被推薦的值包含</text>
+		<text xml:lang="sr" lang3="srp">Preporučene vrednosti su</text>
+		<text xml:lang="ja" lang3="jpn">提案する値は以下の通り</text>
+		<text xml:lang="pl" lang3="pol">Sugerowane wartości obejmują</text>
+		<text xml:lang="hi" lang3="hin">sujheeT guNa mein Sammil Hai</text>
+		<text xml:lang="th" lang3="tha">รวมค่าแนะนำ</text>
+		<text xml:lang="nl" lang3="nld">Voorgestelde waarden</text>
+		<text xml:lang="ru" lang3="rus">Рекомендуемые величины включают</text>
+		<text xml:lang="tr" lang3="tur">Önerilen değerler arasında</text>
+		<text xml:lang="bg" lang3="bul">Препоръчваните стойности включват</text>
+		<text xml:lang="el" lang3="ell">Οι συστημένες τιμές συμπεριλαμβάνουν</text>
+		<text xml:lang="ca" lang3="cat">Exemples de valors suggerits</text>
+		<text xml:lang="la" lang3="lat">Valores propositae sunt</text>
+		<text xml:lang="hr" lang3="hrv">Predložene su vrijednosti</text>
+		<text xml:lang="ko" lang3="kor">제안값은 다음을 포함한다</text>
+	</entry>
+	<entry>
+		<key>Values</key>
+		<text xml:lang="en" lang3="eng">Values</text>
+		<text xml:lang="de" lang3="deu">Werte</text>
+		<text xml:lang="ro" lang3="ron">Valori</text>
+		<text xml:lang="fr" lang3="fra">Valeurs</text>
+		<text xml:lang="pt" lang3="por">Valores</text>
+		<text xml:lang="es" lang3="spa">Valores</text>
+		<text xml:lang="it" lang3="ita">Valori</text>
+		<text xml:lang="sl" lang3="slv">Vrednosti</text>
+		<text xml:lang="sv" lang3="swe">Värden</text>
+		<text xml:lang="no" lang3="nor">Verdier</text>
+		<text xml:lang="zh-TW">值</text>
+		<text xml:lang="sr" lang3="srp">Vrednosti</text>
+		<text xml:lang="ja" lang3="jpn">値</text>
+		<text xml:lang="pl" lang3="pol">Wartości</text>
+		<text xml:lang="hi" lang3="hin">guNa</text>
+		<text xml:lang="nl" lang3="nld">Waarden</text>
+		<text xml:lang="ru" lang3="rus">Величины</text>
+		<text xml:lang="tr" lang3="tur">Değerler</text>
+		<text xml:lang="bg" lang3="bul">Стойности</text>
+		<text xml:lang="el" lang3="ell">Τιμές</text>
+		<text xml:lang="ca" lang3="cat">Valors</text>
+		<text xml:lang="la" lang3="lat">Valores</text>
+		<text xml:lang="hr" lang3="hrv">Vrijednosti</text>
+		<text xml:lang="ko" lang3="kor">값</text>
+	</entry>
+	<entry>
+		<key>include</key>
+		<text xml:lang="en" lang3="eng">include</text>
+		<text xml:lang="de" lang3="deu">enthalten</text>
+		<text xml:lang="ro" lang3="ron">conţin</text>
+		<text xml:lang="fr" lang3="fra">inclure</text>
+		<text xml:lang="pt" lang3="por">inclui (incluem)</text>
+		<text xml:lang="es" lang3="spa">incluir</text>
+		<text xml:lang="it" lang3="ita">include</text>
+		<text xml:lang="sl" lang3="slv">vsebuje</text>
+		<text xml:lang="sv" lang3="swe">inkludera</text>
+		<text xml:lang="no" lang3="nor">inkludere</text>
+		<text xml:lang="zh-TW">包含</text>
+		<text xml:lang="sr" lang3="srp">uključuje</text>
+		<text xml:lang="ja" lang3="jpn">含む</text>
+		<text xml:lang="pl" lang3="pol">włącz</text>
+		<text xml:lang="hi" lang3="hin">sammil</text>
+		<text xml:lang="th" lang3="tha">รวมถึง</text>
+		<text xml:lang="nl" lang3="nld">zijn onder meer</text>
+		<text xml:lang="ru" lang3="rus">включить</text>
+		<text xml:lang="tr" lang3="tur">içer</text>
+		<text xml:lang="bg" lang3="bul">включи</text>
+		<text xml:lang="el" lang3="ell">ενσωμάτωσης</text>
+		<text xml:lang="ca" lang3="cat">inclou</text>
+		<text xml:lang="la" lang3="lat">inclusum est</text>
+		<text xml:lang="hr" lang3="hrv">sadrži</text>
+		<text xml:lang="ko" lang3="kor">포함한다</text>
+	</entry>
+	<entry>
+		<key>appendixWords</key>
+		<text xml:lang="en" lang3="eng">Appendix</text>
+		<text xml:lang="de" lang3="deu">Anhang</text>
+		<text xml:lang="ro" lang3="ron">Apendice</text>
+		<text xml:lang="fr" lang3="fra">Annexe</text>
+		<text xml:lang="pt" lang3="por">Apêndice</text>
+		<text xml:lang="es" lang3="spa">Apéndice</text>
+		<text xml:lang="it" lang3="ita">Appendice</text>
+		<text xml:lang="sl" lang3="slv">Dodatek</text>
+		<text xml:lang="sv" lang3="swe">Bilaga</text>
+		<text xml:lang="no" lang3="nor">Vedlegg</text>
+		<text xml:lang="zh-TW">附錄</text>
+		<text xml:lang="sr" lang3="srp">Dodatak</text>
+		<text xml:lang="ja" lang3="jpn">付録</text>
+		<text xml:lang="pl" lang3="pol">Dodatek</text>
+		<text xml:lang="hi" lang3="hin">Atirikta</text>
+		<text xml:lang="th" lang3="tha">ภาคผนวก</text>
+		<text xml:lang="nl" lang3="nld">Appendix</text>
+		<text xml:lang="ru" lang3="rus">Приложение</text>
+		<text xml:lang="tr" lang3="tur">Ek</text>
+		<text xml:lang="bg" lang3="bul">Приложение</text>
+		<text xml:lang="el" lang3="ell">Παράρτημα</text>
+		<text xml:lang="ca" lang3="cat">Apèndix</text>
+		<text xml:lang="la" lang3="lat">Appendix</text>
+		<text xml:lang="hr" lang3="hrv">Dodatak</text>
+		<text xml:lang="ko" lang3="kor">부록</text>
+	</entry>
+	<entry>
+		<key>editorWord</key>
+		<text xml:lang="en" lang3="eng">Editor</text>
+	</entry>
+	<entry>
+		<key>authorWord</key>
+		<text xml:lang="en" lang3="eng">Author</text>
+		<text xml:lang="de" lang3="deu">Autor</text>
+		<text xml:lang="ro" lang3="ron">Autor</text>
+		<text xml:lang="fr" lang3="fra">Auteur</text>
+		<text xml:lang="pt" lang3="por">Autor</text>
+		<text xml:lang="es" lang3="spa">Autor</text>
+		<text xml:lang="it" lang3="ita">Autore</text>
+		<text xml:lang="sl" lang3="slv">Avtor</text>
+		<text xml:lang="sv" lang3="swe">Författare</text>
+		<text xml:lang="no" lang3="nor">Forfatter</text>
+		<text xml:lang="zh-TW">作者</text>
+		<text xml:lang="sr" lang3="srp">Autor</text>
+		<text xml:lang="ja" lang3="jpn">著者</text>
+		<text xml:lang="pl" lang3="pol">Autor</text>
+		<text xml:lang="hi" lang3="hin">Lekhaka</text>
+		<text xml:lang="th" lang3="tha">ผู้แต่ง</text>
+		<text xml:lang="nl" lang3="nld">Auteur</text>
+		<text xml:lang="ru" lang3="rus">Автор</text>
+		<text xml:lang="tr" lang3="tur">Yazar</text>
+		<text xml:lang="bg" lang3="bul">Автор</text>
+		<text xml:lang="el" lang3="ell">Δημιουργός</text>
+		<text xml:lang="ca" lang3="cat">Autor</text>
+		<text xml:lang="la" lang3="lat">Auctor</text>
+		<text xml:lang="hr" lang3="hrv">Autor</text>
+		<text xml:lang="ko" lang3="kor">저자</text>
+	</entry>
+	<entry>
+		<key>biblioWords</key>
+		<text xml:lang="en" lang3="eng">Bibliography</text>
+		<text xml:lang="de" lang3="deu">Bibliographie</text>
+		<text xml:lang="ro" lang3="ron">Bibliografie</text>
+		<text xml:lang="fr" lang3="fra">Bibliographie</text>
+		<text xml:lang="pt" lang3="por">Bibiografia</text>
+		<text xml:lang="es" lang3="spa">Bibliografía</text>
+		<text xml:lang="it" lang3="ita">Bibliografia</text>
+		<text xml:lang="sl" lang3="slv">Bibliografija</text>
+		<text xml:lang="sv" lang3="swe">Bibliografi</text>
+		<text xml:lang="no" lang3="nor">Bibliografi</text>
+		<text xml:lang="zh-TW">參考書目</text>
+		<text xml:lang="sr" lang3="srp">Bibliografija</text>
+		<text xml:lang="ja" lang3="jpn">目録</text>
+		<text xml:lang="pl" lang3="pol">Bibliografia</text>
+		<text xml:lang="hi" lang3="hin">Bibliography</text>
+		<text xml:lang="th" lang3="tha">บรรณานุกรม</text>
+		<text xml:lang="nl" lang3="nld">Bibliografie</text>
+		<text xml:lang="ru" lang3="rus">Библиография</text>
+		<text xml:lang="tr" lang3="tur">Bibliyografya</text>
+		<text xml:lang="bg" lang3="bul">Литература</text>
+		<text xml:lang="el" lang3="ell">Βιβλιογραφία</text>
+		<text xml:lang="ca" lang3="cat">Bibliografia</text>
+		<text xml:lang="la" lang3="lat">Auctores</text>
+		<text xml:lang="hr" lang3="hrv">Bibliografija</text>
+		<text xml:lang="ko" lang3="kor">서지목록</text>
+	</entry>
+	<entry>
+		<key>contentsHeading</key>
+		<text xml:lang="en" lang3="eng">Sections in this document:</text>
+		<text xml:lang="de" lang3="deu">Abschnitte in diesem Dokument:</text>
+		<text xml:lang="ro" lang3="ron">Capitolele acestui document:</text>
+		<text xml:lang="fr" lang3="fra">Sections de ce document:</text>
+		<text xml:lang="pt" lang3="por">Índice geral:</text>
+		<text xml:lang="es" lang3="spa">Secciones en este documento:</text>
+		<text xml:lang="it" lang3="ita">Sommario di questo documento:</text>
+		<text xml:lang="sl" lang3="slv">Razdelki v tem dokumentu:</text>
+		<text xml:lang="sv" lang3="swe">Sektioner i detta dokument</text>
+		<text xml:lang="no" lang3="nor">Deler i dette dokumentet:</text>
+		<text xml:lang="zh-TW">本文章節:</text>
+		<text xml:lang="sr" lang3="srp">Odeljci u ovom dokumentu:</text>
+		<text xml:lang="ja" lang3="jpn">表題</text>
+		<text xml:lang="pl" lang3="pol">Sekcje zawarte w bieżącym dokumencie:</text>
+		<text xml:lang="th" lang3="tha">บทในเอกสารนี้</text>
+		<text xml:lang="nl" lang3="nld">Onderdelen van dit document:</text>
+		<text xml:lang="ru" lang3="rus">Разделы в этом документе:</text>
+		<text xml:lang="tr" lang3="tur">Bu belgenin bölümleri:</text>
+		<text xml:lang="bg" lang3="bul">Раздели в този документ:</text>
+		<text xml:lang="el" lang3="ell">Τμήματα αυτού του εγγράφου:</text>
+		<text xml:lang="ca" lang3="cat">Seccions en aquest document:</text>
+		<text xml:lang="la" lang3="lat">Capitula textus:</text>
+		<text xml:lang="hr" lang3="hrv">Odjeljci ovog dokumenta:</text>
+		<text xml:lang="ko" lang3="kor">본 문서의 절</text>
+	</entry>
+	<entry>
+		<key>contentsWord</key>
+		<text xml:lang="en" lang3="eng">Contents</text>
+		<text xml:lang="de" lang3="deu">Inhalt</text>
+		<text xml:lang="ro" lang3="ron">Cuprins</text>
+		<text xml:lang="fr" lang3="fra">Contenu</text>
+		<text xml:lang="pt" lang3="por">Índice geral</text>
+		<text xml:lang="es" lang3="spa">Contenidos</text>
+		<text xml:lang="sl" lang3="slv">Vsebina</text>
+		<text xml:lang="sv" lang3="swe">Innehåll</text>
+		<text xml:lang="no" lang3="nor">Innhold</text>
+		<text xml:lang="zh-TW">內容</text>
+		<text xml:lang="sr" lang3="srp">Sadržaj</text>
+		<text xml:lang="ja" lang3="jpn">目次</text>
+		<text xml:lang="pl" lang3="pol">Spis treści</text>
+		<text xml:lang="hi" lang3="hin">Mula Shabda</text>
+		<text xml:lang="th" lang3="tha">เนื้อหา</text>
+		<text xml:lang="nl" lang3="nld">Inhoud</text>
+		<text xml:lang="ru" lang3="rus">Оглавление</text>
+		<text xml:lang="tr" lang3="tur">İçerik</text>
+		<text xml:lang="bg" lang3="bul">Съдържание</text>
+		<text xml:lang="el" lang3="ell">Περιεχόμενα</text>
+		<text xml:lang="ca" lang3="cat">Índex general</text>
+		<text xml:lang="it" lang3="ita">Argomenti</text>
+		<text xml:lang="la" lang3="lat">Tabula contentorum</text>
+		<text xml:lang="hr" lang3="hrv">Sadržaj</text>
+		<text xml:lang="ko" lang3="kor">내용</text>
+	</entry>
+	<entry>
+		<key>dateWord</key>
+		<text xml:lang="en" lang3="eng">Date</text>
+		<text xml:lang="de" lang3="deu">Datum</text>
+		<text xml:lang="ro" lang3="ron">Data</text>
+		<text xml:lang="fr" lang3="fra">Date</text>
+		<text xml:lang="pt" lang3="por">Data</text>
+		<text xml:lang="es" lang3="spa">Fecha</text>
+		<text xml:lang="it" lang3="ita">Data</text>
+		<text xml:lang="sl" lang3="slv">Datum</text>
+		<text xml:lang="sv" lang3="swe">Datum</text>
+		<text xml:lang="no" lang3="nor">Dato</text>
+		<text xml:lang="zh-TW">日期</text>
+		<text xml:lang="sr" lang3="srp">Datum</text>
+		<text xml:lang="ja" lang3="jpn">日付</text>
+		<text xml:lang="pl" lang3="pol">Data</text>
+		<text xml:lang="hi" lang3="hin">Tarikha</text>
+		<text xml:lang="th" lang3="tha">วันที่</text>
+		<text xml:lang="nl" lang3="nld">Datum</text>
+		<text xml:lang="ru" lang3="rus">Дата</text>
+		<text xml:lang="tr" lang3="tur">Tarih</text>
+		<text xml:lang="bg" lang3="bul">Дата</text>
+		<text xml:lang="el" lang3="ell">Ημερομηνία</text>
+		<text xml:lang="ca" lang3="cat">Dataa</text>
+		<text xml:lang="la" lang3="lat">Die dato</text>
+		<text xml:lang="hr" lang3="hrv">Datum</text>
+		<text xml:lang="ko" lang3="kor">날짜</text>
+	</entry>
+	<entry>
+		<key>feedbackWords</key>
+		<text xml:lang="en" lang3="eng">Feedback</text>
+		<text xml:lang="de" lang3="deu">Kommentare</text>
+		<text xml:lang="ro" lang3="ron">Retur</text>
+		<text xml:lang="fr" lang3="fra">Commentaires</text>
+		<text xml:lang="pt" lang3="por">Comentários</text>
+		<text xml:lang="es" lang3="spa">Comentarios</text>
+		<text xml:lang="it" lang3="ita">Commenti e suggerimenti</text>
+		<text xml:lang="sl" lang3="slv">Odzivi</text>
+		<text xml:lang="sv" lang3="swe">Kommentarer</text>
+		<text xml:lang="no" lang3="nor">Kommentarer</text>
+		<text xml:lang="zh-TW">回饋</text>
+		<text xml:lang="sr" lang3="srp">Komentari</text>
+		<text xml:lang="ja" lang3="jpn">ご意見・ご感想</text>
+		<text xml:lang="pl" lang3="pol">Komentarze</text>
+		<text xml:lang="hi" lang3="hin">Tippani</text>
+		<text xml:lang="th" lang3="tha">ตอบกลับ</text>
+		<text xml:lang="nl" lang3="nld">Feedback</text>
+		<text xml:lang="ru" lang3="rus">Отзывы</text>
+		<text xml:lang="tr" lang3="tur">Geri besleme</text>
+		<text xml:lang="bg" lang3="bul">Коментари</text>
+		<text xml:lang="el" lang3="ell">Γνώμες</text>
+		<text xml:lang="ca" lang3="cat">Comentaris</text>
+		<text xml:lang="la" lang3="lat">Responsiones</text>
+		<text xml:lang="hr" lang3="hrv">Komentari</text>
+		<text xml:lang="ko" lang3="kor">피드백</text>
+	</entry>
+	<entry>
+		<key>figureWord</key>
+		<text xml:lang="en" lang3="eng">Figure</text>
+		<text xml:lang="de" lang3="deu">Abbildung</text>
+		<text xml:lang="ro" lang3="ron">Figura</text>
+		<text xml:lang="fr" lang3="fra">Figure</text>
+		<text xml:lang="pt" lang3="por">Figura</text>
+		<text xml:lang="es" lang3="spa">Imagen</text>
+		<text xml:lang="it" lang3="ita">Figura</text>
+		<text xml:lang="sl" lang3="slv">Slika</text>
+		<text xml:lang="sv" lang3="swe">Figur</text>
+		<text xml:lang="no" lang3="nor">Figur</text>
+		<text xml:lang="zh-TW">圖表</text>
+		<text xml:lang="sr" lang3="srp">Slika</text>
+		<text xml:lang="ja" lang3="jpn">図</text>
+		<text xml:lang="pl" lang3="pol">Rysunek</text>
+		<text xml:lang="hi" lang3="hin">Chitr</text>
+		<text xml:lang="th" lang3="tha">ภาพ</text>
+		<text xml:lang="nl" lang3="nld">Afbeelding</text>
+		<text xml:lang="ru" lang3="rus">Фигура</text>
+		<text xml:lang="tr" lang3="tur">Şekil</text>
+		<text xml:lang="bg" lang3="bul">Фигура</text>
+		<text xml:lang="el" lang3="ell">Σχήμα</text>
+		<text xml:lang="ca" lang3="cat">Figura</text>
+		<text xml:lang="la" lang3="lat">Figura</text>
+		<text xml:lang="hr" lang3="hrv">Ilustracija</text>
+		<text xml:lang="ko" lang3="kor">그림</text>
+	</entry>
+	<entry>
+		<key>figureWords</key>
+		<text xml:lang="en" lang3="eng">Figures</text>
+		<text xml:lang="de" lang3="deu">Abbildungen</text>
+		<text xml:lang="ro" lang3="ron">Figuri</text>
+		<text xml:lang="fr" lang3="fra">Figures</text>
+		<text xml:lang="pt" lang3="por">Figuras</text>
+		<text xml:lang="es" lang3="spa">Imágenes</text>
+		<text xml:lang="it" lang3="ita">Figure</text>
+		<text xml:lang="sl" lang3="slv">Slike</text>
+		<text xml:lang="sv" lang3="swe">Figurer</text>
+		<text xml:lang="no" lang3="nor">Figurer</text>
+		<text xml:lang="zh-TW">圖表</text>
+		<text xml:lang="sr" lang3="srp">Slike</text>
+		<text xml:lang="ja" lang3="jpn">図</text>
+		<text xml:lang="pl" lang3="pol">Rysunki</text>
+		<text xml:lang="hi" lang3="hin">Chitr</text>
+		<text xml:lang="th" lang3="tha">ภาพ</text>
+		<text xml:lang="nl" lang3="nld">Afbeeldingen</text>
+		<text xml:lang="ru" lang3="rus">Фигуры</text>
+		<text xml:lang="tr" lang3="tur">Şekiller</text>
+		<text xml:lang="bg" lang3="bul">Фигури</text>
+		<text xml:lang="el" lang3="ell">Σχήματα</text>
+		<text xml:lang="ca" lang3="cat">Figures</text>
+		<text xml:lang="la" lang3="lat">Figurae</text>
+		<text xml:lang="hr" lang3="hrv">Ilustracije</text>
+		<text xml:lang="ko" lang3="kor">그림들</text>
+	</entry>
+	<entry>
+		<key>nextWord</key>
+		<text xml:lang="en" lang3="eng">Next</text>
+		<text xml:lang="de" lang3="deu">Nächstes</text>
+		<text xml:lang="ro" lang3="ron">Următorul</text>
+		<text xml:lang="fr" lang3="fra">Suivant</text>
+		<text xml:lang="pt" lang3="por">Seguinte</text>
+		<text xml:lang="es" lang3="spa">Siguiente</text>
+		<text xml:lang="it" lang3="ita">Seguente</text>
+		<text xml:lang="sl" lang3="slv">Naslednji</text>
+		<text xml:lang="sv" lang3="swe">Nästa</text>
+		<text xml:lang="no" lang3="nor">Neste</text>
+		<text xml:lang="zh-TW">下一頁</text>
+		<text xml:lang="sr" lang3="srp">Sledeći</text>
+		<text xml:lang="ja" lang3="jpn">次</text>
+		<text xml:lang="pl" lang3="pol">Następny</text>
+		<text xml:lang="hi" lang3="hin">Agala</text>
+		<text xml:lang="th" lang3="tha">ต่อไป</text>
+		<text xml:lang="nl" lang3="nld">Volgende</text>
+		<text xml:lang="ru" lang3="rus">Следующий</text>
+		<text xml:lang="tr" lang3="tur">Sonraki</text>
+		<text xml:lang="bg" lang3="bul">Следващ</text>
+		<text xml:lang="el" lang3="ell">Επόμενος</text>
+		<text xml:lang="ca" lang3="cat">Següent</text>
+		<text xml:lang="la" lang3="lat">Porro</text>
+		<text xml:lang="hr" lang3="hrv">Dalje</text>
+		<text xml:lang="ko" lang3="kor">다음</text>
+	</entry>
+	<entry>
+		<key>noteHeading</key>
+		<text xml:lang="en" lang3="eng">Notes</text>
+		<text xml:lang="de" lang3="deu">Noten</text>
+		<text xml:lang="ro" lang3="ron">Note</text>
+		<text xml:lang="fr" lang3="fra">Notes</text>
+		<text xml:lang="pt" lang3="por">Nota</text>
+		<text xml:lang="es" lang3="spa">Notas</text>
+		<text xml:lang="it" lang3="ita">Note</text>
+		<text xml:lang="sl" lang3="slv">Opombe</text>
+		<text xml:lang="sv" lang3="swe">Noteringar</text>
+		<text xml:lang="no" lang3="nor">Noter</text>
+		<text xml:lang="zh-TW">註解</text>
+		<text xml:lang="sr" lang3="srp">Napomene</text>
+		<text xml:lang="ja" lang3="jpn">注釈</text>
+		<text xml:lang="pl" lang3="pol">Uwagi</text>
+		<text xml:lang="hi" lang3="hin">Dhyan</text>
+		<text xml:lang="th" lang3="tha">หมายเหตุ</text>
+		<text xml:lang="nl" lang3="nld">Opmerkingen</text>
+		<text xml:lang="ru" lang3="rus">Примечания</text>
+		<text xml:lang="tr" lang3="tur">Notlar</text>
+		<text xml:lang="bg" lang3="bul">Забележки</text>
+		<text xml:lang="el" lang3="ell">Σχόλια</text>
+		<text xml:lang="ca" lang3="cat">Notes</text>
+		<text xml:lang="la" lang3="lat">Notae</text>
+		<text xml:lang="hr" lang3="hrv">Bilješke</text>
+		<text xml:lang="ko" lang3="kor">주석</text>
+	</entry>
+	<entry>
+		<key>previousWord</key>
+		<text xml:lang="en" lang3="eng">Previous</text>
+		<text xml:lang="de" lang3="deu">Vorheriges</text>
+		<text xml:lang="ro" lang3="ron">Precedentul</text>
+		<text xml:lang="fr" lang3="fra">Précédent</text>
+		<text xml:lang="pt" lang3="por">Prévio</text>
+		<text xml:lang="es" lang3="spa">Anterior</text>
+		<text xml:lang="it" lang3="ita">Precedente</text>
+		<text xml:lang="sl" lang3="slv">Prejšnji</text>
+		<text xml:lang="sv" lang3="swe">Föregående</text>
+		<text xml:lang="no" lang3="nor">Forrige</text>
+		<text xml:lang="zh-TW">上一頁</text>
+		<text xml:lang="sr" lang3="srp">Prethodni</text>
+		<text xml:lang="ja" lang3="jpn">前</text>
+		<text xml:lang="pl" lang3="pol">Poprzedni</text>
+		<text xml:lang="hi" lang3="hin">Purva"</text>
+		<text xml:lang="nl" lang3="nld">Vorige</text>
+		<text xml:lang="ru" lang3="rus">Предыдущий</text>
+		<text xml:lang="tr" lang3="tur">Önceki</text>
+		<text xml:lang="bg" lang3="bul">Предходен</text>
+		<text xml:lang="el" lang3="ell">Προηγούμενος</text>
+		<text xml:lang="ca" lang3="cat">Anterior</text>
+		<text xml:lang="la" lang3="lat">Retro</text>
+		<text xml:lang="hr" lang3="hrv">Natrag</text>
+		<text xml:lang="ko" lang3="kor">이전</text>
+	</entry>
+	<entry>
+		<key>revisedWord</key>
+		<text xml:lang="en" lang3="eng">revised</text>
+		<text xml:lang="de" lang3="deu">überarbeitet</text>
+		<text xml:lang="ro" lang3="ron">revăzut</text>
+		<text xml:lang="fr" lang3="fra">révisé</text>
+		<text xml:lang="pt" lang3="por">revisto</text>
+		<text xml:lang="es" lang3="spa">Revisado</text>
+		<text xml:lang="it" lang3="ita">revisionato</text>
+		<text xml:lang="sl" lang3="slv">dopolnjeno</text>
+		<text xml:lang="sv" lang3="swe">Ändrad</text>
+		<text xml:lang="no" lang3="nor">Revidert</text>
+		<text xml:lang="zh-TW">修訂</text>
+		<text xml:lang="sr" lang3="srp">izmenjeno</text>
+		<text xml:lang="ja" lang3="jpn">改訂</text>
+		<text xml:lang="pl" lang3="pol">poprawione</text>
+		<text xml:lang="hi" lang3="hin">duharAnA</text>
+		<text xml:lang="th" lang3="tha">ทบทวน</text>
+		<text xml:lang="nl" lang3="nld">herzien</text>
+		<text xml:lang="ru" lang3="rus">Пересмотрено</text>
+		<text xml:lang="tr" lang3="tur">Düzeltilmiş</text>
+		<text xml:lang="bg" lang3="bul">Променено</text>
+		<text xml:lang="el" lang3="ell">Μετάβλητο</text>
+		<text xml:lang="ca" lang3="cat">Revisat</text>
+		<text xml:lang="la" lang3="lat">Accurate revisum</text>
+		<text xml:lang="hr" lang3="hrv">Pregledano</text>
+		<text xml:lang="ko" lang3="kor">수정</text>
+	</entry>
+	<entry>
+		<key>searchWords</key>
+		<text xml:lang="en" lang3="eng">Search</text>
+		<text xml:lang="de" lang3="deu">Suche</text>
+		<text xml:lang="ro" lang3="ron">Caută</text>
+		<text xml:lang="fr" lang3="fra">Recherche</text>
+		<text xml:lang="pt" lang3="por">Pesquisa</text>
+		<text xml:lang="es" lang3="spa">Buscar</text>
+		<text xml:lang="it" lang3="ita">Cerca</text>
+		<text xml:lang="sl" lang3="slv">Iskanje</text>
+		<text xml:lang="sv" lang3="swe">Sök</text>
+		<text xml:lang="no" lang3="nor">Sok</text>
+		<text xml:lang="zh-TW">搜尋</text>
+		<text xml:lang="sr" lang3="srp">Pretraga</text>
+		<text xml:lang="ja" lang3="jpn">検索</text>
+		<text xml:lang="pl" lang3="pol">Szukaj</text>
+		<text xml:lang="hi" lang3="hin">Khoj</text>
+		<text xml:lang="th" lang3="tha">ค้นหา</text>
+		<text xml:lang="nl" lang3="nld">Zoeken</text>
+		<text xml:lang="ru" lang3="rus">Поиск</text>
+		<text xml:lang="tr" lang3="tur">Ara</text>
+		<text xml:lang="bg" lang3="bul">Търси</text>
+		<text xml:lang="el" lang3="ell">Ψάχνε</text>
+		<text xml:lang="ca" lang3="cat">Cercar</text>
+		<text xml:lang="la" lang3="lat">Quaere</text>
+		<text xml:lang="hr" lang3="hrv">Pretraživanje</text>
+		<text xml:lang="ko" lang3="kor">검색</text>
+	</entry>
+	<entry>
+		<key>tableWord</key>
+		<text xml:lang="en" lang3="eng">Table</text>
+		<text xml:lang="de" lang3="deu">Tabelle</text>
+		<text xml:lang="ro" lang3="ron">Tabel</text>
+		<text xml:lang="fr" lang3="fra">Table</text>
+		<text xml:lang="pt" lang3="por">Tabela</text>
+		<text xml:lang="es" lang3="spa">Tabla</text>
+		<text xml:lang="it" lang3="ita">Tavola</text>
+		<text xml:lang="sl" lang3="slv">Tabela</text>
+		<text xml:lang="sv" lang3="swe">Tabell</text>
+		<text xml:lang="no" lang3="nor">Tabell</text>
+		<text xml:lang="zh-TW">表格</text>
+		<text xml:lang="sr" lang3="srp">Tabela</text>
+		<text xml:lang="ja" lang3="jpn">表</text>
+		<text xml:lang="pl" lang3="pol">Tabela</text>
+		<text xml:lang="hi" lang3="hin">Patti</text>
+		<text xml:lang="th" lang3="tha">ตาราง</text>
+		<text xml:lang="nl" lang3="nld">Tabel</text>
+		<text xml:lang="ru" lang3="rus">Таблица</text>
+		<text xml:lang="tr" lang3="tur">Tablo</text>
+		<text xml:lang="bg" lang3="bul">Таблица</text>
+		<text xml:lang="el" lang3="ell">Πίνακας</text>
+		<text xml:lang="ca" lang3="cat">Taula</text>
+		<text xml:lang="la" lang3="lat">Tabella</text>
+		<text xml:lang="hr" lang3="hrv">Tablica</text>
+		<text xml:lang="ko" lang3="kor">표</text>
+	</entry>
+	<entry>
+		<key>tableWords</key>
+		<text xml:lang="en" lang3="eng">Tables</text>
+		<text xml:lang="de" lang3="deu">Tabellen</text>
+		<text xml:lang="ro" lang3="ron">Tabele</text>
+		<text xml:lang="fr" lang3="fra">Tables</text>
+		<text xml:lang="pt" lang3="por">Tabelas</text>
+		<text xml:lang="es" lang3="spa">Tablas</text>
+		<text xml:lang="it" lang3="ita">Tavole</text>
+		<text xml:lang="sl" lang3="slv">Tabele</text>
+		<text xml:lang="sv" lang3="swe">Tabeller</text>
+		<text xml:lang="no" lang3="nor">Tabeller</text>
+		<text xml:lang="zh-TW">表格</text>
+		<text xml:lang="sr" lang3="srp">Tabele</text>
+		<text xml:lang="ja" lang3="jpn">表</text>
+		<text xml:lang="pl" lang3="pol">Tabele</text>
+		<text xml:lang="hi" lang3="hin">Pattiya</text>
+		<text xml:lang="th" lang3="tha">คาราง</text>
+		<text xml:lang="nl" lang3="nld">Tabellen</text>
+		<text xml:lang="ru" lang3="rus">Таблицы</text>
+		<text xml:lang="tr" lang3="tur">Tablolar</text>
+		<text xml:lang="bg" lang3="bul">Таблици</text>
+		<text xml:lang="el" lang3="ell">Πίνακες</text>
+		<text xml:lang="ca" lang3="cat">Taules</text>
+		<text xml:lang="la" lang3="lat">Tabellae</text>
+		<text xml:lang="hr" lang3="hrv">Tablice</text>
+		<text xml:lang="ko" lang3="kor">표들</text>
+	</entry>
+	<entry>
+		<key>tocWords</key>
+		<text xml:lang="en" lang3="eng">Table of contents</text>
+		<text xml:lang="de" lang3="deu">Inhalt</text>
+		<text xml:lang="ro" lang3="ron">Cuprins</text>
+		<text xml:lang="fr" lang3="fra">Contenu</text>
+		<text xml:lang="pt" lang3="por">Índice geral</text>
+		<text xml:lang="es" lang3="spa">Índice</text>
+		<text xml:lang="it" lang3="ita">Indice</text>
+		<text xml:lang="sl" lang3="slv">Kazalo</text>
+		<text xml:lang="sv" lang3="swe">Innehåll</text>
+		<text xml:lang="no" lang3="nor">Innhold</text>
+		<text xml:lang="zh-TW">內容</text>
+		<text xml:lang="sr" lang3="srp">Sadržaj</text>
+		<text xml:lang="ja" lang3="jpn">目次</text>
+		<text xml:lang="pl" lang3="pol">Spis treści</text>
+		<text xml:lang="hi" lang3="hin">mula</text>
+		<text xml:lang="th" lang3="tha">สารบัญ</text>
+		<text xml:lang="nl" lang3="nld">Inhoud</text>
+		<text xml:lang="ru" lang3="rus">Оглавление</text>
+		<text xml:lang="tr" lang3="tur">İçerik</text>
+		<text xml:lang="bg" lang3="bul">Съдържание</text>
+		<text xml:lang="el" lang3="ell">Περιεχόμενα</text>
+		<text xml:lang="ca" lang3="cat">Índice general</text>
+		<text xml:lang="la" lang3="lat">Tabula contentorum</text>
+		<text xml:lang="hr" lang3="hrv">Sadržaj</text>
+		<text xml:lang="ko" lang3="kor">목차</text>
+	</entry>
+	<entry>
+		<key>upWord</key>
+		<text xml:lang="en" lang3="eng">Up</text>
+		<text xml:lang="de" lang3="deu">Aufwärts</text>
+		<text xml:lang="ro" lang3="ron">Sus</text>
+		<text xml:lang="fr" lang3="fra">Haut</text>
+		<text xml:lang="pt" lang3="por">Topo</text>
+		<text xml:lang="es" lang3="spa">Arriba</text>
+		<text xml:lang="it" lang3="ita">Su</text>
+		<text xml:lang="sl" lang3="slv">Gor</text>
+		<text xml:lang="sv" lang3="swe">Upp</text>
+		<text xml:lang="no" lang3="nor">Opp</text>
+		<text xml:lang="zh-TW">往上</text>
+		<text xml:lang="sr" lang3="srp">Gore</text>
+		<text xml:lang="ja" lang3="jpn">上</text>
+		<text xml:lang="pl" lang3="pol">W górę</text>
+		<text xml:lang="hi" lang3="hin">Upara Shabda</text>
+		<text xml:lang="th" lang3="tha">ไปข้างบน</text>
+		<text xml:lang="nl" lang3="nld">Hoger</text>
+		<text xml:lang="ru" lang3="rus">Вверх</text>
+		<text xml:lang="tr" lang3="tur">Yukarı</text>
+		<text xml:lang="bg" lang3="bul">Нагоре</text>
+		<text xml:lang="el" lang3="ell">Ανω</text>
+		<text xml:lang="ca" lang3="cat">Amunt</text>
+		<text xml:lang="la" lang3="lat">Sursum</text>
+		<text xml:lang="hr" lang3="hrv">Gore</text>
+		<text xml:lang="ko" lang3="kor">상위</text>
+	</entry>
+	<entry>
+		<key>appearsintheoriginalas</key>
+		<text xml:lang="en" lang3="eng">Appears in the original as</text>
+		<text xml:lang="es" lang3="spa">Aparece en el original como</text>
+		<text xml:lang="ca" lang3="cat">Apareix en l'original com</text>
+		<text xml:lang="de" lang3="deu">Erscheint im Original als</text>
+		<text xml:lang="la" lang3="lat">In exemplari legitur</text>
+		<text xml:lang="hr" lang3="hrv">U izvorniku se pojavljuje kao</text>
+		<text xml:lang="ko" lang3="kor">와 같이 원본에 나타난다</text>
+	</entry>
+	<text xml:lang="it" lang3="ita">Nell'originale appare come</text>
+	<entry>
+		<key>shouldbereadas</key>
+		<text xml:lang="en" lang3="eng">Should be read as</text>
+		<text xml:lang="es" lang3="spa">Debería leerse como</text>
+		<text xml:lang="ca" lang3="cat">S'hi hauria de llegir</text>
+		<text xml:lang="it" lang3="ita">Da leggersi come</text>
+		<text xml:lang="de" lang3="deu">Sollte gelesen werden als</text>
+		<text xml:lang="la" lang3="lat">Legendum est</text>
+		<text xml:lang="hr" lang3="hrv">Čita se kao</text>
+		<text xml:lang="ko" lang3="kor">와 같이 해석해야 한다</text>
+	</entry>
+	<entry>
+		<key>page</key>
+		<text xml:lang="en" lang3="eng">Page</text>
+		<text xml:lang="es" lang3="spa">Página</text>
+		<text xml:lang="ca" lang3="cat">Pàgina</text>
+		<text xml:lang="it" lang3="ita">Pagina</text>
+		<text xml:lang="de" lang3="deu">Seite</text>
+		<text xml:lang="la" lang3="lat">Pagina</text>
+		<text xml:lang="hr" lang3="hrv">Stranica</text>
+		<text xml:lang="ko" lang3="kor">쪽</text>
+	</entry>
+	<entry>
+		<key>asfoundin</key>
+		<text xml:lang="en" lang3="eng">As found in</text>
+		<text xml:lang="es" lang3="spa">Tal como se encuentra en</text>
+		<text xml:lang="ca" lang3="cat">Tal com es troba en</text>
+		<text xml:lang="de" lang3="deu">So wie gefunden in</text>
+		<text xml:lang="it" lang3="ita">Da riferirsi a</text>
+		<text xml:lang="la" lang3="lat">Ut legitur in</text>
+		<text xml:lang="hr" lang3="hrv">Prema izvoru</text>
+		<text xml:lang="ko" lang3="kor">에서와 같이 발견된</text>
+	</entry>
+	<entry>
+		<key>otherreadings</key>
+		<text xml:lang="en" lang3="eng">Other readings</text>
+		<text xml:lang="es" lang3="spa">Otras lecturas</text>
+		<text xml:lang="ca" lang3="cat">D'altres lectures</text>
+		<text xml:lang="de" lang3="deu">Andere Lesarten</text>
+		<text xml:lang="it" lang3="ita">Altre intepretazioni</text>
+		<text xml:lang="la" lang3="lat">Aliae lectiones</text>
+		<text xml:lang="hr" lang3="hrv">Druga čitanja</text>
+		<text xml:lang="ko" lang3="kor">다른 해석</text>
+	</entry>
+	<entry>
+		<key>homeWord</key>
+		<text xml:lang="ca" lang3="cat">Principal</text>
+		<text xml:lang="en" lang3="eng">Home</text>
+		<text xml:lang="fr" lang3="fra">Accueil</text>
+		<text xml:lang="pl" lang3="pol">Strona główna</text>
+		<text xml:lang="sw" lang3="swe">Hem</text>
+		<text xml:lang="th" lang3="tha">หน้าแรก</text>
+		<text xml:lang="de" lang3="deu">Anfang</text>
+		<text xml:lang="pt" lang3="por">Página inicial</text>
+		<text xml:lang="ja" lang3="jpn">ホーム</text>
+		<text xml:lang="sl" lang3="slv">Domov</text>
+		<text xml:lang="zh-TW">首頁</text>
+		<text xml:lang="no" lang3="nor">Hjem</text>
+		<text xml:lang="ro" lang3="ron">Acasă</text>
+		<text xml:lang="it" lang3="ita">Home</text>
+		<text xml:lang="es" lang3="spa">Principal</text>
+		<text xml:lang="ko" lang3="kor">가정</text>
+	</entry>
+	<entry>
+		<key>Used by</key>
+		<text xml:lang="ca" lang3="cat">Usat per</text>
+		<text xml:lang="en" lang3="eng">Used by</text>
+		<text xml:lang="pl" lang3="pol">Użyto w</text>
+		<text xml:lang="sw" lang3="swe">Används av</text>
+		<text xml:lang="de" lang3="deu">Verwendet von</text>
+		<text xml:lang="pt" lang3="por">Usado por</text>
+		<text xml:lang="no" lang3="nor">Brukt av</text>
+		<text xml:lang="sl" lang3="slv">Uporabljen v</text>
+		<text xml:lang="ja" lang3="jpn">当該モジュールを使用するもの</text>
+		<text xml:lang="zh-TW">屬於</text>
+		<text xml:lang="th" lang3="tha">ใช้โดย</text>
+		<text xml:lang="ro" lang3="ron">Folosit de</text>
+		<text xml:lang="fr" lang3="fra">Utilisé par</text>
+		<text xml:lang="it" lang3="ita">Usato da</text>
+		<text xml:lang="es" lang3="spa">Usado por</text>
+		<text xml:lang="ko" lang3="kor">에 의해 사용된</text>
+	</entry>
+	<entry>
+		<key>May contain</key>
+		<text xml:lang="ca" lang3="cat">Pot contenir</text>
+		<text xml:lang="en" lang3="eng">May contain</text>
+		<text xml:lang="pl" lang3="pol">Może zawierać</text>
+		<text xml:lang="sw" lang3="swe">Kan innehålla</text>
+		<text xml:lang="de" lang3="deu">Kann enthalten</text>
+		<text xml:lang="pt" lang3="por">Pode conter</text>
+		<text xml:lang="th" lang3="tha">ประกอบด้วย</text>
+		<text xml:lang="ja" lang3="jpn">下位</text>
+		<text xml:lang="sl" lang3="slv">Lahko vsebuje</text>
+		<text xml:lang="zh-TW">可包含</text>
+		<text xml:lang="no" lang3="nor">Kan inneholde</text>
+		<text xml:lang="ro" lang3="ron">Poate conţine</text>
+		<text xml:lang="fr" lang3="fra">Peut contenir</text>
+		<text xml:lang="it" lang3="ita">Può contenere</text>
+		<text xml:lang="es" lang3="spa">Puede contener</text>
+		<text xml:lang="ko" lang3="kor">포함할 수 있다</text>
+	</entry>
+	<entry>
+		<key>Contained by</key>
+		<text xml:lang="ca" lang3="cat">Contingut en</text>
+		<text xml:lang="ro" lang3="ron">Conţinut de</text>
+		<text xml:lang="en" lang3="eng">Contained by</text>
+		<text xml:lang="pl" lang3="pol">Zawiera się w</text>
+		<text xml:lang="sw" lang3="swe">Ingår i</text>
+		<text xml:lang="de" lang3="deu">Enthalten in</text>
+		<text xml:lang="pt" lang3="por">Contido em</text>
+		<text xml:lang="sl" lang3="slv">Vsebovan v</text>
+		<text xml:lang="ja" lang3="jpn">上位</text>
+		<text xml:lang="zh-TW">可包含在於</text>
+		<text xml:lang="no" lang3="nor">Er en del av</text>
+		<text xml:lang="th" lang3="tha">บรรจุอยู่ใน</text>
+		<text xml:lang="fr" lang3="fra">Contenu dans</text>
+		<text xml:lang="it" lang3="ita">Contenuto in</text>
+		<text xml:lang="es" lang3="spa">Contenido en</text>
+		<text xml:lang="ko" lang3="kor">에 의해 포함된</text>
+	</entry>
+	<entry>
+		<key>Compact to XML format</key>
+		<text xml:lang="ca" lang3="cat">De format compacte a XML</text>
+		<text xml:lang="en" lang3="eng">Compact to XML format</text>
+		<text xml:lang="zh-TW">簡潔式轉到XML式</text>
+		<text xml:lang="it" lang3="ita">Compatta in formato XML</text>
+		<text xml:lang="fr" lang3="fra">Transformer en syntaxe XML</text>
+		<text xml:lang="pt" lang3="por">De Compact para formato XML</text>
+		<text xml:lang="ja" lang3="jpn">XML表記</text>
+		<text xml:lang="es" lang3="spa">De formato compacto a XML</text>
+		<text xml:lang="de" lang3="deu">Vom kompakten zum XML-Format</text>
+		<text xml:lang="ko" lang3="kor">XML 형식에 따른 규약?</text>
+	</entry>
+	<entry>
+		<key>XML format to compact</key>
+		<text xml:lang="ca" lang3="cat">De format XML a compacte</text>
+		<text xml:lang="en" lang3="eng">XML format to compact</text>
+		<text xml:lang="fr" lang3="fra">Transformer en syntaxe compact</text>
+		<text xml:lang="zh-TW">XML式轉到簡潔式</text>
+		<text xml:lang="it" lang3="ita">Formato XML da compattare</text>
+		<text xml:lang="pt" lang3="por">De formato XML para Compact</text>
+		<text xml:lang="ja" lang3="jpn">簡易表記</text>
+		<text xml:lang="es" lang3="spa">De formato XML a compacto</text>
+		<text xml:lang="de" lang3="deu">Vom XML-Format zum kompakten</text>
+		<text xml:lang="ko" lang3="kor">규약에 대한 XML 형식?</text>
+	</entry>
+	<entry>
+		<key>Empty element</key>
+		<text xml:lang="ca" lang3="cat">Element buit</text>
+		<text xml:lang="en" lang3="eng">Empty element</text>
+		<text xml:lang="fr" lang3="fra">Elément vide</text>
+		<text xml:lang="zh-TW">空白元素</text>
+		<text xml:lang="it" lang3="ita">Elemento vuoto</text>
+		<text xml:lang="pt" lang3="por">Elemento vazio</text>
+		<text xml:lang="ja" lang3="jpn">空要素</text>
+		<text xml:lang="es" lang3="spa">Elemento vacío</text>
+		<text xml:lang="de" lang3="deu">Leeres Element</text>
+		<text xml:lang="ko" lang3="kor">공백 요소</text>
+	</entry>
+	<entry>
+		<key>Character data only</key>
+		<text xml:lang="ca" lang3="cat">Sols dades de caràcters</text>
+		<text xml:lang="en" lang3="eng">Character data only</text>
+		<text xml:lang="fr" lang3="fra">Des données textuelles uniquement</text>
+		<text xml:lang="zh-TW">僅文字符號資料</text>
+		<text xml:lang="it" lang3="ita">Ammessi soltanto caratteri di testo</text>
+		<text xml:lang="ja" lang3="jpn">文字データのみ</text>
+		<text xml:lang="es" lang3="spa">Sólo datos de caracteres</text>
+		<text xml:lang="de" lang3="deu">Nur Zeichen</text>
+		<text xml:lang="ko" lang3="kor">문자 자료만 허용</text>
+	</entry>
+	<entry>
+		<key>separated by whitespace</key>
+		<text xml:lang="ca" lang3="cat">separat per espai en blanc</text>
+		<text xml:lang="en" lang3="eng">separated by whitespace</text>
+		<text xml:lang="fr" lang3="fra">séparé par un espace</text>
+		<text xml:lang="zh-TW">以空白鍵隔開</text>
+		<text xml:lang="it" lang3="ita">separato da spazio bianco</text>
+		<text xml:lang="pt" lang3="por">separado por espaços</text>
+		<text xml:lang="ja" lang3="jpn">空白文字で区切られる</text>
+		<text xml:lang="es" lang3="spa">separado por espacio en blanco</text>
+		<text xml:lang="de" lang3="deu">Durch Leerzeichen getrennt</text>
+		<text xml:lang="ko" lang3="kor">공백문자로 분리됨</text>
+	</entry>
+	<entry>
+		<key>Text body</key>
+		<text xml:lang="ca" lang3="cat">Cos del text</text>
+		<text xml:lang="en" lang3="eng">Text body</text>
+		<text xml:lang="fr" lang3="fra">Corps du texte</text>
+		<text xml:lang="zh-TW">正文</text>
+		<text xml:lang="it" lang3="ita">Corpo del testo</text>
+		<text xml:lang="pt" lang3="por">Texto</text>
+		<text xml:lang="ja" lang3="jpn">本文</text>
+		<text xml:lang="es" lang3="spa">Cuerpo del texto</text>
+		<text xml:lang="de" lang3="deu">Textkörper</text>
+		<text xml:lang="ko" lang3="kor">텍스트 본문</text>
+	</entry>
+	<entry>
+		<key>Back Matter</key>
+		<text xml:lang="ca" lang3="cat">Material final</text>
+		<text xml:lang="en" lang3="eng">Back Matter</text>
+		<text xml:lang="fr" lang3="fra">Annexes</text>
+		<text xml:lang="zh-TW">正文後資訊</text>
+		<text xml:lang="ja" lang3="jpn">後付</text>
+		<text xml:lang="it" lang3="ita">Sezioni conclusive</text>
+		<text xml:lang="pt" lang3="por">Anexos</text>
+		<text xml:lang="es" lang3="spa">Material final</text>
+		<text xml:lang="de" lang3="deu">Nachspann</text>
+		<text xml:lang="ko" lang3="kor">권말 부분</text>
+	</entry>
+	<entry>
+		<key>Front Matter</key>
+		<text xml:lang="ca" lang3="cat">Material preliminar</text>
+		<text xml:lang="en" lang3="eng">Front Matter</text>
+		<text xml:lang="fr" lang3="fra">Pièces liminaires</text>
+		<text xml:lang="zh-TW">正文前資訊</text>
+		<text xml:lang="it" lang3="ita">Sezioni preliminari</text>
+		<text xml:lang="pt" lang3="por">Front Matter</text>
+		<text xml:lang="ja" lang3="jpn">前付</text>
+		<text xml:lang="es" lang3="spa">Material preliminar</text>
+		<text xml:lang="de" lang3="deu">Vorspann</text>
+		<text xml:lang="ko" lang3="kor">책 앞부분</text>
+	</entry>
+	<entry>
+		<key>Getting the most recent version</key>
+		<text xml:lang="ca" lang3="cat">Obtenir la versió més recent</text>
+		<text xml:lang="en" lang3="eng">Getting the most recent version</text>
+		<text xml:lang="fr" lang3="fra">Obtenir la dernière version</text>
+		<text xml:lang="zh-TW">取得最新版本</text>
+		<text xml:lang="it" lang3="ita">Otteni la versione più recente</text>
+		<text xml:lang="pt" lang3="por">Como obter a versão mais recente</text>
+		<text xml:lang="ja" lang3="jpn">最新版の入手方法</text>
+		<text xml:lang="es" lang3="spa">Obtener la versión más reciente</text>
+		<text xml:lang="de" lang3="deu">Die aktuellste Version holen</text>
+		<text xml:lang="ko" lang3="kor">최신 버전 얻기</text>
+	</entry>
+	<entry>
+		<key>Sourceforge Subversion Repository</key>
+		<text xml:lang="ca" lang3="cat">Magatzem Subversion en Sourceforge</text>
+		<text xml:lang="en" lang3="eng">Sourceforge Subversion Repository</text>
+		<text xml:lang="fr" lang3="fra">Répertoire Subversion dans Sourceforge</text>
+		<text xml:lang="zh-TW">P5原始檔典藏@Sourceforge</text>
+		<text xml:lang="it" lang3="ita">Sourceforge Subversion Repository</text>
+		<text xml:lang="pt" lang3="por">Sourceforge Subversion Repository</text>
+		<text xml:lang="ja" lang3="jpn">各種データ(Sourceforge)</text>
+		<text xml:lang="es" lang3="spa">Almacén Subversion en Sourceforge</text>
+		<text xml:lang="de" lang3="deu">Sourceforge Subversion Repositorium</text>
+		<text xml:lang="ko" lang3="kor">소스 하위 버전 저장소 Sourceforge Subversion
+			Repository</text>
+	</entry>
+	<entry>
+		<key>BugsFeatures</key>
+		<text xml:lang="ca" lang3="cat">Informes d'errors, peticions de
+			característiques</text>
+		<text xml:lang="en" lang3="eng">Bug Reports, Feature Requests, etc.</text>
+		<text xml:lang="ja" lang3="jpn">バグ報告や要望など</text>
+		<text xml:lang="fr" lang3="fra">Rapports d'erreurs, demandes de
+			modifications etc</text>
+		<text xml:lang="zh-TW">錯誤回報、功能要求等等。</text>
+		<text xml:lang="it" lang3="ita">Liste di bug, Richieste di nuove
+			funzionalità, etc.</text>
+		<text xml:lang="pt" lang3="por">Relatório de Erros, Pedidos de
+			Modificaçoes, etc.</text>
+		<text xml:lang="es" lang3="spa">Informes de errores, peticiones de
+			características</text>
+		<text xml:lang="de" lang3="deu">Fehlerberichte, Anfragen zu Funktionen,
+			etc.</text>
+		<text xml:lang="ko" lang3="kor">버그 보고, 특성 요구 등</text>
+	</entry>
+	<entry>
+		<key>Some Popular Sections</key>
+		<text xml:lang="ca" lang3="cat">Seccions populars</text>
+		<text xml:lang="ja" lang3="jpn">代表的な章</text>
+		<text xml:lang="en" lang3="eng">Some Popular Sections</text>
+		<text xml:lang="fr" lang3="fra">Parties les plus visitées</text>
+		<text xml:lang="zh-TW">一些受歡迎的章節</text>
+		<text xml:lang="it" lang3="ita">Alcune fra le sezioni più richieste</text>
+		<text xml:lang="pt" lang3="por">Algumas Secçoes Populares</text>
+		<text xml:lang="es" lang3="spa">Secciones populares</text>
+		<text xml:lang="de" lang3="deu">Einige beliebte Sektionen</text>
+		<text xml:lang="ko" lang3="kor">인기있는 절</text>
+	</entry>
+	<entry>
+		<key>GuidelinesTEI</key>
+		<text xml:lang="ca" lang3="cat">Directrius per a la codificació i
+			l'intercanvi de textos electrònics</text>
+		<text xml:lang="ja" lang3="jpn">TEIガイドライン</text>
+		<text xml:lang="en" lang3="eng">Guidelines for Electronic Text Encoding
+			and Interchange</text>
+		<text xml:lang="fr" lang3="fra">Principes directeurs pour l'encodage et
+			l'échange de textes électroniques</text>
+		<text xml:lang="zh-TW">TEI指引</text>
+		<text xml:lang="it" lang3="ita">Linee guida per la codifica e
+			l'interscambio del testo elettronico</text>
+		<text xml:lang="pt" lang3="por">Instruçoes para Electronic Text
+			Encoding and Interchange</text>
+		<text xml:lang="es" lang3="spa">Directrices para la codificación y el
+			intercambio de textos electrónicos</text>
+		<text xml:lang="de" lang3="deu">Richtlinien für die Auszeichnung und
+			den Austausch elektronischer Texte</text>
+		<text xml:lang="ko" lang3="kor">전자 텍스트 부호화 및 교환에 대한 지침</text>
+	</entry>
+	<entry>
+		<key>edited by</key>
+		<text xml:lang="ca" lang3="cat">editat per</text>
+		<text xml:lang="en" lang3="eng">edited by</text>
+		<text xml:lang="fr" lang3="fra">édité par</text>
+		<text xml:lang="zh-TW">編輯者：</text>
+		<text xml:lang="it" lang3="ita">edito da</text>
+		<text xml:lang="pt" lang3="por">editado por</text>
+		<text xml:lang="ja" lang3="jpn">監修</text>
+		<text xml:lang="es" lang3="spa">editado por</text>
+		<text xml:lang="de" lang3="deu">ediert von</text>
+		<text xml:lang="ko" lang3="kor">에 의해 편집</text>
+	</entry>
+	<entry>
+		<key>Versions of the Guidelines</key>
+		<text xml:lang="ca" lang3="cat">Versions de les directrius</text>
+		<text xml:lang="en" lang3="eng">Versions of the Guidelines</text>
+		<text xml:lang="fr" lang3="fra">Versions des Principes directeurs</text>
+		<text xml:lang="zh-TW">指引版本</text>
+		<text xml:lang="it" lang3="ita">Versioni delle Linee guida</text>
+		<text xml:lang="pt" lang3="por">Versoes das instruçoes</text>
+		<text xml:lang="ko" lang3="kor">지침 버전</text>
+		<text xml:lang="ja" lang3="jpn">ガイドラインについて</text>
+		<text xml:lang="es" lang3="spa">Versiones de las directrices</text>
+		<text xml:lang="de" lang3="deu">Versionen der Richtlinien</text>
+	</entry>
+	<entry>
+		<key>Sorted alphabetically</key>
+		<text xml:lang="ca" lang3="cat">Ordenat alfabèticament</text>
+		<text xml:lang="en" lang3="eng">Sorted alphabetically</text>
+		<text xml:lang="it" lang3="ita">In ordine alfabetico</text>
+		<text xml:lang="zh-TW">按羅馬字母排序</text>
+		<text xml:lang="fr" lang3="fra">Trié alphabétiquement</text>
+		<text xml:lang="pt" lang3="por">Ordenado alfabeticamente</text>
+		<text xml:lang="ja" lang3="jpn">アルファベット順</text>
+		<text xml:lang="es" lang3="spa">Ordenado alfabéticamente</text>
+		<text xml:lang="de" lang3="deu">Alphabetisch geordnet</text>
+		<text xml:lang="ko" lang3="kor">알파벳 순</text>
+	</entry>
+	<entry>
+		<key>Show all</key>
+		<text xml:lang="ca" lang3="cat">Mostrar tot</text>
+		<text xml:lang="en" lang3="eng">Show all</text>
+		<text xml:lang="it" lang3="ita">Mostra tutto</text>
+		<text xml:lang="zh-TW">全部顯示</text>
+		<text xml:lang="fr" lang3="fra">Toute la liste</text>
+		<text xml:lang="pt" lang3="por">Mostre tudo</text>
+		<text xml:lang="ja" lang3="jpn">一括表示</text>
+		<text xml:lang="es" lang3="spa">Mostrar todo</text>
+		<text xml:lang="de" lang3="deu">Alle anzeigen</text>
+		<text xml:lang="ko" lang3="kor">모두 보기</text>
+	</entry>
+	<entry>
+		<key>Show by module</key>
+		<text xml:lang="ca" lang3="cat">Mostrar per mòdul</text>
+		<text xml:lang="en" lang3="eng">Show by module</text>
+		<text xml:lang="it" lang3="ita">Mostra modulo per modulo</text>
+		<text xml:lang="zh-TW">按模組顯示</text>
+		<text xml:lang="fr" lang3="fra">Par module</text>
+		<text xml:lang="pt" lang3="por">Mostre por módulo</text>
+		<text xml:lang="ja" lang3="jpn">モジュール別表示</text>
+		<text xml:lang="es" lang3="spa">Mostrar por módulo</text>
+		<text xml:lang="de" lang3="deu">Nach Modulen geordnet anzeigen</text>
+		<text xml:lang="ko" lang3="kor">모듈로 보기</text>
+	</entry>
+	<entry>
+		<key>occurrences of</key>
+		<text xml:lang="ca" lang3="cat">aparicions de</text>
+		<text xml:lang="en" lang3="eng">occurrences of</text>
+		<text xml:lang="es" lang3="spa">apariciones de</text>
+		<text xml:lang="de" lang3="deu">Vorkommen von</text>
+		<text xml:lang="it" lang3="ita">occorrenze di</text>
+		<text xml:lang="zh-TW">次可出現:</text>
+		<text xml:lang="ko" lang3="kor">출현</text>
+	</entry>
+	<entry>
+		<key>author</key>
+		<text xml:lang="en" lang3="eng">Author</text>
+		<text xml:lang="de" lang3="deu">Verfasser</text>
+		<text xml:lang="fr" lang3="fra">Auteur</text>
+		<text xml:lang="it" lang3="ita">Autore</text>
+		<text xml:lang="ko" lang3="kor">저자</text>
+	</entry>
+	<entry>
+		<key>title</key>
+		<text xml:lang="en" lang3="eng">Title</text>
+		<text xml:lang="de" lang3="deu">Titel</text>
+		<text xml:lang="fr" lang3="fra">Titre</text>
+		<text xml:lang="it" lang3="ita">Titolo</text>
+		<text xml:lang="ko" lang3="kor">제목</text>
+	</entry>
+	<entry>
+		<key>remarks</key>
+		<text xml:lang="en" lang3="eng">Remarks</text>
+		<text xml:lang="de" lang3="deu">Bemerkungen</text>
+		<text xml:lang="fr" lang3="fra">Remarques</text>
+		<text xml:lang="it" lang3="ita">Osservazioni</text>
+		<text xml:lang="ko" lang3="kor">해설</text>
+	</entry>
+	<entry>
+		<key>physDesc</key>
+		<text xml:lang="en" lang3="eng">Physical description</text>
+		<text xml:lang="de" lang3="deu">Äußere Beschreibung</text>
+		<text xml:lang="fr" lang3="fra">Description physique</text>
+		<text xml:lang="it" lang3="ita">Descrizione fisica</text>
+		<text xml:lang="ko" lang3="kor">물리적 기술</text>
+	</entry>
+	<entry>
+		<key>watermarks</key>
+		<text xml:lang="en" lang3="eng">Watermarks</text>
+		<text xml:lang="de" lang3="deu">Wasserzeichen</text>
+		<text xml:lang="fr" lang3="fra">Filigrane</text>
+		<text xml:lang="it" lang3="ita">Filigrana</text>
+		<text xml:lang="ko" lang3="kor">투명 표식</text>
+	</entry>
+	<entry>
+		<key>musicNotations</key>
+		<text xml:lang="en" lang3="eng">Musical notations</text>
+		<text xml:lang="de" lang3="deu">Musikalische Notationen</text>
+		<text xml:lang="fr" lang3="fra">Notation musicale</text>
+		<text xml:lang="it" lang3="ita">Notazioni musicali</text>
+		<text xml:lang="ko" lang3="kor">음악 표기법</text>
+	</entry>
+	<entry>
+		<key>history</key>
+		<text xml:lang="en" lang3="eng">History of the manuscript</text>
+		<text xml:lang="de" lang3="deu">Geschichte der Handschrift</text>
+		<text xml:lang="fr" lang3="fra">Histoire du manuscrit</text>
+		<text xml:lang="it" lang3="ita">Storia del manoscritto</text>
+		<text xml:lang="ko" lang3="kor">필사본 역사</text>
+	</entry>
+	<entry>
+		<key>availability</key>
+		<text xml:lang="en" lang3="eng">With kind permission of </text>
+		<text xml:lang="fr" lang3="fra">With kind permission of </text>
+		<text xml:lang="it" lang3="ita">With kind permission of </text>
+		<text xml:lang="de" lang3="deu">Mit freundlicher Genehmigung von</text>
+		<text xml:lang="ko" lang3="kor">친절한 허용</text>
+	</entry>
+	<entry>
+		<key>acquisition</key>
+		<text xml:lang="en" lang3="eng">Acquisition of the manuscript</text>
+		<text xml:lang="fr" lang3="fra">Acquisition du manuscrit</text>
+		<text xml:lang="it" lang3="ita">Acquisizione del manoscritto</text>
+		<text xml:lang="de" lang3="deu">Erwerb der Handschrift</text>
+		<text xml:lang="ko" lang3="kor">필사본의의 입수</text>
+	</entry>
+	<entry>
+		<key>additions</key>
+		<text xml:lang="en" lang3="eng">Additions</text>
+		<text xml:lang="fr" lang3="fra">Compléments à posteriori</text>
+		<text xml:lang="it" lang3="ita">Aggiunte</text>
+		<text xml:lang="de" lang3="deu">Spätere Ergänzungen</text>
+		<text xml:lang="ko" lang3="kor">추가사항</text>
+	</entry>
+	<entry>
+		<key>altIdentifier[@type="formerShelfmark"]</key>
+		<text xml:lang="en" lang3="eng">Former shelfmark</text>
+		<text xml:lang="fr" lang3="fra">Cote</text>
+		<text xml:lang="it" lang3="ita">segnatura</text>
+		<text xml:lang="de" lang3="deu">Frühere Signatur</text>
+		<text xml:lang="ko" lang3="kor">이전 서가기호</text>
+	</entry>
+	<entry>
+		<key>msPart</key>
+		<text xml:lang="en" lang3="eng">Manuscript part</text>
+		<text xml:lang="fr" lang3="fra">Partie du manuscrit</text>
+		<text xml:lang="it" lang3="ita">Sezione del manoscritto</text>
+		<text xml:lang="de" lang3="deu">Handschriftenteil</text>
+		<text xml:lang="ko" lang3="kor">필사본 부분</text>
+	</entry>
+	<entry>
+		<key>binding</key>
+		<text xml:lang="en" lang3="eng">Binding</text>
+		<text xml:lang="fr" lang3="fra">Couverture</text>
+		<text xml:lang="it" lang3="ita">Legatura</text>
+		<text xml:lang="de" lang3="deu">Einband</text>
+		<text xml:lang="ko" lang3="kor">제책</text>
+	</entry>
+	<entry>
+		<key>collation</key>
+		<text xml:lang="en" lang3="eng">Collation</text>
+		<text xml:lang="fr" lang3="fra">Composition des fascicules</text>
+		<text xml:lang="it" lang3="ita">Composizione dei fascicoli</text>
+		<text xml:lang="de" lang3="deu">Lagenstruktur</text>
+		<text xml:lang="ko" lang3="kor">쪽 순서 대조</text>
+	</entry>
+	<entry>
+		<key>condition</key>
+		<text xml:lang="en" lang3="eng">Condition</text>
+		<text xml:lang="fr" lang3="fra">Etat</text>
+		<text xml:lang="it" lang3="ita">Condizioni</text>
+		<text xml:lang="de" lang3="deu">Zustand</text>
+		<text xml:lang="ko" lang3="kor">상태</text>
+	</entry>
+	<entry>
+		<key>decoDesc</key>
+		<text xml:lang="en" lang3="eng">Decoration</text>
+		<text xml:lang="fr" lang3="fra">Reliure d'art</text>
+		<text xml:lang="it" lang3="ita">Decorazione</text>
+		<text xml:lang="de" lang3="deu">Buchschmuck</text>
+		<text xml:lang="ko" lang3="kor">장식</text>
+	</entry>
+	<entry>
+		<key>extent</key>
+		<text xml:lang="en" lang3="eng">Extent</text>
+		<text xml:lang="fr" lang3="fra">Volume</text>
+		<text xml:lang="it" lang3="ita">Dimensioni</text>
+		<text xml:lang="de" lang3="deu">Umfang</text>
+		<text xml:lang="ko" lang3="kor">분량</text>
+	</entry>
+	<entry>
+		<key>foliation</key>
+		<text xml:lang="en" lang3="eng">Foliation</text>
+		<text xml:lang="fr" lang3="fra">Numérotation des pages</text>
+		<text xml:lang="it" lang3="ita">Numerazione delle pagine</text>
+		<text xml:lang="de" lang3="deu">Seitennummerierung</text>
+		<text xml:lang="ko" lang3="kor">쪽수</text>
+	</entry>
+	<entry>
+		<key>handDesc</key>
+		<text xml:lang="en" lang3="eng">Writing and hands</text>
+		<text xml:lang="fr" lang3="fra">Type d'écritures et copistes</text>
+		<text xml:lang="it" lang3="ita">Tipo di scrittura e e mani</text>
+		<text xml:lang="de" lang3="deu">Schrift und Hände</text>
+		<text xml:lang="ko" lang3="kor">집필과 필체</text>
+	</entry>
+	<entry>
+		<key>msDesc/head/title</key>
+		<text xml:lang="en" lang3="eng">Author and title</text>
+		<text xml:lang="fr" lang3="fra">Auteur et titre</text>
+		<text xml:lang="it" lang3="ita">Autore e titolo</text>
+		<text xml:lang="de" lang3="deu">Autor und Titel</text>
+		<text xml:lang="ko" lang3="kor">저자와 제목</text>
+	</entry>
+	<entry>
+		<key>origPlace</key>
+		<text xml:lang="en" lang3="eng">Place of origin</text>
+		<text xml:lang="fr" lang3="fra">Origine</text>
+		<text xml:lang="it" lang3="ita">Luogo di origine</text>
+		<text xml:lang="de" lang3="deu">Entstehungsort</text>
+		<text xml:lang="ko" lang3="kor">원본 생산 장소</text>
+	</entry>
+	<entry>
+		<key>origDate</key>
+		<text xml:lang="en" lang3="eng">Date of origin</text>
+		<text xml:lang="fr" lang3="fra">Période</text>
+		<text xml:lang="it" lang3="ita">Datazione</text>
+		<text xml:lang="de" lang3="deu">Entstehungszeit</text>
+		<text xml:lang="ko" lang3="kor">원본 생산 날짜 </text>
+	</entry>
+	<entry>
+		<key>msDesc/head/note[@type="respStmt"]</key>
+		<text xml:lang="en" lang3="eng">Writer</text>
+		<text xml:lang="fr" lang3="fra">Scribe</text>
+		<text xml:lang="it" lang3="ita">Copista</text>
+		<text xml:lang="de" lang3="deu">Schreiber</text>
+		<text xml:lang="ko" lang3="kor">작가</text>
+	</entry>
+	<entry>
+		<key>provenance</key>
+		<text xml:lang="en" lang3="eng">Provenance of the manuscript</text>
+		<text xml:lang="fr" lang3="fra">Provenance du manuscrit</text>
+		<text xml:lang="it" lang3="ita">Provenienza del manoscritto</text>
+		<text xml:lang="de" lang3="deu">Provenienz der Handschrift</text>
+		<text xml:lang="ko" lang3="kor">필사본의 출처</text>
+	</entry>
+	<entry>
+		<key>layoutDesc | layout</key>
+		<text xml:lang="en" lang3="eng">Page layout</text>
+		<text xml:lang="fr" lang3="fra">Mise en page</text>
+		<text xml:lang="it" lang3="ita">Disposizione della pagina</text>
+		<text xml:lang="de" lang3="deu">Seiteneinrichtung</text>
+		<text xml:lang="ko" lang3="kor">페이지 레이아웃</text>
+	</entry>
+	<entry>
+		<key>msDesc/additional/listBibl</key>
+		<text xml:lang="en" lang3="eng">Bibliography</text>
+		<text xml:lang="fr" lang3="fra">Bibliographie</text>
+		<text xml:lang="it" lang3="ita">Bibliografia</text>
+		<text xml:lang="de" lang3="deu">Literaturverzeichnis</text>
+		<text xml:lang="ko" lang3="kor">서지항목</text>
+	</entry>
+	<entry>
+		<key>measure[@type="leaveSize"]</key>
+		<text xml:lang="en" lang3="eng">Format</text>
+		<text xml:lang="fr" lang3="fra">Format</text>
+		<text xml:lang="it" lang3="ita">Formato</text>
+		<text xml:lang="de" lang3="deu">Format</text>
+		<text xml:lang="ko" lang3="kor">형식</text>
+	</entry>
+	<entry>
+		<key>msContents</key>
+		<text xml:lang="en" lang3="eng">Contents</text>
+		<text xml:lang="fr" lang3="fra">Sommaire</text>
+		<text xml:lang="it" lang3="ita">Contenuto</text>
+		<text xml:lang="de" lang3="deu">Inhaltsangabe</text>
+		<text xml:lang="ko" lang3="kor">내용</text>
+	</entry>
+	<entry>
+		<key>origin</key>
+		<text xml:lang="en" lang3="eng">Origin of the manuscript</text>
+		<text xml:lang="fr" lang3="fra">Parution du manuscrit</text>
+		<text xml:lang="it" lang3="ita">Origine del manoscritto</text>
+		<text xml:lang="de" lang3="deu">Entstehung der Handschrift</text>
+		<text xml:lang="ko" lang3="kor">필사본의 유래</text>
+	</entry>
+	<entry>
+		<key>support</key>
+		<text xml:lang="en" lang3="eng">Support</text>
+		<text xml:lang="fr" lang3="fra">Support de substitution</text>
+		<text xml:lang="it" lang3="ita">Supporto materiale</text>
+		<text xml:lang="de" lang3="deu">Beschreibstoff</text>
+		<text xml:lang="ko" lang3="kor">지원</text>
+	</entry>
+	<entry>
+		<key>surrogates</key>
+		<text xml:lang="en" lang3="eng">Surrogates</text>
+		<text xml:lang="fr" lang3="fra">Surrogates</text>
+		<text xml:lang="it" lang3="ita">Surrogates</text>
+		<text xml:lang="de" lang3="deu">Sekundärformen</text>
+		<text xml:lang="ko" lang3="kor">대용</text>
+	</entry>
+	<entry>
+		<key>textLang</key>
+		<text xml:lang="en" lang3="eng">Main language</text>
+		<text xml:lang="fr" lang3="fra">Langue principale</text>
+		<text xml:lang="it" lang3="ita">Lingua principale</text>
+		<text xml:lang="de" lang3="deu">Hauptsprache</text>
+		<text xml:lang="ko" lang3="kor">주 언어</text>
+	</entry>
+	<entry>
+		<key>and</key>
+		<text xml:lang="en" lang3="eng">and</text>
+		<text xml:lang="de" lang3="deu">und</text>
+		<text xml:lang="es" lang3="spa">y</text>
+	</entry>
 </i18n>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/rnc/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/rnc/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/rnc/build-to.xml	(revision 2397)
@@ -1,72 +1,65 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitornc">
-    <!--
-        This library is free software; you can redistribute it and/or
-        modify it under the terms of the GNU Lesser General Public
-        License as published by the Free Software Foundation; either
-        version 2.1 of the License, or (at your option) any later version.
-        
-        This library is distributed in the hope that it will be useful,
-        but WITHOUT ANY WARRANTY; without even the implied warranty of
-        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-        Lesser General Public License for more details.
-        
-        You should have received a copy of the GNU Lesser General Public
-        License along with this library; if not, write to the Free Software
-        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-        
-        Id: $Id: build-to.xml 9316 2011-09-13 08:06:05Z rahtz $
-        Copyright: 2011, TEI Consortium<
-    -->
-    <!--
-        Convert TEI documents into RNC schemas.
-    -->
-    <!-- Path to TEI XML file. -->
-    <property name="inputFile" value=""/>
-    <!-- Path where the output schema file will be saved. -->
-    <property name="outputFile" value=""/>
-    <!-- which profile -->
-    <property name="profile" value="default"/>
-    <!-- where does oxygen keep stuff -->
-    <property name="oxygenlib" value=""/>
-    <dirname property="inputFileDir" file="${inputFile}"/>
-    <dirname property="outputDir" file="${outputFile}"/>
-    <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-    <!-- The input file for the TRANG transformation. -->
-    <property name="trangInputFile" value="${outputFile}.rng"/>
-    
-    <path id="classpath">
-        <pathelement path="${java.class.path}"/>
-    </path>
-    
-    <!-- Use the Relax NG target to obtain a Relax NG schema and afterward transform it
-        to RNC using TRANG. -->
-    <target name="trangConvert">
-        <!-- Obtain a Relax NG schema.  -->
-        <ant antfile="../relaxng/build-to.xml" dir="../relaxng"/>
-        <!-- The Relax NG was generated inside the output file. -->
-        <copy file="${outputFile}" tofile="${trangInputFile}"/>
-        
-        <echo level="info">TRANG generate RNC from RELAXNG files</echo>
-        <java classname="com.thaiopensource.relaxng.translate.Driver" fork="no">
-            <classpath>
-                <path refid="classpath"/>
-                <pathelement location="${oxygenlib}/trang.jar"/>
-            </classpath>
-            <!-- Even though the output type is inferred from the output file extension,
-                make sure it's the right one. -->
-            <arg value="-O"/>
-            <arg value="rnc"/>
-            <arg value="${trangInputFile}" />
-            <arg value="${outputFile}" />
-        </java>
-    </target>
-    
-    <target name="cleanup" unless="debug">
-        <!-- Delete the intermediate Relax NG schema. -->
-        <delete file="${trangInputFile}"/>
-    </target>
-    
-    <target name="dist" depends="trangConvert, cleanup"/>
-    
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9316 2011-09-13 08:06:05Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into RNC schemas. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output schema file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<!-- The input file for the TRANG transformation. -->
+	<property name="trangInputFile" value="${outputFile}.rng" />
+
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+
+	<!-- Use the Relax NG target to obtain a Relax NG schema and afterward transform 
+		it to RNC using TRANG. -->
+	<target name="trangConvert">
+		<!-- Obtain a Relax NG schema. -->
+		<ant antfile="../relaxng/build-to.xml" dir="../relaxng" />
+		<!-- The Relax NG was generated inside the output file. -->
+		<copy file="${outputFile}" tofile="${trangInputFile}" />
+
+		<echo level="info">TRANG generate RNC from RELAXNG files</echo>
+		<java classname="com.thaiopensource.relaxng.translate.Driver"
+			fork="no">
+			<classpath>
+				<path refid="classpath" />
+				<pathelement location="${oxygenlib}/trang.jar" />
+			</classpath>
+			<!-- Even though the output type is inferred from the output file extension, 
+				make sure it's the right one. -->
+			<arg value="-O" />
+			<arg value="rnc" />
+			<arg value="${trangInputFile}" />
+			<arg value="${outputFile}" />
+		</java>
+	</target>
+
+	<target name="cleanup" unless="debug">
+		<!-- Delete the intermediate Relax NG schema. -->
+		<delete file="${trangInputFile}" />
+	</target>
+
+	<target name="dist" depends="trangConvert, cleanup" />
+
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/tei-fo.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/tei-fo.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/tei-fo.xsl	(revision 2397)
@@ -1,56 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:fotex="http://www.tug.org/fotex"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei fotex fo m"
-                version="2.0">
-    <!-- import base conversion style -->
+<xsl:stylesheet
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:fotex="http://www.tug.org/fotex"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei fotex fo m" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../fo2/tei.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<xsl:import href="../../fo2/tei.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei-fo.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-fo.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html5/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html5/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html5/to.xsl	(revision 2397)
@@ -1,56 +1,58 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="tei"
-    version="2.0">
+<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei" version="2.0">
 
-    <!-- import base conversion style -->
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../html5/tei.xsl"/>
-    <xsl:import href="../../../html5/microdata.xsl"/>
+	<xsl:import href="../../../html5/tei.xsl" />
+	<xsl:import href="../../../html5/microdata.xsl" />
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 8923 2011-05-25 13:11:45Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 8923 2011-05-25 13:11:45Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
 
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/epub/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/epub/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/epub/to.xsl	(revision 2397)
@@ -1,48 +1,52 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="tei">
-    <xsl:import href="../../../epub/tei-to-epub.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for making ePub from TEI.</p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="tei">
+	<xsl:import href="../../../epub/tei-to-epub.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making ePub from TEI.</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: to.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/oddhtml/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/oddhtml/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/oddhtml/to.xsl	(revision 2397)
@@ -1,65 +1,69 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-    xmlns:fo="http://www.w3.org/1999/XSL/Format" 
-    xmlns:html="http://www.w3.org/1999/xhtml" 
-    xmlns:i="http://www.iso.org/ns/1.0"
-    xmlns:rng="http://relaxng.org/ns/structure/1.0"
-    xmlns:s="http://www.ascc.net/xml/schematron" 
-    xmlns:sch="http://purl.oclc.org/dsdl/schematron" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:teix="http://www.tei-c.org/ns/Examples" 
-    xmlns:xi="http://www.w3.org/2001/XInclude"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl"
-                version="2.0">
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:i="http://www.iso.org/ns/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl"
+	version="2.0">
 
-    <!-- import base conversion style -->
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../odds2/odd2html.xsl"/>
+	<xsl:import href="../../../odds2/odd2html.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 9703 2011-11-09 11:16:42Z rahtz $</p>
-         <p>Copyright: 2010, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9703 2011-11-09 11:16:42Z rahtz $</p>
+			<p>Copyright: 2010, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/csv/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/csv/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/csv/to.xsl	(revision 2397)
@@ -3,78 +3,87 @@
 <xsl:stylesheet version="2.0"
 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
-	xmlns:tei="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="xs tei">
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	exclude-result-prefixes="xs tei">
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: James Cummings </p>
-         <p>Id: $Id: to.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2010, TEI Consortium</p>
-	<p>
-		Usage:  saxon filename.xsl tei2csv.xsl 
-		<ul>
-		<li> This produces files named tableX.csv
-		where X is the number of the table in the 
-		document as a whole.</li>
-		<li> All other content is discarded</li>
-		<li> All output is in UTF-8, input-encoding is 
-		based on XML declaration in the original file.
-		</li>
-		</ul>
-	</p>
-      </desc>
-   </doc>
-   <xsl:output omit-xml-declaration="yes"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:param name="directory"></xsl:param>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: James Cummings </p>
+			<p>Id: $Id: to.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2010, TEI Consortium</p>
+			<p>
+				Usage: saxon filename.xsl tei2csv.xsl
+				<ul>
+					<li> This produces files named tableX.csv
+						where X is the number of the table in the
+						document as a whole.</li>
+					<li> All other content is discarded</li>
+					<li> All output is in UTF-8, input-encoding is
+						based on XML declaration in the original file.
+					</li>
+				</ul>
+			</p>
+		</desc>
+	</doc>
+	<xsl:output omit-xml-declaration="yes" />
 
-   <xsl:template match="/">
-     <xsl:for-each select="//tei:table">
-       <xsl:variable name="tableNum">
-	 <xsl:number level="any"/>
-       </xsl:variable>
-       <xsl:result-document href="{concat($directory,'table',$tableNum, '.csv')}"
-			    encoding="UTF-8" method="text">
-	 <xsl:for-each select="tei:row">
-	   <xsl:for-each select="tei:cell">
-	     <xsl:value-of select="concat('&quot;',normalize-space(.),'&quot;')"/>
-	     <xsl:if test="following-sibling::tei:cell[1]">,</xsl:if>
-	   </xsl:for-each>
-	   <xsl:text>&#xa;</xsl:text>
-	 </xsl:for-each>
-       </xsl:result-document>
-     </xsl:for-each>
-   </xsl:template>
+	<xsl:param name="directory"></xsl:param>
+
+	<xsl:template match="/">
+		<xsl:for-each select="//tei:table">
+			<xsl:variable name="tableNum">
+				<xsl:number level="any" />
+			</xsl:variable>
+			<xsl:result-document
+				href="{concat($directory,'table',$tableNum, '.csv')}"
+				encoding="UTF-8" method="text">
+				<xsl:for-each select="tei:row">
+					<xsl:for-each select="tei:cell">
+						<xsl:value-of
+							select="concat('&quot;',normalize-space(.),'&quot;')" />
+						<xsl:if test="following-sibling::tei:cell[1]">
+							,
+						</xsl:if>
+					</xsl:for-each>
+					<xsl:text>&#xa;</xsl:text>
+				</xsl:for-each>
+			</xsl:result-document>
+		</xsl:for-each>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/csv/from.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/csv/from.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/csv/from.xsl	(revision 2397)
@@ -6,128 +6,137 @@
 	xmlns:tei="http://www.tei-c.org/ns/1.0"
 	xmlns:jc="http://james.blushingbunny.net/ns.html"
 	exclude-result-prefixes="xs tei jc">
-	<xsl:param name="input-encoding" select="'UTF-8'" as="xs:string"/>
-	<xsl:output indent="yes" encoding="UTF-8"/>
-	<xsl:param name="input-uri" select="'filename.csv'"/>
+	<xsl:param name="input-encoding" select="'UTF-8'"
+		as="xs:string" />
+	<xsl:output indent="yes" encoding="UTF-8" />
+	<xsl:param name="input-uri" select="'filename.csv'" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: James Cummings</p>
-         <p>Id: $Id: from.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2010, TEI Consortium</p>
-<p>
-Usage:  saxon -it main styesheet.xsl input-uri=filename.csv
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-<ul>
-<li> It assumes cells are comma separated and 
-rows are on individual lines...technically a linebreak 
-is allowed to occur inside a quoted CSV field, but in 
-this stylesheet it will be treated as two separate lines.</li>
-<li>If surrounded in double-quotes, it will remove 
-them.</li>
-<li>If there are extra or final commas, these will be changed 
-into empty <gi>cell/</gi> elements </li>
-<li> It assumes things are in UTF-8 but this can be 
-changed with the input-encoding parameter.  
-All output is converted to UTF-8.</li>
-</ul>
-</p>
-      </desc>
-   </doc>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: James Cummings</p>
+			<p>Id: $Id: from.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2010, TEI Consortium</p>
+			<p>
+				Usage: saxon -it main styesheet.xsl input-uri=filename.csv
 
-   <xsl:function name="jc:splitCSV" as="xs:string+">
-     <xsl:param name="str" as="xs:string"/>
-     <xsl:analyze-string select="concat($str, ',')"
-			 regex="((&quot;[^&quot;]*&quot;)+|[^,]*),">
-       <xsl:matching-substring>
-	 <xsl:sequence
-	     select="replace(regex-group(1), &quot;^&quot;&quot;|&quot;&quot;$|(&quot;&quot;)&quot;&quot;&quot;, &quot;$1&quot;)"
-	     />
-       </xsl:matching-substring>
-     </xsl:analyze-string>
-   </xsl:function>
-   
-   <xsl:template match="/" name="main">
-     <xsl:choose>
-       <xsl:when test="unparsed-text-available($input-uri, $input-encoding)">
-	 <xsl:variable name="csv"
-		       select="unparsed-text($input-uri, $input-encoding)"/>
-	 <xsl:variable name="lines" select="tokenize($csv, '&#xa;')"
-		       as="xs:string+"/>
-	 <TEI xmlns="http://www.tei-c.org/ns/1.0">
-	   <teiHeader>
-	     <fileDesc>
-	       <titleStmt>
-		 <title>A TEI file automatically converted from CSV</title>
-	       </titleStmt>
-	       <publicationStmt>
-		 <p>No publication statement</p>
-	       </publicationStmt>
-	       <sourceDesc>
-		 <p>A TEI file automatically converted from a CSV file.</p>
-		 
-	       </sourceDesc>
-	     </fileDesc>
-	   </teiHeader>
-	   <text>
-	     <body>
-	       <table>
-		 <xsl:for-each select="$lines">
-		   <row>
-		     <xsl:variable name="lineItems" select="jc:splitCSV(.)"
-				   as="xs:string+"/>
-		     
-		     <xsl:for-each select="$lineItems">
-		       <xsl:variable name="pos" select="position()"/>
-		       <cell n="{$pos}">
-			 <xsl:value-of select="$lineItems[$pos]"/>
-		       </cell>
-		     </xsl:for-each>
-		   </row>
-		 </xsl:for-each>
-	       </table>
-	     </body>
-	   </text>
-	 </TEI>
-       </xsl:when>
-       <xsl:otherwise>
-	 <xsl:message terminate="yes">
-	   <xsl:text>Cannot find the input csv file: </xsl:text>
-	   <xsl:value-of select="$input-uri"/>
-	 </xsl:message>
-       </xsl:otherwise>
-     </xsl:choose>
-   </xsl:template>
+				<ul>
+					<li> It assumes cells are comma separated and
+						rows are on individual lines...technically a linebreak
+						is allowed to occur inside a quoted CSV field, but in
+						this stylesheet it will be treated as two separate lines.</li>
+					<li>If surrounded in double-quotes, it will remove
+						them.</li>
+					<li>
+						If there are extra or final commas, these will be changed
+						into empty
+						<gi>cell/</gi>
+						elements
+					</li>
+					<li> It assumes things are in UTF-8 but this can be
+						changed with the input-encoding parameter.
+						All output is converted to UTF-8.</li>
+				</ul>
+			</p>
+		</desc>
+	</doc>
+
+	<xsl:function name="jc:splitCSV" as="xs:string+">
+		<xsl:param name="str" as="xs:string" />
+		<xsl:analyze-string select="concat($str, ',')"
+			regex="((&quot;[^&quot;]*&quot;)+|[^,]*),">
+			<xsl:matching-substring>
+				<xsl:sequence
+					select="replace(regex-group(1), &quot;^&quot;&quot;|&quot;&quot;$|(&quot;&quot;)&quot;&quot;&quot;, &quot;$1&quot;)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:function>
+
+	<xsl:template match="/" name="main">
+		<xsl:choose>
+			<xsl:when
+				test="unparsed-text-available($input-uri, $input-encoding)">
+				<xsl:variable name="csv"
+					select="unparsed-text($input-uri, $input-encoding)" />
+				<xsl:variable name="lines"
+					select="tokenize($csv, '&#xa;')" as="xs:string+" />
+				<TEI xmlns="http://www.tei-c.org/ns/1.0">
+					<teiHeader>
+						<fileDesc>
+							<titleStmt>
+								<title>A TEI file automatically converted from CSV</title>
+							</titleStmt>
+							<publicationStmt>
+								<p>No publication statement</p>
+							</publicationStmt>
+							<sourceDesc>
+								<p>A TEI file automatically converted from a CSV file.</p>
+
+							</sourceDesc>
+						</fileDesc>
+					</teiHeader>
+					<text>
+						<body>
+							<table>
+								<xsl:for-each select="$lines">
+									<row>
+										<xsl:variable name="lineItems"
+											select="jc:splitCSV(.)" as="xs:string+" />
+
+										<xsl:for-each select="$lineItems">
+											<xsl:variable name="pos" select="position()" />
+											<cell n="{$pos}">
+												<xsl:value-of select="$lineItems[$pos]" />
+											</cell>
+										</xsl:for-each>
+									</row>
+								</xsl:for-each>
+							</table>
+						</body>
+					</text>
+				</TEI>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:message terminate="yes">
+					<xsl:text>Cannot find the input csv file: </xsl:text>
+					<xsl:value-of select="$input-uri" />
+				</xsl:message>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/lite/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/lite/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/lite/to.xsl	(revision 2397)
@@ -1,56 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei m"
-                version="2.0">
+<xsl:stylesheet
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei m" version="2.0">
 
-    <!-- import base conversion style -->
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../odds2/odd2lite.xsl"/>
+	<xsl:import href="../../../odds2/odd2lite.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 9703 2011-11-09 11:16:42Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9703 2011-11-09 11:16:42Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/default-functions.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/default-functions.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/default-functions.xsl	(revision 2397)
@@ -1,117 +1,160 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                version="2.0"
-                exclude-result-prefixes="ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
 
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> Specialized TEI stylesheet for transforming tei into Word docx files for Vesta </p>
-         <p>This software is dual-licensed:
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" version="2.0"
+	exclude-result-prefixes="ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> Specialized TEI stylesheet for transforming tei into Word docx
+				files for Vesta </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: default-functions.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <!-- returns a listtype for a given stylename (return empty string to figure it out dynamically)-->
-    <xsl:function name="tei:get-listtype" as="xs:string">
-        <xsl:param name="style"/>
-        <xsl:choose>
-            <xsl:when test="starts-with($style,'dl')">
-                <xsl:text>gloss</xsl:text>
-            </xsl:when>
-            <xsl:when test="starts-with($style,$ListBullet)">
-                <xsl:text>unordered</xsl:text>
-            </xsl:when>
-            <xsl:when test="starts-with($style,$ListContinue)">
-                <xsl:text>unordered</xsl:text>
-            </xsl:when>
-            <xsl:when test="starts-with($style,$ListNumber)">
-                <xsl:text>ordered</xsl:text>
-            </xsl:when>
-            <xsl:when test="$style=$List">
-                <xsl:text>ordered</xsl:text>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:text/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
-    
-    <xsl:function name="tei:render-bold" as="xs:boolean">
-        <xsl:param name="element"/>
-        <xsl:for-each select="$element">
-            <xsl:choose>
-		<xsl:when test="ancestor-or-self::tei:cell[@rend='wovenodd-col1']">true</xsl:when>
-		<xsl:when test="ancestor-or-self::tei:cell[@role='label']">true</xsl:when>
-		<xsl:when test="self::tei:cell and parent::tei:row[@role='label']">true</xsl:when>
-                <xsl:when test="@rend='bold'">true</xsl:when>
-                <xsl:when test="@rend='label'">true</xsl:when>
-                <xsl:when test="@rend='odd_label'">true</xsl:when>
-                <xsl:when test="contains(@rend,'bold')">true</xsl:when>
-                <xsl:when test="parent::tei:hi[@rend='bold']">true</xsl:when>
-                <xsl:when test="parent::tei:hi[starts-with(@rend,'specList-')]">true</xsl:when>
-                <xsl:when test="self::tei:docAuthor">true</xsl:when>
-                <xsl:when test="self::tei:hi[@rend='label']">true</xsl:when>
-                <xsl:when test="self::tei:label[following-sibling::tei:item]">true</xsl:when>
-                <xsl:when test="self::tei:term">true</xsl:when>
-                <xsl:when test="starts-with(@rend,'specList-')">true</xsl:when>
-                <xsl:when test="starts-with(parent::tei:hi/@rend,'specList-')">true</xsl:when>
-                <xsl:otherwise>false</xsl:otherwise>
-            </xsl:choose>
-        </xsl:for-each>
-    </xsl:function>
-    
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: default-functions.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<!-- returns a listtype for a given stylename (return empty string to figure 
+		it out dynamically) -->
+	<xsl:function name="tei:get-listtype" as="xs:string">
+		<xsl:param name="style" />
+		<xsl:choose>
+			<xsl:when test="starts-with($style,'dl')">
+				<xsl:text>gloss</xsl:text>
+			</xsl:when>
+			<xsl:when test="starts-with($style,$ListBullet)">
+				<xsl:text>unordered</xsl:text>
+			</xsl:when>
+			<xsl:when test="starts-with($style,$ListContinue)">
+				<xsl:text>unordered</xsl:text>
+			</xsl:when>
+			<xsl:when test="starts-with($style,$ListNumber)">
+				<xsl:text>ordered</xsl:text>
+			</xsl:when>
+			<xsl:when test="$style=$List">
+				<xsl:text>ordered</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
+	<xsl:function name="tei:render-bold" as="xs:boolean">
+		<xsl:param name="element" />
+		<xsl:for-each select="$element">
+			<xsl:choose>
+				<xsl:when
+					test="ancestor-or-self::tei:cell[@rend='wovenodd-col1']">
+					true
+				</xsl:when>
+				<xsl:when test="ancestor-or-self::tei:cell[@role='label']">
+					true
+				</xsl:when>
+				<xsl:when
+					test="self::tei:cell and parent::tei:row[@role='label']">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='bold'">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='label'">
+					true
+				</xsl:when>
+				<xsl:when test="@rend='odd_label'">
+					true
+				</xsl:when>
+				<xsl:when test="contains(@rend,'bold')">
+					true
+				</xsl:when>
+				<xsl:when test="parent::tei:hi[@rend='bold']">
+					true
+				</xsl:when>
+				<xsl:when
+					test="parent::tei:hi[starts-with(@rend,'specList-')]">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:docAuthor">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:hi[@rend='label']">
+					true
+				</xsl:when>
+				<xsl:when
+					test="self::tei:label[following-sibling::tei:item]">
+					true
+				</xsl:when>
+				<xsl:when test="self::tei:term">
+					true
+				</xsl:when>
+				<xsl:when test="starts-with(@rend,'specList-')">
+					true
+				</xsl:when>
+				<xsl:when
+					test="starts-with(parent::tei:hi/@rend,'specList-')">
+					true
+				</xsl:when>
+				<xsl:otherwise>
+					false
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:function>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/to.xsl	(revision 2397)
@@ -1,392 +1,440 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                version="2.0"
-                exclude-result-prefixes="ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn tei teidocx">
-    <!-- import conversion style -->
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
 
-    <xsl:import href="../../../docx/to/teitodocx.xsl"/>
-    
-    <!-- import functions -->
-    <xsl:import href="default-functions.xsl"/>
-    
-    <xsl:param name="renderAddDel">true</xsl:param>
-    <xsl:param name="addColour">red</xsl:param>
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" version="2.0"
+	exclude-result-prefixes="ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn tei teidocx">
+	<!-- import conversion style -->
 
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML (see tei-docx.xsl)</p>
-         <p>This software is dual-licensed:
+	<xsl:import href="../../../docx/to/teitodocx.xsl" />
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<!-- import functions -->
+	<xsl:import href="default-functions.xsl" />
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<xsl:param name="renderAddDel">
+		true
+	</xsl:param>
+	<xsl:param name="addColour">
+		red
+	</xsl:param>
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML (see
+				tei-docx.xsl)</p>
+			<p>This software is dual-licensed:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <xsl:param name="bulletOne">•</xsl:param>
-    <xsl:param name="bulletTwo"></xsl:param>
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-    <xsl:param name="word-directory">..</xsl:param>
-    <xsl:param name="debug">false</xsl:param>
-    <xsl:param name="styleDoc">
-        <xsl:value-of select="concat($word-directory, '/word/styles.xml')"/>
-    </xsl:param>
-    
-    <!-- Styles -->
-    
-    <xsl:template match="tei:abbr" mode="get-style">abbr</xsl:template>
-    <xsl:template match="tei:cit" mode="get-style">Quote</xsl:template>
-    <xsl:template match="tei:date" mode="get-style">date</xsl:template>
-    <xsl:template match="tei:foreign" mode="get-style">teiforeign</xsl:template>
-    <xsl:template match="tei:formula" mode="get-style">Formula</xsl:template>
-    <xsl:template match="tei:mentioned" mode="get-style">teimentioned</xsl:template>
-    <xsl:template match="tei:orgName" mode="get-style">orgName</xsl:template>
-    <xsl:template match="tei:quote" mode="get-style">Quote</xsl:template>
-    <xsl:template match="tei:ref[@rend and not(@target)]" mode="get-style"><xsl:value-of select="@rend"/></xsl:template>
-    <xsl:template match="tei:seg[@rend]" mode="get-style"><xsl:value-of select="@rend"/></xsl:template>
+				All rights reserved.
 
-    <xsl:template match="tei:p[@rend]" mode="get-style">
-        <xsl:call-template name="getStyleName">
-            <xsl:with-param name="in" select="@rend"/>
-        </xsl:call-template>
-    </xsl:template>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-       <xsl:template match="tei:editionStmt">
-        <w:r>
-            <w:t>
-            <xsl:value-of select="tei:edition"/> Edition</w:t>
-        </w:r>
-    </xsl:template>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <xsl:template match="tei:label[following-sibling::tei:*[1]/self::tei:item]">
-        <xsl:param name="nop"/>   
-	<xsl:variable name="pair">
-	  <tei:list>
-	    <tei:glossListEntry count="{count(ancestor::tei:list)}">
-	      <tei:hi rend="bold">
-		<xsl:apply-templates mode="iden"/>
-	      </tei:hi>
-	      <tei:lb/>
-	      <xsl:for-each select="following-sibling::tei:item[1]">
-		<xsl:apply-templates mode="iden"/>
-	      </xsl:for-each>
-	    </tei:glossListEntry>
-	  </tei:list>
-	</xsl:variable>
-	<xsl:apply-templates select="$pair/tei:list/tei:glossListEntry"/>
-    </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-    <xsl:template match="tei:glossListEntry">
-      <xsl:call-template name="block-element">
-	<xsl:with-param name="style">dl</xsl:with-param>
-	<xsl:with-param name="pPr">
-	  <w:pPr>
-	    <w:pStyle w:val="dl"/>
-	    <w:ind w:left="360" w:hanging="360"/>
-	  </w:pPr>
-	</xsl:with-param>
-      </xsl:call-template>
-    </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-   
-    <xsl:template match="tei:seg[not(@*) and normalize-space(.)='']">
-      <w:r>
-	<w:t>
-	  <xsl:attribute name="xml:space">preserve</xsl:attribute>
-	  <xsl:text> </xsl:text>
-	</w:t>
-      </w:r>
-    </xsl:template>
+	<xsl:param name="bulletOne">
+		•
+	</xsl:param>
+	<xsl:param name="bulletTwo">
+		
+	</xsl:param>
 
-    
-    <!-- 
-        Block Templates:
-        Here we can overwrite how block elements are rendered
-    -->
-  
-    
-    <!-- Dates -->
-    <xsl:template match="tei:date[ancestor::tei:teiHeader]">
-        <w:r>
-            <w:rPr>
-                <w:rStyle w:val="date"/>
-            </w:rPr>
-            <w:t>
-                <xsl:value-of select="."/>
-            </w:t>
-        </w:r>
-    </xsl:template>
+	<xsl:param name="word-directory">
+		..
+	</xsl:param>
+	<xsl:param name="debug">
+		false
+	</xsl:param>
+	<xsl:param name="styleDoc">
+		<xsl:value-of
+			select="concat($word-directory, '/word/styles.xml')" />
+	</xsl:param>
 
-    <!-- formulas -->
-    <xsl:template match="tei:formula">
-        <w:p>    
-            <w:pPr>
-                <w:pStyle w:val="Formula"/>
-            </w:pPr>
-            <xsl:call-template name="block-element">                   
-                <xsl:with-param name="nop">true</xsl:with-param>
-            </xsl:call-template>
-            <xsl:if test="@n">
-                <w:r>
-                    <w:tab/>
-                </w:r>
-                <w:r>
-                    <w:rPr>
-                        <w:rStyle w:val="FormulaReference"/>
-                    </w:rPr>
-                    <w:t xml:space="preserve"><xsl:value-of select="@n"/></w:t>
-                </w:r>
-            </xsl:if>
-        </w:p>
-    </xsl:template>
-    
-     
-    <!-- 
-        Special Notes (Footnotes) .. 
-        @TODO: Ideally this should go into the general template, but for some
-        reason xsl always calls the less specific tei:note template in here. 
-    -->
-    <xsl:template match="tei:note[@place]">
-        <xsl:choose>
-            <xsl:when test="@place='foot'  or @place='bottom' or @place='tablefoot' ">
-                <xsl:call-template name="create-footnote"/>
-            </xsl:when>
-            <xsl:when test="@place='end'">
-                <xsl:call-template name="create-endnote"/>
-            </xsl:when>
-	    <xsl:when test="@place='comment'">
-	      <xsl:call-template name="create-comment"/>
-	    </xsl:when>
-	</xsl:choose>
-    </xsl:template>
-    
-    
-    
-    <!-- Paragraphs in the front matter -->
-    <xsl:template match="tei:front/tei:div/tei:p">
-        <xsl:call-template name="block-element">
-            <xsl:with-param name="pPr">
-                <w:pPr>
-                    <w:pStyle>
-                        <xsl:attribute name="w:val">
-                            <xsl:value-of select="concat(upper-case(substring(parent::tei:div/@type,1,1)),substring(parent::tei:div/@type,2))"/>
+	<!-- Styles -->
+
+	<xsl:template match="tei:abbr" mode="get-style">
+		abbr
+	</xsl:template>
+	<xsl:template match="tei:cit" mode="get-style">
+		Quote
+	</xsl:template>
+	<xsl:template match="tei:date" mode="get-style">
+		date
+	</xsl:template>
+	<xsl:template match="tei:foreign" mode="get-style">
+		teiforeign
+	</xsl:template>
+	<xsl:template match="tei:formula" mode="get-style">
+		Formula
+	</xsl:template>
+	<xsl:template match="tei:mentioned" mode="get-style">
+		teimentioned
+	</xsl:template>
+	<xsl:template match="tei:orgName" mode="get-style">
+		orgName
+	</xsl:template>
+	<xsl:template match="tei:quote" mode="get-style">
+		Quote
+	</xsl:template>
+	<xsl:template match="tei:ref[@rend and not(@target)]"
+		mode="get-style">
+		<xsl:value-of select="@rend" />
+	</xsl:template>
+	<xsl:template match="tei:seg[@rend]" mode="get-style">
+		<xsl:value-of select="@rend" />
+	</xsl:template>
+
+	<xsl:template match="tei:p[@rend]" mode="get-style">
+		<xsl:call-template name="getStyleName">
+			<xsl:with-param name="in" select="@rend" />
+		</xsl:call-template>
+	</xsl:template>
+
+	<xsl:template match="tei:editionStmt">
+		<w:r>
+			<w:t>
+				<xsl:value-of select="tei:edition" />
+				Edition
+			</w:t>
+		</w:r>
+	</xsl:template>
+
+	<xsl:template
+		match="tei:label[following-sibling::tei:*[1]/self::tei:item]">
+		<xsl:param name="nop" />
+		<xsl:variable name="pair">
+			<tei:list>
+				<tei:glossListEntry
+					count="{count(ancestor::tei:list)}">
+					<tei:hi rend="bold">
+						<xsl:apply-templates mode="iden" />
+					</tei:hi>
+					<tei:lb />
+					<xsl:for-each select="following-sibling::tei:item[1]">
+						<xsl:apply-templates mode="iden" />
+					</xsl:for-each>
+				</tei:glossListEntry>
+			</tei:list>
+		</xsl:variable>
+		<xsl:apply-templates
+			select="$pair/tei:list/tei:glossListEntry" />
+	</xsl:template>
+
+	<xsl:template match="tei:glossListEntry">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				dl
+			</xsl:with-param>
+			<xsl:with-param name="pPr">
+				<w:pPr>
+					<w:pStyle w:val="dl" />
+					<w:ind w:left="360" w:hanging="360" />
+				</w:pPr>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+
+
+	<xsl:template
+		match="tei:seg[not(@*) and normalize-space(.)='']">
+		<w:r>
+			<w:t>
+				<xsl:attribute name="xml:space">preserve</xsl:attribute>
+				<xsl:text> </xsl:text>
+			</w:t>
+		</w:r>
+	</xsl:template>
+
+
+	<!-- Block Templates: Here we can overwrite how block elements are rendered -->
+
+
+	<!-- Dates -->
+	<xsl:template match="tei:date[ancestor::tei:teiHeader]">
+		<w:r>
+			<w:rPr>
+				<w:rStyle w:val="date" />
+			</w:rPr>
+			<w:t>
+				<xsl:value-of select="." />
+			</w:t>
+		</w:r>
+	</xsl:template>
+
+	<!-- formulas -->
+	<xsl:template match="tei:formula">
+		<w:p>
+			<w:pPr>
+				<w:pStyle w:val="Formula" />
+			</w:pPr>
+			<xsl:call-template name="block-element">
+				<xsl:with-param name="nop">
+					true
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:if test="@n">
+				<w:r>
+					<w:tab />
+				</w:r>
+				<w:r>
+					<w:rPr>
+						<w:rStyle w:val="FormulaReference" />
+					</w:rPr>
+					<w:t xml:space="preserve"><xsl:value-of select="@n" /></w:t>
+				</w:r>
+			</xsl:if>
+		</w:p>
+	</xsl:template>
+
+
+	<!-- Special Notes (Footnotes) .. @TODO: Ideally this should go into the 
+		general template, but for some reason xsl always calls the less specific 
+		tei:note template in here. -->
+	<xsl:template match="tei:note[@place]">
+		<xsl:choose>
+			<xsl:when
+				test="@place='foot'  or @place='bottom' or @place='tablefoot' ">
+				<xsl:call-template name="create-footnote" />
+			</xsl:when>
+			<xsl:when test="@place='end'">
+				<xsl:call-template name="create-endnote" />
+			</xsl:when>
+			<xsl:when test="@place='comment'">
+				<xsl:call-template name="create-comment" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+
+
+	<!-- Paragraphs in the front matter -->
+	<xsl:template match="tei:front/tei:div/tei:p">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="pPr">
+				<w:pPr>
+					<w:pStyle>
+						<xsl:attribute name="w:val">
+                            <xsl:value-of
+							select="concat(upper-case(substring(parent::tei:div/@type,1,1)),substring(parent::tei:div/@type,2))" />
                         </xsl:attribute>
-                    </w:pStyle>
-                </w:pPr>
-            </xsl:with-param>
-        </xsl:call-template>
-    </xsl:template>
-   
-    
-    
-    <!-- who created this document -->
-    <xsl:template name="created-by">
-        <xsl:text>TEI XSL</xsl:text>
-    </xsl:template>
+					</w:pStyle>
+				</w:pPr>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
 
-    <!-- fake listPerson into an unordered list -->
-  <xsl:template match="tei:listPerson">
-      <xsl:variable name="mylist">
-         <tei:list type="unordered">
-	           <xsl:apply-templates/>
-         </tei:list>
-      </xsl:variable>
-      <xsl:apply-templates select="$mylist"/>
-  </xsl:template>
 
-  <xsl:template match="tei:person">
-      <tei:item>
-         <xsl:copy-of select="*|text()"/>
-      </tei:item>
-  </xsl:template>
+	<!-- who created this document -->
+	<xsl:template name="created-by">
+		<xsl:text>TEI XSL</xsl:text>
+	</xsl:template>
 
-  <xsl:template match="tei:affiliation">
-      <w:r>
-        <w:br/>
-      </w:r>   
-     <xsl:apply-templates/>
-  </xsl:template>
 
+	<!-- fake listPerson into an unordered list -->
+	<xsl:template match="tei:listPerson">
+		<xsl:variable name="mylist">
+			<tei:list type="unordered">
+				<xsl:apply-templates />
+			</tei:list>
+		</xsl:variable>
+		<xsl:apply-templates select="$mylist" />
+	</xsl:template>
 
-    <xsl:template name="defineOrderedLists">
-      <w:abstractNum w:abstractNumId="3">
-                    <w:multiLevelType w:val="multilevel"/>
-                    <w:lvl w:ilvl="0">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="ListNumber"/>
-                        <w:lvlText w:val="%1."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="360" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="1">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:pStyle w:val="ListNumber2"/>
-                        <w:lvlText w:val="%2)"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="720" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="2">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:pStyle w:val="ListNumber3"/>
-                        <w:lvlText w:val="%3)"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1080" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="3">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="upperRoman"/>
-                        <w:pStyle w:val="ListNumber4"/>
-                        <w:lvlText w:val="%4)"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1440" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="4">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="(%5)"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1800" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="5">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="(%6)"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2160" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="6">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%7."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2520" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="7">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%8."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2880" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="8">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%9."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="3240" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                </w:abstractNum>
+	<xsl:template match="tei:person">
+		<tei:item>
+			<xsl:copy-of select="*|text()" />
+		</tei:item>
+	</xsl:template>
 
-    </xsl:template>
+	<xsl:template match="tei:affiliation">
+		<w:r>
+			<w:br />
+		</w:r>
+		<xsl:apply-templates />
+	</xsl:template>
 
-    <xsl:template match="@*|text()|comment()|processing-instruction()" mode="iden">
-      <xsl:copy-of select="."/>
-    </xsl:template>
-    
-    <xsl:template match="*" mode="iden">
-      <xsl:copy>
-	        <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="iden"/>
-      </xsl:copy>
-    </xsl:template>
- 
 
+	<xsl:template name="defineOrderedLists">
+		<w:abstractNum w:abstractNumId="3">
+			<w:multiLevelType w:val="multilevel" />
+			<w:lvl w:ilvl="0">
+				<w:start w:val="1" />
+				<w:numFmt w:val="decimal" />
+				<w:pStyle w:val="ListNumber" />
+				<w:lvlText w:val="%1." />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="360" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="1">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerLetter" />
+				<w:pStyle w:val="ListNumber2" />
+				<w:lvlText w:val="%2)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="720" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="2">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerRoman" />
+				<w:pStyle w:val="ListNumber3" />
+				<w:lvlText w:val="%3)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1080" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="3">
+				<w:start w:val="1" />
+				<w:numFmt w:val="upperRoman" />
+				<w:pStyle w:val="ListNumber4" />
+				<w:lvlText w:val="%4)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1440" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="4">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerLetter" />
+				<w:lvlText w:val="(%5)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1800" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="5">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerRoman" />
+				<w:lvlText w:val="(%6)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2160" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="6">
+				<w:start w:val="1" />
+				<w:numFmt w:val="decimal" />
+				<w:lvlText w:val="%7." />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2520" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="7">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerLetter" />
+				<w:lvlText w:val="%8." />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2880" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="8">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerRoman" />
+				<w:lvlText w:val="%9." />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="3240" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+		</w:abstractNum>
+
+	</xsl:template>
+
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="iden">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*" mode="iden">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="iden" />
+		</xsl:copy>
+	</xsl:template>
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/from.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/from.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docx/from.xsl	(revision 2397)
@@ -1,77 +1,83 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns="http://www.tei-c.org/ns/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-		xmlns:html="http://www.w3.org/1999/xhtml"
-		xmlns:its="http://www.w3.org/2005/11/its"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                version="2.0"
-                exclude-result-prefixes="ve o r m v wp html its w10 w wne mml tbx iso">
-    <!-- import base conversion style -->
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:its="http://www.w3.org/2005/11/its"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	version="2.0"
+	exclude-result-prefixes="ve o r m v wp html its w10 w wne mml tbx iso">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../docx/from/docxtotei.xsl"/>
-    
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for simplifying TEI ODD markup </p>
-      <p>This software is dual-licensed:
+	<xsl:import href="../../../docx/from/docxtotei.xsl" />
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for simplifying TEI ODD markup </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: from.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-    
-    <xsl:output indent="yes"/>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <xsl:template match="@rend[.='Body Text']" mode="pass2"/>
-    <xsl:template match="@rend[.='Body Text 2']" mode="pass2"/>
-    <xsl:template match="@rend[.='Body Text 3']" mode="pass2"/>
-    <xsl:template match="@rend[.='Text Body']" mode="pass2"/>
-    <xsl:template match="@rend[.='Text body']" mode="pass2"/>
-    <xsl:template match="@rend[.='Body Text Indent']" mode="pass2"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: from.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:output indent="yes" />
+
+	<xsl:template match="@rend[.='Body Text']" mode="pass2" />
+	<xsl:template match="@rend[.='Body Text 2']" mode="pass2" />
+	<xsl:template match="@rend[.='Body Text 3']" mode="pass2" />
+	<xsl:template match="@rend[.='Text Body']" mode="pass2" />
+	<xsl:template match="@rend[.='Text body']" mode="pass2" />
+	<xsl:template match="@rend[.='Body Text Indent']"
+		mode="pass2" />
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/relaxng/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/relaxng/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/relaxng/to.xsl	(revision 2397)
@@ -1,65 +1,69 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-    xmlns:fo="http://www.w3.org/1999/XSL/Format" 
-    xmlns:html="http://www.w3.org/1999/xhtml" 
-    xmlns:i="http://www.iso.org/ns/1.0"
-    xmlns:rng="http://relaxng.org/ns/structure/1.0"
-    xmlns:s="http://www.ascc.net/xml/schematron" 
-    xmlns:sch="http://purl.oclc.org/dsdl/schematron" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:teix="http://www.tei-c.org/ns/Examples" 
-    xmlns:xi="http://www.w3.org/2001/XInclude"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl"
-                version="2.0">
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:i="http://www.iso.org/ns/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a fo html i rng s sch tei teix xi xs xsl"
+	version="2.0">
 
-    <!-- import base conversion style -->
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../odds2/odd2relax.xsl"/>
+	<xsl:import href="../../../odds2/odd2relax.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 9703 2011-11-09 11:16:42Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9703 2011-11-09 11:16:42Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/fo/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/fo/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/fo/to.xsl	(revision 2397)
@@ -1,54 +1,57 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei m"
-                version="2.0">
-    <!-- import base conversion style -->
+<xsl:stylesheet
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei m" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../fo2/tei.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<xsl:import href="../../../fo2/tei.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html/to.xsl	(revision 2397)
@@ -1,75 +1,77 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns="http://www.w3.org/1999/xhtml"
-    xmlns:html="http://www.w3.org/1999/xhtml"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="tei html"
-    version="2.0">
-    <!-- import base conversion style -->
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei html" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../xhtml2/tei.xsl"/>
+	<xsl:import href="../../../xhtml2/tei.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-   <xsl:output method="xhtml" omit-xml-declaration="yes"/>
-    
-    <xsl:template match="html:*">
-      <xsl:element name="{local-name()}">
-	<xsl:copy-of select="@*"/>
-	<xsl:apply-templates/>
-      </xsl:element>
-    </xsl:template>
-    
-    <xsl:template match="html:*/comment()">
-      <xsl:copy-of select="."/>
-    </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:template match="tei:div[@type='frontispiece']">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:output method="xhtml" omit-xml-declaration="yes" />
 
-  <xsl:template match="tei:div[@type='illustration']">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="html:*">
+		<xsl:element name="{local-name()}">
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
 
+	<xsl:template match="html:*/comment()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="tei:div[@type='frontispiece']">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="tei:div[@type='illustration']">
+		<xsl:apply-templates />
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html/from.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html/from.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/html/from.xsl	(revision 2397)
@@ -1,55 +1,57 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns="http://www.w3.org/1999/xhtml"
-    xmlns:html="http://www.w3.org/1999/xhtml"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="tei html"
-    version="2.0">
-    <!-- import base conversion style -->
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei html" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../tools/html2tei.xsl"/>
+	<xsl:import href="../../../tools/html2tei.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 8923 2011-05-25 13:11:45Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 8923 2011-05-25 13:11:45Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/dtd/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/dtd/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/dtd/to.xsl	(revision 2397)
@@ -1,54 +1,57 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei m"
-                version="2.0">
-    <!-- import base conversion style -->
+<xsl:stylesheet
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei m" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../odds2/odd2dtd.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<xsl:import href="../../../odds2/odd2dtd.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 9703 2011-11-09 11:16:42Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9703 2011-11-09 11:16:42Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/rdf/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/rdf/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/rdf/to.xsl	(revision 2397)
@@ -1,56 +1,58 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:html="http://www.w3.org/1999/xhtml"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="tei html"
-    version="2.0">
-    <!-- import base conversion style -->
+<xsl:stylesheet xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei html" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../rdf/tei2rdf.xsl"/>
+	<xsl:import href="../../../rdf/tei2rdf.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 8884 2011-05-03 14:46:06Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-   <xsl:output method="xml" omit-xml-declaration="yes"/>
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 8884 2011-05-03 14:46:06Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
+	<xsl:output method="xml" omit-xml-declaration="yes" />
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/latex/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/latex/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/latex/to.xsl	(revision 2397)
@@ -1,54 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="tei m"
-                version="2.0">
-    <!-- import base conversion style -->
+<xsl:stylesheet
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei m" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../latex2/tei.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+	<xsl:import href="../../../latex2/tei.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:param name="reencode">false</xsl:param>
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:param name="reencode">
+		false
+	</xsl:param>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/epub3/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/epub3/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/epub3/to.xsl	(revision 2397)
@@ -1,48 +1,52 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="tei">
-    <xsl:import href="../../../epub3/tei-to-epub3.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for making ePub from TEI.</p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="tei">
+	<xsl:import href="../../../epub3/tei-to-epub3.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making ePub from TEI.</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: to.xsl 8698 2011-02-25 22:34:37Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 8698 2011-02-25 22:34:37Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/txt/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/txt/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/txt/to.xsl	(revision 2397)
@@ -1,54 +1,56 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns="http://www.w3.org/1999/xhtml"
-    xmlns:html="http://www.w3.org/1999/xhtml"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    exclude-result-prefixes="tei html"
-    version="2.0">
-    <!-- import base conversion style -->
-    <xsl:import href="../../../txt/tei-to-text.xsl"/>
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="tei html" version="2.0">
+	<!-- import base conversion style -->
+	<xsl:import href="../../../txt/tei-to-text.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: to.xsl 8923 2011-05-25 13:11:45Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-   <xsl:output method="text"/>
-    
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 8923 2011-05-25 13:11:45Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:output method="text" />
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docbook/from.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docbook/from.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/docbook/from.xsl	(revision 2397)
@@ -1,713 +1,732 @@
-<xsl:stylesheet 
-    xmlns="http://www.tei-c.org/ns/1.0"
-    xpath-default-namespace="http://docbook.org/ns/docbook"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns="http://www.tei-c.org/ns/1.0"
+	xpath-default-namespace="http://docbook.org/ns/docbook"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: Sebastian Rahtz</p>
-         <p>Id: $Id: from.xsl 10017 2012-01-10 14:45:54Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: Sebastian Rahtz</p>
+			<p>Id: $Id: from.xsl 10017 2012-01-10 14:45:54Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-<xsl:output method="xml" indent="yes" encoding="utf-8"/>
-  <xsl:variable name="processor">
-    <xsl:value-of select="system-property('xsl:vendor')"/>
-  </xsl:variable>
 
-<xsl:template match="/">
-  <xsl:choose>
-    <xsl:when test="*[namespace-uri()='http://docbook.org/ns/docbook']">
-      <xsl:apply-templates/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:variable name="db5">
-	<xsl:apply-templates mode="convert"/>
-      </xsl:variable>
-      <xsl:apply-templates select="$db5/*"/>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
+	<xsl:output method="xml" indent="yes" encoding="utf-8" />
+	<xsl:variable name="processor">
+		<xsl:value-of select="system-property('xsl:vendor')" />
+	</xsl:variable>
 
-<xsl:template match="@*|text()|comment()" mode="convert">
-  <xsl:copy-of select="."/>
-</xsl:template>
+	<xsl:template match="/">
+		<xsl:choose>
+			<xsl:when
+				test="*[namespace-uri()='http://docbook.org/ns/docbook']">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="db5">
+					<xsl:apply-templates mode="convert" />
+				</xsl:variable>
+				<xsl:apply-templates select="$db5/*" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template match="*" mode="convert">
-  <xsl:element name="{name()}" namespace="http://docbook.org/ns/docbook">
-    <xsl:apply-templates select="@*|text()|*|comment()" mode="convert"/>
-  </xsl:element>
-</xsl:template>
+	<xsl:template match="@*|text()|comment()" mode="convert">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
+	<xsl:template match="*" mode="convert">
+		<xsl:element name="{name()}"
+			namespace="http://docbook.org/ns/docbook">
+			<xsl:apply-templates
+				select="@*|text()|*|comment()" mode="convert" />
+		</xsl:element>
+	</xsl:template>
 
-<xsl:template match="abbrev">
-  <abbr>
-    <xsl:apply-templates/>
-  </abbr>
-</xsl:template>
 
-<xsl:template match="abstract">
-  <div type="abstract">
-    <xsl:call-template name="ID"/>
-    <xsl:apply-templates/>
-  </div>
-</xsl:template>
+	<xsl:template match="abbrev">
+		<abbr>
+			<xsl:apply-templates />
+		</abbr>
+	</xsl:template>
 
-<xsl:template match="ackno">
- <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="abstract">
+		<div type="abstract">
+			<xsl:call-template name="ID" />
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
 
-<xsl:template match="acronym">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="ackno">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="address">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="acronym">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="affiliation">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="address">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="anchor">
- <anchor>
-   <xsl:call-template name="ID"/>
- </anchor>
-</xsl:template>
+	<xsl:template match="affiliation">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="appendix">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="anchor">
+		<anchor>
+			<xsl:call-template name="ID" />
+		</anchor>
+	</xsl:template>
 
-<xsl:template match="application">
- <ident type="application" >
-   <xsl:apply-templates/>
- </ident>
-</xsl:template>
+	<xsl:template match="appendix">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="info|artheader|articleinfo"/>
+	<xsl:template match="application">
+		<ident type="application">
+			<xsl:apply-templates />
+		</ident>
+	</xsl:template>
 
-<xsl:template match="info|artheader|articleinfo" mode="header">
-  <teiHeader >
-    <fileDesc>
-      <titleStmt>
-	<xsl:apply-templates select="title"/>
-	<author>
-	  <xsl:choose>
-	    <xsl:when test="author">
-	      <xsl:apply-templates select="author"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:text>unknown author</xsl:text>
-	  </xsl:otherwise>
-	  </xsl:choose>
-	</author>
-      </titleStmt>
-      <editionStmt>
-          <edition>
-            <date>
-	      <xsl:choose>
-		<xsl:when test="pubdate">
-		  <xsl:apply-templates select="pubdate"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <xsl:call-template name="whatsTheDate"/> 
-		</xsl:otherwise>
-	      </xsl:choose>
-            </date>
-          </edition>
-        </editionStmt>
-      <publicationStmt>
-        <p></p>
-      </publicationStmt>
-    <sourceDesc>
-      <p>Converted from a Docbook original</p>
-    </sourceDesc>
-    </fileDesc>
-    <xsl:if test="keywordset">
-      <profileDesc>
-        <textClass>
-	  <xsl:apply-templates select="keywordset"/>
-        </textClass>
-      </profileDesc>
-    </xsl:if>
-  </teiHeader>
-</xsl:template>
+	<xsl:template match="info|artheader|articleinfo" />
 
-<xsl:template match="article|book">
-  <TEI>
-    <xsl:call-template name="ID"/>
-    <xsl:apply-templates select="info|artheader|articleinfo" mode="header"/>
-    <text>
-      <xsl:choose>
-	<xsl:when test="artheader/abstract">
-	  <front>
-	    <xsl:apply-templates select="artheader/abstract"/>
-	  </front>
-	</xsl:when>
-	<xsl:when test="articleinfo/abstract">
-	  <front>
-	    <xsl:apply-templates select="articleinfo/abstract"/>
-	  </front>
-	</xsl:when>
-	<xsl:otherwise>
-	</xsl:otherwise>
-      </xsl:choose>
-      <body>
-	<xsl:apply-templates />
-      </body>
-    </text>
-  </TEI>
-</xsl:template>
+	<xsl:template match="info|artheader|articleinfo"
+		mode="header">
+		<teiHeader>
+			<fileDesc>
+				<titleStmt>
+					<xsl:apply-templates select="title" />
+					<author>
+						<xsl:choose>
+							<xsl:when test="author">
+								<xsl:apply-templates select="author" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:text>unknown author</xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</author>
+				</titleStmt>
+				<editionStmt>
+					<edition>
+						<date>
+							<xsl:choose>
+								<xsl:when test="pubdate">
+									<xsl:apply-templates select="pubdate" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:call-template name="whatsTheDate" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</date>
+					</edition>
+				</editionStmt>
+				<publicationStmt>
+					<p></p>
+				</publicationStmt>
+				<sourceDesc>
+					<p>Converted from a Docbook original</p>
+				</sourceDesc>
+			</fileDesc>
+			<xsl:if test="keywordset">
+				<profileDesc>
+					<textClass>
+						<xsl:apply-templates select="keywordset" />
+					</textClass>
+				</profileDesc>
+			</xsl:if>
+		</teiHeader>
+	</xsl:template>
 
-<xsl:template match="attribution">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="article|book">
+		<TEI>
+			<xsl:call-template name="ID" />
+			<xsl:apply-templates
+				select="info|artheader|articleinfo" mode="header" />
+			<text>
+				<xsl:choose>
+					<xsl:when test="artheader/abstract">
+						<front>
+							<xsl:apply-templates
+								select="artheader/abstract" />
+						</front>
+					</xsl:when>
+					<xsl:when test="articleinfo/abstract">
+						<front>
+							<xsl:apply-templates
+								select="articleinfo/abstract" />
+						</front>
+					</xsl:when>
+					<xsl:otherwise>
+					</xsl:otherwise>
+				</xsl:choose>
+				<body>
+					<xsl:apply-templates />
+				</body>
+			</text>
+		</TEI>
+	</xsl:template>
 
-<xsl:template match="author">
-    <name>
-      <xsl:choose>
-	<xsl:when test="surname">
-	  <persName>
-	    <xsl:apply-templates/>
-	  </persName>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:apply-templates/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </name>
-</xsl:template>
+	<xsl:template match="attribution">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="authorblurb">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="author">
+		<name>
+			<xsl:choose>
+				<xsl:when test="surname">
+					<persName>
+						<xsl:apply-templates />
+					</persName>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</name>
+	</xsl:template>
 
-<xsl:template match="authorgroup">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="authorblurb">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="bibliodiv">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="authorgroup">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="bibliography">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="bibliodiv">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="bibliomisc">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="bibliography">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="bibliomixed">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="bibliomisc">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="blockquote">
-  <q>  
-    <xsl:apply-templates/>
-  </q>
-</xsl:template>
+	<xsl:template match="bibliomixed">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="chapter">
-  <div>  
-    <xsl:call-template name="ID"/>
-    <xsl:apply-templates/>
-  </div>
-</xsl:template>
+	<xsl:template match="blockquote">
+		<q>
+			<xsl:apply-templates />
+		</q>
+	</xsl:template>
 
-<xsl:template match="citation">
-  <cit>  
-    <xsl:apply-templates/>
-  </cit>
-</xsl:template>
+	<xsl:template match="chapter">
+		<div>
+			<xsl:call-template name="ID" />
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
 
-<xsl:template match="computeroutput">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="citation">
+		<cit>
+			<xsl:apply-templates />
+		</cit>
+	</xsl:template>
 
-<xsl:template match="copyright">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="computeroutput">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="email">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="copyright">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="emphasis">
-  <xsl:choose>
-    <xsl:when test="@role='strong'">
-      <hi>
-	<xsl:apply-templates/>
-      </hi>
-    </xsl:when>
-    <xsl:otherwise>
-      <hi>
-	<xsl:call-template name="Role"/>
-	<xsl:apply-templates/>
-      </hi>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
+	<xsl:template match="email">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="entry">
-  <cell>
-    <xsl:apply-templates/>
-  </cell>
-</xsl:template>
+	<xsl:template match="emphasis">
+		<xsl:choose>
+			<xsl:when test="@role='strong'">
+				<hi>
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:otherwise>
+				<hi>
+					<xsl:call-template name="Role" />
+					<xsl:apply-templates />
+				</hi>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template match="example">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="entry">
+		<cell>
+			<xsl:apply-templates />
+		</cell>
+	</xsl:template>
 
-<xsl:template match="figure">
-  <figure>
-    <xsl:apply-templates/>
-    <figDesc></figDesc>
-  </figure>
-</xsl:template>
+	<xsl:template match="example">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="foreignphrase">
-  <foreign><xsl:apply-templates/></foreign>
-</xsl:template>
+	<xsl:template match="figure">
+		<figure>
+			<xsl:apply-templates />
+			<figDesc></figDesc>
+		</figure>
+	</xsl:template>
 
-<xsl:template match="imageobject">
-  <graphic url="{imagedata/@fileref}"/>
-</xsl:template>
+	<xsl:template match="foreignphrase">
+		<foreign>
+			<xsl:apply-templates />
+		</foreign>
+	</xsl:template>
 
-<xsl:template match="imagedata">
-</xsl:template>
+	<xsl:template match="imageobject">
+		<graphic url="{imagedata/@fileref}" />
+	</xsl:template>
 
-<xsl:template match="inlinemediaobject|mediaobject">
+	<xsl:template match="imagedata">
+	</xsl:template>
 
- <xsl:apply-templates/>
+	<xsl:template match="inlinemediaobject|mediaobject">
 
-</xsl:template>
+		<xsl:apply-templates />
 
-<xsl:template match="issuenum">
-  <xsl:apply-templates/>
-</xsl:template>
+	</xsl:template>
 
-<xsl:template match="itemizedlist">
-  <list  type="unordered">
-    <xsl:apply-templates/>
-  </list>
-</xsl:template>
+	<xsl:template match="issuenum">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="keyword">
-  <term>
-    <xsl:call-template name="Lang"/>
-    <xsl:apply-templates/>
-  </term>
-</xsl:template>
+	<xsl:template match="itemizedlist">
+		<list type="unordered">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
 
-<xsl:template match="keywordset">
-  <keywords scheme="adhoc">
-    <xsl:apply-templates/>
-  </keywords>
-</xsl:template>
+	<xsl:template match="keyword">
+		<term>
+			<xsl:call-template name="Lang" />
+			<xsl:apply-templates />
+		</term>
+	</xsl:template>
 
-<xsl:template match="link">
-  <ref target="#{@linkend}">
-    <xsl:apply-templates/>
-  </ref>
-</xsl:template>
+	<xsl:template match="keywordset">
+		<keywords scheme="adhoc">
+			<xsl:apply-templates />
+		</keywords>
+	</xsl:template>
 
-<xsl:template match="listitem">
-  <item >
-    <xsl:apply-templates/>
-  </item>
-</xsl:template>
+	<xsl:template match="link">
+		<ref target="#{@linkend}">
+			<xsl:apply-templates />
+		</ref>
+	</xsl:template>
 
-<xsl:template match="literal">
-  <code rend="{@role}">
-    <xsl:apply-templates/>
-  </code>
-</xsl:template>
+	<xsl:template match="listitem">
+		<item>
+			<xsl:apply-templates />
+		</item>
+	</xsl:template>
 
-<xsl:template match="literallayout">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="literal">
+		<code rend="{@role}">
+			<xsl:apply-templates />
+		</code>
+	</xsl:template>
 
-<xsl:template match="note">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="literallayout">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="orderedlist">
-  <list  type="ordered">
-    <xsl:apply-templates/>
-  </list>
-</xsl:template>
+	<xsl:template match="note">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="orgname">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="orderedlist">
+		<list type="ordered">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
 
-<xsl:template match="othercredit">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="orgname">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="para">
-  <xsl:choose>
-    <xsl:when test="normalize-space(.)=''"/>
-    <xsl:when test="parent::listitem and count(../para)=1">
-	<xsl:apply-templates/>
-    </xsl:when>
-    <xsl:when test="parent::footnote and count(../para)=1">
-	<xsl:apply-templates/>
-    </xsl:when>
-    <xsl:otherwise>
-      <p>  
-	<xsl:apply-templates/>
-      </p>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
+	<xsl:template match="othercredit">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="productname">
- <ident rend="productname">
-   <xsl:apply-templates/>
- </ident>
-</xsl:template>
+	<xsl:template match="para">
+		<xsl:choose>
+			<xsl:when test="normalize-space(.)=''" />
+			<xsl:when test="parent::listitem and count(../para)=1">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="parent::footnote and count(../para)=1">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<p>
+					<xsl:apply-templates />
+				</p>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template match="pubdate">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="productname">
+		<ident rend="productname">
+			<xsl:apply-templates />
+		</ident>
+	</xsl:template>
 
-<xsl:template match="quote">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="pubdate">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="row">
-  <row>
-    <xsl:if test="ancestor::thead">
-      <xsl:attribute name="role">label</xsl:attribute>
-    </xsl:if>
-    <xsl:apply-templates/>
-  </row>
-</xsl:template>
+	<xsl:template match="quote">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="screen">
-<eg >
-  <xsl:apply-templates/>
-</eg>
-</xsl:template>
+	<xsl:template match="row">
+		<row>
+			<xsl:if test="ancestor::thead">
+				<xsl:attribute name="role">label</xsl:attribute>
+			</xsl:if>
+			<xsl:apply-templates />
+		</row>
+	</xsl:template>
 
-<xsl:template match="section|sect1|sect2|sect3|sect4">
-  <xsl:variable name="gi">
-    <xsl:choose>
-      <xsl:when test="local-name(.)='section'">div</xsl:when>
-      <xsl:otherwise>
-	<xsl:text>div</xsl:text>
-	<xsl:value-of select="substring-after(local-name(.),'sect')"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  <xsl:element name="{$gi}">
-    <xsl:call-template name="ID"/>
-    <xsl:apply-templates/>
-  </xsl:element>
-</xsl:template>
+	<xsl:template match="screen">
+		<eg>
+			<xsl:apply-templates />
+		</eg>
+	</xsl:template>
 
+	<xsl:template match="section|sect1|sect2|sect3|sect4">
+		<xsl:variable name="gi">
+			<xsl:choose>
+				<xsl:when test="local-name(.)='section'">
+					div
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>div</xsl:text>
+					<xsl:value-of
+						select="substring-after(local-name(.),'sect')" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:element name="{$gi}">
+			<xsl:call-template name="ID" />
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
 
-<xsl:template match="surname">
-  <surname >
-    <xsl:apply-templates/>
-  </surname>
-</xsl:template>
 
-<xsl:template match="symbol">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="surname">
+		<surname>
+			<xsl:apply-templates />
+		</surname>
+	</xsl:template>
 
-<xsl:template match="table">
-  <table>
-    <xsl:apply-templates/>
-  </table>
-</xsl:template>
+	<xsl:template match="symbol">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="tbody">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="table">
+		<table>
+			<xsl:apply-templates />
+		</table>
+	</xsl:template>
 
-<xsl:template match="tgroup">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="tbody">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="title">
-  <xsl:choose>
-    <xsl:when test="parent::articleinfo">
-      <title>
-	<xsl:apply-templates/>
-      </title>
-    </xsl:when>
-    <xsl:otherwise>
-      <head>
-	<xsl:apply-templates/>
-      </head>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
+	<xsl:template match="tgroup">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="artheader/title">
-  <title>
-    <xsl:call-template name="Lang"/>
-    <xsl:apply-templates/>
-  </title>
-</xsl:template>
+	<xsl:template match="title">
+		<xsl:choose>
+			<xsl:when test="parent::articleinfo">
+				<title>
+					<xsl:apply-templates />
+				</title>
+			</xsl:when>
+			<xsl:otherwise>
+				<head>
+					<xsl:apply-templates />
+				</head>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template match="toc"/>
+	<xsl:template match="artheader/title">
+		<title>
+			<xsl:call-template name="Lang" />
+			<xsl:apply-templates />
+		</title>
+	</xsl:template>
 
+	<xsl:template match="toc" />
 
-<xsl:template match="tocentry">
-  <xsl:apply-templates/>
-</xsl:template>
 
-<xsl:template match="token">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="tocentry">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="ulink">
- <ref target="{@url}" >
-   <xsl:apply-templates/>
- </ref>
-</xsl:template>
+	<xsl:template match="token">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="userinput">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="ulink">
+		<ref target="{@url}">
+			<xsl:apply-templates />
+		</ref>
+	</xsl:template>
 
-<xsl:template match="volumenum">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="userinput">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="warning">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="volumenum">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="wordasword">
- <w>
-  <xsl:apply-templates/>
- </w>
-</xsl:template>
+	<xsl:template match="warning">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="xref">
-  <ptr target="#{@linkend}" type="{@role}" />
-</xsl:template>
+	<xsl:template match="wordasword">
+		<w>
+			<xsl:apply-templates />
+		</w>
+	</xsl:template>
 
-<xsl:template match="programlisting">
-  <eg>
-    <xsl:apply-templates/>
-  </eg>
-</xsl:template>
+	<xsl:template match="xref">
+		<ptr target="#{@linkend}" type="{@role}" />
+	</xsl:template>
 
-<xsl:template match="firstname">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="programlisting">
+		<eg>
+			<xsl:apply-templates />
+		</eg>
+	</xsl:template>
 
-<xsl:template match="jobtitle">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="firstname">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="orgdiv">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="jobtitle">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="simpara">
-  <xsl:choose>
-    <xsl:when test="following-sibling::simpara or
+	<xsl:template match="orgdiv">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="simpara">
+		<xsl:choose>
+			<xsl:when
+				test="following-sibling::simpara or
 		    preceding-sibling::simpara">
-      <p>
-	<xsl:apply-templates/>
-      </p>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:apply-templates/>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
+				<p>
+					<xsl:apply-templates />
+				</p>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template match="term">
-  <term>
-    <xsl:apply-templates/>
-  </term>
-</xsl:template>
+	<xsl:template match="term">
+		<term>
+			<xsl:apply-templates />
+		</term>
+	</xsl:template>
 
-<xsl:template match="thead">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="thead">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="variablelist">
-  <list type="gloss">
-    <xsl:apply-templates/>
-  </list>
-</xsl:template>
+	<xsl:template match="variablelist">
+		<list type="gloss">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
 
-<xsl:template match="varlistentry">
-    <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="varlistentry">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="varlistentry/term">
-  <label>
-    <xsl:apply-templates/>
-  </label>
-</xsl:template>
+	<xsl:template match="varlistentry/term">
+		<label>
+			<xsl:apply-templates />
+		</label>
+	</xsl:template>
 
-<!-- more -->
+	<!-- more -->
 
-<xsl:template match="action">
-  <hi rend="Action">
-  <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="action">
+		<hi rend="Action">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="command">
-  <hi rend="Command">
-  <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="command">
+		<hi rend="Command">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="database">
-  <hi rend="Database">
-  <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="database">
+		<hi rend="Database">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="function">
-  <hi rend="Function">
-  <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="function">
+		<hi rend="Function">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="guilabel">
-  <hi rend="Label">
-    <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="guilabel">
+		<hi rend="Label">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="parameter">
-  <hi rend="Parameter">
-  <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="parameter">
+		<hi rend="Parameter">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="remark">
-  <hi rend="Remark">
-  <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="remark">
+		<hi rend="Remark">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="trademark">
-  <xsl:apply-templates/>
-  <xsl:text>™</xsl:text>
-</xsl:template>
+	<xsl:template match="trademark">
+		<xsl:apply-templates />
+		<xsl:text>™</xsl:text>
+	</xsl:template>
 
-<xsl:template match="type">
-  <hi rend="Type">
-  <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="type">
+		<hi rend="Type">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="varname">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="varname">
+		<xsl:apply-templates />
+	</xsl:template>
 
 
-<xsl:template match="filename">
-  <hi rend="FileSpec">
-    <xsl:apply-templates/>
-  </hi>
-</xsl:template>
+	<xsl:template match="filename">
+		<hi rend="FileSpec">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-<xsl:template match="footnote">
-  <note place="foot">
-    <xsl:apply-templates/>
-  </note>
-</xsl:template>
+	<xsl:template match="footnote">
+		<note place="foot">
+			<xsl:apply-templates />
+		</note>
+	</xsl:template>
 
-<xsl:template match="informalexample">
-  <eg>
-    <xsl:apply-templates/>
-  </eg>
-</xsl:template>
-<xsl:template match="graphic">
-  <graphic target="@fileref">
-    <xsl:if test="@align">
-      <xsl:attribute name="rend" select="@align"/>
-    </xsl:if>
-  </graphic>
-</xsl:template>
+	<xsl:template match="informalexample">
+		<eg>
+			<xsl:apply-templates />
+		</eg>
+	</xsl:template>
+	<xsl:template match="graphic">
+		<graphic target="@fileref">
+			<xsl:if test="@align">
+				<xsl:attribute name="rend" select="@align" />
+			</xsl:if>
+		</graphic>
+	</xsl:template>
 
 
-<!-- catch all -->
+	<!-- catch all -->
 
-<xsl:template match="*">
-  <xsl:message>Unknown element <xsl:value-of  select="name()"/></xsl:message>
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="*">
+		<xsl:message>
+			Unknown element
+			<xsl:value-of select="name()" />
+		</xsl:message>
+		<xsl:apply-templates />
+	</xsl:template>
 
-<!-- use general-purpose templates to add standard attributes -->
-<xsl:template name="Role">
-    <xsl:if test="@role">
-      <xsl:attribute name="rend">
-	<xsl:value-of select="@role"/>
+	<!-- use general-purpose templates to add standard attributes -->
+	<xsl:template name="Role">
+		<xsl:if test="@role">
+			<xsl:attribute name="rend">
+	<xsl:value-of select="@role" />
       </xsl:attribute>
-    </xsl:if>
-</xsl:template>
+		</xsl:if>
+	</xsl:template>
 
-<xsl:template name="Lang">
-    <xsl:if test="@lang">
-      <xsl:attribute name="xml:lang">
-	<xsl:value-of select="@lang"/>
+	<xsl:template name="Lang">
+		<xsl:if test="@lang">
+			<xsl:attribute name="xml:lang">
+	<xsl:value-of select="@lang" />
       </xsl:attribute>
-    </xsl:if>
-</xsl:template>
+		</xsl:if>
+	</xsl:template>
 
-<xsl:template name="ID">
-    <xsl:if test="@id">
-      <xsl:attribute name="xml:id">
-	<xsl:value-of select="@id"/>
+	<xsl:template name="ID">
+		<xsl:if test="@id">
+			<xsl:attribute name="xml:id">
+	<xsl:value-of select="@id" />
       </xsl:attribute>
-    </xsl:if>
-</xsl:template>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template name="whatsTheDate">
-      <xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')"/>
-  </xsl:template>
+	<xsl:template name="whatsTheDate">
+		<xsl:value-of
+			select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')" />
+	</xsl:template>
 
 
 
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/p4/from.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/p4/from.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/p4/from.xsl	(revision 2397)
@@ -1,798 +1,822 @@
 <?xml version="1.0"?>
-<xsl:stylesheet 
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:tei="http://www.tei-c.org/ns/1.0" 
-    xmlns="http://www.tei-c.org/ns/1.0"
-    version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
 
-         <p>This software is dual-licensed:
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: from.xsl 10048 2012-01-18 10:03:59Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <!-- 
-       
-       P4 to P5 converter 
-       
-       Sebastian Rahtz <sebastian.rahtz@oucs.ox.ac.uk>
-       
-       $Date: 2012-01-18 10:03:59 +0000 (Wed, 18 Jan 2012) $  $Id: from.xsl 10048 2012-01-18 10:03:59Z rahtz $
-       
-  -->
-  <xsl:output method="xml" encoding="utf-8"
-    cdata-section-elements="tei:eg" omit-xml-declaration="yes"/>
-  
-  <xsl:variable name="processor">
-    <xsl:value-of select="system-property('xsl:vendor')"/>
-  </xsl:variable>
-  
-  <xsl:variable name="today">
-      <xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')"/>
-  </xsl:variable>
-  
-  <xsl:template match="*">
-    <xsl:choose>
-      <xsl:when test="namespace-uri()=''">
-	<xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
-	  <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-	</xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:copy>
-	  <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-	</xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  
-  <xsl:template match="@*|processing-instruction()|comment()">
-    <xsl:copy/>
-  </xsl:template>
-  
-  
-  <xsl:template match="text()">
-    <xsl:value-of select="."/>
-  </xsl:template>
-  
-    <xsl:template match="teiCorpus.2">
-    <teiCorpus>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </teiCorpus>
-  </xsl:template>
-  
-  <xsl:template match="witness/@sigil">
-    <xsl:attribute name="xml:id">
-      <xsl:value-of select="."/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: from.xsl 10048 2012-01-18 10:03:59Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<!-- P4 to P5 converter Sebastian Rahtz <sebastian.rahtz@oucs.ox.ac.uk> 
+		$Date: 2012-01-18 10:03:59 +0000 (Wed, 18 Jan 2012) $ $Id: from.xsl 10048 
+		2012-01-18 10:03:59Z rahtz $ -->
+	<xsl:output method="xml" encoding="utf-8"
+		cdata-section-elements="tei:eg" omit-xml-declaration="yes" />
+
+	<xsl:variable name="processor">
+		<xsl:value-of select="system-property('xsl:vendor')" />
+	</xsl:variable>
+
+	<xsl:variable name="today">
+		<xsl:value-of
+			select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')" />
+	</xsl:variable>
+
+	<xsl:template match="*">
+		<xsl:choose>
+			<xsl:when test="namespace-uri()=''">
+				<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+					name="{local-name(.)}">
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+		<xsl:copy />
+	</xsl:template>
+
+
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template match="teiCorpus.2">
+		<teiCorpus>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</teiCorpus>
+	</xsl:template>
+
+	<xsl:template match="witness/@sigil">
+		<xsl:attribute name="xml:id">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template match="witList">
-    <listWit>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </listWit>
-  </xsl:template>
-  
-  
-  <xsl:template match="TEI.2">
-    <TEI>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </TEI>
-  </xsl:template>
-  
-  <xsl:template match="xref">
-    <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="ref">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
-  
-  
-  <xsl:template match="xptr">
-    <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="ptr">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
-  
-  
-  <xsl:template match="figure[@url]">
-    <figure>
-      <graphic>
-	<xsl:apply-templates select="@*"/>
-      </graphic>
-      <xsl:apply-templates/>
-    </figure>
-  </xsl:template>
-  
- 
-  <xsl:template match="figure/@entity"/>
+	<xsl:template match="witList">
+		<listWit>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</listWit>
+	</xsl:template>
 
-  
-  <xsl:template match="figure[@entity]">
-    <figure>
-      <graphic>
-	<xsl:attribute name="url">
+
+	<xsl:template match="TEI.2">
+		<TEI>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</TEI>
+	</xsl:template>
+
+	<xsl:template match="xref">
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+			name="ref">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
+
+
+	<xsl:template match="xptr">
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+			name="ptr">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
+
+
+	<xsl:template match="figure[@url]">
+		<figure>
+			<graphic>
+				<xsl:apply-templates select="@*" />
+			</graphic>
+			<xsl:apply-templates />
+		</figure>
+	</xsl:template>
+
+
+	<xsl:template match="figure/@entity" />
+
+
+	<xsl:template match="figure[@entity]">
+		<figure>
+			<graphic>
+				<xsl:attribute name="url">
 	  <xsl:choose>
 	    <xsl:when test="unparsed-entity-uri(@entity)=''">
 	      <xsl:text>ENTITY_</xsl:text>
-	      <xsl:value-of select="@entity"/>
+	      <xsl:value-of select="@entity" />
 	    </xsl:when>
 	    <xsl:otherwise>
-	      <xsl:value-of select="unparsed-entity-uri(@entity)"/>
+	      <xsl:value-of select="unparsed-entity-uri(@entity)" />
 	    </xsl:otherwise>
 	  </xsl:choose>
 	</xsl:attribute>
-	<xsl:apply-templates select="@*"/>
-      </graphic>
-      <xsl:apply-templates/>
-    </figure>
-  </xsl:template>
-  
-  <xsl:template match="event">
-    <incident>
-      <xsl:apply-templates select="@*|*|text()|comment()|processing-instruction()"/>
-    </incident>
-  </xsl:template>
-  
-  <xsl:template match="state">
-    <refState>
-      <xsl:apply-templates select="@*|*|text()|comment()|processing-instruction()"/>
-    </refState>
-  </xsl:template>
-  
-  
-  <!-- lost elements -->
-  <xsl:template match="dateRange">
-    <date>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </date>
-  </xsl:template>
-  
-  
-  <xsl:template match="dateRange/@from">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="dateRange/@to">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="language">
-    <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="language">
-	<xsl:if test="@id">
-        <xsl:attribute name="ident">
-	  <xsl:value-of select="@id"/>
+				<xsl:apply-templates select="@*" />
+			</graphic>
+			<xsl:apply-templates />
+		</figure>
+	</xsl:template>
+
+	<xsl:template match="event">
+		<incident>
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction()" />
+		</incident>
+	</xsl:template>
+
+	<xsl:template match="state">
+		<refState>
+			<xsl:apply-templates
+				select="@*|*|text()|comment()|processing-instruction()" />
+		</refState>
+	</xsl:template>
+
+
+	<!-- lost elements -->
+	<xsl:template match="dateRange">
+		<date>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</date>
+	</xsl:template>
+
+
+	<xsl:template match="dateRange/@from">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="dateRange/@to">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="language">
+		<xsl:element namespace="http://www.tei-c.org/ns/1.0"
+			name="language">
+			<xsl:if test="@id">
+				<xsl:attribute name="ident">
+	  <xsl:value-of select="@id" />
         </xsl:attribute>
-        </xsl:if>
-      <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
-  
-  <!-- attributes lost -->
-  <!-- dropped from TEI. Added as new change records later -->
-  <xsl:template match="@date.created"/>
-  
-  <xsl:template match="@date.updated"/>
-  
-  <!-- dropped from TEI. No replacement -->
-  <xsl:template match="refsDecl/@doctype"/>
-  
-  <!-- attributes changed name -->
-  
-  <xsl:template match="date/@value">
-    <xsl:attribute name="when">
-      <xsl:value-of select="."/>
+			</xsl:if>
+			<xsl:apply-templates
+				select="*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
+
+	<!-- attributes lost -->
+	<!-- dropped from TEI. Added as new change records later -->
+	<xsl:template match="@date.created" />
+
+	<xsl:template match="@date.updated" />
+
+	<!-- dropped from TEI. No replacement -->
+	<xsl:template match="refsDecl/@doctype" />
+
+	<!-- attributes changed name -->
+
+	<xsl:template match="date/@value">
+		<xsl:attribute name="when">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
-  
-  
-  <xsl:template match="@url">
-    <xsl:attribute name="target">
-      <xsl:value-of select="."/>
+	</xsl:template>
+
+
+	<xsl:template match="@url">
+		<xsl:attribute name="target">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
-  
-  <xsl:template match="figure/@url">
-    <xsl:attribute name="url">
-      <xsl:value-of select="."/>
+	</xsl:template>
+
+	<xsl:template match="figure/@url">
+		<xsl:attribute name="url">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
-  
-  
-  <xsl:template match="@doc">
-    <xsl:attribute name="target">
-      <xsl:value-of select="unparsed-entity-uri(.)"/>
+	</xsl:template>
+
+
+	<xsl:template match="@doc">
+		<xsl:attribute name="target">
+      <xsl:value-of select="unparsed-entity-uri(.)" />
     </xsl:attribute>
-  </xsl:template>
-  
-  
-  <xsl:template match="@id">
-    <xsl:choose>
-      <xsl:when test="parent::lang">
-	<xsl:attribute name="ident">
-	  <xsl:value-of select="."/>
+	</xsl:template>
+
+
+	<xsl:template match="@id">
+		<xsl:choose>
+			<xsl:when test="parent::lang">
+				<xsl:attribute name="ident">
+	  <xsl:value-of select="." />
 	</xsl:attribute>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:attribute name="xml:id">
-	  <xsl:value-of select="."/>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:attribute name="xml:id">
+	  <xsl:value-of select="." />
 	</xsl:attribute>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  
-  <xsl:template match="@lang">
-    <xsl:attribute name="xml:lang">
-      <xsl:value-of select="."/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<xsl:template match="@lang">
+		<xsl:attribute name="xml:lang">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
-  
-  
-  <xsl:template match="change/@date"/>
-  
-  <xsl:template match="date/@certainty">
-    <xsl:attribute name="cert">
-      <xsl:value-of select="."/>
+	</xsl:template>
+
+
+	<xsl:template match="change/@date" />
+
+	<xsl:template match="date/@certainty">
+		<xsl:attribute name="cert">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
-  
-  <!-- all pointing attributes preceded by # -->
-  
-  <xsl:template match="variantEncoding/@location">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template match="@ana|@active|@adj|@adjFrom|@adjTo|@children|@class|@code|@copyOf|@corresp|@decls|@domains|@end|@exclude|@fVal|@feats|@follow|@hand|@inst|@langKey|@location|@mergedin|@new|@next|@old|@origin|@otherLangs|@parent|@passive|@perf|@prev|@render|@resp|@sameAs|@scheme|@script|@select|@since|@start|@synch|@target|@targetEnd|@value|@value|@who|@wit">
-    <xsl:attribute name="{name(.)}">
+	<!-- all pointing attributes preceded by # -->
+
+	<xsl:template match="variantEncoding/@location">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template
+		match="@ana|@active|@adj|@adjFrom|@adjTo|@children|@class|@code|@copyOf|@corresp|@decls|@domains|@end|@exclude|@fVal|@feats|@follow|@hand|@inst|@langKey|@location|@mergedin|@new|@next|@old|@origin|@otherLangs|@parent|@passive|@perf|@prev|@render|@resp|@sameAs|@scheme|@script|@select|@since|@start|@synch|@target|@targetEnd|@value|@value|@who|@wit">
+		<xsl:attribute name="{name(.)}">
       <xsl:call-template name="splitter">
 	<xsl:with-param name="val">
-	  <xsl:value-of select="."/>
+	  <xsl:value-of select="." />
 	</xsl:with-param>
       </xsl:call-template>
     </xsl:attribute>
-  </xsl:template>
-  
-  
-  <xsl:template name="splitter">
-    <xsl:param name="val"/>
-    <xsl:choose>
-      <xsl:when test="contains($val,' ')">
-	<xsl:text>#</xsl:text>
-	<xsl:value-of select="substring-before($val,' ')"/>
-	<xsl:text> </xsl:text>
-	<xsl:call-template name="splitter">
-	  <xsl:with-param name="val">
-	    <xsl:value-of select="substring-after($val,' ')"/>
-	  </xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:text>#</xsl:text>
-	<xsl:value-of select="$val"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  
-  <!-- fool around with selected elements -->
-  
+	</xsl:template>
 
- <!-- imprint is no longer allowed inside bibl -->
- <xsl:template match="bibl/imprint">
-    <xsl:apply-templates/>
-  </xsl:template>
 
-  <xsl:template match="editionStmt/editor">
-    <respStmt>    
-      <resp><xsl:value-of select="@role"/></resp>
-      <name><xsl:apply-templates/></name>
-    </respStmt>
-  </xsl:template>
-  
-  <!-- header -->  
-  
-  <xsl:template match="teiHeader">
-    <teiHeader>
-      <xsl:apply-templates select="@*|*|comment()|processing-instruction()"/>
-      
-      <xsl:if test="not(revisionDesc) and (@date.created or @date.updated)">
-	<revisionDesc>
-	  <xsl:if test="@date.updated">
-	    <change>>
-	    <label>updated</label>
-	    <date>
-	      <xsl:value-of select="@date.updated"/>
-	    </date>
-	    <label>Date edited</label>
-	    </change>
-	  </xsl:if>
-	  <xsl:if test="@date.created">
-	    <change>
-	      <label>created</label>
-	      <date>
-		<xsl:value-of select="@date.created"/>
-	      </date>
-	      <label>Date created</label>
-	    </change>
-	  </xsl:if>
-	</revisionDesc>
-      </xsl:if>
-      <!--
-	  <change when="{$today}">Converted to TEI P5 XML by p4top5.xsl
-	  written by Sebastian
-	  Rahtz at Oxford University Computing Services.</change>
-	  </revisionDesc>
-	  </xsl:if>
-      -->
-    </teiHeader>
-  </xsl:template>
-  
-  <xsl:template match="revisionDesc">
-    <revisionDesc>
-      <xsl:apply-templates
-	  select="@*|*|comment()|processing-instruction()"/>
-    </revisionDesc>
-  </xsl:template>
-  
-  <xsl:template match="publicationStmt">
-    <publicationStmt>
-      <xsl:apply-templates select="@*|*|comment()|processing-instruction()"/>
-      <!--
-	  <availability>
-	  <p>Licensed under <ptr target="http://creativecommons.org/licenses/by-sa/2.0/uk/"/></p>
-	  </availability>
-      -->
-    </publicationStmt>
-  </xsl:template>
-  
- <!-- space does not have @extent any more -->
-  <xsl:template match="space/@extent">
-    <xsl:attribute name="quantity">
-      <xsl:value-of select="."/>
+	<xsl:template name="splitter">
+		<xsl:param name="val" />
+		<xsl:choose>
+			<xsl:when test="contains($val,' ')">
+				<xsl:text>#</xsl:text>
+				<xsl:value-of select="substring-before($val,' ')" />
+				<xsl:text> </xsl:text>
+				<xsl:call-template name="splitter">
+					<xsl:with-param name="val">
+						<xsl:value-of select="substring-after($val,' ')" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>#</xsl:text>
+				<xsl:value-of select="$val" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<!-- fool around with selected elements -->
+
+
+	<!-- imprint is no longer allowed inside bibl -->
+	<xsl:template match="bibl/imprint">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="editionStmt/editor">
+		<respStmt>
+			<resp>
+				<xsl:value-of select="@role" />
+			</resp>
+			<name>
+				<xsl:apply-templates />
+			</name>
+		</respStmt>
+	</xsl:template>
+
+	<!-- header -->
+
+	<xsl:template match="teiHeader">
+		<teiHeader>
+			<xsl:apply-templates
+				select="@*|*|comment()|processing-instruction()" />
+
+			<xsl:if
+				test="not(revisionDesc) and (@date.created or @date.updated)">
+				<revisionDesc>
+					<xsl:if test="@date.updated">
+						<change>
+							>
+							<label>updated</label>
+							<date>
+								<xsl:value-of select="@date.updated" />
+							</date>
+							<label>Date edited</label>
+						</change>
+					</xsl:if>
+					<xsl:if test="@date.created">
+						<change>
+							<label>created</label>
+							<date>
+								<xsl:value-of select="@date.created" />
+							</date>
+							<label>Date created</label>
+						</change>
+					</xsl:if>
+				</revisionDesc>
+			</xsl:if>
+			<!-- <change when="{$today}">Converted to TEI P5 XML by p4top5.xsl written 
+				by Sebastian Rahtz at Oxford University Computing Services.</change> </revisionDesc> 
+				</xsl:if> -->
+		</teiHeader>
+	</xsl:template>
+
+	<xsl:template match="revisionDesc">
+		<revisionDesc>
+			<xsl:apply-templates
+				select="@*|*|comment()|processing-instruction()" />
+		</revisionDesc>
+	</xsl:template>
+
+	<xsl:template match="publicationStmt">
+		<publicationStmt>
+			<xsl:apply-templates
+				select="@*|*|comment()|processing-instruction()" />
+			<!-- <availability> <p>Licensed under <ptr target="http://creativecommons.org/licenses/by-sa/2.0/uk/"/></p> 
+				</availability> -->
+		</publicationStmt>
+	</xsl:template>
+
+	<!-- space does not have @extent any more -->
+	<xsl:template match="space/@extent">
+		<xsl:attribute name="quantity">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
- <!-- word key -->
-  <xsl:template match="entryFree/@key">
-    <xsl:attribute name="sortKey">
-      <xsl:value-of select="."/>
+	<!-- word key -->
+	<xsl:template match="entryFree/@key">
+		<xsl:attribute name="sortKey">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-  <!-- tagsDecl has a compulsory namespace child now -->
-  <xsl:template match="tagsDecl">
-    <xsl:if test="*">
-      <tagsDecl>
-	<namespace name="http://www.tei-c.org/ns/1.0">
-	  <xsl:apply-templates select="*|comment()|processing-instruction"/>
-	</namespace>
-      </tagsDecl>
-    </xsl:if>
-  </xsl:template>
-  
-  <!-- orgTitle inside orgName? redundant -->
-  <xsl:template match="orgName/orgTitle">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<!-- tagsDecl has a compulsory namespace child now -->
+	<xsl:template match="tagsDecl">
+		<xsl:if test="*">
+			<tagsDecl>
+				<namespace name="http://www.tei-c.org/ns/1.0">
+					<xsl:apply-templates
+						select="*|comment()|processing-instruction" />
+				</namespace>
+			</tagsDecl>
+		</xsl:if>
+	</xsl:template>
 
- <!-- no need for empty <p> in sourceDesc -->  
-  <xsl:template match="sourceDesc/p[string-length(.)=0]"/>
-  
-  <!-- start creating the new choice element -->
-  <xsl:template match="corr[@sic]">
-    <choice>
-      <corr>
-	<xsl:value-of select="text()" />
-      </corr>
-      <sic>
-	<xsl:value-of select="@sic" />
-      </sic>
-    </choice>
-  </xsl:template>
-  
-  <xsl:template match="gap/@desc"/>
+	<!-- orgTitle inside orgName? redundant -->
+	<xsl:template match="orgName/orgTitle">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="gap">
-    <gap>
-      <xsl:apply-templates select="@*"/>
-      <xsl:if test="@desc">
-	<desc>
-	  <xsl:value-of select="@desc"/>
-	</desc>
-      </xsl:if>
-    </gap>
-  </xsl:template>
+	<!-- no need for empty <p> in sourceDesc -->
+	<xsl:template match="sourceDesc/p[string-length(.)=0]" />
 
-  <xsl:template match="sic[@corr]">
-    <choice>
-      <sic>
-	<xsl:apply-templates/>
-      </sic>
-      <corr>
-	<xsl:value-of select="@corr" />
-      </corr>
-    </choice>
-  </xsl:template>
-  
-  <xsl:template match="abbr[@expan]">
-    <choice>
-      <abbr>
-	<xsl:apply-templates/>
-      </abbr>
-      <expan>
-	<xsl:value-of select="@expan" />
-      </expan>
-    </choice>
-  </xsl:template>
-  
-  <xsl:template match="expan[@abbr]">
-    <choice>
-      <expan>
-	<xsl:apply-templates/>
-      </expan>
-      <abbr>
-	<xsl:value-of select="@abbr" />
-      </abbr>
-    </choice>
-  </xsl:template>
-  
-  <!-- special consideration for <change> element -->
-  <xsl:template match="change">
-    <change>
-      <xsl:apply-templates select="item/@*"/>
-      
-      <xsl:apply-templates select="date"/>
-      
-      <xsl:if test="respStmt/resp">
-	<label>
-	  <xsl:value-of select="respStmt/resp/text()"/>
-	</label>
-      </xsl:if>
-	<xsl:for-each select="respStmt/name">
-	  <name>
-	    <xsl:apply-templates
-		select="@*|*|comment()|processing-instruction()|text()"/>
-	  </name>
-	</xsl:for-each>
-	<xsl:for-each select="item">
-	  <xsl:apply-templates
-	      select="*|comment()|processing-instruction()|text()"/>
-	</xsl:for-each>
-    </change>
-  </xsl:template>
+	<!-- start creating the new choice element -->
+	<xsl:template match="corr[@sic]">
+		<choice>
+			<corr>
+				<xsl:value-of select="text()" />
+			</corr>
+			<sic>
+				<xsl:value-of select="@sic" />
+			</sic>
+		</choice>
+	</xsl:template>
 
+	<xsl:template match="gap/@desc" />
 
-  <xsl:template match="respStmt[resp]">
-    <respStmt>
-      <xsl:choose>
-	<xsl:when test="resp/name">
-	  <resp>
-	    <xsl:value-of select="resp/text()"/>
-	  </resp>
-	    <xsl:for-each select="resp/name">
-	      <name>
-		<xsl:apply-templates/>
-	      </name>
-	    </xsl:for-each>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:apply-templates/>
-	  <name>
-	  </name>
-	</xsl:otherwise>
-      </xsl:choose>
-    </respStmt>
-  </xsl:template>
+	<xsl:template match="gap">
+		<gap>
+			<xsl:apply-templates select="@*" />
+			<xsl:if test="@desc">
+				<desc>
+					<xsl:value-of select="@desc" />
+				</desc>
+			</xsl:if>
+		</gap>
+	</xsl:template>
 
-  <xsl:template match="q/@direct"/>
-  
-  <xsl:template match="q">
-    <q>
-      <xsl:apply-templates
-	  select="@*|*|comment()|processing-instruction()|text()"/>
-    </q>
-  </xsl:template>
+	<xsl:template match="sic[@corr]">
+		<choice>
+			<sic>
+				<xsl:apply-templates />
+			</sic>
+			<corr>
+				<xsl:value-of select="@corr" />
+			</corr>
+		</choice>
+	</xsl:template>
 
-  
-<!-- if we are reading the P4 with a DTD,
-       we need to avoid copying the default values
-       of attributes -->
-  
-  <xsl:template match="@targOrder">
-    <xsl:if test="not(lower-case(.) ='u')">
-      <xsl:attribute name="targOrder">
-	<xsl:value-of select="."/>
+	<xsl:template match="abbr[@expan]">
+		<choice>
+			<abbr>
+				<xsl:apply-templates />
+			</abbr>
+			<expan>
+				<xsl:value-of select="@expan" />
+			</expan>
+		</choice>
+	</xsl:template>
+
+	<xsl:template match="expan[@abbr]">
+		<choice>
+			<expan>
+				<xsl:apply-templates />
+			</expan>
+			<abbr>
+				<xsl:value-of select="@abbr" />
+			</abbr>
+		</choice>
+	</xsl:template>
+
+	<!-- special consideration for <change> element -->
+	<xsl:template match="change">
+		<change>
+			<xsl:apply-templates select="item/@*" />
+
+			<xsl:apply-templates select="date" />
+
+			<xsl:if test="respStmt/resp">
+				<label>
+					<xsl:value-of select="respStmt/resp/text()" />
+				</label>
+			</xsl:if>
+			<xsl:for-each select="respStmt/name">
+				<name>
+					<xsl:apply-templates
+						select="@*|*|comment()|processing-instruction()|text()" />
+				</name>
+			</xsl:for-each>
+			<xsl:for-each select="item">
+				<xsl:apply-templates
+					select="*|comment()|processing-instruction()|text()" />
+			</xsl:for-each>
+		</change>
+	</xsl:template>
+
+
+	<xsl:template match="respStmt[resp]">
+		<respStmt>
+			<xsl:choose>
+				<xsl:when test="resp/name">
+					<resp>
+						<xsl:value-of select="resp/text()" />
+					</resp>
+					<xsl:for-each select="resp/name">
+						<name>
+							<xsl:apply-templates />
+						</name>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+					<name>
+					</name>
+				</xsl:otherwise>
+			</xsl:choose>
+		</respStmt>
+	</xsl:template>
+
+	<xsl:template match="q/@direct" />
+
+	<xsl:template match="q">
+		<q>
+			<xsl:apply-templates
+				select="@*|*|comment()|processing-instruction()|text()" />
+		</q>
+	</xsl:template>
+
+
+	<!-- if we are reading the P4 with a DTD, we need to avoid copying the default 
+		values of attributes -->
+
+	<xsl:template match="@targOrder">
+		<xsl:if test="not(lower-case(.) ='u')">
+			<xsl:attribute name="targOrder">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  
-  <xsl:template match="@opt">
-    <xsl:if test="not(lower-case(.) ='n')">
-      <xsl:attribute name="opt">
-	<xsl:value-of select="."/>
+		</xsl:if>
+	</xsl:template>
+
+
+	<xsl:template match="@opt">
+		<xsl:if test="not(lower-case(.) ='n')">
+			<xsl:attribute name="opt">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  
-  <xsl:template match="@to">
-    <xsl:if test="not(lower-case(.) ='ditto')">
-      <xsl:attribute name="to">
-	<xsl:value-of select="."/>
+		</xsl:if>
+	</xsl:template>
+
+
+	<xsl:template match="@to">
+		<xsl:if test="not(lower-case(.) ='ditto')">
+			<xsl:attribute name="to">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="xptr/@to">
-      <xsl:attribute name="target">
-	<xsl:value-of select="."/>
+	<xsl:template match="xptr/@to">
+		<xsl:attribute name="target">
+	<xsl:value-of select="." />
       </xsl:attribute>
-  </xsl:template>
-  
-  <xsl:template match="interp/@value">
-      <xsl:attribute name="inst">
-	<xsl:value-of select="."/>
+	</xsl:template>
+
+	<xsl:template match="interp/@value">
+		<xsl:attribute name="inst">
+	<xsl:value-of select="." />
       </xsl:attribute>
-  </xsl:template>
-  
-  
-  <xsl:template match="@default">
-    <xsl:choose>
-      <xsl:when test="lower-case(.)= 'no'"/>
-      <xsl:otherwise>
-	<xsl:attribute name="default">
-	  <xsl:value-of select="."/>
+	</xsl:template>
+
+
+	<xsl:template match="@default">
+		<xsl:choose>
+			<xsl:when test="lower-case(.)= 'no'" />
+			<xsl:otherwise>
+				<xsl:attribute name="default">
+	  <xsl:value-of select="." />
 	</xsl:attribute>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  
-  <xsl:template match="@part">
-    <xsl:if test="not(lower-case(.) ='n')">
-      <xsl:attribute name="part">
-	<xsl:value-of select="."/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<xsl:template match="@part">
+		<xsl:if test="not(lower-case(.) ='n')">
+			<xsl:attribute name="part">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  
-  <xsl:template match="@full">
-    <xsl:if test="not(lower-case(.) ='yes')">
-      <xsl:attribute name="full">
-	<xsl:value-of select="."/>
+		</xsl:if>
+	</xsl:template>
+
+
+	<xsl:template match="@full">
+		<xsl:if test="not(lower-case(.) ='yes')">
+			<xsl:attribute name="full">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  
-  <xsl:template match="@from">
-    <xsl:if test="not(lower-case(.) ='root')">
-      <xsl:attribute name="from">
-	<xsl:value-of select="."/>
+		</xsl:if>
+	</xsl:template>
+
+
+	<xsl:template match="@from">
+		<xsl:if test="not(lower-case(.) ='root')">
+			<xsl:attribute name="from">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  
-  <xsl:template match="@status">
-    <xsl:choose>
-      <xsl:when test="parent::teiHeader">
-	<xsl:if test="not(lower-case(.) ='new')">
-	  <xsl:attribute name="status">
-	    <xsl:value-of select="."/>
+		</xsl:if>
+	</xsl:template>
+
+
+	<xsl:template match="@status">
+		<xsl:choose>
+			<xsl:when test="parent::teiHeader">
+				<xsl:if test="not(lower-case(.) ='new')">
+					<xsl:attribute name="status">
+	    <xsl:value-of select="." />
 	  </xsl:attribute>
-	</xsl:if>
-      </xsl:when>
-      <xsl:when test="parent::del">
-	<xsl:if test="not(lower-case(.) ='unremarkable')">
-	  <xsl:attribute name="status">
-	    <xsl:value-of select="."/>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="parent::del">
+				<xsl:if test="not(lower-case(.) ='unremarkable')">
+					<xsl:attribute name="status">
+	    <xsl:value-of select="." />
 	  </xsl:attribute>
-	</xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:attribute name="status">
-	  <xsl:value-of select="."/>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:attribute name="status">
+	  <xsl:value-of select="." />
 	</xsl:attribute>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  
-  <xsl:template match="@place">
-    <xsl:if test="not(lower-case(.) ='unspecified')">
-      <xsl:attribute name="place">
-	<xsl:value-of select="."/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<xsl:template match="@place">
+		<xsl:if test="not(lower-case(.) ='unspecified')">
+			<xsl:attribute name="place">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  
-  <xsl:template match="@sample">
-    <xsl:if test="not(lower-case(.) ='complete')">
-      <xsl:attribute name="sample">
-	<xsl:value-of select="."/>
+		</xsl:if>
+	</xsl:template>
+
+
+	<xsl:template match="@sample">
+		<xsl:if test="not(lower-case(.) ='complete')">
+			<xsl:attribute name="sample">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  
-  <xsl:template match="@org">
-    <xsl:if test="not(lower-case(.) ='uniform')">
-      <xsl:attribute name="org">
-	<xsl:value-of select="."/>
+		</xsl:if>
+	</xsl:template>
+
+
+	<xsl:template match="@org">
+		<xsl:if test="not(lower-case(.) ='uniform')">
+			<xsl:attribute name="org">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  <xsl:template match="teiHeader/@type">
-    <xsl:if test="not(lower-case(.) ='text')">
-      <xsl:attribute name="type">
-	<xsl:value-of select="."/>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="teiHeader/@type">
+		<xsl:if test="not(lower-case(.) ='text')">
+			<xsl:attribute name="type">
+	<xsl:value-of select="." />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
-  
-  <!-- yes|no to boolean -->
-  
-  <xsl:template match="@anchored">
-    <xsl:attribute name="anchored">
+		</xsl:if>
+	</xsl:template>
+
+	<!-- yes|no to boolean -->
+
+	<xsl:template match="@anchored">
+		<xsl:attribute name="anchored">
       <xsl:choose>
 	<xsl:when test="lower-case(.)='yes'">true</xsl:when>
 	<xsl:when test="lower-case(.)='no'">false</xsl:when>
       </xsl:choose>
     </xsl:attribute>
-  </xsl:template>
-  
-  <xsl:template match="sourceDesc/@default"/>
-  
-  <xsl:template match="@tei">
-    <xsl:attribute name="tei">
+	</xsl:template>
+
+	<xsl:template match="sourceDesc/@default" />
+
+	<xsl:template match="@tei">
+		<xsl:attribute name="tei">
       <xsl:choose>
 	<xsl:when test="lower-case(.)='yes'">true</xsl:when>
 	<xsl:when test="lower-case(.)='no'">false</xsl:when>
       </xsl:choose>
     </xsl:attribute>
-  </xsl:template>
-  
-  <xsl:template match="@langKey"/>  
-  
-  <xsl:template match="@TEIform"/>  
+	</xsl:template>
 
-<!-- assorted atts -->
+	<xsl:template match="@langKey" />
 
-  <xsl:template match="gi/@TEI">  	 
-    <xsl:if test=".='yes'">
-      <xsl:attribute name="scheme">TEI</xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+	<xsl:template match="@TEIform" />
 
-  <xsl:template match="@old"/>  
+	<!-- assorted atts -->
 
-  <xsl:template match="ref/@from"/>  
+	<xsl:template match="gi/@TEI">
+		<xsl:if test=".='yes'">
+			<xsl:attribute name="scheme">TEI</xsl:attribute>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="@mergedin">  
-    <xsl:attribute name="mergedIn">
-      <xsl:value-of select="."/>
+	<xsl:template match="@old" />
+
+	<xsl:template match="ref/@from" />
+
+	<xsl:template match="@mergedin">
+		<xsl:attribute name="mergedIn">
+      <xsl:value-of select="." />
     </xsl:attribute>
-  </xsl:template>
+	</xsl:template>
 
-<!-- deal with the loss of div0 -->  
+	<!-- deal with the loss of div0 -->
 
-  <xsl:template match="div0|div1|div2|div3|div4|div5|div6">
-    <xsl:element name="div" namespace="http://www.tei-c.org/ns/1.0">
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:element>
-  </xsl:template>
+	<xsl:template match="div0|div1|div2|div3|div4|div5|div6">
+		<xsl:element name="div"
+			namespace="http://www.tei-c.org/ns/1.0">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:element>
+	</xsl:template>
 
 
-<!-- from Conal Tuohy -->
-<xsl:template match="orig[@reg]">
-  <choice>
-    <orig>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </orig>
-    <reg>
-      <xsl:value-of select="@reg"/>
-    </reg>
-  </choice>
-</xsl:template>
+	<!-- from Conal Tuohy -->
+	<xsl:template match="orig[@reg]">
+		<choice>
+			<orig>
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()" />
+			</orig>
+			<reg>
+				<xsl:value-of select="@reg" />
+			</reg>
+		</choice>
+	</xsl:template>
 
-<xsl:template match="reg[@orig]">
-  <choice>
-    <reg><xsl:apply-templates select="*|@*|processing-instruction()|
-    comment()|text()"/></reg>
-    <orig><xsl:value-of select="@orig"/></orig>
-  </choice>
-</xsl:template>
+	<xsl:template match="reg[@orig]">
+		<choice>
+			<reg>
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|
+    comment()|text()" />
+			</reg>
+			<orig>
+				<xsl:value-of select="@orig" />
+			</orig>
+		</choice>
+	</xsl:template>
 
-<xsl:template match="@orig|@reg"/>
+	<xsl:template match="@orig|@reg" />
 
-<!-- remove default values for attributes -->
+	<!-- remove default values for attributes -->
 
-<xsl:template match="row/@role[.='data']"/>
-<xsl:template match="cell/@role[.='data']"/>
-<xsl:template match="cell/@rows[.='1']"/>
-<xsl:template match="cell/@cols[.='1']"/>
-<xsl:template match="q/@broken[.='no']"/>
+	<xsl:template match="row/@role[.='data']" />
+	<xsl:template match="cell/@role[.='data']" />
+	<xsl:template match="cell/@rows[.='1']" />
+	<xsl:template match="cell/@cols[.='1']" />
+	<xsl:template match="q/@broken[.='no']" />
 
-  <xsl:template match="text[not(parent::TEI.2)]">
-    <floatingText>
-	<xsl:apply-templates 
-	    select="*|@*|processing-instruction()|comment()|text()"/>
-    </floatingText>
-  </xsl:template>
+	<xsl:template match="text[not(parent::TEI.2)]">
+		<floatingText>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</floatingText>
+	</xsl:template>
 
-<!-- from CES -->
-  <xsl:template match="cesdoc">
-    <cesDoc>
-    <xsl:apply-templates 
-        select="*|@*|processing-instruction()|comment()|text()"/>
-    </cesDoc>
-</xsl:template>
+	<!-- from CES -->
+	<xsl:template match="cesdoc">
+		<cesDoc>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</cesDoc>
+	</xsl:template>
 
-<!-- found in Perseus -->
+	<!-- found in Perseus -->
 
-  <xsl:template match="lg1|lg2|lg3|lg4">
-    <lg>
-    <xsl:apply-templates 
-        select="*|@*|processing-instruction()|comment()|text()"/>
-    </lg>
-  </xsl:template>
+	<xsl:template match="lg1|lg2|lg3|lg4">
+		<lg>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</lg>
+	</xsl:template>
 
-<!-- from OTA DTD -->
-  <xsl:template match="spkr">
-    <speaker>
-    <xsl:apply-templates 
-        select="*|@*|processing-instruction()|comment()|text()"/>
-    </speaker>
-  </xsl:template>
+	<!-- from OTA DTD -->
+	<xsl:template match="spkr">
+		<speaker>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</speaker>
+	</xsl:template>
 
-  <xsl:template match="letter">
-    <floatingText type="letter">
-      <body>
-	<xsl:apply-templates 
-	    select="*|@*|processing-instruction()|comment()|text()"/>
-      </body>
-    </floatingText>
-  </xsl:template>
+	<xsl:template match="letter">
+		<floatingText type="letter">
+			<body>
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()" />
+			</body>
+		</floatingText>
+	</xsl:template>
 
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/ibooks/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/ibooks/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/ibooks/to.xsl	(revision 2397)
@@ -1,48 +1,52 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="tei">
-    <xsl:import href="../../../ibooks/tei-to-ibooks.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for making iBooks from TEI.</p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="tei">
+	<xsl:import href="../../../ibooks/tei-to-ibooks.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making iBooks from TEI.</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: to.xsl 8698 2011-02-25 22:34:37Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 8698 2011-02-25 22:34:37Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/odt/to.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/odt/to.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/odt/to.xsl	(revision 2397)
@@ -1,54 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns="http://www.tei-c.org/ns/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-		>
-    <!-- import base conversion style -->
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../odt/teitoodt.xsl"/>
+	<xsl:import href="../../../odt/teitoodt.xsl" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for converting TEI to ODF</p>
-      <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting TEI to ODF</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: to.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-<xsl:param name="freestanding">true</xsl:param>
-    
-    
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: to.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:param name="freestanding">
+		true
+	</xsl:param>
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/odt/from.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/odt/from.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/profiles/default/odt/from.xsl	(revision 2397)
@@ -1,51 +1,54 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns="http://www.tei-c.org/ns/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-		>
-    <!-- import base conversion style -->
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" version="2.0">
+	<!-- import base conversion style -->
 
-    <xsl:import href="../../../odt/odttotei.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for simplifying TEI ODD markup </p>
-      <p>This software is dual-licensed:
+	<xsl:import href="../../../odt/odttotei.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for simplifying TEI ODD markup </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: from.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-    
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: from.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/expandxsl.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/expandxsl.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/expandxsl.xsl	(revision 2397)
@@ -1,80 +1,62 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet
-    xpath-default-namespace="http://www.w3.org/1999/XSL/Transform" 
-    xmlns:doc="http://www.oxygenxml.com/ns/doc/xsl"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    version="2.0"
->
+	xpath-default-namespace="http://www.w3.org/1999/XSL/Transform"
+	xmlns:doc="http://www.oxygenxml.com/ns/doc/xsl"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
 
-<!--This software is dual-licensed:
+	<!--This software is dual-licensed: 1. Distributed under a Creative Commons 
+		Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+		2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution 
+		and use in source and binary forms, with or without modification, are permitted 
+		provided that the following conditions are met: * Redistributions of source 
+		code must retain the above copyright notice, this list of conditions and 
+		the following disclaimer. * Redistributions in binary form must reproduce 
+		the above copyright notice, this list of conditions and the following disclaimer 
+		in the documentation and/or other materials provided with the distribution. 
+		This software is provided by the copyright holders and contributors "as is" 
+		and any express or implied warranties, including, but not limited to, the 
+		implied warranties of merchantability and fitness for a particular purpose 
+		are disclaimed. In no event shall the copyright holder or contributors be 
+		liable for any direct, indirect, incidental, special, exemplary, or consequential 
+		damages (including, but not limited to, procurement of substitute goods or 
+		services; loss of use, data, or profits; or business interruption) however 
+		caused and on any theory of liability, whether in contract, strict liability, 
+		or tort (including negligence or otherwise) arising in any way out of the 
+		use of this software, even if advised of the possibility of such damage. 
+		$Id: checkxsl.xsl 9646 2011-11-05 23:39:08Z rahtz $ 2008, TEI Consortium -->
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:template match="import">
+		<xsl:for-each select="doc(@href)/stylesheet">
+			<xsl:apply-templates />
+		</xsl:for-each>
+	</xsl:template>
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<xsl:template match="doc:*" />
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<xsl:template match="stylesheet">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+	<xsl:template match="text()|@*|comment()">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
+	<xsl:template match="*" mode="import">
+		<xsl:copy>
+			<xsl:attribute name="priority">-10</xsl:attribute>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
 
-$Id: checkxsl.xsl 9646 2011-11-05 23:39:08Z rahtz $
-
-2008, TEI Consortium
--->
-
-<xsl:template match="import">
-  <xsl:for-each select="doc(@href)/stylesheet">
-    <xsl:apply-templates/>
-  </xsl:for-each>
-</xsl:template>
-
-<xsl:template match="doc:*"/>
-
-<xsl:template match="stylesheet">
-  <xsl:copy>
-    <xsl:copy-of select="@*"/>
-    <xsl:apply-templates/>
-</xsl:copy>
-</xsl:template>
-
-<xsl:template match="text()|@*|comment()">
-  <xsl:copy-of select="."/>
-</xsl:template>
-
-<xsl:template match="*">
-  <xsl:copy>
-    <xsl:copy-of select="@*"/>
-    <xsl:apply-templates/>
-  </xsl:copy>
-</xsl:template>
-
-<xsl:template match="*" mode="import">
-  <xsl:copy>
-    <xsl:attribute name="priority">-10</xsl:attribute>
-    <xsl:copy-of select="@*"/>
-    <xsl:apply-templates/>
-  </xsl:copy>
-</xsl:template>
-
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/fixgraphics.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/fixgraphics.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/fixgraphics.xsl	(revision 2397)
@@ -1,95 +1,105 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the core module. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module. </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: fixgraphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:output method="xml" indent="yes"/>
-  <xsl:param name="DIR"/>
-  <xsl:key name="W" match="tiff:ImageWidth" use="1"/>
-  <xsl:key name="H" match="tiff:ImageLength" use="1"/>
-  <xsl:template match="@*|text()|comment()|processing-instruction()">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  
-  <xsl:template match="*">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-  </xsl:template>
-  
-  
-  <xsl:template match="tei:graphic">
-      <xsl:copy>
-	        <xsl:variable name="newName">
-	           <xsl:text>Pictures/resource</xsl:text>
-	           <xsl:number level="any"/>
-	           <xsl:text>.</xsl:text>
-	           <xsl:value-of select="tokenize(@url,'\.')[last()]"/>
-	        </xsl:variable>
-	        <xsl:attribute name="url">
-	           <xsl:value-of select="$newName"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: fixgraphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:output method="xml" indent="yes" />
+	<xsl:param name="DIR" />
+	<xsl:key name="W" match="tiff:ImageWidth" use="1" />
+	<xsl:key name="H" match="tiff:ImageLength" use="1" />
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+
+	<xsl:template match="tei:graphic">
+		<xsl:copy>
+			<xsl:variable name="newName">
+				<xsl:text>Pictures/resource</xsl:text>
+				<xsl:number level="any" />
+				<xsl:text>.</xsl:text>
+				<xsl:value-of select="tokenize(@url,'\.')[last()]" />
+			</xsl:variable>
+			<xsl:attribute name="url">
+	           <xsl:value-of select="$newName" />
 	        </xsl:attribute>
-	        <xsl:copy-of select="@n"/>
-	        <xsl:copy-of select="@height"/>
-	        <xsl:copy-of select="@width"/>
-	        <xsl:copy-of select="@scale"/>
-		
-	        <xsl:if test="doc-available(concat($DIR,'/',$newName,'.xmp'))">
-	           <xsl:attribute name="tei:width">
-	              <xsl:for-each select="document(concat($DIR,'/',$newName,'.xmp'),/)">
-	                 <xsl:value-of select="(number(key('W',1)) div 72) * 9144"/>
+			<xsl:copy-of select="@n" />
+			<xsl:copy-of select="@height" />
+			<xsl:copy-of select="@width" />
+			<xsl:copy-of select="@scale" />
+
+			<xsl:if test="doc-available(concat($DIR,'/',$newName,'.xmp'))">
+				<xsl:attribute name="tei:width">
+	              <xsl:for-each
+					select="document(concat($DIR,'/',$newName,'.xmp'),/)">
+	                 <xsl:value-of
+					select="(number(key('W',1)) div 72) * 9144" />
 	              </xsl:for-each>
 	           </xsl:attribute>
-	  
-	           <xsl:attribute name="tei:height">
-	              <xsl:for-each select="document(concat($DIR,'/',$newName,'.xmp'),/)">
-	                 <xsl:value-of select="(number(key('H',1)) div 72) * 9144"/>
+
+				<xsl:attribute name="tei:height">
+	              <xsl:for-each
+					select="document(concat($DIR,'/',$newName,'.xmp'),/)">
+	                 <xsl:value-of
+					select="(number(key('H',1)) div 72) * 9144" />
 	              </xsl:for-each>
 	           </xsl:attribute>
-	        </xsl:if>
-      </xsl:copy>
-  </xsl:template>
+			</xsl:if>
+		</xsl:copy>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/build-to.xml	(revision 2397)
@@ -1,104 +1,109 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitooo">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9875 2011-12-04 18:27:43Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into OO files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output oo file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- which language -->
-  <property name="lang" value="en"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="stylesheetFile"  value="../profiles/${profile}/odt/to.xsl"/>
-  <property name="listgraphics"    value="../tools/makegraphicsanttask.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir"    file="${outputFile}"/>
-  <dirname property="xslDir"       file="${stylesheetFile}"/>
-  <property name="outputTempDir"   value="${outputDir}/temp-dir-for-ant"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9875 2011-12-04 18:27:43Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into OO files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output oo file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- which language -->
+	<property name="lang" value="en" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="stylesheetFile"
+		value="../profiles/${profile}/odt/to.xsl" />
+	<property name="listgraphics"
+		value="../tools/makegraphicsanttask.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<dirname property="xslDir" file="${stylesheetFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
 
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
 
-  <import file="../odds2/build-to.xml"/>
+	<import file="../odds2/build-to.xml" />
 
-  <target name="setup">
-    <taskdef name="images" classname="ImageTask" classpath="../tools/ImageInfo/ImageInfo.jar"/>
-    <delete dir="${outputTempDir}"/>
-    <mkdir  dir="${outputTempDir}"/>
-  </target>
+	<target name="setup">
+		<taskdef name="images" classname="ImageTask"
+			classpath="../tools/ImageInfo/ImageInfo.jar" />
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
 
-  <target name="dist" depends="setup,odd,notodd">
-    <!-- Recreate temporary output directory -->
-    <!-- The transformation for OO output. -->
-    <echo level="info">unzip ODT template</echo>
-    <unzip src="${xslDir}/template.odt" dest="${outputTempDir}"/>
-    <echo level="info">Get names of graphics files and write an ant task</echo>
-    <xslt force="yes" style="${listgraphics}" classpath="classpath" in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/copy.xml">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="inputDir" expression="${inputFileDir}"/>
-      <param name="mediaDir" expression="Pictures"/>
-    </xslt>
-    <echo level="info">Copy image files by running ant task</echo>
-    <ant antfile="${outputTempDir}/copy.xml"/>
-    <echo level="info">Read dimensions of image files and write info file</echo>
-    <images outputFile="${outputTempDir}/image-size-info.xml">
-      <fileset dir="${outputTempDir}" includes="Pictures/*.*"/>
-    </images>
-    <echo level="info">XSLT generate files for oo </echo>
-    <xslt force="yes" style="${stylesheetFile}" in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/newdocument.xml" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="outputDir" expression="file:///${outputTempDir}"/>
-      <param name="freestanding" expression="true"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-    <move file="${outputTempDir}/newdocument.xml" tofile="${outputTempDir}/content.xml" overwrite="true"/>
-    <echo level="info">ZIP: put files from ${outputTempDir} together into ${outputFile}</echo>
-    <zip destfile="${outputDir}/temp-for-ant.zip" basedir="${outputTempDir}" compress="true" excludes="tmp1.xml,tmp2.xml,image-size-info.xml,copy.xml"/>
-    <copy file="${outputDir}/temp-for-ant.zip" tofile="${outputFile}" overwrite="true"/>
-    <delete file="${outputDir}/temp-for-ant.zip"/>
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="dist" depends="setup,odd,notodd">
+		<!-- Recreate temporary output directory -->
+		<!-- The transformation for OO output. -->
+		<echo level="info">unzip ODT template</echo>
+		<unzip src="${xslDir}/template.odt" dest="${outputTempDir}" />
+		<echo level="info">Get names of graphics files and write an ant task</echo>
+		<xslt force="yes" style="${listgraphics}" classpath="classpath"
+			in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/copy.xml">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="inputDir" expression="${inputFileDir}" />
+			<param name="mediaDir" expression="Pictures" />
+		</xslt>
+		<echo level="info">Copy image files by running ant task</echo>
+		<ant antfile="${outputTempDir}/copy.xml" />
+		<echo level="info">Read dimensions of image files and write info file</echo>
+		<images outputFile="${outputTempDir}/image-size-info.xml">
+			<fileset dir="${outputTempDir}" includes="Pictures/*.*" />
+		</images>
+		<echo level="info">XSLT generate files for oo </echo>
+		<xslt force="yes" style="${stylesheetFile}"
+			in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/newdocument.xml"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="outputDir" expression="file:///${outputTempDir}" />
+			<param name="freestanding" expression="true" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+		<move file="${outputTempDir}/newdocument.xml"
+			tofile="${outputTempDir}/content.xml" overwrite="true" />
+		<echo level="info">ZIP: put files from ${outputTempDir} together into
+			${outputFile}</echo>
+		<zip destfile="${outputDir}/temp-for-ant.zip"
+			basedir="${outputTempDir}" compress="true"
+			excludes="tmp1.xml,tmp2.xml,image-size-info.xml,copy.xml" />
+		<copy file="${outputDir}/temp-for-ant.zip" tofile="${outputFile}"
+			overwrite="true" />
+		<delete file="${outputDir}/temp-for-ant.zip" />
+		<delete dir="${outputTempDir}" />
+	</target>
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/build-from.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/build-from.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/build-from.xml	(revision 2397)
@@ -1,85 +1,81 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="docxtei">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-from.xml 9316 2011-09-13 08:06:05Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert odt files to TEI documents.
- -->
-  <!-- Path to ODT file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output TEI file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- which language -->
-  <property name="lang" value="en"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="odttotei"  value="../profiles/${profile}/odt/from.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir"    file="${outputFile}"/>
-  <property name="outputTempDir"   value="${outputDir}/temp-dir-for-ant"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-from.xml 9316 2011-09-13 08:06:05Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert odt files to TEI documents. -->
+	<!-- Path to ODT file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output TEI file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- which language -->
+	<property name="lang" value="en" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="odttotei"
+		value="../profiles/${profile}/odt/from.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
 
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
 
-  <target name="setup">
-    <!-- Recreate temporary output directory -->
-    <delete dir="${outputTempDir}"/>
-    <mkdir  dir="${outputTempDir}"/>
-  </target>
+	<target name="setup">
+		<!-- Recreate temporary output directory -->
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
 
-  <target name="dist" depends="convert,mediadir.check,picturecopy,cleanup"/>
+	<target name="dist"
+		depends="convert,mediadir.check,picturecopy,cleanup" />
 
-  <target name="convert" depends="setup">
-    <unzip src="${inputFile}" dest="${outputTempDir}"/>
-    <xslt force="yes" style="${odttotei}" classpath="classpath" in="${outputTempDir}/content.xml" out="${outputFile}">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="dir" expression="${outputTempDir}"/>
-      <param name="inputDir" expression="${inputFileDir}"/>
-      <param name="mediaDir" expression="Pictures"/>
-    </xslt>
-  </target>
+	<target name="convert" depends="setup">
+		<unzip src="${inputFile}" dest="${outputTempDir}" />
+		<xslt force="yes" style="${odttotei}" classpath="classpath"
+			in="${outputTempDir}/content.xml" out="${outputFile}">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="dir" expression="${outputTempDir}" />
+			<param name="inputDir" expression="${inputFileDir}" />
+			<param name="mediaDir" expression="Pictures" />
+		</xslt>
+	</target>
 
-  <target name="mediadir.check">
-    <condition property="mediadir.exists">
-      <available file="${outputTempDir}/Pictures" type="dir"/>
-    </condition>
-  </target>
+	<target name="mediadir.check">
+		<condition property="mediadir.exists">
+			<available file="${outputTempDir}/Pictures" type="dir" />
+		</condition>
+	</target>
 
-  <target name="picturecopy" if="${mediadir.exists}">
-    <move todir="${outputDir}/Pictures"  overwrite="true">
-      <fileset dir="${outputTempDir}/Pictures"/>
-    </move>
-  </target>
+	<target name="picturecopy" if="${mediadir.exists}">
+		<move todir="${outputDir}/Pictures" overwrite="true">
+			<fileset dir="${outputTempDir}/Pictures" />
+		</move>
+	</target>
 
-  <target name="cleanup" unless="debug">
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/grouping.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/grouping.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/grouping.xsl	(revision 2397)
@@ -1,126 +1,126 @@
 <xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:mf="http://example.com/mf"
- exclude-result-prefixes="xs mf"
- version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the core module. </p>
-         <p>This software is dual-licensed:
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:mf="http://example.com/mf" exclude-result-prefixes="xs mf"
+	version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module. </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: grouping.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: grouping.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
- <xsl:output indent="yes"/>
 
- <xsl:template match="body">
-   <xsl:copy>
-     <xsl:sequence select="mf:group(*, 1, 0)"/>
-   </xsl:copy>
- </xsl:template>
+	<xsl:output indent="yes" />
 
- <xsl:function name="mf:group" as="node()*">
-   <xsl:param name="elements" as="element()*"/>
-   <xsl:param name="level" as="xs:integer"/>
-   <xsl:param name="last-level" as="xs:integer"/>
-   <xsl:for-each-group select="$elements"
-group-starting-with="head[@level = $level]">
-     <xsl:variable name="head" as="element()?"
-select=".[self::head[@level = $level]]"/>
-     <xsl:variable name="tail" as="element()*" select="current-group()
-except $head"/>
-     <xsl:choose>
-       <xsl:when test="$head">
-         <xsl:sequence select="mf:nested-divs($head, $tail, $level,
-$level - $last-level)"/>
-       </xsl:when>
-       <xsl:otherwise>
-           <xsl:choose>
-             <xsl:when test="$tail[self::head[@level]]">
-               <xsl:sequence select="mf:group($tail, $level + 1, $last-level)"/>
-             </xsl:when>
-             <xsl:otherwise>
-               <xsl:copy-of select="$tail"/>
-             </xsl:otherwise>
-           </xsl:choose>
-       </xsl:otherwise>
-     </xsl:choose>
-   </xsl:for-each-group>
- </xsl:function>
+	<xsl:template match="body">
+		<xsl:copy>
+			<xsl:sequence select="mf:group(*, 1, 0)" />
+		</xsl:copy>
+	</xsl:template>
 
- <xsl:function name="mf:nested-divs" as="element()*">
-   <xsl:param name="head" as="element()?"/>
-   <xsl:param name="tail" as="element()*"/>
-   <xsl:param name="level" as="xs:integer"/>
-   <xsl:param name="i" as="xs:integer"/>
-   <xsl:choose>
-     <xsl:when test="$i gt 0">
-       <div>
-         <xsl:sequence select="mf:nested-divs($head, $tail, $level, $i - 1)"/>
-       </div>
-     </xsl:when>
-     <xsl:otherwise>
-       <xsl:copy-of select="$head"/>
-       <xsl:choose>
-         <xsl:when test="$tail[self::head[@level]]">
-           <xsl:sequence select="mf:group($tail, $level + 1, $level)"/>
-         </xsl:when>
-         <xsl:otherwise>
-           <xsl:copy-of select="$tail"/>
-         </xsl:otherwise>
-       </xsl:choose>
-     </xsl:otherwise>
-   </xsl:choose>
- </xsl:function>
+	<xsl:function name="mf:group" as="node()*">
+		<xsl:param name="elements" as="element()*" />
+		<xsl:param name="level" as="xs:integer" />
+		<xsl:param name="last-level" as="xs:integer" />
+		<xsl:for-each-group select="$elements"
+			group-starting-with="head[@level = $level]">
+			<xsl:variable name="head" as="element()?"
+				select=".[self::head[@level = $level]]" />
+			<xsl:variable name="tail" as="element()*"
+				select="current-group()
+except $head" />
+			<xsl:choose>
+				<xsl:when test="$head">
+					<xsl:sequence
+						select="mf:nested-divs($head, $tail, $level,
+$level - $last-level)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:choose>
+						<xsl:when test="$tail[self::head[@level]]">
+							<xsl:sequence
+								select="mf:group($tail, $level + 1, $last-level)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:copy-of select="$tail" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+	</xsl:function>
 
+	<xsl:function name="mf:nested-divs" as="element()*">
+		<xsl:param name="head" as="element()?" />
+		<xsl:param name="tail" as="element()*" />
+		<xsl:param name="level" as="xs:integer" />
+		<xsl:param name="i" as="xs:integer" />
+		<xsl:choose>
+			<xsl:when test="$i gt 0">
+				<div>
+					<xsl:sequence
+						select="mf:nested-divs($head, $tail, $level, $i - 1)" />
+				</div>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="$head" />
+				<xsl:choose>
+					<xsl:when test="$tail[self::head[@level]]">
+						<xsl:sequence
+							select="mf:group($tail, $level + 1, $level)" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy-of select="$tail" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
 </xsl:stylesheet>
 
-<!--
-It has become rather complicated with two functions due to the
-requirement to add missing levels.
+<!-- It has become rather complicated with two functions due to the requirement 
+	to add missing levels. Your latest suggestion to first normalize the input 
+	by adding missing levels and then to group in a second pass might indeed 
+	be an approach leading to shorter and less complicated code. Martin Honnen 
+	http://msmvps.com/blogs/martin_honnen/ -->
 
-Your latest suggestion to first normalize the input by adding missing
-levels and then to group in a second pass might indeed be an approach
-leading to shorter and less complicated code.
-
-
-
-       Martin Honnen
-       http://msmvps.com/blogs/martin_honnen/
--->
-
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/odttotei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/odttotei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/odttotei.xsl	(revision 2397)
@@ -1,1450 +1,1517 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet
-  exclude-result-prefixes="office style text table draw fo xlink dc
+	exclude-result-prefixes="office style text table draw fo xlink dc
 			   meta number tei svg chart dr3d math form
 			   script ooo ooow oooc dom xforms xs xsd xsi"
-  office:version="1.0" version="2.0" 
-  xmlns:xs="http://www.w3.org/2001/XMLSchema"
-  xmlns="http://www.tei-c.org/ns/1.0"
-  xmlns:tei="http://www.tei-c.org/ns/1.0"
-  xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
-  xmlns:dc="http://purl.org/dc/elements/1.1/"
-  xmlns:dom="http://www.w3.org/2001/xml-events"
-  xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
-  xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
-  xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
-  xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
-  xmlns:math="http://www.w3.org/1998/Math/MathML"
-  xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
-  xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
-  xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
-  xmlns:ooo="http://openoffice.org/2004/office"
-  xmlns:oooc="http://openoffice.org/2004/calc"
-  xmlns:ooow="http://openoffice.org/2004/writer"
-  xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
-  xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
-  xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
-  xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
-  xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
-  xmlns:xforms="http://www.w3.org/2002/xforms"
-  xmlns:xlink="http://www.w3.org/1999/xlink"
-  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	office:version="1.0" version="2.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dom="http://www.w3.org/2001/xml-events"
+	xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+	xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+	xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+	xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+	xmlns:math="http://www.w3.org/1998/Math/MathML"
+	xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+	xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+	xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+	xmlns:ooo="http://openoffice.org/2004/office"
+	xmlns:oooc="http://openoffice.org/2004/calc"
+	xmlns:ooow="http://openoffice.org/2004/writer"
+	xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+	xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+	xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+	xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+	xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+	xmlns:xforms="http://www.w3.org/2002/xforms"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making TEI files from
-	 OpenOffice. Originally derived from the OpenOffice /Docbook
-	 conversion, but largely rewritten</p>
-         <p> 
-            <h1 xmlns="">License</h1>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making TEI files from
+				OpenOffice. Originally derived from the OpenOffice /Docbook
+				conversion, but largely rewritten</p>
+			<p>
+				<h1 xmlns="">License</h1>
+				This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: odttotei.xsl 10180 2012-03-25 14:48:46Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:key match="style:style" name="STYLES" use="@style:name"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: odttotei.xsl 10180 2012-03-25 14:48:46Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
+	<xsl:key match="style:style" name="STYLES" use="@style:name" />
 
-  <xsl:key name="LISTS" 
-	 match="text:list-level-style-number" 
-	 use="parent::text:list-style/@style:name"/>
 
-  <xsl:key match="text:h" name="Headings" use="text:outline-level"/>
+	<xsl:key name="LISTS" match="text:list-level-style-number"
+		use="parent::text:list-style/@style:name" />
 
-  <xsl:param name="debug">false</xsl:param>
+	<xsl:key match="text:h" name="Headings"
+		use="text:outline-level" />
 
-  <xsl:param name="dir">.</xsl:param>
+	<xsl:param name="debug">
+		false
+	</xsl:param>
 
-  <xsl:output encoding="utf-8" indent="yes"/>
+	<xsl:param name="dir">
+		.
+	</xsl:param>
 
-  <!--  <xsl:strip-space elements="text:span"/>-->
-  
-  <xsl:variable name="META">
-    <xsl:choose>
-      <xsl:when test="doc-available(concat($dir,'/meta.xml'))">
-        <xsl:copy-of select="document(concat($dir,'/meta.xml'))//office:meta"/>
-      </xsl:when>
-      <xsl:when test="/office:document/office:meta">
-        <xsl:copy-of select="/office:document/office:meta"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy-of select="/office:document-meta/office:meta"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
+	<xsl:output encoding="utf-8" indent="yes" />
 
-  <xsl:variable name="document-title">
-    <xsl:choose>
-      <xsl:when
-	  test="/office:document-content/office:body/office:text/text:p[@text:style-name='Title']">
-        <xsl:value-of
-	    select="/office:document-content/office:body/office:text/text:p[@text:style-name='Title'][1]"
-	    />
-      </xsl:when>
-      <xsl:when test="$META/office:meta/dc:title">
-        <xsl:value-of select="$META/office:meta/dc:title"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>Untitled Document</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
+	<!-- <xsl:strip-space elements="text:span"/> -->
 
-  <xsl:template match="*" mode="summary">
-    <xsl:text>&#10;</xsl:text>
-    <xsl:for-each select="ancestor::*"><xsl:text>.</xsl:text></xsl:for-each>
-    <xsl:value-of select="name()"/>:
-    <xsl:apply-templates mode="summary"/>
-  </xsl:template>
+	<xsl:variable name="META">
+		<xsl:choose>
+			<xsl:when test="doc-available(concat($dir,'/meta.xml'))">
+				<xsl:copy-of
+					select="document(concat($dir,'/meta.xml'))//office:meta" />
+			</xsl:when>
+			<xsl:when test="/office:document/office:meta">
+				<xsl:copy-of select="/office:document/office:meta" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="/office:document-meta/office:meta" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
 
-  <xsl:template match="/">
-    <xsl:if test="$debug='true'">
-      <xsl:message>Look for metadata in <xsl:value-of select="concat($dir,'/meta.xml')"/></xsl:message>
-    </xsl:if>
-    <xsl:variable name="pass1">
-      <xsl:apply-templates/>
-    </xsl:variable>
-    <xsl:variable name="pass2">
-      <xsl:apply-templates mode="pass2" select="$pass1"/>
-    </xsl:variable>
-    <xsl:apply-templates mode="pass3" select="$pass2"/>    
-  </xsl:template>
+	<xsl:variable name="document-title">
+		<xsl:choose>
+			<xsl:when
+				test="/office:document-content/office:body/office:text/text:p[@text:style-name='Title']">
+				<xsl:value-of
+					select="/office:document-content/office:body/office:text/text:p[@text:style-name='Title'][1]" />
+			</xsl:when>
+			<xsl:when test="$META/office:meta/dc:title">
+				<xsl:value-of select="$META/office:meta/dc:title" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>Untitled Document</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
 
-  <xsl:template match="office:document-content|office:body">
-    <xsl:for-each select="descendant::text:variable-decl">
-      <xsl:variable name="name">
-        <xsl:value-of select="@text:name"/>
-      </xsl:variable>
-      <xsl:if test="contains(@text:name,'entitydecl')">
-        <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE TEI [
+	<xsl:template match="*" mode="summary">
+		<xsl:text>&#10;</xsl:text>
+		<xsl:for-each select="ancestor::*">
+			<xsl:text>.</xsl:text>
+		</xsl:for-each>
+		<xsl:value-of select="name()" />
+		:
+		<xsl:apply-templates mode="summary" />
+	</xsl:template>
+
+	<xsl:template match="/">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Look for metadata in
+				<xsl:value-of select="concat($dir,'/meta.xml')" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:variable name="pass1">
+			<xsl:apply-templates />
+		</xsl:variable>
+		<xsl:variable name="pass2">
+			<xsl:apply-templates mode="pass2" select="$pass1" />
+		</xsl:variable>
+		<xsl:apply-templates mode="pass3" select="$pass2" />
+	</xsl:template>
+
+	<xsl:template match="office:document-content|office:body">
+		<xsl:for-each select="descendant::text:variable-decl">
+			<xsl:variable name="name">
+				<xsl:value-of select="@text:name" />
+			</xsl:variable>
+			<xsl:if test="contains(@text:name,'entitydecl')">
+				<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE TEI [
 	</xsl:text>
-        <xsl:text disable-output-escaping="yes">&lt;!ENTITY </xsl:text>
-        <xsl:value-of select="substring-after(@text:name,'entitydecl_')"/>
-        <xsl:text> &quot;</xsl:text>
-        <xsl:value-of
-          select="/descendant::text:variable-set[@text:name= $name][1]"/>
-        <xsl:text disable-output-escaping="yes">&quot;&gt;</xsl:text>
-        <xsl:text disable-output-escaping="yes">]&gt;</xsl:text>
-      </xsl:if>
-    </xsl:for-each>
-    <TEI>
-	<xsl:for-each select="$META/office:meta/dc:language">
-	  <xsl:attribute name="xml:lang">
-	    <xsl:value-of select="normalize-space(.)"/>
+				<xsl:text disable-output-escaping="yes">&lt;!ENTITY </xsl:text>
+				<xsl:value-of
+					select="substring-after(@text:name,'entitydecl_')" />
+				<xsl:text> &quot;</xsl:text>
+				<xsl:value-of
+					select="/descendant::text:variable-set[@text:name= $name][1]" />
+				<xsl:text disable-output-escaping="yes">&quot;&gt;</xsl:text>
+				<xsl:text disable-output-escaping="yes">]&gt;</xsl:text>
+			</xsl:if>
+		</xsl:for-each>
+		<TEI>
+			<xsl:for-each select="$META/office:meta/dc:language">
+				<xsl:attribute name="xml:lang">
+	    <xsl:value-of select="normalize-space(.)" />
 	  </xsl:attribute>
-	</xsl:for-each>  
-      <xsl:call-template name="teiHeader"/>
-      <text>
-	<xsl:apply-templates/>
-      </text>
-    </TEI>
-  </xsl:template>
+			</xsl:for-each>
+			<xsl:call-template name="teiHeader" />
+			<text>
+				<xsl:apply-templates />
+			</text>
+		</TEI>
+	</xsl:template>
 
 
-  <xsl:template match="text:variable-set|text:variable-get">
-    <xsl:choose>
-      <xsl:when test="contains(@text:style-name,'entitydecl')">
-        <xsl:text disable-output-escaping="yes">&amp;</xsl:text>
-        <xsl:value-of select="substring-after(@text:style-name,'entitydecl_')"/>
-        <xsl:text disable-output-escaping="yes">;</xsl:text>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="text:variable-set|text:variable-get">
+		<xsl:choose>
+			<xsl:when test="contains(@text:style-name,'entitydecl')">
+				<xsl:text disable-output-escaping="yes">&amp;</xsl:text>
+				<xsl:value-of
+					select="substring-after(@text:style-name,'entitydecl_')" />
+				<xsl:text disable-output-escaping="yes">;</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="teiHeader">
-    <teiHeader>
-      <fileDesc>
-        <titleStmt>
-          <title>
-            <xsl:value-of select="$document-title"/>
-          </title>
-          <author>
-            <xsl:value-of
-              select="$META/office:meta/meta:initial-creator"/>
-          </author>
-        </titleStmt>
-        <editionStmt>
-          <edition>
-            <date>
-              <xsl:value-of
-                select="$META/office:meta/meta:creation-date"/>
-            </date>
-          </edition>
-        </editionStmt>
-        <publicationStmt>
-          <p>no publication statement available</p>
-        </publicationStmt>
-        <sourceDesc>
-          <p>
-	    <xsl:apply-templates
-              select="$META/office:meta/meta:generator"/>
-	    <xsl:text>Written by OpenOffice</xsl:text>
-	  </p>
-        </sourceDesc>
-      </fileDesc>
-      <xsl:variable name="pD">
-	<xsl:if test="$META/office:meta/dc:language">
-	  <langUsage>
-	    <language>
-	      <xsl:attribute name="ident">
-		<xsl:value-of select="$META/office:meta/dc:language"/>
+	<xsl:template name="teiHeader">
+		<teiHeader>
+			<fileDesc>
+				<titleStmt>
+					<title>
+						<xsl:value-of select="$document-title" />
+					</title>
+					<author>
+						<xsl:value-of
+							select="$META/office:meta/meta:initial-creator" />
+					</author>
+				</titleStmt>
+				<editionStmt>
+					<edition>
+						<date>
+							<xsl:value-of
+								select="$META/office:meta/meta:creation-date" />
+						</date>
+					</edition>
+				</editionStmt>
+				<publicationStmt>
+					<p>no publication statement available</p>
+				</publicationStmt>
+				<sourceDesc>
+					<p>
+						<xsl:apply-templates
+							select="$META/office:meta/meta:generator" />
+						<xsl:text>Written by OpenOffice</xsl:text>
+					</p>
+				</sourceDesc>
+			</fileDesc>
+			<xsl:variable name="pD">
+				<xsl:if test="$META/office:meta/dc:language">
+					<langUsage>
+						<language>
+							<xsl:attribute name="ident">
+		<xsl:value-of select="$META/office:meta/dc:language" />
 	      </xsl:attribute>
-	      <xsl:value-of select="$META/office:meta/dc:language"/>
-	    </language>
-	  </langUsage>
-	</xsl:if>
-	<xsl:if test="$META/office:meta/meta:keyword">
-	  <textClass>
-	    <keywords scheme="unknown">
-	      <list>
-		<xsl:for-each select="$META/office:meta/meta:keyword">
-		  <item>
-		    <xsl:value-of select="."/>
-		  </item>
-		</xsl:for-each>
-	      </list>
-	    </keywords>
-	  </textClass>
-	</xsl:if>
-      </xsl:variable>
-      <xsl:if test="$pD/*">
-	<profileDesc>
-	  <xsl:copy-of select="$pD"/>
-	</profileDesc>
-      </xsl:if>
-      <revisionDesc>
-	<change>
-	  <name>
-	    <xsl:apply-templates
-		select="$META/office:meta/dc:creator"/>
-	  </name>
-	  <date>
-	    <xsl:apply-templates select="$META/office:meta/dc:date"/>
-	  </date>
-	</change>
-      </revisionDesc>
-    </teiHeader>
-  </xsl:template>
+							<xsl:value-of select="$META/office:meta/dc:language" />
+						</language>
+					</langUsage>
+				</xsl:if>
+				<xsl:if test="$META/office:meta/meta:keyword">
+					<textClass>
+						<keywords scheme="unknown">
+							<list>
+								<xsl:for-each
+									select="$META/office:meta/meta:keyword">
+									<item>
+										<xsl:value-of select="." />
+									</item>
+								</xsl:for-each>
+							</list>
+						</keywords>
+					</textClass>
+				</xsl:if>
+			</xsl:variable>
+			<xsl:if test="$pD/*">
+				<profileDesc>
+					<xsl:copy-of select="$pD" />
+				</profileDesc>
+			</xsl:if>
+			<revisionDesc>
+				<change>
+					<name>
+						<xsl:apply-templates
+							select="$META/office:meta/dc:creator" />
+					</name>
+					<date>
+						<xsl:apply-templates
+							select="$META/office:meta/dc:date" />
+					</date>
+				</change>
+			</revisionDesc>
+		</teiHeader>
+	</xsl:template>
 
 
 
-  <xsl:template match="/office:document-content/office:body">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="/office:document-content/office:body">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <!-- sections -->
-  <xsl:template match="text:h">
-    <xsl:choose>
-      <xsl:when test="ancestor::text:note-body">
-          <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:when test="@text:style-name='ArticleInfo'"> </xsl:when>
-      <xsl:when test="@text:style-name='Abstract'">
-        <div type="abstract">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Appendix'">
-        <div type="appendix">
-          <xsl:apply-templates/>
-        </div>
-      </xsl:when>
-      <xsl:otherwise>
-	<HEAD level="1" style="{@text:style-name}">
-	  <xsl:apply-templates/>
-	</HEAD>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<!-- sections -->
+	<xsl:template match="text:h">
+		<xsl:choose>
+			<xsl:when test="ancestor::text:note-body">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@text:style-name='ArticleInfo'">
+			</xsl:when>
+			<xsl:when test="@text:style-name='Abstract'">
+				<div type="abstract">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:when test="@text:style-name='Appendix'">
+				<div type="appendix">
+					<xsl:apply-templates />
+				</div>
+			</xsl:when>
+			<xsl:otherwise>
+				<HEAD level="1" style="{@text:style-name}">
+					<xsl:apply-templates />
+				</HEAD>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="text:h[@text:outline-level]">
-    <xsl:choose>
-      <xsl:when test="ancestor::text:note-body">
-	<p>
-	  <xsl:attribute name="rend">
+	<xsl:template match="text:h[@text:outline-level]">
+		<xsl:choose>
+			<xsl:when test="ancestor::text:note-body">
+				<p>
+					<xsl:attribute name="rend">
 	    <xsl:choose>
 	      <xsl:when test="@text:style-name">
-		<xsl:value-of select="@text:style-name"/>
+		<xsl:value-of select="@text:style-name" />
 	      </xsl:when>
 	      <xsl:otherwise>heading</xsl:otherwise>
 	    </xsl:choose>
 	  </xsl:attribute>
-          <xsl:apply-templates/>
-	</p>
-      </xsl:when>
-      <xsl:otherwise>
-	<HEAD level="{@text:outline-level}" >
-	  <xsl:attribute name="style">
+					<xsl:apply-templates />
+				</p>
+			</xsl:when>
+			<xsl:otherwise>
+				<HEAD level="{@text:outline-level}">
+					<xsl:attribute name="style">
 	    <xsl:choose>
 	      <xsl:when test="@text:style-name">
-		<xsl:value-of select="@text:style-name"/>
+		<xsl:value-of select="@text:style-name" />
 	      </xsl:when>
 	      <xsl:otherwise>nostyle</xsl:otherwise>
 	    </xsl:choose>
 	  </xsl:attribute>
-	  <xsl:apply-templates/>
-	</HEAD>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <!-- special case paragraphs -->
-  <xsl:template match="text:p[@text:style-name='XMLComment']">
-    <xsl:comment>
-      <xsl:value-of select="."/>
-    </xsl:comment>
-  </xsl:template>
- 
+					<xsl:apply-templates />
+				</HEAD>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="text:p[@text:style-name]">
-    <xsl:choose>
-      <xsl:when test="draw:frame and parent::draw:text-box">
-	<xsl:apply-templates select="draw:frame"/>
-	<head>
-	  <xsl:apply-templates select="text()|*[not(local-name(.)='frame')]"/>
-	</head>
-      </xsl:when>
-      <xsl:when test="parent::table:table-cell">
-	<xsl:call-template name="applyStyle"/>
-      </xsl:when>
+	<!-- special case paragraphs -->
+	<xsl:template
+		match="text:p[@text:style-name='XMLComment']">
+		<xsl:comment>
+			<xsl:value-of select="." />
+		</xsl:comment>
+	</xsl:template>
 
-      <xsl:when test="count(parent::text:note-body/text:p)=1">
-          <xsl:apply-templates/>
-      </xsl:when>
 
-      <xsl:when test="count(parent::text:list-item/text:p)=1">
-          <xsl:apply-templates/>
-      </xsl:when>
+	<xsl:template match="text:p[@text:style-name]">
+		<xsl:choose>
+			<xsl:when test="draw:frame and parent::draw:text-box">
+				<xsl:apply-templates select="draw:frame" />
+				<head>
+					<xsl:apply-templates
+						select="text()|*[not(local-name(.)='frame')]" />
+				</head>
+			</xsl:when>
+			<xsl:when test="parent::table:table-cell">
+				<xsl:call-template name="applyStyle" />
+			</xsl:when>
 
-      <xsl:when test="@text:style-name='Document Title'">
-        <title>
-          <xsl:apply-templates/>
-        </title>
-      </xsl:when>
+			<xsl:when test="count(parent::text:note-body/text:p)=1">
+				<xsl:apply-templates />
+			</xsl:when>
 
-      <xsl:when test="@text:style-name='Author'">
-        <author>
-          <xsl:apply-templates/>
-        </author>
-      </xsl:when>
+			<xsl:when test="count(parent::text:list-item/text:p)=1">
+				<xsl:apply-templates />
+			</xsl:when>
 
-      <xsl:when test="@text:style-name='lg'">
-        <lg>
-	  <xsl:for-each-group select="node()"
-			      group-ending-with="text:line-break">
-	    <l><xsl:apply-templates select="current-group()"/></l>
-	  </xsl:for-each-group>
-        </lg>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Title'">
-        <title>
-          <xsl:apply-templates/>
-        </title>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Date'">
-        <date>
-          <xsl:apply-templates/>
-        </date>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Section Title'">
-        <head>
-          <xsl:apply-templates/>
-        </head>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Appendix Title'">
-        <head>
-          <xsl:apply-templates/>
-        </head>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Screen'">
-        <Screen>
-          <xsl:apply-templates/>
-        </Screen>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Output'">
-        <Output>
-          <xsl:apply-templates/>
-        </Output>
-      </xsl:when>
+			<xsl:when test="@text:style-name='Document Title'">
+				<title>
+					<xsl:apply-templates />
+				</title>
+			</xsl:when>
 
-      <xsl:otherwise>
-        <p>
-          <xsl:variable name="stylename"><xsl:value-of select="@text:style-name"></xsl:value-of></xsl:variable>
-          <xsl:choose>
-            <xsl:when test="matches($stylename,'P[0-9]+')">
-              <xsl:attribute name="rend" select="//style:style[@style:name=$stylename]/@style:parent-style-name"></xsl:attribute>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:attribute name="rend" select="@text:style-name"></xsl:attribute>
-            </xsl:otherwise>
-          </xsl:choose> 
-          <!-- <xsl:attribute name="rend" select="@text:style-name"/> -->
-	<xsl:apply-templates/>
-<!--      <xsl:call-template name="applyStyle"/>-->
-        </p>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			<xsl:when test="@text:style-name='Author'">
+				<author>
+					<xsl:apply-templates />
+				</author>
+			</xsl:when>
 
-  <xsl:template match="office:annotation/text:p" priority="100">
-    <note>
-        <xsl:apply-templates/>
-    </note>
-  </xsl:template>
+			<xsl:when test="@text:style-name='lg'">
+				<lg>
+					<xsl:for-each-group select="node()"
+						group-ending-with="text:line-break">
+						<l>
+							<xsl:apply-templates select="current-group()" />
+						</l>
+					</xsl:for-each-group>
+				</lg>
+			</xsl:when>
+			<xsl:when test="@text:style-name='Title'">
+				<title>
+					<xsl:apply-templates />
+				</title>
+			</xsl:when>
+			<xsl:when test="@text:style-name='Date'">
+				<date>
+					<xsl:apply-templates />
+				</date>
+			</xsl:when>
+			<xsl:when test="@text:style-name='Section Title'">
+				<head>
+					<xsl:apply-templates />
+				</head>
+			</xsl:when>
+			<xsl:when test="@text:style-name='Appendix Title'">
+				<head>
+					<xsl:apply-templates />
+				</head>
+			</xsl:when>
+			<xsl:when test="@text:style-name='Screen'">
+				<Screen>
+					<xsl:apply-templates />
+				</Screen>
+			</xsl:when>
+			<xsl:when test="@text:style-name='Output'">
+				<Output>
+					<xsl:apply-templates />
+				</Output>
+			</xsl:when>
 
+			<xsl:otherwise>
+				<p>
+					<xsl:variable name="stylename">
+						<xsl:value-of select="@text:style-name"></xsl:value-of>
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="matches($stylename,'P[0-9]+')">
+							<xsl:attribute name="rend"
+								select="//style:style[@style:name=$stylename]/@style:parent-style-name"></xsl:attribute>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:attribute name="rend"
+								select="@text:style-name"></xsl:attribute>
+						</xsl:otherwise>
+					</xsl:choose>
+					<!-- <xsl:attribute name="rend" select="@text:style-name"/> -->
+					<xsl:apply-templates />
+					<!-- <xsl:call-template name="applyStyle"/> -->
+				</p>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- normal paragraphs -->
-  <xsl:template match="text:p">
-    <xsl:choose>
-      <xsl:when test="parent::text:list-item">
-	<xsl:call-template name="applyStyle"/>
-      </xsl:when>
-      <xsl:when test="parent::table:table-cell">
-        <xsl:call-template name="applyStyle"/>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Table'"/>
-      <xsl:when test="text:span[@text:style-name = 'XrefLabel']"/>
-      <xsl:when test="@text:style-name='Speech'">
-        <sp>
-          <speaker/>
-          <p>
-            <xsl:call-template name="id.attribute"/>
-            <xsl:call-template name="applyStyle"/>
-          </p>
-        </sp>
-      </xsl:when>
-      <xsl:otherwise>
-        <p>
-          <xsl:call-template name="id.attribute"/>
-          <xsl:call-template name="applyStyle"/>
-        </p>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="office:annotation/text:p"
+		priority="100">
+		<note>
+			<xsl:apply-templates />
+		</note>
+	</xsl:template>
 
-  <!-- lists -->
-  <xsl:template match="text:list">
-    <xsl:variable name="style">
-      <xsl:for-each select="key('LISTS',@text:style-name)[1]">
-	<xsl:value-of select="@text:style-name"/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="text:list-item/text:h">
-	<xsl:for-each select="text:list-item">
-	  <xsl:apply-templates/>
-	</xsl:for-each>
-      </xsl:when>
-      <xsl:when test="@text:style-name='Var List'">
-        <list>
-          <xsl:apply-templates/>
-        </list>
-      </xsl:when>
-      <xsl:when test="contains($style,'Number')">
-        <list type="ordered">
-          <xsl:apply-templates/>
-        </list>
-      </xsl:when>
-      <xsl:otherwise>
-        <list type="unordered">
-          <xsl:apply-templates/>
-        </list>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
-  <xsl:template match="text:list-header">
-    <head>
-      <xsl:apply-templates/>
-    </head>
-  </xsl:template>
+	<!-- normal paragraphs -->
+	<xsl:template match="text:p">
+		<xsl:choose>
+			<xsl:when test="parent::text:list-item">
+				<xsl:call-template name="applyStyle" />
+			</xsl:when>
+			<xsl:when test="parent::table:table-cell">
+				<xsl:call-template name="applyStyle" />
+			</xsl:when>
+			<xsl:when test="@text:style-name='Table'" />
+			<xsl:when test="text:span[@text:style-name = 'XrefLabel']" />
+			<xsl:when test="@text:style-name='Speech'">
+				<sp>
+					<speaker />
+					<p>
+						<xsl:call-template name="id.attribute" />
+						<xsl:call-template name="applyStyle" />
+					</p>
+				</sp>
+			</xsl:when>
+			<xsl:otherwise>
+				<p>
+					<xsl:call-template name="id.attribute" />
+					<xsl:call-template name="applyStyle" />
+				</p>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="text:list-item">
-    <xsl:choose>
-      <xsl:when test="parent::text:list/@text:style-name='Var List'">
-        <item>
-          <xsl:for-each select="text:p[@text:style-name='VarList Term']">
-            <xsl:apply-templates select="."/>
-          </xsl:for-each>
-        </item>
-      </xsl:when>
-      <xsl:otherwise>
-        <item>
-	  <xsl:apply-templates/>
-	</item>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<!-- lists -->
+	<xsl:template match="text:list">
+		<xsl:variable name="style">
+			<xsl:for-each select="key('LISTS',@text:style-name)[1]">
+				<xsl:value-of select="@text:style-name" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="text:list-item/text:h">
+				<xsl:for-each select="text:list-item">
+					<xsl:apply-templates />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="@text:style-name='Var List'">
+				<list>
+					<xsl:apply-templates />
+				</list>
+			</xsl:when>
+			<xsl:when test="contains($style,'Number')">
+				<list type="ordered">
+					<xsl:apply-templates />
+				</list>
+			</xsl:when>
+			<xsl:otherwise>
+				<list type="unordered">
+					<xsl:apply-templates />
+				</list>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
+	<xsl:template match="text:list-header">
+		<head>
+			<xsl:apply-templates />
+		</head>
+	</xsl:template>
 
-  <xsl:template
-    match="text:p[@text:style-name='VarList Item' or
+	<xsl:template match="text:list-item">
+		<xsl:choose>
+			<xsl:when
+				test="parent::text:list/@text:style-name='Var List'">
+				<item>
+					<xsl:for-each
+						select="text:p[@text:style-name='VarList Term']">
+						<xsl:apply-templates select="." />
+					</xsl:for-each>
+				</item>
+			</xsl:when>
+			<xsl:otherwise>
+				<item>
+					<xsl:apply-templates />
+				</item>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<xsl:template
+		match="text:p[@text:style-name='VarList Item' or
 	   @text:style-name='List Contents']">
-    <GLOSS n="item">
-      <xsl:apply-templates/>
-    </GLOSS>
-  </xsl:template>
+		<GLOSS n="item">
+			<xsl:apply-templates />
+		</GLOSS>
+	</xsl:template>
 
-  <xsl:template
-    match="text:p[@text:style-name='VarList Term' or @text:style-name='List Heading']">
-    <GLOSS n="label"> 
-      <xsl:apply-templates/>
-    </GLOSS>
-  </xsl:template>
+	<xsl:template
+		match="text:p[@text:style-name='VarList Term' or @text:style-name='List Heading']">
+		<GLOSS n="label">
+			<xsl:apply-templates />
+		</GLOSS>
+	</xsl:template>
 
-  <!-- inline -->
+	<!-- inline -->
 
-  <xsl:template match="text:span">
-    <xsl:variable name="Style">
-      <xsl:value-of select="@text:style-name"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$Style='Emphasis'">
-        <emph>
-          <xsl:apply-templates/>
-        </emph>
-      </xsl:when>
-      <xsl:when test="$Style='Underline'">
-        <hi rend="ul">
-          <xsl:apply-templates/>
-        </hi>
-      </xsl:when>
-      <xsl:when test="$Style='SmallCaps'">
-        <hi rend="sc">
-          <xsl:apply-templates/>
-        </hi>
-      </xsl:when>
-      <xsl:when test="$Style='Emphasis Bold'">
-        <hi rend="bold">
-          <xsl:apply-templates/>
-        </hi>
-      </xsl:when>
-      <xsl:when test="$Style='Highlight'">
-        <hi>
-          <xsl:apply-templates/>
-        </hi>
-      </xsl:when>
-      <xsl:when test="$Style='q'">
-        <q>
-          <xsl:choose>
-            <xsl:when test="starts-with(.,'&#x2018;')">
-              <xsl:value-of
-                select="substring-before(substring-after(.,'&#x2018;'),'&#x2019;')"
-              />
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:apply-templates/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </q>
-      </xsl:when>
-      <xsl:when test="$Style='date'">
-        <date>
-          <xsl:apply-templates/>
-        </date>
-      </xsl:when>
-      <xsl:when test="$Style='l'">
-        <l>
-          <xsl:apply-templates/>
-        </l>
-      </xsl:when>
-      <xsl:when test="$Style='Filespec'">
-        <Filespec>
-          <xsl:apply-templates/>
-        </Filespec>
-      </xsl:when>
-      <xsl:when test="$Style='gi'">
-        <gi>
-          <xsl:apply-templates/>
-        </gi>
-      </xsl:when>
-      <xsl:when test="$Style='Code'">
-        <Code>
-          <xsl:apply-templates/>
-        </Code>
-      </xsl:when>
-      <xsl:when test="$Style='Input'">
-        <Input>
-          <xsl:apply-templates/>
-        </Input>
-      </xsl:when>
-      <xsl:when test="$Style='Internet Link'">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:when test="$Style='SubScript'">
-	<hi rend="sub">
-	  <xsl:apply-templates/>
-        </hi>
-      </xsl:when>
-      <xsl:when test="$Style='SuperScript'">
-        <hi rend="sup">
-	  <xsl:apply-templates/>
-        </hi>
-      </xsl:when>
-      <xsl:when test="style:text-properties[@fo:text-transform='small-caps']">
-	<hi rend="sc">
-	  <xsl:apply-templates/>
-	</hi>
-      </xsl:when>
-      <xsl:when test="../text:h">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="applyStyle"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="text:span">
+		<xsl:variable name="Style">
+			<xsl:value-of select="@text:style-name" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$Style='Emphasis'">
+				<emph>
+					<xsl:apply-templates />
+				</emph>
+			</xsl:when>
+			<xsl:when test="$Style='Underline'">
+				<hi rend="ul">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when test="$Style='SmallCaps'">
+				<hi rend="sc">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when test="$Style='Emphasis Bold'">
+				<hi rend="bold">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when test="$Style='Highlight'">
+				<hi>
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when test="$Style='q'">
+				<q>
+					<xsl:choose>
+						<xsl:when test="starts-with(.,'&#x2018;')">
+							<xsl:value-of
+								select="substring-before(substring-after(.,'&#x2018;'),'&#x2019;')" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates />
+						</xsl:otherwise>
+					</xsl:choose>
+				</q>
+			</xsl:when>
+			<xsl:when test="$Style='date'">
+				<date>
+					<xsl:apply-templates />
+				</date>
+			</xsl:when>
+			<xsl:when test="$Style='l'">
+				<l>
+					<xsl:apply-templates />
+				</l>
+			</xsl:when>
+			<xsl:when test="$Style='Filespec'">
+				<Filespec>
+					<xsl:apply-templates />
+				</Filespec>
+			</xsl:when>
+			<xsl:when test="$Style='gi'">
+				<gi>
+					<xsl:apply-templates />
+				</gi>
+			</xsl:when>
+			<xsl:when test="$Style='Code'">
+				<Code>
+					<xsl:apply-templates />
+				</Code>
+			</xsl:when>
+			<xsl:when test="$Style='Input'">
+				<Input>
+					<xsl:apply-templates />
+				</Input>
+			</xsl:when>
+			<xsl:when test="$Style='Internet Link'">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="$Style='SubScript'">
+				<hi rend="sub">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when test="$Style='SuperScript'">
+				<hi rend="sup">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when
+				test="style:text-properties[@fo:text-transform='small-caps']">
+				<hi rend="sc">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:when test="../text:h">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="applyStyle" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="applyStyle">
-    <xsl:variable name="name">
-      <xsl:value-of select="@text:style-name"/>
-    </xsl:variable>
+	<xsl:template name="applyStyle">
+		<xsl:variable name="name">
+			<xsl:value-of select="@text:style-name" />
+		</xsl:variable>
 
-    <xsl:choose>
-      <xsl:when test="string-length(.)=0"/>
-      <xsl:when test="text:note">
-	<xsl:apply-templates/>
-      </xsl:when>
-      <xsl:when test="key('STYLES',$name)">
-        <xsl:variable name="contents">
-          <xsl:apply-templates/>
-        </xsl:variable>
-        <xsl:for-each select="key('STYLES',$name)">
+		<xsl:choose>
+			<xsl:when test="string-length(.)=0" />
+			<xsl:when test="text:note">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="key('STYLES',$name)">
+				<xsl:variable name="contents">
+					<xsl:apply-templates />
+				</xsl:variable>
+				<xsl:for-each select="key('STYLES',$name)">
 
-	  <!--! <xsl:for-each select="style:text-properties/@*">
-	      <xsl:value-of select="name(.)"/>:        <xsl:value-of select="."/>&#10;
-	      </xsl:for-each>
-	  -->
-	  <xsl:variable name="divrendstring">
-	    <xsl:if
-		test="style:paragraph-properties/@fo:text-align">
-	      <xsl:value-of
-		  select="style:paragraph-properties/@fo:text-align"/>
-	      <xsl:text> </xsl:text>
-	    </xsl:if>
-	  </xsl:variable>
+					<!--! <xsl:for-each select="style:text-properties/@*"> <xsl:value-of 
+						select="name(.)"/>: <xsl:value-of select="."/>&#10; </xsl:for-each> -->
+					<xsl:variable name="divrendstring">
+						<xsl:if test="style:paragraph-properties/@fo:text-align">
+							<xsl:value-of
+								select="style:paragraph-properties/@fo:text-align" />
+							<xsl:text> </xsl:text>
+						</xsl:if>
+					</xsl:variable>
 
-	  <xsl:variable name="rendstring">
-	    <xsl:if
-		test="style:text-properties[starts-with(@style:text-position,'super')]">
-	      <xsl:text>sup </xsl:text>
-	    </xsl:if>
-	    
-	    <xsl:if
-		test="style:text-properties[starts-with(@style:text-position,'sub')]">
-	      <xsl:text>sub </xsl:text>
-	    </xsl:if>
-	    
-	    <xsl:if test="style:text-properties[@fo:font-weight='bold']">
-	      <xsl:text>bold </xsl:text>
-	    </xsl:if>
-	    
-	    <xsl:if
-		test="style:text-properties[@style:text-underline-type='double']">
-	      <xsl:text>underdoubleline </xsl:text>
-	    </xsl:if>
-	    
-	    <xsl:if
-		test="style:text-properties[@style:text-underline-style='solid']">
-	      <xsl:text>underline </xsl:text>
-	    </xsl:if>
-	    
-	    <xsl:if
-		test="style:text-properties[@style:text-line-through-style='solid']">
-	      <xsl:text>strikethrough </xsl:text>
-	    </xsl:if>
-	    
-	    <xsl:if
-		test="style:text-properties[@fo:font-variant='small-caps']">
-	      <xsl:text>smallcaps </xsl:text>
-	    </xsl:if>
-	    
-	    <xsl:if test="style:text-properties[@fo:font-style='italic']">
-	      <xsl:text>italic </xsl:text>
-	    </xsl:if>
-	  </xsl:variable>
+					<xsl:variable name="rendstring">
+						<xsl:if
+							test="style:text-properties[starts-with(@style:text-position,'super')]">
+							<xsl:text>sup </xsl:text>
+						</xsl:if>
 
-	  <!--<xsl:message>so: <xsl:value-of select="$divrendstring"/></xsl:message>
-	  <xsl:if test="not($divrendstring='')">
-	      <xsl:attribute name="rend" select="normalize-space($divrendstring)"/>
-	  </xsl:if>-->
+						<xsl:if
+							test="style:text-properties[starts-with(@style:text-position,'sub')]">
+							<xsl:text>sub </xsl:text>
+						</xsl:if>
 
-	  <xsl:choose>
-	    <xsl:when test="$rendstring=''">
-	      <xsl:copy-of select="$contents"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <hi rend="{normalize-space($rendstring)}">
-		<xsl:copy-of select="$contents"/>
-	      </hi>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	  
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+						<xsl:if
+							test="style:text-properties[@fo:font-weight='bold']">
+							<xsl:text>bold </xsl:text>
+						</xsl:if>
 
-  <!-- tables -->
-  <xsl:template match="table:table">
-    <table rend="frame">
-      <xsl:if test="@table:name and not(@table:name = 'local-table')">
-        <xsl:attribute name="xml:id">
-          <xsl:value-of select="@table:name"/>
+						<xsl:if
+							test="style:text-properties[@style:text-underline-type='double']">
+							<xsl:text>underdoubleline </xsl:text>
+						</xsl:if>
+
+						<xsl:if
+							test="style:text-properties[@style:text-underline-style='solid']">
+							<xsl:text>underline </xsl:text>
+						</xsl:if>
+
+						<xsl:if
+							test="style:text-properties[@style:text-line-through-style='solid']">
+							<xsl:text>strikethrough </xsl:text>
+						</xsl:if>
+
+						<xsl:if
+							test="style:text-properties[@fo:font-variant='small-caps']">
+							<xsl:text>smallcaps </xsl:text>
+						</xsl:if>
+
+						<xsl:if
+							test="style:text-properties[@fo:font-style='italic']">
+							<xsl:text>italic </xsl:text>
+						</xsl:if>
+					</xsl:variable>
+
+					<!--<xsl:message>so: <xsl:value-of select="$divrendstring"/></xsl:message> 
+						<xsl:if test="not($divrendstring='')"> <xsl:attribute name="rend" select="normalize-space($divrendstring)"/> 
+						</xsl:if> -->
+
+					<xsl:choose>
+						<xsl:when test="$rendstring=''">
+							<xsl:copy-of select="$contents" />
+						</xsl:when>
+						<xsl:otherwise>
+							<hi rend="{normalize-space($rendstring)}">
+								<xsl:copy-of select="$contents" />
+							</hi>
+						</xsl:otherwise>
+					</xsl:choose>
+
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<!-- tables -->
+	<xsl:template match="table:table">
+		<table rend="frame">
+			<xsl:if
+				test="@table:name and not(@table:name = 'local-table')">
+				<xsl:attribute name="xml:id">
+          <xsl:value-of select="@table:name" />
         </xsl:attribute>
-      </xsl:if>
-      <xsl:if test="following-sibling::text:p[@text:style-name='Table']">
-        <head>
-          <xsl:value-of
-            select="following-sibling::text:p[@text:style-name='Table']"/>
-        </head>
-      </xsl:if>
-      <xsl:call-template name="generictable"/>
-    </table>
+			</xsl:if>
+			<xsl:if
+				test="following-sibling::text:p[@text:style-name='Table']">
+				<head>
+					<xsl:value-of
+						select="following-sibling::text:p[@text:style-name='Table']" />
+				</head>
+			</xsl:if>
+			<xsl:call-template name="generictable" />
+		</table>
 
-  </xsl:template>
+	</xsl:template>
 
 
-  <xsl:template name="generictable">
-    <xsl:variable name="cells" select="count(descendant::table:table-cell)"/>
-    <xsl:variable name="rows">
-      <xsl:value-of select="count(descendant::table:table-row) "/>
-    </xsl:variable>
-    <xsl:variable name="cols">
-      <xsl:value-of select="$cells div $rows"/>
-    </xsl:variable>
-    <xsl:variable name="numcols">
-      <xsl:choose>
-        <xsl:when
-          test="child::table:table-column/@table:number-columns-repeated">
-          <xsl:value-of
-            select="number(table:table-column/@table:number-columns-repeated+1)"
-          />
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$cols"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
+	<xsl:template name="generictable">
+		<xsl:variable name="cells"
+			select="count(descendant::table:table-cell)" />
+		<xsl:variable name="rows">
+			<xsl:value-of
+				select="count(descendant::table:table-row) " />
+		</xsl:variable>
+		<xsl:variable name="cols">
+			<xsl:value-of select="$cells div $rows" />
+		</xsl:variable>
+		<xsl:variable name="numcols">
+			<xsl:choose>
+				<xsl:when
+					test="child::table:table-column/@table:number-columns-repeated">
+					<xsl:value-of
+						select="number(table:table-column/@table:number-columns-repeated+1)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$cols" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-    <xsl:apply-templates/>
-  </xsl:template>
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template name="colspec">
-    <xsl:param name="left"/>
-    <xsl:if
-      test="number($left &lt; ( table:table-column/@table:number-columns-repeated +2)  )">
-      <colspec>
-        <xsl:attribute name="colnum">
-          <xsl:value-of select="$left"/>
+	<xsl:template name="colspec">
+		<xsl:param name="left" />
+		<xsl:if
+			test="number($left &lt; ( table:table-column/@table:number-columns-repeated +2)  )">
+			<colspec>
+				<xsl:attribute name="colnum">
+          <xsl:value-of select="$left" />
         </xsl:attribute>
-        <xsl:attribute name="colname">
+				<xsl:attribute name="colname">
           <xsl:text>c</xsl:text>
-          <xsl:value-of select="$left"/>
+          <xsl:value-of select="$left" />
         </xsl:attribute>
-      </colspec>
-      <xsl:call-template name="colspec">
-        <xsl:with-param name="left" select="$left+1"/>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:template>
+			</colspec>
+			<xsl:call-template name="colspec">
+				<xsl:with-param name="left" select="$left+1" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="table:table-column">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="table:table-column">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="table:table-header-rows">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="table:table-header-rows">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="table:table-header-rows/table:table-row">
-    <row role="label">
-      <xsl:apply-templates/>
-    </row>
-  </xsl:template>
+	<xsl:template
+		match="table:table-header-rows/table:table-row">
+		<row role="label">
+			<xsl:apply-templates />
+		</row>
+	</xsl:template>
 
-  <xsl:template match="table:table/table:table-row">
-    <row>
-      <xsl:apply-templates/>
-    </row>
-  </xsl:template>
+	<xsl:template match="table:table/table:table-row">
+		<row>
+			<xsl:apply-templates />
+		</row>
+	</xsl:template>
 
-  <xsl:template match="table:table-cell/text:h">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="table:table-cell/text:h">
+		<xsl:apply-templates />
+	</xsl:template>
 
 
-  <xsl:template match="table:table-cell">
-    <cell>
-      <xsl:if test="@table:number-columns-spanned &gt;'1'">
-        <xsl:attribute name="cols">
-          <xsl:value-of select="@table:number-columns-spanned"/>
+	<xsl:template match="table:table-cell">
+		<cell>
+			<xsl:if test="@table:number-columns-spanned &gt;'1'">
+				<xsl:attribute name="cols">
+          <xsl:value-of
+					select="@table:number-columns-spanned" />
         </xsl:attribute>
-      </xsl:if>
-      <xsl:if test="@table:number-rows-spanned &gt;'1'">
-        <xsl:attribute name="rows">
-          <xsl:value-of select="@table:number-rows-spanned"/>
+			</xsl:if>
+			<xsl:if test="@table:number-rows-spanned &gt;'1'">
+				<xsl:attribute name="rows">
+          <xsl:value-of
+					select="@table:number-rows-spanned" />
         </xsl:attribute>
-      </xsl:if>
-      <xsl:if test="text:h">
-        <xsl:attribute name="role">label</xsl:attribute>
-      </xsl:if>
-      <xsl:apply-templates/>
-    </cell>
-  </xsl:template>
+			</xsl:if>
+			<xsl:if test="text:h">
+				<xsl:attribute name="role">label</xsl:attribute>
+			</xsl:if>
+			<xsl:apply-templates />
+		</cell>
+	</xsl:template>
 
 
-  <!-- notes -->
-  <xsl:template match="text:note-citation"/>
+	<!-- notes -->
+	<xsl:template match="text:note-citation" />
 
-  <xsl:template match="text:note-body">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="text:note-body">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="text:note-ref">
-    <ref target="#{@text:ref-name}">
-      <xsl:apply-templates/>
-    </ref>
-  </xsl:template>
+	<xsl:template match="text:note-ref">
+		<ref target="#{@text:ref-name}">
+			<xsl:apply-templates />
+		</ref>
+	</xsl:template>
 
-  <xsl:template match="text:note">
-    <note>
-      <xsl:if test="@text:id">
-	<xsl:attribute name="xml:id">
-	  <xsl:value-of select="@text:id"/>
+	<xsl:template match="text:note">
+		<note>
+			<xsl:if test="@text:id">
+				<xsl:attribute name="xml:id">
+	  <xsl:value-of select="@text:id" />
 	</xsl:attribute>
-      </xsl:if>
-      <xsl:choose>
-        <xsl:when test="@text:note-class='endnote'">
-          <xsl:attribute name="place">end</xsl:attribute>
-        </xsl:when>
-        <xsl:when test="@text:note-class='footnote'">
-          <xsl:attribute name="place">foot</xsl:attribute>
-        </xsl:when>
-      </xsl:choose>
-      <xsl:if test="text:note-citation">
-	<xsl:attribute name="n">
-	  <xsl:value-of select="text:note-citation"/>
+			</xsl:if>
+			<xsl:choose>
+				<xsl:when test="@text:note-class='endnote'">
+					<xsl:attribute name="place">end</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="@text:note-class='footnote'">
+					<xsl:attribute name="place">foot</xsl:attribute>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:if test="text:note-citation">
+				<xsl:attribute name="n">
+	  <xsl:value-of select="text:note-citation" />
 	</xsl:attribute>
-      </xsl:if>
-      <xsl:apply-templates/>
-    </note>
-  </xsl:template>
+			</xsl:if>
+			<xsl:apply-templates />
+		</note>
+	</xsl:template>
 
-  <!-- drawing -->
-  <xsl:template match="draw:plugin">
-    <ptr target="{@xlink:href}"/>
-  </xsl:template>
+	<!-- drawing -->
+	<xsl:template match="draw:plugin">
+		<ptr target="{@xlink:href}" />
+	</xsl:template>
 
-  <xsl:template match="draw:text-box">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="draw:text-box">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="draw:frame">
-    <xsl:choose>
-      <xsl:when test="ancestor::draw:frame">
-	<xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-	<figure>
-	  <xsl:apply-templates/>
-	</figure>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="draw:frame">
+		<xsl:choose>
+			<xsl:when test="ancestor::draw:frame">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<figure>
+					<xsl:apply-templates />
+				</figure>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="draw:image">
-    <xsl:choose>
-      <xsl:when test="ancestor::draw:text-box">
-	<xsl:call-template name="findGraphic"/>
-      </xsl:when>
-      <xsl:when test="ancestor::draw:frame">
-	<xsl:call-template name="findGraphic"/>
-      </xsl:when>
-      <xsl:when test="parent::text:p[@text:style-name='Mediaobject']">
-        <figure>
-          <xsl:call-template name="findGraphic"/>
-          <head>
-            <xsl:value-of select="."/>
-          </head>
-        </figure>
-      </xsl:when>
-      <xsl:otherwise>
-        <figure>
-          <xsl:call-template name="findGraphic"/>
-        </figure>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="draw:image">
+		<xsl:choose>
+			<xsl:when test="ancestor::draw:text-box">
+				<xsl:call-template name="findGraphic" />
+			</xsl:when>
+			<xsl:when test="ancestor::draw:frame">
+				<xsl:call-template name="findGraphic" />
+			</xsl:when>
+			<xsl:when
+				test="parent::text:p[@text:style-name='Mediaobject']">
+				<figure>
+					<xsl:call-template name="findGraphic" />
+					<head>
+						<xsl:value-of select="." />
+					</head>
+				</figure>
+			</xsl:when>
+			<xsl:otherwise>
+				<figure>
+					<xsl:call-template name="findGraphic" />
+				</figure>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="findGraphic">
-    <xsl:choose>
-      <xsl:when test="office:binary-data">
-	<xsl:apply-templates/>
-      </xsl:when>
-      <xsl:when test="@xlink:href">
-        <graphic>
-          <xsl:attribute name="url">
-            <xsl:value-of select="@xlink:href"/>
+	<xsl:template name="findGraphic">
+		<xsl:choose>
+			<xsl:when test="office:binary-data">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@xlink:href">
+				<graphic>
+					<xsl:attribute name="url">
+            <xsl:value-of select="@xlink:href" />
           </xsl:attribute>
-        </graphic>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+				</graphic>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="office:binary-data">    
-    <binaryObject mimeType="image/jpg">
-      <xsl:value-of select="."/>
-    </binaryObject>
-  </xsl:template>
+	<xsl:template match="office:binary-data">
+		<binaryObject mimeType="image/jpg">
+			<xsl:value-of select="." />
+		</binaryObject>
+	</xsl:template>
 
 
-  <!-- linking -->
-  <xsl:template match="text:a">
-    <xsl:choose>
-      <xsl:when test="starts-with(@xlink:href,'mailto:')">
-        <xsl:choose>
-          <xsl:when test=".=@xlink:href">
-            <ptr target="{substring-after(@xlink:href,'mailto:')}"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <ref target="{@xlink:href}">
-              <xsl:apply-templates/>
-            </ref>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="contains(@xlink:href,'://')">
-        <xsl:choose>
-          <xsl:when test=".=@xlink:href">
-            <ptr target="{@xlink:href}"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <ref target="{@xlink:href}">
-              <xsl:apply-templates/>
-            </ref>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="not(contains(@xlink:href,'#'))">
-        <ref target="{@xlink:href}">
-          <xsl:apply-templates/>
-        </ref>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="linkvar" select="@xlink:href"/>
-        <xsl:choose>
-          <xsl:when test=".=$linkvar">
-            <ptr target="{$linkvar}"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <ref target="{$linkvar}">
-              <xsl:apply-templates/>
-            </ref>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<!-- linking -->
+	<xsl:template match="text:a">
+		<xsl:choose>
+			<xsl:when test="starts-with(@xlink:href,'mailto:')">
+				<xsl:choose>
+					<xsl:when test=".=@xlink:href">
+						<ptr target="{substring-after(@xlink:href,'mailto:')}" />
+					</xsl:when>
+					<xsl:otherwise>
+						<ref target="{@xlink:href}">
+							<xsl:apply-templates />
+						</ref>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="contains(@xlink:href,'://')">
+				<xsl:choose>
+					<xsl:when test=".=@xlink:href">
+						<ptr target="{@xlink:href}" />
+					</xsl:when>
+					<xsl:otherwise>
+						<ref target="{@xlink:href}">
+							<xsl:apply-templates />
+						</ref>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="not(contains(@xlink:href,'#'))">
+				<ref target="{@xlink:href}">
+					<xsl:apply-templates />
+				</ref>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="linkvar" select="@xlink:href" />
+				<xsl:choose>
+					<xsl:when test=".=$linkvar">
+						<ptr target="{$linkvar}" />
+					</xsl:when>
+					<xsl:otherwise>
+						<ref target="{$linkvar}">
+							<xsl:apply-templates />
+						</ref>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="text:line-break">
-    <xsl:choose>
-      <xsl:when test="parent::text:span[@text:style-name='l']"/>
-      <xsl:when test="parent::text:p[@text:style-name='lg']"/>
-      <xsl:otherwise>
-	<lb/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="text:line-break">
+		<xsl:choose>
+			<xsl:when test="parent::text:span[@text:style-name='l']" />
+			<xsl:when test="parent::text:p[@text:style-name='lg']" />
+			<xsl:otherwise>
+				<lb />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template match="text:tab">
-    <xsl:text>	</xsl:text>
-  </xsl:template>
+	<xsl:template match="text:tab">
+		<xsl:text>	</xsl:text>
+	</xsl:template>
 
-  <xsl:template match="text:reference-ref">
-    <ptr target="#id_{@text:ref-name}"/>
-  </xsl:template>
+	<xsl:template match="text:reference-ref">
+		<ptr target="#id_{@text:ref-name}" />
+	</xsl:template>
 
-  <xsl:template name="id.attribute.literal">
-    <xsl:if test="child::text:reference-mark-start">
-      <xsl:text> xml:id=&quot;</xsl:text>
-	<xsl:text>id_</xsl:text>
-        <xsl:value-of select="child::text:reference-mark-start/@text:style-name"
-        />
-	<xsl:text>&quot;</xsl:text>
-    </xsl:if>
-  </xsl:template>
+	<xsl:template name="id.attribute.literal">
+		<xsl:if test="child::text:reference-mark-start">
+			<xsl:text> xml:id=&quot;</xsl:text>
+			<xsl:text>id_</xsl:text>
+			<xsl:value-of
+				select="child::text:reference-mark-start/@text:style-name" />
+			<xsl:text>&quot;</xsl:text>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template name="id.attribute">
-    <xsl:if test="child::text:reference-mark-start">
-      <xsl:attribute name="xml:id">
+	<xsl:template name="id.attribute">
+		<xsl:if test="child::text:reference-mark-start">
+			<xsl:attribute name="xml:id">
 	<xsl:text>id_</xsl:text>
-        <xsl:value-of select="child::text:reference-mark-start/@text:style-name"
-        />
+        <xsl:value-of
+				select="child::text:reference-mark-start/@text:style-name" />
       </xsl:attribute>
-    </xsl:if>
-  </xsl:template>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="text:reference-mark-start"/>
+	<xsl:template match="text:reference-mark-start" />
 
-  <xsl:template match="text:reference-mark-end"/>
+	<xsl:template match="text:reference-mark-end" />
 
-  <xsl:template match="comment">
-    <xsl:comment>
-      <xsl:value-of select="."/>
-    </xsl:comment>
-  </xsl:template>
+	<xsl:template match="comment">
+		<xsl:comment>
+			<xsl:value-of select="." />
+		</xsl:comment>
+	</xsl:template>
 
-  <xsl:template match="text:user-index-mark">
-    <index indexName="{@text:index-name}">
-      <term>
-	<xsl:value-of select="@text:string-value"/>
-      </term>
-    </index>
-  </xsl:template>
+	<xsl:template match="text:user-index-mark">
+		<index indexName="{@text:index-name}">
+			<term>
+				<xsl:value-of select="@text:string-value" />
+			</term>
+		</index>
+	</xsl:template>
 
-  <xsl:template match="text:alphabetical-index-mark">
-    <xsl:if test="not(normalize-space(@text:string-value)='')">
-    <index>
-      <xsl:if test="@text:id">
-	<xsl:attribute name="xml:id">
-	  <xsl:value-of select="@text:id"/>
+	<xsl:template match="text:alphabetical-index-mark">
+		<xsl:if test="not(normalize-space(@text:string-value)='')">
+			<index>
+				<xsl:if test="@text:id">
+					<xsl:attribute name="xml:id">
+	  <xsl:value-of select="@text:id" />
 	</xsl:attribute>
-      </xsl:if>
-      <xsl:choose>
-	<xsl:when test="@text:key1">
-	  <term>
-	    <xsl:value-of select="@text:key1"/>
-	  </term>
-	  <index>
-	    <term>
-	      <xsl:value-of select="@text:string-value"/>
-	    </term>
-	  </index>
-	</xsl:when>
-	<xsl:otherwise>
-	  <term>
-	    <xsl:value-of select="@text:string-value"/>
-	  </term>
-	</xsl:otherwise>
-      </xsl:choose>
-    </index>
-    </xsl:if>
-  </xsl:template>
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="@text:key1">
+						<term>
+							<xsl:value-of select="@text:key1" />
+						</term>
+						<index>
+							<term>
+								<xsl:value-of select="@text:string-value" />
+							</term>
+						</index>
+					</xsl:when>
+					<xsl:otherwise>
+						<term>
+							<xsl:value-of select="@text:string-value" />
+						</term>
+					</xsl:otherwise>
+				</xsl:choose>
+			</index>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="text:alphabetical-index">
-    <index>
-      <xsl:apply-templates select="text:index-body"/>
-    </index>
-  </xsl:template>
+	<xsl:template match="text:alphabetical-index">
+		<index>
+			<xsl:apply-templates select="text:index-body" />
+		</index>
+	</xsl:template>
 
-  <xsl:template match="text:index-body">
-    <xsl:for-each select="text:p[@text:style-name = 'Index 1']">
-      <index>
-        <term>
-          <xsl:value-of select="."/>
-        </term>
-        <xsl:if test="key('secondary_children', generate-id())">
-          <index>
-	    <term>
-            <xsl:value-of select="key('secondary_children', generate-id())"/>
-	    </term>
-	  </index>
-        </xsl:if>
-      </index>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template match="text:index-body">
+		<xsl:for-each
+			select="text:p[@text:style-name = 'Index 1']">
+			<index>
+				<term>
+					<xsl:value-of select="." />
+				</term>
+				<xsl:if test="key('secondary_children', generate-id())">
+					<index>
+						<term>
+							<xsl:value-of
+								select="key('secondary_children', generate-id())" />
+						</term>
+					</index>
+				</xsl:if>
+			</index>
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template match="text:bookmark-ref">
-    <ref target="#id_{@text:ref-name}" type="{@text:reference-format}">
-      <xsl:apply-templates/>
-    </ref>
-  </xsl:template>
+	<xsl:template match="text:bookmark-ref">
+		<ref target="#id_{@text:ref-name}" type="{@text:reference-format}">
+			<xsl:apply-templates />
+		</ref>
+	</xsl:template>
 
-  <xsl:template match="text:bookmark-start">
-    <anchor type="bookmark-start">
-      <xsl:attribute name="xml:id">
+	<xsl:template match="text:bookmark-start">
+		<anchor type="bookmark-start">
+			<xsl:attribute name="xml:id">
 	<xsl:text>id_</xsl:text>
-	<xsl:value-of select="@text:name"/>
+	<xsl:value-of select="@text:name" />
       </xsl:attribute>
-    </anchor>
-  </xsl:template>
+		</anchor>
+	</xsl:template>
 
-  <xsl:template match="text:bookmark-end">
-    <anchor type="bookmark-end">
-      <xsl:attribute name="corresp">
+	<xsl:template match="text:bookmark-end">
+		<anchor type="bookmark-end">
+			<xsl:attribute name="corresp">
 	<xsl:text>#id_</xsl:text>
-	<xsl:value-of select="@text:name"/>
+	<xsl:value-of select="@text:name" />
       </xsl:attribute>
-    </anchor>
-  </xsl:template>
+		</anchor>
+	</xsl:template>
 
-  <xsl:template match="text:bookmark">
-    <anchor>
-      <xsl:attribute name="xml:id">
+	<xsl:template match="text:bookmark">
+		<anchor>
+			<xsl:attribute name="xml:id">
 	<xsl:text>id_</xsl:text>
-	<xsl:value-of select="@text:name"/>
+	<xsl:value-of select="@text:name" />
       </xsl:attribute>
-    </anchor>
-  </xsl:template>
-  <!--
-These seem to have no obvious translation
--->
+		</anchor>
+	</xsl:template>
+	<!-- These seem to have no obvious translation -->
 
-  <xsl:template match="text:endnotes-configuration"/>
+	<xsl:template match="text:endnotes-configuration" />
 
-  <xsl:template match="text:file-name"/>
+	<xsl:template match="text:file-name" />
 
-  <xsl:template match="text:footnotes-configuration"/>
+	<xsl:template match="text:footnotes-configuration" />
 
-  <xsl:template match="text:linenumbering-configuration"/>
+	<xsl:template match="text:linenumbering-configuration" />
 
-  <xsl:template match="text:list-level-style-bullet"/>
+	<xsl:template match="text:list-level-style-bullet" />
 
-  <xsl:template match="text:list-level-style-number"/>
+	<xsl:template match="text:list-level-style-number" />
 
-  <xsl:template match="text:list-style"/>
+	<xsl:template match="text:list-style" />
 
-  <xsl:template match="text:outline-level-style"/>
+	<xsl:template match="text:outline-level-style" />
 
-  <xsl:template match="text:outline-style"/>
+	<xsl:template match="text:outline-style" />
 
-  <xsl:template match="text:s"/>
+	<xsl:template match="text:s" />
 
-  <xsl:template match="text:editing-cycles"><xsl:value-of select="."/></xsl:template>
-  <xsl:template match="text:page-count"><xsl:value-of select="."/></xsl:template>
-  <xsl:template match="text:word-count"><xsl:value-of select="."/></xsl:template>
-  <xsl:template match="text:image-count"><xsl:value-of select="."/></xsl:template>
-  <xsl:template match="text:table-count"><xsl:value-of select="."/></xsl:template>
-  <xsl:template match="text:modification-date"><xsl:value-of select="."/></xsl:template>
-  <xsl:template match="text:modification-time"><xsl:value-of select="."/></xsl:template>
-  <xsl:template match="text:sequence-ref"><xsl:value-of select="."/></xsl:template>
+	<xsl:template match="text:editing-cycles">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="text:page-count">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="text:word-count">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="text:image-count">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="text:table-count">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="text:modification-date">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="text:modification-time">
+		<xsl:value-of select="." />
+	</xsl:template>
+	<xsl:template match="text:sequence-ref">
+		<xsl:value-of select="." />
+	</xsl:template>
 
-  <xsl:template match="text:*"> [[[UNTRANSLATED <xsl:value-of select="name(.)"/>: <xsl:apply-templates/>]]] </xsl:template>
+	<xsl:template match="text:*">
+		[[[UNTRANSLATED
+		<xsl:value-of select="name(.)" />
+		:
+		<xsl:apply-templates />
+		]]]
+	</xsl:template>
 
 
-  <!-- sections of the OO format we don't need at present -->
+	<!-- sections of the OO format we don't need at present -->
 
-  <xsl:template match="office:automatic-styles"/>
+	<xsl:template match="office:automatic-styles" />
 
-  <xsl:template match="office:font-decls"/>
+	<xsl:template match="office:font-decls" />
 
-  <xsl:template match="office:meta"/>
+	<xsl:template match="office:meta" />
 
-  <xsl:template match="office:script"/>
+	<xsl:template match="office:script" />
 
-  <xsl:template match="office:settings"/>
+	<xsl:template match="office:settings" />
 
-  <xsl:template match="office:styles"/>
+	<xsl:template match="office:styles" />
 
-  <xsl:template match="style:*"/>
+	<xsl:template match="style:*" />
 
 
-  <xsl:template match="dc:*">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="dc:*">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="meta:creation-date">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="meta:creation-date">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="meta:editing-cycles"/>
+	<xsl:template match="meta:editing-cycles" />
 
-  <xsl:template match="meta:editing-duration"/>
+	<xsl:template match="meta:editing-duration" />
 
-  <xsl:template match="meta:generator"/>
+	<xsl:template match="meta:generator" />
 
-  <xsl:template match="meta:user-defined"/>
+	<xsl:template match="meta:user-defined" />
 
-  <!--
-<xsl:template match="text()">
-  <xsl:apply-templates select="normalize-space(.)"/>
-</xsl:template>
--->
+	<!-- <xsl:template match="text()"> <xsl:apply-templates select="normalize-space(.)"/> 
+		</xsl:template> -->
 
-<xsl:template match="text:section">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="text:section">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="text:sequence-decl">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="text:sequence-decl">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="text:sequence-decls">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="text:sequence-decls">
+		<xsl:apply-templates />
+	</xsl:template>
 
 
-<xsl:template match="text:sequence">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template match="text:sequence">
+		<xsl:apply-templates />
+	</xsl:template>
 
 
-<xsl:template match="text:section-source"/>
+	<xsl:template match="text:section-source" />
 
 
-<xsl:template match="text:soft-page-break">
-	<pb/>
-</xsl:template>
+	<xsl:template match="text:soft-page-break">
+		<pb />
+	</xsl:template>
 
-<xsl:template name="stars">
-   <xsl:param name="n"/>
-   <xsl:if test="$n &gt;0">
-     <xsl:text>*</xsl:text>
-     <xsl:call-template name="stars">
-       <xsl:with-param name="n">
-	 <xsl:value-of select="$n - 1"/>
-       </xsl:with-param>
-     </xsl:call-template>
-   </xsl:if>
-</xsl:template>
+	<xsl:template name="stars">
+		<xsl:param name="n" />
+		<xsl:if test="$n &gt;0">
+			<xsl:text>*</xsl:text>
+			<xsl:call-template name="stars">
+				<xsl:with-param name="n">
+					<xsl:value-of select="$n - 1" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-<xsl:template match="text:change|text:changed-region|text:change-end|text:change-start">
-  <xsl:apply-templates/>
-</xsl:template>
+	<xsl:template
+		match="text:change|text:changed-region|text:change-end|text:change-start">
+		<xsl:apply-templates />
+	</xsl:template>
 
-<xsl:template match="text:table-of-content"/>
-<xsl:template match="text:index-entry-chapter"/>
-<xsl:template match="text:index-entry-page-number"/>
-<xsl:template match="text:index-entry-tab-stop"/>
-<xsl:template match="text:index-entry-text"/>
-<xsl:template match="text:index-title-template"/>
-<xsl:template match="text:table-of-content-entry-template"/>
-<xsl:template match="text:table-of-content-source"/>
+	<xsl:template match="text:table-of-content" />
+	<xsl:template match="text:index-entry-chapter" />
+	<xsl:template match="text:index-entry-page-number" />
+	<xsl:template match="text:index-entry-tab-stop" />
+	<xsl:template match="text:index-entry-text" />
+	<xsl:template match="text:index-title-template" />
+	<xsl:template match="text:table-of-content-entry-template" />
+	<xsl:template match="text:table-of-content-source" />
 
-  <xsl:template match="office:text">
-    <body>
-      <xsl:variable name="Body">
-	<HEAD level="1" magic="true">Start</HEAD>
-        <xsl:apply-templates/>
-      </xsl:variable>
-      <!-- debug
-      <xsl:result-document href="/tmp/temp.xml">
-	<xsl:copy-of select="$Body"/>
-      </xsl:result-document>
-      -->
-      <xsl:variable name="Body2">
-	<xsl:for-each select="$Body">
-	  <xsl:apply-templates mode="pass1"/>
-	</xsl:for-each>
-      </xsl:variable>
-      <xsl:for-each select="$Body2">
-        <xsl:for-each-group select="tei:*" group-starting-with="tei:HEAD[@level='1']">
-          <xsl:choose>
-            <xsl:when test="self::tei:HEAD[@level='1']">
-	      <xsl:call-template name="group-by-section"/>
-            </xsl:when>
-            <xsl:otherwise>
-	      <xsl:call-template name="inSection"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each-group>
-      </xsl:for-each>
-    </body>
-  </xsl:template>
+	<xsl:template match="office:text">
+		<body>
+			<xsl:variable name="Body">
+				<HEAD level="1" magic="true">Start</HEAD>
+				<xsl:apply-templates />
+			</xsl:variable>
+			<!-- debug <xsl:result-document href="/tmp/temp.xml"> <xsl:copy-of select="$Body"/> 
+				</xsl:result-document> -->
+			<xsl:variable name="Body2">
+				<xsl:for-each select="$Body">
+					<xsl:apply-templates mode="pass1" />
+				</xsl:for-each>
+			</xsl:variable>
+			<xsl:for-each select="$Body2">
+				<xsl:for-each-group select="tei:*"
+					group-starting-with="tei:HEAD[@level='1']">
+					<xsl:choose>
+						<xsl:when test="self::tei:HEAD[@level='1']">
+							<xsl:call-template name="group-by-section" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template name="inSection" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each-group>
+			</xsl:for-each>
+		</body>
+	</xsl:template>
 
-  <xsl:template name="group-by-section">
-    <xsl:variable name="ThisHeader" select="number(@level)"/>
-    <xsl:variable name="NextHeader" select="number(@level)+1"/>
-    <xsl:choose>
-      <xsl:when test="@magic">
-	  <xsl:for-each-group select="current-group() except ."
-			      group-starting-with="tei:HEAD[number(@level)=$NextHeader]">
-	    <xsl:choose>
-	      <xsl:when test="self::tei:HEAD">
-		<xsl:call-template name="group-by-section"/>
-	      </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:call-template name="inSection"/>
-	    </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:for-each-group>
-      </xsl:when>
-      <xsl:otherwise>
-	<div>
-	  <xsl:choose>
-	    <xsl:when test="starts-with(@style,'Heading')"/>
-	    <xsl:when test="@style">
-	      <xsl:attribute name="rend" select="@style"/>
-	    </xsl:when>
-	  </xsl:choose>
-	  <xsl:if test="not(@interpolated='true')">
-	    <head>
-	      <xsl:apply-templates mode="pass1"/>
-	    </head>
-	  </xsl:if>
-	  <xsl:for-each-group select="current-group() except ."
-			      group-starting-with="tei:HEAD[number(@level)=$NextHeader]">
-	    <xsl:choose>
-	      <xsl:when test="self::tei:HEAD">
-		<xsl:call-template name="group-by-section"/>
-	      </xsl:when>
-	    <xsl:otherwise>
-		<xsl:call-template name="inSection"/>
-	    </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:for-each-group>
-	</div>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="group-by-section">
+		<xsl:variable name="ThisHeader" select="number(@level)" />
+		<xsl:variable name="NextHeader" select="number(@level)+1" />
+		<xsl:choose>
+			<xsl:when test="@magic">
+				<xsl:for-each-group
+					select="current-group() except ."
+					group-starting-with="tei:HEAD[number(@level)=$NextHeader]">
+					<xsl:choose>
+						<xsl:when test="self::tei:HEAD">
+							<xsl:call-template name="group-by-section" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template name="inSection" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each-group>
+			</xsl:when>
+			<xsl:otherwise>
+				<div>
+					<xsl:choose>
+						<xsl:when test="starts-with(@style,'Heading')" />
+						<xsl:when test="@style">
+							<xsl:attribute name="rend" select="@style" />
+						</xsl:when>
+					</xsl:choose>
+					<xsl:if test="not(@interpolated='true')">
+						<head>
+							<xsl:apply-templates mode="pass1" />
+						</head>
+					</xsl:if>
+					<xsl:for-each-group
+						select="current-group() except ."
+						group-starting-with="tei:HEAD[number(@level)=$NextHeader]">
+						<xsl:choose>
+							<xsl:when test="self::tei:HEAD">
+								<xsl:call-template name="group-by-section" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template name="inSection" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each-group>
+				</div>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template name="inSection">
-    <xsl:for-each-group select="current-group()"
+	<xsl:template name="inSection">
+		<xsl:for-each-group select="current-group()"
 			group-adjacent="if (self::tei:GLOSS)
 					then 1
-					else 2">      
-      <xsl:choose>
-	<xsl:when test="current-grouping-key()=1">
-	  <list type="gloss">
-	    <xsl:for-each select="current-group()">
-	      <xsl:element name="{@n}">
-		<xsl:apply-templates mode="pass2"/>
-	      </xsl:element>
-	    </xsl:for-each>
-	  </list>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:for-each select="current-group()">
-	    <xsl:apply-templates select="." mode="pass2"/>
-	  </xsl:for-each>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each-group>
-  </xsl:template>
-		
-<xsl:template match="@*|text()|comment()|processing-instruction()" mode="pass1">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+					else 2">
+			<xsl:choose>
+				<xsl:when test="current-grouping-key()=1">
+					<list type="gloss">
+						<xsl:for-each select="current-group()">
+							<xsl:element name="{@n}">
+								<xsl:apply-templates mode="pass2" />
+							</xsl:element>
+						</xsl:for-each>
+					</list>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:for-each select="current-group()">
+						<xsl:apply-templates select="." mode="pass2" />
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+	</xsl:template>
 
-  <xsl:template match="tei:p[not(node())]" mode="pass1"/>
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="pass1">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="tei:HEAD" mode="pass1">
-    <xsl:if test="preceding-sibling::tei:HEAD">
-      <xsl:variable name="prev"
-		    select="xs:integer(number(preceding-sibling::tei:HEAD[1]/@level))"/>
-      <xsl:variable name="current"
-		    select="xs:integer(number(@level))"/>
-	<xsl:if test="($current - $prev) &gt;1 ">
-	  <!--<xsl:message>Walk from <xsl:value-of select="$prev"/> to <xsl:value-of select="$current"/></xsl:message>-->
-	  <xsl:for-each
-	      select="$prev + 1   to $current - 1 ">
-	    <HEAD interpolated='true' level="{.}"/>
-	  </xsl:for-each>
-	</xsl:if>
-    </xsl:if>
-    <xsl:copy>
-    <xsl:apply-templates
-	select="*|@*|processing-instruction()|comment()|text()"
-	mode="pass1"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="tei:p[not(node())]" mode="pass1" />
 
-  <xsl:template match="*" mode="pass1">
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass1"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="tei:HEAD" mode="pass1">
+		<xsl:if test="preceding-sibling::tei:HEAD">
+			<xsl:variable name="prev"
+				select="xs:integer(number(preceding-sibling::tei:HEAD[1]/@level))" />
+			<xsl:variable name="current"
+				select="xs:integer(number(@level))" />
+			<xsl:if test="($current - $prev) &gt;1 ">
+				<!--<xsl:message>Walk from <xsl:value-of select="$prev"/> to <xsl:value-of 
+					select="$current"/></xsl:message> -->
+				<xsl:for-each select="$prev + 1   to $current - 1 ">
+					<HEAD interpolated='true' level="{.}" />
+				</xsl:for-each>
+			</xsl:if>
+		</xsl:if>
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass1" />
+		</xsl:copy>
+	</xsl:template>
 
+	<xsl:template match="*" mode="pass1">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass1" />
+		</xsl:copy>
+	</xsl:template>
 
-  <!-- second pass -->
 
+	<!-- second pass -->
 
-  <xsl:template match="tei:p[not(*) and normalize-space(.)='']" mode="pass2"/>
 
-    <xsl:template match="@*|comment()|processing-instruction()" mode="pass2">
-        <xsl:copy-of select="."/>
-    </xsl:template>
-    
-    <xsl:template match="*" mode="pass2">
-        <xsl:copy>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-        </xsl:copy>
-    </xsl:template>
-    
-    
-    <xsl:template match="text()" mode="pass2">
-        <xsl:value-of select="."/>
-    </xsl:template>
+	<xsl:template
+		match="tei:p[not(*) and normalize-space(.)='']" mode="pass2" />
 
+	<xsl:template
+		match="@*|comment()|processing-instruction()" mode="pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-    <xsl:template match="tei:title" mode="pass2">
-      <xsl:choose>
-	<xsl:when test="parent::tei:div|parent::tei:body">
-	  <head>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-	  </head>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:copy>
-	    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-	  </xsl:copy>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
+	<xsl:template match="*" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass2" />
+		</xsl:copy>
+	</xsl:template>
 
-  <!-- third pass -->
 
+	<xsl:template match="text()" mode="pass2">
+		<xsl:value-of select="." />
+	</xsl:template>
 
 
-    <xsl:template match="@*|comment()|processing-instruction()" mode="pass3">
-        <xsl:copy-of select="."/>
-    </xsl:template>
-    
-    <xsl:template match="*" mode="pass3">
-        <xsl:copy>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-        </xsl:copy>
-    </xsl:template>
-    
-    
-    <xsl:template match="text()" mode="pass3">
-        <xsl:value-of select="."/>
-    </xsl:template>
+	<xsl:template match="tei:title" mode="pass2">
+		<xsl:choose>
+			<xsl:when test="parent::tei:div|parent::tei:body">
+				<head>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()"
+						mode="pass2" />
+				</head>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()"
+						mode="pass2" />
+				</xsl:copy>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template match="tei:div[not(@type)]" mode="pass3">
-      <div type="div{count(ancestor-or-self::tei:div)}">
-	<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass3"/>
-      </div>
-    </xsl:template>
+	<!-- third pass -->
 
+
+
+	<xsl:template
+		match="@*|comment()|processing-instruction()" mode="pass3">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*" mode="pass3">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass3" />
+		</xsl:copy>
+	</xsl:template>
+
+
+	<xsl:template match="text()" mode="pass3">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template match="tei:div[not(@type)]" mode="pass3">
+		<div type="div{count(ancestor-or-self::tei:div)}">
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass3" />
+		</div>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/teitoodt.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/teitoodt.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/teitoodt.xsl	(revision 2397)
@@ -1,174 +1,218 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="2.0"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-    xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
-    xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:dom="http://www.w3.org/2001/xml-events"
-    xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
-    xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
-    xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
-    xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
-    xmlns:math="http://www.w3.org/1998/Math/MathML"
-    xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
-    xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
-    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
-    xmlns:m="http://www.w3.org/1998/Math/MathML"
-    xmlns:atom="http://www.w3.org/2005/Atom"  
-    xmlns:estr="http://exslt.org/strings"
-    xmlns:xlink="http://www.w3.org/1999/xlink"
-    xmlns:xhtml="http://www.w3.org/1999/xhtml"
-    xmlns:dbk="http://docbook.org/ns/docbook"
-    xmlns:rng="http://relaxng.org/ns/structure/1.0"
-    xmlns:ooo="http://openoffice.org/2004/office"
-    xmlns:oooc="http://openoffice.org/2004/calc"
-    xmlns:ooow="http://openoffice.org/2004/writer"
-    xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
-    xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
-    xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
-    xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
-    xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
-    xmlns:xforms="http://www.w3.org/2002/xforms"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:teix="http://www.tei-c.org/ns/Examples"
-    office:version="1.0"
-    >
+<xsl:stylesheet version="2.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dom="http://www.w3.org/2001/xml-events"
+	xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+	xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+	xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+	xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+	xmlns:math="http://www.w3.org/1998/Math/MathML"
+	xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+	xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+	xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:atom="http://www.w3.org/2005/Atom"
+	xmlns:estr="http://exslt.org/strings"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	xmlns:dbk="http://docbook.org/ns/docbook"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:ooo="http://openoffice.org/2004/office"
+	xmlns:oooc="http://openoffice.org/2004/calc"
+	xmlns:ooow="http://openoffice.org/2004/writer"
+	xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+	xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+	xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+	xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+	xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+	xmlns:xforms="http://www.w3.org/2002/xforms"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples" office:version="1.0">
 
-  <xsl:import href="../common2/core.xsl"/>
-  <xsl:param name="useFixedDate">false</xsl:param>
+	<xsl:import href="../common2/core.xsl" />
+	<xsl:param name="useFixedDate">
+		false
+	</xsl:param>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making OpenOffice files from TEI XML.
-	 Originally derived from the OpenOffice /Docbook
-	 conversion, but largely rewritten </p>
-         <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making OpenOffice files from TEI XML.
+				Originally derived from the OpenOffice /Docbook
+				conversion, but largely rewritten
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: teitoodt.xsl 10180 2012-03-25 14:48:46Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-  
-  <xsl:strip-space elements="teix:* rng:* xsl:* xhtml:* atom:* m:*"/>
-    <xsl:key name="W" match="image" use="@url"/>
-    <xsl:key name="H" match="image" use="@url"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: teitoodt.xsl 10180 2012-03-25 14:48:46Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:output method="xml" omit-xml-declaration="no"/>
+	<xsl:strip-space
+		elements="teix:* rng:* xsl:* xhtml:* atom:* m:*" />
+	<xsl:key name="W" match="image" use="@url" />
+	<xsl:key name="H" match="image" use="@url" />
 
-  <xsl:decimal-format name="staff" digit="D"/>
-  <xsl:variable name="doc_type">TEI</xsl:variable>
-  <xsl:param name="useHeaderFrontMatter">false</xsl:param>
-  <xsl:param name="postQuote">’</xsl:param>
-  <xsl:param name="preQuote">‘</xsl:param>
-  <xsl:param name="outputDir">.</xsl:param>
-  <xsl:param name="freestanding">false</xsl:param>
-  <xsl:key name='IDS' match="tei:*[@xml:id]" use="@xml:id"/>
-  <xsl:key name='GRAPHICS' match="tei:graphic" use="1"/>
-  <xsl:key name="Page" match="style:page-layout-properties" use="1"/>
 
-  <xsl:template match="/">
-    <xsl:choose>
-      <xsl:when test="$freestanding='true'">
-	<xsl:result-document href="{concat($outputDir,'/meta.xml')}">
-	  <xsl:call-template name="META"/>
-	</xsl:result-document>
-	<office:document-content>
-	  <xsl:if test="$freestanding='true'">
-	  <xsl:for-each select="document(concat($outputDir,'/content.xml'))/office:document-content">
-	    <xsl:copy-of select="office:scripts"/>
-	    <xsl:copy-of select="office:font-face-decls"/>
-	    <xsl:copy-of select="office:automatic-styles"/>
-	  </xsl:for-each>
-	  </xsl:if>
-	  <office:body>
-	    <office:text>
-	      <xsl:apply-templates/>
-	    </office:text>
-	  </office:body>
-	</office:document-content>
-      </xsl:when>
-      <xsl:otherwise>
-	<office:document>
-	  <xsl:call-template name="META"/>
-	  <office:body>
-	    <office:text>
-	      <xsl:apply-templates/>
-	    </office:text>
-	  </office:body>
-	</office:document>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:result-document href="{concat($outputDir,'/META-INF/manifest.xml')}">
-      <manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
-	<manifest:file-entry manifest:media-type="application/vnd.oasis.opendocument.text" manifest:version="1.2" manifest:full-path="/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/statusbar/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/accelerator/current.xml"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/accelerator/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/floater/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/popupmenu/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/progressbar/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/menubar/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/toolbar/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/images/Bitmaps/"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Configurations2/images/"/>
-	<manifest:file-entry manifest:media-type="application/vnd.sun.xml.ui.configuration" manifest:full-path="Configurations2/"/>
-	<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="content.xml"/>
-	<manifest:file-entry manifest:media-type="application/rdf+xml" manifest:full-path="manifest.rdf"/>
-	<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="styles.xml"/>
-	<manifest:file-entry manifest:media-type="text/xml" manifest:full-path="meta.xml"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Thumbnails/thumbnail.png"/>
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Thumbnails/"/>
-	<manifest:file-entry manifest:media-type="text/xml"
-			     manifest:full-path="settings.xml"/>
-	<xsl:if test="count(key('GRAPHICS',1))&gt;0">
-	<manifest:file-entry manifest:media-type="" manifest:full-path="Pictures/"/>
-	<xsl:for-each select="key('GRAPHICS',1)">
-	  <xsl:variable name="imagetype"
-			select="tokenize(@url,'\.')[last()]"/>
-	  <manifest:file-entry>
-	    <xsl:attribute name="manifest:full-path">
+	<xsl:output method="xml" omit-xml-declaration="no" />
+
+	<xsl:decimal-format name="staff" digit="D" />
+	<xsl:variable name="doc_type">
+		TEI
+	</xsl:variable>
+	<xsl:param name="useHeaderFrontMatter">
+		false
+	</xsl:param>
+	<xsl:param name="postQuote">
+		’
+	</xsl:param>
+	<xsl:param name="preQuote">
+		‘
+	</xsl:param>
+	<xsl:param name="outputDir">
+		.
+	</xsl:param>
+	<xsl:param name="freestanding">
+		false
+	</xsl:param>
+	<xsl:key name='IDS' match="tei:*[@xml:id]" use="@xml:id" />
+	<xsl:key name='GRAPHICS' match="tei:graphic" use="1" />
+	<xsl:key name="Page" match="style:page-layout-properties"
+		use="1" />
+
+	<xsl:template match="/">
+		<xsl:choose>
+			<xsl:when test="$freestanding='true'">
+				<xsl:result-document
+					href="{concat($outputDir,'/meta.xml')}">
+					<xsl:call-template name="META" />
+				</xsl:result-document>
+				<office:document-content>
+					<xsl:if test="$freestanding='true'">
+						<xsl:for-each
+							select="document(concat($outputDir,'/content.xml'))/office:document-content">
+							<xsl:copy-of select="office:scripts" />
+							<xsl:copy-of select="office:font-face-decls" />
+							<xsl:copy-of select="office:automatic-styles" />
+						</xsl:for-each>
+					</xsl:if>
+					<office:body>
+						<office:text>
+							<xsl:apply-templates />
+						</office:text>
+					</office:body>
+				</office:document-content>
+			</xsl:when>
+			<xsl:otherwise>
+				<office:document>
+					<xsl:call-template name="META" />
+					<office:body>
+						<office:text>
+							<xsl:apply-templates />
+						</office:text>
+					</office:body>
+				</office:document>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:result-document
+			href="{concat($outputDir,'/META-INF/manifest.xml')}">
+			<manifest:manifest
+				xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
+				<manifest:file-entry
+					manifest:media-type="application/vnd.oasis.opendocument.text"
+					manifest:version="1.2" manifest:full-path="/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/statusbar/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/accelerator/current.xml" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/accelerator/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/floater/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/popupmenu/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/progressbar/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/menubar/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/toolbar/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/images/Bitmaps/" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Configurations2/images/" />
+				<manifest:file-entry
+					manifest:media-type="application/vnd.sun.xml.ui.configuration"
+					manifest:full-path="Configurations2/" />
+				<manifest:file-entry
+					manifest:media-type="text/xml" manifest:full-path="content.xml" />
+				<manifest:file-entry
+					manifest:media-type="application/rdf+xml"
+					manifest:full-path="manifest.rdf" />
+				<manifest:file-entry
+					manifest:media-type="text/xml" manifest:full-path="styles.xml" />
+				<manifest:file-entry
+					manifest:media-type="text/xml" manifest:full-path="meta.xml" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Thumbnails/thumbnail.png" />
+				<manifest:file-entry manifest:media-type=""
+					manifest:full-path="Thumbnails/" />
+				<manifest:file-entry
+					manifest:media-type="text/xml" manifest:full-path="settings.xml" />
+				<xsl:if test="count(key('GRAPHICS',1))&gt;0">
+					<manifest:file-entry manifest:media-type=""
+						manifest:full-path="Pictures/" />
+					<xsl:for-each select="key('GRAPHICS',1)">
+						<xsl:variable name="imagetype"
+							select="tokenize(@url,'\.')[last()]" />
+						<manifest:file-entry>
+							<xsl:attribute name="manifest:full-path">
 	      <xsl:text>Pictures/resource</xsl:text>
-	      <xsl:number level="any"/>
+	      <xsl:number level="any" />
 	      <xsl:text>.</xsl:text>
-	      <xsl:value-of select="$imagetype"/>
+	      <xsl:value-of select="$imagetype" />
 	    </xsl:attribute>
-	    <xsl:attribute name="manifest:media-type">
+							<xsl:attribute name="manifest:media-type">
 	      <xsl:text>image/</xsl:text>
 	      <xsl:choose>
 		<xsl:when test="$imagetype='png'">png</xsl:when>
@@ -180,380 +224,392 @@
 		<xsl:otherwise>jpeg</xsl:otherwise>
 	      </xsl:choose>
 	    </xsl:attribute>
-	  </manifest:file-entry>
-	</xsl:for-each>
-	</xsl:if>
-      </manifest:manifest>
-    </xsl:result-document>
+						</manifest:file-entry>
+					</xsl:for-each>
+				</xsl:if>
+			</manifest:manifest>
+		</xsl:result-document>
 
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template name="META">
-    <xsl:for-each select="*">
-    <office:meta>
-      <meta:generator>TEI to OpenOffice XSLT</meta:generator>
-      <dc:title>
-	<xsl:call-template name="generateTitle"/>
-      </dc:title>
-      <dc:description/>
-      <dc:subject/>
-      <meta:creation-date>
-	<xsl:call-template name="generateDate"/>
-      </meta:creation-date>
-      <dc:date>
-	<xsl:call-template name="generateRevDate"/>
-      </dc:date>
-      <dc:language>
-	<xsl:choose>
-	  <xsl:when test="/tei:TEI/@xml:lang">
-	    <xsl:value-of select="/tei:TEI/@xml:lang"/>
-	  </xsl:when>
-	  <xsl:otherwise>en</xsl:otherwise>
-	</xsl:choose>
-      </dc:language>
-      <meta:editing-cycles>1</meta:editing-cycles>
-      <meta:editing-duration>PT00H00M00S</meta:editing-duration>
-      <meta:user-defined meta:name="Info 1"/>
-      <meta:user-defined meta:name="Info 2"/>
-      <meta:user-defined meta:name="Info 3"/>
-      <meta:user-defined meta:name="Info 4"/>
-      <meta:document-statistic meta:table-count="1" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="42" meta:word-count="144" meta:character-count="820"/>
-    </office:meta>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="META">
+		<xsl:for-each select="*">
+			<office:meta>
+				<meta:generator>TEI to OpenOffice XSLT</meta:generator>
+				<dc:title>
+					<xsl:call-template name="generateTitle" />
+				</dc:title>
+				<dc:description />
+				<dc:subject />
+				<meta:creation-date>
+					<xsl:call-template name="generateDate" />
+				</meta:creation-date>
+				<dc:date>
+					<xsl:call-template name="generateRevDate" />
+				</dc:date>
+				<dc:language>
+					<xsl:choose>
+						<xsl:when test="/tei:TEI/@xml:lang">
+							<xsl:value-of select="/tei:TEI/@xml:lang" />
+						</xsl:when>
+						<xsl:otherwise>
+							en
+						</xsl:otherwise>
+					</xsl:choose>
+				</dc:language>
+				<meta:editing-cycles>1</meta:editing-cycles>
+				<meta:editing-duration>PT00H00M00S</meta:editing-duration>
+				<meta:user-defined meta:name="Info 1" />
+				<meta:user-defined meta:name="Info 2" />
+				<meta:user-defined meta:name="Info 3" />
+				<meta:user-defined meta:name="Info 4" />
+				<meta:document-statistic
+					meta:table-count="1" meta:image-count="0" meta:object-count="0"
+					meta:page-count="1" meta:paragraph-count="42" meta:word-count="144"
+					meta:character-count="820" />
+			</office:meta>
+		</xsl:for-each>
+	</xsl:template>
 
-  <!-- base structure -->
-  <xsl:template match="tei:TEI">
-    <xsl:apply-templates select="tei:text"/>
-  </xsl:template>
+	<!-- base structure -->
+	<xsl:template match="tei:TEI">
+		<xsl:apply-templates select="tei:text" />
+	</xsl:template>
 
-  <xsl:template match="tei:body|tei:front|tei:back">
-	<xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:body|tei:front|tei:back">
+		<xsl:apply-templates />
+	</xsl:template>
 
 
-  <xsl:template match="tei:head">
-    <xsl:choose>
-      <xsl:when test="parent::tei:figure"/>
-      <xsl:when test="parent::tei:list"/>
-      <xsl:when test="parent::tei:div"/>
-      <xsl:when test="parent::tei:div1"/>
-      <xsl:when test="parent::tei:div2"/>
-      <xsl:when test="parent::tei:div3"/>
-      <xsl:when test="parent::tei:div4"/>
-      <xsl:when test="parent::tei:div5"/>
-      <xsl:when test="parent::tei:div6"/>
-      <xsl:when test="parent::tei:table"/>
+	<xsl:template match="tei:head">
+		<xsl:choose>
+			<xsl:when test="parent::tei:figure" />
+			<xsl:when test="parent::tei:list" />
+			<xsl:when test="parent::tei:div" />
+			<xsl:when test="parent::tei:div1" />
+			<xsl:when test="parent::tei:div2" />
+			<xsl:when test="parent::tei:div3" />
+			<xsl:when test="parent::tei:div4" />
+			<xsl:when test="parent::tei:div5" />
+			<xsl:when test="parent::tei:div6" />
+			<xsl:when test="parent::tei:table" />
 
-      <xsl:otherwise>
-	<xsl:choose>
-	  <xsl:when test="parent::tei:appendix">
-	    <text:p text:style-name="Appendix">
-	      <xsl:apply-templates/>	   
-	    </text:p>	
-	  </xsl:when>
-	  <xsl:when test="parent::tei:body">
-	    <text:h text:outline-level="1">
-	      <xsl:apply-templates/>
-	    </text:h>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <text:p>
-	      <xsl:apply-templates/>	   
-	    </text:p>
-	  </xsl:otherwise>
-	</xsl:choose>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="parent::tei:appendix">
+						<text:p text:style-name="Appendix">
+							<xsl:apply-templates />
+						</text:p>
+					</xsl:when>
+					<xsl:when test="parent::tei:body">
+						<text:h text:outline-level="1">
+							<xsl:apply-templates />
+						</text:h>
+					</xsl:when>
+					<xsl:otherwise>
+						<text:p>
+							<xsl:apply-templates />
+						</text:p>
+					</xsl:otherwise>
+				</xsl:choose>
 
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
 
-  <xsl:template match="tei:div">
-    <xsl:variable name="depth">
-      <xsl:value-of select="count(ancestor::tei:div)"/>
-    </xsl:variable>
-    <text:h>
-      <xsl:attribute name="text:outline-level">
-	<xsl:value-of select="$depth + 1"/>
+	<xsl:template match="tei:div">
+		<xsl:variable name="depth">
+			<xsl:value-of select="count(ancestor::tei:div)" />
+		</xsl:variable>
+		<text:h>
+			<xsl:attribute name="text:outline-level">
+	<xsl:value-of select="$depth + 1" />
       </xsl:attribute>
-      <xsl:call-template name="test.id"/>
-      <xsl:apply-templates select="tei:head" mode="show"/>
-    </text:h>
-    <xsl:apply-templates/>
-  </xsl:template>
+			<xsl:call-template name="test.id" />
+			<xsl:apply-templates select="tei:head"
+				mode="show" />
+		</text:h>
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
-    <xsl:variable name="depth">
-      <xsl:value-of select="substring-after(name(.),'div')"/>
-    </xsl:variable>
-    <text:h>
-      <xsl:attribute name="text:outline-level">
-	<xsl:value-of select="$depth + 1"/>
+	<xsl:template
+		match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6">
+		<xsl:variable name="depth">
+			<xsl:value-of select="substring-after(name(.),'div')" />
+		</xsl:variable>
+		<text:h>
+			<xsl:attribute name="text:outline-level">
+	<xsl:value-of select="$depth + 1" />
       </xsl:attribute>
-      <xsl:call-template name="test.id"/>
-      <xsl:apply-templates select="tei:head" mode="show"/>
-    </text:h>
-    <xsl:apply-templates/>
-  </xsl:template>
+			<xsl:call-template name="test.id" />
+			<xsl:apply-templates select="tei:head"
+				mode="show" />
+		</text:h>
+		<xsl:apply-templates />
+	</xsl:template>
 
 
 
-<!-- paragraphs -->
-  <xsl:template match="tei:pb">
-    <text:soft-page-break/>
-  </xsl:template>
+	<!-- paragraphs -->
+	<xsl:template match="tei:pb">
+		<text:soft-page-break />
+	</xsl:template>
 
-  <xsl:template match="tei:p">
-    <xsl:variable name="style">
-      <xsl:choose>
-	<xsl:when test="ancestor::tei:note[@place='foot']">
-	    <xsl:text>Footnote</xsl:text>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:text>Text_20_body</xsl:text>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:choose>
-<!--      
-     <xsl:when test="tei:pb">
-	<xsl:for-each-group select="node()" group-adjacent="boolean(self::tei:pb)">
-	  <xsl:choose>
-	    <xsl:when test="current-grouping-key()">
-		<text:p text:style-name="P1"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	    <text:p text:style-name="{$style}">
-	      <xsl:call-template name="test.id"/>
-	      <xsl:apply-templates select="current-group()"/>
-	    </text:p>
-	  </xsl:otherwise>  
-        </xsl:choose>
-	</xsl:for-each-group>
-      </xsl:when>
--->
-      <xsl:when test="tei:list">
-	<xsl:for-each-group select="node()" group-adjacent="boolean(self::tei:list)">
-	  <xsl:choose>
-	    <xsl:when test="current-grouping-key()">
-	      <xsl:apply-templates select="current-group()"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	    <text:p text:style-name="{$style}">
-	      <xsl:call-template name="test.id"/>
-	      <xsl:apply-templates select="current-group()"/>
-	    </text:p>
-	  </xsl:otherwise>  
-        </xsl:choose>
-	</xsl:for-each-group>
-      </xsl:when>
-      <xsl:otherwise>
-	<text:p text:style-name="{$style}">
-	  <xsl:call-template name="test.id"/>
-	  <xsl:apply-templates/>
-	</text:p>
-      </xsl:otherwise>  
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:p">
+		<xsl:variable name="style">
+			<xsl:choose>
+				<xsl:when test="ancestor::tei:note[@place='foot']">
+					<xsl:text>Footnote</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>Text_20_body</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<!-- <xsl:when test="tei:pb"> <xsl:for-each-group select="node()" group-adjacent="boolean(self::tei:pb)"> 
+				<xsl:choose> <xsl:when test="current-grouping-key()"> <text:p text:style-name="P1"/> 
+				</xsl:when> <xsl:otherwise> <text:p text:style-name="{$style}"> <xsl:call-template 
+				name="test.id"/> <xsl:apply-templates select="current-group()"/> </text:p> 
+				</xsl:otherwise> </xsl:choose> </xsl:for-each-group> </xsl:when> -->
+			<xsl:when test="tei:list">
+				<xsl:for-each-group select="node()"
+					group-adjacent="boolean(self::tei:list)">
+					<xsl:choose>
+						<xsl:when test="current-grouping-key()">
+							<xsl:apply-templates select="current-group()" />
+						</xsl:when>
+						<xsl:otherwise>
+							<text:p text:style-name="{$style}">
+								<xsl:call-template name="test.id" />
+								<xsl:apply-templates
+									select="current-group()" />
+							</text:p>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each-group>
+			</xsl:when>
+			<xsl:otherwise>
+				<text:p text:style-name="{$style}">
+					<xsl:call-template name="test.id" />
+					<xsl:apply-templates />
+				</text:p>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
 
-<!-- figures -->
-  <xsl:template match="tei:figure">
-    <xsl:call-template name="startHook"/>
-    <text:p text:style-name="Standard">
-      <xsl:call-template name="test.id"/>
-      <xsl:apply-templates select="tei:graphic"/>
-    </text:p>
-    <xsl:if test="tei:head">
-      <text:p text:style-name="Caption">
-	<text:span text:style-name="Figurenum">
-	  <xsl:text>Figure </xsl:text>
-	  <text:sequence 
-	      text:ref-name="refFigure0" 
-	      text:name="Figure"
-	      text:formula="Figure+1"
-	      style:num-format="1">
-	  <xsl:number level="any"/>
-	  <xsl:text>.</xsl:text>
-	  </text:sequence>
-	</text:span>
-	<xsl:text> </xsl:text>
-	<xsl:apply-templates select="tei:head" mode="show"/>
-      </text:p>
-    </xsl:if>
-    <xsl:call-template name="endHook"/>
+	<!-- figures -->
+	<xsl:template match="tei:figure">
+		<xsl:call-template name="startHook" />
+		<text:p text:style-name="Standard">
+			<xsl:call-template name="test.id" />
+			<xsl:apply-templates select="tei:graphic" />
+		</text:p>
+		<xsl:if test="tei:head">
+			<text:p text:style-name="Caption">
+				<text:span text:style-name="Figurenum">
+					<xsl:text>Figure </xsl:text>
+					<text:sequence text:ref-name="refFigure0"
+						text:name="Figure" text:formula="Figure+1" style:num-format="1">
+						<xsl:number level="any" />
+						<xsl:text>.</xsl:text>
+					</text:sequence>
+				</text:span>
+				<xsl:text> </xsl:text>
+				<xsl:apply-templates select="tei:head"
+					mode="show" />
+			</text:p>
+		</xsl:if>
+		<xsl:call-template name="endHook" />
 
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template match="tei:graphic">
-    <xsl:variable name="id">
-      <xsl:choose>
-	<xsl:when test="@xml:id">
-	  <xsl:value-of select="@xml:id"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:text>Figure</xsl:text><xsl:number level="any"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
+	<xsl:template match="tei:graphic">
+		<xsl:variable name="id">
+			<xsl:choose>
+				<xsl:when test="@xml:id">
+					<xsl:value-of select="@xml:id" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>Figure</xsl:text>
+					<xsl:number level="any" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-	<xsl:variable name="filename">
-	  <xsl:text>Pictures/resource</xsl:text>
-	  <xsl:number level="any"/>
-	  <xsl:text>.</xsl:text>
-	  <xsl:value-of select="tokenize(@url,'\.')[last()]"/>
-	</xsl:variable>
-	<xsl:variable name="origheight">
-	  <xsl:choose>
-	    <xsl:when test="@teidocx:height">
-	      <xsl:value-of select="@teidocx:height"/>
-	    </xsl:when>
-	    <xsl:when test="doc-available(concat($outputDir,'/image-size-info.xml'))">
-		<xsl:for-each select="document(concat($outputDir,'/image-size-info.xml'))">
-		  <xsl:value-of select="(number(key('H',$filename)/height) div 72) * 9144"/>
-		</xsl:for-each>
-	    </xsl:when>
-	    <xsl:otherwise>0</xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
+		<xsl:variable name="filename">
+			<xsl:text>Pictures/resource</xsl:text>
+			<xsl:number level="any" />
+			<xsl:text>.</xsl:text>
+			<xsl:value-of select="tokenize(@url,'\.')[last()]" />
+		</xsl:variable>
+		<xsl:variable name="origheight">
+			<xsl:choose>
+				<xsl:when test="@teidocx:height">
+					<xsl:value-of select="@teidocx:height" />
+				</xsl:when>
+				<xsl:when
+					test="doc-available(concat($outputDir,'/image-size-info.xml'))">
+					<xsl:for-each
+						select="document(concat($outputDir,'/image-size-info.xml'))">
+						<xsl:value-of
+							select="(number(key('H',$filename)/height) div 72) * 9144" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-	<xsl:variable name="origwidth">
-	  <xsl:choose>
-	    <xsl:when test="@teidocx:width">
-	      <xsl:value-of select="@teidocx:width"/>
-	    </xsl:when>
-	    <xsl:when test="doc-available(concat($outputDir,'/image-size-info.xml'))">
-		<xsl:for-each select="document(concat($outputDir,'/image-size-info.xml'))">
-		  <xsl:value-of select="(number(key('W',$filename)/width) div 72) * 9144"/>
-		</xsl:for-each>
-	    </xsl:when>
-	    <xsl:otherwise>0</xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
+		<xsl:variable name="origwidth">
+			<xsl:choose>
+				<xsl:when test="@teidocx:width">
+					<xsl:value-of select="@teidocx:width" />
+				</xsl:when>
+				<xsl:when
+					test="doc-available(concat($outputDir,'/image-size-info.xml'))">
+					<xsl:for-each
+						select="document(concat($outputDir,'/image-size-info.xml'))">
+						<xsl:value-of
+							select="(number(key('W',$filename)/width) div 72) * 9144" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-    <xsl:choose>
-      <xsl:when test="$filename and  ( ($origwidth and $origheight) or (@width and @height))">
-	
-	<!-- work out page width / height and subtract 1inch on all sides -->
-	<xsl:variable name="pageWidth">
-	  <xsl:for-each
-	      select="document(concat($outputDir,'/styles.xml'))/office:document-styles/office:automatic-styles/style:page-layout/style:page-layout-properties">
-	    <xsl:value-of
-		select="number(tei:convert-dim-pt(@fo:page-width) - 144)"/>
-	  </xsl:for-each>
-	</xsl:variable>
-	<xsl:variable name="pageHeight">
-	  <xsl:for-each
-	      select="document(concat($outputDir,'/styles.xml'))/office:document-styles/office:automatic-styles/style:page-layout/style:page-layout-properties">
-	    <xsl:value-of 
-		select="number(tei:convert-dim-pt(@fo:page-height) - 144)"/>
-	  </xsl:for-each>
-	</xsl:variable>
-	
-	<xsl:variable name="Width">
-	  <xsl:choose>
-	    <xsl:when test="contains(@width,'%')">
-	      <xsl:value-of select="(($pageWidth div 100) * number(substring-before(@width,'%'))) cast as xs:integer"/>
-	    </xsl:when>
-	    <xsl:when test="@width">
-	      <xsl:value-of select="tei:convert-dim-pt(@width)"/>
-	    </xsl:when>
-	    <xsl:when test="@scale and $origwidth">
-	      <xsl:value-of select="number($origwidth * number(@scale)) div 127 cast as xs:integer"/>
-	    </xsl:when>
-	    <xsl:when test="@height[not(contains(.,'%'))] and $origheight">
-	      <xsl:variable name="h">
-		<xsl:value-of select="number(tei:convert-dim-pt(@height))"/>
-	      </xsl:variable>
-	      <xsl:value-of select="($h * number($origwidth)) div number($origheight)"/>
-	    </xsl:when>
-	    <xsl:when test="$origwidth">
-	      <xsl:value-of select="number($origwidth) div 127"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:message terminate="yes">no way to work out image width for
-	      <xsl:value-of select="$filename"/>
-	      </xsl:message>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
-	
-	<xsl:variable name="Height">
-	  <xsl:choose>
-	    <xsl:when test="contains(@height,'%')">
-	      <xsl:value-of select="(($pageHeight div 100) * (number(substring-before(@height,'%')))) cast as xs:integer"/>
-	    </xsl:when>
-	    <xsl:when test="@height">
-	      <xsl:value-of select="tei:convert-dim-pt(@height)"/>
-	    </xsl:when>
-	    <xsl:when test="@scale and $origheight">
-	      <xsl:value-of select="($origheight *
-				    number(@scale)) div 127 cast as xs:integer"/>
-	    </xsl:when>
-	    <xsl:when test="@width[not(contains(.,'%'))] and $origheight and $origwidth">
-	      <xsl:variable name="w">
-		<xsl:value-of select="number(tei:convert-dim-pt(@width))"/>
-	      </xsl:variable>
-	      <xsl:value-of select="($w * number($origheight)) div number($origwidth)"/>
-	    </xsl:when>
-	    <xsl:when test="$origheight">
-	      <xsl:value-of select="number($origheight) div 127"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:message terminate="yes">no way to work out image height for
-	      <xsl:value-of select="$filename"/>
-	      </xsl:message>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
-	
-	<!-- check for sense -->
-	<xsl:variable name="imageHeight">
-	  <xsl:choose>
-	    <xsl:when test="$Height &lt; 0">
-	      <xsl:value-of select="$pageHeight"/>
-	    </xsl:when>
-	    <xsl:when test="number($Height) &gt; $pageHeight">
-	      <xsl:value-of select="$pageHeight"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:value-of select="$Height"/>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
-	<xsl:variable name="imageWidth">
-	  <xsl:choose>
-	    <xsl:when test="$Width &lt; 0">
-	      <xsl:value-of select="$pageWidth"/>
-	    </xsl:when>
-	    <xsl:when test="number($Width) &gt; $pageWidth">
-	      <xsl:value-of select="$pageWidth"/>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:value-of select="$Width"/>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
-<!--
-<xsl:message>
-  <xsl:for-each select="@*">
-    - @<xsl:value-of select="name(.)"/>: <xsl:value-of select="."/>
-</xsl:for-each>
-    - pageWidth: <xsl:value-of select="$pageWidth"/>
-    - pageHeight: <xsl:value-of select="$pageHeight"/>
-    - Width: <xsl:value-of select="$Width"/>
-    - Height: <xsl:value-of select="$Height"/>
-    - imageWidth: <xsl:value-of select="$imageWidth"/>
-    - imageHeight: <xsl:value-of select="$imageHeight"/>
-</xsl:message>
--->
-	<draw:frame draw:style-name="fr1" 
-		    draw:name="{$id}"
-		    draw:z-index="0">
-	  <xsl:attribute name="text:anchor-type">
+		<xsl:choose>
+			<xsl:when
+				test="$filename and  ( ($origwidth and $origheight) or (@width and @height))">
+
+				<!-- work out page width / height and subtract 1inch on all sides -->
+				<xsl:variable name="pageWidth">
+					<xsl:for-each
+						select="document(concat($outputDir,'/styles.xml'))/office:document-styles/office:automatic-styles/style:page-layout/style:page-layout-properties">
+						<xsl:value-of
+							select="number(tei:convert-dim-pt(@fo:page-width) - 144)" />
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:variable name="pageHeight">
+					<xsl:for-each
+						select="document(concat($outputDir,'/styles.xml'))/office:document-styles/office:automatic-styles/style:page-layout/style:page-layout-properties">
+						<xsl:value-of
+							select="number(tei:convert-dim-pt(@fo:page-height) - 144)" />
+					</xsl:for-each>
+				</xsl:variable>
+
+				<xsl:variable name="Width">
+					<xsl:choose>
+						<xsl:when test="contains(@width,'%')">
+							<xsl:value-of
+								select="(($pageWidth div 100) * number(substring-before(@width,'%'))) cast as xs:integer" />
+						</xsl:when>
+						<xsl:when test="@width">
+							<xsl:value-of select="tei:convert-dim-pt(@width)" />
+						</xsl:when>
+						<xsl:when test="@scale and $origwidth">
+							<xsl:value-of
+								select="number($origwidth * number(@scale)) div 127 cast as xs:integer" />
+						</xsl:when>
+						<xsl:when
+							test="@height[not(contains(.,'%'))] and $origheight">
+							<xsl:variable name="h">
+								<xsl:value-of
+									select="number(tei:convert-dim-pt(@height))" />
+							</xsl:variable>
+							<xsl:value-of
+								select="($h * number($origwidth)) div number($origheight)" />
+						</xsl:when>
+						<xsl:when test="$origwidth">
+							<xsl:value-of select="number($origwidth) div 127" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:message terminate="yes">
+								no way to work out image width for
+								<xsl:value-of select="$filename" />
+							</xsl:message>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+
+				<xsl:variable name="Height">
+					<xsl:choose>
+						<xsl:when test="contains(@height,'%')">
+							<xsl:value-of
+								select="(($pageHeight div 100) * (number(substring-before(@height,'%')))) cast as xs:integer" />
+						</xsl:when>
+						<xsl:when test="@height">
+							<xsl:value-of select="tei:convert-dim-pt(@height)" />
+						</xsl:when>
+						<xsl:when test="@scale and $origheight">
+							<xsl:value-of
+								select="($origheight *
+				    number(@scale)) div 127 cast as xs:integer" />
+						</xsl:when>
+						<xsl:when
+							test="@width[not(contains(.,'%'))] and $origheight and $origwidth">
+							<xsl:variable name="w">
+								<xsl:value-of
+									select="number(tei:convert-dim-pt(@width))" />
+							</xsl:variable>
+							<xsl:value-of
+								select="($w * number($origheight)) div number($origwidth)" />
+						</xsl:when>
+						<xsl:when test="$origheight">
+							<xsl:value-of select="number($origheight) div 127" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:message terminate="yes">
+								no way to work out image height for
+								<xsl:value-of select="$filename" />
+							</xsl:message>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+
+				<!-- check for sense -->
+				<xsl:variable name="imageHeight">
+					<xsl:choose>
+						<xsl:when test="$Height &lt; 0">
+							<xsl:value-of select="$pageHeight" />
+						</xsl:when>
+						<xsl:when test="number($Height) &gt; $pageHeight">
+							<xsl:value-of select="$pageHeight" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$Height" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="imageWidth">
+					<xsl:choose>
+						<xsl:when test="$Width &lt; 0">
+							<xsl:value-of select="$pageWidth" />
+						</xsl:when>
+						<xsl:when test="number($Width) &gt; $pageWidth">
+							<xsl:value-of select="$pageWidth" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$Width" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<!-- <xsl:message> <xsl:for-each select="@*"> - @<xsl:value-of select="name(.)"/>: 
+					<xsl:value-of select="."/> </xsl:for-each> - pageWidth: <xsl:value-of select="$pageWidth"/> 
+					- pageHeight: <xsl:value-of select="$pageHeight"/> - Width: <xsl:value-of 
+					select="$Width"/> - Height: <xsl:value-of select="$Height"/> - imageWidth: 
+					<xsl:value-of select="$imageWidth"/> - imageHeight: <xsl:value-of select="$imageHeight"/> 
+					</xsl:message> -->
+				<draw:frame draw:style-name="fr1" draw:name="{$id}"
+					draw:z-index="0">
+					<xsl:attribute name="text:anchor-type">
 	    <xsl:choose>
 	      <xsl:when test="parent::tei:figure">
 		<xsl:text>paragraph</xsl:text>
@@ -563,47 +619,49 @@
 	      </xsl:otherwise>
 	    </xsl:choose>
 	  </xsl:attribute>
-	  
-	  <xsl:attribute name="svg:width">
-	    <xsl:value-of select="$imageWidth"/>
+
+					<xsl:attribute name="svg:width">
+	    <xsl:value-of select="$imageWidth" />
 	    <xsl:text>pt</xsl:text>
 	  </xsl:attribute>
-	  <xsl:attribute name="svg:height">
-	    <xsl:value-of select="$imageHeight"/>
+					<xsl:attribute name="svg:height">
+	    <xsl:value-of select="$imageHeight" />
 	    <xsl:text>pt</xsl:text>
 	  </xsl:attribute>
-	  <draw:image
-	      xlink:href="{$filename}" 
-	      xlink:type="simple" 
-	      xlink:show="embed"
-	      xlink:actuate="onLoad" 
-	      draw:filter-name="&lt;All formats&gt;"/>
-	</draw:frame>
-      </xsl:when>	
-      <xsl:otherwise>
-	<xsl:message terminate="yes">ERROR. no image size info for  <xsl:value-of select="$filename"/>, cannot proceed</xsl:message>
-	
-      </xsl:otherwise>
-    </xsl:choose>
-    
-  </xsl:template>
+					<draw:image xlink:href="{$filename}" xlink:type="simple"
+						xlink:show="embed" xlink:actuate="onLoad"
+						draw:filter-name="&lt;All formats&gt;" />
+				</draw:frame>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:message terminate="yes">
+					ERROR. no image size info for
+					<xsl:value-of select="$filename" />
+					, cannot proceed
+				</xsl:message>
 
+			</xsl:otherwise>
+		</xsl:choose>
 
-<!-- lists -->
-  <xsl:template match="tei:list|tei:listBibl">
-    <xsl:if test="tei:head">
-      <text:p>
-	<xsl:attribute name="text:style-name">
+	</xsl:template>
+
+
+	<!-- lists -->
+	<xsl:template match="tei:list|tei:listBibl">
+		<xsl:if test="tei:head">
+			<text:p>
+				<xsl:attribute name="text:style-name">
 	  <xsl:choose>
-	    <xsl:when  test="@type='ordered'">P2</xsl:when>
+	    <xsl:when test="@type='ordered'">P2</xsl:when>
 	    <xsl:otherwise>P1</xsl:otherwise>
 	  </xsl:choose>
       </xsl:attribute>
-      <xsl:apply-templates select="tei:head" mode="show"/>
-      </text:p>
-    </xsl:if>
-    <text:list>
-      <xsl:attribute name="text:style-name">
+				<xsl:apply-templates select="tei:head"
+					mode="show" />
+			</text:p>
+		</xsl:if>
+		<text:list>
+			<xsl:attribute name="text:style-name">
 	<xsl:choose>
 	    <xsl:when test="self::tei:listBibl">L2</xsl:when>
             <xsl:when test="not(@type)">L1</xsl:when>
@@ -611,160 +669,165 @@
             <xsl:when test="@type='unordered'">L1</xsl:when>
 	</xsl:choose>
       </xsl:attribute>
-      <xsl:apply-templates/>
-    </text:list>
-  </xsl:template>
+			<xsl:apply-templates />
+		</text:list>
+	</xsl:template>
 
 
 
-  <xsl:template match="tei:list[@type='gloss' or @rend='valList']" priority="10">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template
+		match="tei:list[@type='gloss' or @rend='valList']" priority="10">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="tei:list[@type='gloss' or @rend='valList']/tei:item">
-    <text:p text:style-name="List_20_Contents">
-      <xsl:apply-templates/>
-    </text:p>
-  </xsl:template>
+	<xsl:template
+		match="tei:list[@type='gloss' or @rend='valList']/tei:item">
+		<text:p text:style-name="List_20_Contents">
+			<xsl:apply-templates />
+		</text:p>
+	</xsl:template>
 
-  <xsl:template match="tei:list[@type='gloss' or @rend='valList']/tei:label">
-    <text:p text:style-name="List_20_Heading">
-      <xsl:apply-templates/>
-    </text:p>
-  </xsl:template>
+	<xsl:template
+		match="tei:list[@type='gloss' or @rend='valList']/tei:label">
+		<text:p text:style-name="List_20_Heading">
+			<xsl:apply-templates />
+		</text:p>
+	</xsl:template>
 
-  <xsl:template match="tei:item/tei:p">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:item/tei:p">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="tei:item">
-    <text:list-item>
-      <xsl:choose>
-	<xsl:when test="tei:list">
-	  <xsl:apply-templates/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <text:p>
-	    <xsl:attribute name="text:style-name">
+	<xsl:template match="tei:item">
+		<text:list-item>
+			<xsl:choose>
+				<xsl:when test="tei:list">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<text:p>
+						<xsl:attribute name="text:style-name">
 	      <xsl:choose>
-		<xsl:when  test="parent::tei:list/@type='ordered'">P2</xsl:when>
+		<xsl:when test="parent::tei:list/@type='ordered'">P2</xsl:when>
 		<xsl:otherwise>P1</xsl:otherwise>
 	      </xsl:choose>
 	    </xsl:attribute>
-	    <xsl:apply-templates/>
-	  </text:p>
-	</xsl:otherwise>
-      </xsl:choose>
-    </text:list-item>
-  </xsl:template>
+						<xsl:apply-templates />
+					</text:p>
+				</xsl:otherwise>
+			</xsl:choose>
+		</text:list-item>
+	</xsl:template>
 
-<!-- inline stuff -->
-  <xsl:template match="tei:emph">
-    <text:span text:style-name="Emphasis">
-      <xsl:apply-templates/>
-    </text:span>
-  </xsl:template>
+	<!-- inline stuff -->
+	<xsl:template match="tei:emph">
+		<text:span text:style-name="Emphasis">
+			<xsl:apply-templates />
+		</text:span>
+	</xsl:template>
 
-  <xsl:template  match="tei:gi">
-    <xsl:text>&lt;</xsl:text>
-    <xsl:apply-templates/>
-    <xsl:text>&gt;</xsl:text>
-  </xsl:template>
+	<xsl:template match="tei:gi">
+		<xsl:text>&lt;</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>&gt;</xsl:text>
+	</xsl:template>
 
-  <xsl:template  match="tei:caesura">
-    <xsl:text>&#160;&#160;&#160;</xsl:text>
-  </xsl:template>
+	<xsl:template match="tei:caesura">
+		<xsl:text>&#160;&#160;&#160;</xsl:text>
+	</xsl:template>
 
-  <xsl:template match="tei:q">
-    <text:span text:style-name="q">
-      <xsl:text>&#x2018;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>&#x2019;</xsl:text>
-    </text:span>
-  </xsl:template>
+	<xsl:template match="tei:q">
+		<text:span text:style-name="q">
+			<xsl:text>&#x2018;</xsl:text>
+			<xsl:apply-templates />
+			<xsl:text>&#x2019;</xsl:text>
+		</text:span>
+	</xsl:template>
 
 
-  <xsl:template match="tei:note">
-    <text:note text:note-class="footnote">
-    <text:note-citation>
-      <xsl:number level="any" count="tei:note[@place='foot']"/>
-    </text:note-citation>
-      <text:note-body>
-	<text:p text:style-name="Footnote">
-	  <xsl:apply-templates/>
-	</text:p>
-      </text:note-body>
-    </text:note>  
-  </xsl:template>
+	<xsl:template match="tei:note">
+		<text:note text:note-class="footnote">
+			<text:note-citation>
+				<xsl:number level="any" count="tei:note[@place='foot']" />
+			</text:note-citation>
+			<text:note-body>
+				<text:p text:style-name="Footnote">
+					<xsl:apply-templates />
+				</text:p>
+			</text:note-body>
+		</text:note>
+	</xsl:template>
 
-  <xsl:template match="tei:note[@place='end']">
-    <text:note text:note-class="endnote">
-    <text:note-citation>
-      <xsl:number format="i" level="any" count="tei:note[@place='end']"/>
-    </text:note-citation>
-      <text:note-body>
-	<text:p text:style-name="Endnote">
-	  <xsl:apply-templates/>
-	</text:p>
-      </text:note-body>
-    </text:note>
-  </xsl:template>
+	<xsl:template match="tei:note[@place='end']">
+		<text:note text:note-class="endnote">
+			<text:note-citation>
+				<xsl:number format="i" level="any"
+					count="tei:note[@place='end']" />
+			</text:note-citation>
+			<text:note-body>
+				<text:p text:style-name="Endnote">
+					<xsl:apply-templates />
+				</text:p>
+			</text:note-body>
+		</text:note>
+	</xsl:template>
 
 
-  <xsl:template match="tei:ref">
-    <text:a xlink:type="simple" xlink:href="{@target}">
-      <xsl:apply-templates/>
-    </text:a>
-  </xsl:template>
+	<xsl:template match="tei:ref">
+		<text:a xlink:type="simple" xlink:href="{@target}">
+			<xsl:apply-templates />
+		</text:a>
+	</xsl:template>
 
-  <xsl:template match="tei:ptr">
-    <text:a xlink:type="simple" xlink:href="{@target}">
-      <xsl:choose>
-	<xsl:when test="starts-with(@target,'#')">
-	  <xsl:for-each select="id(substring(@target,2))">
-	    <xsl:apply-templates select="." mode="crossref"/>
-	  </xsl:for-each>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="@target"/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </text:a>
-  </xsl:template>
+	<xsl:template match="tei:ptr">
+		<text:a xlink:type="simple" xlink:href="{@target}">
+			<xsl:choose>
+				<xsl:when test="starts-with(@target,'#')">
+					<xsl:for-each select="id(substring(@target,2))">
+						<xsl:apply-templates select="."
+							mode="crossref" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="@target" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</text:a>
+	</xsl:template>
 
-  <xsl:template match="tei:table|tei:figure|tei:item" mode="crossref">
-    <xsl:number level="any"/>
-  </xsl:template>
+	<xsl:template match="tei:table|tei:figure|tei:item"
+		mode="crossref">
+		<xsl:number level="any" />
+	</xsl:template>
 
-  <xsl:template match="tei:div" mode="crossref">
-    <xsl:number format="1.1.1.1.1"
-		level="multiple" 
-		count="tei:div"/>
-  </xsl:template>
+	<xsl:template match="tei:div" mode="crossref">
+		<xsl:number format="1.1.1.1.1" level="multiple"
+			count="tei:div" />
+	</xsl:template>
 
-  <xsl:template
-      match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" 
-      mode="crossref">
-    <xsl:number format="1.1.1.1.1"
-        count="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
-        level="multiple"/>
-  </xsl:template>
+	<xsl:template
+		match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
+		mode="crossref">
+		<xsl:number format="1.1.1.1.1"
+			count="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6"
+			level="multiple" />
+	</xsl:template>
 
-  <xsl:template name="test.id">
-    <xsl:if test="@xml:id">
-      <text:bookmark text:name="{@xml:id}"/>
-    </xsl:if>
-  </xsl:template>
+	<xsl:template name="test.id">
+		<xsl:if test="@xml:id">
+			<text:bookmark text:name="{@xml:id}" />
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="tei:unclear">
-    <text:span text:style-name="Highlight">
-      <xsl:apply-templates/>
-    </text:span>
-  </xsl:template>
+	<xsl:template match="tei:unclear">
+		<text:span text:style-name="Highlight">
+			<xsl:apply-templates />
+		</text:span>
+	</xsl:template>
 
-  <xsl:template match="tei:hi">
-    <text:span>
-      <xsl:attribute name="text:style-name">
+	<xsl:template match="tei:hi">
+		<text:span>
+			<xsl:attribute name="text:style-name">
 	<xsl:choose>
 	  <xsl:when test="@rend='normalweight'">
 	    <xsl:text>Standard</xsl:text>
@@ -813,1117 +876,1250 @@
 	  </xsl:otherwise>
 	</xsl:choose>
       </xsl:attribute>
-      <xsl:apply-templates/>
-    </text:span>
-  </xsl:template>
+			<xsl:apply-templates />
+		</text:span>
+	</xsl:template>
 
-  <xsl:template match="tei:term">
-    <text:span>
-      <xsl:attribute name="text:style-name">
+	<xsl:template match="tei:term">
+		<text:span>
+			<xsl:attribute name="text:style-name">
 	<xsl:text>Highlight</xsl:text>
       </xsl:attribute>
-      <xsl:apply-templates/>
-    </text:span>
-</xsl:template>
+			<xsl:apply-templates />
+		</text:span>
+	</xsl:template>
 
-  <xsl:template match="tei:index"/>
+	<xsl:template match="tei:index" />
 
-  <xsl:template match="tei:eg">
-    <xsl:call-template name="startHook"/>
-    <xsl:call-template name="Literal">
-      <xsl:with-param name="Text">
-	<xsl:value-of select="."/>
-      </xsl:with-param>
-    </xsl:call-template>
-    <xsl:call-template name="endHook"/>
-  </xsl:template>
+	<xsl:template match="tei:eg">
+		<xsl:call-template name="startHook" />
+		<xsl:call-template name="Literal">
+			<xsl:with-param name="Text">
+				<xsl:value-of select="." />
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:call-template name="endHook" />
+	</xsl:template>
 
-  <xsl:template match="teix:egXML">
-    <xsl:call-template name="startHook"/>
-    <xsl:call-template name="Literal">
-      <xsl:with-param name="Text">
-	<xsl:apply-templates mode="verbatim"/>
-      </xsl:with-param>
-    </xsl:call-template>
-    <xsl:call-template name="endHook"/>
-  </xsl:template>
+	<xsl:template match="teix:egXML">
+		<xsl:call-template name="startHook" />
+		<xsl:call-template name="Literal">
+			<xsl:with-param name="Text">
+				<xsl:apply-templates mode="verbatim" />
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:call-template name="endHook" />
+	</xsl:template>
 
-  <!-- safest to drop comments entirely, I think -->
-  <xsl:template match="comment()"/>
+	<!-- safest to drop comments entirely, I think -->
+	<xsl:template match="comment()" />
 
-  <xsl:template match="tei:head" mode="show">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:head" mode="show">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="tei:lb">
-    <text:line-break/>
-  </xsl:template>
+	<xsl:template match="tei:lb">
+		<text:line-break />
+	</xsl:template>
 
-  <xsl:template match="tei:biblStruct">
-    <text:list-item>
-      <text:p text:style-name="P2">
-	<xsl:apply-templates/>
-      </text:p>
-    </text:list-item>
-  </xsl:template>
+	<xsl:template match="tei:biblStruct">
+		<text:list-item>
+			<text:p text:style-name="P2">
+				<xsl:apply-templates />
+			</text:p>
+		</text:list-item>
+	</xsl:template>
 
-  <xsl:template match="tei:bibl|tei:signed|tei:docTitle|tei:byline|tei:docImprint">
-    <text:p text:style-name="tei_{local-name(.)}">
-      <xsl:apply-templates/>
-    </text:p>
-  </xsl:template>
+	<xsl:template
+		match="tei:bibl|tei:signed|tei:docTitle|tei:byline|tei:docImprint">
+		<text:p text:style-name="tei_{local-name(.)}">
+			<xsl:apply-templates />
+		</text:p>
+	</xsl:template>
 
-  <xsl:template match="tei:lg">
-    <text:p text:style-name="lg">
-      <xsl:apply-templates/>
-    </text:p>
-  </xsl:template>
+	<xsl:template match="tei:lg">
+		<text:p text:style-name="lg">
+			<xsl:apply-templates />
+		</text:p>
+	</xsl:template>
 
-  <xsl:template match="tei:l">
-    <xsl:choose>
-      <xsl:when test="parent::tei:q">
-	<xsl:apply-templates/>
-	<text:line-break/>
-      </xsl:when>
-      <xsl:when test="parent::tei:lg">
-	<xsl:apply-templates/>
-	<text:line-break/>
-      </xsl:when>
-      <xsl:otherwise>
-	<text:p text:style-name="lg">
-	  <xsl:apply-templates/>
-	</text:p>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:l">
+		<xsl:choose>
+			<xsl:when test="parent::tei:q">
+				<xsl:apply-templates />
+				<text:line-break />
+			</xsl:when>
+			<xsl:when test="parent::tei:lg">
+				<xsl:apply-templates />
+				<text:line-break />
+			</xsl:when>
+			<xsl:otherwise>
+				<text:p text:style-name="lg">
+					<xsl:apply-templates />
+				</text:p>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="Literal">
-    <xsl:param name="Text"/>
-    <xsl:choose>
-      <xsl:when test="contains($Text,'&#10;')">
-	<text:p text:style-name="Preformatted_20_Text">
-	  <xsl:value-of
-	      select="translate(substring-before($Text,'&#10;'),' ','&#160;')"/>
-	</text:p>
-	<xsl:call-template name="Literal">
-	  <xsl:with-param name="Text">
-	    <xsl:value-of select="substring-after($Text,'&#10;')"/>
-	  </xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-	<text:p text:style-name="Preformatted_20_Text">
-	  <xsl:value-of select="translate($Text,' ','&#160;')"/>
-	</text:p>
-      </xsl:otherwise>
-    </xsl:choose>
-    <!-- text:s c="6" to ident 6 spaces -->
-  </xsl:template>
+	<xsl:template name="Literal">
+		<xsl:param name="Text" />
+		<xsl:choose>
+			<xsl:when test="contains($Text,'&#10;')">
+				<text:p text:style-name="Preformatted_20_Text">
+					<xsl:value-of
+						select="translate(substring-before($Text,'&#10;'),' ','&#160;')" />
+				</text:p>
+				<xsl:call-template name="Literal">
+					<xsl:with-param name="Text">
+						<xsl:value-of select="substring-after($Text,'&#10;')" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<text:p text:style-name="Preformatted_20_Text">
+					<xsl:value-of select="translate($Text,' ','&#160;')" />
+				</text:p>
+			</xsl:otherwise>
+		</xsl:choose>
+		<!-- text:s c="6" to ident 6 spaces -->
+	</xsl:template>
 
 
-  <xsl:template match="tei:sp">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:sp">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="tei:stage">
-    <xsl:choose>
-      <xsl:when test="parent::tei:sp">
-	<text:p text:style-name="Stage">
-	  <xsl:apply-templates/>
-	</text:p>
-      </xsl:when>
-      <xsl:otherwise>
-	<text:span text:style-name="Stage">
-	  <xsl:apply-templates/>
-	</text:span>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="tei:stage">
+		<xsl:choose>
+			<xsl:when test="parent::tei:sp">
+				<text:p text:style-name="Stage">
+					<xsl:apply-templates />
+				</text:p>
+			</xsl:when>
+			<xsl:otherwise>
+				<text:span text:style-name="Stage">
+					<xsl:apply-templates />
+				</text:span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:speaker">
-      <text:p text:style-name="Speaker">
-	<xsl:apply-templates/>
-      </text:p>
-  </xsl:template>
+	<xsl:template match="tei:speaker">
+		<text:p text:style-name="Speaker">
+			<xsl:apply-templates />
+		</text:p>
+	</xsl:template>
 
-  <!-- tables-->
+	<!-- tables -->
 
-  <xsl:template match="tei:table">
-    <xsl:call-template name="startHook"/>
-    <xsl:variable name="tablenum">
-      <xsl:choose>
-	<xsl:when test="@xml:id"><xsl:value-of select="@xml:id"/></xsl:when>
-	<xsl:otherwise>table<xsl:number level="any"/></xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <table:table
-	table:name="{$tablenum}"
-	table:style-name="Table1">
-      <xsl:for-each select="1 to max(for $i in tei:row return count($i/tei:cell))">
-	<table:table-column
-	    table:style-name="Table{.}.col{.}">
-	</table:table-column>
-      </xsl:for-each>
-      <xsl:apply-templates/>
-    </table:table>
-    <xsl:if test="tei:head">
-      <text:p text:style-name="Caption">
-	<xsl:apply-templates select="tei:head" mode="show"/>
-      </text:p>
-    </xsl:if>
-    <xsl:call-template name="endHook"/>
-  </xsl:template>
+	<xsl:template match="tei:table">
+		<xsl:call-template name="startHook" />
+		<xsl:variable name="tablenum">
+			<xsl:choose>
+				<xsl:when test="@xml:id">
+					<xsl:value-of select="@xml:id" />
+				</xsl:when>
+				<xsl:otherwise>
+					table
+					<xsl:number level="any" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<table:table table:name="{$tablenum}"
+			table:style-name="Table1">
+			<xsl:for-each
+				select="1 to max(for $i in tei:row return count($i/tei:cell))">
+				<table:table-column
+					table:style-name="Table{.}.col{.}">
+				</table:table-column>
+			</xsl:for-each>
+			<xsl:apply-templates />
+		</table:table>
+		<xsl:if test="tei:head">
+			<text:p text:style-name="Caption">
+				<xsl:apply-templates select="tei:head"
+					mode="show" />
+			</text:p>
+		</xsl:if>
+		<xsl:call-template name="endHook" />
+	</xsl:template>
 
 
-  <xsl:template match="tei:row[@role='label']">
-    <table:table-header-rows>
-      <table:table-row>
-	<xsl:apply-templates/>
-      </table:table-row>
-    </table:table-header-rows>
-  </xsl:template>
+	<xsl:template match="tei:row[@role='label']">
+		<table:table-header-rows>
+			<table:table-row>
+				<xsl:apply-templates />
+			</table:table-row>
+		</table:table-header-rows>
+	</xsl:template>
 
 
-  <xsl:template match="tei:row">
-    <table:table-row>
-      <xsl:apply-templates/>
-    </table:table-row>
-  </xsl:template>
+	<xsl:template match="tei:row">
+		<table:table-row>
+			<xsl:apply-templates />
+		</table:table-row>
+	</xsl:template>
 
 
 
-  <xsl:template match="tei:seg">
-    <text:span>
-      <xsl:apply-templates/>
-    </text:span>
-  </xsl:template>
+	<xsl:template match="tei:seg">
+		<text:span>
+			<xsl:apply-templates />
+		</text:span>
+	</xsl:template>
 
-  <xsl:template match="tei:seg[@rend='parent']">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="tei:seg[@rend='parent']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="tei:ident">
-    <text:span>
-      <xsl:apply-templates/>
-    </text:span>
-  </xsl:template>
+	<xsl:template match="tei:ident">
+		<text:span>
+			<xsl:apply-templates />
+		</text:span>
+	</xsl:template>
 
-  <xsl:template match="tei:cit[@rend='display' or not(@rend)]">
-    <text:p text:style-name="tei_cit">
-      <xsl:apply-templates/>
-    </text:p>
-  </xsl:template>
+	<xsl:template
+		match="tei:cit[@rend='display' or not(@rend)]">
+		<text:p text:style-name="tei_cit">
+			<xsl:apply-templates />
+		</text:p>
+	</xsl:template>
 
-  <xsl:template match="tei:mentioned">
-    <text:span>
-      <xsl:apply-templates/>
-    </text:span>
-  </xsl:template>
+	<xsl:template match="tei:mentioned">
+		<text:span>
+			<xsl:apply-templates />
+		</text:span>
+	</xsl:template>
 
-  <xsl:template match="tei:code">
-    <text:span text:style-name="User_20_Entry">
-      <xsl:apply-templates/>
-    </text:span>
-  </xsl:template>
+	<xsl:template match="tei:code">
+		<text:span text:style-name="User_20_Entry">
+			<xsl:apply-templates />
+		</text:span>
+	</xsl:template>
 
-  <xsl:template match="tei:cell">
-    <table:table-cell>
-      <xsl:if test="@cols">
-	<xsl:attribute name="table:number-columns-spanned"
-		       select="@cols"/>
-      </xsl:if>
-      <xsl:if test="@rows">
-	<xsl:attribute name="table:number-rows-spanned"
-		       select="@rows"/>
-      </xsl:if>
-      <xsl:variable name="cellContents">
-	<xsl:apply-templates/>
-      </xsl:variable>
-      <xsl:for-each-group select="$cellContents/node()"			  
-			  group-adjacent="if (self::draw:frame or self::text:span or self::text() or self::text:a)
+	<xsl:template match="tei:cell">
+		<table:table-cell>
+			<xsl:if test="@cols">
+				<xsl:attribute name="table:number-columns-spanned"
+					select="@cols" />
+			</xsl:if>
+			<xsl:if test="@rows">
+				<xsl:attribute name="table:number-rows-spanned"
+					select="@rows" />
+			</xsl:if>
+			<xsl:variable name="cellContents">
+				<xsl:apply-templates />
+			</xsl:variable>
+			<xsl:for-each-group select="$cellContents/node()"
+				group-adjacent="if (self::draw:frame or self::text:span or self::text() or self::text:a)
 					  then 1
-					  else 2">      
-      <xsl:choose>
-	<xsl:when test="current-grouping-key()=1">
-	    <text:p>
-	      <xsl:copy-of select="current-group()"/>
-	    </text:p>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:copy-of select="current-group()"/>
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:for-each-group>
-    </table:table-cell>
-    <xsl:if test="@cols">
-      <xsl:for-each select="2 to @cols">
-	<table:covered-table-cell/>
-      </xsl:for-each>
-    </xsl:if>
-  </xsl:template>
+					  else 2">
+				<xsl:choose>
+					<xsl:when test="current-grouping-key()=1">
+						<text:p>
+							<xsl:copy-of select="current-group()" />
+						</text:p>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy-of select="current-group()" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each-group>
+		</table:table-cell>
+		<xsl:if test="@cols">
+			<xsl:for-each select="2 to @cols">
+				<table:covered-table-cell />
+			</xsl:for-each>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:param name="startComment"></xsl:param>
-  <xsl:param name="endComment"></xsl:param>
-  <xsl:param name="startElement"></xsl:param>
-  <xsl:param name="endElement"></xsl:param>
-  <xsl:param name="startElementName"></xsl:param>
-  <xsl:param name="endElementName"></xsl:param>
-  <xsl:param name="startAttribute"></xsl:param>
-  <xsl:param name="endAttribute"></xsl:param>
-  <xsl:param name="startAttributeValue"></xsl:param>
-  <xsl:param name="endAttributeValue"></xsl:param>
-  <xsl:param name="startNamespace"></xsl:param>
-  <xsl:param name="endNamespace"></xsl:param>
+	<xsl:param name="startComment"></xsl:param>
+	<xsl:param name="endComment"></xsl:param>
+	<xsl:param name="startElement"></xsl:param>
+	<xsl:param name="endElement"></xsl:param>
+	<xsl:param name="startElementName"></xsl:param>
+	<xsl:param name="endElementName"></xsl:param>
+	<xsl:param name="startAttribute"></xsl:param>
+	<xsl:param name="endAttribute"></xsl:param>
+	<xsl:param name="startAttributeValue"></xsl:param>
+	<xsl:param name="endAttributeValue"></xsl:param>
+	<xsl:param name="startNamespace"></xsl:param>
+	<xsl:param name="endNamespace"></xsl:param>
 
-  <xsl:param name="spaceCharacter">&#160;</xsl:param>
-  <xsl:param name="showNamespaceDecls">true</xsl:param>
+	<xsl:param name="spaceCharacter">
+		&#160;
+	</xsl:param>
+	<xsl:param name="showNamespaceDecls">
+		true
+	</xsl:param>
 
-  <xsl:param name="wrapLength">65</xsl:param>
+	<xsl:param name="wrapLength">
+		65
+	</xsl:param>
 
-  <xsl:param name="attsOnSameLine">3</xsl:param>
-  <xsl:key name="Namespaces" match="*[ancestor::teix:egXML]" use="namespace-uri()"/>
+	<xsl:param name="attsOnSameLine">
+		3
+	</xsl:param>
+	<xsl:key name="Namespaces" match="*[ancestor::teix:egXML]"
+		use="namespace-uri()" />
 
-  <xsl:key name="Namespaces" match="*[not(ancestor::*)]" use="namespace-uri()"/>
+	<xsl:key name="Namespaces" match="*[not(ancestor::*)]"
+		use="namespace-uri()" />
 
 
-  <xsl:template name="newLine">&#10;</xsl:template>
+	<xsl:template name="newLine">&#10;
+	</xsl:template>
 
-  <xsl:template name="lineBreak">
-    <xsl:param name="id"/>
-    <xsl:text>&#10;</xsl:text>
-  </xsl:template>
+	<xsl:template name="lineBreak">
+		<xsl:param name="id" />
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
 
-  <xsl:template match="comment()" mode="verbatim">
-    <xsl:choose>
-      <xsl:when test="ancestor::Wrapper"/>
-      <xsl:when test="ancestor::xhtml:Wrapper"/>
-      <xsl:otherwise>
-    <xsl:call-template name="lineBreak">
-      <xsl:with-param name="id">21</xsl:with-param>
-    </xsl:call-template>
-    <xsl:value-of  disable-output-escaping="yes" select="$startComment"/>
-    <xsl:text>&lt;!--</xsl:text>
-    <xsl:value-of select="."/>
-    <xsl:text>--&gt;</xsl:text>
-    <xsl:value-of  disable-output-escaping="yes"
-		   select="$endComment"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="comment()" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="ancestor::Wrapper" />
+			<xsl:when test="ancestor::xhtml:Wrapper" />
+			<xsl:otherwise>
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						21
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startComment" />
+				<xsl:text>&lt;!--</xsl:text>
+				<xsl:value-of select="." />
+				<xsl:text>--&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endComment" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="text()" mode="verbatim">
-    <xsl:choose>
-      <xsl:when test="not(preceding-sibling::node() or contains(.,'&#10;'))">
-	<xsl:call-template name="Text">
-	  <xsl:with-param name="words">
-	    <xsl:value-of select="."/>
-	  </xsl:with-param>
-	</xsl:call-template>
-<!--	
-        <xsl:if test="substring(.,string-length(.))=' '">
-	  <xsl:text> </xsl:text>
-	</xsl:if>
--->
-      </xsl:when>
-      <xsl:when test="normalize-space(.)=''">
-        <xsl:for-each select="following-sibling::*[1]">
-          <xsl:call-template name="lineBreak">
-            <xsl:with-param name="id">7</xsl:with-param>
-          </xsl:call-template>
-          <xsl:call-template name="makeIndent"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-<!--
-	<xsl:if test="starts-with(.,' ')">
-	  <xsl:text> </xsl:text>
-	</xsl:if>
--->
-        <xsl:call-template name="wraptext">
-          <xsl:with-param name="count">0</xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:for-each select="parent::*">
-              <xsl:call-template name="makeIndent"/>
-            </xsl:for-each>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-	    <xsl:choose>
-	      <xsl:when test="starts-with(.,'&#10;') and not
+	<xsl:template match="text()" mode="verbatim">
+		<xsl:choose>
+			<xsl:when
+				test="not(preceding-sibling::node() or contains(.,'&#10;'))">
+				<xsl:call-template name="Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="." />
+					</xsl:with-param>
+				</xsl:call-template>
+				<!-- <xsl:if test="substring(.,string-length(.))=' '"> <xsl:text> </xsl:text> 
+					</xsl:if> -->
+			</xsl:when>
+			<xsl:when test="normalize-space(.)=''">
+				<xsl:for-each select="following-sibling::*[1]">
+					<xsl:call-template name="lineBreak">
+						<xsl:with-param name="id">
+							7
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:call-template name="makeIndent" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- <xsl:if test="starts-with(.,' ')"> <xsl:text> </xsl:text> </xsl:if> -->
+				<xsl:call-template name="wraptext">
+					<xsl:with-param name="count">
+						0
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:for-each select="parent::*">
+							<xsl:call-template name="makeIndent" />
+						</xsl:for-each>
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:choose>
+							<xsl:when
+								test="starts-with(.,'&#10;') and not
 			      (preceding-sibling::node())">
-		<xsl:call-template name="Text">
-		  <xsl:with-param name="words">
-		    <xsl:value-of select="substring(.,2)"/>
-		  </xsl:with-param>
+								<xsl:call-template name="Text">
+									<xsl:with-param name="words">
+										<xsl:value-of select="substring(.,2)" />
+									</xsl:with-param>
+								</xsl:call-template>
+
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template name="Text">
+									<xsl:with-param name="words">
+										<xsl:value-of select="." />
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+				</xsl:call-template>
+				<!-- <xsl:if test="substring(.,string-length(.))=' '"> <xsl:text> </xsl:text> 
+					</xsl:if> -->
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="wraptext">
+		<xsl:param name="indent" />
+		<xsl:param name="text" />
+		<xsl:param name="count">
+			0
+		</xsl:param>
+		<xsl:choose>
+			<xsl:when test="normalize-space($text)=''" />
+			<xsl:when test="contains($text,'&#10;')">
+				<xsl:if test="$count &gt; 0">
+					<xsl:value-of select="$indent" />
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:call-template name="Text">
+					<xsl:with-param name="words">
+						<xsl:value-of
+							select="substring-before($text,'&#10;')" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<!-- <xsl:if test="not(substring-after($text,'&#10;')='')"> -->
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						6
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of select="$indent" />
+				<xsl:call-template name="wraptext">
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of select="substring-after($text,'&#10;')" />
+					</xsl:with-param>
+					<xsl:with-param name="count">
+						<xsl:value-of select="$count + 1" />
+					</xsl:with-param>
+				</xsl:call-template>
+
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$count &gt; 0 and parent::*">
+					<xsl:value-of select="$indent" />
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:call-template name="Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="$text" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="Text">
+		<xsl:param name="words" />
+		<xsl:choose>
+			<xsl:when test="contains($words,'&amp;')">
+				<xsl:value-of select="substring-before($words,'&amp;')" />
+				<xsl:text>&amp;amp;</xsl:text>
+				<xsl:call-template name="Text">
+					<xsl:with-param name="words">
+						<xsl:value-of
+							select="substring-after($words,'&amp;')" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$words" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="*" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="parent::xhtml:Wrapper" />
+			<!-- <xsl:when test="child::node()[last()]/self::text()[not(.='')] and 
+				child::node()[1]/self::text()[not(.='')]"/> -->
+			<xsl:when test="not(parent::*)  or parent::teix:egXML">
+				<xsl:choose>
+					<xsl:when
+						test="preceding-sibling::node()[1][self::text()]
+			  and following-sibling::node()[1][self::text()]" />
+					<xsl:when test="preceding-sibling::*">
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								-1
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="newLine" />
+						<!-- <xsl:call-template name="makeIndent"/> -->
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="not(preceding-sibling::node())">
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						-2
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="makeIndent" />
+			</xsl:when>
+			<xsl:when test="preceding-sibling::node()[1]/self::*">
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						1
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="makeIndent" />
+			</xsl:when>
+			<xsl:when test="preceding-sibling::node()[1]/self::text()">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="lineBreak">
+					<xsl:with-param name="id">
+						9
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="makeIndent" />
+			</xsl:otherwise>
+		</xsl:choose>
+
+		<xsl:value-of disable-output-escaping="yes"
+			select="$startElement" />
+		<xsl:text>&lt;</xsl:text>
+		<xsl:call-template name="makeElementName">
+			<xsl:with-param name="start">
+				true
+			</xsl:with-param>
 		</xsl:call-template>
-		
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:call-template name="Text">
-		  <xsl:with-param name="words">
-		    <xsl:value-of select="."/>
-		  </xsl:with-param>
-		</xsl:call-template>
-	      </xsl:otherwise>
-	    </xsl:choose>
-          </xsl:with-param>
-        </xsl:call-template>
-	<!--
-	<xsl:if test="substring(.,string-length(.))=' '">
-	  <xsl:text> </xsl:text>
-	</xsl:if>
-	-->
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+		<xsl:apply-templates select="@*" mode="verbatim" />
+		<xsl:if
+			test="$showNamespaceDecls='true' or parent::teix:egXML[@rend='full']">
+			<xsl:choose>
+				<xsl:when test="not(parent::*)">
+					<xsl:apply-templates select="." mode="ns" />
+				</xsl:when>
+				<xsl:when
+					test="parent::teix:egXML and not(preceding-sibling::*)">
+					<xsl:apply-templates select="." mode="ns" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:if>
 
-  <xsl:template name="wraptext">
-    <xsl:param name="indent"/>
-    <xsl:param name="text"/>
-    <xsl:param name="count">0</xsl:param>
-    <xsl:choose>
-      <xsl:when test="normalize-space($text)=''"/>
-      <xsl:when test="contains($text,'&#10;')">
-	<xsl:if test="$count &gt; 0">
-	  <xsl:value-of select="$indent"/>
-	  <xsl:text> </xsl:text>
-	</xsl:if>
-	<xsl:call-template name="Text">
-	  <xsl:with-param name="words">
-	    <xsl:value-of
-		select="substring-before($text,'&#10;')"/>
-	  </xsl:with-param>
-	</xsl:call-template>
-<!--	<xsl:if test="not(substring-after($text,'&#10;')='')">-->
-	  <xsl:call-template name="lineBreak">
-	    <xsl:with-param name="id">6</xsl:with-param>
-	  </xsl:call-template>
-	  <xsl:value-of select="$indent"/>
-	  <xsl:call-template name="wraptext">
-	    <xsl:with-param name="indent">
-	      <xsl:value-of select="$indent"/>
-	    </xsl:with-param>
-	    <xsl:with-param name="text">
-	      <xsl:value-of select="substring-after($text,'&#10;')"/>
-	    </xsl:with-param>
-	    <xsl:with-param name="count">
-	      <xsl:value-of select="$count + 1"/>
-	    </xsl:with-param>
-	  </xsl:call-template>
+		<xsl:choose>
+			<xsl:when test="child::node()">
+				<xsl:text>&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+				<xsl:apply-templates mode="verbatim" />
+				<xsl:choose>
+					<xsl:when
+						test="child::node()[last()]/self::text() and child::node()[1]/self::text()" />
 
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:if test="$count &gt; 0 and parent::*">
-	  <xsl:value-of select="$indent"/>
-	  <xsl:text> </xsl:text>
-	</xsl:if>
-	<xsl:call-template name="Text">
-	  <xsl:with-param name="words">
-	    <xsl:value-of select="$text"/>
-	  </xsl:with-param>
-	</xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+					<xsl:when test="not(parent::*)  or parent::teix:egXML">
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								23
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when
+						test="child::node()[last()]/self::text()[normalize-space(.)='']">
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								3
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="makeIndent" />
+					</xsl:when>
+					<xsl:when test="child::node()[last()]/self::comment()">
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								4
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="makeIndent" />
+					</xsl:when>
+					<xsl:when test="child::node()[last()]/self::*">
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								5
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="makeIndent" />
+					</xsl:when>
+				</xsl:choose>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElement" />
+				<xsl:text>&lt;/</xsl:text>
+				<xsl:call-template name="makeElementName">
+					<xsl:with-param name="start">
+						false
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>/&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="Text">
-    <xsl:param name="words"/>
-    <xsl:choose>
-      <xsl:when test="contains($words,'&amp;')">
-	<xsl:value-of
-	    select="substring-before($words,'&amp;')"/>
-	<xsl:text>&amp;amp;</xsl:text>
-	<xsl:call-template name="Text">
-	  <xsl:with-param name="words">
-	    <xsl:value-of select="substring-after($words,'&amp;')"/>
-	  </xsl:with-param>
-	</xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:value-of select="$words"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
 
-  <xsl:template match="*" mode="verbatim">
-    <xsl:choose>
-      <xsl:when test="parent::xhtml:Wrapper"/>
-<!--      <xsl:when test="child::node()[last()]/self::text()[not(.='')] and child::node()[1]/self::text()[not(.='')]"/>-->
-      <xsl:when test="not(parent::*)  or parent::teix:egXML">
-	<xsl:choose>
-	  <xsl:when test="preceding-sibling::node()[1][self::text()]
-			  and following-sibling::node()[1][self::text()]"/>
-	  <xsl:when test="preceding-sibling::*">
-	    <xsl:call-template name="lineBreak">
-	      <xsl:with-param name="id">-1</xsl:with-param>
-	    </xsl:call-template>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:call-template name="newLine"/>
-        <!-- <xsl:call-template name="makeIndent"/>-->
-	  </xsl:otherwise>
-	</xsl:choose>
-      </xsl:when>
-      <xsl:when test="not(preceding-sibling::node())">
-	<xsl:call-template name="lineBreak">
-          <xsl:with-param name="id">-2</xsl:with-param>
-	</xsl:call-template>
-        <xsl:call-template name="makeIndent"/>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::node()[1]/self::*">
-        <xsl:call-template name="lineBreak">
-          <xsl:with-param name="id">1</xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="makeIndent"/>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::node()[1]/self::text()">
-	</xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="lineBreak">
-          <xsl:with-param name="id">9</xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="makeIndent"/>
-      </xsl:otherwise>
-    </xsl:choose>
+	<xsl:template name="makeElementName">
+		<xsl:param name="start" />
+		<xsl:choose>
 
-    <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
-    <xsl:text>&lt;</xsl:text>
-    <xsl:call-template name="makeElementName">
-      <xsl:with-param name="start">true</xsl:with-param>
-    </xsl:call-template>
-    <xsl:apply-templates select="@*" mode="verbatim"/>
-    <xsl:if test="$showNamespaceDecls='true' or parent::teix:egXML[@rend='full']">
-      <xsl:choose>
-      <xsl:when test="not(parent::*)">
-	<xsl:apply-templates select="." mode="ns"/>
-      </xsl:when>
-      <xsl:when test="parent::teix:egXML and not(preceding-sibling::*)">
-	<xsl:apply-templates select="." mode="ns"/>
-      </xsl:when>
-      </xsl:choose>
-    </xsl:if>
+			<xsl:when
+				test="namespace-uri()='http://docbook.org/ns/docbook'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>dbk:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+			</xsl:when>
 
-    <xsl:choose>
-      <xsl:when test="child::node()">
-        <xsl:text>&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-        <xsl:apply-templates mode="verbatim"/>
-        <xsl:choose>
-          <xsl:when test="child::node()[last()]/self::text() and child::node()[1]/self::text()"/>
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/2001/XMLSchema'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>xsd:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
 
-	  <xsl:when test="not(parent::*)  or parent::teix:egXML">
-            <xsl:call-template name="lineBreak">
-              <xsl:with-param name="id">23</xsl:with-param>
-            </xsl:call-template>
-	  </xsl:when>
-          <xsl:when test="child::node()[last()]/self::text()[normalize-space(.)='']">
-            <xsl:call-template name="lineBreak">
-              <xsl:with-param name="id">3</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="makeIndent"/>
-          </xsl:when>
-          <xsl:when test="child::node()[last()]/self::comment()">
-            <xsl:call-template name="lineBreak">
-              <xsl:with-param name="id">4</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="makeIndent"/>
-          </xsl:when>
-          <xsl:when test="child::node()[last()]/self::*">
-            <xsl:call-template name="lineBreak">
-              <xsl:with-param name="id">5</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="makeIndent"/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
-        <xsl:text>&lt;/</xsl:text>
-	<xsl:call-template name="makeElementName">
-	  <xsl:with-param name="start">false</xsl:with-param>
-	</xsl:call-template>
-        <xsl:text>&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>/&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
+			</xsl:when>
 
-  <xsl:template name="makeElementName">
-    <xsl:param name="start"/>
-    <xsl:choose>
+			<xsl:when
+				test="namespace-uri()='http://www.ascc.net/xml/schematron'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>sch:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://docbook.org/ns/docbook'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>dbk:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes" select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-      </xsl:when>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://www.w3.org/2001/XMLSchema'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>xsd:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+			</xsl:when>
 
-      <xsl:when
-	  test="namespace-uri()='http://www.ascc.net/xml/schematron'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>sch:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/1998/Math/MathML'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>m:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://www.w3.org/1998/Math/MathML'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>m:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>nvdl:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+			</xsl:when>
 
-      <xsl:when
-	  test="namespace-uri()='http://relaxng.org/ns/compatibility/annotations/1.0'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>a:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
-      <xsl:when
-	  test="namespace-uri()='http://www.w3.org/1999/xhtml'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>xhtml:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>nvdl:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://www.w3.org/1999/xlink'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>xlink:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://relaxng.org/ns/structure/1.0'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>rng:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+			</xsl:when>
 
-      <xsl:when
-	  test="namespace-uri()='http://earth.google.com/kml/2.1'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>kml:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://relaxng.org/ns/compatibility/annotations/1.0'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>a:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://www.w3.org/2005/11/its'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>its:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-      </xsl:when>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
-      <xsl:when test="namespace-uri()='http://www.w3.org/1999/XSL/Transform'">
-        <xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-        <xsl:text>xsl:</xsl:text>
-        <xsl:value-of select="local-name(.)"/>
-        <xsl:value-of disable-output-escaping="yes" select="$endNamespace"/>
-      </xsl:when>
+			</xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/1999/xhtml'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>xhtml:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://www.tei-c.org/ns/Examples'">
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-      </xsl:when>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
-      <xsl:when
-	  test="namespace-uri()='http://www.w3.org/2005/Atom'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>atom:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	    <xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-      </xsl:when>
+			</xsl:when>
 
-      <xsl:when
-	  test="namespace-uri()='http://purl.org/rss/1.0/modules/event/'">
-	<xsl:value-of disable-output-escaping="yes" select="$startNamespace"/>
-	<xsl:text>ev:</xsl:text>
-	<xsl:value-of disable-output-escaping="yes"
-		      select="$endNamespace"/>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	
-      </xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/1999/xlink'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>xlink:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
 
-      <xsl:when test="not(namespace-uri()='')">
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-	<xsl:if test="$start='true'">
-	  <xsl:text> xmlns="</xsl:text>
-	  <xsl:value-of select="namespace-uri()"/>
-	  <xsl:text>"</xsl:text>
-	</xsl:if>
-      </xsl:when>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
-      <xsl:otherwise>
-	<xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-	<xsl:value-of select="local-name(.)"/>
-	<xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+			</xsl:when>
 
+			<xsl:when
+				test="namespace-uri()='http://relaxng.org/ns/structure/1.0'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>rng:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
-    <xsl:template name="makeIndent">
-      <xsl:variable name="depth"
-		    select="count(ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')])"/>
-      <xsl:call-template name="makeSpace">
-	<xsl:with-param name="d">
-	  <xsl:value-of select="$depth"/>
-	</xsl:with-param>
-      </xsl:call-template>
-  </xsl:template>
+			</xsl:when>
 
-  <xsl:template name="makeSpace">
-    <xsl:param name="d"/>
-    <xsl:if test="number($d)&gt;1">
-      <xsl:value-of select="$spaceCharacter"/>
-      <xsl:call-template name="makeSpace">
-	<xsl:with-param name="d">
-	  <xsl:value-of select="$d -1"/>
-	</xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:template>
+			<xsl:when
+				test="namespace-uri()='http://earth.google.com/kml/2.1'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>kml:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
 
-<xsl:template match="@*" mode="verbatim">
-  <xsl:variable name="L">
-    <xsl:for-each select="../@*">
-      <xsl:value-of select="."/>
-    </xsl:for-each>
-  </xsl:variable>
-    <xsl:if test="count(../@*)&gt;$attsOnSameLine or string-length($L)&gt;40 or
+			</xsl:when>
+
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/2005/11/its'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>its:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+			</xsl:when>
+
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/1999/XSL/Transform'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>xsl:</xsl:text>
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+			</xsl:when>
+
+			<xsl:when
+				test="namespace-uri()='http://www.tei-c.org/ns/Examples'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+			</xsl:when>
+
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/2005/Atom'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>atom:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+			</xsl:when>
+
+			<xsl:when
+				test="namespace-uri()='http://purl.org/rss/1.0/modules/event/'">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startNamespace" />
+				<xsl:text>ev:</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endNamespace" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+
+			</xsl:when>
+
+			<xsl:when test="not(namespace-uri()='')">
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+				<xsl:if test="$start='true'">
+					<xsl:text> xmlns="</xsl:text>
+					<xsl:value-of select="namespace-uri()" />
+					<xsl:text>"</xsl:text>
+				</xsl:if>
+			</xsl:when>
+
+			<xsl:otherwise>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<xsl:template name="makeIndent">
+		<xsl:variable name="depth"
+			select="count(ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')])" />
+		<xsl:call-template name="makeSpace">
+			<xsl:with-param name="d">
+				<xsl:value-of select="$depth" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+
+	<xsl:template name="makeSpace">
+		<xsl:param name="d" />
+		<xsl:if test="number($d)&gt;1">
+			<xsl:value-of select="$spaceCharacter" />
+			<xsl:call-template name="makeSpace">
+				<xsl:with-param name="d">
+					<xsl:value-of select="$d -1" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="@*" mode="verbatim">
+		<xsl:variable name="L">
+			<xsl:for-each select="../@*">
+				<xsl:value-of select="." />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:if
+			test="count(../@*)&gt;$attsOnSameLine or string-length($L)&gt;40 or
 		  namespace-uri()='http://www.w3.org/2005/11/its' or
 		  string-length(.)+string-length(name(.)) &gt; 40">
-    <xsl:call-template name="lineBreak">
-      <xsl:with-param name="id">5</xsl:with-param>
-    </xsl:call-template>
-    <xsl:call-template name="makeIndent"/>
-  </xsl:if>
-  <xsl:value-of select="$spaceCharacter"/>
-  <xsl:value-of disable-output-escaping="yes" select="$startAttribute"/>
-  <xsl:choose>
-    <xsl:when test="namespace-uri()='http://www.w3.org/2005/11/its'">
-      <xsl:text>its:</xsl:text>
-    </xsl:when>
-    <xsl:when
-	test="namespace-uri()='http://www.w3.org/XML/1998/namespace'">
-      <xsl:text>xml:</xsl:text>
-    </xsl:when>
-    <xsl:when test="namespace-uri()='http://www.w3.org/1999/xlink'">
-      <xsl:text>xlink:</xsl:text>
-    </xsl:when>
-    <xsl:when
-	test="namespace-uri()='http://www.example.org/ns/nonTEI'">
-      <xsl:text>my:</xsl:text>
-    </xsl:when>
-    <xsl:when
-	test="namespace-uri()='http://relaxng.org/ns/compatibility/annotations/1.0'">
-      <xsl:text>a:</xsl:text>
-    </xsl:when>
-<!--    <xsl:otherwise>
-    <xsl:for-each select="namespace::*">
-      <xsl:if test="not(name(.)='')">
-	  <xsl:value-of select="name(.)"/>
-	  <xsl:text>:</xsl:text>
-      </xsl:if>
-    </xsl:for-each>
-    </xsl:otherwise>
--->
-  </xsl:choose>
-  <xsl:value-of select="local-name(.)"/>
-  <xsl:value-of disable-output-escaping="yes" select="$endAttribute"/>
-  <xsl:text>="</xsl:text>
-  <xsl:value-of disable-output-escaping="yes" select="$startAttributeValue"/>
-  <xsl:apply-templates select="." mode="attributetext"/>
-  <xsl:value-of disable-output-escaping="yes" select="$endAttributeValue"/>
-  <xsl:text>"</xsl:text>
-</xsl:template>
+			<xsl:call-template name="lineBreak">
+				<xsl:with-param name="id">
+					5
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:call-template name="makeIndent" />
+		</xsl:if>
+		<xsl:value-of select="$spaceCharacter" />
+		<xsl:value-of disable-output-escaping="yes"
+			select="$startAttribute" />
+		<xsl:choose>
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/2005/11/its'">
+				<xsl:text>its:</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/XML/1998/namespace'">
+				<xsl:text>xml:</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://www.w3.org/1999/xlink'">
+				<xsl:text>xlink:</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://www.example.org/ns/nonTEI'">
+				<xsl:text>my:</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="namespace-uri()='http://relaxng.org/ns/compatibility/annotations/1.0'">
+				<xsl:text>a:</xsl:text>
+			</xsl:when>
+			<!-- <xsl:otherwise> <xsl:for-each select="namespace::*"> <xsl:if test="not(name(.)='')"> 
+				<xsl:value-of select="name(.)"/> <xsl:text>:</xsl:text> </xsl:if> </xsl:for-each> 
+				</xsl:otherwise> -->
+		</xsl:choose>
+		<xsl:value-of select="local-name(.)" />
+		<xsl:value-of disable-output-escaping="yes"
+			select="$endAttribute" />
+		<xsl:text>="</xsl:text>
+		<xsl:value-of disable-output-escaping="yes"
+			select="$startAttributeValue" />
+		<xsl:apply-templates select="."
+			mode="attributetext" />
+		<xsl:value-of disable-output-escaping="yes"
+			select="$endAttributeValue" />
+		<xsl:text>"</xsl:text>
+	</xsl:template>
 
-<xsl:template match="@*" mode="attributetext">
-  <xsl:choose>
-    <xsl:when test="string-length(.)&gt;50">
-      <xsl:choose>
-	<xsl:when test="contains(.,'|')">
-	  <xsl:call-template name="breakMe">
-	    <xsl:with-param name="text">
-	      <xsl:value-of select="."/>
-	    </xsl:with-param>
-	    <xsl:with-param name="sep">
-	      <xsl:text>|</xsl:text>
-	    </xsl:with-param>
-	  </xsl:call-template>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:call-template name="breakMe">
-	    <xsl:with-param name="text">
-	      <xsl:value-of select="."/>
-	    </xsl:with-param>
-	    <xsl:with-param name="sep">
-	      <xsl:text> </xsl:text>
-	    </xsl:with-param>
-	  </xsl:call-template>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:value-of select="."/>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
+	<xsl:template match="@*" mode="attributetext">
+		<xsl:choose>
+			<xsl:when test="string-length(.)&gt;50">
+				<xsl:choose>
+					<xsl:when test="contains(.,'|')">
+						<xsl:call-template name="breakMe">
+							<xsl:with-param name="text">
+								<xsl:value-of select="." />
+							</xsl:with-param>
+							<xsl:with-param name="sep">
+								<xsl:text>|</xsl:text>
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="breakMe">
+							<xsl:with-param name="text">
+								<xsl:value-of select="." />
+							</xsl:with-param>
+							<xsl:with-param name="sep">
+								<xsl:text> </xsl:text>
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template name="breakMe">
-  <xsl:param name="text"/>
-  <xsl:param name="sep"/>
-  <xsl:choose>
-    <xsl:when test="string-length($text)&lt;50">
-      <xsl:value-of select="$text"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:value-of select="substring-before($text,$sep)"/>
-      <xsl:text>&#10;</xsl:text>
-      <xsl:value-of select="$sep"/>
-      <xsl:call-template name="breakMe">
-	<xsl:with-param name="text">
-	  <xsl:value-of select="substring-after($text,$sep)"/>
-	</xsl:with-param>
-	<xsl:with-param name="sep">
-	  <xsl:value-of select="$sep"/>
-	</xsl:with-param>
-      </xsl:call-template>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
+	<xsl:template name="breakMe">
+		<xsl:param name="text" />
+		<xsl:param name="sep" />
+		<xsl:choose>
+			<xsl:when test="string-length($text)&lt;50">
+				<xsl:value-of select="$text" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="substring-before($text,$sep)" />
+				<xsl:text>&#10;</xsl:text>
+				<xsl:value-of select="$sep" />
+				<xsl:call-template name="breakMe">
+					<xsl:with-param name="text">
+						<xsl:value-of select="substring-after($text,$sep)" />
+					</xsl:with-param>
+					<xsl:with-param name="sep">
+						<xsl:value-of select="$sep" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-<xsl:template match="text()|comment()|processing-instruction()" mode="ns"/>
+	<xsl:template
+		match="text()|comment()|processing-instruction()" mode="ns" />
 
-<xsl:template match="*" mode="ns">
-  <xsl:param name="list"/>
-  <xsl:variable name="used">
-    <xsl:for-each select="namespace::*">
-      <xsl:variable name="ns" select="."/>
-      <xsl:choose>
-	<xsl:when test="contains($list,$ns)"/>
-	<xsl:when test=".='http://relaxng.org/ns/structure/1.0'"/>
-	<xsl:when test=".='http://www.w3.org/2001/XInclude'"/>
-	<xsl:when test=".='http://www.tei-c.org/ns/Examples'"/>
-	<xsl:when test=".='http://relaxng.org/ns/compatibility/annotations/1.0'"/>
-	<xsl:when test="name(.)=''"/>
-	<xsl:when test=".='http://www.w3.org/XML/1998/namespace'"/>
-	<xsl:otherwise>
-	  <xsl:call-template name="lineBreak">
-	    <xsl:with-param name="id">22</xsl:with-param>
-	  </xsl:call-template>
-	  <xsl:text>&#160;&#160;&#160;</xsl:text>
-	  <xsl:text>xmlns:</xsl:text>
-	  <xsl:value-of select="name(.)"/>
-	  <xsl:text>="</xsl:text>
-	  <xsl:value-of select="."/>
-	  <xsl:text>"</xsl:text>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-    </xsl:variable>
-  <xsl:copy-of select="$used"/>
-  <xsl:apply-templates mode="ns">
-    <xsl:with-param name="list">
-      <xsl:value-of select="$list"/>
-      <xsl:value-of select="$used"/>
-    </xsl:with-param>
-  </xsl:apply-templates>
-</xsl:template>
+	<xsl:template match="*" mode="ns">
+		<xsl:param name="list" />
+		<xsl:variable name="used">
+			<xsl:for-each select="namespace::*">
+				<xsl:variable name="ns" select="." />
+				<xsl:choose>
+					<xsl:when test="contains($list,$ns)" />
+					<xsl:when test=".='http://relaxng.org/ns/structure/1.0'" />
+					<xsl:when test=".='http://www.w3.org/2001/XInclude'" />
+					<xsl:when test=".='http://www.tei-c.org/ns/Examples'" />
+					<xsl:when
+						test=".='http://relaxng.org/ns/compatibility/annotations/1.0'" />
+					<xsl:when test="name(.)=''" />
+					<xsl:when test=".='http://www.w3.org/XML/1998/namespace'" />
+					<xsl:otherwise>
+						<xsl:call-template name="lineBreak">
+							<xsl:with-param name="id">
+								22
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:text>&#160;&#160;&#160;</xsl:text>
+						<xsl:text>xmlns:</xsl:text>
+						<xsl:value-of select="name(.)" />
+						<xsl:text>="</xsl:text>
+						<xsl:value-of select="." />
+						<xsl:text>"</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:copy-of select="$used" />
+		<xsl:apply-templates mode="ns">
+			<xsl:with-param name="list">
+				<xsl:value-of select="$list" />
+				<xsl:value-of select="$used" />
+			</xsl:with-param>
+		</xsl:apply-templates>
+	</xsl:template>
 
 
-  <xsl:template name="italicize"/>
+	<xsl:template name="italicize" />
 
-  <xsl:template match="tei:soCalled">
-    <text:span>
-      <xsl:value-of select="$preQuote"/>
-      <xsl:apply-templates/>
-      <xsl:value-of select="$postQuote"/>
-    </text:span>
-  </xsl:template>
+	<xsl:template match="tei:soCalled">
+		<text:span>
+			<xsl:value-of select="$preQuote" />
+			<xsl:apply-templates />
+			<xsl:value-of select="$postQuote" />
+		</text:span>
+	</xsl:template>
 
-  <xsl:function name="tei:convert-dim-pt" as="xs:integer">
-    <xsl:param name="dim"/>
-    <xsl:choose>
-      <xsl:when test="ends-with($dim,'cm')">
-	<xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*28.3464567) cast as xs:integer"/>
-      </xsl:when>
-      <xsl:when test="ends-with($dim,'in')">
-	<xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*72) cast as xs:integer"/>
-      </xsl:when>
-      
-      <xsl:when test="ends-with($dim,'mm')">
-	<xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*2.83464567) cast as xs:integer"/>
-      </xsl:when>
-      <xsl:when test="ends-with($dim,'pt')">
-	<xsl:value-of select="number(substring($dim,0,string-length($dim)-1)) cast as xs:integer"/>
-      </xsl:when>
-      <xsl:when test="ends-with($dim,'px')">
-	<xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*0.75) cast as xs:integer"/>
-      </xsl:when>
-      
-      <xsl:otherwise>
-	-1
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:function>
+	<xsl:function name="tei:convert-dim-pt" as="xs:integer">
+		<xsl:param name="dim" />
+		<xsl:choose>
+			<xsl:when test="ends-with($dim,'cm')">
+				<xsl:value-of
+					select="number(number(substring($dim,0,string-length($dim)-1))*28.3464567) cast as xs:integer" />
+			</xsl:when>
+			<xsl:when test="ends-with($dim,'in')">
+				<xsl:value-of
+					select="number(number(substring($dim,0,string-length($dim)-1))*72) cast as xs:integer" />
+			</xsl:when>
 
-  <xsl:template name="makeExternalLink">
-    <xsl:param name="ptr" as="xs:boolean" select="false()"/>
-    <xsl:param name="dest"/>
-    <xsl:param name="class">link_<xsl:value-of select="local-name(.)"/></xsl:param>
-    <text:a xlink:type="simple" xlink:href="{$dest}">
-      <xsl:choose>
-	<xsl:when test="$ptr">
-	  <xsl:value-of select="$dest"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:apply-templates/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </text:a>
-  </xsl:template>
+			<xsl:when test="ends-with($dim,'mm')">
+				<xsl:value-of
+					select="number(number(substring($dim,0,string-length($dim)-1))*2.83464567) cast as xs:integer" />
+			</xsl:when>
+			<xsl:when test="ends-with($dim,'pt')">
+				<xsl:value-of
+					select="number(substring($dim,0,string-length($dim)-1)) cast as xs:integer" />
+			</xsl:when>
+			<xsl:when test="ends-with($dim,'px')">
+				<xsl:value-of
+					select="number(number(substring($dim,0,string-length($dim)-1))*0.75) cast as xs:integer" />
+			</xsl:when>
 
+			<xsl:otherwise>
+				-1
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
 
-  <xsl:template name="startHook">
-    <xsl:choose>
-      <xsl:when test="self::tei:list and parent::tei:item">
-	<xsl:text disable-output-escaping="yes">&lt;/text:p&gt;</xsl:text>
-	<xsl:text disable-output-escaping="yes">&lt;/text:list&gt;</xsl:text>
-      </xsl:when>
-      <xsl:when test="parent::tei:p">
-      <xsl:text disable-output-escaping="yes">&lt;/text:p&gt;</xsl:text>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="makeExternalLink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="dest" />
+		<xsl:param name="class">
+			link_
+			<xsl:value-of select="local-name(.)" />
+		</xsl:param>
+		<text:a xlink:type="simple" xlink:href="{$dest}">
+			<xsl:choose>
+				<xsl:when test="$ptr">
+					<xsl:value-of select="$dest" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</text:a>
+	</xsl:template>
 
-  <xsl:template name="endHook">
-    <xsl:choose>
-      <xsl:when test="self::tei:list and parent::tei:item">
-	<xsl:text disable-output-escaping="yes">&lt;text:list
+
+	<xsl:template name="startHook">
+		<xsl:choose>
+			<xsl:when test="self::tei:list and parent::tei:item">
+				<xsl:text disable-output-escaping="yes">&lt;/text:p&gt;</xsl:text>
+				<xsl:text disable-output-escaping="yes">&lt;/text:list&gt;</xsl:text>
+			</xsl:when>
+			<xsl:when test="parent::tei:p">
+				<xsl:text disable-output-escaping="yes">&lt;/text:p&gt;</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="endHook">
+		<xsl:choose>
+			<xsl:when test="self::tei:list and parent::tei:item">
+				<xsl:text disable-output-escaping="yes">&lt;text:list
 	</xsl:text>
-	<xsl:choose>
-	  <xsl:when test="parent::tei:list[@type='ordered']">
-	  </xsl:when>
-	</xsl:choose>
-	<xsl:text>&gt;</xsl:text>
-	<xsl:text disable-output-escaping="yes">&lt;text:p  text:style-name="List Contents&gt;</xsl:text>
-      </xsl:when>
-      <xsl:when test="parent::tei:p">
-      <xsl:text disable-output-escaping="yes">&lt;text:p&gt;</xsl:text>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+				<xsl:choose>
+					<xsl:when test="parent::tei:list[@type='ordered']">
+					</xsl:when>
+				</xsl:choose>
+				<xsl:text>&gt;</xsl:text>
+				<xsl:text disable-output-escaping="yes">&lt;text:p  text:style-name="List Contents&gt;</xsl:text>
+			</xsl:when>
+			<xsl:when test="parent::tei:p">
+				<xsl:text disable-output-escaping="yes">&lt;text:p&gt;</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="generateRevDate">
-      <xsl:variable name="when">
-         <xsl:choose>
-            <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/descendant::tei:date">
-               <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/descendant::tei:date[1]"/>
-            </xsl:when>
-            <xsl:when
-		test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/descendant::tei:date">
-	      <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/descendant::tei:date"/>
-	    </xsl:when>	    
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="starts-with($when,'$Date')">
-        <!-- it's RCS -->
-        <xsl:value-of select="substring($when,16,2)"/>
-            <xsl:text>/</xsl:text>
-            <xsl:value-of select="substring($when,13,2)"/>
-            <xsl:text>/</xsl:text>
-            <xsl:value-of select="substring($when,8,4)"/>
-         </xsl:when>
-         <xsl:when test="starts-with($when,'$LastChangedDate')">
-        <!-- it's Subversion-->
-        <xsl:value-of select="substring-before(substring-after($when,'('),')')"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="$when"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template name="generateDate">
-      <xsl:choose>
-	 <xsl:when test="$useFixedDate='true'">1970-01-01</xsl:when>
-         <xsl:when
-	     test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when]">
-            <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when][1]/@when"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date">
-            <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[1]"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date">
-            <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
-            <xsl:apply-templates select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition"/>
-         </xsl:when>
-	 <xsl:when
-	     test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[@when
+	<xsl:template name="generateRevDate">
+		<xsl:variable name="when">
+			<xsl:choose>
+				<xsl:when
+					test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/descendant::tei:date">
+					<xsl:value-of
+						select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/descendant::tei:date[1]" />
+				</xsl:when>
+				<xsl:when
+					test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/descendant::tei:date">
+					<xsl:value-of
+						select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/descendant::tei:date" />
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="starts-with($when,'$Date')">
+				<!-- it's RCS -->
+				<xsl:value-of select="substring($when,16,2)" />
+				<xsl:text>/</xsl:text>
+				<xsl:value-of select="substring($when,13,2)" />
+				<xsl:text>/</xsl:text>
+				<xsl:value-of select="substring($when,8,4)" />
+			</xsl:when>
+			<xsl:when test="starts-with($when,'$LastChangedDate')">
+				<!-- it's Subversion -->
+				<xsl:value-of
+					select="substring-before(substring-after($when,'('),')')" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$when" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="generateDate">
+		<xsl:choose>
+			<xsl:when test="$useFixedDate='true'">
+				1970-01-01
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when]">
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[@when][1]/@when" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date">
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/descendant::tei:date[1]" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date">
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:date" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition">
+				<xsl:apply-templates
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:edition" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[@when
 		   or tei:date]">
-            <xsl:for-each
-		select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[1]">
-	      <xsl:choose>
-		<xsl:when test="@when">
-		  <xsl:value-of select="@when"/>
-		</xsl:when>
-		<xsl:when test="tei:date/@when">
-		  <xsl:value-of select="tei:date/@when"/>
-		</xsl:when>
-		<xsl:when test="tei:date">
-		  <xsl:value-of select="tei:date"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:for-each>
-	 </xsl:when>
-	 <xsl:otherwise>
-	   <xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')"/>
-	 </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[1]">
+					<xsl:choose>
+						<xsl:when test="@when">
+							<xsl:value-of select="@when" />
+						</xsl:when>
+						<xsl:when test="tei:date/@when">
+							<xsl:value-of select="tei:date/@when" />
+						</xsl:when>
+						<xsl:when test="tei:date">
+							<xsl:value-of select="tei:date" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]')" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="generateTitle">
-    <xsl:for-each
-	select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt">
-	<xsl:apply-templates select="tei:title"/>
-    </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="generateTitle">
+		<xsl:for-each
+			select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt">
+			<xsl:apply-templates select="tei:title" />
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="makeSpan">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template name="makeSpan">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template name="tei:makeText">
-    <xsl:param name="letters"/>
-    <xsl:value-of select="$letters"/>
-  </xsl:template>
+	<xsl:template name="tei:makeText">
+		<xsl:param name="letters" />
+		<xsl:value-of select="$letters" />
+	</xsl:template>
 
 
-    <xsl:template name="emphasize">
-      <xsl:param name="class"/>
-      <xsl:param name="content"/>
-      <text:span>
-	<xsl:choose>
-	  <xsl:when test="$class='titlem'">
-	    <xsl:attribute name="text:style-name">Emphasis</xsl:attribute>
-	  </xsl:when>
-	  <xsl:when test="$class='titlej'">
-	    <xsl:attribute name="text:style-name">Emphasis</xsl:attribute>
-	  </xsl:when>
-	</xsl:choose>
-	<xsl:attribute name="xml:space">preserve</xsl:attribute>
-	  <xsl:choose>
-	    <xsl:when test="$class='titles'">
-	      <xsl:text>, </xsl:text>
-	    </xsl:when>
-	    <xsl:when test="$class='titleu'">
-	      <xsl:text>‘</xsl:text>
-	    </xsl:when>
-	    <xsl:when test="$class='titlea'">
-	      <xsl:text>‘</xsl:text>
-	    </xsl:when>
-	  </xsl:choose>
-	  <xsl:value-of select="$content"/>
-	  <xsl:choose>
-	    <xsl:when test="$class='titleu'">
-	      <xsl:text>’</xsl:text>
-	    </xsl:when>
-	    <xsl:when test="$class='titlea'">
-	      <xsl:text>’</xsl:text>
-	    </xsl:when>
-	  </xsl:choose>
-      </text:span>
-    </xsl:template>
- 
+	<xsl:template name="emphasize">
+		<xsl:param name="class" />
+		<xsl:param name="content" />
+		<text:span>
+			<xsl:choose>
+				<xsl:when test="$class='titlem'">
+					<xsl:attribute name="text:style-name">Emphasis</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="$class='titlej'">
+					<xsl:attribute name="text:style-name">Emphasis</xsl:attribute>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:attribute name="xml:space">preserve</xsl:attribute>
+			<xsl:choose>
+				<xsl:when test="$class='titles'">
+					<xsl:text>, </xsl:text>
+				</xsl:when>
+				<xsl:when test="$class='titleu'">
+					<xsl:text>‘</xsl:text>
+				</xsl:when>
+				<xsl:when test="$class='titlea'">
+					<xsl:text>‘</xsl:text>
+				</xsl:when>
+			</xsl:choose>
+			<xsl:value-of select="$content" />
+			<xsl:choose>
+				<xsl:when test="$class='titleu'">
+					<xsl:text>’</xsl:text>
+				</xsl:when>
+				<xsl:when test="$class='titlea'">
+					<xsl:text>’</xsl:text>
+				</xsl:when>
+			</xsl:choose>
+		</text:span>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/listgraphics.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/listgraphics.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odt/listgraphics.xsl	(revision 2397)
@@ -1,90 +1,97 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the core module. </p>
-         <p>This software is dual-licensed:
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module. </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: listgraphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:output method="text"/>
-  <xsl:param name="DIR"/>
-  <xsl:param name="ORIG">.</xsl:param>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: listgraphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:key match="tei:graphic|tei:pb[@facs]" use="1" name="G"/>
+	<xsl:output method="text" />
+	<xsl:param name="DIR" />
+	<xsl:param name="ORIG">
+		.
+	</xsl:param>
 
-  <xsl:template match="/">
-      <xsl:for-each select="key('G',1)">
-         <xsl:variable name="F">
-            <xsl:value-of select="@url|@facs"/>
-         </xsl:variable>
-	 <xsl:variable name="target">
-	   <xsl:value-of select="$DIR"/>
-	   <xsl:text>/image</xsl:text>
-	   <xsl:if test="self::tei:pb">pb</xsl:if>
-	   <xsl:number level="any"/>
-	   <xsl:text>.</xsl:text>
-	   <xsl:value-of select="tokenize($F,'\.')[last()]"/>
-	 </xsl:variable>
-         <xsl:choose>
-	   <xsl:when test="starts-with($F,'http')">
-	     <xsl:text>curl -s -o </xsl:text>
-	     <xsl:value-of select="$target"/>
-	     <xsl:text> </xsl:text>
-	     <xsl:value-of select="$F"/> 
-	   </xsl:when>
-	   <xsl:when test="starts-with($F,'/')">
-	     <xsl:text>cp </xsl:text>
-	     <xsl:value-of select="$F"/> 
-	     <xsl:text> </xsl:text>
-	     <xsl:value-of select="$target"/>
-	   </xsl:when>
-	   <xsl:otherwise> 
-	     <xsl:text>cp </xsl:text>
-	     <xsl:value-of select="$ORIG"/>
-	     <xsl:text>/</xsl:text>
-	     <xsl:value-of select="$F"/> 
-	     <xsl:text> </xsl:text>
-	     <xsl:value-of select="$target"/>
-	   </xsl:otherwise>
-         </xsl:choose>
-         <xsl:text>&#10;</xsl:text>
-      </xsl:for-each>
-  </xsl:template>
+	<xsl:key match="tei:graphic|tei:pb[@facs]" use="1" name="G" />
+
+	<xsl:template match="/">
+		<xsl:for-each select="key('G',1)">
+			<xsl:variable name="F">
+				<xsl:value-of select="@url|@facs" />
+			</xsl:variable>
+			<xsl:variable name="target">
+				<xsl:value-of select="$DIR" />
+				<xsl:text>/image</xsl:text>
+				<xsl:if test="self::tei:pb">
+					pb
+				</xsl:if>
+				<xsl:number level="any" />
+				<xsl:text>.</xsl:text>
+				<xsl:value-of select="tokenize($F,'\.')[last()]" />
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when test="starts-with($F,'http')">
+					<xsl:text>curl -s -o </xsl:text>
+					<xsl:value-of select="$target" />
+					<xsl:text> </xsl:text>
+					<xsl:value-of select="$F" />
+				</xsl:when>
+				<xsl:when test="starts-with($F,'/')">
+					<xsl:text>cp </xsl:text>
+					<xsl:value-of select="$F" />
+					<xsl:text> </xsl:text>
+					<xsl:value-of select="$target" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>cp </xsl:text>
+					<xsl:value-of select="$ORIG" />
+					<xsl:text>/</xsl:text>
+					<xsl:value-of select="$F" />
+					<xsl:text> </xsl:text>
+					<xsl:value-of select="$target" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>&#10;</xsl:text>
+		</xsl:for-each>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/nlm/nlm_3_to_nlm_2.3.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/nlm/nlm_3_to_nlm_2.3.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/nlm/nlm_3_to_nlm_2.3.xsl	(revision 2397)
@@ -1,116 +1,123 @@
 <?xml version="1.0"?>
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="#all">
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="#all">
 
-  <!--
-        Written by Martin Holmes, University of Victoria Humanities Computing and 
-    Media Centre, beginning in 2008.
-    
-    This file is released under the Mozilla Public Licence version 1.1 (MPL 1.1).
-    
-    This transformation is designed to convert NLM 3.0 documents to NLM 2.3;
-    it works only with the subset of NLM 3.0 used by the conversion from teiJournal
-    documents to NLM 3.0.
-    
-    NLM is:
-    
-    The National Center for Biotechnology Information (NCBI) of the National Library of
-    Medicine (NLM) created the Journal Archiving and Interchange Tag Suite.
-    
-    Our source is actually the NLM Journal Publishing Tag Set, described here:
-    
-    http://dtd.nlm.nih.gov/publishing/tag-library/3.0/index.html
-    
-    and the target is the older 2.3 version, described here:
-    
-    http://dtd.nlm.nih.gov/publishing/tag-library/2.3/index.html
-    
-    The reason for creating NLM conversion is that Open Journal Systems has committed 
-    to supporting NLM, so this provides a method of migrating data from teiJournal 
-    to OJS; however, OJS will initially support only NLM 2.3.
-    
-    -->
-  <xsl:output method="xml" doctype-public="-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" doctype-system="http://dtd.nlm.nih.gov/publishing/2.3/journalpublishing.dtd" xpath-default-namespace="" indent="yes"></xsl:output>
+	<!-- Written by Martin Holmes, University of Victoria Humanities Computing 
+		and Media Centre, beginning in 2008. This file is released under the Mozilla 
+		Public Licence version 1.1 (MPL 1.1). This transformation is designed to 
+		convert NLM 3.0 documents to NLM 2.3; it works only with the subset of NLM 
+		3.0 used by the conversion from teiJournal documents to NLM 3.0. NLM is: 
+		The National Center for Biotechnology Information (NCBI) of the National 
+		Library of Medicine (NLM) created the Journal Archiving and Interchange Tag 
+		Suite. Our source is actually the NLM Journal Publishing Tag Set, described 
+		here: http://dtd.nlm.nih.gov/publishing/tag-library/3.0/index.html and the 
+		target is the older 2.3 version, described here: http://dtd.nlm.nih.gov/publishing/tag-library/2.3/index.html 
+		The reason for creating NLM conversion is that Open Journal Systems has committed 
+		to supporting NLM, so this provides a method of migrating data from teiJournal 
+		to OJS; however, OJS will initially support only NLM 2.3. -->
+	<xsl:output method="xml"
+		doctype-public="-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN"
+		doctype-system="http://dtd.nlm.nih.gov/publishing/2.3/journalpublishing.dtd"
+		xpath-default-namespace="" indent="yes"></xsl:output>
 
-  <xsl:template match="/">
+	<xsl:template match="/">
 
-       
-       <xsl:apply-templates></xsl:apply-templates>
-       
 
-  </xsl:template>
-  
-  <!--    Root element needs its article-type attribute massaging a bit. -->
-    <!-- We have an ontology of TEI contribution types; this does not match 
-     NLM at all. In NLM 3.0, the list of article-type values is suggested but 
-     not fixed, so we can use those which are appropriate, and use our own 
-     where there's no match. In 2.3, the list is fixed, so we'd have to convert 
-     all our non-matching ones to "other". -->
-     <xsl:template match="article">
-       <article xmlns:xlink="http://www.w3.org/1999/xlink"
-          xmlns:mml="http://www.w3.org/1998/Math/MathML"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-       <xsl:choose>
-<xsl:when test="@article-type='fiction'">
-  <xsl:attribute name="article-type">other</xsl:attribute>
-</xsl:when>
-<xsl:when test="@article-type='poetry'">
-  <xsl:attribute name="article-type">other</xsl:attribute>
-</xsl:when>
-          <xsl:otherwise><xsl:attribute name="article-type" select="@article-type" /></xsl:otherwise>
-       </xsl:choose>
-         <xsl:apply-templates/>
-       </article>
-     </xsl:template>
-  
-<!-- The 3.0 element-citation is just citation in 2.3. -->
-  <xsl:template match="element-citation">
-    <citation>
-      <xsl:apply-templates />
-    </citation>
-  </xsl:template>
-  
-<!-- The 3.0 element <styled-content> doesn't exist. Each type of content 
-will need to be handled separately. -->
-  <xsl:template match="styled-content[@style-type='scare quotes']">
-    &quot;<xsl:apply-templates/>&quot;
-  </xsl:template>
-    <xsl:template match="styled-content[@style-type='term' or @style-type='mentioned']">
-    <italic><xsl:apply-templates/></italic>
-    </xsl:template>
-    <xsl:template match="styled-content[@style-type='XML tag']">
-    <monospace>&lt;<xsl:apply-templates/>&gt;</monospace>
-  </xsl:template>
-  
-<!-- The @orientation attribute is required in 3.0 and not allowed in 2.3. -->
-  <xsl:template match="@orientation"></xsl:template>
-  
-<!-- @specific-use is not allowed on table-wrap. -->
-  <xsl:template match="table-wrap">
-    <xsl:element name="table-wrap">
-      <xsl:if test="@specific-use">
-        <xsl:attribute name="content-type" select="@specific-use" />
-      </xsl:if>
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-<!-- @specific-use is also not allowed on disp-quote. -->
-  <xsl:template match="disp-quote">
-    <xsl:element name="disp-quote">
-      <xsl:if test="@specific-use">
-        <xsl:attribute name="content-type" select="@specific-use" />
-      </xsl:if>
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-  
-<!-- The person-group/@person-group-type attribute in 2.3 is limited to a 
-fixed list of items.  Some of our types will not do. -->
-  <xsl:template match="person-group">
-    <person-group>
-      <xsl:if test="@person-group-type">
-        <xsl:if test="@person-group-type='allauthors' or 
+		<xsl:apply-templates></xsl:apply-templates>
+
+
+	</xsl:template>
+
+	<!-- Root element needs its article-type attribute massaging a bit. -->
+	<!-- We have an ontology of TEI contribution types; this does not match 
+		NLM at all. In NLM 3.0, the list of article-type values is suggested but 
+		not fixed, so we can use those which are appropriate, and use our own where 
+		there's no match. In 2.3, the list is fixed, so we'd have to convert all 
+		our non-matching ones to "other". -->
+	<xsl:template match="article">
+		<article xmlns:xlink="http://www.w3.org/1999/xlink"
+			xmlns:mml="http://www.w3.org/1998/Math/MathML"
+			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+			<xsl:choose>
+				<xsl:when test="@article-type='fiction'">
+					<xsl:attribute name="article-type">other</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="@article-type='poetry'">
+					<xsl:attribute name="article-type">other</xsl:attribute>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="article-type"
+						select="@article-type" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:apply-templates />
+		</article>
+	</xsl:template>
+
+	<!-- The 3.0 element-citation is just citation in 2.3. -->
+	<xsl:template match="element-citation">
+		<citation>
+			<xsl:apply-templates />
+		</citation>
+	</xsl:template>
+
+	<!-- The 3.0 element <styled-content> doesn't exist. Each type of content 
+		will need to be handled separately. -->
+	<xsl:template
+		match="styled-content[@style-type='scare quotes']">
+		&quot;
+		<xsl:apply-templates />
+		&quot;
+	</xsl:template>
+	<xsl:template
+		match="styled-content[@style-type='term' or @style-type='mentioned']">
+		<italic>
+			<xsl:apply-templates />
+		</italic>
+	</xsl:template>
+	<xsl:template
+		match="styled-content[@style-type='XML tag']">
+		<monospace>
+			&lt;
+			<xsl:apply-templates />
+			&gt;
+		</monospace>
+	</xsl:template>
+
+	<!-- The @orientation attribute is required in 3.0 and not allowed in 2.3. -->
+	<xsl:template match="@orientation"></xsl:template>
+
+	<!-- @specific-use is not allowed on table-wrap. -->
+	<xsl:template match="table-wrap">
+		<xsl:element name="table-wrap">
+			<xsl:if test="@specific-use">
+				<xsl:attribute name="content-type"
+					select="@specific-use" />
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<!-- @specific-use is also not allowed on disp-quote. -->
+	<xsl:template match="disp-quote">
+		<xsl:element name="disp-quote">
+			<xsl:if test="@specific-use">
+				<xsl:attribute name="content-type"
+					select="@specific-use" />
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+
+	<!-- The person-group/@person-group-type attribute in 2.3 is limited to 
+		a fixed list of items. Some of our types will not do. -->
+	<xsl:template match="person-group">
+		<person-group>
+			<xsl:if test="@person-group-type">
+				<xsl:if
+					test="@person-group-type='allauthors' or 
                       @person-group-type='assignee' or 
                       @person-group-type='author' or 
                       @person-group-type='compiler' or 
@@ -120,24 +127,27 @@
                       @person-group-type='inventor' or 
                       @person-group-type='transed' or 
                       @person-group-type='translator'">
-            <xsl:copy-of select="@person-group-type"></xsl:copy-of>
-          </xsl:if>
-      </xsl:if>
-      <xsl:apply-templates />
-    </person-group>
-  </xsl:template>
-  
-<!-- named-content elements cannot occur inside ext-link. -->
-  <xsl:template match="named-content[ancestor::ext-link]">
-    <xsl:value-of select="." />
-  </xsl:template>
-  
-<!--  Lastly, a generic copy-all template with low priority, so that stuff not 
-      handled above is copied to the output. -->
-      <xsl:template match="@*|node()|text()|comment()|processing-instruction()" priority="-1">
-        <xsl:copy>
-            <xsl:apply-templates select="@*|node()|text()|comment()|processing-instruction()"/>
-        </xsl:copy>
-    </xsl:template>
-  
+					<xsl:copy-of select="@person-group-type"></xsl:copy-of>
+				</xsl:if>
+			</xsl:if>
+			<xsl:apply-templates />
+		</person-group>
+	</xsl:template>
+
+	<!-- named-content elements cannot occur inside ext-link. -->
+	<xsl:template match="named-content[ancestor::ext-link]">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<!-- Lastly, a generic copy-all template with low priority, so that stuff 
+		not handled above is copied to the output. -->
+	<xsl:template
+		match="@*|node()|text()|comment()|processing-instruction()"
+		priority="-1">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="@*|node()|text()|comment()|processing-instruction()" />
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/nlm/tei_to_nlm.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/nlm/tei_to_nlm.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/nlm/tei_to_nlm.xsl	(revision 2397)
@@ -1,749 +1,931 @@
 <?xml version="1.0"?>
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exist="http://exist.sourceforge.net/NS/exist" xmlns="" xpath-default-namespace="http://www.tei-c.org/ns/1.0" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="#all">
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:exist="http://exist.sourceforge.net/NS/exist" xmlns=""
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	exclude-result-prefixes="#all">
 
-  <!--
-        Written by Martin Holmes, University of Victoria Humanities Computing and 
-    Media Centre, beginning in 2008.
-    
-    This file is released under the Mozilla Public Licence version 1.1 (MPL 1.1).
-    
-    This transformation is designed to convert the limited subset of TEI elements
-    used in the teiJournal project into an NLM file. NLM is:
-    
-    The National Center for Biotechnology Information (NCBI) of the National Library of
-    Medicine (NLM) created the Journal Archiving and Interchange Tag Suite.
-    
-    Our target is actually the NLM Journal Publishing Tag Set, described here:
-    
-    http://dtd.nlm.nih.gov/publishing/tag-library/3.0/index.html
-    
-    The reason for creating NLM conversion is that Open Journal Systems has committed 
-    to supporting NLM, so this provides a method of migrating data from teiJournal 
-    to OJS.
-    
-    -->
-  <xsl:output method="xml" doctype-public="-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" doctype-system="http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd" xpath-default-namespace="" indent="yes"></xsl:output>
+	<!-- Written by Martin Holmes, University of Victoria Humanities Computing 
+		and Media Centre, beginning in 2008. This file is released under the Mozilla 
+		Public Licence version 1.1 (MPL 1.1). This transformation is designed to 
+		convert the limited subset of TEI elements used in the teiJournal project 
+		into an NLM file. NLM is: The National Center for Biotechnology Information 
+		(NCBI) of the National Library of Medicine (NLM) created the Journal Archiving 
+		and Interchange Tag Suite. Our target is actually the NLM Journal Publishing 
+		Tag Set, described here: http://dtd.nlm.nih.gov/publishing/tag-library/3.0/index.html 
+		The reason for creating NLM conversion is that Open Journal Systems has committed 
+		to supporting NLM, so this provides a method of migrating data from teiJournal 
+		to OJS. -->
+	<xsl:output method="xml"
+		doctype-public="-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN"
+		doctype-system="http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"
+		xpath-default-namespace="" indent="yes"></xsl:output>
 
-  <xsl:template match="/">
-    <article dtd-version="3.0" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-      <xsl:if test="TEI/@xml:lang">
-        <xsl:copy-of select="TEI/@xml:lang"></xsl:copy-of>
-      </xsl:if>
-<!-- We have an ontology of TEI contribution types; this does not match 
-     NLM at all. In NLM 3.0, the list of article-type values is suggested but 
-     not fixed, so we can use those which are appropriate, and use our own 
-     where there's no match. In 2.3, the list is fixed, so we'd have to convert 
-     all our non-matching ones to "other". -->
-        <xsl:choose>
-          <xsl:when test="TEI/@rend='article'">
-  <xsl:attribute name="article-type">research-article</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='review_article'">
-  <xsl:attribute name="article-type">review-article</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='fiction'">
-  <xsl:attribute name="article-type">fiction</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='poetry'">
-  <xsl:attribute name="article-type">poetry</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='review'">
-  <xsl:attribute name="article-type">book-review</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='books_received'">
-  <xsl:attribute name="article-type">books-received</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='note'">
-  <xsl:attribute name="article-type">brief-report</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='discussion'">
-  <xsl:attribute name="article-type">discussion</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='editorial'">
-  <xsl:attribute name="article-type">editorial</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='preface'">
-  <xsl:attribute name="article-type">editorial</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='column'">
-  <xsl:attribute name="article-type">discussion</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='afterword'">
-  <xsl:attribute name="article-type">editorial</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='announcement'">
-  <xsl:attribute name="article-type">announcement</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='corrigendum'">
-  <xsl:attribute name="article-type">correction</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='advertisement'">
-  <xsl:attribute name="article-type">announcement</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='doc_list'">
-  <xsl:attribute name="article-type">collection</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='site_page'">
-  <xsl:attribute name="article-type">editorial</xsl:attribute>
-</xsl:when>
-<xsl:when test="TEI/@rend='obituary'">
-  <xsl:attribute name="article-type">obituary</xsl:attribute>
-</xsl:when>
-          <xsl:otherwise><xsl:attribute name="article-type">other</xsl:attribute></xsl:otherwise>
-        </xsl:choose>
-        
-      
-      <!--      This is the metadata block, essentially. -->
-      <xsl:element name="front">
+	<xsl:template match="/">
+		<article dtd-version="3.0"
+			xmlns:mml="http://www.w3.org/1998/Math/MathML"
+			xmlns:xlink="http://www.w3.org/1999/xlink"
+			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+			<xsl:if test="TEI/@xml:lang">
+				<xsl:copy-of select="TEI/@xml:lang"></xsl:copy-of>
+			</xsl:if>
+			<!-- We have an ontology of TEI contribution types; this does not match 
+				NLM at all. In NLM 3.0, the list of article-type values is suggested but 
+				not fixed, so we can use those which are appropriate, and use our own where 
+				there's no match. In 2.3, the list is fixed, so we'd have to convert all 
+				our non-matching ones to "other". -->
+			<xsl:choose>
+				<xsl:when test="TEI/@rend='article'">
+					<xsl:attribute name="article-type">research-article</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='review_article'">
+					<xsl:attribute name="article-type">review-article</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='fiction'">
+					<xsl:attribute name="article-type">fiction</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='poetry'">
+					<xsl:attribute name="article-type">poetry</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='review'">
+					<xsl:attribute name="article-type">book-review</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='books_received'">
+					<xsl:attribute name="article-type">books-received</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='note'">
+					<xsl:attribute name="article-type">brief-report</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='discussion'">
+					<xsl:attribute name="article-type">discussion</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='editorial'">
+					<xsl:attribute name="article-type">editorial</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='preface'">
+					<xsl:attribute name="article-type">editorial</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='column'">
+					<xsl:attribute name="article-type">discussion</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='afterword'">
+					<xsl:attribute name="article-type">editorial</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='announcement'">
+					<xsl:attribute name="article-type">announcement</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='corrigendum'">
+					<xsl:attribute name="article-type">correction</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='advertisement'">
+					<xsl:attribute name="article-type">announcement</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='doc_list'">
+					<xsl:attribute name="article-type">collection</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='site_page'">
+					<xsl:attribute name="article-type">editorial</xsl:attribute>
+				</xsl:when>
+				<xsl:when test="TEI/@rend='obituary'">
+					<xsl:attribute name="article-type">obituary</xsl:attribute>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="article-type">other</xsl:attribute>
+				</xsl:otherwise>
+			</xsl:choose>
 
-        <!-- Here we dig through the teiHeader to extract what we need to create journal metadata
-     and article metadata. First, journal metadata: -->
-        <xsl:element name="journal-meta">
-          <journal-id journal-id-type="publisher">
-          <xsl:choose>
-          <xsl:when test="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice[1]/abbr[1]">
-            
-              <xsl:value-of select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice[1]/abbr[1]"></xsl:value-of>
-            
-          </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]"></xsl:value-of>
-            </xsl:otherwise>
-          </xsl:choose>
-            </journal-id>
-          <issn>
-            <xsl:value-of select="TEI/teiHeader[1]/fileDesc[1]/seriesStmt[1]/idno[@type='issn']"></xsl:value-of>
-          </issn>
-          <publisher>
-            <publisher-name>
-              <xsl:choose>
-                <xsl:when test="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice/abbr">
-                  <xsl:value-of select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice/abbr"></xsl:value-of>
-                  <xsl:text> (</xsl:text>
-                  <xsl:apply-templates select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice/expan"></xsl:apply-templates>
-                  <xsl:text>)</xsl:text>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:value-of select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]"></xsl:value-of>
-                </xsl:otherwise>
-              </xsl:choose>
-            </publisher-name>
-          </publisher>
 
-        </xsl:element>
+			<!-- This is the metadata block, essentially. -->
+			<xsl:element name="front">
 
-        <!--        Next, article metadata. -->
-        <xsl:element name="article-meta">
-          <article-id pub-id-type="other">
-            <xsl:value-of select="TEI/@xml:id"></xsl:value-of>
-          </article-id>
-          <article-categories>
-            <subj-group>
-              <subject><xsl:value-of select="TEI/@rend" /></subject>
-            </subj-group>
-          </article-categories>
-          
-          <title-group>
-            <article-title><xsl:apply-templates select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/title[@type='main']" /></article-title>
-            <subtitle><xsl:apply-templates select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/title[@type='sub']" /></subtitle>
-            <alt-title alt-title-type="runningRecto"><xsl:apply-templates select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/title[@type='runningRecto']" /></alt-title>
-            <alt-title alt-title-type="runningVerso"><xsl:apply-templates select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/title[@type='runningVerso']" /></alt-title>
-          </title-group>
-          
-          <contrib-group>
-            <xsl:for-each select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/author">
-              <contrib contrib-type="author">
-                <xsl:apply-templates select="name"></xsl:apply-templates>
-                <aff><xsl:apply-templates select="name/affiliation" /></aff>
-              </contrib>
-            </xsl:for-each>
-          </contrib-group>
-          
-          <xsl:for-each select="TEI/teiHeader[1]/fileDesc[1]/seriesStmt[1]/respStmt">
-            <contrib-group>
-              <xsl:for-each select="name">
-                <contrib>
-                  <xsl:attribute name="contrib-type" select="../resp"></xsl:attribute>
-                  <xsl:apply-templates select="." />
-                </contrib>
-              </xsl:for-each>
-            </contrib-group>
-          </xsl:for-each>
+				<!-- Here we dig through the teiHeader to extract what we need to create 
+					journal metadata and article metadata. First, journal metadata: -->
+				<xsl:element name="journal-meta">
+					<journal-id journal-id-type="publisher">
+						<xsl:choose>
+							<xsl:when
+								test="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice[1]/abbr[1]">
 
-          <xsl:call-template name="dateToDMYTags"><xsl:with-param name="inDate" select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/date[1]/@when" /><xsl:with-param name="outTagName">pub-date</xsl:with-param></xsl:call-template>
-          
-          <volume><xsl:apply-templates select="TEI/teiHeader[1]/fileDesc[1]/seriesStmt[1]/idno[@type='vol']" /></volume>
-          
-          <issue><xsl:apply-templates select="TEI/teiHeader[1]/fileDesc[1]/seriesStmt[1]/idno[@type='issue']" /></issue>
-          
-          <elocation-id><xsl:value-of select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/idno[@type='itemNo']/@n" /></elocation-id>
+								<xsl:value-of
+									select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice[1]/abbr[1]"></xsl:value-of>
 
-<!-- If there is an abstract, copy it in here for the sake of completeness. -->
-          <xsl:if test="TEI/text/body/div[@type='abstract']">
-            <abstract>
-              <xsl:apply-templates select="TEI/text/body/div[@type='abstract']/*" />
-            </abstract>
-          </xsl:if>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of
+									select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]"></xsl:value-of>
+							</xsl:otherwise>
+						</xsl:choose>
+					</journal-id>
+					<issn>
+						<xsl:value-of
+							select="TEI/teiHeader[1]/fileDesc[1]/seriesStmt[1]/idno[@type='issn']"></xsl:value-of>
+					</issn>
+					<publisher>
+						<publisher-name>
+							<xsl:choose>
+								<xsl:when
+									test="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice/abbr">
+									<xsl:value-of
+										select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice/abbr"></xsl:value-of>
+									<xsl:text> (</xsl:text>
+									<xsl:apply-templates
+										select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]/choice/expan"></xsl:apply-templates>
+									<xsl:text>)</xsl:text>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of
+										select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/publisher[1]"></xsl:value-of>
+								</xsl:otherwise>
+							</xsl:choose>
+						</publisher-name>
+					</publisher>
 
-<!--        Right now, profilDesc only contains keywords, but other templates 
-            might be added later. -->
-        <xsl:apply-templates select="TEI/teiHeader/profileDesc"></xsl:apply-templates>
+				</xsl:element>
 
+				<!-- Next, article metadata. -->
+				<xsl:element name="article-meta">
+					<article-id pub-id-type="other">
+						<xsl:value-of select="TEI/@xml:id"></xsl:value-of>
+					</article-id>
+					<article-categories>
+						<subj-group>
+							<subject>
+								<xsl:value-of select="TEI/@rend" />
+							</subject>
+						</subj-group>
+					</article-categories>
 
+					<title-group>
+						<article-title>
+							<xsl:apply-templates
+								select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/title[@type='main']" />
+						</article-title>
+						<subtitle>
+							<xsl:apply-templates
+								select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/title[@type='sub']" />
+						</subtitle>
+						<alt-title alt-title-type="runningRecto">
+							<xsl:apply-templates
+								select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/title[@type='runningRecto']" />
+						</alt-title>
+						<alt-title alt-title-type="runningVerso">
+							<xsl:apply-templates
+								select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/title[@type='runningVerso']" />
+						</alt-title>
+					</title-group>
 
-        </xsl:element>
+					<contrib-group>
+						<xsl:for-each
+							select="TEI/teiHeader[1]/fileDesc[1]/titleStmt[1]/author">
+							<contrib contrib-type="author">
+								<xsl:apply-templates select="name"></xsl:apply-templates>
+								<aff>
+									<xsl:apply-templates
+										select="name/affiliation" />
+								</aff>
+							</contrib>
+						</xsl:for-each>
+					</contrib-group>
 
-      </xsl:element>
+					<xsl:for-each
+						select="TEI/teiHeader[1]/fileDesc[1]/seriesStmt[1]/respStmt">
+						<contrib-group>
+							<xsl:for-each select="name">
+								<contrib>
+									<xsl:attribute name="contrib-type"
+										select="../resp"></xsl:attribute>
+									<xsl:apply-templates select="." />
+								</contrib>
+							</xsl:for-each>
+						</contrib-group>
+					</xsl:for-each>
 
-      <!--Here's the meat of the document. -->
-      <xsl:element name="body">
+					<xsl:call-template name="dateToDMYTags">
+						<xsl:with-param name="inDate"
+							select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/date[1]/@when" />
+						<xsl:with-param name="outTagName">
+							pub-date
+						</xsl:with-param>
+					</xsl:call-template>
 
-        <xsl:apply-templates select="TEI/text/body"></xsl:apply-templates>
+					<volume>
+						<xsl:apply-templates
+							select="TEI/teiHeader[1]/fileDesc[1]/seriesStmt[1]/idno[@type='vol']" />
+					</volume>
 
-      </xsl:element>
+					<issue>
+						<xsl:apply-templates
+							select="TEI/teiHeader[1]/fileDesc[1]/seriesStmt[1]/idno[@type='issue']" />
+					</issue>
 
-      <!--      This will contain the appendices, reference list, etc. -->
+					<elocation-id>
+						<xsl:value-of
+							select="TEI/teiHeader[1]/fileDesc[1]/publicationStmt[1]/idno[@type='itemNo']/@n" />
+					</elocation-id>
 
-      <xsl:element name="back">
-<!-- Appendices first. -->
-        <xsl:if test="TEI/text/back/div[@type='appendix']">
-          <xsl:element name="app-group">
-            <xsl:for-each select="TEI/text/back/div[@type='appendix']">
-              <xsl:element name="app">
-                <xsl:if test="@xml:id">
-                  <xsl:attribute name="id" select="@xml:id" />
-                </xsl:if>
-                <xsl:apply-templates select="./*" />
-              </xsl:element>
-            </xsl:for-each>
-          </xsl:element>
-        </xsl:if>
-        
-<!-- Reference list        -->
-        <xsl:if test="TEI/text/back/div[@type='bibliogr']">
-          <xsl:variable name="bibl" select="TEI/text/back/div[@type='bibliogr']"></xsl:variable>
-          <xsl:element name="ref-list">
-<!-- If there's no title tag, we have to add an empty one. -->
-            <title><xsl:value-of select="$bibl/head" /></title>
-<!-- Now process each of the reference items. -->
-            <xsl:for-each select="$bibl/listBibl/biblStruct">
-              <xsl:apply-templates select="." />
-            </xsl:for-each>
-          </xsl:element>
-        </xsl:if>
-      </xsl:element>
-    </article>
+					<!-- If there is an abstract, copy it in here for the sake of completeness. -->
+					<xsl:if test="TEI/text/body/div[@type='abstract']">
+						<abstract>
+							<xsl:apply-templates
+								select="TEI/text/body/div[@type='abstract']/*" />
+						</abstract>
+					</xsl:if>
 
-  </xsl:template>
-  
-<!-- Handling of items in profileDesc. -->
-  <xsl:template match="profileDesc"><xsl:apply-templates /></xsl:template>
-  <xsl:template match="textClass"><xsl:apply-templates /></xsl:template>
-  <xsl:template match="keywords">
-    <xsl:element name="kwd-group">
-      <xsl:if test="@scheme">
-        <xsl:attribute name="kwd-group-type" select="@scheme" />
-      </xsl:if>
-      <xsl:for-each select="list/item">
-        <xsl:element name="kwd">
-          <xsl:value-of select="." />
-        </xsl:element>
-      </xsl:for-each>
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template name="dateToDMYTags">
-    <xsl:param name="inDate" />
-    <xsl:param name="outTagName" />
-    <xsl:element name="{$outTagName}">
-      <xsl:variable name="frags" select="tokenize($inDate, '-')" />
-      <xsl:if test="count($frags) gt 2">
-        <day><xsl:value-of select="$frags[3]" /></day>
-      </xsl:if>
-      <xsl:if test="count($frags) gt 1">
-        <month><xsl:value-of select="$frags[2]" /></month>
-      </xsl:if>
-      <xsl:if test="count($frags) gt 0">
-        <year><xsl:value-of select="$frags[1]" /></year>
-      </xsl:if>
-    </xsl:element>
-  </xsl:template>
-  
-<!-- Block-level templates. -->
-<!--  Document divisions/sections. -->
-  <xsl:template match="div">
-    <xsl:element name="sec">
-<!-- If there's no title tag, we have to add an empty one. -->
-      <xsl:if test="not(child::head)"><title></title></xsl:if>
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="div/head">
-    <xsl:element name="title">
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="p | ab">
-    <xsl:element name="p">
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="list">
-    <xsl:element name="list">
-      <xsl:if test="@type">
-        <xsl:attribute name="list-type" select="@type" />
-      </xsl:if>
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="list/item">
-    <xsl:element name="list-item">
-      <p>
-        <xsl:apply-templates />
-      </p>
-    </xsl:element>
-  </xsl:template>
-  
-    <!-- Tables are simple for the moment, but they'll get complicated. -->
-    <xsl:template match="table">
-      <xsl:element name="table-wrap">
-        <xsl:if test="@rend">
-          <xsl:attribute name="specific-use" select="@rend"/>
-        </xsl:if>
-        <xsl:if test="head">
-          <xsl:element name="caption">
-            <xsl:element name="p">
-              <xsl:apply-templates select="head"/>
-            </xsl:element>
-          </xsl:element>
-          </xsl:if>
-        <xsl:element name="table">
-          <xsl:if test="@xml:id"><xsl:attribute name="id" select="@xml:id" /></xsl:if>
-            <xsl:apply-templates/>
-        </xsl:element>
-      </xsl:element>
-    </xsl:template>
-    <xsl:template match="table/row">
-        <xsl:element name="tr">
-            <xsl:apply-templates/>
-        </xsl:element>
-    </xsl:template>
-    <xsl:template match="table/row/cell">
-      <xsl:choose>
-        <xsl:when test="parent::row/@role='label'">
-          <xsl:element name="th">
-            <xsl:apply-templates />
-          </xsl:element>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:element name="td">
-            <xsl:apply-templates />
-          </xsl:element>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-  
-<!-- Suppress handling of the table caption (head), because the NLM model moves it 
-     into the parent table-wrap element, so we have to handle it at that point
-     (above). -->
-  <xsl:template match="table/head"></xsl:template>
-  
-<!--  Low-level element templates. -->
-  
-<!-- Copy xml:id to id attribute in output. -->
-  <xsl:template match="@xml:id"><xsl:attribute name="id" select="." /></xsl:template>
-  
-<!-- Copy xml:lang to output. -->
-  <xsl:template match="@xml:lang"><xsl:copy-of select="." /></xsl:template>
-  
-<!-- Quotations. Our TEI model is more sophisticated that NLM here; we need 
-to simplify a bit. -->
-  <xsl:template match="cit">
-    <xsl:if test="quote">
-      <xsl:element name="disp-quote">
-        <xsl:if test="@rend">
-          <xsl:attribute name="specific-use" select="@rend" />
-        </xsl:if>
-<!-- If the quote is already divided into paragraphs, we can simply process
-     it; if not, we must supply a p tag, because NLM requires a block tag 
-     inside disp-quote. -->
-        <xsl:choose>
-          <xsl:when test="quote/p">
-            <xsl:apply-templates select="quote" />
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:element name="p">
-              <xsl:apply-templates select="quote" />
-            </xsl:element>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:if test="@rend='block' and ref">
-          <xsl:element name="attrib">
-            <xsl:apply-templates select="ref" />
-          </xsl:element>
-        </xsl:if>
-      </xsl:element>
-    </xsl:if>
-    <xsl:if test="not(@rend='block') and ref">
-       <xsl:apply-templates select="ref" />
-    </xsl:if>
-  </xsl:template>
-  
-  <xsl:template match="ref">
-<!-- For ref elements, we need to distinguish between internal and external 
-because NLM handles them differently. -->
-    <xsl:choose>
-<!-- Internal reference. -->
-      <xsl:when test="starts-with(@target, '#')">
-        <xsl:element name="xref">
-          <xsl:variable name="targId" select="substring-after(@target, '#')" />
-          <xsl:attribute name="rid" select="$targId" />
-<!-- If it's a reference to a biblStruct element in the back matter, then it should 
-be given the recommended @ref-type. -->
-          <xsl:if test="//back//biblStruct[@xml:id = $targId]"><xsl:attribute name="ref-type">bibr</xsl:attribute></xsl:if>
-          
-<!-- We have to be careful of embedded tags, because xref has a very 
-     impoverished content model. -->
-          <xsl:apply-templates />
-        </xsl:element>
-      </xsl:when>
-<!-- External reference. -->
-      <xsl:otherwise>
-        <xsl:element name="ext-link">
-          <xsl:attribute name="xlink:href" select="@target" />
-<!-- We have to be careful of embedded tags, because ext-link has a very 
-     impoverished content model. -->
-          <xsl:apply-templates />
-        </xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-<!-- Abbreviations.  -->
-  <xsl:template match="choice[abbr]">
-    <xsl:apply-templates select="abbr"></xsl:apply-templates>
-  </xsl:template>
-  
-  <xsl:template match="abbr">
-    <xsl:choose>
-      <xsl:when test="not(ancestor::ref)">
-        <xsl:element name="abbrev">
-        <xsl:apply-templates />
-        <xsl:if test="preceding-sibling::expan"><def><p><xsl:apply-templates select="preceding-sibling::expan[1]" /></p></def></xsl:if>
-        <xsl:if test="following-sibling::expan"><def><p><xsl:apply-templates select="following-sibling::expan[1]" /></p></def></xsl:if>
-        </xsl:element>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="." />
-      </xsl:otherwise>
-    </xsl:choose>
-    
-  </xsl:template>
-  
-  
-<!-- Name elements are complicated, because we distinguish them by type, 
-     but NLM makes a distinction between the names of people and other 
-     types of name. The only appropriate NLM element I can find for the latter
-     is named-content. 
-     There is a further annoying complication, in that the <name> element 
-     in NLM can't show up inside regular body text, apparently.      
--->
+					<!-- Right now, profilDesc only contains keywords, but other templates 
+						might be added later. -->
+					<xsl:apply-templates
+						select="TEI/teiHeader/profileDesc"></xsl:apply-templates>
 
-  <xsl:template match="name[@type='person' or not(@type)][not(ancestor::div)]">
-    <xsl:element name="name">
-      <surname><xsl:apply-templates select="surname" /></surname>
-      <given-names><xsl:apply-templates select="forename" /></given-names>
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="name[@type='person' or not(@type)][ancestor::div]">
-    <xsl:element name="named-content">
-      <xsl:attribute name="content-type">person</xsl:attribute>
-      <xsl:value-of select="." />
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="affiliation/name[@type='org']">
-    <xsl:element name="institution">
-      <xsl:value-of select="." />
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="name[@type and not(@type='person')][ancestor::div]">
-    <xsl:element name="named-content">
-      <xsl:attribute name="content-type" select="@type" />
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-<!-- Notes (footnotes/endnotes). -->
-  <xsl:template match="note">
-    <xsl:element name="fn">
-      <xsl:choose>
-        <xsl:when test="not(child::p)">
-          <xsl:element name="p">
-            <xsl:apply-templates />
-          </xsl:element>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates />
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:element>
-  </xsl:template>
-  
-<!-- Figures and graphics. -->
-  <xsl:template match="figure">
-    <xsl:element name="fig">
-      <xsl:if test="@xml:id">
-        <xsl:attribute name="id" select="@xml:id" />
-      </xsl:if>
-      <xsl:apply-templates />
-    </xsl:element>  
-  </xsl:template>
-  
-  <xsl:template match="figure/head">
-    <caption><title><xsl:apply-templates /></title></caption>
-  </xsl:template>
-  
-  <xsl:template match="graphic">
-    <xsl:element name="graphic">
-      <xsl:attribute name="xlink:href" select="@url" />
-    </xsl:element>
-  </xsl:template>
-  
-<!-- Verse lines and groups. -->
-  <xsl:template match="lg">
-    <xsl:element name="verse-group">
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-  <xsl:template match="l">
-    <xsl:element name="verse-line">
-      <xsl:apply-templates />
-    </xsl:element>
-  </xsl:template>
-  
-  
-<!-- Bibliographical items. -->
-  <xsl:template match="listBibl/biblStruct">
-    <ref id="{@xml:id}">
-<!-- Now the hard bit. NLM's model is radically different from TEI's. -->
-      <element-citation publication-type="{@type}">
-        
-<!-- We're going to take the approach of picking out the information we 
-     need from where we expect to find it, rather than trying to apply 
-     templates in some generic way, because the structured nature of 
-     TEI biblStructs is so different from the rather looser structure 
-     of NLM. -->
-        
-<!-- First we look for authors. These might be in the analytic or in the 
-monogr; try analytic first. -->
-        <xsl:if test="analytic">
-<!-- In this case, we should be able to get both title and authors from here. -->
-          <person-group person-group-type="author">
-            <xsl:for-each select="analytic/author/name">
-              <name>
-                <surname><xsl:apply-templates select="surname" /></surname>
-                <given-names><xsl:apply-templates select="forename" /></given-names>
-              </name>
-            </xsl:for-each>
-          </person-group>
-<!-- Now we can get the title from here. NLM has an article-title element, which 
-     will do for journal articles; it uses chapter-title for book chapters. -->
-          <xsl:choose>
-            <xsl:when test="@type='book'"><chapter-title><xsl:apply-templates select="analytic/title" /></chapter-title></xsl:when>
-            <xsl:otherwise><article-title><xsl:apply-templates select="analytic/title" /></article-title></xsl:otherwise>
-          </xsl:choose> 
-        </xsl:if>
-<!-- Now we look for additional information in the monogr element. -->
-        <xsl:if test="monogr">
-<!-- If there's a monogr title element, it could be the level m or j (books and 
-journals), or it could be s (series title). We need to handle each separately.-->
-          <xsl:for-each select="monogr/title[@level='m' or @level='u' or @level='j']">
-            <source><xsl:value-of select="." /></source>
-          </xsl:for-each>
-<!-- Series titles. -->
-          <xsl:for-each select="monogr/title[@level='s']">
-            <series><xsl:value-of select="." /></series>
-          </xsl:for-each>
-<!-- Now we should look for authors and editors at the monogr level. -->
-          <xsl:if test="monogr/author">
-            <person-group person-group-type="author">
-              <xsl:for-each select="monogr/author/name">
-                <name>
-                  <surname><xsl:apply-templates select="surname" /></surname>
-                  <given-names><xsl:apply-templates select="forename" /></given-names>
-                </name>
-              </xsl:for-each>
-            </person-group>
-          </xsl:if>
-          <xsl:if test="monogr/editor">
-            <person-group person-group-type="editor">
-              <xsl:for-each select="monogr/editor/name">
-                <name>
-                  <surname><xsl:apply-templates select="surname" /></surname>
-                  <given-names><xsl:apply-templates select="forename" /></given-names>
-                </name>
-              </xsl:for-each>
-            </person-group>
-            <xsl:if test="edition">
-              <edition><xsl:value-of select="edition" /></edition>  
-            </xsl:if>
-          </xsl:if>
-          
-<!-- In TEI, idno elements are used for a variety of tasks. -->
-          <xsl:for-each select="monogr/idno">
-            <xsl:choose>
-              <xsl:when test="@type='ISSN'">
-                <issn><xsl:value-of select="." /></issn>
-              </xsl:when>
-              <xsl:when test="@type='ISBN'">
-                <isbn><xsl:value-of select="." /></isbn>
-              </xsl:when>
-            </xsl:choose>
-          </xsl:for-each>
-          
-<!-- Now we get the publication information from the imprint element. This can 
-     be handled with more conventional one-to-one mapping, so templates will do.-->
-          <xsl:apply-templates select="monogr/imprint" />
-        </xsl:if>
-<!-- We should process any respStmt elements in analytic or monogr. -->
-          <xsl:apply-templates select="descendant::respStmt">
-          </xsl:apply-templates>
-      </element-citation>
-    </ref>
-  </xsl:template>
-  
-<!-- These are mini-templates for the content of the imprint element in a 
-biblStruct. -->
-  <xsl:template match="biblStruct/monogr/imprint">
-    <xsl:apply-templates />
-  </xsl:template>
-  
-  <xsl:template match="publisher">
-    <publisher-name><xsl:apply-templates /></publisher-name>
-  </xsl:template>
-  
-  <xsl:template match="pubPlace">
-    <publisher-loc><xsl:apply-templates /></publisher-loc>
-  </xsl:template>
-  
-  <xsl:template match="biblStruct/monogr/imprint/date">
-    <year><xsl:value-of select="substring(@when, 1, 4)" /></year>
-    <xsl:if test="string-length(@when) gt 6">
-      <month><xsl:value-of select="substring(@when, 6, 2)" /></month>
-      <xsl:if test="string-length(@when) gt 9">
-        <day><xsl:value-of select="substring(@when, 9, 2)" /></day>
-      </xsl:if>
-    </xsl:if>
-  </xsl:template>
-  
-  <xsl:template match="biblStruct/monogr/imprint/biblScope">
-    <xsl:choose>
-      <xsl:when test="@type='vol'">
-        <volume><xsl:value-of select="." /></volume>
-      </xsl:when>
-      <xsl:when test="@type='issue'">
-        <issue><xsl:value-of select="." /></issue>
-      </xsl:when>
-      <xsl:when test="@type='pp'">
-        <fpage><xsl:value-of select="substring-before(., '-')"/></fpage>
-        <lpage><xsl:value-of select="substring-after(., '-')"/></lpage>
-      </xsl:when>
-<!--       ANY MORE??? -->
-      <!--<xsl:when test="@type=''"></xsl:when>
-      <xsl:when test="@type=''"></xsl:when>
-      <xsl:when test="@type=''"></xsl:when>-->
-      <xsl:otherwise><comment><xsl:value-of select="." /></comment></xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="biblStruct//note">
-    <comment><xsl:value-of select="." /></comment>
-  </xsl:template>
-  
-  <xsl:template match="respStmt[ancestor::biblStruct]">
-    <person-group person-group-type="{resp}">
-      <xsl:for-each select="name">
-        <name>
-                  <surname><xsl:apply-templates select="surname" /></surname>
-                  <given-names><xsl:apply-templates select="forename" /></given-names>
-                </name>
-      </xsl:for-each>
-    </person-group>
-  </xsl:template>
-  
-<!-- The soCalled element has no analogue in NLM; the best we can do 
-is probably to use style-content, enabling us to include the quotes and
-at the same time explain them. -->
-  <xsl:template match="soCalled">
-    <styled-content style-type="scare quotes" style="::before: content(open-quote); ::after: content(close-quote);">
-      <xsl:apply-templates />
-    </styled-content>
-  </xsl:template>
-  
-<!-- The mentioned tag is similarly difficult, as is the tag element, and term. -->
-  <xsl:template match="mentioned">
-    <styled-content style-type="mentioned" style="font-style: italic;">
-      <xsl:apply-templates />
-    </styled-content>
-  </xsl:template>
 
-  <xsl:template match="tag">
-    <styled-content style-type="XML tag" style="::before: content(&lt;); ::after: content(&gt;); font-family: monospace;">
-      <xsl:apply-templates />
-    </styled-content>
-  </xsl:template>
-  
-  <xsl:template match="term">
-    <styled-content style-type="term" style="font-style: italic;">
-      <xsl:apply-templates />
-    </styled-content>
-  </xsl:template>
-  
-<!-- Line breaks are equivalent to <break/>, but cannot appear in paragraphs 
-     What nonsense. -->
-  <xsl:template match="lb"><xsl:comment>There should be a line-break here.</xsl:comment></xsl:template>
-  
-<!-- Inline elements. -->
-<!-- There's no standard way to do document titles in the body text in NLM. -->
-  <xsl:template match="title[not(ancestor::biblStruct) and not(ancestor::teiHeader)]">
-    <named-content content-type="title_level_{@level}">
-<!-- That takes care of identifying the title type. Now we might as well 
-have a shot at styling it. -->
-      <xsl:choose>
-        <xsl:when test="@level='m' or @level='j'">
-          <italic><xsl:apply-templates /></italic>
-        </xsl:when>
-        <xsl:when test="@level='a'">
-          &quot;<xsl:apply-templates />&quot;
-        </xsl:when>
-      </xsl:choose>
-    </named-content>  
-  </xsl:template>
-  
-<!--  Text style markup. -->
-<!--  Bold. -->
-  <xsl:template match="hi[@rend='bold']">
-    <xsl:element name="bold"><xsl:apply-templates /></xsl:element>
-  </xsl:template>
-<!--  Italics. -->
-  <xsl:template match="hi[@rend='italic']">
-    <xsl:element name="italic"><xsl:apply-templates /></xsl:element>
-  </xsl:template> 
-<!--  Underline. -->
-  <xsl:template match="hi[@rend='underline']">
-    <xsl:element name="underline"><xsl:apply-templates /></xsl:element>
-  </xsl:template>
-<!--  Overline. -->
-  <xsl:template match="hi[@rend='overline']">
-    <xsl:element name="overline"><xsl:apply-templates /></xsl:element>
-  </xsl:template>
 
+				</xsl:element>
+
+			</xsl:element>
+
+			<!--Here's the meat of the document. -->
+			<xsl:element name="body">
+
+				<xsl:apply-templates select="TEI/text/body"></xsl:apply-templates>
+
+			</xsl:element>
+
+			<!-- This will contain the appendices, reference list, etc. -->
+
+			<xsl:element name="back">
+				<!-- Appendices first. -->
+				<xsl:if test="TEI/text/back/div[@type='appendix']">
+					<xsl:element name="app-group">
+						<xsl:for-each
+							select="TEI/text/back/div[@type='appendix']">
+							<xsl:element name="app">
+								<xsl:if test="@xml:id">
+									<xsl:attribute name="id" select="@xml:id" />
+								</xsl:if>
+								<xsl:apply-templates select="./*" />
+							</xsl:element>
+						</xsl:for-each>
+					</xsl:element>
+				</xsl:if>
+
+				<!-- Reference list -->
+				<xsl:if test="TEI/text/back/div[@type='bibliogr']">
+					<xsl:variable name="bibl"
+						select="TEI/text/back/div[@type='bibliogr']"></xsl:variable>
+					<xsl:element name="ref-list">
+						<!-- If there's no title tag, we have to add an empty one. -->
+						<title>
+							<xsl:value-of select="$bibl/head" />
+						</title>
+						<!-- Now process each of the reference items. -->
+						<xsl:for-each select="$bibl/listBibl/biblStruct">
+							<xsl:apply-templates select="." />
+						</xsl:for-each>
+					</xsl:element>
+				</xsl:if>
+			</xsl:element>
+		</article>
+
+	</xsl:template>
+
+	<!-- Handling of items in profileDesc. -->
+	<xsl:template match="profileDesc">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="textClass">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="keywords">
+		<xsl:element name="kwd-group">
+			<xsl:if test="@scheme">
+				<xsl:attribute name="kwd-group-type" select="@scheme" />
+			</xsl:if>
+			<xsl:for-each select="list/item">
+				<xsl:element name="kwd">
+					<xsl:value-of select="." />
+				</xsl:element>
+			</xsl:for-each>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template name="dateToDMYTags">
+		<xsl:param name="inDate" />
+		<xsl:param name="outTagName" />
+		<xsl:element name="{$outTagName}">
+			<xsl:variable name="frags"
+				select="tokenize($inDate, '-')" />
+			<xsl:if test="count($frags) gt 2">
+				<day>
+					<xsl:value-of select="$frags[3]" />
+				</day>
+			</xsl:if>
+			<xsl:if test="count($frags) gt 1">
+				<month>
+					<xsl:value-of select="$frags[2]" />
+				</month>
+			</xsl:if>
+			<xsl:if test="count($frags) gt 0">
+				<year>
+					<xsl:value-of select="$frags[1]" />
+				</year>
+			</xsl:if>
+		</xsl:element>
+	</xsl:template>
+
+	<!-- Block-level templates. -->
+	<!-- Document divisions/sections. -->
+	<xsl:template match="div">
+		<xsl:element name="sec">
+			<!-- If there's no title tag, we have to add an empty one. -->
+			<xsl:if test="not(child::head)">
+				<title></title>
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="div/head">
+		<xsl:element name="title">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="p | ab">
+		<xsl:element name="p">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="list">
+		<xsl:element name="list">
+			<xsl:if test="@type">
+				<xsl:attribute name="list-type" select="@type" />
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="list/item">
+		<xsl:element name="list-item">
+			<p>
+				<xsl:apply-templates />
+			</p>
+		</xsl:element>
+	</xsl:template>
+
+	<!-- Tables are simple for the moment, but they'll get complicated. -->
+	<xsl:template match="table">
+		<xsl:element name="table-wrap">
+			<xsl:if test="@rend">
+				<xsl:attribute name="specific-use" select="@rend" />
+			</xsl:if>
+			<xsl:if test="head">
+				<xsl:element name="caption">
+					<xsl:element name="p">
+						<xsl:apply-templates select="head" />
+					</xsl:element>
+				</xsl:element>
+			</xsl:if>
+			<xsl:element name="table">
+				<xsl:if test="@xml:id">
+					<xsl:attribute name="id" select="@xml:id" />
+				</xsl:if>
+				<xsl:apply-templates />
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	<xsl:template match="table/row">
+		<xsl:element name="tr">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+	<xsl:template match="table/row/cell">
+		<xsl:choose>
+			<xsl:when test="parent::row/@role='label'">
+				<xsl:element name="th">
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element name="td">
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<!-- Suppress handling of the table caption (head), because the NLM model 
+		moves it into the parent table-wrap element, so we have to handle it at that 
+		point (above). -->
+	<xsl:template match="table/head"></xsl:template>
+
+	<!-- Low-level element templates. -->
+
+	<!-- Copy xml:id to id attribute in output. -->
+	<xsl:template match="@xml:id">
+		<xsl:attribute name="id" select="." />
+	</xsl:template>
+
+	<!-- Copy xml:lang to output. -->
+	<xsl:template match="@xml:lang">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<!-- Quotations. Our TEI model is more sophisticated that NLM here; we need 
+		to simplify a bit. -->
+	<xsl:template match="cit">
+		<xsl:if test="quote">
+			<xsl:element name="disp-quote">
+				<xsl:if test="@rend">
+					<xsl:attribute name="specific-use" select="@rend" />
+				</xsl:if>
+				<!-- If the quote is already divided into paragraphs, we can simply process 
+					it; if not, we must supply a p tag, because NLM requires a block tag inside 
+					disp-quote. -->
+				<xsl:choose>
+					<xsl:when test="quote/p">
+						<xsl:apply-templates select="quote" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:element name="p">
+							<xsl:apply-templates select="quote" />
+						</xsl:element>
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:if test="@rend='block' and ref">
+					<xsl:element name="attrib">
+						<xsl:apply-templates select="ref" />
+					</xsl:element>
+				</xsl:if>
+			</xsl:element>
+		</xsl:if>
+		<xsl:if test="not(@rend='block') and ref">
+			<xsl:apply-templates select="ref" />
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="ref">
+		<!-- For ref elements, we need to distinguish between internal and external 
+			because NLM handles them differently. -->
+		<xsl:choose>
+			<!-- Internal reference. -->
+			<xsl:when test="starts-with(@target, '#')">
+				<xsl:element name="xref">
+					<xsl:variable name="targId"
+						select="substring-after(@target, '#')" />
+					<xsl:attribute name="rid" select="$targId" />
+					<!-- If it's a reference to a biblStruct element in the back matter, 
+						then it should be given the recommended @ref-type. -->
+					<xsl:if test="//back//biblStruct[@xml:id = $targId]">
+						<xsl:attribute name="ref-type">bibr</xsl:attribute>
+					</xsl:if>
+
+					<!-- We have to be careful of embedded tags, because xref has a very 
+						impoverished content model. -->
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:when>
+			<!-- External reference. -->
+			<xsl:otherwise>
+				<xsl:element name="ext-link">
+					<xsl:attribute name="xlink:href" select="@target" />
+					<!-- We have to be careful of embedded tags, because ext-link has a 
+						very impoverished content model. -->
+					<xsl:apply-templates />
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<!-- Abbreviations. -->
+	<xsl:template match="choice[abbr]">
+		<xsl:apply-templates select="abbr"></xsl:apply-templates>
+	</xsl:template>
+
+	<xsl:template match="abbr">
+		<xsl:choose>
+			<xsl:when test="not(ancestor::ref)">
+				<xsl:element name="abbrev">
+					<xsl:apply-templates />
+					<xsl:if test="preceding-sibling::expan">
+						<def>
+							<p>
+								<xsl:apply-templates
+									select="preceding-sibling::expan[1]" />
+							</p>
+						</def>
+					</xsl:if>
+					<xsl:if test="following-sibling::expan">
+						<def>
+							<p>
+								<xsl:apply-templates
+									select="following-sibling::expan[1]" />
+							</p>
+						</def>
+					</xsl:if>
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+
+	</xsl:template>
+
+
+	<!-- Name elements are complicated, because we distinguish them by type, 
+		but NLM makes a distinction between the names of people and other types of 
+		name. The only appropriate NLM element I can find for the latter is named-content. 
+		There is a further annoying complication, in that the <name> element in NLM 
+		can't show up inside regular body text, apparently. -->
+
+	<xsl:template
+		match="name[@type='person' or not(@type)][not(ancestor::div)]">
+		<xsl:element name="name">
+			<surname>
+				<xsl:apply-templates select="surname" />
+			</surname>
+			<given-names>
+				<xsl:apply-templates select="forename" />
+			</given-names>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template
+		match="name[@type='person' or not(@type)][ancestor::div]">
+		<xsl:element name="named-content">
+			<xsl:attribute name="content-type">person</xsl:attribute>
+			<xsl:value-of select="." />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="affiliation/name[@type='org']">
+		<xsl:element name="institution">
+			<xsl:value-of select="." />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template
+		match="name[@type and not(@type='person')][ancestor::div]">
+		<xsl:element name="named-content">
+			<xsl:attribute name="content-type" select="@type" />
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<!-- Notes (footnotes/endnotes). -->
+	<xsl:template match="note">
+		<xsl:element name="fn">
+			<xsl:choose>
+				<xsl:when test="not(child::p)">
+					<xsl:element name="p">
+						<xsl:apply-templates />
+					</xsl:element>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+
+	<!-- Figures and graphics. -->
+	<xsl:template match="figure">
+		<xsl:element name="fig">
+			<xsl:if test="@xml:id">
+				<xsl:attribute name="id" select="@xml:id" />
+			</xsl:if>
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="figure/head">
+		<caption>
+			<title>
+				<xsl:apply-templates />
+			</title>
+		</caption>
+	</xsl:template>
+
+	<xsl:template match="graphic">
+		<xsl:element name="graphic">
+			<xsl:attribute name="xlink:href" select="@url" />
+		</xsl:element>
+	</xsl:template>
+
+	<!-- Verse lines and groups. -->
+	<xsl:template match="lg">
+		<xsl:element name="verse-group">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="l">
+		<xsl:element name="verse-line">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
+
+	<!-- Bibliographical items. -->
+	<xsl:template match="listBibl/biblStruct">
+		<ref id="{@xml:id}">
+			<!-- Now the hard bit. NLM's model is radically different from TEI's. -->
+			<element-citation publication-type="{@type}">
+
+				<!-- We're going to take the approach of picking out the information 
+					we need from where we expect to find it, rather than trying to apply templates 
+					in some generic way, because the structured nature of TEI biblStructs is 
+					so different from the rather looser structure of NLM. -->
+
+				<!-- First we look for authors. These might be in the analytic or in 
+					the monogr; try analytic first. -->
+				<xsl:if test="analytic">
+					<!-- In this case, we should be able to get both title and authors from 
+						here. -->
+					<person-group person-group-type="author">
+						<xsl:for-each select="analytic/author/name">
+							<name>
+								<surname>
+									<xsl:apply-templates select="surname" />
+								</surname>
+								<given-names>
+									<xsl:apply-templates select="forename" />
+								</given-names>
+							</name>
+						</xsl:for-each>
+					</person-group>
+					<!-- Now we can get the title from here. NLM has an article-title element, 
+						which will do for journal articles; it uses chapter-title for book chapters. -->
+					<xsl:choose>
+						<xsl:when test="@type='book'">
+							<chapter-title>
+								<xsl:apply-templates select="analytic/title" />
+							</chapter-title>
+						</xsl:when>
+						<xsl:otherwise>
+							<article-title>
+								<xsl:apply-templates select="analytic/title" />
+							</article-title>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:if>
+				<!-- Now we look for additional information in the monogr element. -->
+				<xsl:if test="monogr">
+					<!-- If there's a monogr title element, it could be the level m or j 
+						(books and journals), or it could be s (series title). We need to handle 
+						each separately. -->
+					<xsl:for-each
+						select="monogr/title[@level='m' or @level='u' or @level='j']">
+						<source>
+							<xsl:value-of select="." />
+						</source>
+					</xsl:for-each>
+					<!-- Series titles. -->
+					<xsl:for-each select="monogr/title[@level='s']">
+						<series>
+							<xsl:value-of select="." />
+						</series>
+					</xsl:for-each>
+					<!-- Now we should look for authors and editors at the monogr level. -->
+					<xsl:if test="monogr/author">
+						<person-group person-group-type="author">
+							<xsl:for-each select="monogr/author/name">
+								<name>
+									<surname>
+										<xsl:apply-templates select="surname" />
+									</surname>
+									<given-names>
+										<xsl:apply-templates select="forename" />
+									</given-names>
+								</name>
+							</xsl:for-each>
+						</person-group>
+					</xsl:if>
+					<xsl:if test="monogr/editor">
+						<person-group person-group-type="editor">
+							<xsl:for-each select="monogr/editor/name">
+								<name>
+									<surname>
+										<xsl:apply-templates select="surname" />
+									</surname>
+									<given-names>
+										<xsl:apply-templates select="forename" />
+									</given-names>
+								</name>
+							</xsl:for-each>
+						</person-group>
+						<xsl:if test="edition">
+							<edition>
+								<xsl:value-of select="edition" />
+							</edition>
+						</xsl:if>
+					</xsl:if>
+
+					<!-- In TEI, idno elements are used for a variety of tasks. -->
+					<xsl:for-each select="monogr/idno">
+						<xsl:choose>
+							<xsl:when test="@type='ISSN'">
+								<issn>
+									<xsl:value-of select="." />
+								</issn>
+							</xsl:when>
+							<xsl:when test="@type='ISBN'">
+								<isbn>
+									<xsl:value-of select="." />
+								</isbn>
+							</xsl:when>
+						</xsl:choose>
+					</xsl:for-each>
+
+					<!-- Now we get the publication information from the imprint element. 
+						This can be handled with more conventional one-to-one mapping, so templates 
+						will do. -->
+					<xsl:apply-templates select="monogr/imprint" />
+				</xsl:if>
+				<!-- We should process any respStmt elements in analytic or monogr. -->
+				<xsl:apply-templates
+					select="descendant::respStmt">
+				</xsl:apply-templates>
+			</element-citation>
+		</ref>
+	</xsl:template>
+
+	<!-- These are mini-templates for the content of the imprint element in 
+		a biblStruct. -->
+	<xsl:template match="biblStruct/monogr/imprint">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="publisher">
+		<publisher-name>
+			<xsl:apply-templates />
+		</publisher-name>
+	</xsl:template>
+
+	<xsl:template match="pubPlace">
+		<publisher-loc>
+			<xsl:apply-templates />
+		</publisher-loc>
+	</xsl:template>
+
+	<xsl:template match="biblStruct/monogr/imprint/date">
+		<year>
+			<xsl:value-of select="substring(@when, 1, 4)" />
+		</year>
+		<xsl:if test="string-length(@when) gt 6">
+			<month>
+				<xsl:value-of select="substring(@when, 6, 2)" />
+			</month>
+			<xsl:if test="string-length(@when) gt 9">
+				<day>
+					<xsl:value-of select="substring(@when, 9, 2)" />
+				</day>
+			</xsl:if>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="biblStruct/monogr/imprint/biblScope">
+		<xsl:choose>
+			<xsl:when test="@type='vol'">
+				<volume>
+					<xsl:value-of select="." />
+				</volume>
+			</xsl:when>
+			<xsl:when test="@type='issue'">
+				<issue>
+					<xsl:value-of select="." />
+				</issue>
+			</xsl:when>
+			<xsl:when test="@type='pp'">
+				<fpage>
+					<xsl:value-of select="substring-before(., '-')" />
+				</fpage>
+				<lpage>
+					<xsl:value-of select="substring-after(., '-')" />
+				</lpage>
+			</xsl:when>
+			<!-- ANY MORE??? -->
+			<!--<xsl:when test="@type=''"></xsl:when> <xsl:when test="@type=''"></xsl:when> 
+				<xsl:when test="@type=''"></xsl:when> -->
+			<xsl:otherwise>
+				<comment>
+					<xsl:value-of select="." />
+				</comment>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="biblStruct//note">
+		<comment>
+			<xsl:value-of select="." />
+		</comment>
+	</xsl:template>
+
+	<xsl:template match="respStmt[ancestor::biblStruct]">
+		<person-group person-group-type="{resp}">
+			<xsl:for-each select="name">
+				<name>
+					<surname>
+						<xsl:apply-templates select="surname" />
+					</surname>
+					<given-names>
+						<xsl:apply-templates select="forename" />
+					</given-names>
+				</name>
+			</xsl:for-each>
+		</person-group>
+	</xsl:template>
+
+	<!-- The soCalled element has no analogue in NLM; the best we can do is 
+		probably to use style-content, enabling us to include the quotes and at the 
+		same time explain them. -->
+	<xsl:template match="soCalled">
+		<styled-content style-type="scare quotes"
+			style="::before: content(open-quote); ::after: content(close-quote);">
+			<xsl:apply-templates />
+		</styled-content>
+	</xsl:template>
+
+	<!-- The mentioned tag is similarly difficult, as is the tag element, and 
+		term. -->
+	<xsl:template match="mentioned">
+		<styled-content style-type="mentioned"
+			style="font-style: italic;">
+			<xsl:apply-templates />
+		</styled-content>
+	</xsl:template>
+
+	<xsl:template match="tag">
+		<styled-content style-type="XML tag"
+			style="::before: content(&lt;); ::after: content(&gt;); font-family: monospace;">
+			<xsl:apply-templates />
+		</styled-content>
+	</xsl:template>
+
+	<xsl:template match="term">
+		<styled-content style-type="term"
+			style="font-style: italic;">
+			<xsl:apply-templates />
+		</styled-content>
+	</xsl:template>
+
+	<!-- Line breaks are equivalent to <break/>, but cannot appear in paragraphs 
+		What nonsense. -->
+	<xsl:template match="lb">
+		<xsl:comment>
+			There should be a line-break here.
+		</xsl:comment>
+	</xsl:template>
+
+	<!-- Inline elements. -->
+	<!-- There's no standard way to do document titles in the body text in NLM. -->
+	<xsl:template
+		match="title[not(ancestor::biblStruct) and not(ancestor::teiHeader)]">
+		<named-content content-type="title_level_{@level}">
+			<!-- That takes care of identifying the title type. Now we might as well 
+				have a shot at styling it. -->
+			<xsl:choose>
+				<xsl:when test="@level='m' or @level='j'">
+					<italic>
+						<xsl:apply-templates />
+					</italic>
+				</xsl:when>
+				<xsl:when test="@level='a'">
+					&quot;
+					<xsl:apply-templates />
+					&quot;
+				</xsl:when>
+			</xsl:choose>
+		</named-content>
+	</xsl:template>
+
+	<!-- Text style markup. -->
+	<!-- Bold. -->
+	<xsl:template match="hi[@rend='bold']">
+		<xsl:element name="bold">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+	<!-- Italics. -->
+	<xsl:template match="hi[@rend='italic']">
+		<xsl:element name="italic">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+	<!-- Underline. -->
+	<xsl:template match="hi[@rend='underline']">
+		<xsl:element name="underline">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+	<!-- Overline. -->
+	<xsl:template match="hi[@rend='overline']">
+		<xsl:element name="overline">
+			<xsl:apply-templates />
+		</xsl:element>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/identity/identity.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/identity/identity.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/identity/identity.xsl	(revision 2397)
@@ -1,59 +1,65 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0">
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI utility stylesheet for identity transformation </p>
-         <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI utility stylesheet for identity transformation </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: identity.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-    <!-- identity transform -->
-    
-    <xsl:template match="@*|text()|comment()|processing-instruction()" mode="iden">
-        <xsl:copy-of select="."/>
-    </xsl:template>
-    
-    <xsl:template match="*" mode="iden">
-        <xsl:copy>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="iden"/>
-	     </xsl:copy>
-    </xsl:template>
-        
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: identity.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<!-- identity transform -->
+
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="iden">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*" mode="iden">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="iden" />
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/verbatim/verbatim.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/verbatim/verbatim.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/verbatim/verbatim.xsl	(revision 2397)
@@ -1,603 +1,757 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dbk="http://docbook.org/ns/docbook" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" exclude-result-prefixes="xlink xhtml dbk rng sch m tei teix atom">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for creating verbatim XML </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:sch="http://www.ascc.net/xml/schematron"
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:atom="http://www.w3.org/2005/Atom"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	xmlns:dbk="http://docbook.org/ns/docbook"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="xlink xhtml dbk rng sch m tei teix atom">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for creating verbatim XML </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: verbatim.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:strip-space elements="teix:* rng:* xsl:* xhtml:* atom:* m:*"/>
-  <xsl:param name="startComment">&lt;span class="comment"&gt;</xsl:param>
-  <xsl:param name="endComment">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startElement">&lt;span class="element"&gt;</xsl:param>
-  <xsl:param name="endElement">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startElementName">&lt;span class="elementname"&gt;</xsl:param>
-  <xsl:param name="endElementName">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startAttribute">&lt;span class="attribute"&gt;</xsl:param>
-  <xsl:param name="endAttribute">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startAttributeValue">&lt;span class="attributevalue"&gt;</xsl:param>
-  <xsl:param name="endAttributeValue">&lt;/span&gt;</xsl:param>
-  <xsl:param name="startNamespace">&lt;span class="namespace"&gt;</xsl:param>
-  <xsl:param name="endNamespace">&lt;/span&gt;</xsl:param>
-  <xsl:param name="spaceCharacter">&#160;</xsl:param>
-  <xsl:param name="showNamespaceDecls">true</xsl:param>
-  <xsl:param name="forceWrap">false</xsl:param>
-  <xsl:param name="wrapLength">65</xsl:param>
-  <xsl:param name="attLength">40</xsl:param>
-  <xsl:param name="attsOnSameLine">3</xsl:param>
-  <xsl:key name="Namespaces" match="*[ancestor::teix:egXML]" use="namespace-uri()"/>
-  <xsl:key name="Namespaces" match="*[not(ancestor::*)]" use="namespace-uri()"/>
-  <xsl:template name="verbatim-newLine"/>
-  <xsl:template name="verbatim-getNamespacePrefix">
-    <xsl:variable name="ns" select="namespace-uri()"/>
-    <xsl:choose>
-      <xsl:when test="$ns='http://www.w3.org/XML/1998/namespace'">xml</xsl:when>
-      <xsl:when test="$ns='http://www.tei-c.org/ns/1.0'">tei</xsl:when>
-      <xsl:when test="$ns='http://docbook.org/ns/docbook'">dbk</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/2001/XMLSchema'">xsd</xsl:when>
-      <xsl:when test="$ns='http://www.ascc.net/xml/schematron'">sch</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/1998/Math/MathML'">m</xsl:when>
-      <xsl:when test="$ns='http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0'">nvdl</xsl:when>
-      <xsl:when test="$ns='http://relaxng.org/ns/compatibility/annotations/1.0'">a</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/1999/xhtml'">xhtml</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/1999/xlink'">xlink</xsl:when>
-      <xsl:when test="$ns='http://relaxng.org/ns/structure/1.0'">rng</xsl:when>
-      <xsl:when test="$ns='http://earth.google.com/kml/2.1'">kml</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/2005/11/its'">its</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/1999/XSL/Transform'">xsl</xsl:when>
-      <xsl:when test="$ns='http://www.w3.org/2005/Atom'">atom</xsl:when>
-      <xsl:when test="$ns='http://purl.org/rss/1.0/modules/event/'">ev</xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-lineBreak">
-    <xsl:param name="id"/>
-    <xsl:text>&#10;</xsl:text>
-  </xsl:template>
-  <xsl:template match="comment()" mode="verbatim">
-    <xsl:choose>
-      <xsl:when test="ancestor::Wrapper"/>
-      <xsl:when test="ancestor::xhtml:Wrapper"/>
-      <xsl:otherwise>
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">21</xsl:with-param>
-        </xsl:call-template>
-        <xsl:value-of disable-output-escaping="yes" select="$startComment"/>
-        <xsl:text>&lt;!--</xsl:text>
-        <xsl:choose>
-          <xsl:when test="$forceWrap='true'">
-            <xsl:call-template name="verbatim-reformatText">
-              <xsl:with-param name="sofar">0</xsl:with-param>
-              <xsl:with-param name="indent">
-                <xsl:text> </xsl:text>
-              </xsl:with-param>
-              <xsl:with-param name="text">
-                <xsl:value-of select="normalize-space(.)"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="."/>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:text>--&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endComment"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="text()" mode="verbatim">
-    <xsl:choose>
-      <xsl:when test="$forceWrap='true'">
-        <xsl:variable name="indent">
-          <xsl:for-each select="parent::*">
-            <xsl:call-template name="verbatim-makeIndent"/>
-          </xsl:for-each>
-        </xsl:variable>
-        <xsl:if test="string-length(.)&gt;$wrapLength or parent::sch:assert">
-          <xsl:text>&#10;</xsl:text>
-          <xsl:value-of select="$indent"/>
-        </xsl:if>
-        <xsl:call-template name="verbatim-reformatText">
-          <xsl:with-param name="sofar">0</xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:value-of select="$indent"/>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-            <xsl:value-of select="normalize-space(.)"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:if test="string-length(.)&gt;$wrapLength or parent::sch:assert">
-          <xsl:text>&#10;</xsl:text>
-          <xsl:value-of select="$indent"/>
-        </xsl:if>
-      </xsl:when>
-      <xsl:when test="not(preceding-sibling::node() or         contains(.,'&#10;'))">
-        <xsl:if test="starts-with(.,' ')">
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="normalize-space(.)"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:if test="substring(.,string-length(.),1)=' '">
-          <xsl:text> </xsl:text>
-        </xsl:if>
-      </xsl:when>
-      <xsl:when test="normalize-space(.)=''">
-        <xsl:for-each select="following-sibling::*[1]">
-          <xsl:call-template name="verbatim-lineBreak">
-            <xsl:with-param name="id">7</xsl:with-param>
-          </xsl:call-template>
-          <xsl:call-template name="verbatim-makeIndent"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="verbatim-wraptext">
-          <xsl:with-param name="count">0</xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:for-each select="parent::*">
-              <xsl:call-template name="verbatim-makeIndent"/>
-            </xsl:for-each>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-            <xsl:choose>
-              <xsl:when test="starts-with(.,'&#10;') and not          (preceding-sibling::node())">
-                <xsl:value-of select="translate(substring(.,2),'&#10;','⌤')"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="translate(.,'&#10;','⌤')"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:with-param>
-        </xsl:call-template>
-        <!--
-	<xsl:if test="substring(.,string-length(.))=' '">
-	  <xsl:text> </xsl:text>
-	</xsl:if>
-	-->
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-reformatText">
-    <xsl:param name="indent"/>
-    <xsl:param name="text"/>
-    <xsl:param name="sofar"/>
-    <xsl:choose>
-      <xsl:when test="$sofar&gt;$wrapLength">
-        <xsl:text>&#10;</xsl:text>
-        <xsl:value-of select="$indent"/>
-        <xsl:call-template name="verbatim-reformatText">
-          <xsl:with-param name="text">
-            <xsl:value-of select="$text"/>
-          </xsl:with-param>
-          <xsl:with-param name="sofar">
-            <xsl:text>0</xsl:text>
-          </xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:value-of select="$indent"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="not(contains($text,' '))">
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="$text"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="chunk">
-          <xsl:value-of select="substring-before($text,' ')"/>
-        </xsl:variable>
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="$chunk"/>
-            <xsl:text> </xsl:text>
-          </xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="verbatim-reformatText">
-          <xsl:with-param name="text">
-            <xsl:value-of select="substring-after($text,' ')"/>
-          </xsl:with-param>
-          <xsl:with-param name="sofar">
-            <xsl:value-of select="$sofar + string-length($chunk) + 1"/>
-          </xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:value-of select="$indent"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-wraptext">
-    <xsl:param name="indent"/>
-    <xsl:param name="text"/>
-    <xsl:param name="count">0</xsl:param>
-    <xsl:variable name="finalSpace">
-      <xsl:choose>
-        <xsl:when test="substring($text,string-length($text),1)=' '">
-          <xsl:text> </xsl:text>
-        </xsl:when>
-        <xsl:when test="substring($text,string-length($text),1)='⌤'">
-          <xsl:text> </xsl:text>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:text/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <!--
-<xsl:message>my text is [<xsl:value-of select="$text"/>]</xsl:message>
-<xsl:message>my space is [<xsl:value-of select="$finalSpace"/>]</xsl:message>
--->
-    <xsl:choose>
-      <xsl:when test="normalize-space($text)=''"/>
-      <xsl:when test="contains($text,'⌤')">
-        <xsl:if test="$count &gt; 0">
-          <xsl:value-of select="$indent"/>
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:if test="starts-with($text,' ')">
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="normalize-space(substring-before($text,'⌤'))"/>
-          </xsl:with-param>
-        </xsl:call-template>
-        <!--	<xsl:if test="not(substring-after($text,'&#10;')='')">-->
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">6</xsl:with-param>
-        </xsl:call-template>
-        <xsl:value-of select="$indent"/>
-        <xsl:call-template name="verbatim-wraptext">
-          <xsl:with-param name="indent">
-            <xsl:value-of select="$indent"/>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-            <xsl:value-of select="normalize-space(substring-after($text,'⌤'))"/>
-            <xsl:value-of select="$finalSpace"/>
-          </xsl:with-param>
-          <xsl:with-param name="count">
-            <xsl:value-of select="$count + 1"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:if test="starts-with($text,' ')">
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:if test="$count &gt; 0 and parent::*">
-          <xsl:value-of select="$indent"/>
-          <xsl:text> </xsl:text>
-        </xsl:if>
-        <xsl:call-template name="verbatim-Text">
-          <xsl:with-param name="words">
-            <xsl:value-of select="normalize-space($text)"/>
-            <xsl:value-of select="$finalSpace"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-Text">
-    <xsl:param name="words"/>
-    <xsl:analyze-string select="." regex="(&amp;)">
-      <xsl:matching-substring>
-        <xsl:text>&amp;amp;</xsl:text>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>
-        <xsl:value-of select="."/>
-      </xsl:non-matching-substring>
-    </xsl:analyze-string>
-  </xsl:template>
-  <xsl:template match="*" mode="verbatim">
-    <xsl:choose>
-      <xsl:when test="parent::xhtml:Wrapper"/>
-      <!--      <xsl:when test="child::node()[last()]/self::text()[not(.='')] and child::node()[1]/self::text()[not(.='')]"/>-->
-      <xsl:when test="not(parent::*)  or parent::teix:egXML">
-        <xsl:choose>
-          <xsl:when test="preceding-sibling::node()[1][self::text()]      and following-sibling::node()[1][self::text()]"/>
-          <xsl:when test="preceding-sibling::*">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">-1</xsl:with-param>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="verbatim-newLine"/>
-            <!-- <xsl:call-template name="makeIndent"/>-->
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="not(preceding-sibling::node())">
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">-2</xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="verbatim-makeIndent"/>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::node()[1]/self::*">
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">1</xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="verbatim-makeIndent"/>
-      </xsl:when>
-      <xsl:when test="preceding-sibling::node()[1]/self::text()"> </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="verbatim-lineBreak">
-          <xsl:with-param name="id">9</xsl:with-param>
-        </xsl:call-template>
-        <xsl:call-template name="verbatim-makeIndent"/>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
-    <xsl:text>&lt;</xsl:text>
-    <xsl:call-template name="verbatim-makeElementName">
-      <xsl:with-param name="start">true</xsl:with-param>
-    </xsl:call-template>
-    <xsl:apply-templates select="@*" mode="verbatim"/>
-    <xsl:if test="$showNamespaceDecls='true' or parent::teix:egXML[@rend='full']">
-      <!--
-	  <xsl:variable name="me" select="."/>
-	  <xsl:message><xsl:value-of select="name()"/>: </xsl:message>
-	  <xsl:for-each select="in-scope-prefixes(.)">
-	  <xsl:message>  .. <xsl:value-of select="."/>: <xsl:value-of select="namespace-uri-for-prefix(.,$me)"/> </xsl:message>
-	  </xsl:for-each>
-      -->
-      <!-- 2009-02-01 stop emitting xmlns at all -->
-      <!--
-      <xsl:choose>
-        <xsl:when test="not(parent::*)">
-          <xsl:apply-templates select="." mode="ns"/>
-        </xsl:when>
-        <xsl:when test="parent::teix:egXML and not(preceding-sibling::*)">
-          <xsl:apply-templates select="." mode="ns"/>
-        </xsl:when>
-      </xsl:choose>
-      -->
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="child::node()">
-        <xsl:text>&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-        <xsl:apply-templates mode="verbatim"/>
-        <xsl:choose>
-          <xsl:when test="child::node()[last()]/self::text() and child::node()[1]/self::text()"/>
-          <xsl:when test="not(parent::*)  or parent::teix:egXML">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">23</xsl:with-param>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:when test="child::node()[last()]/self::text()[normalize-space(.)='']">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">3</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="verbatim-makeIndent"/>
-          </xsl:when>
-          <xsl:when test="child::node()[last()]/self::comment()">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">4</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="verbatim-makeIndent"/>
-          </xsl:when>
-          <xsl:when test="child::node()[last()]/self::*">
-            <xsl:call-template name="verbatim-lineBreak">
-              <xsl:with-param name="id">5</xsl:with-param>
-            </xsl:call-template>
-            <xsl:call-template name="verbatim-makeIndent"/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
-        <xsl:text>&lt;/</xsl:text>
-        <xsl:call-template name="verbatim-makeElementName">
-          <xsl:with-param name="start">false</xsl:with-param>
-        </xsl:call-template>
-        <xsl:text>&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>/&gt;</xsl:text>
-        <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-createElement">
-    <xsl:param name="special"/>
-    <xsl:param name="name"/>
-    <xsl:value-of select="$name"/>
-  </xsl:template>
-  <xsl:template name="verbatim-createAttribute">
-    <xsl:param name="name"/>
-    <xsl:value-of select="$name"/>
-  </xsl:template>
-  <xsl:template name="verbatim-makeElementName">
-    <xsl:param name="start"/>
-    <!-- get namespace prefix -->
-    <xsl:variable name="ns-prefix">
-      <xsl:call-template name="verbatim-getNamespacePrefix"/>
-    </xsl:variable>
-    <xsl:variable name="ns-parent">
-      <xsl:for-each select="parent::*">
-        <xsl:value-of select="namespace-uri()"/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:variable name="ns">
-      <xsl:value-of select="namespace-uri()"/>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="namespace-uri()='http://www.tei-c.org/ns/Examples'">
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="local-name(.)"/>
-          <xsl:with-param name="special"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="string-length($ns-prefix) &gt; 0">
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="concat($ns-prefix,concat(':',local-name(.)))"/>
-          <xsl:with-param name="special"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$ns-parent=$ns">
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="local-name(.)"/>
-          <xsl:with-param name="special"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="not($ns='')">
-        <xsl:call-template name="verbatim-createElement">
-          <xsl:with-param name="name" select="local-name(.)"/>
-          <xsl:with-param name="special"/>
-        </xsl:call-template>
-        <xsl:if test="$start='true'">
-          <xsl:text> xmlns="</xsl:text>
-          <xsl:value-of select="namespace-uri()"/>
-          <xsl:text>"</xsl:text>
-          <xsl:call-template name="verbatim-lineBreak">
-            <xsl:with-param name="id">5</xsl:with-param>
-          </xsl:call-template>
-          <xsl:call-template name="verbatim-makeIndent"/>
-        </xsl:if>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
-        <xsl:value-of select="local-name(.)"/>
-        <xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="verbatim-makeIndent">
-    <xsl:variable name="depth" select="count(ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')])"/>
-    <xsl:call-template name="verbatim-makeSpace">
-      <xsl:with-param name="d">
-        <xsl:value-of select="$depth"/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template name="verbatim-makeSpace">
-    <xsl:param name="d"/>
-    <xsl:if test="number($d)&gt;1">
-      <xsl:value-of select="$spaceCharacter"/>
-      <xsl:call-template name="verbatim-makeSpace">
-        <xsl:with-param name="d">
-          <xsl:value-of select="$d -1"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="@*" mode="verbatim">
-    <xsl:variable name="L">
-      <xsl:for-each select="../@*">
-        <xsl:value-of select="."/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:if test="count(../@*)&gt;$attsOnSameLine or      string-length($L)&gt;$attLength or     ancestor::tei:cell[not(@rend='wovenodd-col2')] or     namespace-uri()='http://www.w3.org/2005/11/its' or     string-length(.)+string-length(name(.)) &gt;     $attLength">
-      <xsl:call-template name="verbatim-lineBreak">
-        <xsl:with-param name="id">5</xsl:with-param>
-      </xsl:call-template>
-      <xsl:call-template name="verbatim-makeIndent"/>
-    </xsl:if>
-    <xsl:value-of select="$spaceCharacter"/>
-    <xsl:variable name="ns-prefix">
-      <xsl:call-template name="verbatim-getNamespacePrefix"/>
-    </xsl:variable>
-    <xsl:variable name="name">
-      <xsl:choose>
-        <xsl:when test="string-length($ns-prefix) &gt; 0">
-          <xsl:value-of select="$ns-prefix"/>
-          <xsl:text>:</xsl:text>
-          <xsl:value-of select="local-name(.)"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name(.)"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:call-template name="verbatim-createAttribute">
-      <xsl:with-param name="name" select="$name"/>
-    </xsl:call-template>
-    <xsl:text>="</xsl:text>
-    <xsl:value-of disable-output-escaping="yes" select="$startAttributeValue"/>
-    <xsl:apply-templates select="." mode="attributetext"/>
-    <xsl:value-of disable-output-escaping="yes" select="$endAttributeValue"/>
-    <xsl:text>"</xsl:text>
-  </xsl:template>
-  <xsl:template match="@*" mode="attributetext">
-    <xsl:choose>
-      <xsl:when test="string-length(.)&gt;$attLength and contains(.,' ')">
-        <xsl:call-template name="verbatim-reformatText">
-          <xsl:with-param name="sofar">0</xsl:with-param>
-          <xsl:with-param name="indent">
-            <xsl:text> </xsl:text>
-          </xsl:with-param>
-          <xsl:with-param name="text">
-            <xsl:value-of select="normalize-space(.)"/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="."/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template match="text()|comment()|processing-instruction()" mode="ns"/>
-  <xsl:template match="@*|*" mode="ns">
-    <xsl:variable name="ns" select="namespace-uri()"/>
-    <xsl:choose>
-      <xsl:when test="$ns=''"/>
-      <xsl:when test="$ns='http://relaxng.org/ns/structure/1.0'"/>
-      <xsl:when test="$ns='http://www.w3.org/2001/XInclude'"/>
-      <xsl:when test="$ns='http://www.tei-c.org/ns/Examples'"/>
-      <xsl:when test="$ns='http://www.ascc.net/xml/schematron'"/>
-      <xsl:when test="$ns='http://relaxng.org/ns/compatibility/annotations/1.0'"/>
-      <xsl:when test="$ns='http://www.w3.org/XML/1998/namespace'"/>
-      <xsl:otherwise>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:apply-templates mode="ns" select="@*|*"/>
-  </xsl:template>
-  <xsl:template name="ns">
-    <xsl:param name="nsname"/>
-    <xsl:call-template name="verbatim-lineBreak">
-      <xsl:with-param name="id">22</xsl:with-param>
-    </xsl:call-template>
-    <xsl:text>&#160;&#160;&#160;</xsl:text>
-    <xsl:text>xmlns:</xsl:text>
-    <xsl:value-of select="name(.)"/>
-    <xsl:text>="</xsl:text>
-    <xsl:value-of select="."/>
-    <xsl:text>"</xsl:text>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: verbatim.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:strip-space
+		elements="teix:* rng:* xsl:* xhtml:* atom:* m:*" />
+	<xsl:param name="startComment">
+		&lt;span class="comment"&gt;
+	</xsl:param>
+	<xsl:param name="endComment">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startElement">
+		&lt;span class="element"&gt;
+	</xsl:param>
+	<xsl:param name="endElement">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startElementName">
+		&lt;span class="elementname"&gt;
+	</xsl:param>
+	<xsl:param name="endElementName">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startAttribute">
+		&lt;span class="attribute"&gt;
+	</xsl:param>
+	<xsl:param name="endAttribute">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startAttributeValue">
+		&lt;span class="attributevalue"&gt;
+	</xsl:param>
+	<xsl:param name="endAttributeValue">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="startNamespace">
+		&lt;span class="namespace"&gt;
+	</xsl:param>
+	<xsl:param name="endNamespace">
+		&lt;/span&gt;
+	</xsl:param>
+	<xsl:param name="spaceCharacter">
+		&#160;
+	</xsl:param>
+	<xsl:param name="showNamespaceDecls">
+		true
+	</xsl:param>
+	<xsl:param name="forceWrap">
+		false
+	</xsl:param>
+	<xsl:param name="wrapLength">
+		65
+	</xsl:param>
+	<xsl:param name="attLength">
+		40
+	</xsl:param>
+	<xsl:param name="attsOnSameLine">
+		3
+	</xsl:param>
+	<xsl:key name="Namespaces" match="*[ancestor::teix:egXML]"
+		use="namespace-uri()" />
+	<xsl:key name="Namespaces" match="*[not(ancestor::*)]"
+		use="namespace-uri()" />
+	<xsl:template name="verbatim-newLine" />
+	<xsl:template name="verbatim-getNamespacePrefix">
+		<xsl:variable name="ns" select="namespace-uri()" />
+		<xsl:choose>
+			<xsl:when test="$ns='http://www.w3.org/XML/1998/namespace'">
+				xml
+			</xsl:when>
+			<xsl:when test="$ns='http://www.tei-c.org/ns/1.0'">
+				tei
+			</xsl:when>
+			<xsl:when test="$ns='http://docbook.org/ns/docbook'">
+				dbk
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/2001/XMLSchema'">
+				xsd
+			</xsl:when>
+			<xsl:when test="$ns='http://www.ascc.net/xml/schematron'">
+				sch
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/1998/Math/MathML'">
+				m
+			</xsl:when>
+			<xsl:when
+				test="$ns='http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0'">
+				nvdl
+			</xsl:when>
+			<xsl:when
+				test="$ns='http://relaxng.org/ns/compatibility/annotations/1.0'">
+				a
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/1999/xhtml'">
+				xhtml
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/1999/xlink'">
+				xlink
+			</xsl:when>
+			<xsl:when test="$ns='http://relaxng.org/ns/structure/1.0'">
+				rng
+			</xsl:when>
+			<xsl:when test="$ns='http://earth.google.com/kml/2.1'">
+				kml
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/2005/11/its'">
+				its
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/1999/XSL/Transform'">
+				xsl
+			</xsl:when>
+			<xsl:when test="$ns='http://www.w3.org/2005/Atom'">
+				atom
+			</xsl:when>
+			<xsl:when
+				test="$ns='http://purl.org/rss/1.0/modules/event/'">
+				ev
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-lineBreak">
+		<xsl:param name="id" />
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
+	<xsl:template match="comment()" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="ancestor::Wrapper" />
+			<xsl:when test="ancestor::xhtml:Wrapper" />
+			<xsl:otherwise>
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						21
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startComment" />
+				<xsl:text>&lt;!--</xsl:text>
+				<xsl:choose>
+					<xsl:when test="$forceWrap='true'">
+						<xsl:call-template name="verbatim-reformatText">
+							<xsl:with-param name="sofar">
+								0
+							</xsl:with-param>
+							<xsl:with-param name="indent">
+								<xsl:text> </xsl:text>
+							</xsl:with-param>
+							<xsl:with-param name="text">
+								<xsl:value-of select="normalize-space(.)" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="." />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:text>--&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endComment" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template match="text()" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="$forceWrap='true'">
+				<xsl:variable name="indent">
+					<xsl:for-each select="parent::*">
+						<xsl:call-template name="verbatim-makeIndent" />
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:if
+					test="string-length(.)&gt;$wrapLength or parent::sch:assert">
+					<xsl:text>&#10;</xsl:text>
+					<xsl:value-of select="$indent" />
+				</xsl:if>
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="sofar">
+						0
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of select="normalize-space(.)" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if
+					test="string-length(.)&gt;$wrapLength or parent::sch:assert">
+					<xsl:text>&#10;</xsl:text>
+					<xsl:value-of select="$indent" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:when
+				test="not(preceding-sibling::node() or         contains(.,'&#10;'))">
+				<xsl:if test="starts-with(.,' ')">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="normalize-space(.)" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:if test="substring(.,string-length(.),1)=' '">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+			</xsl:when>
+			<xsl:when test="normalize-space(.)=''">
+				<xsl:for-each select="following-sibling::*[1]">
+					<xsl:call-template name="verbatim-lineBreak">
+						<xsl:with-param name="id">
+							7
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:call-template name="verbatim-makeIndent" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="verbatim-wraptext">
+					<xsl:with-param name="count">
+						0
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:for-each select="parent::*">
+							<xsl:call-template name="verbatim-makeIndent" />
+						</xsl:for-each>
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:choose>
+							<xsl:when
+								test="starts-with(.,'&#10;') and not          (preceding-sibling::node())">
+								<xsl:value-of
+									select="translate(substring(.,2),'&#10;','⌤')" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="translate(.,'&#10;','⌤')" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+				</xsl:call-template>
+				<!-- <xsl:if test="substring(.,string-length(.))=' '"> <xsl:text> </xsl:text> 
+					</xsl:if> -->
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-reformatText">
+		<xsl:param name="indent" />
+		<xsl:param name="text" />
+		<xsl:param name="sofar" />
+		<xsl:choose>
+			<xsl:when test="$sofar&gt;$wrapLength">
+				<xsl:text>&#10;</xsl:text>
+				<xsl:value-of select="$indent" />
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="text">
+						<xsl:value-of select="$text" />
+					</xsl:with-param>
+					<xsl:with-param name="sofar">
+						<xsl:text>0</xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not(contains($text,' '))">
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="$text" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="chunk">
+					<xsl:value-of select="substring-before($text,' ')" />
+				</xsl:variable>
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="$chunk" />
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="text">
+						<xsl:value-of select="substring-after($text,' ')" />
+					</xsl:with-param>
+					<xsl:with-param name="sofar">
+						<xsl:value-of
+							select="$sofar + string-length($chunk) + 1" />
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-wraptext">
+		<xsl:param name="indent" />
+		<xsl:param name="text" />
+		<xsl:param name="count">
+			0
+		</xsl:param>
+		<xsl:variable name="finalSpace">
+			<xsl:choose>
+				<xsl:when
+					test="substring($text,string-length($text),1)=' '">
+					<xsl:text> </xsl:text>
+				</xsl:when>
+				<xsl:when
+					test="substring($text,string-length($text),1)='⌤'">
+					<xsl:text> </xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<!-- <xsl:message>my text is [<xsl:value-of select="$text"/>]</xsl:message> 
+			<xsl:message>my space is [<xsl:value-of select="$finalSpace"/>]</xsl:message> -->
+		<xsl:choose>
+			<xsl:when test="normalize-space($text)=''" />
+			<xsl:when test="contains($text,'⌤')">
+				<xsl:if test="$count &gt; 0">
+					<xsl:value-of select="$indent" />
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:if test="starts-with($text,' ')">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of
+							select="normalize-space(substring-before($text,'⌤'))" />
+					</xsl:with-param>
+				</xsl:call-template>
+				<!-- <xsl:if test="not(substring-after($text,'&#10;')='')"> -->
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						6
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:value-of select="$indent" />
+				<xsl:call-template name="verbatim-wraptext">
+					<xsl:with-param name="indent">
+						<xsl:value-of select="$indent" />
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of
+							select="normalize-space(substring-after($text,'⌤'))" />
+						<xsl:value-of select="$finalSpace" />
+					</xsl:with-param>
+					<xsl:with-param name="count">
+						<xsl:value-of select="$count + 1" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="starts-with($text,' ')">
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:if test="$count &gt; 0 and parent::*">
+					<xsl:value-of select="$indent" />
+					<xsl:text> </xsl:text>
+				</xsl:if>
+				<xsl:call-template name="verbatim-Text">
+					<xsl:with-param name="words">
+						<xsl:value-of select="normalize-space($text)" />
+						<xsl:value-of select="$finalSpace" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-Text">
+		<xsl:param name="words" />
+		<xsl:analyze-string select="." regex="(&amp;)">
+			<xsl:matching-substring>
+				<xsl:text>&amp;amp;</xsl:text>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:value-of select="." />
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+	</xsl:template>
+	<xsl:template match="*" mode="verbatim">
+		<xsl:choose>
+			<xsl:when test="parent::xhtml:Wrapper" />
+			<!-- <xsl:when test="child::node()[last()]/self::text()[not(.='')] and 
+				child::node()[1]/self::text()[not(.='')]"/> -->
+			<xsl:when test="not(parent::*)  or parent::teix:egXML">
+				<xsl:choose>
+					<xsl:when
+						test="preceding-sibling::node()[1][self::text()]      and following-sibling::node()[1][self::text()]" />
+					<xsl:when test="preceding-sibling::*">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								-1
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="verbatim-newLine" />
+						<!-- <xsl:call-template name="makeIndent"/> -->
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="not(preceding-sibling::node())">
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						-2
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="verbatim-makeIndent" />
+			</xsl:when>
+			<xsl:when test="preceding-sibling::node()[1]/self::*">
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						1
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="verbatim-makeIndent" />
+			</xsl:when>
+			<xsl:when test="preceding-sibling::node()[1]/self::text()">
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="verbatim-lineBreak">
+					<xsl:with-param name="id">
+						9
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:call-template name="verbatim-makeIndent" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:value-of disable-output-escaping="yes"
+			select="$startElement" />
+		<xsl:text>&lt;</xsl:text>
+		<xsl:call-template name="verbatim-makeElementName">
+			<xsl:with-param name="start">
+				true
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:apply-templates select="@*" mode="verbatim" />
+		<xsl:if
+			test="$showNamespaceDecls='true' or parent::teix:egXML[@rend='full']">
+			<!-- <xsl:variable name="me" select="."/> <xsl:message><xsl:value-of select="name()"/>: 
+				</xsl:message> <xsl:for-each select="in-scope-prefixes(.)"> <xsl:message> 
+				.. <xsl:value-of select="."/>: <xsl:value-of select="namespace-uri-for-prefix(.,$me)"/> 
+				</xsl:message> </xsl:for-each> -->
+			<!-- 2009-02-01 stop emitting xmlns at all -->
+			<!-- <xsl:choose> <xsl:when test="not(parent::*)"> <xsl:apply-templates 
+				select="." mode="ns"/> </xsl:when> <xsl:when test="parent::teix:egXML and 
+				not(preceding-sibling::*)"> <xsl:apply-templates select="." mode="ns"/> </xsl:when> 
+				</xsl:choose> -->
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="child::node()">
+				<xsl:text>&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+				<xsl:apply-templates mode="verbatim" />
+				<xsl:choose>
+					<xsl:when
+						test="child::node()[last()]/self::text() and child::node()[1]/self::text()" />
+					<xsl:when test="not(parent::*)  or parent::teix:egXML">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								23
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when
+						test="child::node()[last()]/self::text()[normalize-space(.)='']">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								3
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="verbatim-makeIndent" />
+					</xsl:when>
+					<xsl:when test="child::node()[last()]/self::comment()">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								4
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="verbatim-makeIndent" />
+					</xsl:when>
+					<xsl:when test="child::node()[last()]/self::*">
+						<xsl:call-template name="verbatim-lineBreak">
+							<xsl:with-param name="id">
+								5
+							</xsl:with-param>
+						</xsl:call-template>
+						<xsl:call-template name="verbatim-makeIndent" />
+					</xsl:when>
+				</xsl:choose>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElement" />
+				<xsl:text>&lt;/</xsl:text>
+				<xsl:call-template name="verbatim-makeElementName">
+					<xsl:with-param name="start">
+						false
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text>&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>/&gt;</xsl:text>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElement" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-createElement">
+		<xsl:param name="special" />
+		<xsl:param name="name" />
+		<xsl:value-of select="$name" />
+	</xsl:template>
+	<xsl:template name="verbatim-createAttribute">
+		<xsl:param name="name" />
+		<xsl:value-of select="$name" />
+	</xsl:template>
+	<xsl:template name="verbatim-makeElementName">
+		<xsl:param name="start" />
+		<!-- get namespace prefix -->
+		<xsl:variable name="ns-prefix">
+			<xsl:call-template
+				name="verbatim-getNamespacePrefix" />
+		</xsl:variable>
+		<xsl:variable name="ns-parent">
+			<xsl:for-each select="parent::*">
+				<xsl:value-of select="namespace-uri()" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:variable name="ns">
+			<xsl:value-of select="namespace-uri()" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="namespace-uri()='http://www.tei-c.org/ns/Examples'">
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name" select="local-name(.)" />
+					<xsl:with-param name="special" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="string-length($ns-prefix) &gt; 0">
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name"
+						select="concat($ns-prefix,concat(':',local-name(.)))" />
+					<xsl:with-param name="special" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$ns-parent=$ns">
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name" select="local-name(.)" />
+					<xsl:with-param name="special" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="not($ns='')">
+				<xsl:call-template name="verbatim-createElement">
+					<xsl:with-param name="name" select="local-name(.)" />
+					<xsl:with-param name="special" />
+				</xsl:call-template>
+				<xsl:if test="$start='true'">
+					<xsl:text> xmlns="</xsl:text>
+					<xsl:value-of select="namespace-uri()" />
+					<xsl:text>"</xsl:text>
+					<xsl:call-template name="verbatim-lineBreak">
+						<xsl:with-param name="id">
+							5
+						</xsl:with-param>
+					</xsl:call-template>
+					<xsl:call-template name="verbatim-makeIndent" />
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of disable-output-escaping="yes"
+					select="$startElementName" />
+				<xsl:value-of select="local-name(.)" />
+				<xsl:value-of disable-output-escaping="yes"
+					select="$endElementName" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="verbatim-makeIndent">
+		<xsl:variable name="depth"
+			select="count(ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')])" />
+		<xsl:call-template name="verbatim-makeSpace">
+			<xsl:with-param name="d">
+				<xsl:value-of select="$depth" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template name="verbatim-makeSpace">
+		<xsl:param name="d" />
+		<xsl:if test="number($d)&gt;1">
+			<xsl:value-of select="$spaceCharacter" />
+			<xsl:call-template name="verbatim-makeSpace">
+				<xsl:with-param name="d">
+					<xsl:value-of select="$d -1" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="@*" mode="verbatim">
+		<xsl:variable name="L">
+			<xsl:for-each select="../@*">
+				<xsl:value-of select="." />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:if
+			test="count(../@*)&gt;$attsOnSameLine or      string-length($L)&gt;$attLength or     ancestor::tei:cell[not(@rend='wovenodd-col2')] or     namespace-uri()='http://www.w3.org/2005/11/its' or     string-length(.)+string-length(name(.)) &gt;     $attLength">
+			<xsl:call-template name="verbatim-lineBreak">
+				<xsl:with-param name="id">
+					5
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:call-template name="verbatim-makeIndent" />
+		</xsl:if>
+		<xsl:value-of select="$spaceCharacter" />
+		<xsl:variable name="ns-prefix">
+			<xsl:call-template
+				name="verbatim-getNamespacePrefix" />
+		</xsl:variable>
+		<xsl:variable name="name">
+			<xsl:choose>
+				<xsl:when test="string-length($ns-prefix) &gt; 0">
+					<xsl:value-of select="$ns-prefix" />
+					<xsl:text>:</xsl:text>
+					<xsl:value-of select="local-name(.)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="local-name(.)" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:call-template name="verbatim-createAttribute">
+			<xsl:with-param name="name" select="$name" />
+		</xsl:call-template>
+		<xsl:text>="</xsl:text>
+		<xsl:value-of disable-output-escaping="yes"
+			select="$startAttributeValue" />
+		<xsl:apply-templates select="."
+			mode="attributetext" />
+		<xsl:value-of disable-output-escaping="yes"
+			select="$endAttributeValue" />
+		<xsl:text>"</xsl:text>
+	</xsl:template>
+	<xsl:template match="@*" mode="attributetext">
+		<xsl:choose>
+			<xsl:when
+				test="string-length(.)&gt;$attLength and contains(.,' ')">
+				<xsl:call-template name="verbatim-reformatText">
+					<xsl:with-param name="sofar">
+						0
+					</xsl:with-param>
+					<xsl:with-param name="indent">
+						<xsl:text> </xsl:text>
+					</xsl:with-param>
+					<xsl:with-param name="text">
+						<xsl:value-of select="normalize-space(.)" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template
+		match="text()|comment()|processing-instruction()" mode="ns" />
+	<xsl:template match="@*|*" mode="ns">
+		<xsl:variable name="ns" select="namespace-uri()" />
+		<xsl:choose>
+			<xsl:when test="$ns=''" />
+			<xsl:when test="$ns='http://relaxng.org/ns/structure/1.0'" />
+			<xsl:when test="$ns='http://www.w3.org/2001/XInclude'" />
+			<xsl:when test="$ns='http://www.tei-c.org/ns/Examples'" />
+			<xsl:when test="$ns='http://www.ascc.net/xml/schematron'" />
+			<xsl:when
+				test="$ns='http://relaxng.org/ns/compatibility/annotations/1.0'" />
+			<xsl:when test="$ns='http://www.w3.org/XML/1998/namespace'" />
+			<xsl:otherwise>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:apply-templates mode="ns" select="@*|*" />
+	</xsl:template>
+	<xsl:template name="ns">
+		<xsl:param name="nsname" />
+		<xsl:call-template name="verbatim-lineBreak">
+			<xsl:with-param name="id">
+				22
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:text>&#160;&#160;&#160;</xsl:text>
+		<xsl:text>xmlns:</xsl:text>
+		<xsl:value-of select="name(.)" />
+		<xsl:text>="</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>"</xsl:text>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/verbatim/tei-docx-verbatim.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/verbatim/tei-docx-verbatim.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/verbatim/tei-docx-verbatim.xsl	(revision 2397)
@@ -1,119 +1,124 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:sch="http://www.ascc.net/xml/schematron"
-                xmlns:m="http://www.w3.org/1998/Math/MathML"
-                xmlns:atom="http://www.w3.org/2005/Atom"
-                xmlns:xlink="http://www.w3.org/1999/xlink"
-                xmlns:xhtml="http://www.w3.org/1999/xhtml"
-                xmlns:dbk="http://docbook.org/ns/docbook"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		xmlns:iso="http://www.iso.org/ns/1.0"
-		xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                version="2.0"
-                exclude-result-prefixes="xlink xhtml dbk iso rng sch m tei teix atom">
-    
-    <xsl:import href="../../../common2/verbatim.xsl"/>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI Utility stylesheet to create verbatim XML for the TEI to Word conversion </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:sch="http://www.ascc.net/xml/schematron"
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:atom="http://www.w3.org/2005/Atom"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:xhtml="http://www.w3.org/1999/xhtml"
+	xmlns:dbk="http://docbook.org/ns/docbook"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	version="2.0"
+	exclude-result-prefixes="xlink xhtml dbk iso rng sch m tei teix atom">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:import href="../../../common2/verbatim.xsl" />
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI Utility stylesheet to create verbatim XML for the TEI to Word
+				conversion </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei-docx-verbatim.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <!--
-        <xsl:param name="startComment">&lt;span class="comment"&gt;</xsl:param>
-    <xsl:param name="endComment">&lt;/span&gt;</xsl:param>
-    <xsl:param name="startElement">&lt;span class="element"&gt;</xsl:param>
-    <xsl:param name="endElement">&lt;/span&gt;</xsl:param>
-    <xsl:param name="startElementName">&lt;span class="elementname"&gt;</xsl:param>
-    <xsl:param name="endElementName">&lt;/span&gt;</xsl:param>
-    <xsl:param name="startAttribute">&lt;span class="attribute"&gt;</xsl:param>
-    <xsl:param name="endAttribute">&lt;/span&gt;</xsl:param>
-    <xsl:param name="startAttributeValue">&lt;span class="attributevalue"&gt;</xsl:param>
-    <xsl:param name="endAttributeValue">&lt;/span&gt;</xsl:param>
-    <xsl:param name="startNamespace">&lt;span class="namespace"&gt;</xsl:param>
-    <xsl:param name="endNamespace">&lt;/span&gt;</xsl:param>
-    
-    <xsl:param name="spaceCharacter">&#xA0;</xsl:param>
-    <xsl:param name="showNamespaceDecls">true</xsl:param> -->
-    
-    <xsl:param name="startComment"/>
-    <xsl:param name="endComment"/>
-    <xsl:param name="startElement"/>
-    <xsl:param name="endElement"/>
-    <xsl:param name="startElementName"/>
-    <xsl:param name="endElementName"/>
-    <xsl:param name="startAttribute"/>
-    <xsl:param name="endAttribute"/>
-    <xsl:param name="startAttributeValue"/>
-    <xsl:param name="endAttributeValue"/>
-    <xsl:param name="startNamespace"/>
-    <xsl:param name="endNamespace"/>
-    
-    <xsl:param name="spaceCharacter">&#160;</xsl:param>
-    <xsl:param name="showNamespaceDecls">true</xsl:param>
-    
-    <xsl:template name="verbatim-lineBreak">
-        <xsl:param name="id"/>
-        <tei:lb/>
-    </xsl:template>
-    
-    <xsl:template name="verbatim-createElement">
-        <xsl:param name="name"/>
-        <xsl:param name="special"/>
-        <tei:hi rend="bold">
-            <xsl:value-of select="$name"/>
-        </tei:hi>
-    </xsl:template>
-    
-    <xsl:template name="verbatim-createAttribute">
-        <xsl:param name="name"/>
-        <tei:hi rend="bold">
-            <xsl:value-of select="$name"/>
-        </tei:hi>
-    </xsl:template>    
-    
-    
-    
-    <xsl:template name="create-egXML-section">
-        <xsl:apply-templates mode="verbatim"/>
-    </xsl:template>
-    
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-docx-verbatim.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<!-- <xsl:param name="startComment">&lt;span class="comment"&gt;</xsl:param> 
+		<xsl:param name="endComment">&lt;/span&gt;</xsl:param> <xsl:param name="startElement">&lt;span 
+		class="element"&gt;</xsl:param> <xsl:param name="endElement">&lt;/span&gt;</xsl:param> 
+		<xsl:param name="startElementName">&lt;span class="elementname"&gt;</xsl:param> 
+		<xsl:param name="endElementName">&lt;/span&gt;</xsl:param> <xsl:param name="startAttribute">&lt;span 
+		class="attribute"&gt;</xsl:param> <xsl:param name="endAttribute">&lt;/span&gt;</xsl:param> 
+		<xsl:param name="startAttributeValue">&lt;span class="attributevalue"&gt;</xsl:param> 
+		<xsl:param name="endAttributeValue">&lt;/span&gt;</xsl:param> <xsl:param 
+		name="startNamespace">&lt;span class="namespace"&gt;</xsl:param> <xsl:param 
+		name="endNamespace">&lt;/span&gt;</xsl:param> <xsl:param name="spaceCharacter">&#xA0;</xsl:param> 
+		<xsl:param name="showNamespaceDecls">true</xsl:param> -->
+
+	<xsl:param name="startComment" />
+	<xsl:param name="endComment" />
+	<xsl:param name="startElement" />
+	<xsl:param name="endElement" />
+	<xsl:param name="startElementName" />
+	<xsl:param name="endElementName" />
+	<xsl:param name="startAttribute" />
+	<xsl:param name="endAttribute" />
+	<xsl:param name="startAttributeValue" />
+	<xsl:param name="endAttributeValue" />
+	<xsl:param name="startNamespace" />
+	<xsl:param name="endNamespace" />
+
+	<xsl:param name="spaceCharacter">
+		&#160;
+	</xsl:param>
+	<xsl:param name="showNamespaceDecls">
+		true
+	</xsl:param>
+
+	<xsl:template name="verbatim-lineBreak">
+		<xsl:param name="id" />
+		<tei:lb />
+	</xsl:template>
+
+	<xsl:template name="verbatim-createElement">
+		<xsl:param name="name" />
+		<xsl:param name="special" />
+		<tei:hi rend="bold">
+			<xsl:value-of select="$name" />
+		</tei:hi>
+	</xsl:template>
+
+	<xsl:template name="verbatim-createAttribute">
+		<xsl:param name="name" />
+		<tei:hi rend="bold">
+			<xsl:value-of select="$name" />
+		</tei:hi>
+	</xsl:template>
+
+
+
+	<xsl:template name="create-egXML-section">
+		<xsl:apply-templates mode="verbatim" />
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/maths/mml2omml.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/maths/mml2omml.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/maths/mml2omml.xsl	(revision 2397)
@@ -1,2561 +1,2755 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Beta Version 070708 --><xsl:stylesheet xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                version="2.0"
-                exclude-result-prefixes="mml m w">
-  <xsl:output method="xml" encoding="UTF-8"/>
+<!-- Beta Version 070708 -->
+<xsl:stylesheet
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	version="2.0" exclude-result-prefixes="mml m w">
+	<xsl:output method="xml" encoding="UTF-8" />
 
 
-  <xsl:variable name="StrUCAlphabet">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
-  <xsl:variable name="StrLCAlphabet">abcdefghijklmnopqrstuvwxyz</xsl:variable>
+	<xsl:variable name="StrUCAlphabet">
+		ABCDEFGHIJKLMNOPQRSTUVWXYZ
+	</xsl:variable>
+	<xsl:variable name="StrLCAlphabet">
+		abcdefghijklmnopqrstuvwxyz
+	</xsl:variable>
 
 
-<!--
-  <xsl:template match="/">
-    <oMath>
-      <xsl:apply-templates mode="mml"  />
-    </oMath>
-  </xsl:template>
--->
+	<!-- <xsl:template match="/"> <oMath> <xsl:apply-templates mode="mml" /> 
+		</oMath> </xsl:template> -->
 
-  <!-- %%Template: SReplace
+	<!-- %%Template: SReplace Replace all occurences of sOrig in sInput with 
+		sReplacement and return the resulting string. -->
+	<xsl:template name="SReplace">
+		<xsl:param name="sInput" />
+		<xsl:param name="sOrig" />
+		<xsl:param name="sReplacement" />
 
-		Replace all occurences of sOrig in sInput with sReplacement
-		and return the resulting string. -->
-  <xsl:template name="SReplace">
-      <xsl:param name="sInput"/>
-      <xsl:param name="sOrig"/>
-      <xsl:param name="sReplacement"/>
+		<xsl:choose>
+			<xsl:when test="not(contains($sInput, $sOrig))">
+				<xsl:value-of select="$sInput" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="sBefore"
+					select="substring-before($sInput, $sOrig)" />
+				<xsl:variable name="sAfter"
+					select="substring-after($sInput, $sOrig)" />
+				<xsl:variable name="sAfterProcessed">
+					<xsl:call-template name="SReplace">
+						<xsl:with-param name="sInput" select="$sAfter" />
+						<xsl:with-param name="sOrig" select="$sOrig" />
+						<xsl:with-param name="sReplacement"
+							select="$sReplacement" />
+					</xsl:call-template>
+				</xsl:variable>
 
-      <xsl:choose>
-         <xsl:when test="not(contains($sInput, $sOrig))">
-            <xsl:value-of select="$sInput"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="sBefore" select="substring-before($sInput, $sOrig)"/>
-            <xsl:variable name="sAfter" select="substring-after($sInput, $sOrig)"/>
-            <xsl:variable name="sAfterProcessed">
-               <xsl:call-template name="SReplace">
-                  <xsl:with-param name="sInput" select="$sAfter"/>
-                  <xsl:with-param name="sOrig" select="$sOrig"/>
-                  <xsl:with-param name="sReplacement" select="$sReplacement"/>
-               </xsl:call-template>
-            </xsl:variable>
+				<xsl:value-of
+					select="concat($sBefore, concat($sReplacement, $sAfterProcessed))" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-            <xsl:value-of select="concat($sBefore, concat($sReplacement, $sAfterProcessed))"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: OutputText Post processing on the string given and otherwise 
+		do a xsl:value-of on it -->
+	<xsl:template name="OutputText">
+		<xsl:param name="sInput" />
 
-  <!-- %%Template: OutputText
+		<!-- Add local Variable as you add new post processing tasks -->
 
-		Post processing on the string given and otherwise do
-		a xsl:value-of on it -->
-  <xsl:template name="OutputText">
-      <xsl:param name="sInput"/>
+		<!-- 1. Remove any unwanted characters -->
+		<xsl:variable name="sCharStrip">
+			<xsl:value-of select="translate($sInput, '⁢​', '')" />
+		</xsl:variable>
 
-      <!-- Add local Variable as you add new post processing tasks -->
+		<!-- 2. Replace any characters as needed -->
+		<!-- Replace &#x2A75; <-> == -->
+		<xsl:variable name="sCharReplace">
+			<xsl:call-template name="SReplace">
+				<xsl:with-param name="sInput" select="$sCharStrip" />
+				<xsl:with-param name="sOrig" select="'⩵'" />
+				<xsl:with-param name="sReplacement" select="'=='" />
+			</xsl:call-template>
+		</xsl:variable>
 
-    <!-- 1. Remove any unwanted characters -->
-    <xsl:variable name="sCharStrip">
-         <xsl:value-of select="translate($sInput, '⁢​', '')"/>
-      </xsl:variable>
+		<!-- Finally, return the last value -->
+		<xsl:value-of select="$sCharReplace" />
+	</xsl:template>
 
-      <!-- 2. Replace any characters as needed -->
-    <!--	Replace &#x2A75; <-> ==			 -->
-    <xsl:variable name="sCharReplace">
-         <xsl:call-template name="SReplace">
-            <xsl:with-param name="sInput" select="$sCharStrip"/>
-            <xsl:with-param name="sOrig" select="'⩵'"/>
-            <xsl:with-param name="sReplacement" select="'=='"/>
-         </xsl:call-template>
-      </xsl:variable>
 
-      <!-- Finally, return the last value -->
-    <xsl:value-of select="$sCharReplace"/>
-  </xsl:template>
+	<!-- Template that determines whether or the given node ndCur is a token 
+		element that doesn't have an mglyph as a child. -->
+	<xsl:template name="FNonGlyphToken">
+		<xsl:param name="ndCur" select="." />
+		<xsl:choose>
+			<xsl:when
+				test="$ndCur/self::mml:mi[not(child::mml:mglyph)] |                        $ndCur/self::mml:mn[not(child::mml:mglyph)] |                        $ndCur/self::mml:mo[not(child::mml:mglyph)] |                        $ndCur/self::mml:ms[not(child::mml:mglyph)] |                        $ndCur/self::mml:mtext[not(child::mml:mglyph)]">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- Template that determines whether or the given node 
-	     ndCur is a token element that doesn't have an mglyph as 
-			 a child.
-	-->
-  <xsl:template name="FNonGlyphToken">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:choose>
-         <xsl:when test="$ndCur/self::mml:mi[not(child::mml:mglyph)] |                        $ndCur/self::mml:mn[not(child::mml:mglyph)] |                        $ndCur/self::mml:mo[not(child::mml:mglyph)] |                        $ndCur/self::mml:ms[not(child::mml:mglyph)] |                        $ndCur/self::mml:mtext[not(child::mml:mglyph)]">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- Template used to determine if the current token element (ndCur) is 
+		the beginning of a run. A token element is the beginning of if: the count 
+		of preceding elements is 0 or the directory preceding element is not a non-glyph 
+		token. -->
+	<xsl:template name="FStartOfRun">
+		<xsl:param name="ndCur" select="." />
+		<xsl:variable name="fPrecSibNonGlyphToken">
+			<xsl:call-template name="FNonGlyphToken">
+				<xsl:with-param name="ndCur"
+					select="$ndCur/preceding-sibling::*[1]" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="count($ndCur/preceding-sibling::*)=0             or $fPrecSibNonGlyphToken=0">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
+	<!-- Template that determines if ndCur is the argument of an nary expression. 
+		ndCur is the argument of an nary expression if: 1. The preceding sibling 
+		is one of the following: munder, mover, msub, msup, munder, msubsup, munderover 
+		and 2. The preceding sibling's child is an nary char as specified by the 
+		template "isNary" -->
+	<xsl:template name="FIsNaryArgument">
+		<xsl:param name="ndCur" select="." />
 
-  <!-- Template used to determine if the current token element (ndCur) is the beginning of a run. 
-			 A token element is the beginning of if:
-			 
-			 the count of preceding elements is 0 
-			 or 
-			 the directory preceding element is not a non-glyph token.
-	-->
-  <xsl:template name="FStartOfRun">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:variable name="fPrecSibNonGlyphToken">
-         <xsl:call-template name="FNonGlyphToken">
-            <xsl:with-param name="ndCur" select="$ndCur/preceding-sibling::*[1]"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="count($ndCur/preceding-sibling::*)=0             or $fPrecSibNonGlyphToken=0">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:variable name="fNary">
+			<xsl:call-template name="isNary">
+				<xsl:with-param name="ndCur"
+					select="$ndCur/preceding-sibling::*[1]/child::*[1]" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="preceding-sibling::*[1][self::mml:munder or self::mml:mover or self::mml:munderover or                                                     self::mml:msub or self::mml:msup or self::mml:msubsup]              and $fNary='true'">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- Template that determines if ndCur is the argument of an nary expression. 
-			 
-			 ndCur is the argument of an nary expression if:
-			 
-			 1.  The preceding sibling is one of the following:  munder, mover, msub, msup, munder, msubsup, munderover
-			 and
-			 2.  The preceding sibling's child is an nary char as specified by the template "isNary"
-	-->
-  <xsl:template name="FIsNaryArgument">
-      <xsl:param name="ndCur" select="."/>
+	<!-- %%Template: mml:mrow | mml:mstyle if this row is the next sibling of 
+		an n-ary (i.e. any of mover, munder, munderover, msupsub, msup, or msub with 
+		the base being an n-ary operator) then ignore this. Otherwise pass through -->
+	<xsl:template mode="mml" match="mml:mrow|mml:mstyle">
+		<xsl:variable name="fNaryArgument">
+			<xsl:call-template name="FIsNaryArgument">
+				<xsl:with-param name="ndCur" select="." />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:if test="$fNaryArgument=0">
+			<xsl:variable name="fLinearFrac">
+				<xsl:call-template name="FLinearFrac">
+					<xsl:with-param name="ndCur" select="." />
+				</xsl:call-template>
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when test="$fLinearFrac=1">
+					<xsl:call-template name="MakeLinearFraction">
+						<xsl:with-param name="ndCur" select="." />
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="fFunc">
+						<xsl:call-template name="FIsFunc">
+							<xsl:with-param name="ndCur" select="." />
+						</xsl:call-template>
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="$fFunc=1">
+							<xsl:call-template name="WriteFunc">
+								<xsl:with-param name="ndCur" select="." />
+							</xsl:call-template>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates mode="mml" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template mode="mml"
+		match="mml:mi[not(child::mml:mglyph)] |                        mml:mn[not(child::mml:mglyph)] |                        mml:mo[not(child::mml:mglyph)] |                        mml:ms[not(child::mml:mglyph)] |                        mml:mtext[not(child::mml:mglyph)]">
 
-      <xsl:variable name="fNary">
-         <xsl:call-template name="isNary">
-            <xsl:with-param name="ndCur" select="$ndCur/preceding-sibling::*[1]/child::*[1]"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="preceding-sibling::*[1][self::mml:munder or self::mml:mover or self::mml:munderover or                                                     self::mml:msub or self::mml:msup or self::mml:msubsup]              and $fNary='true'">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<!-- tokens with mglyphs as children are tranformed in a different manner 
+			than "normal" token elements. Where normal token elements are token elements 
+			that contain only text -->
+		<xsl:variable name="fStartOfRun">
+			<xsl:call-template name="FStartOfRun">
+				<xsl:with-param name="ndCur" select="." />
+			</xsl:call-template>
+		</xsl:variable>
 
-  <!-- %%Template: mml:mrow | mml:mstyle
+		<!--In MathML, successive characters that are all part of one string are 
+			sometimes listed as separate tags based on their type (identifier (mi), name 
+			(mn), operator (mo), quoted (ms), literal text (mtext)), where said tags 
+			act to link one another into one logical run. In order to wrap the text of 
+			successive mi's, mn's, and mo's into one m:t, we need to denote where a run 
+			begins. The beginning of a run is the first mi, mn, or mo whose immediately 
+			preceding sibling either doesn't exist or is something other than a "normal" 
+			mi, mn, mo, ms, or mtext tag -->
 
-		 if this row is the next sibling of an n-ary (i.e. any of 
-         mover, munder, munderover, msupsub, msup, or msub with 
-         the base being an n-ary operator) then ignore this. Otherwise
-         pass through -->
-  <xsl:template mode="mml" match="mml:mrow|mml:mstyle">
-      <xsl:variable name="fNaryArgument">
-         <xsl:call-template name="FIsNaryArgument">
-            <xsl:with-param name="ndCur" select="."/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:if test="$fNaryArgument=0">
-         <xsl:variable name="fLinearFrac">
-            <xsl:call-template name="FLinearFrac">
-               <xsl:with-param name="ndCur" select="."/>
-            </xsl:call-template>
-         </xsl:variable>
-         <xsl:choose>
-            <xsl:when test="$fLinearFrac=1">
-               <xsl:call-template name="MakeLinearFraction">
-                  <xsl:with-param name="ndCur" select="."/>
-               </xsl:call-template>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:variable name="fFunc">
-                  <xsl:call-template name="FIsFunc">
-                     <xsl:with-param name="ndCur" select="."/>
-                  </xsl:call-template>
-               </xsl:variable>
-               <xsl:choose>
-                  <xsl:when test="$fFunc=1">
-                     <xsl:call-template name="WriteFunc">
-                        <xsl:with-param name="ndCur" select="."/>
-                     </xsl:call-template>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:apply-templates mode="mml"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template mode="mml"
-                 match="mml:mi[not(child::mml:mglyph)] |                        mml:mn[not(child::mml:mglyph)] |                        mml:mo[not(child::mml:mglyph)] |                        mml:ms[not(child::mml:mglyph)] |                        mml:mtext[not(child::mml:mglyph)]">
+		<!-- If this mi/mo/mn/ms . . . is part the numerator or denominator of 
+			a linear fraction, then don't collect. -->
+		<xsl:variable name="fLinearFracParent">
+			<xsl:call-template name="FLinearFrac">
+				<xsl:with-param name="ndCur" select="parent::*" />
+			</xsl:call-template>
+		</xsl:variable>
+		<!-- If this mi/mo/mn/ms . . . is part of the name of a function, then 
+			don't collect. -->
+		<xsl:variable name="fFunctionName">
+			<xsl:call-template name="FIsFunc">
+				<xsl:with-param name="ndCur" select="parent::*" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:variable name="fShouldCollect"
+			select="($fLinearFracParent=0 and $fFunctionName=0) and (parent::mml:mrow or parent::mml:mstyle or       parent::mml:msqrt or parent::mml:menclose or      parent::mml:math or parent::mml:mphantom or       parent::mml:mtd or parent::mml:maction)" />
 
-    <!-- tokens with mglyphs as children are tranformed
-			 in a different manner than "normal" token elements.  
-			 Where normal token elements are token elements that
-			 contain only text -->
-    <xsl:variable name="fStartOfRun">
-         <xsl:call-template name="FStartOfRun">
-            <xsl:with-param name="ndCur" select="."/>
-         </xsl:call-template>
-      </xsl:variable>
+		<!--In MathML, the meaning of the different parts that make up mathematical 
+			structures, such as a fraction having a numerator and a denominator, is determined 
+			by the relative order of those different parts. For instance, In a fraction, 
+			the numerator is the first child and the denominator is the second child. 
+			To allow for more complex structures, MathML allows one to link a group of 
+			mi, mn, and mo's together using the mrow, or mstyle tags. The mi, mn, and 
+			mo's found within any of the above tags are considered one run. Therefore, 
+			if the parent of any mi, mn, or mo is found to be an mrow or mstyle, then 
+			the contiguous mi, mn, and mo's will be considered one run. -->
+		<xsl:choose>
+			<xsl:when test="$fShouldCollect">
+				<xsl:choose>
+					<xsl:when test="$fStartOfRun=1">
+						<!--If this is the beginning of the run, pass all run attributes to 
+							CreateRunWithSameProp. -->
+						<xsl:call-template name="CreateRunWithSameProp">
+							<xsl:with-param name="mathbackground">
+								<!-- Look for the unqualified mathml attribute mathbackground. Fall 
+									back to the qualified mathml attribute if necessary. This priority of unqualified 
+									over qualified will be followed throughout this xslt. -->
+								<xsl:choose>
+									<xsl:when test="@mathbackground">
+										<xsl:value-of select="@mathbackground" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:mathbackground" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="mathcolor">
+								<xsl:choose>
+									<xsl:when test="@mathcolor">
+										<xsl:value-of select="@mathcolor" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:mathcolor" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="mathvariant">
+								<xsl:choose>
+									<xsl:when test="@mathvariant">
+										<xsl:value-of select="@mathvariant" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:mathvariant" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="color">
+								<xsl:choose>
+									<xsl:when test="@color">
+										<xsl:value-of select="@color" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:color" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="font-family">
+								<xsl:choose>
+									<xsl:when test="@font-family">
+										<xsl:value-of select="@font-family" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:font-family" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="fontsize">
+								<xsl:choose>
+									<xsl:when test="@fontsize">
+										<xsl:value-of select="@fontsize" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:fontsize" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="fontstyle">
+								<xsl:choose>
+									<xsl:when test="@fontstyle">
+										<xsl:value-of select="@fontstyle" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:fontstyle" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="fontweight">
+								<xsl:choose>
+									<xsl:when test="@fontweight">
+										<xsl:value-of select="@fontweight" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:fontweight" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="mathsize">
+								<xsl:choose>
+									<xsl:when test="@mathsize">
+										<xsl:value-of select="@mathsize" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:mathsize" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+							<xsl:with-param name="ndTokenFirst" select="." />
+						</xsl:call-template>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<!--Only one element will be part of run -->
+				<r>
+					<!--Create Run Properties based on current node's attributes -->
+					<xsl:call-template name="CreateRunProp">
+						<xsl:with-param name="mathvariant">
+							<xsl:choose>
+								<xsl:when test="@mathvariant">
+									<xsl:value-of select="@mathvariant" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:mathvariant" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+						<xsl:with-param name="fontstyle">
+							<xsl:choose>
+								<xsl:when test="@fontstyle">
+									<xsl:value-of select="@fontstyle" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:fontstyle" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+						<xsl:with-param name="fontweight">
+							<xsl:choose>
+								<xsl:when test="@fontweight">
+									<xsl:value-of select="@fontweight" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:fontweight" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+						<xsl:with-param name="mathcolor">
+							<xsl:choose>
+								<xsl:when test="@mathcolor">
+									<xsl:value-of select="@mathcolor" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:mathcolor" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+						<xsl:with-param name="mathsize">
+							<xsl:choose>
+								<xsl:when test="@mathsize">
+									<xsl:value-of select="@mathsize" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:mathsize" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+						<xsl:with-param name="color">
+							<xsl:choose>
+								<xsl:when test="@color">
+									<xsl:value-of select="@color" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:color" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+						<xsl:with-param name="fontsize">
+							<xsl:choose>
+								<xsl:when test="@fontsize">
+									<xsl:value-of select="@fontsize" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:fontsize" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+						<xsl:with-param name="ndCur" select="." />
+						<xsl:with-param name="fNor">
+							<xsl:call-template name="FNor">
+								<xsl:with-param name="ndCur" select="." />
+							</xsl:call-template>
+						</xsl:with-param>
+						<xsl:with-param name="fLit">
+							<xsl:call-template name="FLit">
+								<xsl:with-param name="ndCur" select="." />
+							</xsl:call-template>
+						</xsl:with-param>
+					</xsl:call-template>
+					<t>
+						<xsl:call-template name="OutputText">
+							<xsl:with-param name="sInput"
+								select="normalize-space(.)" />
+						</xsl:call-template>
+					</t>
+				</r>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-      <!--In MathML, successive characters that are all part of one string are sometimes listed as separate 
-			tags based on their type (identifier (mi), name (mn), operator (mo), quoted (ms), literal text (mtext)), 
-			where said tags act to link one another into one logical run.  In order to wrap the text of successive mi's, 
-			mn's, and mo's into one m:t, we need to denote where a run begins.  The beginning of a run is the first mi, mn, 
-			or mo whose immediately preceding sibling either doesn't exist or is something other than a "normal" mi, mn, mo, 
-			ms, or mtext tag-->
+	<!-- %%Template: CreateRunWithSameProp -->
+	<xsl:template name="CreateRunWithSameProp">
+		<xsl:param name="mathbackground" />
+		<xsl:param name="mathcolor" />
+		<xsl:param name="mathvariant" />
+		<xsl:param name="color" />
+		<xsl:param name="font-family" />
+		<xsl:param name="fontsize" />
+		<xsl:param name="fontstyle" />
+		<xsl:param name="fontweight" />
+		<xsl:param name="mathsize" />
+		<xsl:param name="ndTokenFirst" />
 
-    <!-- If this mi/mo/mn/ms . . . is part the numerator or denominator of a linear fraction, then don't collect. -->
-    <xsl:variable name="fLinearFracParent">
-         <xsl:call-template name="FLinearFrac">
-            <xsl:with-param name="ndCur" select="parent::*"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <!-- If this mi/mo/mn/ms . . . is part of the name of a function, then don't collect. -->
-    <xsl:variable name="fFunctionName">
-         <xsl:call-template name="FIsFunc">
-            <xsl:with-param name="ndCur" select="parent::*"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:variable name="fShouldCollect"
-                    select="($fLinearFracParent=0 and $fFunctionName=0) and (parent::mml:mrow or parent::mml:mstyle or       parent::mml:msqrt or parent::mml:menclose or      parent::mml:math or parent::mml:mphantom or       parent::mml:mtd or parent::mml:maction)"/>
+		<!--Given mathcolor, color, mstyle's (ancestor) color, and precedence of 
+			said attributes, determine the actual color of the current run -->
+		<xsl:variable name="sColorPropCur">
+			<xsl:choose>
+				<xsl:when test="$mathcolor!=''">
+					<xsl:value-of select="$mathcolor" />
+				</xsl:when>
+				<xsl:when test="$color!=''">
+					<xsl:value-of select="$color" />
+				</xsl:when>
+				<xsl:when
+					test="$ndTokenFirst/ancestor::mml:mstyle[@color][1]/@color!=''">
+					<xsl:value-of
+						select="$ndTokenFirst/ancestor::mml:mstyle[@color][1]/@color" />
+				</xsl:when>
+				<xsl:when
+					test="$ndTokenFirst/ancestor::mml:mstyle[@mml:color][1]/@mml:color!=''">
+					<xsl:value-of
+						select="$ndTokenFirst/ancestor::mml:mstyle[@color][1]/@mml:color" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="''" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <!--In MathML, the meaning of the different parts that make up mathematical structures, such as a fraction 
-			having a numerator and a denominator, is determined by the relative order of those different parts.  
-			For instance, In a fraction, the numerator is the first child and the denominator is the second child.  
-			To allow for more complex structures, MathML allows one to link a group of mi, mn, and mo's together 
-			using the mrow, or mstyle tags.  The mi, mn, and mo's found within any of the above tags are considered 
-			one run.  Therefore, if the parent of any mi, mn, or mo is found to be an mrow or mstyle, then the contiguous 
-			mi, mn, and mo's will be considered one run.-->
-    <xsl:choose>
-         <xsl:when test="$fShouldCollect">
-            <xsl:choose>
-               <xsl:when test="$fStartOfRun=1">
-            <!--If this is the beginning of the run, pass all run attributes to CreateRunWithSameProp.-->
-            <xsl:call-template name="CreateRunWithSameProp">
-                     <xsl:with-param name="mathbackground">
-								<!-- Look for the unqualified mathml attribute mathbackground.
-										 Fall back to the qualified mathml attribute if necessary.
-										 This priority of unqualified over qualified will be 
-										 followed throughout this xslt. -->
-                <xsl:choose>
-                           <xsl:when test="@mathbackground">
-                              <xsl:value-of select="@mathbackground"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:mathbackground"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="mathcolor">
-                        <xsl:choose>
-                           <xsl:when test="@mathcolor">
-                              <xsl:value-of select="@mathcolor"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:mathcolor"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="mathvariant">
-                        <xsl:choose>
-                           <xsl:when test="@mathvariant">
-                              <xsl:value-of select="@mathvariant"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:mathvariant"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="color">
-                        <xsl:choose>
-                           <xsl:when test="@color">
-                              <xsl:value-of select="@color"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:color"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="font-family">
-                        <xsl:choose>
-                           <xsl:when test="@font-family">
-                              <xsl:value-of select="@font-family"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:font-family"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="fontsize">
-                        <xsl:choose>
-                           <xsl:when test="@fontsize">
-                              <xsl:value-of select="@fontsize"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:fontsize"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="fontstyle">
-                        <xsl:choose>
-                           <xsl:when test="@fontstyle">
-                              <xsl:value-of select="@fontstyle"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:fontstyle"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="fontweight">
-                        <xsl:choose>
-                           <xsl:when test="@fontweight">
-                              <xsl:value-of select="@fontweight"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:fontweight"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="mathsize">
-                        <xsl:choose>
-                           <xsl:when test="@mathsize">
-                              <xsl:value-of select="@mathsize"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:mathsize"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                     <xsl:with-param name="ndTokenFirst" select="."/>
-                  </xsl:call-template>
-               </xsl:when>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>
-        <!--Only one element will be part of run-->
-        <r>
-          <!--Create Run Properties based on current node's attributes-->
-          <xsl:call-template name="CreateRunProp">
-                  <xsl:with-param name="mathvariant">
-                     <xsl:choose>
-                        <xsl:when test="@mathvariant">
-                           <xsl:value-of select="@mathvariant"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:mathvariant"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:with-param>
-                  <xsl:with-param name="fontstyle">
-                     <xsl:choose>
-                        <xsl:when test="@fontstyle">
-                           <xsl:value-of select="@fontstyle"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:fontstyle"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:with-param>
-                  <xsl:with-param name="fontweight">
-                     <xsl:choose>
-                        <xsl:when test="@fontweight">
-                           <xsl:value-of select="@fontweight"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:fontweight"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:with-param>
-                  <xsl:with-param name="mathcolor">
-                     <xsl:choose>
-                        <xsl:when test="@mathcolor">
-                           <xsl:value-of select="@mathcolor"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:mathcolor"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:with-param>
-                  <xsl:with-param name="mathsize">
-                     <xsl:choose>
-                        <xsl:when test="@mathsize">
-                           <xsl:value-of select="@mathsize"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:mathsize"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:with-param>
-                  <xsl:with-param name="color">
-                     <xsl:choose>
-                        <xsl:when test="@color">
-                           <xsl:value-of select="@color"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:color"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:with-param>
-                  <xsl:with-param name="fontsize">
-                     <xsl:choose>
-                        <xsl:when test="@fontsize">
-                           <xsl:value-of select="@fontsize"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:fontsize"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:with-param>
-                  <xsl:with-param name="ndCur" select="."/>
-                  <xsl:with-param name="fNor">
-                     <xsl:call-template name="FNor">
-                        <xsl:with-param name="ndCur" select="."/>
-                     </xsl:call-template>
-                  </xsl:with-param>
-                  <xsl:with-param name="fLit">
-                     <xsl:call-template name="FLit">
-                        <xsl:with-param name="ndCur" select="."/>
-                     </xsl:call-template>
-                  </xsl:with-param>
-               </xsl:call-template>
-               <t>
-                  <xsl:call-template name="OutputText">
-                     <xsl:with-param name="sInput" select="normalize-space(.)"/>
-                  </xsl:call-template>
-               </t>
-            </r>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<!--Given mathsize, and fontsize and precedence of said attributes, determine 
+			the actual font size of the current run -->
+		<xsl:variable name="sSzCur">
+			<xsl:choose>
+				<xsl:when test="$mathsize!=''">
+					<xsl:value-of select="$mathsize" />
+				</xsl:when>
+				<xsl:when test="$fontsize!=''">
+					<xsl:value-of select="$fontsize" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="''" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-  <!-- %%Template: CreateRunWithSameProp
-	-->
-  <xsl:template name="CreateRunWithSameProp">
-      <xsl:param name="mathbackground"/>
-      <xsl:param name="mathcolor"/>
-      <xsl:param name="mathvariant"/>
-      <xsl:param name="color"/>
-      <xsl:param name="font-family"/>
-      <xsl:param name="fontsize"/>
-      <xsl:param name="fontstyle"/>
-      <xsl:param name="fontweight"/>
-      <xsl:param name="mathsize"/>
-      <xsl:param name="ndTokenFirst"/>
+		<!--Given mathvariant, fontstyle, and fontweight, and precedence of the 
+			attributes, determine the actual font of the current run -->
+		<xsl:variable name="sFontCur">
+			<xsl:call-template name="GetFontCur">
+				<xsl:with-param name="mathvariant"
+					select="$mathvariant" />
+				<xsl:with-param name="fontstyle" select="$fontstyle" />
+				<xsl:with-param name="fontweight"
+					select="$fontweight" />
+				<xsl:with-param name="ndCur" select="$ndTokenFirst" />
+			</xsl:call-template>
+		</xsl:variable>
 
-      <!--Given mathcolor, color, mstyle's (ancestor) color, and precedence of 
-			said attributes, determine the actual color of the current run-->
-    <xsl:variable name="sColorPropCur">
-         <xsl:choose>
-            <xsl:when test="$mathcolor!=''">
-               <xsl:value-of select="$mathcolor"/>
-            </xsl:when>
-            <xsl:when test="$color!=''">
-               <xsl:value-of select="$color"/>
-            </xsl:when>
-            <xsl:when test="$ndTokenFirst/ancestor::mml:mstyle[@color][1]/@color!=''">
-               <xsl:value-of select="$ndTokenFirst/ancestor::mml:mstyle[@color][1]/@color"/>
-            </xsl:when>
-            <xsl:when test="$ndTokenFirst/ancestor::mml:mstyle[@mml:color][1]/@mml:color!=''">
-               <xsl:value-of select="$ndTokenFirst/ancestor::mml:mstyle[@color][1]/@mml:color"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="''"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+		<!-- The omml equivalent structure for mml:mtext is an omml run with the 
+			run property m:nor (normal) set. Therefore, we can only collect mtexts with 
+			other mtext elements. Suppose the $ndTokenFirst is an mml:mtext, then if 
+			any of its following siblings are to be grouped, they must also be mml:text 
+			elements. The inverse is also true, suppose the $ndTokenFirst isn't an mml:mtext, 
+			then if any of its following siblings are to be grouped with $ndTokenFirst, 
+			they can't be mml:mtext elements -->
+		<xsl:variable name="fNdTokenFirstIsMText">
+			<xsl:choose>
+				<xsl:when test="$ndTokenFirst/self::mml:mtext">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <!--Given mathsize, and fontsize and precedence of said attributes, 
-			determine the actual font size of the current run-->
-    <xsl:variable name="sSzCur">
-         <xsl:choose>
-            <xsl:when test="$mathsize!=''">
-               <xsl:value-of select="$mathsize"/>
-            </xsl:when>
-            <xsl:when test="$fontsize!=''">
-               <xsl:value-of select="$fontsize"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="''"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+		<!--In order to determine the length of the run, we will find the number 
+			of nodes before the inital node in the run and the number of nodes before 
+			the first node that DOES NOT belong to the current run. The number of nodes 
+			that will be printed is One Less than the difference between the latter and 
+			the former -->
 
-      <!--Given mathvariant, fontstyle, and fontweight, and precedence of 
-			the attributes, determine the actual font of the current run-->
-    <xsl:variable name="sFontCur">
-         <xsl:call-template name="GetFontCur">
-            <xsl:with-param name="mathvariant" select="$mathvariant"/>
-            <xsl:with-param name="fontstyle" select="$fontstyle"/>
-            <xsl:with-param name="fontweight" select="$fontweight"/>
-            <xsl:with-param name="ndCur" select="$ndTokenFirst"/>
-         </xsl:call-template>
-      </xsl:variable>
+		<!--Find index of current node -->
+		<xsl:variable name="nndBeforeFirst"
+			select="count($ndTokenFirst/preceding-sibling::*)" />
 
-      <!-- The omml equivalent structure for mml:mtext is an omml run with the run property m:nor (normal) set.
-         Therefore, we can only collect mtexts with  other mtext elements.  Suppose the $ndTokenFirst is an 
-         mml:mtext, then if any of its following siblings are to be grouped, they must also be mml:text elements.  
-         The inverse is also true, suppose the $ndTokenFirst isn't an mml:mtext, then if any of its following siblings 
-         are to be grouped with $ndTokenFirst, they can't be mml:mtext elements-->
-    <xsl:variable name="fNdTokenFirstIsMText">
-         <xsl:choose>
-            <xsl:when test="$ndTokenFirst/self::mml:mtext">1</xsl:when>
-            <xsl:otherwise>0</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+		<!--Find index of next change in run properties. The basic idea is that 
+			we want to find the position of the last node in the longest sequence of 
+			nodes, starting from ndTokenFirst, that can be grouped into a run. For example, 
+			nodes A and B can be grouped together into the same run iff they have the 
+			same props. To accomplish this grouping, we want to find the next sibling 
+			to ndTokenFirst that shouldn't be included in the run of text. We do this 
+			by counting the number of elements that precede the first such element that 
+			doesn't belong. The xpath that accomplishes this is below. Count the number 
+			of siblings the precede the first element after ndTokenFirst that shouldn't 
+			belong. count($ndTokenFirst/following-sibling::*[ . . . ][1]/preceding-sibling::*) 
+			Now, the hard part to this is what is represented by the '. . .' above. This 
+			conditional expression is defining what elements *don't* belong to the current 
+			run. The conditions are as follows: The element is not a token element (mi, 
+			mn, mo, ms, or mtext) or The token element contains a glyph child (this is 
+			handled separately). or The token is an mtext and the run didn't start with 
+			an mtext, or the token isn't an mtext and the run started with an mtext. 
+			We do this check because mtext transforms into an omml m:nor property, and 
+			thus, these mtext token elements need to be grouped separately from other 
+			token elements. // We do an or not( . . . ), because it was easier to define 
+			what token elements match than how they don't match. // Thus, this inner 
+			'. . .' defines how token attributes equate to one another. We add the 'not' 
+			outside of to accomplish // the goal of the outer '. . .', which is the find 
+			the next element that *doesn't* match. or not( The background colors match. 
+			and The current font (sFontCur) matches the mathvariant or sFontCur is normal 
+			and matches the current font characteristics or sFontCur is italic and matches 
+			the current font characteristics or . . . and The font family matches the 
+			current font family. ) // end of not(). -->
+		<xsl:variable name="nndBeforeLim"
+			select="count($ndTokenFirst/following-sibling::*      [(not(self::mml:mi) and not(self::mml:mn) and not(self::mml:mo) and not(self::mml:ms) and not(self::mml:mtext))      or      (self::mml:mi[child::mml:mglyph] or self::mml:mn[child::mml:mglyph] or self::mml:mo[child::mml:mglyph] or self::mml:ms[child::mml:mglyph] or self::mml:mtext[child::mml:mglyph])      or      (($fNdTokenFirstIsMText=1 and not(self::mml:mtext)) or ($fNdTokenFirstIsMText=0 and self::mml:mtext))      or        not(       ((($sFontCur=@mathvariant or $sFontCur=@mml:mathvariant)        or        ($sFontCur='normal'         and ((@mathvariant='normal' or @mml:mathvariant='normal')            or (((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))              and (                     ((@fontstyle='normal' or @mml:fontstyle='normal') and (not(@fontweight='bold') and not(@mml:fontweight='bold')))                     or (self::mml:mi and string-length(normalize-space(.)) &gt; 1)                    )               )           )        )        or        ($sFontCur='italic'          and ((@mathvariant='italic' or @mml:mathvariant='italic')            or (((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))             and (                     ((@fontstyle='italic' or @mml:fontstyle='italic') and (not(@fontweight='bold') and not(@mml:fontweight='bold')))                    or                  (self::mml:mn                  or self::mml:mo                 or (self::mml:mi and string-length(normalize-space(.)) &lt;= 1))                    )               )           )        )         or        ($sFontCur='bold'         and ((@mathvariant='bold' or @mml:mathvariant='bold')            or (((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))                and (                     ((@fontweight='bold' or @mml:fontweight='bold')                     and ((@fontstyle='normal' or @mml:fontstyle='normal') or (self::mml:mi and string-length(normalize-space(.)) &lt;= 1))                    )               )             )             )        )         or        (($sFontCur='bi' or $sFontCur='bold-italic')         and (            (@mathvariant='bold-italic' or @mml:mathvariant='bold-italic')            or (((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))             and (                ((@fontweight='bold' or @mml:fontweight='bold') and (@fontstyle='italic' or @mml:fontstyle='italic'))                or ((@fontweight='bold' or @mml:fontweight='bold')                   and (self::mml:mn                       or self::mml:mo                     or (self::mml:mi and string-length(normalize-space(.)) &lt;= 1)))                    )               )           )        )               or               (($sFontCur=''                   and (                      ((not(@mathvariant) or @mathvariant='')                         and (not(@mml:mathvariant) or @mml:mathvariant='')                         and (not(@fontstyle) or @fontstyle='')                         and (not(@mml:fontstyle) or @mml:fontstyle='')                         and (not(@fontweight)or @fontweight='')                         and (not(@mml:fontweight) or @mml:fontweight='')                 )                        or                          (@mathvariant='italic' or @mml:mathvariant='italic')                         or (                            ((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))                                and (                                   (((@fontweight='normal' or @mml:fontweight='normal')                                    and (@fontstyle='italic' or @mml:fontstyle='italic'))                                   )                                   or                                   ((not(@fontweight) or @fontweight='') and (not(@mml:fontweight) or @mml:fontweight=''))                                    and (@fontstyle='italic' or @mml:fontstyle='italic')                                   or                                   ((not(@fontweight) or @fontweight='') and (not(@mml:fontweight) or @mml:fontweight=''))                                    and (not(@fontstyle) or @fontstyle='')                                    and (not(@mml:fontstyle) or @mml:fontstyle=''))                             )                 )                ))        or               ($sFontCur='normal'                 and ((self::mml:mi                       and (not(@mathvariant) or @mathvariant='')                   and (not(@mml:mathvariant) or @mml:mathvariant)                   and (not(@fontstyle) or @fontstyle='')                    and (not(@mml:fontstyle) or @mml:fontstyle='')                   and (not(@fontweight) or @fontweight='')                    and (not(@mml:fontweight) or @mml:fontweight='')                   and (string-length(normalize-space(.)) &gt; 1)                   )                  or ((self::mml:ms or self::mml:mtext)                    and (not(@mathvariant) or @mathvariant='')                   and (not(@mml:mathvariant) or @mml:mathvariant)                   and (not(@fontstyle) or @fontstyle)                   and (not(@fontstyle) or @fontstyle='')                   and (not(@fontweight) or @fontweight)                   and (not(@mml:fontweight) or @mml:fontweight='')                   )                  )               )           )       and             (($font-family = @font-family or $font-family = @mml:font-family)               or (($font-family='' or not($font-family))                and (not(@font-family) or @font-family='')                and (not(@mml:font-family) or @mml:font-family='')               )              )      ))      ][1]/preceding-sibling::*)" />
 
-      <!--In order to determine the length of the run, we will find the number of nodes before the inital node in the run and
-			the number of nodes before the first node that DOES NOT belong to the current run.  The number of nodes that will
-			be printed is One Less than the difference between the latter and the former-->
+		<xsl:variable name="cndRun"
+			select="$nndBeforeLim - $nndBeforeFirst" />
 
-    <!--Find index of current node-->
-    <xsl:variable name="nndBeforeFirst" select="count($ndTokenFirst/preceding-sibling::*)"/>
+		<!--Contiguous groups of like-property mi, mn, and mo's are separated by 
+			non- mi, mn, mo tags, or mi,mn, or mo tags with different properties. nndBeforeLim 
+			is the number of nodes before the next tag which separates contiguous groups 
+			of like-property mi, mn, and mo's. Knowing this delimiting tag allows for 
+			the aggregation of the correct number of mi, mn, and mo tags. -->
+		<r>
 
-      <!--Find index of next change in run properties.
-		
-		    The basic idea is that we want to find the position of the last node in the longest 
-				sequence of nodes, starting from ndTokenFirst, that can be grouped into a run.  For
-				example, nodes A and B can be grouped together into the same run iff they have the same 
-				props.
-				
-				To accomplish this grouping, we want to find the next sibling to ndTokenFirst that shouldn't be 
-				included in the run of text.  We do this by counting the number of elements that precede the first
-				such element that doesn't belong.  The xpath that accomplishes this is below.
-				    
-						Count the number of siblings the precede the first element after ndTokenFirst that shouldn't belong.
-						count($ndTokenFirst/following-sibling::*[ . . . ][1]/preceding-sibling::*)
-						
-				Now, the hard part to this is what is represented by the '. . .' above.  This conditional expression is 
-				defining what elements *don't* belong to the current run.  The conditions are as follows:
-				
-				The element is not a token element (mi, mn, mo, ms, or mtext)
-				
-				or
-				
-				The token element contains a glyph child (this is handled separately).
-				
-				or
-				
-				The token is an mtext and the run didn't start with an mtext, or the token isn't an mtext and the run started 
-				with an mtext.  We do this check because mtext transforms into an omml m:nor property, and thus, these mtext
-				token elements need to be grouped separately from other token elements.
-				
-				// We do an or not( . . . ), because it was easier to define what token elements match than how they don't match.
-				// Thus, this inner '. . .' defines how token attributes equate to one another.  We add the 'not' outside of to accomplish
-				// the goal of the outer '. . .', which is the find the next element that *doesn't* match.
-				or not(
-				   The background colors match.
-					 
-					 and
-					 
-							The current font (sFontCur) matches the mathvariant
-					 
-							or
-							
-							sFontCur is normal and matches the current font characteristics
-							
-							or 
-							
-							sFontCur is italic and matches the current font characteristics
-							
-							or 
-							
-							. . .
-				
-					 and
-					 
-					 The font family matches the current font family.
-					 ) // end of not().-->
-    <xsl:variable name="nndBeforeLim"
-                    select="count($ndTokenFirst/following-sibling::*      [(not(self::mml:mi) and not(self::mml:mn) and not(self::mml:mo) and not(self::mml:ms) and not(self::mml:mtext))      or      (self::mml:mi[child::mml:mglyph] or self::mml:mn[child::mml:mglyph] or self::mml:mo[child::mml:mglyph] or self::mml:ms[child::mml:mglyph] or self::mml:mtext[child::mml:mglyph])      or      (($fNdTokenFirstIsMText=1 and not(self::mml:mtext)) or ($fNdTokenFirstIsMText=0 and self::mml:mtext))      or        not(       ((($sFontCur=@mathvariant or $sFontCur=@mml:mathvariant)        or        ($sFontCur='normal'         and ((@mathvariant='normal' or @mml:mathvariant='normal')            or (((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))              and (                     ((@fontstyle='normal' or @mml:fontstyle='normal') and (not(@fontweight='bold') and not(@mml:fontweight='bold')))                     or (self::mml:mi and string-length(normalize-space(.)) &gt; 1)                    )               )           )        )        or        ($sFontCur='italic'          and ((@mathvariant='italic' or @mml:mathvariant='italic')            or (((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))             and (                     ((@fontstyle='italic' or @mml:fontstyle='italic') and (not(@fontweight='bold') and not(@mml:fontweight='bold')))                    or                  (self::mml:mn                  or self::mml:mo                 or (self::mml:mi and string-length(normalize-space(.)) &lt;= 1))                    )               )           )        )         or        ($sFontCur='bold'         and ((@mathvariant='bold' or @mml:mathvariant='bold')            or (((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))                and (                     ((@fontweight='bold' or @mml:fontweight='bold')                     and ((@fontstyle='normal' or @mml:fontstyle='normal') or (self::mml:mi and string-length(normalize-space(.)) &lt;= 1))                    )               )             )             )        )         or        (($sFontCur='bi' or $sFontCur='bold-italic')         and (            (@mathvariant='bold-italic' or @mml:mathvariant='bold-italic')            or (((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))             and (                ((@fontweight='bold' or @mml:fontweight='bold') and (@fontstyle='italic' or @mml:fontstyle='italic'))                or ((@fontweight='bold' or @mml:fontweight='bold')                   and (self::mml:mn                       or self::mml:mo                     or (self::mml:mi and string-length(normalize-space(.)) &lt;= 1)))                    )               )           )        )               or               (($sFontCur=''                   and (                      ((not(@mathvariant) or @mathvariant='')                         and (not(@mml:mathvariant) or @mml:mathvariant='')                         and (not(@fontstyle) or @fontstyle='')                         and (not(@mml:fontstyle) or @mml:fontstyle='')                         and (not(@fontweight)or @fontweight='')                         and (not(@mml:fontweight) or @mml:fontweight='')                 )                        or                          (@mathvariant='italic' or @mml:mathvariant='italic')                         or (                            ((not(@mathvariant) or @mathvariant='') and (not(@mml:mathvariant) or @mml:mathvariant=''))                                and (                                   (((@fontweight='normal' or @mml:fontweight='normal')                                    and (@fontstyle='italic' or @mml:fontstyle='italic'))                                   )                                   or                                   ((not(@fontweight) or @fontweight='') and (not(@mml:fontweight) or @mml:fontweight=''))                                    and (@fontstyle='italic' or @mml:fontstyle='italic')                                   or                                   ((not(@fontweight) or @fontweight='') and (not(@mml:fontweight) or @mml:fontweight=''))                                    and (not(@fontstyle) or @fontstyle='')                                    and (not(@mml:fontstyle) or @mml:fontstyle=''))                             )                 )                ))        or               ($sFontCur='normal'                 and ((self::mml:mi                       and (not(@mathvariant) or @mathvariant='')                   and (not(@mml:mathvariant) or @mml:mathvariant)                   and (not(@fontstyle) or @fontstyle='')                    and (not(@mml:fontstyle) or @mml:fontstyle='')                   and (not(@fontweight) or @fontweight='')                    and (not(@mml:fontweight) or @mml:fontweight='')                   and (string-length(normalize-space(.)) &gt; 1)                   )                  or ((self::mml:ms or self::mml:mtext)                    and (not(@mathvariant) or @mathvariant='')                   and (not(@mml:mathvariant) or @mml:mathvariant)                   and (not(@fontstyle) or @fontstyle)                   and (not(@fontstyle) or @fontstyle='')                   and (not(@fontweight) or @fontweight)                   and (not(@mml:fontweight) or @mml:fontweight='')                   )                  )               )           )       and             (($font-family = @font-family or $font-family = @mml:font-family)               or (($font-family='' or not($font-family))                and (not(@font-family) or @font-family='')                and (not(@mml:font-family) or @mml:font-family='')               )              )      ))      ][1]/preceding-sibling::*)"/>
+			<!--The beginning and ending of the current run has been established. 
+				Now we should open a run element -->
+			<xsl:choose>
 
-      <xsl:variable name="cndRun" select="$nndBeforeLim - $nndBeforeFirst"/>
+				<!--If cndRun > 0, then there is a following diffrent prop, or non- Token, 
+					although there may or may not have been a preceding different prop, or non- 
+					Token -->
+				<xsl:when test="$cndRun &gt; 0">
+					<xsl:call-template name="CreateRunProp">
+						<xsl:with-param name="mathvariant"
+							select="$mathvariant" />
+						<xsl:with-param name="fontstyle"
+							select="$fontstyle" />
+						<xsl:with-param name="fontweight"
+							select="$fontweight" />
+						<xsl:with-param name="mathcolor"
+							select="$mathcolor" />
+						<xsl:with-param name="mathsize" select="$mathsize" />
+						<xsl:with-param name="color" select="$color" />
+						<xsl:with-param name="fontsize" select="$fontsize" />
+						<xsl:with-param name="ndCur" select="$ndTokenFirst" />
+						<xsl:with-param name="fNor">
+							<xsl:call-template name="FNor">
+								<xsl:with-param name="ndCur"
+									select="$ndTokenFirst" />
+							</xsl:call-template>
+						</xsl:with-param>
+						<xsl:with-param name="fLit">
+							<xsl:call-template name="FLit">
+								<xsl:with-param name="ndCur"
+									select="$ndTokenFirst" />
+							</xsl:call-template>
+						</xsl:with-param>
+					</xsl:call-template>
+					<t>
+						<xsl:call-template name="OutputText">
+							<xsl:with-param name="sInput">
+								<xsl:choose>
+									<xsl:when
+										test="namespace-uri($ndTokenFirst) = 'http://www.w3.org/1998/Math/MathML' and local-name($ndTokenFirst) = 'ms'">
+										<xsl:call-template name="OutputMs">
+											<xsl:with-param name="msCur"
+												select="$ndTokenFirst" />
+										</xsl:call-template>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="normalize-space($ndTokenFirst)" />
+									</xsl:otherwise>
+								</xsl:choose>
+								<xsl:for-each
+									select="$ndTokenFirst/following-sibling::*[position() &lt; $cndRun]">
+									<xsl:choose>
+										<xsl:when
+											test="namespace-uri(.) = 'http://www.w3.org/1998/Math/MathML' and               local-name(.) = 'ms'">
+											<xsl:call-template name="OutputMs">
+												<xsl:with-param name="msCur" select="." />
+											</xsl:call-template>
+										</xsl:when>
+										<xsl:otherwise>
+											<xsl:value-of select="normalize-space(.)" />
+										</xsl:otherwise>
+									</xsl:choose>
+								</xsl:for-each>
+							</xsl:with-param>
+						</xsl:call-template>
+					</t>
+				</xsl:when>
+				<xsl:otherwise>
 
-      <!--Contiguous groups of like-property mi, mn, and mo's are separated by non- mi, mn, mo tags, or mi,mn, or mo
-			tags with different properties.  nndBeforeLim is the number of nodes before the next tag which separates contiguous 
-			groups of like-property mi, mn, and mo's.  Knowing this delimiting tag allows for the aggregation of the correct 
-			number of mi, mn, and mo tags.-->
-    <r>
+					<!--if cndRun lt;= 0, then iNextNonToken = 0, and iPrecNonToken gt;= 
+						0. In either case, b/c there is no next different property or non-Token (which 
+						is implied by the nndBeforeLast being equal to 0) you can put all the remaining 
+						mi, mn, and mo's into one group. -->
+					<xsl:call-template name="CreateRunProp">
+						<xsl:with-param name="mathvariant"
+							select="$mathvariant" />
+						<xsl:with-param name="fontstyle"
+							select="$fontstyle" />
+						<xsl:with-param name="fontweight"
+							select="$fontweight" />
+						<xsl:with-param name="mathcolor"
+							select="$mathcolor" />
+						<xsl:with-param name="mathsize" select="$mathsize" />
+						<xsl:with-param name="color" select="$color" />
+						<xsl:with-param name="fontsize" select="$fontsize" />
+						<xsl:with-param name="ndCur" select="$ndTokenFirst" />
+						<xsl:with-param name="fNor">
+							<xsl:call-template name="FNor">
+								<xsl:with-param name="ndCur"
+									select="$ndTokenFirst" />
+							</xsl:call-template>
+						</xsl:with-param>
+						<xsl:with-param name="fLit">
+							<xsl:call-template name="FLit">
+								<xsl:with-param name="ndCur"
+									select="$ndTokenFirst" />
+							</xsl:call-template>
+						</xsl:with-param>
+					</xsl:call-template>
+					<t>
 
-      <!--The beginning and ending of the current run has been established. Now we should open a run element-->
-      <xsl:choose>
+						<!--Create the Run, first output current, then in a for-each, because 
+							all the following siblings are mn, mi, and mo's that conform to the run's 
+							properties, group them together -->
+						<xsl:call-template name="OutputText">
+							<xsl:with-param name="sInput">
+								<xsl:choose>
+									<xsl:when
+										test="namespace-uri($ndTokenFirst) = 'http://www.w3.org/1998/Math/MathML' and               local-name($ndTokenFirst) = 'ms'">
+										<xsl:call-template name="OutputMs">
+											<xsl:with-param name="msCur"
+												select="$ndTokenFirst" />
+										</xsl:call-template>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="normalize-space($ndTokenFirst)" />
+									</xsl:otherwise>
+								</xsl:choose>
+								<xsl:for-each
+									select="$ndTokenFirst/following-sibling::*[self::mml:mi or self::mml:mn or self::mml:mo or self::mml:ms or self::mml:mtext]">
+									<xsl:choose>
+										<xsl:when
+											test="namespace-uri(.) = 'http://www.w3.org/1998/Math/MathML' and               local-name(.) = 'ms'">
+											<xsl:call-template name="OutputMs">
+												<xsl:with-param name="msCur" select="." />
+											</xsl:call-template>
+										</xsl:when>
+										<xsl:otherwise>
+											<xsl:value-of select="normalize-space(.)" />
+										</xsl:otherwise>
+									</xsl:choose>
+								</xsl:for-each>
+							</xsl:with-param>
+						</xsl:call-template>
+					</t>
+				</xsl:otherwise>
+			</xsl:choose>
+		</r>
 
-        <!--If cndRun > 0, then there is a following diffrent prop, or non- Token, 
-						although there may or may not have been a preceding different prop, or non-
-						Token-->
-        <xsl:when test="$cndRun &gt; 0">
-               <xsl:call-template name="CreateRunProp">
-                  <xsl:with-param name="mathvariant" select="$mathvariant"/>
-                  <xsl:with-param name="fontstyle" select="$fontstyle"/>
-                  <xsl:with-param name="fontweight" select="$fontweight"/>
-                  <xsl:with-param name="mathcolor" select="$mathcolor"/>
-                  <xsl:with-param name="mathsize" select="$mathsize"/>
-                  <xsl:with-param name="color" select="$color"/>
-                  <xsl:with-param name="fontsize" select="$fontsize"/>
-                  <xsl:with-param name="ndCur" select="$ndTokenFirst"/>
-                  <xsl:with-param name="fNor">
-                     <xsl:call-template name="FNor">
-                        <xsl:with-param name="ndCur" select="$ndTokenFirst"/>
-                     </xsl:call-template>
-                  </xsl:with-param>
-                  <xsl:with-param name="fLit">
-                     <xsl:call-template name="FLit">
-                        <xsl:with-param name="ndCur" select="$ndTokenFirst"/>
-                     </xsl:call-template>
-                  </xsl:with-param>
-               </xsl:call-template>
-               <t>
-                  <xsl:call-template name="OutputText">
-                     <xsl:with-param name="sInput">
-                        <xsl:choose>
-                           <xsl:when test="namespace-uri($ndTokenFirst) = 'http://www.w3.org/1998/Math/MathML' and local-name($ndTokenFirst) = 'ms'">
-                              <xsl:call-template name="OutputMs">
-                                 <xsl:with-param name="msCur" select="$ndTokenFirst"/>
-                              </xsl:call-template>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="normalize-space($ndTokenFirst)"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                        <xsl:for-each select="$ndTokenFirst/following-sibling::*[position() &lt; $cndRun]">
-                           <xsl:choose>
-                              <xsl:when test="namespace-uri(.) = 'http://www.w3.org/1998/Math/MathML' and               local-name(.) = 'ms'">
-                                 <xsl:call-template name="OutputMs">
-                                    <xsl:with-param name="msCur" select="."/>
-                                 </xsl:call-template>
-                              </xsl:when>
-                              <xsl:otherwise>
-                                 <xsl:value-of select="normalize-space(.)"/>
-                              </xsl:otherwise>
-                           </xsl:choose>
-                        </xsl:for-each>
-                     </xsl:with-param>
-                  </xsl:call-template>
-               </t>
-            </xsl:when>
-            <xsl:otherwise>
+		<!--The run was terminated by an mi, mn, mo, ms, or mtext with different 
+			properties, therefore, call-template CreateRunWithSameProp, using cndRun+1 
+			node as new start node -->
+		<xsl:if
+			test="$nndBeforeLim!=0             and ($ndTokenFirst/following-sibling::*[$cndRun]/self::mml:mi or             $ndTokenFirst/following-sibling::*[$cndRun]/self::mml:mn or            $ndTokenFirst/following-sibling::*[$cndRun]/self::mml:mo or            $ndTokenFirst/following-sibling::*[$cndRun]/self::mml:ms or                 $ndTokenFirst/following-sibling::*[$cndRun]/self::mml:mtext)              and (count($ndTokenFirst/following-sibling::*[$cndRun]/mml:mglyph) = 0)">
+			<xsl:call-template name="CreateRunWithSameProp">
+				<xsl:with-param name="mathbackground">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@mathbackground">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mathbackground" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:mathbackground" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="mathcolor">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@mathcolor">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mathcolor" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:mathcolor" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="mathvariant">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@mathvariant">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mathvariant" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:mathvariant" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="color">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@color">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@color" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:color" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="font-family">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@font-family">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@font-family" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:font-family" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fontsize">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@fontsize">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@fontsize" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:fontsize" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fontstyle">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@fontstyle">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@fontstyle" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:fontstyle" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fontweight">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@fontweight">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@fontweight" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:fontweight" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="mathsize">
+					<xsl:choose>
+						<xsl:when
+							test="$ndTokenFirst/following-sibling::*[$cndRun]/@mathsize">
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mathsize" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:mathsize" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="ndTokenFirst"
+					select="$ndTokenFirst/following-sibling::*[$cndRun]" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-          <!--if cndRun lt;= 0, then iNextNonToken = 0, 
-						and iPrecNonToken gt;= 0.  In either case, b/c there 
-						is no next different property or non-Token 
-						(which is implied by the nndBeforeLast being equal to 0) 
-						you can put all the remaining mi, mn, and mo's into one 
-						group.-->
-          <xsl:call-template name="CreateRunProp">
-                  <xsl:with-param name="mathvariant" select="$mathvariant"/>
-                  <xsl:with-param name="fontstyle" select="$fontstyle"/>
-                  <xsl:with-param name="fontweight" select="$fontweight"/>
-                  <xsl:with-param name="mathcolor" select="$mathcolor"/>
-                  <xsl:with-param name="mathsize" select="$mathsize"/>
-                  <xsl:with-param name="color" select="$color"/>
-                  <xsl:with-param name="fontsize" select="$fontsize"/>
-                  <xsl:with-param name="ndCur" select="$ndTokenFirst"/>
-                  <xsl:with-param name="fNor">
-                     <xsl:call-template name="FNor">
-                        <xsl:with-param name="ndCur" select="$ndTokenFirst"/>
-                     </xsl:call-template>
-                  </xsl:with-param>
-                  <xsl:with-param name="fLit">
-                     <xsl:call-template name="FLit">
-                        <xsl:with-param name="ndCur" select="$ndTokenFirst"/>
-                     </xsl:call-template>
-                  </xsl:with-param>
-               </xsl:call-template>
-               <t>
+	<!-- %%Template: FNor Given the context of ndCur, determine if ndCur should 
+		be omml's normal style. -->
+	<xsl:template name="FNor">
+		<xsl:param name="ndCur" select="." />
+		<xsl:choose>
+			<!-- Is the current node an mml:mtext, or if this is an mglyph whose parent 
+				is an mml:mtext. -->
+			<xsl:when
+				test="$ndCur/self::mml:mtext or ($ndCur/self::mml:mglyph and parent::mml:mtext)">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-            <!--Create the Run, first output current, then in a 
-							for-each, because all the following siblings are
-							mn, mi, and mo's that conform to the run's properties,
-							group them together-->
-            <xsl:call-template name="OutputText">
-                     <xsl:with-param name="sInput">
-                        <xsl:choose>
-                           <xsl:when test="namespace-uri($ndTokenFirst) = 'http://www.w3.org/1998/Math/MathML' and               local-name($ndTokenFirst) = 'ms'">
-                              <xsl:call-template name="OutputMs">
-                                 <xsl:with-param name="msCur" select="$ndTokenFirst"/>
-                              </xsl:call-template>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="normalize-space($ndTokenFirst)"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                        <xsl:for-each select="$ndTokenFirst/following-sibling::*[self::mml:mi or self::mml:mn or self::mml:mo or self::mml:ms or self::mml:mtext]">
-                           <xsl:choose>
-                              <xsl:when test="namespace-uri(.) = 'http://www.w3.org/1998/Math/MathML' and               local-name(.) = 'ms'">
-                                 <xsl:call-template name="OutputMs">
-                                    <xsl:with-param name="msCur" select="."/>
-                                 </xsl:call-template>
-                              </xsl:when>
-                              <xsl:otherwise>
-                                 <xsl:value-of select="normalize-space(.)"/>
-                              </xsl:otherwise>
-                           </xsl:choose>
-                        </xsl:for-each>
-                     </xsl:with-param>
-                  </xsl:call-template>
-               </t>
-            </xsl:otherwise>
-         </xsl:choose>
-      </r>
+	<!-- %%Template: FLit Given the context of ndCur, determine if ndCur should 
+		have the run omml property of lit (literal, no build up). -->
+	<xsl:template name="FLit">
+		<xsl:param name="ndCur" select="." />
+		<xsl:variable name="sLowerActiontype">
+			<xsl:choose>
+				<xsl:when
+					test="$ndCur/ancestor::mml:maction[@actiontype='lit']/@actiontype">
+					<xsl:value-of
+						select="translate($ndCur/ancestor::mml:maction[@actiontype='lit']/@actiontype, $StrUCAlphabet,                                                                                                       $StrLCAlphabet)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of
+						select="translate($ndCur/ancestor::mml:maction[@actiontype='lit']/@mml:actiontype, $StrUCAlphabet,                                                                                                       $StrLCAlphabet)" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$sLowerActiontype='lit'">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-      <!--The run was terminated by an mi, mn, mo, ms, or mtext with different properties, 
-				therefore, call-template CreateRunWithSameProp, using cndRun+1 node as new start node-->
-    <xsl:if test="$nndBeforeLim!=0             and ($ndTokenFirst/following-sibling::*[$cndRun]/self::mml:mi or             $ndTokenFirst/following-sibling::*[$cndRun]/self::mml:mn or            $ndTokenFirst/following-sibling::*[$cndRun]/self::mml:mo or            $ndTokenFirst/following-sibling::*[$cndRun]/self::mml:ms or                 $ndTokenFirst/following-sibling::*[$cndRun]/self::mml:mtext)              and (count($ndTokenFirst/following-sibling::*[$cndRun]/mml:mglyph) = 0)">
-         <xsl:call-template name="CreateRunWithSameProp">
-            <xsl:with-param name="mathbackground">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@mathbackground">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mathbackground"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:mathbackground"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="mathcolor">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@mathcolor">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mathcolor"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:mathcolor"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="mathvariant">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@mathvariant">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mathvariant"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:mathvariant"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="color">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@color">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@color"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:color"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="font-family">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@font-family">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@font-family"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:font-family"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fontsize">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@fontsize">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@fontsize"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:fontsize"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fontstyle">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@fontstyle">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@fontstyle"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:fontstyle"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fontweight">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@fontweight">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@fontweight"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:fontweight"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="mathsize">
-               <xsl:choose>
-                  <xsl:when test="$ndTokenFirst/following-sibling::*[$cndRun]/@mathsize">
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mathsize"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$ndTokenFirst/following-sibling::*[$cndRun]/@mml:mathsize"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="ndTokenFirst" select="$ndTokenFirst/following-sibling::*[$cndRun]"/>
-         </xsl:call-template>
-      </xsl:if>
-  </xsl:template>
+	<!-- %%Template: CreateRunProp -->
+	<xsl:template name="CreateRunProp">
+		<xsl:param name="mathbackground" />
+		<xsl:param name="mathcolor" />
+		<xsl:param name="mathvariant" />
+		<xsl:param name="color" />
+		<xsl:param name="font-family">
+			Cambria Math
+		</xsl:param>
+		<xsl:param name="fontsize" />
+		<xsl:param name="fontstyle" />
+		<xsl:param name="fontweight" />
+		<xsl:param name="mathsize" />
+		<xsl:param name="ndCur" />
+		<xsl:param name="fNor" />
+		<xsl:param name="fLit" />
+		<w:rPr>
+			<xsl:call-template name="mathrRpHook" />
+			<w:rFonts w:ascii="{$font-family}"
+				w:eastAsia="{$font-family}" w:hAnsi="{$font-family}"
+				w:cs="{$font-family}" />
+			<xsl:choose>
+				<xsl:when test="$fontweight=''" />
+				<xsl:when test="$fontweight='bold'">
+					<w:b />
+				</xsl:when>
+				<xsl:when test="$fontweight='normal'">
+					<w:b w:val="0" />
+				</xsl:when>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="$fontstyle=''" />
+				<xsl:when test="$fontstyle='italic'">
+					<w:i />
+				</xsl:when>
+				<xsl:when test="$fontstyle='normal'">
+					<w:i w:val="0" />
+				</xsl:when>
+			</xsl:choose>
+		</w:rPr>
+		<xsl:variable name="mstyleColor">
+			<xsl:if test="not(not($ndCur))">
+				<xsl:choose>
+					<xsl:when
+						test="$ndCur/ancestor::mml:mstyle[@color][1]/@color">
+						<xsl:value-of
+							select="$ndCur/ancestor::mml:mstyle[@color][1]/@color" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of
+							select="$ndCur/ancestor::mml:mstyle[@color][1]/@mml:color" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:variable>
+		<xsl:call-template name="CreateMathRPR">
+			<xsl:with-param name="mathvariant"
+				select="$mathvariant" />
+			<xsl:with-param name="fontstyle" select="$fontstyle" />
+			<xsl:with-param name="fontweight" select="$fontweight" />
+			<xsl:with-param name="ndCur" select="$ndCur" />
+			<xsl:with-param name="fNor" select="$fNor" />
+			<xsl:with-param name="fLit" select="$fLit" />
+		</xsl:call-template>
+	</xsl:template>
 
-  <!-- %%Template: FNor
-				 Given the context of ndCur, determine if ndCur should be omml's normal style.
-	-->
-  <xsl:template name="FNor">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:choose>
-      <!-- Is the current node an mml:mtext, or if this is an mglyph whose parent is 
-             an mml:mtext. -->
-      <xsl:when test="$ndCur/self::mml:mtext or ($ndCur/self::mml:mglyph and parent::mml:mtext)">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: CreateMathRPR -->
+	<xsl:template name="CreateMathRPR">
+		<xsl:param name="mathvariant" />
+		<xsl:param name="fontstyle" />
+		<xsl:param name="fontweight" />
+		<xsl:param name="ndCur" />
+		<xsl:param name="fNor" />
+		<xsl:param name="fLit" />
+		<xsl:variable name="sFontCur">
+			<xsl:call-template name="GetFontCur">
+				<xsl:with-param name="mathvariant"
+					select="$mathvariant" />
+				<xsl:with-param name="fontstyle" select="$fontstyle" />
+				<xsl:with-param name="fontweight"
+					select="$fontweight" />
+				<xsl:with-param name="ndCur" select="$ndCur" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:if
+			test="$fLit=1 or $fNor=1 or ($sFontCur!='italic' and $sFontCur!='')">
+			<rPr>
+				<xsl:if test="$fNor=1">
+					<nor />
+				</xsl:if>
+				<xsl:if test="$fLit=1">
+					<lit />
+				</xsl:if>
+				<xsl:call-template name="CreateMathScrStyProp">
+					<xsl:with-param name="font" select="$sFontCur" />
+					<xsl:with-param name="fNor" select="$fNor" />
+				</xsl:call-template>
+			</rPr>
+		</xsl:if>
+	</xsl:template>
 
-  <!-- %%Template: FLit
-				 Given the context of ndCur, determine if ndCur should have the 
-				 run omml property of lit (literal, no build up).
-	-->
-  <xsl:template name="FLit">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:variable name="sLowerActiontype">
-         <xsl:choose>
-            <xsl:when test="$ndCur/ancestor::mml:maction[@actiontype='lit']/@actiontype">
-               <xsl:value-of select="translate($ndCur/ancestor::mml:maction[@actiontype='lit']/@actiontype, $StrUCAlphabet,                                                                                                       $StrLCAlphabet)"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="translate($ndCur/ancestor::mml:maction[@actiontype='lit']/@mml:actiontype, $StrUCAlphabet,                                                                                                       $StrLCAlphabet)"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$sLowerActiontype='lit'">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: GetFontCur -->
+	<xsl:template name="GetFontCur">
+		<xsl:param name="ndCur" />
+		<xsl:param name="mathvariant" />
+		<xsl:param name="fontstyle" />
+		<xsl:param name="fontweight" />
+		<xsl:choose>
+			<xsl:when test="$mathvariant!=''">
+				<xsl:value-of select="$mathvariant" />
+			</xsl:when>
+			<xsl:when test="not($ndCur)">
+				<xsl:value-of select="'italic'" />
+			</xsl:when>
+			<xsl:when
+				test="$ndCur/self::mml:mi and (string-length(normalize-space($ndCur)) &lt;= 1)               or $ndCur/self::mml:mn and string(number($ndCur/text()))!='NaN'               or $ndCur/self::mml:mo">
 
-  <!-- %%Template: CreateRunProp
-	-->
-  <xsl:template name="CreateRunProp">
-      <xsl:param name="mathbackground"/>
-      <xsl:param name="mathcolor"/>
-      <xsl:param name="mathvariant"/>
-      <xsl:param name="color"/>
-      <xsl:param name="font-family">Cambria Math</xsl:param>
-      <xsl:param name="fontsize"/>
-      <xsl:param name="fontstyle"/>
-      <xsl:param name="fontweight"/>
-      <xsl:param name="mathsize"/>
-      <xsl:param name="ndCur"/>
-      <xsl:param name="fNor"/>
-      <xsl:param name="fLit"/>
-      <w:rPr>
-	<xsl:call-template name="mathrRpHook"/>
-         <w:rFonts w:ascii="{$font-family}" w:eastAsia="{$font-family}" w:hAnsi="{$font-family}"
-                   w:cs="{$font-family}"/>
-	 <xsl:choose>
-	   <xsl:when test="$fontweight=''"/>
-	   <xsl:when test="$fontweight='bold'">
-	     <w:b/>
-	   </xsl:when>
-	   <xsl:when test="$fontweight='normal'">
-	     <w:b w:val="0"/>
-	   </xsl:when>
-	 </xsl:choose>
-	 <xsl:choose>
-	   <xsl:when test="$fontstyle=''"/>
-	   <xsl:when test="$fontstyle='italic'">
-	     <w:i/>
-	   </xsl:when>
-	   <xsl:when test="$fontstyle='normal'">
-	     <w:i w:val="0"/>
-	   </xsl:when>
-	 </xsl:choose>
-      </w:rPr>
-      <xsl:variable name="mstyleColor">
-         <xsl:if test="not(not($ndCur))">
-            <xsl:choose>
-               <xsl:when test="$ndCur/ancestor::mml:mstyle[@color][1]/@color">
-                  <xsl:value-of select="$ndCur/ancestor::mml:mstyle[@color][1]/@color"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="$ndCur/ancestor::mml:mstyle[@color][1]/@mml:color"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:if>
-      </xsl:variable>
-      <xsl:call-template name="CreateMathRPR">
-         <xsl:with-param name="mathvariant" select="$mathvariant"/>
-         <xsl:with-param name="fontstyle" select="$fontstyle"/>
-         <xsl:with-param name="fontweight" select="$fontweight"/>
-         <xsl:with-param name="ndCur" select="$ndCur"/>
-         <xsl:with-param name="fNor" select="$fNor"/>
-         <xsl:with-param name="fLit" select="$fLit"/>
-      </xsl:call-template>
-  </xsl:template>
+				<!-- The default for the above three cases is fontstyle=italic fontweight=normal. -->
+				<xsl:choose>
+					<xsl:when
+						test="$fontstyle='normal' and $fontweight='bold'">
+						<!-- In omml, a sty of 'b' (which is what bold is translated into) 
+							implies a normal fontstyle -->
+						<xsl:value-of select="'bold'" />
+					</xsl:when>
+					<xsl:when test="$fontstyle='normal'">
+						<xsl:value-of select="'normal'" />
+					</xsl:when>
+					<xsl:when test="$fontweight='bold'">
+						<xsl:value-of select="'bi'" />
+					</xsl:when>
+					<xsl:when test="$fontweight='normal'">
+						<xsl:value-of select="'i'" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="'italic'" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<!--Default is fontweight = 'normal' and fontstyle='normal' -->
+				<xsl:choose>
+					<xsl:when
+						test="$fontstyle='italic' and $fontweight='bold'">
+						<xsl:value-of select="'bi'" />
+					</xsl:when>
+					<xsl:when test="$fontstyle='italic'">
+						<xsl:value-of select="'italic'" />
+					</xsl:when>
+					<xsl:when test="$fontweight='normal'">
+						<xsl:value-of select="'italic'" />
+					</xsl:when>
+					<xsl:when test="$fontweight='bold'">
+						<xsl:value-of select="'bold'" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="'normal'" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- %%Template: CreateMathRPR
-	-->
-  <xsl:template name="CreateMathRPR">
-      <xsl:param name="mathvariant"/>
-      <xsl:param name="fontstyle"/>
-      <xsl:param name="fontweight"/>
-      <xsl:param name="ndCur"/>
-      <xsl:param name="fNor"/>
-      <xsl:param name="fLit"/>
-      <xsl:variable name="sFontCur">
-         <xsl:call-template name="GetFontCur">
-            <xsl:with-param name="mathvariant" select="$mathvariant"/>
-            <xsl:with-param name="fontstyle" select="$fontstyle"/>
-            <xsl:with-param name="fontweight" select="$fontweight"/>
-            <xsl:with-param name="ndCur" select="$ndCur"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:if test="$fLit=1 or $fNor=1 or ($sFontCur!='italic' and $sFontCur!='')">
-         <rPr>
-            <xsl:if test="$fNor=1">
-               <nor/>
-            </xsl:if>
-            <xsl:if test="$fLit=1">
-               <lit/>
-            </xsl:if>
-            <xsl:call-template name="CreateMathScrStyProp">
-               <xsl:with-param name="font" select="$sFontCur"/>
-               <xsl:with-param name="fNor" select="$fNor"/>
-            </xsl:call-template>
-         </rPr>
-      </xsl:if>
-  </xsl:template>
 
-  <!-- %%Template: GetFontCur
-	-->
-  <xsl:template name="GetFontCur">
-      <xsl:param name="ndCur"/>
-      <xsl:param name="mathvariant"/>
-      <xsl:param name="fontstyle"/>
-      <xsl:param name="fontweight"/>
-      <xsl:choose>
-         <xsl:when test="$mathvariant!=''">
-            <xsl:value-of select="$mathvariant"/>
-         </xsl:when>
-         <xsl:when test="not($ndCur)">
-            <xsl:value-of select="'italic'"/>
-         </xsl:when>
-         <xsl:when test="$ndCur/self::mml:mi and (string-length(normalize-space($ndCur)) &lt;= 1)               or $ndCur/self::mml:mn and string(number($ndCur/text()))!='NaN'               or $ndCur/self::mml:mo">
+	<!-- %%Template: CreateMathScrStyProp -->
+	<xsl:template name="CreateMathScrStyProp">
+		<xsl:param name="font" />
+		<xsl:param name="fNor" select="0" />
+		<xsl:choose>
+			<xsl:when test="$font='normal' and $fNor=0">
+				<sty>
+					<xsl:attribute name="m:val">p</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='bold'">
+				<sty>
+					<xsl:attribute name="m:val">b</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='italic'">
+			</xsl:when>
+			<xsl:when test="$font='script'">
+				<scr>
+					<xsl:attribute name="m:val">script</xsl:attribute>
+				</scr>
+			</xsl:when>
+			<xsl:when test="$font='bold-script'">
+				<scr>
+					<xsl:attribute name="m:val">script</xsl:attribute>
+				</scr>
+				<sty>
+					<xsl:attribute name="m:val">b</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='double-struck'">
+				<scr>
+					<xsl:attribute name="m:val">double-struck</xsl:attribute>
+				</scr>
+				<sty>
+					<xsl:attribute name="m:val">p</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='fraktur'">
+				<scr>
+					<xsl:attribute name="m:val">fraktur</xsl:attribute>
+				</scr>
+				<sty>
+					<xsl:attribute name="m:val">p</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='bold-fraktur'">
+				<scr>
+					<xsl:attribute name="m:val">fraktur</xsl:attribute>
+				</scr>
+				<sty>
+					<xsl:attribute name="m:val">b</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='sans-serif'">
+				<scr>
+					<xsl:attribute name="m:val">sans-serif</xsl:attribute>
+				</scr>
+				<sty>
+					<xsl:attribute name="m:val">p</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='bold-sans-serif'">
+				<scr>
+					<xsl:attribute name="m:val">sans-serif</xsl:attribute>
+				</scr>
+				<sty>
+					<xsl:attribute name="m:val">b</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='sans-serif-italic'">
+				<scr>
+					<xsl:attribute name="m:val">sans-serif</xsl:attribute>
+				</scr>
+			</xsl:when>
+			<xsl:when test="$font='sans-serif-bold-italic'">
+				<scr>
+					<xsl:attribute name="m:val">sans-serif</xsl:attribute>
+				</scr>
+				<sty>
+					<xsl:attribute name="m:val">bi</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='monospace'" />
+			<!-- We can't do monospace, so leave empty -->
+			<xsl:when test="$font='bold'">
+				<sty>
+					<xsl:attribute name="m:val">b</xsl:attribute>
+				</sty>
+			</xsl:when>
+			<xsl:when test="$font='bi' or $font='bold-italic'">
+				<sty>
+					<xsl:attribute name="m:val">bi</xsl:attribute>
+				</sty>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-	   <!-- The default for the above three cases is fontstyle=italic fontweight=normal.-->
-	   <xsl:choose>
-	     <xsl:when test="$fontstyle='normal' and $fontweight='bold'">
-	       <!-- In omml, a sty of 'b' (which is what bold is translated into)
-		    implies a normal fontstyle -->
-	       <xsl:value-of select="'bold'"/>
-	     </xsl:when>
-	     <xsl:when test="$fontstyle='normal'">
-	       <xsl:value-of select="'normal'"/>
-	     </xsl:when>
-	     <xsl:when test="$fontweight='bold'">
-	       <xsl:value-of select="'bi'"/>
-	     </xsl:when>
-	     <xsl:when test="$fontweight='normal'">
-	       <xsl:value-of select="'i'"/>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <xsl:value-of select="'italic'"/>
-	     </xsl:otherwise>
-	   </xsl:choose>
-	 </xsl:when>
-	 <xsl:otherwise>
-	   <!--Default is fontweight = 'normal' and fontstyle='normal'-->
-        <xsl:choose>
-	  <xsl:when test="$fontstyle='italic' and $fontweight='bold'">
-	    <xsl:value-of select="'bi'"/>
-	  </xsl:when>
-	  <xsl:when test="$fontstyle='italic'">
-	    <xsl:value-of select="'italic'"/>
-	  </xsl:when>
-	     <xsl:when test="$fontweight='normal'">
-	       <xsl:value-of select="'italic'"/>
-	     </xsl:when>
-	  <xsl:when test="$fontweight='bold'">
-	    <xsl:value-of select="'bold'"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:value-of select="'normal'"/>
-	  </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<xsl:template name="FBar">
+		<xsl:param name="sLineThickness" />
+		<xsl:variable name="sLowerLineThickness"
+			select="translate($sLineThickness, $StrUCAlphabet, $StrLCAlphabet)" />
+		<xsl:choose>
+			<xsl:when
+				test="string-length($sLowerLineThickness)=0                       or $sLowerLineThickness='thin'                        or $sLowerLineThickness='medium'                        or $sLowerLineThickness='thick'">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="fStrContainsNonZeroDigit">
+					<xsl:call-template
+						name="FStrContainsNonZeroDigit">
+						<xsl:with-param name="s"
+							select="$sLowerLineThickness" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$fStrContainsNonZeroDigit=1">
+						1
+					</xsl:when>
+					<xsl:otherwise>
+						0
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- %%Template: CreateMathScrStyProp
-	-->
-  <xsl:template name="CreateMathScrStyProp">
-      <xsl:param name="font"/>
-      <xsl:param name="fNor" select="0"/>
-      <xsl:choose>
-         <xsl:when test="$font='normal' and $fNor=0">
-            <sty>
-               <xsl:attribute name="m:val">p</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='bold'">
-            <sty>
-               <xsl:attribute name="m:val">b</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='italic'">
-      </xsl:when>
-         <xsl:when test="$font='script'">
-            <scr>
-               <xsl:attribute name="m:val">script</xsl:attribute>
-            </scr>
-         </xsl:when>
-         <xsl:when test="$font='bold-script'">
-            <scr>
-               <xsl:attribute name="m:val">script</xsl:attribute>
-            </scr>
-            <sty>
-               <xsl:attribute name="m:val">b</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='double-struck'">
-            <scr>
-               <xsl:attribute name="m:val">double-struck</xsl:attribute>
-            </scr>
-            <sty>
-               <xsl:attribute name="m:val">p</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='fraktur'">
-            <scr>
-               <xsl:attribute name="m:val">fraktur</xsl:attribute>
-            </scr>
-            <sty>
-               <xsl:attribute name="m:val">p</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='bold-fraktur'">
-            <scr>
-               <xsl:attribute name="m:val">fraktur</xsl:attribute>
-            </scr>
-            <sty>
-               <xsl:attribute name="m:val">b</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='sans-serif'">
-            <scr>
-               <xsl:attribute name="m:val">sans-serif</xsl:attribute>
-            </scr>
-            <sty>
-               <xsl:attribute name="m:val">p</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='bold-sans-serif'">
-            <scr>
-               <xsl:attribute name="m:val">sans-serif</xsl:attribute>
-            </scr>
-            <sty>
-               <xsl:attribute name="m:val">b</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='sans-serif-italic'">
-            <scr>
-               <xsl:attribute name="m:val">sans-serif</xsl:attribute>
-            </scr>
-         </xsl:when>
-         <xsl:when test="$font='sans-serif-bold-italic'">
-            <scr>
-               <xsl:attribute name="m:val">sans-serif</xsl:attribute>
-            </scr>
-            <sty>
-               <xsl:attribute name="m:val">bi</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='monospace'"/>
-         <!-- We can't do monospace, so leave empty -->
-      <xsl:when test="$font='bold'">
-            <sty>
-               <xsl:attribute name="m:val">b</xsl:attribute>
-            </sty>
-         </xsl:when>
-         <xsl:when test="$font='bi' or $font='bold-italic'">
-            <sty>
-               <xsl:attribute name="m:val">bi</xsl:attribute>
-            </sty>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: match mfrac -->
+	<xsl:template mode="mml" match="mml:mfrac">
+		<xsl:variable name="fBar">
+			<xsl:call-template name="FBar">
+				<xsl:with-param name="sLineThickness">
+					<xsl:choose>
+						<xsl:when test="@linethickness">
+							<xsl:value-of select="@linethickness" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@mml:linethickness" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
 
-  <xsl:template name="FBar">
-      <xsl:param name="sLineThickness"/>
-      <xsl:variable name="sLowerLineThickness"
-                    select="translate($sLineThickness, $StrUCAlphabet, $StrLCAlphabet)"/>
-      <xsl:choose>
-         <xsl:when test="string-length($sLowerLineThickness)=0                       or $sLowerLineThickness='thin'                        or $sLowerLineThickness='medium'                        or $sLowerLineThickness='thick'">1</xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="fStrContainsNonZeroDigit">
-               <xsl:call-template name="FStrContainsNonZeroDigit">
-                  <xsl:with-param name="s" select="$sLowerLineThickness"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="$fStrContainsNonZeroDigit=1">1</xsl:when>
-               <xsl:otherwise>0</xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-
-
-  <!-- %%Template: match mfrac 
-		-->
-  <xsl:template mode="mml" match="mml:mfrac">
-      <xsl:variable name="fBar">
-         <xsl:call-template name="FBar">
-            <xsl:with-param name="sLineThickness">
-               <xsl:choose>
-                  <xsl:when test="@linethickness">
-                     <xsl:value-of select="@linethickness"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@mml:linethickness"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-         </xsl:call-template>
-      </xsl:variable>
-
-      <f>
-         <fPr>
-            <type>
-               <xsl:attribute name="m:val">
+		<f>
+			<fPr>
+				<type>
+					<xsl:attribute name="m:val">
                   <xsl:choose>
                      <xsl:when test="$fBar=0">noBar</xsl:when>
-                     <xsl:when test="@bevelled='true' or @mml:bevelled='true'">skw</xsl:when>
+                     <xsl:when
+						test="@bevelled='true' or @mml:bevelled='true'">skw</xsl:when>
                      <xsl:otherwise>bar</xsl:otherwise>
                   </xsl:choose>
                </xsl:attribute>
-            </type>
-         </fPr>
-         <num>
-            <xsl:call-template name="CreateArgProp"/>
-            <xsl:apply-templates mode="mml" select="child::*[1]"/>
-         </num>
-         <den>
-            <xsl:call-template name="CreateArgProp"/>
-            <xsl:apply-templates mode="mml" select="child::*[2]"/>
-         </den>
-      </f>
-  </xsl:template>
+				</type>
+			</fPr>
+			<num>
+				<xsl:call-template name="CreateArgProp" />
+				<xsl:apply-templates mode="mml"
+					select="child::*[1]" />
+			</num>
+			<den>
+				<xsl:call-template name="CreateArgProp" />
+				<xsl:apply-templates mode="mml"
+					select="child::*[2]" />
+			</den>
+		</f>
+	</xsl:template>
 
-  <!-- %%Template: match menclose msqrt
-	-->
-  <xsl:template mode="mml" match="mml:menclose | mml:msqrt">
-      <xsl:variable name="sLowerCaseNotation">
-         <xsl:choose>
-            <xsl:when test="@notation">
-               <xsl:value-of select="translate(@notation, $StrUCAlphabet, $StrLCAlphabet)"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="translate(@mml:notation, $StrUCAlphabet, $StrLCAlphabet)"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:choose>
-      <!-- Take care of default -->
-      <xsl:when test="$sLowerCaseNotation='radical'                        or not($sLowerCaseNotation)                        or $sLowerCaseNotation=''                        or self::mml:msqrt">
-            <rad>
-               <radPr>
-                  <degHide>
-                     <xsl:attribute name="m:val">on</xsl:attribute>
-                  </degHide>
-               </radPr>
-               <deg>
-                  <xsl:call-template name="CreateArgProp"/>
-               </deg>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml"/>
-               </e>
-            </rad>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="$sLowerCaseNotation='actuarial' or $sLowerCaseNotation='longdiv'"/>
-               <xsl:otherwise>
-                  <borderBox>
-              <!-- Dealing with more complex notation attribute -->
-              <xsl:variable name="fBox">
-                        <xsl:choose>
-                  <!-- Word doesn't have circle and roundedbox concepts, therefore, map both to a 
-                       box. -->
-                  <xsl:when test="contains($sLowerCaseNotation, 'box')                                   or contains($sLowerCaseNotation, 'circle')                                   or contains($sLowerCaseNotation, 'roundedbox')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
-                     <xsl:variable name="fTop">
-                        <xsl:choose>
-                           <xsl:when test="contains($sLowerCaseNotation, 'top')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
-                     <xsl:variable name="fBot">
-                        <xsl:choose>
-                           <xsl:when test="contains($sLowerCaseNotation, 'bottom')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
-                     <xsl:variable name="fLeft">
-                        <xsl:choose>
-                           <xsl:when test="contains($sLowerCaseNotation, 'left')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
-                     <xsl:variable name="fRight">
-                        <xsl:choose>
-                           <xsl:when test="contains($sLowerCaseNotation, 'right')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
-                     <xsl:variable name="fStrikeH">
-                        <xsl:choose>
-                           <xsl:when test="contains($sLowerCaseNotation, 'horizontalstrike')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
-                     <xsl:variable name="fStrikeV">
-                        <xsl:choose>
-                           <xsl:when test="contains($sLowerCaseNotation, 'verticalstrike')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
-                     <xsl:variable name="fStrikeBLTR">
-                        <xsl:choose>
-                           <xsl:when test="contains($sLowerCaseNotation, 'updiagonalstrike')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
-                     <xsl:variable name="fStrikeTLBR">
-                        <xsl:choose>
-                           <xsl:when test="contains($sLowerCaseNotation, 'downdiagonalstrike')">1</xsl:when>
-                           <xsl:otherwise>0</xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:variable>
+	<!-- %%Template: match menclose msqrt -->
+	<xsl:template mode="mml" match="mml:menclose | mml:msqrt">
+		<xsl:variable name="sLowerCaseNotation">
+			<xsl:choose>
+				<xsl:when test="@notation">
+					<xsl:value-of
+						select="translate(@notation, $StrUCAlphabet, $StrLCAlphabet)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of
+						select="translate(@mml:notation, $StrUCAlphabet, $StrLCAlphabet)" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<!-- Take care of default -->
+			<xsl:when
+				test="$sLowerCaseNotation='radical'                        or not($sLowerCaseNotation)                        or $sLowerCaseNotation=''                        or self::mml:msqrt">
+				<rad>
+					<radPr>
+						<degHide>
+							<xsl:attribute name="m:val">on</xsl:attribute>
+						</degHide>
+					</radPr>
+					<deg>
+						<xsl:call-template name="CreateArgProp" />
+					</deg>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml" />
+					</e>
+				</rad>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when
+						test="$sLowerCaseNotation='actuarial' or $sLowerCaseNotation='longdiv'" />
+					<xsl:otherwise>
+						<borderBox>
+							<!-- Dealing with more complex notation attribute -->
+							<xsl:variable name="fBox">
+								<xsl:choose>
+									<!-- Word doesn't have circle and roundedbox concepts, therefore, 
+										map both to a box. -->
+									<xsl:when
+										test="contains($sLowerCaseNotation, 'box')                                   or contains($sLowerCaseNotation, 'circle')                                   or contains($sLowerCaseNotation, 'roundedbox')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:variable name="fTop">
+								<xsl:choose>
+									<xsl:when test="contains($sLowerCaseNotation, 'top')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:variable name="fBot">
+								<xsl:choose>
+									<xsl:when
+										test="contains($sLowerCaseNotation, 'bottom')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:variable name="fLeft">
+								<xsl:choose>
+									<xsl:when test="contains($sLowerCaseNotation, 'left')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:variable name="fRight">
+								<xsl:choose>
+									<xsl:when
+										test="contains($sLowerCaseNotation, 'right')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:variable name="fStrikeH">
+								<xsl:choose>
+									<xsl:when
+										test="contains($sLowerCaseNotation, 'horizontalstrike')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:variable name="fStrikeV">
+								<xsl:choose>
+									<xsl:when
+										test="contains($sLowerCaseNotation, 'verticalstrike')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:variable name="fStrikeBLTR">
+								<xsl:choose>
+									<xsl:when
+										test="contains($sLowerCaseNotation, 'updiagonalstrike')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:variable name="fStrikeTLBR">
+								<xsl:choose>
+									<xsl:when
+										test="contains($sLowerCaseNotation, 'downdiagonalstrike')">
+										1
+									</xsl:when>
+									<xsl:otherwise>
+										0
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
 
-                     <!-- Should we create borderBoxPr? 
-                   We should if the enclosure isn't Word's default, which is
-                   a plain box -->
-              <xsl:if test="$fStrikeH=1                            or $fStrikeV=1                           or $fStrikeBLTR=1                            or $fStrikeTLBR=1                           or ($fBox=0                               and not($fTop=1                                        and $fBot=1                                       and $fLeft=1                                       and $fRight=1)                               )">
-                        <borderBoxPr>
-                           <xsl:if test="$fBox=0">
-                              <xsl:if test="$fTop=0">
-                                 <hideTop>
-                                    <xsl:attribute name="m:val">on</xsl:attribute>
-                                 </hideTop>
-                              </xsl:if>
-                              <xsl:if test="$fBot=0">
-                                 <hideBot>
-                                    <xsl:attribute name="m:val">on</xsl:attribute>
-                                 </hideBot>
-                              </xsl:if>
-                              <xsl:if test="$fLeft=0">
-                                 <hideLeft>
-                                    <xsl:attribute name="m:val">on</xsl:attribute>
-                                 </hideLeft>
-                              </xsl:if>
-                              <xsl:if test="$fRight=0">
-                                 <hideRight>
-                                    <xsl:attribute name="m:val">on</xsl:attribute>
-                                 </hideRight>
-                              </xsl:if>
-                           </xsl:if>
-                           <xsl:if test="$fStrikeH=1">
-                              <strikeH>
-                                 <xsl:attribute name="m:val">on</xsl:attribute>
-                              </strikeH>
-                           </xsl:if>
-                           <xsl:if test="$fStrikeV=1">
-                              <strikeV>
-                                 <xsl:attribute name="m:val">on</xsl:attribute>
-                              </strikeV>
-                           </xsl:if>
-                           <xsl:if test="$fStrikeBLTR=1">
-                              <strikeBLTR>
-                                 <xsl:attribute name="m:val">on</xsl:attribute>
-                              </strikeBLTR>
-                           </xsl:if>
-                           <xsl:if test="$fStrikeTLBR=1">
-                              <strikeTLBR>
-                                 <xsl:attribute name="m:val">on</xsl:attribute>
-                              </strikeTLBR>
-                           </xsl:if>
-                        </borderBoxPr>
-                     </xsl:if>
-                     <e>
-                        <xsl:call-template name="CreateArgProp"/>
-                        <xsl:apply-templates mode="mml"/>
-                     </e>
-                  </borderBox>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+							<!-- Should we create borderBoxPr? We should if the enclosure isn't 
+								Word's default, which is a plain box -->
+							<xsl:if
+								test="$fStrikeH=1                            or $fStrikeV=1                           or $fStrikeBLTR=1                            or $fStrikeTLBR=1                           or ($fBox=0                               and not($fTop=1                                        and $fBot=1                                       and $fLeft=1                                       and $fRight=1)                               )">
+								<borderBoxPr>
+									<xsl:if test="$fBox=0">
+										<xsl:if test="$fTop=0">
+											<hideTop>
+												<xsl:attribute name="m:val">on</xsl:attribute>
+											</hideTop>
+										</xsl:if>
+										<xsl:if test="$fBot=0">
+											<hideBot>
+												<xsl:attribute name="m:val">on</xsl:attribute>
+											</hideBot>
+										</xsl:if>
+										<xsl:if test="$fLeft=0">
+											<hideLeft>
+												<xsl:attribute name="m:val">on</xsl:attribute>
+											</hideLeft>
+										</xsl:if>
+										<xsl:if test="$fRight=0">
+											<hideRight>
+												<xsl:attribute name="m:val">on</xsl:attribute>
+											</hideRight>
+										</xsl:if>
+									</xsl:if>
+									<xsl:if test="$fStrikeH=1">
+										<strikeH>
+											<xsl:attribute name="m:val">on</xsl:attribute>
+										</strikeH>
+									</xsl:if>
+									<xsl:if test="$fStrikeV=1">
+										<strikeV>
+											<xsl:attribute name="m:val">on</xsl:attribute>
+										</strikeV>
+									</xsl:if>
+									<xsl:if test="$fStrikeBLTR=1">
+										<strikeBLTR>
+											<xsl:attribute name="m:val">on</xsl:attribute>
+										</strikeBLTR>
+									</xsl:if>
+									<xsl:if test="$fStrikeTLBR=1">
+										<strikeTLBR>
+											<xsl:attribute name="m:val">on</xsl:attribute>
+										</strikeTLBR>
+									</xsl:if>
+								</borderBoxPr>
+							</xsl:if>
+							<e>
+								<xsl:call-template name="CreateArgProp" />
+								<xsl:apply-templates mode="mml" />
+							</e>
+						</borderBox>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- %%Template: CreateArgProp
-	-->
-  <xsl:template name="CreateArgProp">
-      <xsl:if test="not(count(ancestor-or-self::mml:mstyle[@scriptlevel='0' or @scriptlevel='1' or @scriptlevel='2'])=0)                   or not(count(ancestor-or-self::mml:mstyle[@mml:scriptlevel='0' or @mml:scriptlevel='1' or @mml:scriptlevel='2'])=0)">
-         <argPr>
-            <scrLvl>
-               <xsl:attribute name="m:val">
+	<!-- %%Template: CreateArgProp -->
+	<xsl:template name="CreateArgProp">
+		<xsl:if
+			test="not(count(ancestor-or-self::mml:mstyle[@scriptlevel='0' or @scriptlevel='1' or @scriptlevel='2'])=0)                   or not(count(ancestor-or-self::mml:mstyle[@mml:scriptlevel='0' or @mml:scriptlevel='1' or @mml:scriptlevel='2'])=0)">
+			<argPr>
+				<scrLvl>
+					<xsl:attribute name="m:val">
                   <xsl:choose>
-                     <xsl:when test="ancestor-or-self::mml:mstyle[@scriptlevel][1]/@scriptlevel">
-                        <xsl:value-of select="ancestor-or-self::mml:mstyle[@scriptlevel][1]/@scriptlevel"/>
+                     <xsl:when
+						test="ancestor-or-self::mml:mstyle[@scriptlevel][1]/@scriptlevel">
+                        <xsl:value-of
+						select="ancestor-or-self::mml:mstyle[@scriptlevel][1]/@scriptlevel" />
                      </xsl:when>
                      <xsl:otherwise>
-                        <xsl:value-of select="ancestor-or-self::mml:mstyle[@scriptlevel][1]/@mml:scriptlevel"/>
+                        <xsl:value-of
+						select="ancestor-or-self::mml:mstyle[@scriptlevel][1]/@mml:scriptlevel" />
                      </xsl:otherwise>
                   </xsl:choose>
                </xsl:attribute>
-            </scrLvl>
-         </argPr>
-      </xsl:if>
-  </xsl:template>
+				</scrLvl>
+			</argPr>
+		</xsl:if>
+	</xsl:template>
 
-  <!-- %%Template: match mroot
-	-->
-  <xsl:template mode="mml" match="mml:mroot">
-      <rad>
-         <radPr>
-            <degHide>
-               <xsl:attribute name="m:val">off</xsl:attribute>
-            </degHide>
-         </radPr>
-         <deg>
-            <xsl:call-template name="CreateArgProp"/>
-            <xsl:apply-templates mode="mml" select="child::*[2]"/>
-         </deg>
-         <e>
-            <xsl:call-template name="CreateArgProp"/>
-            <xsl:apply-templates mode="mml" select="child::*[1]"/>
-         </e>
-      </rad>
-  </xsl:template>
+	<!-- %%Template: match mroot -->
+	<xsl:template mode="mml" match="mml:mroot">
+		<rad>
+			<radPr>
+				<degHide>
+					<xsl:attribute name="m:val">off</xsl:attribute>
+				</degHide>
+			</radPr>
+			<deg>
+				<xsl:call-template name="CreateArgProp" />
+				<xsl:apply-templates mode="mml"
+					select="child::*[2]" />
+			</deg>
+			<e>
+				<xsl:call-template name="CreateArgProp" />
+				<xsl:apply-templates mode="mml"
+					select="child::*[1]" />
+			</e>
+		</rad>
+	</xsl:template>
 
-  <!-- MathML has no concept of a linear fraction.  When transforming a linear fraction
-       from Omml to MathML, we create the following MathML:
-       
-       <mml:mrow>
-         <mml:mrow>
-            // numerator
-         </mml:mrow>
-         <mml:mo>/</mml:mo>
-         <mml:mrow>
-            // denominator
-         </mml:mrow>
-       </mml:mrow>
-       
-       This template looks for four things:
-          1.  ndCur is an mml:mrow
-          2.  ndCur has three children
-          3.  The second child is an <mml:mo>
-          4.  The second child's text is '/'
-       
-       -->
-  <xsl:template name="FLinearFrac">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:variable name="sNdText">
-         <xsl:value-of select="normalize-space($ndCur/*[2])"/>
-      </xsl:variable>
+	<!-- MathML has no concept of a linear fraction. When transforming a linear 
+		fraction from Omml to MathML, we create the following MathML: <mml:mrow> 
+		<mml:mrow> // numerator </mml:mrow> <mml:mo>/</mml:mo> <mml:mrow> // denominator 
+		</mml:mrow> </mml:mrow> This template looks for four things: 1. ndCur is 
+		an mml:mrow 2. ndCur has three children 3. The second child is an <mml:mo> 
+		4. The second child's text is '/' -->
+	<xsl:template name="FLinearFrac">
+		<xsl:param name="ndCur" select="." />
+		<xsl:variable name="sNdText">
+			<xsl:value-of select="normalize-space($ndCur/*[2])" />
+		</xsl:variable>
 
-      <xsl:choose>
-      <!-- I spy a linear fraction -->
-      <xsl:when test="$ndCur/self::mml:mrow                       and count($ndCur/*)=3                       and $ndCur/*[2][self::mml:mo]                       and $sNdText='/'">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<!-- I spy a linear fraction -->
+			<xsl:when
+				test="$ndCur/self::mml:mrow                       and count($ndCur/*)=3                       and $ndCur/*[2][self::mml:mo]                       and $sNdText='/'">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- Though presentation mathml can certainly typeset any generic function with the
-	     appropriate function operator spacing, presentation MathML has no concept of 
-			 a function structure like omml does.  In order to preserve the omml <func> 
-			 element, we must establish how an omml <func> element looks in mml.  This 
-			 is shown below:
-       
-       <mml:mrow>
-         <mml:mrow>
-            // function name
-         </mml:mrow>
-         <mml:mo>&#x02061;</mml:mo>
-         <mml:mrow>
-            // function argument
-         </mml:mrow>
-       </mml:mrow>
-       
-       This template looks for six things to be true:
-					1.  ndCur is an mml:mrow
-					2.  ndCur has three children
-					3.  The first child is an <mml:mrow>
-					4.  The second child is an <mml:mo>
-					5.  The third child is an <mml:mrow>
-					6.  The second child's text is '&#x02061;'
-       -->
-  <xsl:template name="FIsFunc">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:variable name="sNdText">
-         <xsl:value-of select="normalize-space($ndCur/*[2])"/>
-      </xsl:variable>
+	<!-- Though presentation mathml can certainly typeset any generic function 
+		with the appropriate function operator spacing, presentation MathML has no 
+		concept of a function structure like omml does. In order to preserve the 
+		omml <func> element, we must establish how an omml <func> element looks in 
+		mml. This is shown below: <mml:mrow> <mml:mrow> // function name </mml:mrow> 
+		<mml:mo>&#x02061;</mml:mo> <mml:mrow> // function argument </mml:mrow> </mml:mrow> 
+		This template looks for six things to be true: 1. ndCur is an mml:mrow 2. 
+		ndCur has three children 3. The first child is an <mml:mrow> 4. The second 
+		child is an <mml:mo> 5. The third child is an <mml:mrow> 6. The second child's 
+		text is '&#x02061;' -->
+	<xsl:template name="FIsFunc">
+		<xsl:param name="ndCur" select="." />
+		<xsl:variable name="sNdText">
+			<xsl:value-of select="normalize-space($ndCur/*[2])" />
+		</xsl:variable>
 
-      <xsl:choose>
-      <!-- Is this an omml function -->
-      <xsl:when test="count($ndCur/*)=3               and $ndCur/self::*[self::mml:mrow]                       and $ndCur/*[2][self::mml:mo]                       and $sNdText='⁡'">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<!-- Is this an omml function -->
+			<xsl:when
+				test="count($ndCur/*)=3               and $ndCur/self::*[self::mml:mrow]                       and $ndCur/*[2][self::mml:mo]                       and $sNdText='⁡'">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- Given the node of the linear fraction's parent mrow, 
-       make a linear fraction -->
-  <xsl:template name="MakeLinearFraction">
-      <xsl:param name="ndCur" select="."/>
-      <f>
-         <fPr>
-            <type>
-               <xsl:attribute name="m:val">lin</xsl:attribute>
-            </type>
-         </fPr>
-         <num>
-            <xsl:call-template name="CreateArgProp"/>
-            <xsl:apply-templates mode="mml" select="$ndCur/*[1]"/>
-         </num>
-         <den>
-            <xsl:call-template name="CreateArgProp"/>
-            <xsl:apply-templates mode="mml" select="$ndCur/*[3]"/>
-         </den>
-      </f>
-  </xsl:template>
+	<!-- Given the node of the linear fraction's parent mrow, make a linear 
+		fraction -->
+	<xsl:template name="MakeLinearFraction">
+		<xsl:param name="ndCur" select="." />
+		<f>
+			<fPr>
+				<type>
+					<xsl:attribute name="m:val">lin</xsl:attribute>
+				</type>
+			</fPr>
+			<num>
+				<xsl:call-template name="CreateArgProp" />
+				<xsl:apply-templates mode="mml"
+					select="$ndCur/*[1]" />
+			</num>
+			<den>
+				<xsl:call-template name="CreateArgProp" />
+				<xsl:apply-templates mode="mml"
+					select="$ndCur/*[3]" />
+			</den>
+		</f>
+	</xsl:template>
 
 
-  <!-- Given the node of the function's parent mrow, 
-       make an omml function -->
-  <xsl:template name="WriteFunc">
-      <xsl:param name="ndCur" select="."/>
+	<!-- Given the node of the function's parent mrow, make an omml function -->
+	<xsl:template name="WriteFunc">
+		<xsl:param name="ndCur" select="." />
 
-      <func>
-         <fName>
-            <xsl:apply-templates mode="mml" select="$ndCur/child::*[1]"/>
-         </fName>
-         <e>
-            <xsl:apply-templates mode="mml" select="$ndCur/child::*[3]"/>
-         </e>
-      </func>
-  </xsl:template>
+		<func>
+			<fName>
+				<xsl:apply-templates mode="mml"
+					select="$ndCur/child::*[1]" />
+			</fName>
+			<e>
+				<xsl:apply-templates mode="mml"
+					select="$ndCur/child::*[3]" />
+			</e>
+		</func>
+	</xsl:template>
 
 
-  <!-- MathML doesn't have the concept of nAry structures.  The best approximation
-       to these is to have some under/over or sub/sup followed by an mrow or mstyle.
-       
-       In the case that we've come across some under/over or sub/sup that contains an 
-       nAry operator, this function handles the following sibling to the nAry structure.
-       
-       If the following sibling is:
-       
-          mml:mstyle, then apply templates to the children of this mml:mstyle
-          
-          mml:mrow, determine if this mrow is a linear fraction 
-          (see comments for FlinearFrac template).
-              If so, make an Omml linear fraction.
-              If not, apply templates as was done for mml:mstyle.
-       
-       -->
-  <xsl:template name="NaryHandleMrowMstyle">
-      <xsl:param name="ndCur" select="."/>
-      <!-- if the next sibling is an mrow, pull it in by 
-							doing whatever we would have done to its children. 
-							The mrow itself will be skipped, see template above. -->
-    <xsl:choose>
-         <xsl:when test="$ndCur[self::mml:mrow]">
-        <!-- Check for linear fraction -->
-        <xsl:variable name="fLinearFrac">
-               <xsl:call-template name="FLinearFrac">
-                  <xsl:with-param name="ndCur" select="$ndCur"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="$fLinearFrac=1">
-                  <xsl:call-template name="MakeLinearFraction">
-                     <xsl:with-param name="ndCur" select="$ndCur"/>
-                  </xsl:call-template>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:variable name="fFunc">
-                     <xsl:call-template name="FIsFunc">
-                        <xsl:with-param name="ndCur" select="."/>
-                     </xsl:call-template>
-                  </xsl:variable>
-                  <xsl:choose>
-                     <xsl:when test="$fFunc=1">
-                        <xsl:call-template name="WriteFunc">
-                           <xsl:with-param name="ndCur" select="."/>
-                        </xsl:call-template>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:apply-templates mode="mml" select="$ndCur/*"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:when test="$ndCur[self::mml:mstyle]">
-            <xsl:apply-templates mode="mml" select="$ndCur/*"/>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
+	<!-- MathML doesn't have the concept of nAry structures. The best approximation 
+		to these is to have some under/over or sub/sup followed by an mrow or mstyle. 
+		In the case that we've come across some under/over or sub/sup that contains 
+		an nAry operator, this function handles the following sibling to the nAry 
+		structure. If the following sibling is: mml:mstyle, then apply templates 
+		to the children of this mml:mstyle mml:mrow, determine if this mrow is a 
+		linear fraction (see comments for FlinearFrac template). If so, make an Omml 
+		linear fraction. If not, apply templates as was done for mml:mstyle. -->
+	<xsl:template name="NaryHandleMrowMstyle">
+		<xsl:param name="ndCur" select="." />
+		<!-- if the next sibling is an mrow, pull it in by doing whatever we would 
+			have done to its children. The mrow itself will be skipped, see template 
+			above. -->
+		<xsl:choose>
+			<xsl:when test="$ndCur[self::mml:mrow]">
+				<!-- Check for linear fraction -->
+				<xsl:variable name="fLinearFrac">
+					<xsl:call-template name="FLinearFrac">
+						<xsl:with-param name="ndCur" select="$ndCur" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$fLinearFrac=1">
+						<xsl:call-template name="MakeLinearFraction">
+							<xsl:with-param name="ndCur" select="$ndCur" />
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:variable name="fFunc">
+							<xsl:call-template name="FIsFunc">
+								<xsl:with-param name="ndCur" select="." />
+							</xsl:call-template>
+						</xsl:variable>
+						<xsl:choose>
+							<xsl:when test="$fFunc=1">
+								<xsl:call-template name="WriteFunc">
+									<xsl:with-param name="ndCur" select="." />
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:apply-templates mode="mml"
+									select="$ndCur/*" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="$ndCur[self::mml:mstyle]">
+				<xsl:apply-templates mode="mml"
+					select="$ndCur/*" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- MathML munder/mover can represent several Omml constructs 
-       (m:bar, m:limLow, m:limUpp, m:acc, m:groupChr, etc.).  The following 
-       templates (FIsBar, FIsAcc, and FIsGroupChr) are used to determine 
-			 which of these Omml constructs an munder/mover should be translated into. -->
+	<!-- MathML munder/mover can represent several Omml constructs (m:bar, m:limLow, 
+		m:limUpp, m:acc, m:groupChr, etc.). The following templates (FIsBar, FIsAcc, 
+		and FIsGroupChr) are used to determine which of these Omml constructs an 
+		munder/mover should be translated into. -->
 
-  <!-- Note:  ndCur should only be an munder/mover MathML element.
-  
-       ndCur should be interpretted as an m:bar if
-          1)  its respective accent attribute is not true
-          2)  its second child is an mml:mo
-          3)  the character of the mml:mo is the correct under/over bar. -->
-  <xsl:template name="FIsBar">
-      <xsl:param name="ndCur"/>
-      <xsl:variable name="fUnder">
-         <xsl:choose>
-            <xsl:when test="$ndCur[self::mml:munder]">1</xsl:when>
-            <xsl:otherwise>0</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="sLowerCaseAccent">
-         <xsl:choose>
-            <xsl:when test="$fUnder=1">
-               <xsl:choose>
-                  <xsl:when test="$ndCur/@accentunder">
-                     <xsl:value-of select="translate($ndCur/@accentunder, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/@mml:accentunder, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:choose>
-                  <xsl:when test="$ndCur/@accent">
-                     <xsl:value-of select="translate($ndCur/@accent, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/@mml:accent, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="fAccent">
-         <xsl:choose>
-            <xsl:when test="$sLowerCaseAccent='true'">1</xsl:when>
-            <xsl:otherwise>0</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+	<!-- Note: ndCur should only be an munder/mover MathML element. ndCur should 
+		be interpretted as an m:bar if 1) its respective accent attribute is not 
+		true 2) its second child is an mml:mo 3) the character of the mml:mo is the 
+		correct under/over bar. -->
+	<xsl:template name="FIsBar">
+		<xsl:param name="ndCur" />
+		<xsl:variable name="fUnder">
+			<xsl:choose>
+				<xsl:when test="$ndCur[self::mml:munder]">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="sLowerCaseAccent">
+			<xsl:choose>
+				<xsl:when test="$fUnder=1">
+					<xsl:choose>
+						<xsl:when test="$ndCur/@accentunder">
+							<xsl:value-of
+								select="translate($ndCur/@accentunder, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/@mml:accentunder, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:choose>
+						<xsl:when test="$ndCur/@accent">
+							<xsl:value-of
+								select="translate($ndCur/@accent, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/@mml:accent, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fAccent">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseAccent='true'">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <xsl:choose>
-      <!-- The script is unaccented and the second child is an mo -->
-      <xsl:when test="$fAccent = 0                        and $ndCur/child::*[2]/self::mml:mo">
-            <xsl:variable name="sOperator">
-               <xsl:value-of select="$ndCur/child::*[2]"/>
-            </xsl:variable>
-            <xsl:choose>
-          <!-- Should we write an underbar? -->
-          <xsl:when test="$fUnder = 1">
-                  <xsl:choose>
-                     <xsl:when test="$sOperator = '̲'">1</xsl:when>
-                     <xsl:otherwise>0</xsl:otherwise>
-                  </xsl:choose>
-               </xsl:when>
-               <!-- Should we write an overbar? -->
-          <xsl:otherwise>
-                  <xsl:choose>
-                     <xsl:when test="$sOperator = '¯'">1</xsl:when>
-                     <xsl:otherwise>0</xsl:otherwise>
-                  </xsl:choose>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<!-- The script is unaccented and the second child is an mo -->
+			<xsl:when
+				test="$fAccent = 0                        and $ndCur/child::*[2]/self::mml:mo">
+				<xsl:variable name="sOperator">
+					<xsl:value-of select="$ndCur/child::*[2]" />
+				</xsl:variable>
+				<xsl:choose>
+					<!-- Should we write an underbar? -->
+					<xsl:when test="$fUnder = 1">
+						<xsl:choose>
+							<xsl:when test="$sOperator = '̲'">
+								1
+							</xsl:when>
+							<xsl:otherwise>
+								0
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<!-- Should we write an overbar? -->
+					<xsl:otherwise>
+						<xsl:choose>
+							<xsl:when test="$sOperator = '¯'">
+								1
+							</xsl:when>
+							<xsl:otherwise>
+								0
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- Note:  ndCur should only be an mover MathML element.
-  
-       ndCur should be interpretted as an m:acc if
-          1)  its accent attribute is true
-          2)  its second child is an mml:mo
-          3)  there is only one character in the mml:mo -->
-  <xsl:template name="FIsAcc">
-      <xsl:param name="ndCur" select="."/>
+	<!-- Note: ndCur should only be an mover MathML element. ndCur should be 
+		interpretted as an m:acc if 1) its accent attribute is true 2) its second 
+		child is an mml:mo 3) there is only one character in the mml:mo -->
+	<xsl:template name="FIsAcc">
+		<xsl:param name="ndCur" select="." />
 
-      <xsl:variable name="sLowerCaseAccent">
-         <xsl:choose>
-            <xsl:when test="$ndCur/@accent">
-               <xsl:value-of select="translate($ndCur/@accent, $StrUCAlphabet, $StrLCAlphabet)"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="translate($ndCur/@mml:accent, $StrUCAlphabet, $StrLCAlphabet)"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="fAccent">
-         <xsl:choose>
-            <xsl:when test="$sLowerCaseAccent='true'">1</xsl:when>
-            <xsl:otherwise>0</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+		<xsl:variable name="sLowerCaseAccent">
+			<xsl:choose>
+				<xsl:when test="$ndCur/@accent">
+					<xsl:value-of
+						select="translate($ndCur/@accent, $StrUCAlphabet, $StrLCAlphabet)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of
+						select="translate($ndCur/@mml:accent, $StrUCAlphabet, $StrLCAlphabet)" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fAccent">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseAccent='true'">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <xsl:choose>
-      <!-- The script is accented and the second child is an mo -->
-      <xsl:when test="$fAccent = 1                        and $ndCur/child::*[2] = mml:mo">
-            <xsl:variable name="sOperator">
-               <xsl:value-of select="$ndCur/child::*[2]"/>
-            </xsl:variable>
-            <xsl:choose>
-          <!-- There is only one operator, this is a valid Omml accent! -->
-          <xsl:when test="string-length($sOperator) = 1">1</xsl:when>
-               <!-- More than one accented operator.  This isn't a valid
-               omml accent -->
-          <xsl:otherwise>0</xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <!-- Not accented, not an operator, or both, but in any case, this is
-           not an Omml accent. -->
-      <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<!-- The script is accented and the second child is an mo -->
+			<xsl:when
+				test="$fAccent = 1                        and $ndCur/child::*[2] = mml:mo">
+				<xsl:variable name="sOperator">
+					<xsl:value-of select="$ndCur/child::*[2]" />
+				</xsl:variable>
+				<xsl:choose>
+					<!-- There is only one operator, this is a valid Omml accent! -->
+					<xsl:when test="string-length($sOperator) = 1">
+						1
+					</xsl:when>
+					<!-- More than one accented operator. This isn't a valid omml accent -->
+					<xsl:otherwise>
+						0
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<!-- Not accented, not an operator, or both, but in any case, this is 
+				not an Omml accent. -->
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- Is ndCur a groupChr? 
-			 ndCur is a groupChr if:
-			 
-				 1.  The accent is false (note:  accent attribute 
-						 for munder is accentunder). 
-				 2.  ndCur is an munder or mover.
-				 3.  ndCur has two children
-				 4.  Of these two children, one is an mml:mo and the other is an mml:mrow
-				 5.  The number of characters in the mml:mo is 1.
-			 
-			 If all of the above are true, then return 1, else return 0.
-	-->
-  <xsl:template name="FIsGroupChr">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:variable name="fUnder">
-         <xsl:choose>
-            <xsl:when test="$ndCur[self::mml:munder]">1</xsl:when>
-            <xsl:otherwise>0</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="sLowerCaseAccent">
-         <xsl:choose>
-            <xsl:when test="$fUnder=1">
-               <xsl:choose>
-                  <xsl:when test="$ndCur/@accentunder">
-                     <xsl:value-of select="translate($ndCur/@accentunder, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/@mml:accentunder, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:choose>
-                  <xsl:when test="$ndCur/@accent">
-                     <xsl:value-of select="translate($ndCur/@accent, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/@mml:accent, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+	<!-- Is ndCur a groupChr? ndCur is a groupChr if: 1. The accent is false 
+		(note: accent attribute for munder is accentunder). 2. ndCur is an munder 
+		or mover. 3. ndCur has two children 4. Of these two children, one is an mml:mo 
+		and the other is an mml:mrow 5. The number of characters in the mml:mo is 
+		1. If all of the above are true, then return 1, else return 0. -->
+	<xsl:template name="FIsGroupChr">
+		<xsl:param name="ndCur" select="." />
+		<xsl:variable name="fUnder">
+			<xsl:choose>
+				<xsl:when test="$ndCur[self::mml:munder]">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="sLowerCaseAccent">
+			<xsl:choose>
+				<xsl:when test="$fUnder=1">
+					<xsl:choose>
+						<xsl:when test="$ndCur/@accentunder">
+							<xsl:value-of
+								select="translate($ndCur/@accentunder, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/@mml:accentunder, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:choose>
+						<xsl:when test="$ndCur/@accent">
+							<xsl:value-of
+								select="translate($ndCur/@accent, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/@mml:accent, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <xsl:variable name="fAccentFalse">
-         <xsl:choose>
-            <xsl:when test="$sLowerCaseAccent='false'">1</xsl:when>
-            <xsl:otherwise>0</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+		<xsl:variable name="fAccentFalse">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseAccent='false'">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <xsl:choose>
-         <xsl:when test="$fAccentFalse=1                       and $ndCur[self::mml:munder or self::mml:mover]                        and count($ndCur/child::*)=2                        and (($ndCur/child::*[1][self::mml:mrow] and $ndCur/child::*[2][self::mml:mo])                              or ($ndCur/child::*[1][self::mml:mo] and $ndCur/child::*[2][self::mml:mrow]))">
-            <xsl:variable name="sOperator">
-               <xsl:value-of select="$ndCur/child::mml:mo"/>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="string-length($sOperator) &lt;= 1">1</xsl:when>
-               <xsl:otherwise>0</xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
+		<xsl:choose>
+			<xsl:when
+				test="$fAccentFalse=1                       and $ndCur[self::mml:munder or self::mml:mover]                        and count($ndCur/child::*)=2                        and (($ndCur/child::*[1][self::mml:mrow] and $ndCur/child::*[2][self::mml:mo])                              or ($ndCur/child::*[1][self::mml:mo] and $ndCur/child::*[2][self::mml:mrow]))">
+				<xsl:variable name="sOperator">
+					<xsl:value-of select="$ndCur/child::mml:mo" />
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="string-length($sOperator) &lt;= 1">
+						1
+					</xsl:when>
+					<xsl:otherwise>
+						0
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
 
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- %%Template: match munder
-	-->
-  <xsl:template mode="mml" match="mml:munder">
-      <xsl:variable name="fNary">
-         <xsl:call-template name="isNary">
-            <xsl:with-param name="ndCur" select="child::*[1]"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$fNary='true'">
-            <nary>
-               <xsl:call-template name="CreateNaryProp">
-                  <xsl:with-param name="chr">
-                     <xsl:value-of select="normalize-space(child::*[1])"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="sMathmlType" select="'munder'"/>
-               </xsl:call-template>
-               <sub>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sub>
-               <sup>
-                  <xsl:call-template name="CreateArgProp"/>
-               </sup>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:call-template name="NaryHandleMrowMstyle">
-                     <xsl:with-param name="ndCur" select="following-sibling::*[1]"/>
-                  </xsl:call-template>
-               </e>
-            </nary>
-         </xsl:when>
-         <xsl:otherwise>
-        <!-- Should this munder be interpreted as an OMML m:bar? -->
-        <xsl:variable name="fIsBar">
-               <xsl:call-template name="FIsBar">
-                  <xsl:with-param name="ndCur" select="."/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="$fIsBar=1">
-                  <bar>
-                     <barPr>
-                        <pos m:val="bot"/>
-                     </barPr>
-                     <e>
-                        <xsl:call-template name="CreateArgProp"/>
-                        <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                     </e>
-                  </bar>
-               </xsl:when>
-               <xsl:otherwise>
-            <!-- It isn't an integral or underbar, is this a groupChr? -->
-            <xsl:variable name="fGroupChr">
-                     <xsl:call-template name="FIsGroupChr">
-                        <xsl:with-param name="ndCur" select="."/>
-                     </xsl:call-template>
-                  </xsl:variable>
-                  <xsl:choose>
-                     <xsl:when test="$fGroupChr=1">
-                        <groupChr>
-                           <xsl:call-template name="CreateGroupChrPr">
-                              <xsl:with-param name="chr">
-                                 <xsl:value-of select="mml:mo"/>
-                              </xsl:with-param>
-                              <xsl:with-param name="pos">
-                                 <xsl:choose>
-                                    <xsl:when test="child::*[1][self::mml:mrow]">bot</xsl:when>
-                                    <xsl:otherwise>top</xsl:otherwise>
-                                 </xsl:choose>
-                              </xsl:with-param>
-                              <xsl:with-param name="vertJc">top</xsl:with-param>
-                           </xsl:call-template>
-                           <e>
-                              <xsl:apply-templates mode="mml" select="mml:mrow"/>
-                           </e>
-                        </groupChr>
-                     </xsl:when>
-                     <xsl:otherwise>
-                <!-- Generic munder -->
-                <limLow>
-                           <e>
-                              <xsl:call-template name="CreateArgProp"/>
-                              <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                           </e>
-                           <lim>
-                              <xsl:call-template name="CreateArgProp"/>
-                              <xsl:apply-templates mode="mml" select="child::*[2]"/>
-                           </lim>
-                        </limLow>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: match munder -->
+	<xsl:template mode="mml" match="mml:munder">
+		<xsl:variable name="fNary">
+			<xsl:call-template name="isNary">
+				<xsl:with-param name="ndCur" select="child::*[1]" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$fNary='true'">
+				<nary>
+					<xsl:call-template name="CreateNaryProp">
+						<xsl:with-param name="chr">
+							<xsl:value-of select="normalize-space(child::*[1])" />
+						</xsl:with-param>
+						<xsl:with-param name="sMathmlType"
+							select="'munder'" />
+					</xsl:call-template>
+					<sub>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sub>
+					<sup>
+						<xsl:call-template name="CreateArgProp" />
+					</sup>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:call-template name="NaryHandleMrowMstyle">
+							<xsl:with-param name="ndCur"
+								select="following-sibling::*[1]" />
+						</xsl:call-template>
+					</e>
+				</nary>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- Should this munder be interpreted as an OMML m:bar? -->
+				<xsl:variable name="fIsBar">
+					<xsl:call-template name="FIsBar">
+						<xsl:with-param name="ndCur" select="." />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$fIsBar=1">
+						<bar>
+							<barPr>
+								<pos m:val="bot" />
+							</barPr>
+							<e>
+								<xsl:call-template name="CreateArgProp" />
+								<xsl:apply-templates mode="mml"
+									select="child::*[1]" />
+							</e>
+						</bar>
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- It isn't an integral or underbar, is this a groupChr? -->
+						<xsl:variable name="fGroupChr">
+							<xsl:call-template name="FIsGroupChr">
+								<xsl:with-param name="ndCur" select="." />
+							</xsl:call-template>
+						</xsl:variable>
+						<xsl:choose>
+							<xsl:when test="$fGroupChr=1">
+								<groupChr>
+									<xsl:call-template name="CreateGroupChrPr">
+										<xsl:with-param name="chr">
+											<xsl:value-of select="mml:mo" />
+										</xsl:with-param>
+										<xsl:with-param name="pos">
+											<xsl:choose>
+												<xsl:when test="child::*[1][self::mml:mrow]">
+													bot
+												</xsl:when>
+												<xsl:otherwise>
+													top
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:with-param>
+										<xsl:with-param name="vertJc">
+											top
+										</xsl:with-param>
+									</xsl:call-template>
+									<e>
+										<xsl:apply-templates mode="mml"
+											select="mml:mrow" />
+									</e>
+								</groupChr>
+							</xsl:when>
+							<xsl:otherwise>
+								<!-- Generic munder -->
+								<limLow>
+									<e>
+										<xsl:call-template name="CreateArgProp" />
+										<xsl:apply-templates mode="mml"
+											select="child::*[1]" />
+									</e>
+									<lim>
+										<xsl:call-template name="CreateArgProp" />
+										<xsl:apply-templates mode="mml"
+											select="child::*[2]" />
+									</lim>
+								</limLow>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- Given the values for chr, pos, and vertJc, create an omml
-	     groupChr's groupChrPr -->
-  <xsl:template name="CreateGroupChrPr">
-      <xsl:param name="chr">⏟</xsl:param>
-      <xsl:param name="pos" select="bot"/>
-      <xsl:param name="vertJc" select="top"/>
-      <groupChrPr>
-         <chr>
-            <xsl:attribute name="m:val">
-               <xsl:value-of select="$chr"/>
+	<!-- Given the values for chr, pos, and vertJc, create an omml groupChr's 
+		groupChrPr -->
+	<xsl:template name="CreateGroupChrPr">
+		<xsl:param name="chr">
+			⏟
+		</xsl:param>
+		<xsl:param name="pos" select="bot" />
+		<xsl:param name="vertJc" select="top" />
+		<groupChrPr>
+			<chr>
+				<xsl:attribute name="m:val">
+               <xsl:value-of select="$chr" />
             </xsl:attribute>
-         </chr>
-         <pos>
-            <xsl:attribute name="m:val">
-               <xsl:value-of select="$pos"/>
+			</chr>
+			<pos>
+				<xsl:attribute name="m:val">
+               <xsl:value-of select="$pos" />
             </xsl:attribute>
-         </pos>
-         <vertJc>
-            <xsl:attribute name="m:val">
-               <xsl:value-of select="$vertJc"/>
+			</pos>
+			<vertJc>
+				<xsl:attribute name="m:val">
+               <xsl:value-of select="$vertJc" />
             </xsl:attribute>
-         </vertJc>
-      </groupChrPr>
-  </xsl:template>
+			</vertJc>
+		</groupChrPr>
+	</xsl:template>
 
 
-  <!-- %%Template: match mover
-	-->
-  <xsl:template mode="mml" match="mml:mover">
-      <xsl:variable name="fNary">
-         <xsl:call-template name="isNary">
-            <xsl:with-param name="ndCur" select="child::*[1]"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$fNary='true'">
-            <nary>
-               <xsl:call-template name="CreateNaryProp">
-                  <xsl:with-param name="chr">
-                     <xsl:value-of select="normalize-space(child::*[1])"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="sMathmlType" select="'mover'"/>
-               </xsl:call-template>
-               <sub>
-                  <xsl:call-template name="CreateArgProp"/>
-               </sub>
-               <sup>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sup>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:call-template name="NaryHandleMrowMstyle">
-                     <xsl:with-param name="ndCur" select="following-sibling::*[1]"/>
-                  </xsl:call-template>
-               </e>
-            </nary>
-         </xsl:when>
-         <xsl:otherwise>
-        <!-- Should this munder be interpreted as an OMML m:bar or m:acc? -->
+	<!-- %%Template: match mover -->
+	<xsl:template mode="mml" match="mml:mover">
+		<xsl:variable name="fNary">
+			<xsl:call-template name="isNary">
+				<xsl:with-param name="ndCur" select="child::*[1]" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$fNary='true'">
+				<nary>
+					<xsl:call-template name="CreateNaryProp">
+						<xsl:with-param name="chr">
+							<xsl:value-of select="normalize-space(child::*[1])" />
+						</xsl:with-param>
+						<xsl:with-param name="sMathmlType" select="'mover'" />
+					</xsl:call-template>
+					<sub>
+						<xsl:call-template name="CreateArgProp" />
+					</sub>
+					<sup>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sup>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:call-template name="NaryHandleMrowMstyle">
+							<xsl:with-param name="ndCur"
+								select="following-sibling::*[1]" />
+						</xsl:call-template>
+					</e>
+				</nary>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- Should this munder be interpreted as an OMML m:bar or m:acc? -->
 
-        <!-- Check to see if this is an m:bar -->
-        <xsl:variable name="fIsBar">
-               <xsl:call-template name="FIsBar">
-                  <xsl:with-param name="ndCur" select="."/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="$fIsBar = 1">
-                  <bar>
-                     <barPr>
-                        <pos m:val="top"/>
-                     </barPr>
-                     <e>
-                        <xsl:call-template name="CreateArgProp"/>
-                        <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                     </e>
-                  </bar>
-               </xsl:when>
-               <xsl:otherwise>
-            <!-- Not an m:bar, should it be an m:acc? -->
-            <xsl:variable name="fIsAcc">
-                     <xsl:call-template name="FIsAcc">
-                        <xsl:with-param name="ndCur" select="."/>
-                     </xsl:call-template>
-                  </xsl:variable>
-                  <xsl:choose>
-                     <xsl:when test="$fIsAcc=1">
-                        <acc>
-                           <accPr>
-                              <chr>
-                                 <xsl:attribute name="m:val">
-                                    <xsl:value-of select="child::*[2]"/>
+				<!-- Check to see if this is an m:bar -->
+				<xsl:variable name="fIsBar">
+					<xsl:call-template name="FIsBar">
+						<xsl:with-param name="ndCur" select="." />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$fIsBar = 1">
+						<bar>
+							<barPr>
+								<pos m:val="top" />
+							</barPr>
+							<e>
+								<xsl:call-template name="CreateArgProp" />
+								<xsl:apply-templates mode="mml"
+									select="child::*[1]" />
+							</e>
+						</bar>
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- Not an m:bar, should it be an m:acc? -->
+						<xsl:variable name="fIsAcc">
+							<xsl:call-template name="FIsAcc">
+								<xsl:with-param name="ndCur" select="." />
+							</xsl:call-template>
+						</xsl:variable>
+						<xsl:choose>
+							<xsl:when test="$fIsAcc=1">
+								<acc>
+									<accPr>
+										<chr>
+											<xsl:attribute name="m:val">
+                                    <xsl:value-of
+												select="child::*[2]" />
                                  </xsl:attribute>
-                              </chr>
-                           </accPr>
-                           <e>
-                              <xsl:call-template name="CreateArgProp"/>
-                              <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                           </e>
-                        </acc>
-                     </xsl:when>
-                     <xsl:otherwise>
-                <!-- This isn't an integral, overbar or accent, 
-								     could it be a groupChr? -->
-                <xsl:variable name="fGroupChr">
-                           <xsl:call-template name="FIsGroupChr">
-                              <xsl:with-param name="ndCur" select="."/>
-                           </xsl:call-template>
-                        </xsl:variable>
-                        <xsl:choose>
-                           <xsl:when test="$fGroupChr=1">
-                              <groupChr>
-                                 <xsl:call-template name="CreateGroupChrPr">
-                                    <xsl:with-param name="chr">
-                                       <xsl:value-of select="mml:mo"/>
-                                    </xsl:with-param>
-                                    <xsl:with-param name="pos">
-                                       <xsl:choose>
-                                          <xsl:when test="child::*[1][self::mml:mrow]">top</xsl:when>
-                                          <xsl:otherwise>bot</xsl:otherwise>
-                                       </xsl:choose>
-                                    </xsl:with-param>
-                                    <xsl:with-param name="vertJc">bot</xsl:with-param>
-                                 </xsl:call-template>
-                                 <e>
-                                    <xsl:apply-templates mode="mml" select="mml:mrow"/>
-                                 </e>
-                              </groupChr>
-                           </xsl:when>
-                           <xsl:otherwise>
-                    <!-- Generic mover -->
-                    <limUpp>
-                                 <e>
-                                    <xsl:call-template name="CreateArgProp"/>
-                                    <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                                 </e>
-                                 <lim>
-                                    <xsl:call-template name="CreateArgProp"/>
-                                    <xsl:apply-templates mode="mml" select="child::*[2]"/>
-                                 </lim>
-                              </limUpp>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+										</chr>
+									</accPr>
+									<e>
+										<xsl:call-template name="CreateArgProp" />
+										<xsl:apply-templates mode="mml"
+											select="child::*[1]" />
+									</e>
+								</acc>
+							</xsl:when>
+							<xsl:otherwise>
+								<!-- This isn't an integral, overbar or accent, could it be a groupChr? -->
+								<xsl:variable name="fGroupChr">
+									<xsl:call-template name="FIsGroupChr">
+										<xsl:with-param name="ndCur" select="." />
+									</xsl:call-template>
+								</xsl:variable>
+								<xsl:choose>
+									<xsl:when test="$fGroupChr=1">
+										<groupChr>
+											<xsl:call-template name="CreateGroupChrPr">
+												<xsl:with-param name="chr">
+													<xsl:value-of select="mml:mo" />
+												</xsl:with-param>
+												<xsl:with-param name="pos">
+													<xsl:choose>
+														<xsl:when test="child::*[1][self::mml:mrow]">
+															top
+														</xsl:when>
+														<xsl:otherwise>
+															bot
+														</xsl:otherwise>
+													</xsl:choose>
+												</xsl:with-param>
+												<xsl:with-param name="vertJc">
+													bot
+												</xsl:with-param>
+											</xsl:call-template>
+											<e>
+												<xsl:apply-templates mode="mml"
+													select="mml:mrow" />
+											</e>
+										</groupChr>
+									</xsl:when>
+									<xsl:otherwise>
+										<!-- Generic mover -->
+										<limUpp>
+											<e>
+												<xsl:call-template name="CreateArgProp" />
+												<xsl:apply-templates mode="mml"
+													select="child::*[1]" />
+											</e>
+											<lim>
+												<xsl:call-template name="CreateArgProp" />
+												<xsl:apply-templates mode="mml"
+													select="child::*[2]" />
+											</lim>
+										</limUpp>
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- %%Template: match munderover
-	-->
-  <xsl:template mode="mml" match="mml:munderover">
-      <xsl:variable name="fNary">
-         <xsl:call-template name="isNary">
-            <xsl:with-param name="ndCur" select="child::*[1]"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$fNary='true'">
-            <nary>
-               <xsl:call-template name="CreateNaryProp">
-                  <xsl:with-param name="chr">
-                     <xsl:value-of select="normalize-space(child::*[1])"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="sMathmlType" select="'munderover'"/>
-               </xsl:call-template>
-               <sub>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sub>
-               <sup>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[3]"/>
-               </sup>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:call-template name="NaryHandleMrowMstyle">
-                     <xsl:with-param name="ndCur" select="following-sibling::*[1]"/>
-                  </xsl:call-template>
-               </e>
-            </nary>
-         </xsl:when>
-         <xsl:otherwise>
-            <limUpp>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <limLow>
-                     <e>
-                        <xsl:call-template name="CreateArgProp"/>
-                        <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                     </e>
-                     <lim>
-                        <xsl:call-template name="CreateArgProp"/>
-                        <xsl:apply-templates mode="mml" select="child::*[2]"/>
-                     </lim>
-                  </limLow>
-               </e>
-               <lim>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[3]"/>
-               </lim>
-            </limUpp>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: match munderover -->
+	<xsl:template mode="mml" match="mml:munderover">
+		<xsl:variable name="fNary">
+			<xsl:call-template name="isNary">
+				<xsl:with-param name="ndCur" select="child::*[1]" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$fNary='true'">
+				<nary>
+					<xsl:call-template name="CreateNaryProp">
+						<xsl:with-param name="chr">
+							<xsl:value-of select="normalize-space(child::*[1])" />
+						</xsl:with-param>
+						<xsl:with-param name="sMathmlType"
+							select="'munderover'" />
+					</xsl:call-template>
+					<sub>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sub>
+					<sup>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[3]" />
+					</sup>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:call-template name="NaryHandleMrowMstyle">
+							<xsl:with-param name="ndCur"
+								select="following-sibling::*[1]" />
+						</xsl:call-template>
+					</e>
+				</nary>
+			</xsl:when>
+			<xsl:otherwise>
+				<limUpp>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<limLow>
+							<e>
+								<xsl:call-template name="CreateArgProp" />
+								<xsl:apply-templates mode="mml"
+									select="child::*[1]" />
+							</e>
+							<lim>
+								<xsl:call-template name="CreateArgProp" />
+								<xsl:apply-templates mode="mml"
+									select="child::*[2]" />
+							</lim>
+						</limLow>
+					</e>
+					<lim>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[3]" />
+					</lim>
+				</limUpp>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- %%Template: match mfenced -->
-  <xsl:template mode="mml" match="mml:mfenced">
-      <d>
-         <xsl:call-template name="CreateDelimProp">
-            <xsl:with-param name="fChOpenValid">
-               <xsl:choose>
-                  <xsl:when test="@open">
-                     <xsl:value-of select="1"/>
-                  </xsl:when>
-                  <xsl:when test="@mml:open">
-                     <xsl:value-of select="1"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="0"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="chOpen">
-               <xsl:choose>
-                  <xsl:when test="@open">
-                     <xsl:value-of select="@open"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@mml:open"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fChSeparatorsValid">
-               <xsl:choose>
-                  <xsl:when test="@separators">
-                     <xsl:value-of select="1"/>
-                  </xsl:when>
-                  <xsl:when test="@mml:separators">
-                     <xsl:value-of select="1"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="0"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="chSeparators">
-               <xsl:choose>
-                  <xsl:when test="@separators">
-                     <xsl:value-of select="@separators"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@mml:separators"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fChCloseValid">
-               <xsl:choose>
-                  <xsl:when test="@close">
-                     <xsl:value-of select="1"/>
-                  </xsl:when>
-                  <xsl:when test="@mml:close">
-                     <xsl:value-of select="1"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="0"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="chClose">
-               <xsl:choose>
-                  <xsl:when test="@close">
-                     <xsl:value-of select="@close"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@mml:close"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-         </xsl:call-template>
-         <xsl:for-each select="*">
-            <e>
-               <xsl:call-template name="CreateArgProp"/>
-               <xsl:apply-templates mode="mml" select="."/>
-            </e>
-         </xsl:for-each>
-      </d>
-  </xsl:template>
+	<!-- %%Template: match mfenced -->
+	<xsl:template mode="mml" match="mml:mfenced">
+		<d>
+			<xsl:call-template name="CreateDelimProp">
+				<xsl:with-param name="fChOpenValid">
+					<xsl:choose>
+						<xsl:when test="@open">
+							<xsl:value-of select="1" />
+						</xsl:when>
+						<xsl:when test="@mml:open">
+							<xsl:value-of select="1" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="0" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="chOpen">
+					<xsl:choose>
+						<xsl:when test="@open">
+							<xsl:value-of select="@open" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@mml:open" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fChSeparatorsValid">
+					<xsl:choose>
+						<xsl:when test="@separators">
+							<xsl:value-of select="1" />
+						</xsl:when>
+						<xsl:when test="@mml:separators">
+							<xsl:value-of select="1" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="0" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="chSeparators">
+					<xsl:choose>
+						<xsl:when test="@separators">
+							<xsl:value-of select="@separators" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@mml:separators" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fChCloseValid">
+					<xsl:choose>
+						<xsl:when test="@close">
+							<xsl:value-of select="1" />
+						</xsl:when>
+						<xsl:when test="@mml:close">
+							<xsl:value-of select="1" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="0" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="chClose">
+					<xsl:choose>
+						<xsl:when test="@close">
+							<xsl:value-of select="@close" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@mml:close" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:for-each select="*">
+				<e>
+					<xsl:call-template name="CreateArgProp" />
+					<xsl:apply-templates mode="mml" select="." />
+				</e>
+			</xsl:for-each>
+		</d>
+	</xsl:template>
 
-  <!-- %%Template: CreateDelimProp
-	
-		Given the characters to use as open, close and separators for 
-		the delim object, create the m:dPr (delim properties). 		
-		
-		MathML can have any number of separators in an mfenced object, but 
-		OMML can only represent one separator for each d (delim) object.
-		So, we pick the first separator specified. 		
-	-->
-  <xsl:template name="CreateDelimProp">
-      <xsl:param name="fChOpenValid"/>
-      <xsl:param name="chOpen"/>
-      <xsl:param name="fChSeparatorsValid"/>
-      <xsl:param name="chSeparators"/>
-      <xsl:param name="fChCloseValid"/>
-      <xsl:param name="chClose"/>
-      <xsl:variable name="chSep" select="substring($chSeparators, 1, 1)"/>
+	<!-- %%Template: CreateDelimProp Given the characters to use as open, close 
+		and separators for the delim object, create the m:dPr (delim properties). 
+		MathML can have any number of separators in an mfenced object, but OMML can 
+		only represent one separator for each d (delim) object. So, we pick the first 
+		separator specified. -->
+	<xsl:template name="CreateDelimProp">
+		<xsl:param name="fChOpenValid" />
+		<xsl:param name="chOpen" />
+		<xsl:param name="fChSeparatorsValid" />
+		<xsl:param name="chSeparators" />
+		<xsl:param name="fChCloseValid" />
+		<xsl:param name="chClose" />
+		<xsl:variable name="chSep"
+			select="substring($chSeparators, 1, 1)" />
 
-      <!-- do we need a dPr at all? If everything's at its default value, then 
+		<!-- do we need a dPr at all? If everything's at its default value, then 
 			don't bother at all -->
-    <xsl:if test="($fChOpenValid=1 and not($chOpen = '(')) or         ($fChCloseValid=1 and not($chClose = ')')) or          not($chSep = '|')">
-         <dPr>
-        <!-- the default for MathML and OMML is '('. -->
-        <xsl:if test="$fChOpenValid=1 and not($chOpen = '(')">
-               <begChr>
-                  <xsl:attribute name="m:val">
-                     <xsl:value-of select="$chOpen"/>
+		<xsl:if
+			test="($fChOpenValid=1 and not($chOpen = '(')) or         ($fChCloseValid=1 and not($chClose = ')')) or          not($chSep = '|')">
+			<dPr>
+				<!-- the default for MathML and OMML is '('. -->
+				<xsl:if test="$fChOpenValid=1 and not($chOpen = '(')">
+					<begChr>
+						<xsl:attribute name="m:val">
+                     <xsl:value-of select="$chOpen" />
                   </xsl:attribute>
-               </begChr>
-            </xsl:if>
+					</begChr>
+				</xsl:if>
 
-            <!-- the default for MathML is ',' and for OMML is '|' -->
+				<!-- the default for MathML is ',' and for OMML is '|' -->
 
-        <xsl:choose>
-          <!-- matches OMML's default, don't bother to write anything out -->
-          <xsl:when test="$chSep = '|'"/>
+				<xsl:choose>
+					<!-- matches OMML's default, don't bother to write anything out -->
+					<xsl:when test="$chSep = '|'" />
 
-               <!-- Not specified, use MathML's default. We test against 
-					the existence of the actual attribute, not the substring -->
-          <xsl:when test="$fChSeparatorsValid=0">
-                  <sepChr m:val=","/>
-               </xsl:when>
+					<!-- Not specified, use MathML's default. We test against the existence 
+						of the actual attribute, not the substring -->
+					<xsl:when test="$fChSeparatorsValid=0">
+						<sepChr m:val="," />
+					</xsl:when>
 
-               <xsl:otherwise>
-                  <sepChr>
-                     <xsl:attribute name="m:val">
-                        <xsl:value-of select="$chSep"/>
+					<xsl:otherwise>
+						<sepChr>
+							<xsl:attribute name="m:val">
+                        <xsl:value-of select="$chSep" />
                      </xsl:attribute>
-                  </sepChr>
-               </xsl:otherwise>
-            </xsl:choose>
+						</sepChr>
+					</xsl:otherwise>
+				</xsl:choose>
 
-            <!-- the default for MathML and OMML is ')'. -->
-        <xsl:if test="$fChCloseValid=1 and not($chClose = ')')">
-               <endChr>
-                  <xsl:attribute name="m:val">
-                     <xsl:value-of select="$chClose"/>
+				<!-- the default for MathML and OMML is ')'. -->
+				<xsl:if test="$fChCloseValid=1 and not($chClose = ')')">
+					<endChr>
+						<xsl:attribute name="m:val">
+                     <xsl:value-of select="$chClose" />
                   </xsl:attribute>
-               </endChr>
-            </xsl:if>
-         </dPr>
-      </xsl:if>
-  </xsl:template>
+					</endChr>
+				</xsl:if>
+			</dPr>
+		</xsl:if>
+	</xsl:template>
 
-  <!-- %%Template: OutputMs
-	-->
-  <xsl:template name="OutputMs">
-      <xsl:param name="msCur"/>
-      <xsl:choose>
-         <xsl:when test="(not($msCur/@lquote) or $msCur/@lquote='')                       and (not($msCur/@mml:lquote) or $msCur/@mml:lquote='')">
-            <xsl:text>"</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="$msCur/@lquote">
-                  <xsl:value-of select="$msCur/@lquote"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="$msCur/@mml:lquote"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:value-of select="normalize-space($msCur)"/>
-      <xsl:choose>
-         <xsl:when test="(not($msCur/@rquote) or $msCur/@rquote='')                        and (not($msCur/@mml:rquote) or $msCur/@mml:rquote='')">
-            <xsl:text>"</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="$msCur/@rquote">
-                  <xsl:value-of select="$msCur/@rquote"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="$msCur/@mml:rquote"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: OutputMs -->
+	<xsl:template name="OutputMs">
+		<xsl:param name="msCur" />
+		<xsl:choose>
+			<xsl:when
+				test="(not($msCur/@lquote) or $msCur/@lquote='')                       and (not($msCur/@mml:lquote) or $msCur/@mml:lquote='')">
+				<xsl:text>"</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$msCur/@lquote">
+						<xsl:value-of select="$msCur/@lquote" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$msCur/@mml:lquote" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:value-of select="normalize-space($msCur)" />
+		<xsl:choose>
+			<xsl:when
+				test="(not($msCur/@rquote) or $msCur/@rquote='')                        and (not($msCur/@mml:rquote) or $msCur/@mml:rquote='')">
+				<xsl:text>"</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$msCur/@rquote">
+						<xsl:value-of select="$msCur/@rquote" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$msCur/@mml:rquote" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- %%Template: match msub
-	-->
-  <xsl:template mode="mml" match="mml:msub">
-      <xsl:variable name="fNary">
-         <xsl:call-template name="isNary">
-            <xsl:with-param name="ndCur" select="child::*[1]"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$fNary='true'">
-            <nary>
-               <xsl:call-template name="CreateNaryProp">
-                  <xsl:with-param name="chr">
-                     <xsl:value-of select="normalize-space(child::*[1])"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="sMathmlType" select="'msub'"/>
-               </xsl:call-template>
-               <sub>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sub>
-               <sup>
-                  <xsl:call-template name="CreateArgProp"/>
-               </sup>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:call-template name="NaryHandleMrowMstyle">
-                     <xsl:with-param name="ndCur" select="following-sibling::*[1]"/>
-                  </xsl:call-template>
-               </e>
-            </nary>
-         </xsl:when>
-         <xsl:otherwise>
-            <sSub>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[1]"/>
-               </e>
-               <sub>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sub>
-            </sSub>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: match msub -->
+	<xsl:template mode="mml" match="mml:msub">
+		<xsl:variable name="fNary">
+			<xsl:call-template name="isNary">
+				<xsl:with-param name="ndCur" select="child::*[1]" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$fNary='true'">
+				<nary>
+					<xsl:call-template name="CreateNaryProp">
+						<xsl:with-param name="chr">
+							<xsl:value-of select="normalize-space(child::*[1])" />
+						</xsl:with-param>
+						<xsl:with-param name="sMathmlType" select="'msub'" />
+					</xsl:call-template>
+					<sub>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sub>
+					<sup>
+						<xsl:call-template name="CreateArgProp" />
+					</sup>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:call-template name="NaryHandleMrowMstyle">
+							<xsl:with-param name="ndCur"
+								select="following-sibling::*[1]" />
+						</xsl:call-template>
+					</e>
+				</nary>
+			</xsl:when>
+			<xsl:otherwise>
+				<sSub>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[1]" />
+					</e>
+					<sub>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sub>
+				</sSub>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- %%Template: match msup
-	-->
-  <xsl:template mode="mml" match="mml:msup">
-      <xsl:variable name="fNary">
-         <xsl:call-template name="isNary">
-            <xsl:with-param name="ndCur" select="child::*[1]"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$fNary='true'">
-            <nary>
-               <xsl:call-template name="CreateNaryProp">
-                  <xsl:with-param name="chr">
-                     <xsl:value-of select="normalize-space(child::*[1])"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="sMathmlType" select="'msup'"/>
-               </xsl:call-template>
-               <sub>
-                  <xsl:call-template name="CreateArgProp"/>
-               </sub>
-               <sup>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sup>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:call-template name="NaryHandleMrowMstyle">
-                     <xsl:with-param name="ndCur" select="following-sibling::*[1]"/>
-                  </xsl:call-template>
-               </e>
-            </nary>
-         </xsl:when>
-         <xsl:otherwise>
-            <sSup>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[1]"/>
-               </e>
-               <sup>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sup>
-            </sSup>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: match msup -->
+	<xsl:template mode="mml" match="mml:msup">
+		<xsl:variable name="fNary">
+			<xsl:call-template name="isNary">
+				<xsl:with-param name="ndCur" select="child::*[1]" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$fNary='true'">
+				<nary>
+					<xsl:call-template name="CreateNaryProp">
+						<xsl:with-param name="chr">
+							<xsl:value-of select="normalize-space(child::*[1])" />
+						</xsl:with-param>
+						<xsl:with-param name="sMathmlType" select="'msup'" />
+					</xsl:call-template>
+					<sub>
+						<xsl:call-template name="CreateArgProp" />
+					</sub>
+					<sup>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sup>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:call-template name="NaryHandleMrowMstyle">
+							<xsl:with-param name="ndCur"
+								select="following-sibling::*[1]" />
+						</xsl:call-template>
+					</e>
+				</nary>
+			</xsl:when>
+			<xsl:otherwise>
+				<sSup>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[1]" />
+					</e>
+					<sup>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sup>
+				</sSup>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- %%Template: match msubsup
-	-->
-  <xsl:template mode="mml" match="mml:msubsup">
-      <xsl:variable name="fNary">
-         <xsl:call-template name="isNary">
-            <xsl:with-param name="ndCur" select="child::*[1]"/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$fNary='true'">
-            <nary>
-               <xsl:call-template name="CreateNaryProp">
-                  <xsl:with-param name="chr">
-                     <xsl:value-of select="normalize-space(child::*[1])"/>
-                  </xsl:with-param>
-                  <xsl:with-param name="sMathmlType" select="'msubsup'"/>
-               </xsl:call-template>
-               <sub>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sub>
-               <sup>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[3]"/>
-               </sup>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:call-template name="NaryHandleMrowMstyle">
-                     <xsl:with-param name="ndCur" select="following-sibling::*[1]"/>
-                  </xsl:call-template>
-               </e>
-            </nary>
-         </xsl:when>
-         <xsl:otherwise>
-            <sSubSup>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[1]"/>
-               </e>
-               <sub>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[2]"/>
-               </sub>
-               <sup>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[3]"/>
-               </sup>
-            </sSubSup>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- %%Template: match msubsup -->
+	<xsl:template mode="mml" match="mml:msubsup">
+		<xsl:variable name="fNary">
+			<xsl:call-template name="isNary">
+				<xsl:with-param name="ndCur" select="child::*[1]" />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$fNary='true'">
+				<nary>
+					<xsl:call-template name="CreateNaryProp">
+						<xsl:with-param name="chr">
+							<xsl:value-of select="normalize-space(child::*[1])" />
+						</xsl:with-param>
+						<xsl:with-param name="sMathmlType"
+							select="'msubsup'" />
+					</xsl:call-template>
+					<sub>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sub>
+					<sup>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[3]" />
+					</sup>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:call-template name="NaryHandleMrowMstyle">
+							<xsl:with-param name="ndCur"
+								select="following-sibling::*[1]" />
+						</xsl:call-template>
+					</e>
+				</nary>
+			</xsl:when>
+			<xsl:otherwise>
+				<sSubSup>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[1]" />
+					</e>
+					<sub>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[2]" />
+					</sub>
+					<sup>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[3]" />
+					</sup>
+				</sSubSup>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- %%Template: SplitScripts 
-	
-		Takes an collection of nodes, and splits them
-		odd and even into sup and sub scripts. Used for dealing with
-		mmultiscript.
-		
-		This template assumes you want to output both a sub and sup element.
-		-->
-  <xsl:template name="SplitScripts">
-      <xsl:param name="ndScripts"/>
-      <sub>
-         <xsl:call-template name="CreateArgProp"/>
-         <xsl:apply-templates mode="mml" select="$ndScripts[(position() mod 2) = 1]"/>
-      </sub>
-      <sup>
-         <xsl:call-template name="CreateArgProp"/>
-         <xsl:apply-templates mode="mml" select="$ndScripts[(position() mod 2) = 0]"/>
-      </sup>
-  </xsl:template>
+	<!-- %%Template: SplitScripts Takes an collection of nodes, and splits them 
+		odd and even into sup and sub scripts. Used for dealing with mmultiscript. 
+		This template assumes you want to output both a sub and sup element. -->
+	<xsl:template name="SplitScripts">
+		<xsl:param name="ndScripts" />
+		<sub>
+			<xsl:call-template name="CreateArgProp" />
+			<xsl:apply-templates mode="mml"
+				select="$ndScripts[(position() mod 2) = 1]" />
+		</sub>
+		<sup>
+			<xsl:call-template name="CreateArgProp" />
+			<xsl:apply-templates mode="mml"
+				select="$ndScripts[(position() mod 2) = 0]" />
+		</sup>
+	</xsl:template>
 
-  <!-- %%Template: match mmultiscripts
-	
-		There is some subtlety with the mml:mprescripts element. Everything that comes before 
-		that is considered a script (as opposed to a pre-script), but it need not be present.
-	-->
-  <xsl:template mode="mml" match="mml:mmultiscripts">
+	<!-- %%Template: match mmultiscripts There is some subtlety with the mml:mprescripts 
+		element. Everything that comes before that is considered a script (as opposed 
+		to a pre-script), but it need not be present. -->
+	<xsl:template mode="mml" match="mml:mmultiscripts">
 
-    <!-- count the nodes. Everything that comes after a mml:mprescripts is considered a pre-script;
-			Everything that does not have an mml:mprescript as a preceding-sibling (and is not itself 
-			mml:mprescript) is a script, except for the first child which is always the base.
-			The mml:none element is a place holder for a sub/sup element slot.
-			
-			mmultisript pattern:
-			<mmultiscript>
-				(base)
-				(sub sup)* // Where <none/> can replace a sub/sup entry to preserve pattern.
-				<mprescripts />
-				(presub presup)*
-			</mmultiscript>
-			-->
-    <!-- Count of presecript nodes that we'd print (this is essentially anything but the none placeholder. -->
-    <xsl:variable name="cndPrescriptStrict"
-                    select="count(mml:mprescripts[1]/following-sibling::*[not(self::mml:none)])"/>
-      <!-- Count of all super script excluding mml:none -->
-    <xsl:variable name="cndSuperScript"
-                    select="count(*[not(preceding-sibling::mml:mprescripts)                               and not(self::mml:mprescripts)                               and ((position() mod 2) = 1)                                and not(self::mml:none)]) - 1"/>
-      <!-- Count of all sup script excluding mml:none -->
-    <xsl:variable name="cndSubScript"
-                    select="count(*[not(preceding-sibling::mml:mprescripts)                               and not(self::mml:mprescripts)                               and ((position() mod 2) = 0)                                and not(self::mml:none)])"/>
-      <!-- Count of all scripts excluding mml:none -->
-    <xsl:variable name="cndScriptStrict" select="$cndSuperScript + $cndSubScript"/>
-      <!-- Count of all scripts including mml:none.  This is essentially all nodes before the 
-		first mml:mprescripts except the base. -->
-    <xsl:variable name="cndScript"
-                    select="count(*[not(preceding-sibling::mml:mprescripts) and not(self::mml:mprescripts)]) - 1"/>
+		<!-- count the nodes. Everything that comes after a mml:mprescripts is 
+			considered a pre-script; Everything that does not have an mml:mprescript 
+			as a preceding-sibling (and is not itself mml:mprescript) is a script, except 
+			for the first child which is always the base. The mml:none element is a place 
+			holder for a sub/sup element slot. mmultisript pattern: <mmultiscript> (base) 
+			(sub sup)* // Where <none/> can replace a sub/sup entry to preserve pattern. 
+			<mprescripts /> (presub presup)* </mmultiscript> -->
+		<!-- Count of presecript nodes that we'd print (this is essentially anything 
+			but the none placeholder. -->
+		<xsl:variable name="cndPrescriptStrict"
+			select="count(mml:mprescripts[1]/following-sibling::*[not(self::mml:none)])" />
+		<!-- Count of all super script excluding mml:none -->
+		<xsl:variable name="cndSuperScript"
+			select="count(*[not(preceding-sibling::mml:mprescripts)                               and not(self::mml:mprescripts)                               and ((position() mod 2) = 1)                                and not(self::mml:none)]) - 1" />
+		<!-- Count of all sup script excluding mml:none -->
+		<xsl:variable name="cndSubScript"
+			select="count(*[not(preceding-sibling::mml:mprescripts)                               and not(self::mml:mprescripts)                               and ((position() mod 2) = 0)                                and not(self::mml:none)])" />
+		<!-- Count of all scripts excluding mml:none -->
+		<xsl:variable name="cndScriptStrict"
+			select="$cndSuperScript + $cndSubScript" />
+		<!-- Count of all scripts including mml:none. This is essentially all nodes 
+			before the first mml:mprescripts except the base. -->
+		<xsl:variable name="cndScript"
+			select="count(*[not(preceding-sibling::mml:mprescripts) and not(self::mml:mprescripts)]) - 1" />
 
-      <xsl:choose>
-      <!-- The easy case first. No prescripts, and no script ... just a base -->
-      <xsl:when test="$cndPrescriptStrict &lt;= 0 and $cndScriptStrict &lt;= 0">
-            <xsl:apply-templates mode="mml" select="*[1]"/>
-         </xsl:when>
+		<xsl:choose>
+			<!-- The easy case first. No prescripts, and no script ... just a base -->
+			<xsl:when
+				test="$cndPrescriptStrict &lt;= 0 and $cndScriptStrict &lt;= 0">
+				<xsl:apply-templates mode="mml" select="*[1]" />
+			</xsl:when>
 
-         <!-- Next, if there are no prescripts -->
-      <xsl:when test="$cndPrescriptStrict &lt;= 0">
-        <!-- we know we have some scripts or else we would have taken the earlier
-					  branch. -->
-        <xsl:choose>
-          <!-- We have both sub and super scripts-->
-          <xsl:when test="$cndSuperScript &gt; 0 and $cndSubScript &gt; 0">
-                  <sSubSup>
-                     <e>
-                        <xsl:call-template name="CreateArgProp"/>
-                        <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                     </e>
+			<!-- Next, if there are no prescripts -->
+			<xsl:when test="$cndPrescriptStrict &lt;= 0">
+				<!-- we know we have some scripts or else we would have taken the earlier 
+					branch. -->
+				<xsl:choose>
+					<!-- We have both sub and super scripts -->
+					<xsl:when
+						test="$cndSuperScript &gt; 0 and $cndSubScript &gt; 0">
+						<sSubSup>
+							<e>
+								<xsl:call-template name="CreateArgProp" />
+								<xsl:apply-templates mode="mml"
+									select="child::*[1]" />
+							</e>
 
-                     <!-- Every child except the first is a script.  Do the split -->
-              <xsl:call-template name="SplitScripts">
-                        <xsl:with-param name="ndScripts" select="*[position() &gt; 1]"/>
-                     </xsl:call-template>
-                  </sSubSup>
-               </xsl:when>
-               <!-- Just a sub script -->
-          <xsl:when test="$cndSubScript &gt; 0">
-                  <sSub>
-                     <e>
-                        <xsl:call-template name="CreateArgProp"/>
-                        <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                     </e>
+							<!-- Every child except the first is a script. Do the split -->
+							<xsl:call-template name="SplitScripts">
+								<xsl:with-param name="ndScripts"
+									select="*[position() &gt; 1]" />
+							</xsl:call-template>
+						</sSubSup>
+					</xsl:when>
+					<!-- Just a sub script -->
+					<xsl:when test="$cndSubScript &gt; 0">
+						<sSub>
+							<e>
+								<xsl:call-template name="CreateArgProp" />
+								<xsl:apply-templates mode="mml"
+									select="child::*[1]" />
+							</e>
 
-                     <!-- No prescripts and no super scripts, therefore, it's a sub. -->
-              <sub>
-                        <xsl:apply-templates mode="mml" select="*[position() &gt; 1]"/>
-                     </sub>
-                  </sSub>
-               </xsl:when>
-               <!-- Just super script -->
-          <xsl:otherwise>
-                  <sSup>
-                     <e>
-                        <xsl:call-template name="CreateArgProp"/>
-                        <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                     </e>
+							<!-- No prescripts and no super scripts, therefore, it's a sub. -->
+							<sub>
+								<xsl:apply-templates mode="mml"
+									select="*[position() &gt; 1]" />
+							</sub>
+						</sSub>
+					</xsl:when>
+					<!-- Just super script -->
+					<xsl:otherwise>
+						<sSup>
+							<e>
+								<xsl:call-template name="CreateArgProp" />
+								<xsl:apply-templates mode="mml"
+									select="child::*[1]" />
+							</e>
 
-                     <!-- No prescripts and no sub scripts, therefore, it's a sup. -->
-              <sup>
-                        <xsl:apply-templates mode="mml" select="*[position() &gt; 1]"/>
-                     </sup>
-                  </sSup>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
+							<!-- No prescripts and no sub scripts, therefore, it's a sup. -->
+							<sup>
+								<xsl:apply-templates mode="mml"
+									select="*[position() &gt; 1]" />
+							</sup>
+						</sSup>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
 
-         <!-- Next, if there are no scripts -->
-      <xsl:when test="$cndScriptStrict &lt;= 0">
-        <!-- we know we have some prescripts or else we would have taken the earlier
-					  branch. So, create an sPre and split the elements -->
-        <sPre>
-               <e>
-                  <xsl:call-template name="CreateArgProp"/>
-                  <xsl:apply-templates mode="mml" select="child::*[1]"/>
-               </e>
+			<!-- Next, if there are no scripts -->
+			<xsl:when test="$cndScriptStrict &lt;= 0">
+				<!-- we know we have some prescripts or else we would have taken the 
+					earlier branch. So, create an sPre and split the elements -->
+				<sPre>
+					<e>
+						<xsl:call-template name="CreateArgProp" />
+						<xsl:apply-templates mode="mml"
+							select="child::*[1]" />
+					</e>
 
-               <!-- The prescripts come after the mml:mprescript and if we get here
-							we know there exists some elements after the mml:mprescript element. 
-							
-							The prescript element has no sub/subsup variation, therefore, even if
-							we're only writing sub, we need to write out both the sub and sup element.
-							-->
-          <xsl:call-template name="SplitScripts">
-                  <xsl:with-param name="ndScripts" select="mml:mprescripts[1]/following-sibling::*"/>
-               </xsl:call-template>
-            </sPre>
-         </xsl:when>
+					<!-- The prescripts come after the mml:mprescript and if we get here 
+						we know there exists some elements after the mml:mprescript element. The 
+						prescript element has no sub/subsup variation, therefore, even if we're only 
+						writing sub, we need to write out both the sub and sup element. -->
+					<xsl:call-template name="SplitScripts">
+						<xsl:with-param name="ndScripts"
+							select="mml:mprescripts[1]/following-sibling::*" />
+					</xsl:call-template>
+				</sPre>
+			</xsl:when>
 
-         <!-- Finally, the case with both prescripts and scripts. Create an sPre 
+			<!-- Finally, the case with both prescripts and scripts. Create an sPre 
 				element to house the prescripts, with a sub/sup/subsup element at its base. -->
-      <xsl:otherwise>
-            <sPre>
-               <e>
-                  <xsl:choose>
-              <!-- We have both sub and super scripts-->
-              <xsl:when test="$cndSuperScript &gt; 0 and $cndSubScript &gt; 0">
-                        <sSubSup>
-                           <e>
-                              <xsl:call-template name="CreateArgProp"/>
-                              <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                           </e>
+			<xsl:otherwise>
+				<sPre>
+					<e>
+						<xsl:choose>
+							<!-- We have both sub and super scripts -->
+							<xsl:when
+								test="$cndSuperScript &gt; 0 and $cndSubScript &gt; 0">
+								<sSubSup>
+									<e>
+										<xsl:call-template name="CreateArgProp" />
+										<xsl:apply-templates mode="mml"
+											select="child::*[1]" />
+									</e>
 
-                           <!-- scripts come before the mml:mprescript but after the first child, so their
-								 positions will be 2, 3, ... ($nndScript + 1) -->
-                  <xsl:call-template name="SplitScripts">
-                              <xsl:with-param name="ndScripts"
-                                              select="*[(position() &gt; 1) and (position() &lt;= ($cndScript + 1))]"/>
-                           </xsl:call-template>
-                        </sSubSup>
-                     </xsl:when>
-                     <!-- Just a sub script -->
-              <xsl:when test="$cndSubScript &gt; 0">
-                        <sSub>
-                           <e>
-                              <xsl:call-template name="CreateArgProp"/>
-                              <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                           </e>
+									<!-- scripts come before the mml:mprescript but after the first 
+										child, so their positions will be 2, 3, ... ($nndScript + 1) -->
+									<xsl:call-template name="SplitScripts">
+										<xsl:with-param name="ndScripts"
+											select="*[(position() &gt; 1) and (position() &lt;= ($cndScript + 1))]" />
+									</xsl:call-template>
+								</sSubSup>
+							</xsl:when>
+							<!-- Just a sub script -->
+							<xsl:when test="$cndSubScript &gt; 0">
+								<sSub>
+									<e>
+										<xsl:call-template name="CreateArgProp" />
+										<xsl:apply-templates mode="mml"
+											select="child::*[1]" />
+									</e>
 
-                           <!-- We have prescripts but no super scripts, therefore, do a sub 
-									and apply templates to all tokens counted by cndScript. -->
-                  <sub>
-                              <xsl:apply-templates mode="mml" select="*[position() &gt; 1 and (position() &lt;= ($cndScript + 1))]"/>
-                           </sub>
-                        </sSub>
-                     </xsl:when>
-                     <!-- Just super script -->
-              <xsl:otherwise>
-                        <sSup>
-                           <e>
-                              <xsl:call-template name="CreateArgProp"/>
-                              <xsl:apply-templates mode="mml" select="child::*[1]"/>
-                           </e>
+									<!-- We have prescripts but no super scripts, therefore, do a sub 
+										and apply templates to all tokens counted by cndScript. -->
+									<sub>
+										<xsl:apply-templates mode="mml"
+											select="*[position() &gt; 1 and (position() &lt;= ($cndScript + 1))]" />
+									</sub>
+								</sSub>
+							</xsl:when>
+							<!-- Just super script -->
+							<xsl:otherwise>
+								<sSup>
+									<e>
+										<xsl:call-template name="CreateArgProp" />
+										<xsl:apply-templates mode="mml"
+											select="child::*[1]" />
+									</e>
 
-                           <!-- We have prescripts but no sub scripts, therefore, do a sub 
-									and apply templates to all tokens counted by cndScript. -->
-                  <sup>
-                              <xsl:apply-templates mode="mml" select="*[position() &gt; 1 and (position() &lt;= ($cndScript + 1))]"/>
-                           </sup>
-                        </sSup>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </e>
+									<!-- We have prescripts but no sub scripts, therefore, do a sub 
+										and apply templates to all tokens counted by cndScript. -->
+									<sup>
+										<xsl:apply-templates mode="mml"
+											select="*[position() &gt; 1 and (position() &lt;= ($cndScript + 1))]" />
+									</sup>
+								</sSup>
+							</xsl:otherwise>
+						</xsl:choose>
+					</e>
 
-               <!-- The prescripts come after the mml:mprescript and if we get here
-							we know there exists one such element -->
-          <xsl:call-template name="SplitScripts">
-                  <xsl:with-param name="ndScripts" select="mml:mprescripts[1]/following-sibling::*"/>
-               </xsl:call-template>
-            </sPre>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+					<!-- The prescripts come after the mml:mprescript and if we get here 
+						we know there exists one such element -->
+					<xsl:call-template name="SplitScripts">
+						<xsl:with-param name="ndScripts"
+							select="mml:mprescripts[1]/following-sibling::*" />
+					</xsl:call-template>
+				</sPre>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- Template that determines if ndCur is an equation array.
-				
-			 ndCur is an equation array if:
-			 
-			 0.  The table has a columnalign other than the default (center) 
-			 1.  There are are no frame lines
-			 2.  There are no column lines
-			 3.  There are no row lines
-			 4.  There is no row with more than 1 column  
-			 5.  There is no row with fewer than 1 column
-			 6.  There are no labeled rows.			 
-			 
-	-->
-  <xsl:template name="FIsEqArray">
-      <xsl:param name="ndCur" select="."/>
+	<!-- Template that determines if ndCur is an equation array. ndCur is an 
+		equation array if: 0. The table has a columnalign other than the default 
+		(center) 1. There are are no frame lines 2. There are no column lines 3. 
+		There are no row lines 4. There is no row with more than 1 column 5. There 
+		is no row with fewer than 1 column 6. There are no labeled rows. -->
+	<xsl:template name="FIsEqArray">
+		<xsl:param name="ndCur" select="." />
 
-      <!-- There should be no frame, columnlines, or rowlines -->
-    <xsl:choose>
-         <xsl:when test="@columnalign!='center'">0</xsl:when>
-         <xsl:when test="(not($ndCur/@frame) or $ndCur/@frame='' or $ndCur/@frame='none')                       
+		<!-- There should be no frame, columnlines, or rowlines -->
+		<xsl:choose>
+			<xsl:when test="@columnalign!='center'">
+				0
+			</xsl:when>
+			<xsl:when
+				test="(not($ndCur/@frame) or $ndCur/@frame='' or $ndCur/@frame='none')                       
 			 and (not($ndCur/@mml:frame) or $ndCur/@mml:frame='' or $ndCur/@mml:frame='none')
 			 and (not($ndCur/@columnlines) or $ndCur/@columnlines='' or $ndCur/@columnlines='none')                       
 			 and (not($ndCur/@mml:columnlines) or $ndCur/@mml:columnlines='' or $ndCur/@mml:columnlines='none')               
@@ -2563,1138 +2757,1232 @@
 			 and (not($ndCur/@mml:rowlines) or $ndCur/@mml:rowlines='' or $ndCur/@mml:rowlines='none')               
 			 and not($ndCur/mml:mtr[count(mml:mtd) &gt; 1])            
 			 and not($ndCur/mml:mtr[count(mml:mtd) &lt; 1])
-			 and not($ndCur/mml:mlabeledtr)">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+			 and not($ndCur/mml:mlabeledtr)">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- Template used to determine if we should ignore a collection when iterating through 
-	     a mathml equation array row.
-	
-			 So far, the only thing that needs to be ignored is the argument of an nary.  We
-			 can ignore this since it is output when we apply-templates to the munder[over]/msub[sup].
-	-->
-  <xsl:template name="FIgnoreCollection">
-      <xsl:param name="ndCur" select="."/>
+	<!-- Template used to determine if we should ignore a collection when iterating 
+		through a mathml equation array row. So far, the only thing that needs to 
+		be ignored is the argument of an nary. We can ignore this since it is output 
+		when we apply-templates to the munder[over]/msub[sup]. -->
+	<xsl:template name="FIgnoreCollection">
+		<xsl:param name="ndCur" select="." />
 
-      <xsl:variable name="fNaryArgument">
-         <xsl:call-template name="FIsNaryArgument">
-            <xsl:with-param name="ndCur" select="$ndCur"/>
-         </xsl:call-template>
-      </xsl:variable>
+		<xsl:variable name="fNaryArgument">
+			<xsl:call-template name="FIsNaryArgument">
+				<xsl:with-param name="ndCur" select="$ndCur" />
+			</xsl:call-template>
+		</xsl:variable>
 
-      <xsl:choose>
-         <xsl:when test="$fNaryArgument=1">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<xsl:when test="$fNaryArgument=1">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- Template used to determine if we've already encountered an maligngroup or malignmark.
-	
-			 This is needed because omml has an implicit spacing alignment (omml spacing alignment = 
-			 mathml's maligngroup element) at the beginning of each equation array row.  Therefore, 
-			 the first maligngroup (implied or explicit) we encounter does not need to be output.  
-			 This template recursively searches up the xml tree and looks at previous siblings to see 
-			 if they have a descendant that is an maligngroup or malignmark.  We look for the malignmark 
-			 to find the implicit maligngroup.
-	-->
-  <xsl:template name="FFirstAlignAlreadyFound">
-      <xsl:param name="ndCur" select="."/>
+	<!-- Template used to determine if we've already encountered an maligngroup 
+		or malignmark. This is needed because omml has an implicit spacing alignment 
+		(omml spacing alignment = mathml's maligngroup element) at the beginning 
+		of each equation array row. Therefore, the first maligngroup (implied or 
+		explicit) we encounter does not need to be output. This template recursively 
+		searches up the xml tree and looks at previous siblings to see if they have 
+		a descendant that is an maligngroup or malignmark. We look for the malignmark 
+		to find the implicit maligngroup. -->
+	<xsl:template name="FFirstAlignAlreadyFound">
+		<xsl:param name="ndCur" select="." />
 
-      <xsl:choose>
-         <xsl:when test="count($ndCur/preceding-sibling::*[descendant-or-self::mml:maligngroup                                                 or descendant-or-self::mml:malignmark]) &gt; 0">1</xsl:when>
-         <xsl:when test="not($ndCur/parent::mml:mtd)">
-            <xsl:call-template name="FFirstAlignAlreadyFound">
-               <xsl:with-param name="ndCur" select="$ndCur/parent::*"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<xsl:when
+				test="count($ndCur/preceding-sibling::*[descendant-or-self::mml:maligngroup                                                 or descendant-or-self::mml:malignmark]) &gt; 0">
+				1
+			</xsl:when>
+			<xsl:when test="not($ndCur/parent::mml:mtd)">
+				<xsl:call-template name="FFirstAlignAlreadyFound">
+					<xsl:with-param name="ndCur"
+						select="$ndCur/parent::*" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- This template builds a string that is result of concatenating a given string several times. 
-	
-			 Given strToRepeat, create a string that has strToRepeat repeated iRepitions times. 
-	-->
-  <xsl:template name="ConcatStringRepeat">
-      <xsl:param name="strToRepeat" select="''"/>
-      <xsl:param name="iRepetitions" select="0"/>
-      <xsl:param name="strBuilding" select="''"/>
+	<!-- This template builds a string that is result of concatenating a given 
+		string several times. Given strToRepeat, create a string that has strToRepeat 
+		repeated iRepitions times. -->
+	<xsl:template name="ConcatStringRepeat">
+		<xsl:param name="strToRepeat" select="''" />
+		<xsl:param name="iRepetitions" select="0" />
+		<xsl:param name="strBuilding" select="''" />
 
-      <xsl:choose>
-         <xsl:when test="$iRepetitions &lt;= 0">
-            <xsl:value-of select="$strBuilding"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="ConcatStringRepeat">
-               <xsl:with-param name="strToRepeat" select="$strToRepeat"/>
-               <xsl:with-param name="iRepetitions" select="$iRepetitions - 1"/>
-               <xsl:with-param name="strBuilding" select="concat($strBuilding, $strToRepeat)"/>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<xsl:when test="$iRepetitions &lt;= 0">
+				<xsl:value-of select="$strBuilding" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="ConcatStringRepeat">
+					<xsl:with-param name="strToRepeat"
+						select="$strToRepeat" />
+					<xsl:with-param name="iRepetitions"
+						select="$iRepetitions - 1" />
+					<xsl:with-param name="strBuilding"
+						select="concat($strBuilding, $strToRepeat)" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- This template determines if ndCur is a special collection.
-			 By special collection, I mean is ndCur the outer element of some special grouping 
-			 of mathml elements that actually represents some over all omml structure.
-			 
-			 For instance, is ndCur a linear fraction, or an omml function.
-	-->
-  <xsl:template name="FSpecialCollection">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:choose>
-         <xsl:when test="$ndCur/self::mml:mrow">
-            <xsl:variable name="fLinearFraction">
-               <xsl:call-template name="FLinearFrac">
-                  <xsl:with-param name="ndCur" select="$ndCur"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:variable name="fFunc">
-               <xsl:call-template name="FIsFunc">
-                  <xsl:with-param name="ndCur" select="$ndCur"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="$fLinearFraction=1 or $fFunc=1">1</xsl:when>
-               <xsl:otherwise>0</xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<!-- This template determines if ndCur is a special collection. By special 
+		collection, I mean is ndCur the outer element of some special grouping of 
+		mathml elements that actually represents some over all omml structure. For 
+		instance, is ndCur a linear fraction, or an omml function. -->
+	<xsl:template name="FSpecialCollection">
+		<xsl:param name="ndCur" select="." />
+		<xsl:choose>
+			<xsl:when test="$ndCur/self::mml:mrow">
+				<xsl:variable name="fLinearFraction">
+					<xsl:call-template name="FLinearFrac">
+						<xsl:with-param name="ndCur" select="$ndCur" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:variable name="fFunc">
+					<xsl:call-template name="FIsFunc">
+						<xsl:with-param name="ndCur" select="$ndCur" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$fLinearFraction=1 or $fFunc=1">
+						1
+					</xsl:when>
+					<xsl:otherwise>
+						0
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <!-- This template iterates through the children of an equation array row (mtr) and outputs
-	     the equation.
-			 
-			 This template does all the work to output ampersands and skip the right elements when needed.
-	-->
-  <xsl:template name="ProcessEqArrayRow">
-      <xsl:param name="ndCur" select="."/>
+	<!-- This template iterates through the children of an equation array row 
+		(mtr) and outputs the equation. This template does all the work to output 
+		ampersands and skip the right elements when needed. -->
+	<xsl:template name="ProcessEqArrayRow">
+		<xsl:param name="ndCur" select="." />
 
-      <xsl:for-each select="$ndCur/*">
-         <xsl:variable name="fSpecialCollection">
-            <xsl:call-template name="FSpecialCollection">
-               <xsl:with-param name="ndCur" select="."/>
-            </xsl:call-template>
-         </xsl:variable>
-         <xsl:variable name="fIgnoreCollection">
-            <xsl:call-template name="FIgnoreCollection">
-               <xsl:with-param name="ndCur" select="."/>
-            </xsl:call-template>
-         </xsl:variable>
-         <xsl:choose>
-        <!-- If we have an alignment element output the ampersand. -->
-        <xsl:when test="self::mml:maligngroup or self::mml:malignmark">
-          <!-- Omml has an implied spacing alignment at the beginning of each equation.
-					     Therefore, if this is the first ampersand to be output, don't actually output. -->
-          <xsl:variable name="fFirstAlignAlreadyFound">
-                  <xsl:call-template name="FFirstAlignAlreadyFound">
-                     <xsl:with-param name="ndCur" select="."/>
-                  </xsl:call-template>
-               </xsl:variable>
-               <!-- Don't output unless it is an malignmark or we have already previously found an alignment point. -->
-          <xsl:if test="self::mml:malignmark or $fFirstAlignAlreadyFound=1">
-                  <r>
-                     <t>&amp;</t>
-                  </r>
-               </xsl:if>
-            </xsl:when>
-            <!-- If this node is an non-special mrow or mstyle and we aren't supposed to ignore this collection, then
-				     go ahead an apply templates to this node. -->
-        <xsl:when test="$fIgnoreCollection=0 and ((self::mml:mrow and $fSpecialCollection=0) or self::mml:mstyle)">
-               <xsl:call-template name="ProcessEqArrayRow">
-                  <xsl:with-param name="ndCur" select="."/>
-               </xsl:call-template>
-            </xsl:when>
-            <!-- At this point we have some mathml structure (fraction, nary, non-grouping element, etc.) -->
-        <!-- If this mathml structure has alignment groups or marks as children, then extract those since
-				     omml can't handle that. -->
-        <xsl:when test="descendant::mml:maligngroup or descendant::mml:malignmark">
-               <xsl:variable name="cMalignGroups">
-                  <xsl:value-of select="count(descendant::mml:maligngroup)"/>
-               </xsl:variable>
-               <xsl:variable name="cMalignMarks">
-                  <xsl:value-of select="count(descendant::mml:malignmark)"/>
-               </xsl:variable>
-               <!-- Output all maligngroups and malignmarks as '&amp;' -->
-          <xsl:if test="$cMalignGroups + $cMalignMarks &gt; 0">
-                  <xsl:variable name="str">
-                     <xsl:call-template name="ConcatStringRepeat">
-                        <xsl:with-param name="strToRepeat" select="'&amp;'"/>
-                        <xsl:with-param name="iRepetitions" select="$cMalignGroups + $cMalignMarks"/>
-                        <xsl:with-param name="strBuilding" select="''"/>
-                     </xsl:call-template>
-                  </xsl:variable>
-                  <r>
-                     <t>
-                        <xsl:call-template name="OutputText">
-                           <xsl:with-param name="sInput" select="$str"/>
-                        </xsl:call-template>
-                     </t>
-                  </r>
-               </xsl:if>
-               <!-- Now that the '&amp;' have been extracted, just apply-templates to this node.-->
-          <xsl:apply-templates mode="mml" select="."/>
-            </xsl:when>
-            <!-- If there are no alignment points as descendants, then go ahead and output this node. -->
-        <xsl:otherwise>
-               <xsl:apply-templates mode="mml" select="."/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:for-each>
-  </xsl:template>
+		<xsl:for-each select="$ndCur/*">
+			<xsl:variable name="fSpecialCollection">
+				<xsl:call-template name="FSpecialCollection">
+					<xsl:with-param name="ndCur" select="." />
+				</xsl:call-template>
+			</xsl:variable>
+			<xsl:variable name="fIgnoreCollection">
+				<xsl:call-template name="FIgnoreCollection">
+					<xsl:with-param name="ndCur" select="." />
+				</xsl:call-template>
+			</xsl:variable>
+			<xsl:choose>
+				<!-- If we have an alignment element output the ampersand. -->
+				<xsl:when
+					test="self::mml:maligngroup or self::mml:malignmark">
+					<!-- Omml has an implied spacing alignment at the beginning of each 
+						equation. Therefore, if this is the first ampersand to be output, don't actually 
+						output. -->
+					<xsl:variable name="fFirstAlignAlreadyFound">
+						<xsl:call-template
+							name="FFirstAlignAlreadyFound">
+							<xsl:with-param name="ndCur" select="." />
+						</xsl:call-template>
+					</xsl:variable>
+					<!-- Don't output unless it is an malignmark or we have already previously 
+						found an alignment point. -->
+					<xsl:if
+						test="self::mml:malignmark or $fFirstAlignAlreadyFound=1">
+						<r>
+							<t>&amp;</t>
+						</r>
+					</xsl:if>
+				</xsl:when>
+				<!-- If this node is an non-special mrow or mstyle and we aren't supposed 
+					to ignore this collection, then go ahead an apply templates to this node. -->
+				<xsl:when
+					test="$fIgnoreCollection=0 and ((self::mml:mrow and $fSpecialCollection=0) or self::mml:mstyle)">
+					<xsl:call-template name="ProcessEqArrayRow">
+						<xsl:with-param name="ndCur" select="." />
+					</xsl:call-template>
+				</xsl:when>
+				<!-- At this point we have some mathml structure (fraction, nary, non-grouping 
+					element, etc.) -->
+				<!-- If this mathml structure has alignment groups or marks as children, 
+					then extract those since omml can't handle that. -->
+				<xsl:when
+					test="descendant::mml:maligngroup or descendant::mml:malignmark">
+					<xsl:variable name="cMalignGroups">
+						<xsl:value-of
+							select="count(descendant::mml:maligngroup)" />
+					</xsl:variable>
+					<xsl:variable name="cMalignMarks">
+						<xsl:value-of
+							select="count(descendant::mml:malignmark)" />
+					</xsl:variable>
+					<!-- Output all maligngroups and malignmarks as '&amp;' -->
+					<xsl:if test="$cMalignGroups + $cMalignMarks &gt; 0">
+						<xsl:variable name="str">
+							<xsl:call-template name="ConcatStringRepeat">
+								<xsl:with-param name="strToRepeat"
+									select="'&amp;'" />
+								<xsl:with-param name="iRepetitions"
+									select="$cMalignGroups + $cMalignMarks" />
+								<xsl:with-param name="strBuilding" select="''" />
+							</xsl:call-template>
+						</xsl:variable>
+						<r>
+							<t>
+								<xsl:call-template name="OutputText">
+									<xsl:with-param name="sInput" select="$str" />
+								</xsl:call-template>
+							</t>
+						</r>
+					</xsl:if>
+					<!-- Now that the '&amp;' have been extracted, just apply-templates 
+						to this node. -->
+					<xsl:apply-templates mode="mml" select="." />
+				</xsl:when>
+				<!-- If there are no alignment points as descendants, then go ahead and 
+					output this node. -->
+				<xsl:otherwise>
+					<xsl:apply-templates mode="mml" select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 
-  <!-- This template transforms mtable into its appropriate omml type.
-	
-			 There are two possible omml constructs that an mtable can become:  a matrix or 
-			 an equation array.
-			 
-			 Because omml has no generic table construct, the omml matrix is the best approximate
-			 for a mathml table.
-			 
-			 Our equation array transformation is very simple.  The main goal of this transform is to
-			 allow roundtripping omml eq arrays through mathml.  The template ProcessEqArrayRow was never
-			 intended to account for many of the alignment flexibilities that are present in mathml like 
-			 using the alig attribute, using alignmark attribute in token elements, etc.
-			 
-			 The restrictions on this transform require <malignmark> and <maligngroup> elements to be outside of
-			 any non-grouping mathml elements (that is, mrow and mstyle).  Moreover, these elements cannot be the children of
-			 mrows that represent linear fractions or functions.  Also, <malignmark> cannot be a child
-			 of token attributes.
-			 
-			 In the case that the above 
-	
-	-->
-  <xsl:template mode="mml" match="mml:mtable">
-      <xsl:variable name="fEqArray">
-         <xsl:call-template name="FIsEqArray">
-            <xsl:with-param name="ndCur" select="."/>
-         </xsl:call-template>
-      </xsl:variable>
-      <xsl:variable name="alignment">
-	<xsl:value-of select="@columnalign"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$fEqArray=1">
-            <eqArr>
-	      <xsl:if test="$alignment!=''">
-		<eqArrPr>
-		  <baseJc m:val="{$alignment}"/>
-		</eqArrPr>
-	      </xsl:if>
-               <xsl:for-each select="mml:mtr">
-                  <e>
-                     <xsl:call-template name="ProcessEqArrayRow">
-                        <xsl:with-param name="ndCur" select="mml:mtd"/>
-                     </xsl:call-template>
-                  </e>
-               </xsl:for-each>
-            </eqArr>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="cMaxElmtsInRow">
-               <xsl:call-template name="CountMaxElmtsInRow">
-                  <xsl:with-param name="ndCur" select="*[1]"/>
-                  <xsl:with-param name="cMaxElmtsInRow" select="0"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <m>
-               <mPr>
-                  <baseJc m:val="center"/>
-                  <plcHide m:val="on"/>
-                  <mcs>
-                     <mc>
-                        <mcPr>
-                           <count>
-                              <xsl:attribute name="m:val">
-                                 <xsl:value-of select="$cMaxElmtsInRow"/>
+	<!-- This template transforms mtable into its appropriate omml type. There 
+		are two possible omml constructs that an mtable can become: a matrix or an 
+		equation array. Because omml has no generic table construct, the omml matrix 
+		is the best approximate for a mathml table. Our equation array transformation 
+		is very simple. The main goal of this transform is to allow roundtripping 
+		omml eq arrays through mathml. The template ProcessEqArrayRow was never intended 
+		to account for many of the alignment flexibilities that are present in mathml 
+		like using the alig attribute, using alignmark attribute in token elements, 
+		etc. The restrictions on this transform require <malignmark> and <maligngroup> 
+		elements to be outside of any non-grouping mathml elements (that is, mrow 
+		and mstyle). Moreover, these elements cannot be the children of mrows that 
+		represent linear fractions or functions. Also, <malignmark> cannot be a child 
+		of token attributes. In the case that the above -->
+	<xsl:template mode="mml" match="mml:mtable">
+		<xsl:variable name="fEqArray">
+			<xsl:call-template name="FIsEqArray">
+				<xsl:with-param name="ndCur" select="." />
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:variable name="alignment">
+			<xsl:value-of select="@columnalign" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$fEqArray=1">
+				<eqArr>
+					<xsl:if test="$alignment!=''">
+						<eqArrPr>
+							<baseJc m:val="{$alignment}" />
+						</eqArrPr>
+					</xsl:if>
+					<xsl:for-each select="mml:mtr">
+						<e>
+							<xsl:call-template name="ProcessEqArrayRow">
+								<xsl:with-param name="ndCur" select="mml:mtd" />
+							</xsl:call-template>
+						</e>
+					</xsl:for-each>
+				</eqArr>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="cMaxElmtsInRow">
+					<xsl:call-template name="CountMaxElmtsInRow">
+						<xsl:with-param name="ndCur" select="*[1]" />
+						<xsl:with-param name="cMaxElmtsInRow" select="0" />
+					</xsl:call-template>
+				</xsl:variable>
+				<m>
+					<mPr>
+						<baseJc m:val="center" />
+						<plcHide m:val="on" />
+						<mcs>
+							<mc>
+								<mcPr>
+									<count>
+										<xsl:attribute name="m:val">
+                                 <xsl:value-of
+											select="$cMaxElmtsInRow" />
                               </xsl:attribute>
-                           </count>
-                           <mcJc m:val="{$alignment}"/>
-                        </mcPr>
-                     </mc>
-                  </mcs>
-               </mPr>
-               <xsl:for-each select="*">
-                  <xsl:choose>
-                     <xsl:when test="self::mml:mtr or self::mml:mlabeledtr">
-                        <mr>
-                           <xsl:choose>
-                              <xsl:when test="self::mml:mtr">
-                                 <xsl:for-each select="*">
-                                    <e>
-                                       <xsl:apply-templates mode="mml" select="."/>
-                                    </e>
-                                 </xsl:for-each>
-                                 <xsl:call-template name="CreateEmptyElmt">
-                                    <xsl:with-param name="cEmptyMtd" select="$cMaxElmtsInRow - count(*)"/>
-                                 </xsl:call-template>
-                              </xsl:when>
-                              <xsl:otherwise>
-                                 <xsl:for-each select="*[position() &gt; 1]">
-                                    <e>
-                                       <xsl:apply-templates mode="mml" select="."/>
-                                    </e>
-                                 </xsl:for-each>
-                                 <xsl:call-template name="CreateEmptyElmt">
-                                    <xsl:with-param name="cEmptyMtd" select="$cMaxElmtsInRow - (count(*) - 1)"/>
-                                 </xsl:call-template>
-                              </xsl:otherwise>
-                           </xsl:choose>
-                        </mr>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <mr>
-                           <e>
-                              <xsl:apply-templates mode="mml" select="."/>
-                           </e>
-                           <xsl:call-template name="CreateEmptyElmt">
-                              <xsl:with-param name="cEmptyMtd" select="$cMaxElmtsInRow - 1"/>
-                           </xsl:call-template>
-                        </mr>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:for-each>
-            </m>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template mode="mml" match="m:mtd">
-      <xsl:apply-templates mode="mml"/>
-  </xsl:template>
-  <xsl:template name="CreateEmptyElmt">
-      <xsl:param name="cEmptyMtd"/>
-      <xsl:if test="$cEmptyMtd &gt; 0">
-         <e/>
-         <xsl:call-template name="CreateEmptyElmt">
-            <xsl:with-param name="cEmptyMtd" select="$cEmptyMtd - 1"/>
-         </xsl:call-template>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="CountMaxElmtsInRow">
-      <xsl:param name="ndCur"/>
-      <xsl:param name="cMaxElmtsInRow" select="0"/>
-      <xsl:choose>
-         <xsl:when test="not($ndCur)">
-            <xsl:value-of select="$cMaxElmtsInRow"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="CountMaxElmtsInRow">
-               <xsl:with-param name="ndCur" select="$ndCur/following-sibling::*[1]"/>
-               <xsl:with-param name="cMaxElmtsInRow">
-                  <xsl:choose>
-                     <xsl:when test="local-name($ndCur) = 'mlabeledtr' and                      namespace-uri($ndCur) = 'http://www.w3.org/1998/Math/MathML'">
-                        <xsl:choose>
-                           <xsl:when test="(count($ndCur/*) - 1) &gt; $cMaxElmtsInRow">
-                              <xsl:value-of select="count($ndCur/*) - 1"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="$cMaxElmtsInRow"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:when>
-                     <xsl:when test="local-name($ndCur) = 'mtr' and                      namespace-uri($ndCur) = 'http://www.w3.org/1998/Math/MathML'">
-                        <xsl:choose>
-                           <xsl:when test="count($ndCur/*) &gt; $cMaxElmtsInRow">
-                              <xsl:value-of select="count($ndCur/*)"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="$cMaxElmtsInRow"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:choose>
-                           <xsl:when test="1 &gt; $cMaxElmtsInRow">
-                              <xsl:value-of select="1"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="$cMaxElmtsInRow"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <xsl:template mode="mml" match="mml:mglyph">
-      <xsl:call-template name="CreateMglyph"/>
-  </xsl:template>
-  <xsl:template mode="mml"
-                 match="mml:mi[child::mml:mglyph] |                        mml:mn[child::mml:mglyph] |                        mml:mo[child::mml:mglyph] |                        mml:ms[child::mml:mglyph] |                        mml:mtext[child::mml:mglyph]">
-      <xsl:if test="string-length(normalize-space(.)) &gt; 0">
-         <r>
-            <xsl:call-template name="CreateRunProp">
-               <xsl:with-param name="mathvariant">
-                  <xsl:choose>
-                     <xsl:when test="@mathvariant">
-                        <xsl:value-of select="@mathvariant"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:mathvariant"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-               <xsl:with-param name="fontstyle">
-                  <xsl:choose>
-                     <xsl:when test="@fontstyle">
-                        <xsl:value-of select="@fontstyle"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:fontstyle"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-               <xsl:with-param name="fontweight">
-                  <xsl:choose>
-                     <xsl:when test="@fontweight">
-                        <xsl:value-of select="@fontweight"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:fontweight"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-               <xsl:with-param name="mathcolor">
-                  <xsl:choose>
-                     <xsl:when test="@mathcolor">
-                        <xsl:value-of select="@mathcolor"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:mathcolor"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-               <xsl:with-param name="mathsize">
-                  <xsl:choose>
-                     <xsl:when test="@mathsize">
-                        <xsl:value-of select="@mathsize"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:mathsize"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-               <xsl:with-param name="color">
-                  <xsl:choose>
-                     <xsl:when test="@color">
-                        <xsl:value-of select="@color"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:color"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-               <xsl:with-param name="fontsize">
-                  <xsl:choose>
-                     <xsl:when test="@fontsize">
-                        <xsl:value-of select="@fontsize"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:fontsize"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-               <xsl:with-param name="fNor">
-                  <xsl:call-template name="FNor">
-                     <xsl:with-param name="ndCur" select="."/>
-                  </xsl:call-template>
-               </xsl:with-param>
-               <xsl:with-param name="fLit">
-                  <xsl:call-template name="FLit">
-                     <xsl:with-param name="ndCur" select="."/>
-                  </xsl:call-template>
-               </xsl:with-param>
-               <xsl:with-param name="ndCur" select="."/>
-            </xsl:call-template>
-            <t>
-               <xsl:call-template name="OutputText">
-                  <xsl:with-param name="sInput">
-                     <xsl:choose>
-                        <xsl:when test="self::mml:ms">
-                           <xsl:call-template name="OutputMs">
-                              <xsl:with-param name="msCur" select="."/>
-                           </xsl:call-template>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="normalize-space(.)"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:with-param>
-               </xsl:call-template>
-            </t>
-         </r>
-      </xsl:if>
-      <xsl:for-each select="child::mml:mglyph">
-         <xsl:call-template name="CreateMglyph">
-            <xsl:with-param name="ndCur" select="."/>
-         </xsl:call-template>
-      </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="FGlyphIndexOk">
-      <xsl:param name="index"/>
-      <xsl:if test="$index != ''">
-         <xsl:choose>
-            <xsl:when test="string(number(string(floor($index)))) = 'NaN'"/>
-            <xsl:when test="number($index) &lt; 32 and not(number($index) = 9 or number($index) = 10 or number($index) = 13)"/>
-            <xsl:when test="number($index) = 65534 or number($index) = 65535"/>
-            <xsl:otherwise>1</xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-  </xsl:template>
-  <xsl:template name="CreateMglyph">
-      <xsl:param name="ndCur"/>
-      <r>
-         <xsl:call-template name="CreateRunProp">
-            <xsl:with-param name="mathvariant">
-               <xsl:choose>
-                  <xsl:when test="(not(@mathvariant) or @mathvariant='')                              and (not(@mml:mathvariant) or @mml:mathvariant='')                             and (../@mathvariant!='' or ../@mml:mathvariant!='')">
-                     <xsl:choose>
-                        <xsl:when test="../@mathvariant">
-                           <xsl:value-of select="../@mathvariant"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="../mml:mathvariant"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:choose>
-                        <xsl:when test="@mathvariant">
-                           <xsl:value-of select="@mathvariant"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:mathvariant"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fontstyle">
-               <xsl:choose>
-                  <xsl:when test="(not(@fontstyle) or @fontstyle='')                              and (not(@mml:fontstyle) or @mml:fontstyle='')                             and (../@fontstyle!='' or ../@mml:fontstyle!='')">
-                     <xsl:choose>
-                        <xsl:when test="../@fontstyle">
-                           <xsl:value-of select="../@fontstyle"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="../@mml:fontstyle"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:choose>
-                        <xsl:when test="@fontstyle">
-                           <xsl:value-of select="@fontstyle"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:fontstyle"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fontweight">
-               <xsl:choose>
-                  <xsl:when test="(not(@fontweight) or @fontweight='')                              and (not(@mml:fontweight) or @mml:fontweight='')                             and (../@fontweight!='' or ../@mml:fontweight!='')">
-                     <xsl:choose>
-                        <xsl:when test="../@fontweight">
-                           <xsl:value-of select="../@fontweight"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="../@mml:fontweight"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:choose>
-                        <xsl:when test="@fontweight">
-                           <xsl:value-of select="@fontweight"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:fontweight"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="mathcolor">
-               <xsl:choose>
-                  <xsl:when test="(not(@mathcolor) or @mathcolor='')                              and (not(@mml:mathcolor) or @mml:mathcolor='')                             and (../@mathcolor!='' or ../@mml:mathcolor!='')">
-                     <xsl:choose>
-                        <xsl:when test="../@mathcolor">
-                           <xsl:value-of select="../@mathcolor"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="../@mml:mathcolor"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:choose>
-                        <xsl:when test="@mathcolor">
-                           <xsl:value-of select="@mathcolor"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:mathcolor"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="mathsize">
-               <xsl:choose>
-                  <xsl:when test="(not(@mathsize) or @mathsize='')                             and (not(@mml:mathsize) or @mml:mathsize='')                             and (../@mathsize!='' or ../@mml:mathsize!='')">
-                     <xsl:choose>
-                        <xsl:when test="../@mathsize">
-                           <xsl:value-of select="../@mathsize"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="../@mathsize"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:choose>
-                        <xsl:when test="@mathsize">
-                           <xsl:value-of select="@mathsize"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:mathsize"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="color">
-               <xsl:choose>
-                  <xsl:when test="(not(@color) or @color='')                              and (not(@mml:color) or @mml:color='')                             and (../@color!='' or ../@mml:color!='')">
-                     <xsl:choose>
-                        <xsl:when test="../@color">
-                           <xsl:value-of select="../@color"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="../@mml:color"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:choose>
-                        <xsl:when test="@color">
-                           <xsl:value-of select="@color"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:color"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fontsize">
-               <xsl:choose>
-                  <xsl:when test="(not(@fontsize) or @fontsize='')                             and (not(@mml:fontsize) or @mml:fontsize='')                             and (../@fontsize!='' or ../@mml:fontsize!='')">
-                     <xsl:choose>
-                        <xsl:when test="../@fontsize">
-                           <xsl:value-of select="../@fontsize"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="../@mml:fontsize"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:choose>
-                        <xsl:when test="@fontsize">
-                           <xsl:value-of select="@fontsize"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                           <xsl:value-of select="@mml:fontsize"/>
-                        </xsl:otherwise>
-                     </xsl:choose>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="ndCur" select="."/>
-            <xsl:with-param name="font-family">
-               <xsl:choose>
-                  <xsl:when test="@fontfamily">
-                     <xsl:value-of select="@fontfamily"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@mml:fontfamily"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-            <xsl:with-param name="fNor">
-               <xsl:call-template name="FNor">
-                  <xsl:with-param name="ndCur" select="."/>
-               </xsl:call-template>
-            </xsl:with-param>
-            <xsl:with-param name="fLit">
-               <xsl:call-template name="FLit">
-                  <xsl:with-param name="ndCur" select="."/>
-               </xsl:call-template>
-            </xsl:with-param>
-         </xsl:call-template>
-         <xsl:variable name="shouldGlyphUseIndex">
-            <xsl:call-template name="FGlyphIndexOk">
-               <xsl:with-param name="index">
-                  <xsl:choose>
-                     <xsl:when test="@index">
-                        <xsl:value-of select="@index"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:index"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:variable>
-         <xsl:choose>
-            <xsl:when test="not($shouldGlyphUseIndex = '1')">
-               <t>
-                  <xsl:choose>
-                     <xsl:when test="@alt">
-                        <xsl:value-of select="@alt"/>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:value-of select="@mml:alt"/>
-                     </xsl:otherwise>
-                  </xsl:choose>
-               </t>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:variable name="nHexIndex">
-                  <xsl:call-template name="ConvertDecToHex">
-                     <xsl:with-param name="index">
-                        <xsl:choose>
-                           <xsl:when test="@index">
-                              <xsl:value-of select="@index"/>
-                           </xsl:when>
-                           <xsl:otherwise>
-                              <xsl:value-of select="@mml:index"/>
-                           </xsl:otherwise>
-                        </xsl:choose>
-                     </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:variable>
-               <t>
-                  <xsl:text disable-output-escaping="yes">&amp;#x</xsl:text>
-                  <xsl:value-of select="$nHexIndex"/>
-                  <xsl:text>;</xsl:text>
-               </t>
-            </xsl:otherwise>
-         </xsl:choose>
-      </r>
-  </xsl:template>
-  <xsl:template name="ConvertDecToHex">
-      <xsl:param name="index"/>
-      <xsl:if test="$index &gt; 0">
-         <xsl:call-template name="ConvertDecToHex">
-            <xsl:with-param name="index" select="floor($index div 16)"/>
-         </xsl:call-template>
-         <xsl:choose>
-            <xsl:when test="$index mod 16 &lt; 10">
-               <xsl:value-of select="$index mod 16"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:choose>
-                  <xsl:when test="$index mod 16 = 10">A</xsl:when>
-                  <xsl:when test="$index mod 16 = 11">B</xsl:when>
-                  <xsl:when test="$index mod 16 = 12">C</xsl:when>
-                  <xsl:when test="$index mod 16 = 13">D</xsl:when>
-                  <xsl:when test="$index mod 16 = 14">E</xsl:when>
-                  <xsl:when test="$index mod 16 = 15">F</xsl:when>
-                  <xsl:otherwise>A</xsl:otherwise>
-               </xsl:choose>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:if>
-  </xsl:template>
+									</count>
+									<mcJc m:val="{$alignment}" />
+								</mcPr>
+							</mc>
+						</mcs>
+					</mPr>
+					<xsl:for-each select="*">
+						<xsl:choose>
+							<xsl:when test="self::mml:mtr or self::mml:mlabeledtr">
+								<mr>
+									<xsl:choose>
+										<xsl:when test="self::mml:mtr">
+											<xsl:for-each select="*">
+												<e>
+													<xsl:apply-templates mode="mml"
+														select="." />
+												</e>
+											</xsl:for-each>
+											<xsl:call-template name="CreateEmptyElmt">
+												<xsl:with-param name="cEmptyMtd"
+													select="$cMaxElmtsInRow - count(*)" />
+											</xsl:call-template>
+										</xsl:when>
+										<xsl:otherwise>
+											<xsl:for-each select="*[position() &gt; 1]">
+												<e>
+													<xsl:apply-templates mode="mml"
+														select="." />
+												</e>
+											</xsl:for-each>
+											<xsl:call-template name="CreateEmptyElmt">
+												<xsl:with-param name="cEmptyMtd"
+													select="$cMaxElmtsInRow - (count(*) - 1)" />
+											</xsl:call-template>
+										</xsl:otherwise>
+									</xsl:choose>
+								</mr>
+							</xsl:when>
+							<xsl:otherwise>
+								<mr>
+									<e>
+										<xsl:apply-templates mode="mml" select="." />
+									</e>
+									<xsl:call-template name="CreateEmptyElmt">
+										<xsl:with-param name="cEmptyMtd"
+											select="$cMaxElmtsInRow - 1" />
+									</xsl:call-template>
+								</mr>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each>
+				</m>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template mode="mml" match="m:mtd">
+		<xsl:apply-templates mode="mml" />
+	</xsl:template>
+	<xsl:template name="CreateEmptyElmt">
+		<xsl:param name="cEmptyMtd" />
+		<xsl:if test="$cEmptyMtd &gt; 0">
+			<e />
+			<xsl:call-template name="CreateEmptyElmt">
+				<xsl:with-param name="cEmptyMtd"
+					select="$cEmptyMtd - 1" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="CountMaxElmtsInRow">
+		<xsl:param name="ndCur" />
+		<xsl:param name="cMaxElmtsInRow" select="0" />
+		<xsl:choose>
+			<xsl:when test="not($ndCur)">
+				<xsl:value-of select="$cMaxElmtsInRow" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="CountMaxElmtsInRow">
+					<xsl:with-param name="ndCur"
+						select="$ndCur/following-sibling::*[1]" />
+					<xsl:with-param name="cMaxElmtsInRow">
+						<xsl:choose>
+							<xsl:when
+								test="local-name($ndCur) = 'mlabeledtr' and                      namespace-uri($ndCur) = 'http://www.w3.org/1998/Math/MathML'">
+								<xsl:choose>
+									<xsl:when
+										test="(count($ndCur/*) - 1) &gt; $cMaxElmtsInRow">
+										<xsl:value-of select="count($ndCur/*) - 1" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="$cMaxElmtsInRow" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:when>
+							<xsl:when
+								test="local-name($ndCur) = 'mtr' and                      namespace-uri($ndCur) = 'http://www.w3.org/1998/Math/MathML'">
+								<xsl:choose>
+									<xsl:when test="count($ndCur/*) &gt; $cMaxElmtsInRow">
+										<xsl:value-of select="count($ndCur/*)" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="$cMaxElmtsInRow" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:choose>
+									<xsl:when test="1 &gt; $cMaxElmtsInRow">
+										<xsl:value-of select="1" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="$cMaxElmtsInRow" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template mode="mml" match="mml:mglyph">
+		<xsl:call-template name="CreateMglyph" />
+	</xsl:template>
+	<xsl:template mode="mml"
+		match="mml:mi[child::mml:mglyph] |                        mml:mn[child::mml:mglyph] |                        mml:mo[child::mml:mglyph] |                        mml:ms[child::mml:mglyph] |                        mml:mtext[child::mml:mglyph]">
+		<xsl:if test="string-length(normalize-space(.)) &gt; 0">
+			<r>
+				<xsl:call-template name="CreateRunProp">
+					<xsl:with-param name="mathvariant">
+						<xsl:choose>
+							<xsl:when test="@mathvariant">
+								<xsl:value-of select="@mathvariant" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:mathvariant" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+					<xsl:with-param name="fontstyle">
+						<xsl:choose>
+							<xsl:when test="@fontstyle">
+								<xsl:value-of select="@fontstyle" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:fontstyle" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+					<xsl:with-param name="fontweight">
+						<xsl:choose>
+							<xsl:when test="@fontweight">
+								<xsl:value-of select="@fontweight" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:fontweight" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+					<xsl:with-param name="mathcolor">
+						<xsl:choose>
+							<xsl:when test="@mathcolor">
+								<xsl:value-of select="@mathcolor" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:mathcolor" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+					<xsl:with-param name="mathsize">
+						<xsl:choose>
+							<xsl:when test="@mathsize">
+								<xsl:value-of select="@mathsize" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:mathsize" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+					<xsl:with-param name="color">
+						<xsl:choose>
+							<xsl:when test="@color">
+								<xsl:value-of select="@color" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:color" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+					<xsl:with-param name="fontsize">
+						<xsl:choose>
+							<xsl:when test="@fontsize">
+								<xsl:value-of select="@fontsize" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:fontsize" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+					<xsl:with-param name="fNor">
+						<xsl:call-template name="FNor">
+							<xsl:with-param name="ndCur" select="." />
+						</xsl:call-template>
+					</xsl:with-param>
+					<xsl:with-param name="fLit">
+						<xsl:call-template name="FLit">
+							<xsl:with-param name="ndCur" select="." />
+						</xsl:call-template>
+					</xsl:with-param>
+					<xsl:with-param name="ndCur" select="." />
+				</xsl:call-template>
+				<t>
+					<xsl:call-template name="OutputText">
+						<xsl:with-param name="sInput">
+							<xsl:choose>
+								<xsl:when test="self::mml:ms">
+									<xsl:call-template name="OutputMs">
+										<xsl:with-param name="msCur" select="." />
+									</xsl:call-template>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="normalize-space(.)" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+					</xsl:call-template>
+				</t>
+			</r>
+		</xsl:if>
+		<xsl:for-each select="child::mml:mglyph">
+			<xsl:call-template name="CreateMglyph">
+				<xsl:with-param name="ndCur" select="." />
+			</xsl:call-template>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="FGlyphIndexOk">
+		<xsl:param name="index" />
+		<xsl:if test="$index != ''">
+			<xsl:choose>
+				<xsl:when
+					test="string(number(string(floor($index)))) = 'NaN'" />
+				<xsl:when
+					test="number($index) &lt; 32 and not(number($index) = 9 or number($index) = 10 or number($index) = 13)" />
+				<xsl:when
+					test="number($index) = 65534 or number($index) = 65535" />
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template name="CreateMglyph">
+		<xsl:param name="ndCur" />
+		<r>
+			<xsl:call-template name="CreateRunProp">
+				<xsl:with-param name="mathvariant">
+					<xsl:choose>
+						<xsl:when
+							test="(not(@mathvariant) or @mathvariant='')                              and (not(@mml:mathvariant) or @mml:mathvariant='')                             and (../@mathvariant!='' or ../@mml:mathvariant!='')">
+							<xsl:choose>
+								<xsl:when test="../@mathvariant">
+									<xsl:value-of select="../@mathvariant" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="../mml:mathvariant" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:choose>
+								<xsl:when test="@mathvariant">
+									<xsl:value-of select="@mathvariant" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:mathvariant" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fontstyle">
+					<xsl:choose>
+						<xsl:when
+							test="(not(@fontstyle) or @fontstyle='')                              and (not(@mml:fontstyle) or @mml:fontstyle='')                             and (../@fontstyle!='' or ../@mml:fontstyle!='')">
+							<xsl:choose>
+								<xsl:when test="../@fontstyle">
+									<xsl:value-of select="../@fontstyle" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="../@mml:fontstyle" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:choose>
+								<xsl:when test="@fontstyle">
+									<xsl:value-of select="@fontstyle" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:fontstyle" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fontweight">
+					<xsl:choose>
+						<xsl:when
+							test="(not(@fontweight) or @fontweight='')                              and (not(@mml:fontweight) or @mml:fontweight='')                             and (../@fontweight!='' or ../@mml:fontweight!='')">
+							<xsl:choose>
+								<xsl:when test="../@fontweight">
+									<xsl:value-of select="../@fontweight" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="../@mml:fontweight" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:choose>
+								<xsl:when test="@fontweight">
+									<xsl:value-of select="@fontweight" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:fontweight" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="mathcolor">
+					<xsl:choose>
+						<xsl:when
+							test="(not(@mathcolor) or @mathcolor='')                              and (not(@mml:mathcolor) or @mml:mathcolor='')                             and (../@mathcolor!='' or ../@mml:mathcolor!='')">
+							<xsl:choose>
+								<xsl:when test="../@mathcolor">
+									<xsl:value-of select="../@mathcolor" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="../@mml:mathcolor" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:choose>
+								<xsl:when test="@mathcolor">
+									<xsl:value-of select="@mathcolor" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:mathcolor" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="mathsize">
+					<xsl:choose>
+						<xsl:when
+							test="(not(@mathsize) or @mathsize='')                             and (not(@mml:mathsize) or @mml:mathsize='')                             and (../@mathsize!='' or ../@mml:mathsize!='')">
+							<xsl:choose>
+								<xsl:when test="../@mathsize">
+									<xsl:value-of select="../@mathsize" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="../@mathsize" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:choose>
+								<xsl:when test="@mathsize">
+									<xsl:value-of select="@mathsize" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:mathsize" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="color">
+					<xsl:choose>
+						<xsl:when
+							test="(not(@color) or @color='')                              and (not(@mml:color) or @mml:color='')                             and (../@color!='' or ../@mml:color!='')">
+							<xsl:choose>
+								<xsl:when test="../@color">
+									<xsl:value-of select="../@color" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="../@mml:color" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:choose>
+								<xsl:when test="@color">
+									<xsl:value-of select="@color" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:color" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fontsize">
+					<xsl:choose>
+						<xsl:when
+							test="(not(@fontsize) or @fontsize='')                             and (not(@mml:fontsize) or @mml:fontsize='')                             and (../@fontsize!='' or ../@mml:fontsize!='')">
+							<xsl:choose>
+								<xsl:when test="../@fontsize">
+									<xsl:value-of select="../@fontsize" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="../@mml:fontsize" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:choose>
+								<xsl:when test="@fontsize">
+									<xsl:value-of select="@fontsize" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="@mml:fontsize" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="ndCur" select="." />
+				<xsl:with-param name="font-family">
+					<xsl:choose>
+						<xsl:when test="@fontfamily">
+							<xsl:value-of select="@fontfamily" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@mml:fontfamily" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+				<xsl:with-param name="fNor">
+					<xsl:call-template name="FNor">
+						<xsl:with-param name="ndCur" select="." />
+					</xsl:call-template>
+				</xsl:with-param>
+				<xsl:with-param name="fLit">
+					<xsl:call-template name="FLit">
+						<xsl:with-param name="ndCur" select="." />
+					</xsl:call-template>
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:variable name="shouldGlyphUseIndex">
+				<xsl:call-template name="FGlyphIndexOk">
+					<xsl:with-param name="index">
+						<xsl:choose>
+							<xsl:when test="@index">
+								<xsl:value-of select="@index" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:index" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when test="not($shouldGlyphUseIndex = '1')">
+					<t>
+						<xsl:choose>
+							<xsl:when test="@alt">
+								<xsl:value-of select="@alt" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@mml:alt" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</t>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="nHexIndex">
+						<xsl:call-template name="ConvertDecToHex">
+							<xsl:with-param name="index">
+								<xsl:choose>
+									<xsl:when test="@index">
+										<xsl:value-of select="@index" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="@mml:index" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:variable>
+					<t>
+						<xsl:text disable-output-escaping="yes">&amp;#x</xsl:text>
+						<xsl:value-of select="$nHexIndex" />
+						<xsl:text>;</xsl:text>
+					</t>
+				</xsl:otherwise>
+			</xsl:choose>
+		</r>
+	</xsl:template>
+	<xsl:template name="ConvertDecToHex">
+		<xsl:param name="index" />
+		<xsl:if test="$index &gt; 0">
+			<xsl:call-template name="ConvertDecToHex">
+				<xsl:with-param name="index"
+					select="floor($index div 16)" />
+			</xsl:call-template>
+			<xsl:choose>
+				<xsl:when test="$index mod 16 &lt; 10">
+					<xsl:value-of select="$index mod 16" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:choose>
+						<xsl:when test="$index mod 16 = 10">
+							A
+						</xsl:when>
+						<xsl:when test="$index mod 16 = 11">
+							B
+						</xsl:when>
+						<xsl:when test="$index mod 16 = 12">
+							C
+						</xsl:when>
+						<xsl:when test="$index mod 16 = 13">
+							D
+						</xsl:when>
+						<xsl:when test="$index mod 16 = 14">
+							E
+						</xsl:when>
+						<xsl:when test="$index mod 16 = 15">
+							F
+						</xsl:when>
+						<xsl:otherwise>
+							A
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template name="FStrContainsNonZeroDigit">
-      <xsl:param name="s"/>
+	<xsl:template name="FStrContainsNonZeroDigit">
+		<xsl:param name="s" />
 
-      <!-- Translate any nonzero digit into a 9 -->
-    <xsl:variable name="sNonZeroDigitsToNineDigit" select="translate($s, '12345678', '99999999')"/>
-      <xsl:choose>
-      <!-- Search for 9s -->
-      <xsl:when test="contains($sNonZeroDigitsToNineDigit, '9')">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<!-- Translate any nonzero digit into a 9 -->
+		<xsl:variable name="sNonZeroDigitsToNineDigit"
+			select="translate($s, '12345678', '99999999')" />
+		<xsl:choose>
+			<!-- Search for 9s -->
+			<xsl:when test="contains($sNonZeroDigitsToNineDigit, '9')">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template name="FStrContainsDigits">
-      <xsl:param name="s"/>
+	<xsl:template name="FStrContainsDigits">
+		<xsl:param name="s" />
 
-      <!-- Translate any digit into a 0 -->
-    <xsl:variable name="sDigitsToZeroDigit" select="translate($s, '123456789', '000000000')"/>
-      <xsl:choose>
-      <!-- Search for 0s -->
-      <xsl:when test="contains($sDigitsToZeroDigit, '0')">1</xsl:when>
-         <xsl:otherwise>0</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<!-- Translate any digit into a 0 -->
+		<xsl:variable name="sDigitsToZeroDigit"
+			select="translate($s, '123456789', '000000000')" />
+		<xsl:choose>
+			<!-- Search for 0s -->
+			<xsl:when test="contains($sDigitsToZeroDigit, '0')">
+				1
+			</xsl:when>
+			<xsl:otherwise>
+				0
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- Used to determine if mpadded attribute {width, height, depth } 
-       indicates to show everything. 
-       
-       Unlike mathml, whose mpadded structure has great flexibility in modifying the 
-       bounding box's width, height, and depth, Word can only have zero or full width, height, and depth.
-       Thus, if the width, height, or depth attributes indicate any kind of nonzero width, height, 
-       or depth, we'll translate that into a show full width, height, or depth for OMML.  Only if the attribute
-       indicates a zero width, height, or depth, will we report back FFull as false.
-       
-       Example:  s=0%    ->  FFull returns 0.
-                 s=2%    ->  FFull returns 1.
-                 s=0.1em ->  FFull returns 1.     
-       
-       -->
-  <xsl:template name="FFull">
-      <xsl:param name="s"/>
+	<!-- Used to determine if mpadded attribute {width, height, depth } indicates 
+		to show everything. Unlike mathml, whose mpadded structure has great flexibility 
+		in modifying the bounding box's width, height, and depth, Word can only have 
+		zero or full width, height, and depth. Thus, if the width, height, or depth 
+		attributes indicate any kind of nonzero width, height, or depth, we'll translate 
+		that into a show full width, height, or depth for OMML. Only if the attribute 
+		indicates a zero width, height, or depth, will we report back FFull as false. 
+		Example: s=0% -> FFull returns 0. s=2% -> FFull returns 1. s=0.1em -> FFull 
+		returns 1. -->
+	<xsl:template name="FFull">
+		<xsl:param name="s" />
 
-      <xsl:variable name="fStrContainsNonZeroDigit">
-         <xsl:call-template name="FStrContainsNonZeroDigit">
-            <xsl:with-param name="s" select="$s"/>
-         </xsl:call-template>
-      </xsl:variable>
+		<xsl:variable name="fStrContainsNonZeroDigit">
+			<xsl:call-template name="FStrContainsNonZeroDigit">
+				<xsl:with-param name="s" select="$s" />
+			</xsl:call-template>
+		</xsl:variable>
 
-      <xsl:variable name="fStrContainsDigits">
-         <xsl:call-template name="FStrContainsDigits">
-            <xsl:with-param name="s" select="$s"/>
-         </xsl:call-template>
-      </xsl:variable>
+		<xsl:variable name="fStrContainsDigits">
+			<xsl:call-template name="FStrContainsDigits">
+				<xsl:with-param name="s" select="$s" />
+			</xsl:call-template>
+		</xsl:variable>
 
-      <xsl:choose>
-      <!-- String contained non-zero digit -->
-      <xsl:when test="$fStrContainsNonZeroDigit=1">1</xsl:when>
-         <!-- String didn't contain a non-zero digit, but it did contain digits.
-           This must mean that all digits in the string were 0s. -->
-      <xsl:when test="$fStrContainsDigits=1">0</xsl:when>
-         <!-- Else, no digits, therefore, return true.
-           We return true in the otherwise condition to take account for the possibility
-           in MathML to say something like width="height". -->
-      <xsl:otherwise>1</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+		<xsl:choose>
+			<!-- String contained non-zero digit -->
+			<xsl:when test="$fStrContainsNonZeroDigit=1">
+				1
+			</xsl:when>
+			<!-- String didn't contain a non-zero digit, but it did contain digits. 
+				This must mean that all digits in the string were 0s. -->
+			<xsl:when test="$fStrContainsDigits=1">
+				0
+			</xsl:when>
+			<!-- Else, no digits, therefore, return true. We return true in the otherwise 
+				condition to take account for the possibility in MathML to say something 
+				like width="height". -->
+			<xsl:otherwise>
+				1
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <!-- Just outputs phant properties, doesn't do any fancy 
-       thinking of its own, just obeys the defaults of 
-       phants. -->
-  <xsl:template name="CreatePhantPropertiesCore">
-      <xsl:param name="fShow" select="1"/>
-      <xsl:param name="fFullWidth" select="1"/>
-      <xsl:param name="fFullHeight" select="1"/>
-      <xsl:param name="fFullDepth" select="1"/>
+	<!-- Just outputs phant properties, doesn't do any fancy thinking of its 
+		own, just obeys the defaults of phants. -->
+	<xsl:template name="CreatePhantPropertiesCore">
+		<xsl:param name="fShow" select="1" />
+		<xsl:param name="fFullWidth" select="1" />
+		<xsl:param name="fFullHeight" select="1" />
+		<xsl:param name="fFullDepth" select="1" />
 
-      <xsl:if test="$fShow=0                      or $fFullWidth=0                      or $fFullHeight=0                     or $fFullDepth=0">
-         <phantPr>
-            <xsl:if test="$fShow=0">
-               <show>
-                  <xsl:attribute name="m:val">off</xsl:attribute>
-               </show>
-            </xsl:if>
-            <xsl:if test="$fFullWidth=0">
-               <zeroWid>
-                  <xsl:attribute name="m:val">on</xsl:attribute>
-               </zeroWid>
-            </xsl:if>
-            <xsl:if test="$fFullHeight=0">
-               <zeroAsc>
-                  <xsl:attribute name="m:val">on</xsl:attribute>
-               </zeroAsc>
-            </xsl:if>
-            <xsl:if test="$fFullDepth=0">
-               <zeroDesc>
-                  <xsl:attribute name="m:val">on</xsl:attribute>
-               </zeroDesc>
-            </xsl:if>
-         </phantPr>
-      </xsl:if>
-  </xsl:template>
+		<xsl:if
+			test="$fShow=0                      or $fFullWidth=0                      or $fFullHeight=0                     or $fFullDepth=0">
+			<phantPr>
+				<xsl:if test="$fShow=0">
+					<show>
+						<xsl:attribute name="m:val">off</xsl:attribute>
+					</show>
+				</xsl:if>
+				<xsl:if test="$fFullWidth=0">
+					<zeroWid>
+						<xsl:attribute name="m:val">on</xsl:attribute>
+					</zeroWid>
+				</xsl:if>
+				<xsl:if test="$fFullHeight=0">
+					<zeroAsc>
+						<xsl:attribute name="m:val">on</xsl:attribute>
+					</zeroAsc>
+				</xsl:if>
+				<xsl:if test="$fFullDepth=0">
+					<zeroDesc>
+						<xsl:attribute name="m:val">on</xsl:attribute>
+					</zeroDesc>
+				</xsl:if>
+			</phantPr>
+		</xsl:if>
+	</xsl:template>
 
-  <!-- Figures out if we should factor in width, height, and depth attributes.  
-  
-       If so, then it 
-       gets these attributes, does some processing to figure out what the attributes indicate, 
-       then passes these indications to CreatePhantPropertiesCore.  
-       
-       If we aren't supposed to factor in width, height, or depth, then we'll just output the show
-       attribute. -->
-  <xsl:template name="CreatePhantProperties">
-      <xsl:param name="ndCur" select="."/>
-      <xsl:param name="fShow" select="1"/>
+	<!-- Figures out if we should factor in width, height, and depth attributes. 
+		If so, then it gets these attributes, does some processing to figure out 
+		what the attributes indicate, then passes these indications to CreatePhantPropertiesCore. 
+		If we aren't supposed to factor in width, height, or depth, then we'll just 
+		output the show attribute. -->
+	<xsl:template name="CreatePhantProperties">
+		<xsl:param name="ndCur" select="." />
+		<xsl:param name="fShow" select="1" />
 
-      <xsl:choose>
-      <!-- In the special case that we have an mphantom with one child which is an mpadded, then we should 
-           subsume the mpadded attributes into the mphantom attributes.  The test statement below imples the 
-           'one child which is an mpadded'.  The first part, that the parent of mpadded is an mphantom, is implied
-           by being in this template, which is only called when we've encountered an mphantom.
-           
-           Word outputs its invisible phantoms with smashing as 
+		<xsl:choose>
+			<!-- In the special case that we have an mphantom with one child which 
+				is an mpadded, then we should subsume the mpadded attributes into the mphantom 
+				attributes. The test statement below imples the 'one child which is an mpadded'. 
+				The first part, that the parent of mpadded is an mphantom, is implied by 
+				being in this template, which is only called when we've encountered an mphantom. 
+				Word outputs its invisible phantoms with smashing as <mml:mphantom> <mml:mpadded 
+				. . . > </mml:mpadded> </mml:mphantom> This test is used to allow roundtripping 
+				smashed invisible phantoms. -->
+			<xsl:when
+				test="count($ndCur/child::*)=1 and count($ndCur/mml:mpadded)=1">
+				<xsl:variable name="sLowerCaseWidth">
+					<xsl:choose>
+						<xsl:when test="$ndCur/mml:mpadded/@width">
+							<xsl:value-of
+								select="translate($ndCur/mml:mpadded/@width, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/mml:mpadded/@mml:width, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="sLowerCaseHeight">
+					<xsl:choose>
+						<xsl:when test="$ndCur/mml:mpadded/@height">
+							<xsl:value-of
+								select="translate($ndCur/mml:mpadded/@height, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/mml:mpadded/@mml:height, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="sLowerCaseDepth">
+					<xsl:choose>
+						<xsl:when test="$ndCur/mml:mpadded/@depth">
+							<xsl:value-of
+								select="translate($ndCur/mml:mpadded/@depth, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/mml:mpadded/@mml:depth, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
 
-              <mml:mphantom>
-                <mml:mpadded . . . >
-                  
-                </mml:mpadded>
-              </mml:mphantom>
+				<xsl:variable name="fFullWidth">
+					<xsl:call-template name="FFull">
+						<xsl:with-param name="s" select="$sLowerCaseWidth" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:variable name="fFullHeight">
+					<xsl:call-template name="FFull">
+						<xsl:with-param name="s" select="$sLowerCaseHeight" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:variable name="fFullDepth">
+					<xsl:call-template name="FFull">
+						<xsl:with-param name="s" select="$sLowerCaseDepth" />
+					</xsl:call-template>
+				</xsl:variable>
 
-            This test is used to allow roundtripping smashed invisible phantoms. -->
-      <xsl:when test="count($ndCur/child::*)=1 and count($ndCur/mml:mpadded)=1">
-            <xsl:variable name="sLowerCaseWidth">
-               <xsl:choose>
-                  <xsl:when test="$ndCur/mml:mpadded/@width">
-                     <xsl:value-of select="translate($ndCur/mml:mpadded/@width, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/mml:mpadded/@mml:width, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
-            <xsl:variable name="sLowerCaseHeight">
-               <xsl:choose>
-                  <xsl:when test="$ndCur/mml:mpadded/@height">
-                     <xsl:value-of select="translate($ndCur/mml:mpadded/@height, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/mml:mpadded/@mml:height, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
-            <xsl:variable name="sLowerCaseDepth">
-               <xsl:choose>
-                  <xsl:when test="$ndCur/mml:mpadded/@depth">
-                     <xsl:value-of select="translate($ndCur/mml:mpadded/@depth, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/mml:mpadded/@mml:depth, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
+				<xsl:call-template
+					name="CreatePhantPropertiesCore">
+					<xsl:with-param name="fShow" select="$fShow" />
+					<xsl:with-param name="fFullWidth"
+						select="$fFullWidth" />
+					<xsl:with-param name="fFullHeight"
+						select="$fFullHeight" />
+					<xsl:with-param name="fFullDepth"
+						select="$fFullDepth" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template
+					name="CreatePhantPropertiesCore">
+					<xsl:with-param name="fShow" select="$fShow" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-            <xsl:variable name="fFullWidth">
-               <xsl:call-template name="FFull">
-                  <xsl:with-param name="s" select="$sLowerCaseWidth"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:variable name="fFullHeight">
-               <xsl:call-template name="FFull">
-                  <xsl:with-param name="s" select="$sLowerCaseHeight"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:variable name="fFullDepth">
-               <xsl:call-template name="FFull">
-                  <xsl:with-param name="s" select="$sLowerCaseDepth"/>
-               </xsl:call-template>
-            </xsl:variable>
+	<xsl:template mode="mml" match="mml:mpadded">
+		<xsl:choose>
+			<xsl:when
+				test="count(parent::mml:mphantom)=1 and count(preceding-sibling::*)=0 and count(following-sibling::*)=0">
+				<!-- This mpadded is inside an mphantom that has already setup phantom 
+					attributes, therefore, just apply templates -->
+				<xsl:apply-templates mode="mml" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="sLowerCaseWidth">
+					<xsl:choose>
+						<xsl:when test="@width">
+							<xsl:value-of select="@width" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@mml:width" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="sLowerCaseHeight">
+					<xsl:choose>
+						<xsl:when test="@height">
+							<xsl:value-of select="@height" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@mml:height" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="sLowerCaseDepth">
+					<xsl:choose>
+						<xsl:when test="@depth">
+							<xsl:value-of select="@depth" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="@mml:depth" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
 
-            <xsl:call-template name="CreatePhantPropertiesCore">
-               <xsl:with-param name="fShow" select="$fShow"/>
-               <xsl:with-param name="fFullWidth" select="$fFullWidth"/>
-               <xsl:with-param name="fFullHeight" select="$fFullHeight"/>
-               <xsl:with-param name="fFullDepth" select="$fFullDepth"/>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="CreatePhantPropertiesCore">
-               <xsl:with-param name="fShow" select="$fShow"/>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+				<xsl:variable name="fFullWidth">
+					<xsl:call-template name="FFull">
+						<xsl:with-param name="s" select="$sLowerCaseWidth" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:variable name="fFullHeight">
+					<xsl:call-template name="FFull">
+						<xsl:with-param name="s" select="$sLowerCaseHeight" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:variable name="fFullDepth">
+					<xsl:call-template name="FFull">
+						<xsl:with-param name="s" select="$sLowerCaseDepth" />
+					</xsl:call-template>
+				</xsl:variable>
 
-  <xsl:template mode="mml" match="mml:mpadded">
-      <xsl:choose>
-         <xsl:when test="count(parent::mml:mphantom)=1 and count(preceding-sibling::*)=0 and count(following-sibling::*)=0">
-        <!-- This mpadded is inside an mphantom that has already setup phantom attributes, therefore, just apply templates -->
-        <xsl:apply-templates mode="mml"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="sLowerCaseWidth">
-               <xsl:choose>
-                  <xsl:when test="@width">
-                     <xsl:value-of select="@width"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@mml:width"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
-            <xsl:variable name="sLowerCaseHeight">
-               <xsl:choose>
-                  <xsl:when test="@height">
-                     <xsl:value-of select="@height"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@mml:height"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
-            <xsl:variable name="sLowerCaseDepth">
-               <xsl:choose>
-                  <xsl:when test="@depth">
-                     <xsl:value-of select="@depth"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="@mml:depth"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:variable>
+				<phant>
+					<xsl:call-template
+						name="CreatePhantPropertiesCore">
+						<xsl:with-param name="fShow" select="1" />
+						<xsl:with-param name="fFullWidth"
+							select="$fFullWidth" />
+						<xsl:with-param name="fFullHeight"
+							select="$fFullHeight" />
+						<xsl:with-param name="fFullDepth"
+							select="$fFullDepth" />
+					</xsl:call-template>
+					<e>
+						<xsl:apply-templates mode="mml" />
+					</e>
+				</phant>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-            <xsl:variable name="fFullWidth">
-               <xsl:call-template name="FFull">
-                  <xsl:with-param name="s" select="$sLowerCaseWidth"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:variable name="fFullHeight">
-               <xsl:call-template name="FFull">
-                  <xsl:with-param name="s" select="$sLowerCaseHeight"/>
-               </xsl:call-template>
-            </xsl:variable>
-            <xsl:variable name="fFullDepth">
-               <xsl:call-template name="FFull">
-                  <xsl:with-param name="s" select="$sLowerCaseDepth"/>
-               </xsl:call-template>
-            </xsl:variable>
+	<xsl:template mode="mml" match="mml:mphantom">
+		<phant>
+			<xsl:call-template name="CreatePhantProperties">
+				<xsl:with-param name="ndCur" select="." />
+				<xsl:with-param name="fShow" select="0" />
+			</xsl:call-template>
+			<e>
+				<xsl:apply-templates mode="mml" />
+			</e>
+		</phant>
+	</xsl:template>
 
-            <phant>
-               <xsl:call-template name="CreatePhantPropertiesCore">
-                  <xsl:with-param name="fShow" select="1"/>
-                  <xsl:with-param name="fFullWidth" select="$fFullWidth"/>
-                  <xsl:with-param name="fFullHeight" select="$fFullHeight"/>
-                  <xsl:with-param name="fFullDepth" select="$fFullDepth"/>
-               </xsl:call-template>
-               <e>
-                  <xsl:apply-templates mode="mml"/>
-               </e>
-            </phant>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<xsl:template name="isNaryOper">
+		<xsl:param name="sNdCur" />
+		<xsl:value-of
+			select="($sNdCur = '∫' or $sNdCur = '∬' or $sNdCur = '∭' or $sNdCur = '∮' or $sNdCur = '∯' or $sNdCur = '∰' or $sNdCur = '∲' or $sNdCur = '∳' or $sNdCur = '∱' or $sNdCur = '∩' or $sNdCur = '∪' or $sNdCur = '∏' or $sNdCur = '∐' or $sNdCur = '∑')" />
+	</xsl:template>
 
-  <xsl:template mode="mml" match="mml:mphantom">
-      <phant>
-         <xsl:call-template name="CreatePhantProperties">
-            <xsl:with-param name="ndCur" select="."/>
-            <xsl:with-param name="fShow" select="0"/>
-         </xsl:call-template>
-         <e>
-            <xsl:apply-templates mode="mml"/>
-         </e>
-      </phant>
-  </xsl:template>
 
-  <xsl:template name="isNaryOper">
-      <xsl:param name="sNdCur"/>
-      <xsl:value-of select="($sNdCur = '∫' or $sNdCur = '∬' or $sNdCur = '∭' or $sNdCur = '∮' or $sNdCur = '∯' or $sNdCur = '∰' or $sNdCur = '∲' or $sNdCur = '∳' or $sNdCur = '∱' or $sNdCur = '∩' or $sNdCur = '∪' or $sNdCur = '∏' or $sNdCur = '∐' or $sNdCur = '∑')"/>
-  </xsl:template>
+	<xsl:template name="isNary">
+		<!-- ndCur is the element around the nAry operator -->
+		<xsl:param name="ndCur" />
+		<xsl:variable name="sNdCur">
+			<xsl:value-of select="normalize-space($ndCur)" />
+		</xsl:variable>
 
+		<xsl:variable name="fNaryOper">
+			<xsl:call-template name="isNaryOper">
+				<xsl:with-param name="sNdCur" select="$sNdCur" />
+			</xsl:call-template>
+		</xsl:variable>
 
-  <xsl:template name="isNary">
-    <!-- ndCur is the element around the nAry operator -->
-    <xsl:param name="ndCur"/>
-      <xsl:variable name="sNdCur">
-         <xsl:value-of select="normalize-space($ndCur)"/>
-      </xsl:variable>
+		<!-- Narys shouldn't be MathML accents. -->
+		<xsl:variable name="fUnder">
+			<xsl:choose>
+				<xsl:when test="$ndCur/parent::*[self::mml:munder]">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <xsl:variable name="fNaryOper">
-         <xsl:call-template name="isNaryOper">
-            <xsl:with-param name="sNdCur" select="$sNdCur"/>
-         </xsl:call-template>
-      </xsl:variable>
+		<xsl:variable name="sLowerCaseAccent">
+			<xsl:choose>
+				<xsl:when test="$fUnder=1">
+					<xsl:choose>
+						<xsl:when
+							test="$ndCur/parent::*[self::mml:munder]/@accentunder">
+							<xsl:value-of
+								select="translate($ndCur/parent::*[self::mml:munder]/@accentunder, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/parent::*[self::mml:munder]/@mml:accentunder, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:choose>
+						<xsl:when test="$ndCur/parent::*/@accent">
+							<xsl:value-of
+								select="translate($ndCur/parent::*/@accent, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of
+								select="translate($ndCur/parent::*/@mml:accent, $StrUCAlphabet, $StrLCAlphabet)" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <!-- Narys shouldn't be MathML accents.  -->
-    <xsl:variable name="fUnder">
-         <xsl:choose>
-            <xsl:when test="$ndCur/parent::*[self::mml:munder]">1</xsl:when>
-            <xsl:otherwise>0</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+		<xsl:variable name="fAccent">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseAccent='true'">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <xsl:variable name="sLowerCaseAccent">
-         <xsl:choose>
-            <xsl:when test="$fUnder=1">
-               <xsl:choose>
-                  <xsl:when test="$ndCur/parent::*[self::mml:munder]/@accentunder">
-                     <xsl:value-of select="translate($ndCur/parent::*[self::mml:munder]/@accentunder, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/parent::*[self::mml:munder]/@mml:accentunder, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:choose>
-                  <xsl:when test="$ndCur/parent::*/@accent">
-                     <xsl:value-of select="translate($ndCur/parent::*/@accent, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="translate($ndCur/parent::*/@mml:accent, $StrUCAlphabet, $StrLCAlphabet)"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+		<xsl:choose>
+			<!-- This ndCur is in fact part of an nAry if 1) The last descendant of 
+				ndCur (which could be ndCur itself) is an operator. 2) Along that chain of 
+				descendants we only encounter mml:mo, mml:mstyle, and mml:mrow elements. 
+				3) the operator in mml:mo is a valid nAry operator 4) The nAry is not accented. -->
+			<xsl:when
+				test="$fNaryOper = 'true'                       and $fAccent=0                       and $ndCur/descendant-or-self::*[last()]/self::mml:mo                       and not($ndCur/descendant-or-self::*[not(self::mml:mo or                                                          self::mml:mstyle or                                                          self::mml:mrow)])">
+				<xsl:value-of select="true()" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="false()" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-      <xsl:variable name="fAccent">
-         <xsl:choose>
-            <xsl:when test="$sLowerCaseAccent='true'">1</xsl:when>
-            <xsl:otherwise>0</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-
-      <xsl:choose>
-      <!-- This ndCur is in fact part of an nAry if
-      
-           1)  The last descendant of ndCur (which could be ndCur itself) is an operator.
-           2)  Along that chain of descendants we only encounter mml:mo, mml:mstyle, and mml:mrow elements.
-           3)  the operator in mml:mo is a valid nAry operator
-           4)  The nAry is not accented.
-           -->
-      <xsl:when test="$fNaryOper = 'true'                       and $fAccent=0                       and $ndCur/descendant-or-self::*[last()]/self::mml:mo                       and not($ndCur/descendant-or-self::*[not(self::mml:mo or                                                          self::mml:mstyle or                                                          self::mml:mrow)])">
-            <xsl:value-of select="true()"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="false()"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-
-  <xsl:template name="CreateNaryProp">
-      <xsl:param name="chr"/>
-      <xsl:param name="sMathmlType"/>
-      <naryPr>
-         <chr>
-            <xsl:attribute name="m:val">
-               <xsl:value-of select="$chr"/>
+	<xsl:template name="CreateNaryProp">
+		<xsl:param name="chr" />
+		<xsl:param name="sMathmlType" />
+		<naryPr>
+			<chr>
+				<xsl:attribute name="m:val">
+               <xsl:value-of select="$chr" />
             </xsl:attribute>
-         </chr>
-         <limLoc>
-            <xsl:attribute name="m:val">
+			</chr>
+			<limLoc>
+				<xsl:attribute name="m:val">
                <xsl:choose>
-                  <xsl:when test="$sMathmlType='munder' or           $sMathmlType='mover' or           $sMathmlType='munderover'">
+                  <xsl:when
+					test="$sMathmlType='munder' or           $sMathmlType='mover' or           $sMathmlType='munderover'">
                      <xsl:text>undOvr</xsl:text>
                   </xsl:when>
-                  <xsl:when test="$sMathmlType='msub' or                      $sMathmlType='msup' or                      $sMathmlType='msubsup'">
+                  <xsl:when
+					test="$sMathmlType='msub' or                      $sMathmlType='msup' or                      $sMathmlType='msubsup'">
                      <xsl:text>subSup</xsl:text>
                   </xsl:when>
                </xsl:choose>
             </xsl:attribute>
-         </limLoc>
-         <grow>
-            <xsl:attribute name="m:val">
-               <xsl:value-of select="'on'"/>
+			</limLoc>
+			<grow>
+				<xsl:attribute name="m:val">
+               <xsl:value-of select="'on'" />
             </xsl:attribute>
-         </grow>
-         <subHide>
-            <xsl:attribute name="m:val">
+			</grow>
+			<subHide>
+				<xsl:attribute name="m:val">
                <xsl:choose>
-                  <xsl:when test="$sMathmlType='mover' or                       $sMathmlType='msup'">
+                  <xsl:when
+					test="$sMathmlType='mover' or                       $sMathmlType='msup'">
                      <xsl:text>on</xsl:text>
                   </xsl:when>
                   <xsl:otherwise>
@@ -3702,11 +3990,12 @@
                   </xsl:otherwise>
                </xsl:choose>
             </xsl:attribute>
-         </subHide>
-         <supHide>
-            <xsl:attribute name="m:val">
+			</subHide>
+			<supHide>
+				<xsl:attribute name="m:val">
                <xsl:choose>
-                  <xsl:when test="$sMathmlType='munder' or                       $sMathmlType='msub'">
+                  <xsl:when
+					test="$sMathmlType='munder' or                       $sMathmlType='msub'">
                      <xsl:text>on</xsl:text>
                   </xsl:when>
                   <xsl:otherwise>
@@ -3714,9 +4003,9 @@
                   </xsl:otherwise>
                </xsl:choose>
             </xsl:attribute>
-         </supHide>
-      </naryPr>
-  </xsl:template>
+			</supHide>
+		</naryPr>
+	</xsl:template>
 
-  <xsl:template name="mathrRpHook"/>
+	<xsl:template name="mathrRpHook" />
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/maths/omml2mml.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/maths/omml2mml.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/maths/omml2mml.xsl	(revision 2397)
@@ -1,1819 +1,2088 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- Beta Version 070708 -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-		xmlns="http://www.w3.org/1998/Math/MathML"
-		xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-		version="2.0"
-                exclude-result-prefixes="m w">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns="http://www.w3.org/1998/Math/MathML"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	version="2.0" exclude-result-prefixes="m w">
 	<!-- %% Global Definitions -->
 
 	<!-- Every single unicode character that is recognized by OMML as an operator -->
 	<xsl:variable name="sOperators"
-                 select="concat(      '!&#34;#&amp;()+,-./:',           ';&lt;=&gt;?@[\]^_{',           '|}~¡¦¬¯°±²³·¹¿',           '×÷̀́̂̃̄̅̆̇̈̉',           '̊̋̌̍̎̏̐̑̒̓̔̕',           '̡̛̖̗̘̙̜̝̞̟̠̚',           '̢̧̨̣̤̥̦̩̪̫̬̭',           '̴̵̶̷̸̮̯̰̱̲̳̿',           '         ‐‒–',           '—‖†‡•․‥…′″‴‼',           '⁀⁄⁎⁏⁐⁗⁡⁢⁣⁰⁴⁵',           '⁶⁷⁸⁹⁺⁻⁼⁽⁾₀₁₂',           '₃₄₅₆₇₈₉₊₋₌₍₎',           '⃒⃓⃘⃙⃚⃐⃑⃔⃕⃖⃗⃛',           '⃜⃝⃞⃟⃠⃡⃤⃥⃦⃨⃧⃩',           '⃪⅀ࡢ←↑→↓↔↕↖↗↘↙',           '↚↛↜↝↞↟↠↡↢↣↤↥',           '↦↧↨↩↪↫↬↭↮↯↰↱',           '↲↳↶↷↺↻↼↽↾↿⇀⇁',           '⇂⇃⇄⇅⇆⇇⇈⇉⇊⇋⇌⇍',           '⇎⇏⇐⇑⇒⇓⇔⇕⇖⇗⇘⇙',           '⇚⇛⇜⇝⇞⇟⇠⇡⇢⇣⇤⇥',           '⇦⇧⇨⇩⇳⇴⇵⇶⇷⇸⇹⇺',           '⇻⇼⇽⇾⇿∀∁∂∃∄∆∇',           '∈∉∊∋∌∍∏∐∑−∓∔',           '∕∖∗∘∙√∛∜∝∣∤∥',           '∦∧∨∩∪∫∬∭∮∯∰∱',           '∲∳∴∵∶∷∸∹∺∻∼∽',           '∾≀≁≂≃≄≅≆≇≈≉≊',           '≋≌≍≎≏≐≑≒≓≔≕≖',           '≗≘≙≚≛≜≝≞≟≠≡≢',           '≣≤≥≦≧≨≩≪≫≬≭≮',           '≯≰≱≲≳≴≵≶≷≸≹≺',           '≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆',           '⊇⊈⊉⊊⊋⊌⊍⊎⊏⊐⊑⊒',           '⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊝⊞',           '⊟⊠⊡⊢⊣⊥⊦⊧⊨⊩⊪⊫',           '⊬⊭⊮⊯⊰⊱⊲⊳⊴⊵⊶⊷',           '⊸⊹⊺⊻⊼⊽⋀⋁⋂⋃⋄⋅',           '⋆⋇⋈⋉⋊⋋⋌⋍⋎⋏⋐⋑',           '⋒⋓⋔⋕⋖⋗⋘⋙⋚⋛⋜⋝',           '⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩',           '⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵',           '⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌅⌆',           '⌈⌉⌊⌋⌜⌝⌞⌟⌢⌣〈〉',           '⌽⌿⎰⎱⏜⏝⏞⏟⏠│├┤',           '┬┴▁█▒■□▭▲△▴▵',           '▶▷▸▹▼▽▾▿◀◁◂◃',           '◄◅◊○◦◫◬◸◹◺◻◼',           '◽◾◿★☆❲❳⟑⟒⟓⟔⟕',           '⟖⟗⟘⟙⟚⟛⟜⟝⟞⟟⟠⟡',           '⟢⟣⟤⟥⟦⟧⟨⟩⟪⟫⟰⟱',           '⟲⟳⟴⟵⟶⟷⟸⟹⟺⟻⟼⟽',           '⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉',           '⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕',           '⤖⤗⤘⤙⤚⤛⤜⤝⤞⤟⤠⤡',           '⤢⤣⤤⤥⤦⤧⤨⤩⤪⤫⤬⤭',           '⤮⤯⤰⤱⤲⤳⤴⤵⤶⤷⤸⤹',           '⤺⤻⤼⤽⤾⤿⥀⥁⥂⥃⥄⥅',           '⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑',           '⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝',           '⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩',           '⥪⥫⥬⥭⥮⥯⥰⥱⥲⥳⥴⥵',           '⥶⥷⥸⥹⥺⥻⥼⥽⥾⥿⦀⦂',           '⦃⦄⦅⦆⦇⦈⦉⦊⦋⦌⦍⦎',           '⦏⦐⦑⦒⦓⦔⦕⦖⦗⦘⦙⦚',           '⦶⦷⦸⦹⧀⧁⧄⧅⧆⧇⧈⧎',           '⧏⧐⧑⧒⧓⧔⧕⧖⧗⧘⧙⧚',           '⧛⧟⧡⧢⧣⧤⧥⧦⧫⧴⧵⧶',           '⧷⧸⧹⧺⧻⧼⧽⧾⧿⨀⨁⨂',           '⨃⨄⨅⨆⨇⨈⨉⨊⨋⨌⨍⨎',           '⨏⨐⨑⨒⨓⨔⨕⨖⨗⨘⨙⨚',           '⨛⨜⨝⨞⨟⨠⨡⨢⨣⨤⨥⨦',           '⨧⨨⨩⨪⨫⨬⨭⨮⨯⨰⨱⨲',           '⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⨾',           '⨿⩀⩁⩂⩃⩄⩅⩆⩇⩈⩉⩊',           '⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖',           '⩗⩘⩙⩚⩛⩜⩝⩞⩟⩠⩡⩢',           '⩣⩤⩥⩦⩧⩨⩩⩪⩫⩬⩭⩮',           '⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺',           '⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆',           '⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒',           '⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞',           '⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪',           '⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶',           '⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂',           '⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎',           '⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫚',           '⫛⫝̸⫝⫞⫟⫠⫢⫣⫤⫥⫦⫧',           '⫨⫩⫪⫫⫬⫭⫮⫯⫰⫲⫳⫴',           '⫵⫶⫷⫸⫹⫺⫻⫼⫽⫾⫿⬄',           '⬆⬇⬌⬍〔〕〖〗〘〙！＆',           '（）＋，－．／：；＜＝＞',           '？＠［＼］＾＿｛｜｝')"/>
+		select="concat(      '!&#34;#&amp;()+,-./:',           ';&lt;=&gt;?@[\]^_{',           '|}~¡¦¬¯°±²³·¹¿',           '×÷̀́̂̃̄̅̆̇̈̉',           '̊̋̌̍̎̏̐̑̒̓̔̕',           '̡̛̖̗̘̙̜̝̞̟̠̚',           '̢̧̨̣̤̥̦̩̪̫̬̭',           '̴̵̶̷̸̮̯̰̱̲̳̿',           '         ‐‒–',           '—‖†‡•․‥…′″‴‼',           '⁀⁄⁎⁏⁐⁗⁡⁢⁣⁰⁴⁵',           '⁶⁷⁸⁹⁺⁻⁼⁽⁾₀₁₂',           '₃₄₅₆₇₈₉₊₋₌₍₎',           '⃒⃓⃘⃙⃚⃐⃑⃔⃕⃖⃗⃛',           '⃜⃝⃞⃟⃠⃡⃤⃥⃦⃨⃧⃩',           '⃪⅀ࡢ←↑→↓↔↕↖↗↘↙',           '↚↛↜↝↞↟↠↡↢↣↤↥',           '↦↧↨↩↪↫↬↭↮↯↰↱',           '↲↳↶↷↺↻↼↽↾↿⇀⇁',           '⇂⇃⇄⇅⇆⇇⇈⇉⇊⇋⇌⇍',           '⇎⇏⇐⇑⇒⇓⇔⇕⇖⇗⇘⇙',           '⇚⇛⇜⇝⇞⇟⇠⇡⇢⇣⇤⇥',           '⇦⇧⇨⇩⇳⇴⇵⇶⇷⇸⇹⇺',           '⇻⇼⇽⇾⇿∀∁∂∃∄∆∇',           '∈∉∊∋∌∍∏∐∑−∓∔',           '∕∖∗∘∙√∛∜∝∣∤∥',           '∦∧∨∩∪∫∬∭∮∯∰∱',           '∲∳∴∵∶∷∸∹∺∻∼∽',           '∾≀≁≂≃≄≅≆≇≈≉≊',           '≋≌≍≎≏≐≑≒≓≔≕≖',           '≗≘≙≚≛≜≝≞≟≠≡≢',           '≣≤≥≦≧≨≩≪≫≬≭≮',           '≯≰≱≲≳≴≵≶≷≸≹≺',           '≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆',           '⊇⊈⊉⊊⊋⊌⊍⊎⊏⊐⊑⊒',           '⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊝⊞',           '⊟⊠⊡⊢⊣⊥⊦⊧⊨⊩⊪⊫',           '⊬⊭⊮⊯⊰⊱⊲⊳⊴⊵⊶⊷',           '⊸⊹⊺⊻⊼⊽⋀⋁⋂⋃⋄⋅',           '⋆⋇⋈⋉⋊⋋⋌⋍⋎⋏⋐⋑',           '⋒⋓⋔⋕⋖⋗⋘⋙⋚⋛⋜⋝',           '⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩',           '⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵',           '⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌅⌆',           '⌈⌉⌊⌋⌜⌝⌞⌟⌢⌣〈〉',           '⌽⌿⎰⎱⏜⏝⏞⏟⏠│├┤',           '┬┴▁█▒■□▭▲△▴▵',           '▶▷▸▹▼▽▾▿◀◁◂◃',           '◄◅◊○◦◫◬◸◹◺◻◼',           '◽◾◿★☆❲❳⟑⟒⟓⟔⟕',           '⟖⟗⟘⟙⟚⟛⟜⟝⟞⟟⟠⟡',           '⟢⟣⟤⟥⟦⟧⟨⟩⟪⟫⟰⟱',           '⟲⟳⟴⟵⟶⟷⟸⟹⟺⟻⟼⟽',           '⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉',           '⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕',           '⤖⤗⤘⤙⤚⤛⤜⤝⤞⤟⤠⤡',           '⤢⤣⤤⤥⤦⤧⤨⤩⤪⤫⤬⤭',           '⤮⤯⤰⤱⤲⤳⤴⤵⤶⤷⤸⤹',           '⤺⤻⤼⤽⤾⤿⥀⥁⥂⥃⥄⥅',           '⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑',           '⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝',           '⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩',           '⥪⥫⥬⥭⥮⥯⥰⥱⥲⥳⥴⥵',           '⥶⥷⥸⥹⥺⥻⥼⥽⥾⥿⦀⦂',           '⦃⦄⦅⦆⦇⦈⦉⦊⦋⦌⦍⦎',           '⦏⦐⦑⦒⦓⦔⦕⦖⦗⦘⦙⦚',           '⦶⦷⦸⦹⧀⧁⧄⧅⧆⧇⧈⧎',           '⧏⧐⧑⧒⧓⧔⧕⧖⧗⧘⧙⧚',           '⧛⧟⧡⧢⧣⧤⧥⧦⧫⧴⧵⧶',           '⧷⧸⧹⧺⧻⧼⧽⧾⧿⨀⨁⨂',           '⨃⨄⨅⨆⨇⨈⨉⨊⨋⨌⨍⨎',           '⨏⨐⨑⨒⨓⨔⨕⨖⨗⨘⨙⨚',           '⨛⨜⨝⨞⨟⨠⨡⨢⨣⨤⨥⨦',           '⨧⨨⨩⨪⨫⨬⨭⨮⨯⨰⨱⨲',           '⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⨾',           '⨿⩀⩁⩂⩃⩄⩅⩆⩇⩈⩉⩊',           '⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖',           '⩗⩘⩙⩚⩛⩜⩝⩞⩟⩠⩡⩢',           '⩣⩤⩥⩦⩧⩨⩩⩪⩫⩬⩭⩮',           '⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺',           '⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆',           '⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒',           '⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞',           '⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪',           '⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶',           '⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂',           '⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎',           '⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫚',           '⫛⫝̸⫝⫞⫟⫠⫢⫣⫤⫥⫦⫧',           '⫨⫩⫪⫫⫬⫭⫮⫯⫰⫲⫳⫴',           '⫵⫶⫷⫸⫹⫺⫻⫼⫽⫾⫿⬄',           '⬆⬇⬌⬍〔〕〖〗〘〙！＆',           '（）＋，－．／：；＜＝＞',           '？＠［＼］＾＿｛｜｝')" />
 
-	  <!-- A string of '-'s repeated exactly as many times as the operators above -->
+	<!-- A string of '-'s repeated exactly as many times as the operators above -->
 	<xsl:variable name="sMinuses">
-		    <xsl:call-template name="SRepeatChar">
-			      <xsl:with-param name="cchRequired" select="string-length($sOperators)"/>
-			      <xsl:with-param name="ch" select="'-'"/>
-		    </xsl:call-template>
-	  </xsl:variable>
+		<xsl:call-template name="SRepeatChar">
+			<xsl:with-param name="cchRequired"
+				select="string-length($sOperators)" />
+			<xsl:with-param name="ch" select="'-'" />
+		</xsl:call-template>
+	</xsl:variable>
 
-	  <!-- Every single unicode character that is recognized by OMML as a number -->
-	<xsl:variable name="sNumbers" select="'0123456789'"/>
+	<!-- Every single unicode character that is recognized by OMML as a number -->
+	<xsl:variable name="sNumbers" select="'0123456789'" />
 
-	  <!-- A string of '0's repeated exactly as many times as the list of numbers above -->
+	<!-- A string of '0's repeated exactly as many times as the list of numbers 
+		above -->
 	<xsl:variable name="sZeros">
-		    <xsl:call-template name="SRepeatChar">
-			      <xsl:with-param name="cchRequired" select="string-length($sNumbers)"/>
-			      <xsl:with-param name="ch" select="'0'"/>
-		    </xsl:call-template>
-	  </xsl:variable>
+		<xsl:call-template name="SRepeatChar">
+			<xsl:with-param name="cchRequired"
+				select="string-length($sNumbers)" />
+			<xsl:with-param name="ch" select="'0'" />
+		</xsl:call-template>
+	</xsl:variable>
 
-	  <!-- %%Template: SReplace
-
-		Replace all occurences of sOrig in sInput with sReplacement
-		and return the resulting string. -->
+	<!-- %%Template: SReplace Replace all occurences of sOrig in sInput with 
+		sReplacement and return the resulting string. -->
 	<xsl:template name="SReplace">
-		    <xsl:param name="sInput"/>
-		    <xsl:param name="sOrig"/>
-		    <xsl:param name="sReplacement"/>
+		<xsl:param name="sInput" />
+		<xsl:param name="sOrig" />
+		<xsl:param name="sReplacement" />
 
-		    <xsl:choose>
-			      <xsl:when test="not(contains($sInput, $sOrig))">
-				        <xsl:value-of select="$sInput"/>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:variable name="sBefore" select="substring-before($sInput, $sOrig)"/>
-				        <xsl:variable name="sAfter" select="substring-after($sInput, $sOrig)"/>
-				        <xsl:variable name="sAfterProcessed">
-					          <xsl:call-template name="SReplace">
-						            <xsl:with-param name="sInput" select="$sAfter"/>
-						            <xsl:with-param name="sOrig" select="$sOrig"/>
-						            <xsl:with-param name="sReplacement" select="$sReplacement"/>
-					          </xsl:call-template>
-				        </xsl:variable>
+		<xsl:choose>
+			<xsl:when test="not(contains($sInput, $sOrig))">
+				<xsl:value-of select="$sInput" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="sBefore"
+					select="substring-before($sInput, $sOrig)" />
+				<xsl:variable name="sAfter"
+					select="substring-after($sInput, $sOrig)" />
+				<xsl:variable name="sAfterProcessed">
+					<xsl:call-template name="SReplace">
+						<xsl:with-param name="sInput" select="$sAfter" />
+						<xsl:with-param name="sOrig" select="$sOrig" />
+						<xsl:with-param name="sReplacement"
+							select="$sReplacement" />
+					</xsl:call-template>
+				</xsl:variable>
 
-				        <xsl:value-of select="concat($sBefore, concat($sReplacement, $sAfterProcessed))"/>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+				<xsl:value-of
+					select="concat($sBefore, concat($sReplacement, $sAfterProcessed))" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <!-- Templates -->
-	<!--
-	    <xsl:template match="/">
-	    <math>
-	    <xsl:apply-templates select="*" />
-	    </math>
-	</xsl:template>
-	-->
+	<!-- Templates -->
+	<!-- <xsl:template match="/"> <math> <xsl:apply-templates select="*" /> 
+		</math> </xsl:template> -->
 	<xsl:template match="m:borderBox">
 
 		<!-- Get Lowercase versions of properties -->
 		<xsl:variable name="sLowerCaseHideTop"
-                    select="translate(m:borderBoxPr[last()]/m:hideTop[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseHideBot"
-                    select="translate(m:borderBoxPr[last()]/m:hideBot[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseHideLeft"
-                    select="translate(m:borderBoxPr[last()]/m:hideLeft[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseHideRight"
-                    select="translate(m:borderBoxPr[last()]/m:hideRight[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseStrikeH"
-                    select="translate(m:borderBoxPr[last()]/m:strikeH[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseStrikeV"
-                    select="translate(m:borderBoxPr[last()]/m:strikeV[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseStrikeBLTR"
-                    select="translate(m:borderBoxPr[last()]/m:strikeBLTR[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseStrikeTLBR"
-                    select="translate(m:borderBoxPr[last()]/m:strikeTLBR[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="fHideTop">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseHideTop='on'">
-					          <xsl:text>1</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>0</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fHideBot">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseHideBot='on'">
-					          <xsl:text>1</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>0</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fHideLeft">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseHideLeft='on'">
-					          <xsl:text>1</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>0</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fHideRight">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseHideRight='on'">
-					          <xsl:text>1</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>0</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fStrikeH">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseStrikeH='on'">
-					          <xsl:text>1</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>0</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fStrikeV">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseStrikeV='on'">
-					          <xsl:text>1</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>0</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fStrikeBLTR">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseStrikeBLTR='on'">
-					          <xsl:text>1</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>0</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fStrikeTLBR">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseStrikeTLBR='on'">
-					          <xsl:text>1</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>0</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
+			select="translate(m:borderBoxPr[last()]/m:hideTop[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseHideBot"
+			select="translate(m:borderBoxPr[last()]/m:hideBot[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseHideLeft"
+			select="translate(m:borderBoxPr[last()]/m:hideLeft[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseHideRight"
+			select="translate(m:borderBoxPr[last()]/m:hideRight[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseStrikeH"
+			select="translate(m:borderBoxPr[last()]/m:strikeH[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseStrikeV"
+			select="translate(m:borderBoxPr[last()]/m:strikeV[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseStrikeBLTR"
+			select="translate(m:borderBoxPr[last()]/m:strikeBLTR[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseStrikeTLBR"
+			select="translate(m:borderBoxPr[last()]/m:strikeTLBR[last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="fHideTop">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseHideTop='on'">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fHideBot">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseHideBot='on'">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fHideLeft">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseHideLeft='on'">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fHideRight">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseHideRight='on'">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fStrikeH">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseStrikeH='on'">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fStrikeV">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseStrikeV='on'">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fStrikeBLTR">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseStrikeBLTR='on'">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fStrikeTLBR">
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseStrikeTLBR='on'">
+					<xsl:text>1</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>0</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-		    <menclose>
-			      <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-				        <xsl:with-param name="fHideTop" select="$fHideTop"/>
-				        <xsl:with-param name="fHideBot" select="$fHideBot"/>
-				        <xsl:with-param name="fHideLeft" select="$fHideLeft"/>
-				        <xsl:with-param name="fHideRight" select="$fHideRight"/>
-				        <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-				        <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-				        <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-				        <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-			      </xsl:call-template>
-			      <xsl:apply-templates select="m:e[1]"/>
-		    </menclose>
-	  </xsl:template>
+		<menclose>
+			<xsl:call-template
+				name="CreateMencloseNotationAttrFromBorderBoxAttr">
+				<xsl:with-param name="fHideTop" select="$fHideTop" />
+				<xsl:with-param name="fHideBot" select="$fHideBot" />
+				<xsl:with-param name="fHideLeft" select="$fHideLeft" />
+				<xsl:with-param name="fHideRight"
+					select="$fHideRight" />
+				<xsl:with-param name="fStrikeH" select="$fStrikeH" />
+				<xsl:with-param name="fStrikeV" select="$fStrikeV" />
+				<xsl:with-param name="fStrikeBLTR"
+					select="$fStrikeBLTR" />
+				<xsl:with-param name="fStrikeTLBR"
+					select="$fStrikeTLBR" />
+			</xsl:call-template>
+			<xsl:apply-templates select="m:e[1]" />
+		</menclose>
+	</xsl:template>
 
-	  <xsl:template match="*">
-		    <xsl:apply-templates select="*"/>
-	  </xsl:template>
+	<xsl:template match="*">
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-	  <xsl:template match="m:acc">
-		    <mover>
-			      <xsl:attribute name="accent">true</xsl:attribute>
-			      <mrow>
-				        <xsl:apply-templates select="m:e[1]"/>
-			      </mrow>
-			      <xsl:variable name="chAcc">
-				        <xsl:choose>
-					          <xsl:when test="not(m:accPr[last()]/m:chr)">
-						            <xsl:value-of select="'̂'"/>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <xsl:value-of select="substring(m:accPr/m:chr/@m:val,1,1)"/>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:variable>
-			      <xsl:call-template name="ParseMt">
-				        <xsl:with-param name="sToParse" select="$chAcc"/>
-				        <xsl:with-param name="scr" select="m:e[1]/*/m:rPr[last()]/m:scr/@m:val"/>
-				        <xsl:with-param name="sty" select="m:e[1]/*/m:rPr[last()]/m:sty/@m:val"/>
-				        <xsl:with-param name="nor" select="m:e[1]/*/m:rPr[last()]/m:nor/@m:val"/>
-			      </xsl:call-template>
-		    </mover>
-	  </xsl:template>
+	<xsl:template match="m:acc">
+		<mover>
+			<xsl:attribute name="accent">true</xsl:attribute>
+			<mrow>
+				<xsl:apply-templates select="m:e[1]" />
+			</mrow>
+			<xsl:variable name="chAcc">
+				<xsl:choose>
+					<xsl:when test="not(m:accPr[last()]/m:chr)">
+						<xsl:value-of select="'̂'" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of
+							select="substring(m:accPr/m:chr/@m:val,1,1)" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:call-template name="ParseMt">
+				<xsl:with-param name="sToParse" select="$chAcc" />
+				<xsl:with-param name="scr"
+					select="m:e[1]/*/m:rPr[last()]/m:scr/@m:val" />
+				<xsl:with-param name="sty"
+					select="m:e[1]/*/m:rPr[last()]/m:sty/@m:val" />
+				<xsl:with-param name="nor"
+					select="m:e[1]/*/m:rPr[last()]/m:nor/@m:val" />
+			</xsl:call-template>
+		</mover>
+	</xsl:template>
 
-	  <xsl:template match="m:sPre">
-		    <mmultiscripts>
-			      <mrow>
-				        <xsl:apply-templates select="m:e[1]"/>
-			      </mrow>
-			      <mprescripts/>
-			      <mrow>
-				        <xsl:apply-templates select="m:sub[1]"/>
-			      </mrow>
-			      <mrow>
-				        <xsl:apply-templates select="m:sup[1]"/>
-			      </mrow>
-		    </mmultiscripts>
-	  </xsl:template>
+	<xsl:template match="m:sPre">
+		<mmultiscripts>
+			<mrow>
+				<xsl:apply-templates select="m:e[1]" />
+			</mrow>
+			<mprescripts />
+			<mrow>
+				<xsl:apply-templates select="m:sub[1]" />
+			</mrow>
+			<mrow>
+				<xsl:apply-templates select="m:sup[1]" />
+			</mrow>
+		</mmultiscripts>
+	</xsl:template>
 
-	  <xsl:template match="m:m">
-		    <mtable>
-			      <xsl:call-template name="CreateMathMLMatrixAttr">
-				        <xsl:with-param name="mcJc" select="m:mPr[last()]/m:mcs/m:mc/m:mcPr[last()]/m:mcJc/@m:val"/>
-			      </xsl:call-template>
-			      <xsl:for-each select="m:mr">
-				        <mtr>
-					          <xsl:for-each select="m:e">
-						            <mtd>
-							              <xsl:apply-templates select="."/>
-						            </mtd>
-					          </xsl:for-each>
-				        </mtr>
-			      </xsl:for-each>
-		    </mtable>
-	  </xsl:template>
+	<xsl:template match="m:m">
+		<mtable>
+			<xsl:call-template name="CreateMathMLMatrixAttr">
+				<xsl:with-param name="mcJc"
+					select="m:mPr[last()]/m:mcs/m:mc/m:mcPr[last()]/m:mcJc/@m:val" />
+			</xsl:call-template>
+			<xsl:for-each select="m:mr">
+				<mtr>
+					<xsl:for-each select="m:e">
+						<mtd>
+							<xsl:apply-templates select="." />
+						</mtd>
+					</xsl:for-each>
+				</mtr>
+			</xsl:for-each>
+		</mtable>
+	</xsl:template>
 
-	  <xsl:template name="CreateMathMLMatrixAttr">
-		    <xsl:param name="mcJc"/>
-		    <xsl:variable name="sLowerCaseMcjc"
-                    select="translate($mcJc, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:choose>
-			      <xsl:when test="$sLowerCaseMcjc='left'">
-				        <xsl:attribute name="columnalign">left</xsl:attribute>
-			      </xsl:when>
-			      <xsl:when test="$sLowerCaseMcjc='right'">
-				        <xsl:attribute name="columnalign">right</xsl:attribute>
-			      </xsl:when>
-		    </xsl:choose>
-	  </xsl:template>
+	<xsl:template name="CreateMathMLMatrixAttr">
+		<xsl:param name="mcJc" />
+		<xsl:variable name="sLowerCaseMcjc"
+			select="translate($mcJc, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:choose>
+			<xsl:when test="$sLowerCaseMcjc='left'">
+				<xsl:attribute name="columnalign">left</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="$sLowerCaseMcjc='right'">
+				<xsl:attribute name="columnalign">right</xsl:attribute>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-	  <xsl:template match="m:phant">
-		    <xsl:variable name="sLowerCaseZeroWidVal"
-                    select="translate(m:phantPr[last()]/m:zeroWid[last()]/@m:val,                                                           'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                           'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseZeroAscVal"
-                    select="translate(m:phantPr[last()]/m:zeroAsc[last()]/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseZeroDescVal"
-                    select="translate(m:phantPr[last()]/m:zeroDesc[last()]/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseShowVal"
-                    select="translate(m:phantPr[last()]/m:show[last()]/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')"/>
+	<xsl:template match="m:phant">
+		<xsl:variable name="sLowerCaseZeroWidVal"
+			select="translate(m:phantPr[last()]/m:zeroWid[last()]/@m:val,                                                           'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                           'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseZeroAscVal"
+			select="translate(m:phantPr[last()]/m:zeroAsc[last()]/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseZeroDescVal"
+			select="translate(m:phantPr[last()]/m:zeroDesc[last()]/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseShowVal"
+			select="translate(m:phantPr[last()]/m:show[last()]/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')" />
 
 
-		    <!-- The following properties default to 'yes' unless the last value equals 'no' or there isn't any node for 
-         the property -->
+		<!-- The following properties default to 'yes' unless the last value equals 
+			'no' or there isn't any node for the property -->
 
 		<xsl:variable name="fZeroWid">
-			      <xsl:choose>
-				        <xsl:when test="count(m:phantPr[last()]/m:zeroWid[last()]) = 0">0</xsl:when>
-				        <xsl:when test="$sLowerCaseZeroWidVal = 'off'">0</xsl:when>
-				        <xsl:otherwise>1</xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fZeroAsc">
-			      <xsl:choose>
-				        <xsl:when test="count(m:phantPr[last()]/m:zeroAsc[last()]) = 0">0</xsl:when>
-				        <xsl:when test="$sLowerCaseZeroAscVal = 'off'">0</xsl:when>
-				        <xsl:otherwise>1</xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fZeroDesc">
-			      <xsl:choose>
-				        <xsl:when test="count(m:phantPr[last()]/m:zeroDesc[last()]) = 0">0</xsl:when>
-				        <xsl:when test="$sLowerCaseZeroDescVal = 'off'">0</xsl:when>
-				        <xsl:otherwise>1</xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
+			<xsl:choose>
+				<xsl:when
+					test="count(m:phantPr[last()]/m:zeroWid[last()]) = 0">
+					0
+				</xsl:when>
+				<xsl:when test="$sLowerCaseZeroWidVal = 'off'">
+					0
+				</xsl:when>
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fZeroAsc">
+			<xsl:choose>
+				<xsl:when
+					test="count(m:phantPr[last()]/m:zeroAsc[last()]) = 0">
+					0
+				</xsl:when>
+				<xsl:when test="$sLowerCaseZeroAscVal = 'off'">
+					0
+				</xsl:when>
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fZeroDesc">
+			<xsl:choose>
+				<xsl:when
+					test="count(m:phantPr[last()]/m:zeroDesc[last()]) = 0">
+					0
+				</xsl:when>
+				<xsl:when test="$sLowerCaseZeroDescVal = 'off'">
+					0
+				</xsl:when>
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-		    <!-- The show property defaults to 'on' unless there exists a show property and its value is 'off' -->
+		<!-- The show property defaults to 'on' unless there exists a show property 
+			and its value is 'off' -->
 
 		<xsl:variable name="fShow">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseShowVal = 'off'">0</xsl:when>
-				        <xsl:otherwise>1</xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
+			<xsl:choose>
+				<xsl:when test="$sLowerCaseShowVal = 'off'">
+					0
+				</xsl:when>
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-		    <xsl:choose>
+		<xsl:choose>
 			<!-- Show the phantom contents, therefore, just use mpadded. -->
 			<xsl:when test="$fShow = 1">
-				        <xsl:element name="mpadded">
-					          <xsl:call-template name="CreateMpaddedAttributes">
-						            <xsl:with-param name="fZeroWid" select="$fZeroWid"/>
-						            <xsl:with-param name="fZeroAsc" select="$fZeroAsc"/>
-						            <xsl:with-param name="fZeroDesc" select="$fZeroDesc"/>
-					          </xsl:call-template>
-					          <mrow>
-						            <xsl:apply-templates select="m:e"/>
-					          </mrow>
-				        </xsl:element>
-			      </xsl:when>
-			      <!-- Don't show phantom contents, but don't smash anything, therefore, just 
-           use mphantom -->
-			<xsl:when test="$fZeroWid=0 and $fZeroAsc=0 and $fZeroDesc=0">
-				        <xsl:element name="mphantom">
-					          <mrow>
-						            <xsl:apply-templates select="m:e"/>
-					          </mrow>
-				        </xsl:element>
-			      </xsl:when>
-			      <!-- Combination -->
+				<xsl:element name="mpadded">
+					<xsl:call-template name="CreateMpaddedAttributes">
+						<xsl:with-param name="fZeroWid" select="$fZeroWid" />
+						<xsl:with-param name="fZeroAsc" select="$fZeroAsc" />
+						<xsl:with-param name="fZeroDesc"
+							select="$fZeroDesc" />
+					</xsl:call-template>
+					<mrow>
+						<xsl:apply-templates select="m:e" />
+					</mrow>
+				</xsl:element>
+			</xsl:when>
+			<!-- Don't show phantom contents, but don't smash anything, therefore, 
+				just use mphantom -->
+			<xsl:when
+				test="$fZeroWid=0 and $fZeroAsc=0 and $fZeroDesc=0">
+				<xsl:element name="mphantom">
+					<mrow>
+						<xsl:apply-templates select="m:e" />
+					</mrow>
+				</xsl:element>
+			</xsl:when>
+			<!-- Combination -->
 			<xsl:otherwise>
-				        <xsl:element name="mphantom">
-					          <xsl:element name="mpadded">
-						            <xsl:call-template name="CreateMpaddedAttributes">
-							              <xsl:with-param name="fZeroWid" select="$fZeroWid"/>
-							              <xsl:with-param name="fZeroAsc" select="$fZeroAsc"/>
-							              <xsl:with-param name="fZeroDesc" select="$fZeroDesc"/>
-						            </xsl:call-template>
-						            <mrow>
-							              <xsl:apply-templates select="m:e"/>
-						            </mrow>
-					          </xsl:element>
-				        </xsl:element>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+				<xsl:element name="mphantom">
+					<xsl:element name="mpadded">
+						<xsl:call-template
+							name="CreateMpaddedAttributes">
+							<xsl:with-param name="fZeroWid" select="$fZeroWid" />
+							<xsl:with-param name="fZeroAsc" select="$fZeroAsc" />
+							<xsl:with-param name="fZeroDesc"
+								select="$fZeroDesc" />
+						</xsl:call-template>
+						<mrow>
+							<xsl:apply-templates select="m:e" />
+						</mrow>
+					</xsl:element>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <xsl:template name="CreateMpaddedAttributes">
-		    <xsl:param name="fZeroWid"/>
-		    <xsl:param name="fZeroAsc"/>
-		    <xsl:param name="fZeroDesc"/>
+	<xsl:template name="CreateMpaddedAttributes">
+		<xsl:param name="fZeroWid" />
+		<xsl:param name="fZeroAsc" />
+		<xsl:param name="fZeroDesc" />
 
-		    <xsl:if test="$fZeroWid=1">
-			      <xsl:attribute name="width">0</xsl:attribute>
-		    </xsl:if>
-		    <xsl:if test="$fZeroAsc=1">
-			      <xsl:attribute name="height">0</xsl:attribute>
-		    </xsl:if>
-		    <xsl:if test="$fZeroDesc=1">
-			      <xsl:attribute name="depth">0</xsl:attribute>
-		    </xsl:if>
-	  </xsl:template>
+		<xsl:if test="$fZeroWid=1">
+			<xsl:attribute name="width">0</xsl:attribute>
+		</xsl:if>
+		<xsl:if test="$fZeroAsc=1">
+			<xsl:attribute name="height">0</xsl:attribute>
+		</xsl:if>
+		<xsl:if test="$fZeroDesc=1">
+			<xsl:attribute name="depth">0</xsl:attribute>
+		</xsl:if>
+	</xsl:template>
 
 
 
-	  <xsl:template match="m:rad">
-		    <xsl:variable name="sLowerCaseDegHide"
-                    select="translate(m:radPr[last()]/m:degHide/@m:val,                                                              'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                              'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:choose>
-			      <xsl:when test="$sLowerCaseDegHide='on'">
-				        <msqrt>
-					          <xsl:apply-templates select="m:e[1]"/>
-				        </msqrt>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <mroot>
-					          <mrow>
-						            <xsl:apply-templates select="m:e[1]"/>
-					          </mrow>
-					          <mrow>
-						            <xsl:apply-templates select="m:deg[1]"/>
-					          </mrow>
-				        </mroot>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+	<xsl:template match="m:rad">
+		<xsl:variable name="sLowerCaseDegHide"
+			select="translate(m:radPr[last()]/m:degHide/@m:val,                                                              'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                              'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:choose>
+			<xsl:when test="$sLowerCaseDegHide='on'">
+				<msqrt>
+					<xsl:apply-templates select="m:e[1]" />
+				</msqrt>
+			</xsl:when>
+			<xsl:otherwise>
+				<mroot>
+					<mrow>
+						<xsl:apply-templates select="m:e[1]" />
+					</mrow>
+					<mrow>
+						<xsl:apply-templates select="m:deg[1]" />
+					</mrow>
+				</mroot>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <!-- %%Template match m:nary 
-		Process an n-ary. 
-		
-		Decides, based on which arguments are supplied, between
-		using an mo, msup, msub, or msubsup for the n-ary operator		
-	-->
+	<!-- %%Template match m:nary Process an n-ary. Decides, based on which arguments 
+		are supplied, between using an mo, msup, msub, or msubsup for the n-ary operator -->
 	<xsl:template match="m:nary">
-		    <xsl:variable name="sLowerCaseSubHide">
-			      <xsl:choose>
-				        <xsl:when test="count(m:naryPr[last()]/m:subHide) = 0">
-					          <xsl:text>off</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:value-of select="translate(m:naryPr[last()]/m:subHide/@m:val,                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                     'abcdefghijklmnopqrstuvwxyz')"/>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="sLowerCaseSupHide">
-			      <xsl:choose>
-				        <xsl:when test="count(m:naryPr[last()]/m:supHide) = 0">
-					          <xsl:text>off</xsl:text>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:value-of select="translate(m:naryPr[last()]/m:supHide/@m:val,                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                     'abcdefghijklmnopqrstuvwxyz')"/>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="sLowerCaseLimLoc">
-			      <xsl:value-of select="translate(m:naryPr[last()]/m:limLoc/@m:val,                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                     'abcdefghijklmnopqrstuvwxyz')"/>
-		    </xsl:variable>
-		    <xsl:variable name="fLimLocSubSup">
-			      <xsl:choose>
-				        <xsl:when test="count(m:naryPr[last()]/m:limLoc)=0 or $sLowerCaseLimLoc='subsup'">1</xsl:when>
-				        <xsl:otherwise>0</xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:choose>
-			      <xsl:when test="not($sLowerCaseSupHide='off') and                     not($sLowerCaseSubHide='off')">
-				        <mo>
-					          <xsl:choose>
-						            <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or                                m:naryPr[last()]/m:chr/@m:val=''">
-							              <xsl:text>&#x222b;</xsl:text>
-						            </xsl:when>
-						            <xsl:otherwise>
-							              <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val"/>
-						            </xsl:otherwise>
-					          </xsl:choose>
-				        </mo>
-			      </xsl:when>
-			      <xsl:when test="not($sLowerCaseSubHide='off')">
-				        <xsl:choose>
-					          <xsl:when test="$fLimLocSubSup=1">
-						            <msup>
-							              <mo>
-								                <xsl:choose>
-									                  <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
-										                    <xsl:text>&#x222b;</xsl:text>
-									                  </xsl:when>
-									                  <xsl:otherwise>
-										                    <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val"/>
-									                  </xsl:otherwise>
-								                </xsl:choose>
-							              </mo>
-							              <mrow>
-								                <xsl:apply-templates select="m:sup[1]"/>
-							              </mrow>
-						            </msup>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <mover>
-							              <mo>
-								                <xsl:choose>
-									                  <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
-										                    <xsl:text>&#x222b;</xsl:text>
-									                  </xsl:when>
-									                  <xsl:otherwise>
-										                    <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val"/>
-									                  </xsl:otherwise>
-								                </xsl:choose>
-							              </mo>
-							              <mrow>
-								                <xsl:apply-templates select="m:sup[1]"/>
-							              </mrow>
-						            </mover>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:when>
-			      <xsl:when test="not($sLowerCaseSupHide='off')">
-				        <xsl:choose>
-					          <xsl:when test="$fLimLocSubSup=1">
-						            <msub>
-							              <mo>
-								                <xsl:choose>
-									                  <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
-										                    <xsl:text>&#x222b;</xsl:text>
-									                  </xsl:when>
-									                  <xsl:otherwise>
-										                    <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val"/>
-									                  </xsl:otherwise>
-								                </xsl:choose>
-							              </mo>
-							              <mrow>
-								                <xsl:apply-templates select="m:sub[1]"/>
-							              </mrow>
-						            </msub>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <munder>
-							              <mo>
-								                <xsl:choose>
-									                  <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or                            m:naryPr[last()]/m:chr/@m:val=''">
-										                    <xsl:text>&#x222b;</xsl:text>
-									                  </xsl:when>
-									                  <xsl:otherwise>
-										                    <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val"/>
-									                  </xsl:otherwise>
-								                </xsl:choose>
-							              </mo>
-							              <mrow>
-								                <xsl:apply-templates select="m:sub[1]"/>
-							              </mrow>
-						            </munder>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:choose>
-					          <xsl:when test="$fLimLocSubSup=1">
-						            <msubsup>
-							              <mo>
-								                <xsl:choose>
-									                  <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
-										                    <xsl:text>&#x222b;</xsl:text>
-									                  </xsl:when>
-									                  <xsl:otherwise>
-										                    <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val"/>
-									                  </xsl:otherwise>
-								                </xsl:choose>
-							              </mo>
-							              <mrow>
-								                <xsl:apply-templates select="m:sub[1]"/>
-							              </mrow>
-							              <mrow>
-								                <xsl:apply-templates select="m:sup[1]"/>
-							              </mrow>
-						            </msubsup>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <munderover>
-							              <mo>
-								                <xsl:choose>
-									                  <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
-										                    <xsl:text>&#x222b;</xsl:text>
-									                  </xsl:when>
-									                  <xsl:otherwise>
-										                    <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val"/>
-									                  </xsl:otherwise>
-								                </xsl:choose>
-							              </mo>
-							              <mrow>
-								                <xsl:apply-templates select="m:sub[1]"/>
-							              </mrow>
-							              <mrow>
-								                <xsl:apply-templates select="m:sup[1]"/>
-							              </mrow>
-						            </munderover>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:otherwise>
-		    </xsl:choose>
-		    <mrow>
-			      <xsl:apply-templates select="m:e[1]"/>
-		    </mrow>
-	  </xsl:template>
+		<xsl:variable name="sLowerCaseSubHide">
+			<xsl:choose>
+				<xsl:when test="count(m:naryPr[last()]/m:subHide) = 0">
+					<xsl:text>off</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of
+						select="translate(m:naryPr[last()]/m:subHide/@m:val,                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                     'abcdefghijklmnopqrstuvwxyz')" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="sLowerCaseSupHide">
+			<xsl:choose>
+				<xsl:when test="count(m:naryPr[last()]/m:supHide) = 0">
+					<xsl:text>off</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of
+						select="translate(m:naryPr[last()]/m:supHide/@m:val,                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                     'abcdefghijklmnopqrstuvwxyz')" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="sLowerCaseLimLoc">
+			<xsl:value-of
+				select="translate(m:naryPr[last()]/m:limLoc/@m:val,                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                     'abcdefghijklmnopqrstuvwxyz')" />
+		</xsl:variable>
+		<xsl:variable name="fLimLocSubSup">
+			<xsl:choose>
+				<xsl:when
+					test="count(m:naryPr[last()]/m:limLoc)=0 or $sLowerCaseLimLoc='subsup'">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="not($sLowerCaseSupHide='off') and                     not($sLowerCaseSubHide='off')">
+				<mo>
+					<xsl:choose>
+						<xsl:when
+							test="not(m:naryPr[last()]/m:chr/@m:val) or                                m:naryPr[last()]/m:chr/@m:val=''">
+							<xsl:text>&#x222b;</xsl:text>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</mo>
+			</xsl:when>
+			<xsl:when test="not($sLowerCaseSubHide='off')">
+				<xsl:choose>
+					<xsl:when test="$fLimLocSubSup=1">
+						<msup>
+							<mo>
+								<xsl:choose>
+									<xsl:when
+										test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
+										<xsl:text>&#x222b;</xsl:text>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="m:naryPr[last()]/m:chr/@m:val" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</mo>
+							<mrow>
+								<xsl:apply-templates select="m:sup[1]" />
+							</mrow>
+						</msup>
+					</xsl:when>
+					<xsl:otherwise>
+						<mover>
+							<mo>
+								<xsl:choose>
+									<xsl:when
+										test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
+										<xsl:text>&#x222b;</xsl:text>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="m:naryPr[last()]/m:chr/@m:val" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</mo>
+							<mrow>
+								<xsl:apply-templates select="m:sup[1]" />
+							</mrow>
+						</mover>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="not($sLowerCaseSupHide='off')">
+				<xsl:choose>
+					<xsl:when test="$fLimLocSubSup=1">
+						<msub>
+							<mo>
+								<xsl:choose>
+									<xsl:when
+										test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
+										<xsl:text>&#x222b;</xsl:text>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="m:naryPr[last()]/m:chr/@m:val" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</mo>
+							<mrow>
+								<xsl:apply-templates select="m:sub[1]" />
+							</mrow>
+						</msub>
+					</xsl:when>
+					<xsl:otherwise>
+						<munder>
+							<mo>
+								<xsl:choose>
+									<xsl:when
+										test="not(m:naryPr[last()]/m:chr/@m:val) or                            m:naryPr[last()]/m:chr/@m:val=''">
+										<xsl:text>&#x222b;</xsl:text>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="m:naryPr[last()]/m:chr/@m:val" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</mo>
+							<mrow>
+								<xsl:apply-templates select="m:sub[1]" />
+							</mrow>
+						</munder>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$fLimLocSubSup=1">
+						<msubsup>
+							<mo>
+								<xsl:choose>
+									<xsl:when
+										test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
+										<xsl:text>&#x222b;</xsl:text>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="m:naryPr[last()]/m:chr/@m:val" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</mo>
+							<mrow>
+								<xsl:apply-templates select="m:sub[1]" />
+							</mrow>
+							<mrow>
+								<xsl:apply-templates select="m:sup[1]" />
+							</mrow>
+						</msubsup>
+					</xsl:when>
+					<xsl:otherwise>
+						<munderover>
+							<mo>
+								<xsl:choose>
+									<xsl:when
+										test="not(m:naryPr[last()]/m:chr/@m:val) or                                            m:naryPr[last()]/m:chr/@m:val=''">
+										<xsl:text>&#x222b;</xsl:text>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="m:naryPr[last()]/m:chr/@m:val" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</mo>
+							<mrow>
+								<xsl:apply-templates select="m:sub[1]" />
+							</mrow>
+							<mrow>
+								<xsl:apply-templates select="m:sup[1]" />
+							</mrow>
+						</munderover>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+		<mrow>
+			<xsl:apply-templates select="m:e[1]" />
+		</mrow>
+	</xsl:template>
 
-	  <xsl:template match="m:limLow">
-		    <munder>
-			      <mrow>
-				        <xsl:apply-templates select="m:e[1]"/>
-			      </mrow>
-			      <mrow>
-				        <xsl:apply-templates select="m:lim[1]"/>
-			      </mrow>
-		    </munder>
-	  </xsl:template>
+	<xsl:template match="m:limLow">
+		<munder>
+			<mrow>
+				<xsl:apply-templates select="m:e[1]" />
+			</mrow>
+			<mrow>
+				<xsl:apply-templates select="m:lim[1]" />
+			</mrow>
+		</munder>
+	</xsl:template>
 
-	  <xsl:template match="m:limUpp">
-		    <mover>
-			      <mrow>
-				        <xsl:apply-templates select="m:e[1]"/>
-			      </mrow>
-			      <mrow>
-				        <xsl:apply-templates select="m:lim[1]"/>
-			      </mrow>
-		    </mover>
-	  </xsl:template>
+	<xsl:template match="m:limUpp">
+		<mover>
+			<mrow>
+				<xsl:apply-templates select="m:e[1]" />
+			</mrow>
+			<mrow>
+				<xsl:apply-templates select="m:lim[1]" />
+			</mrow>
+		</mover>
+	</xsl:template>
 
-	  <xsl:template match="m:sSub">
-		    <msub>
-			      <mrow>
-				        <xsl:apply-templates select="m:e[1]"/>
-			      </mrow>
-			      <mrow>
-				        <xsl:apply-templates select="m:sub[1]"/>
-			      </mrow>
-		    </msub>
-	  </xsl:template>
+	<xsl:template match="m:sSub">
+		<msub>
+			<mrow>
+				<xsl:apply-templates select="m:e[1]" />
+			</mrow>
+			<mrow>
+				<xsl:apply-templates select="m:sub[1]" />
+			</mrow>
+		</msub>
+	</xsl:template>
 
-	  <xsl:template match="m:sSup">
-		    <msup>
-			      <mrow>
-				        <xsl:apply-templates select="m:e[1]"/>
-			      </mrow>
-			      <mrow>
-				        <xsl:apply-templates select="m:sup[1]"/>
-			      </mrow>
-		    </msup>
-	  </xsl:template>
+	<xsl:template match="m:sSup">
+		<msup>
+			<mrow>
+				<xsl:apply-templates select="m:e[1]" />
+			</mrow>
+			<mrow>
+				<xsl:apply-templates select="m:sup[1]" />
+			</mrow>
+		</msup>
+	</xsl:template>
 
-	  <xsl:template match="m:sSubSup">
-		    <msubsup>
-			      <mrow>
-				        <xsl:apply-templates select="m:e[1]"/>
-			      </mrow>
-			      <mrow>
-				        <xsl:apply-templates select="m:sub[1]"/>
-			      </mrow>
-			      <mrow>
-				        <xsl:apply-templates select="m:sup[1]"/>
-			      </mrow>
-		    </msubsup>
-	  </xsl:template>
+	<xsl:template match="m:sSubSup">
+		<msubsup>
+			<mrow>
+				<xsl:apply-templates select="m:e[1]" />
+			</mrow>
+			<mrow>
+				<xsl:apply-templates select="m:sub[1]" />
+			</mrow>
+			<mrow>
+				<xsl:apply-templates select="m:sup[1]" />
+			</mrow>
+		</msubsup>
+	</xsl:template>
 
-	  <xsl:template match="m:groupChr">
-		    <xsl:variable name="ndLastGroupChrPr" select="m:groupChrPr[last()]"/>
-		    <xsl:variable name="sLowerCasePos"
-                    select="translate($ndLastGroupChrPr/m:pos/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')"/>
+	<xsl:template match="m:groupChr">
+		<xsl:variable name="ndLastGroupChrPr"
+			select="m:groupChrPr[last()]" />
+		<xsl:variable name="sLowerCasePos"
+			select="translate($ndLastGroupChrPr/m:pos/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')" />
 
-		    <xsl:variable name="sLowerCaseVertJc"
-                    select="translate($ndLastGroupChrPr/m:vertJc/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="ndLastChr" select="$ndLastGroupChrPr/m:chr"/>
+		<xsl:variable name="sLowerCaseVertJc"
+			select="translate($ndLastGroupChrPr/m:vertJc/@m:val,                                                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                         'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="ndLastChr"
+			select="$ndLastGroupChrPr/m:chr" />
 
-		    <xsl:variable name="chr">
-			      <xsl:choose>
-				        <xsl:when test="$ndLastChr and (not($ndLastChr/@m:val) or string-length($ndLastChr/@m:val) = 0)"/>
-				        <xsl:when test="string-length($ndLastChr/@m:val) &gt;= 1">
-					          <xsl:value-of select="substring($ndLastChr/@m:val,1,1)"/>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:text>&amp;#x023DF;</xsl:text>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:choose>
-			      <xsl:when test="$sLowerCasePos = 'top'">
-				        <xsl:choose>
-					          <xsl:when test="$sLowerCaseVertJc = 'bot'">
-						            <mover accent="false">
-							              <mrow>
-								                <xsl:apply-templates select="m:e[1]"/>
-							              </mrow>
-							              <mo>
-								                <xsl:value-of disable-output-escaping="yes" select="$chr"/>
-							              </mo>
-						            </mover>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <munder accentunder="false">
-							              <mo>
-								                <xsl:value-of disable-output-escaping="yes" select="$chr"/>
-							              </mo>
-							              <mrow>
-								                <xsl:apply-templates select="m:e[1]"/>
-							              </mrow>
-						            </munder>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:choose>
-					          <xsl:when test="$sLowerCaseVertJc = 'bot'">
-						            <mover accent="false">
-							              <mo>
-								                <xsl:value-of disable-output-escaping="yes" select="$chr"/>
-							              </mo>
-							              <mrow>
-								                <xsl:apply-templates select="m:e[1]"/>
-							              </mrow>
-						            </mover>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <munder accentunder="false">
-							              <mrow>
-								                <xsl:apply-templates select="m:e[1]"/>
-							              </mrow>
-							              <mo>
-								                <xsl:value-of disable-output-escaping="yes" select="$chr"/>
-							              </mo>
-						            </munder>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+		<xsl:variable name="chr">
+			<xsl:choose>
+				<xsl:when
+					test="$ndLastChr and (not($ndLastChr/@m:val) or string-length($ndLastChr/@m:val) = 0)" />
+				<xsl:when test="string-length($ndLastChr/@m:val) &gt;= 1">
+					<xsl:value-of
+						select="substring($ndLastChr/@m:val,1,1)" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>&amp;#x023DF;</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$sLowerCasePos = 'top'">
+				<xsl:choose>
+					<xsl:when test="$sLowerCaseVertJc = 'bot'">
+						<mover accent="false">
+							<mrow>
+								<xsl:apply-templates select="m:e[1]" />
+							</mrow>
+							<mo>
+								<xsl:value-of disable-output-escaping="yes"
+									select="$chr" />
+							</mo>
+						</mover>
+					</xsl:when>
+					<xsl:otherwise>
+						<munder accentunder="false">
+							<mo>
+								<xsl:value-of disable-output-escaping="yes"
+									select="$chr" />
+							</mo>
+							<mrow>
+								<xsl:apply-templates select="m:e[1]" />
+							</mrow>
+						</munder>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$sLowerCaseVertJc = 'bot'">
+						<mover accent="false">
+							<mo>
+								<xsl:value-of disable-output-escaping="yes"
+									select="$chr" />
+							</mo>
+							<mrow>
+								<xsl:apply-templates select="m:e[1]" />
+							</mrow>
+						</mover>
+					</xsl:when>
+					<xsl:otherwise>
+						<munder accentunder="false">
+							<mrow>
+								<xsl:apply-templates select="m:e[1]" />
+							</mrow>
+							<mo>
+								<xsl:value-of disable-output-escaping="yes"
+									select="$chr" />
+							</mo>
+						</munder>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <xsl:template name="fName">
-		    <xsl:for-each select="m:fName/*">
-			      <xsl:apply-templates select="."/>
-		    </xsl:for-each>
-	  </xsl:template>
+	<xsl:template name="fName">
+		<xsl:for-each select="m:fName/*">
+			<xsl:apply-templates select="." />
+		</xsl:for-each>
+	</xsl:template>
 
-	  <xsl:template match="m:func">
-		    <mrow>
-			      <mrow>
-				        <xsl:call-template name="fName"/>
-			      </mrow>
-			      <mo>⁡</mo>
-			      <mrow>
-				        <xsl:apply-templates select="m:e"/>
-			      </mrow>
-		    </mrow>
-	  </xsl:template>
+	<xsl:template match="m:func">
+		<mrow>
+			<mrow>
+				<xsl:call-template name="fName" />
+			</mrow>
+			<mo>⁡</mo>
+			<mrow>
+				<xsl:apply-templates select="m:e" />
+			</mrow>
+		</mrow>
+	</xsl:template>
 
-	  <!-- %%Template: match m:f 
-		
-		m:f maps directly to mfrac. 
-	-->
+	<!-- %%Template: match m:f m:f maps directly to mfrac. -->
 	<xsl:template match="m:f">
-		    <xsl:variable name="sLowerCaseType"
-                    select="translate(m:fPr[last()]/m:type/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:choose>
-			      <xsl:when test="$sLowerCaseType='lin'">
-				        <mrow>
-					          <mrow>
-						            <xsl:apply-templates select="m:num[1]"/>
-					          </mrow>
-					          <mo>/</mo>
-					          <mrow>
-						            <xsl:apply-templates select="m:den[1]"/>
-					          </mrow>
-				        </mrow>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <mfrac>
-					          <xsl:call-template name="CreateMathMLFracProp">
-						            <xsl:with-param name="type" select="$sLowerCaseType"/>
-					          </xsl:call-template>
-					          <mrow>
-						            <xsl:apply-templates select="m:num[1]"/>
-					          </mrow>
-					          <mrow>
-						            <xsl:apply-templates select="m:den[1]"/>
-					          </mrow>
-				        </mfrac>
-			      </xsl:otherwise>
-		    </xsl:choose>
+		<xsl:variable name="sLowerCaseType"
+			select="translate(m:fPr[last()]/m:type/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:choose>
+			<xsl:when test="$sLowerCaseType='lin'">
+				<mrow>
+					<mrow>
+						<xsl:apply-templates select="m:num[1]" />
+					</mrow>
+					<mo>/</mo>
+					<mrow>
+						<xsl:apply-templates select="m:den[1]" />
+					</mrow>
+				</mrow>
+			</xsl:when>
+			<xsl:otherwise>
+				<mfrac>
+					<xsl:call-template name="CreateMathMLFracProp">
+						<xsl:with-param name="type"
+							select="$sLowerCaseType" />
+					</xsl:call-template>
+					<mrow>
+						<xsl:apply-templates select="m:num[1]" />
+					</mrow>
+					<mrow>
+						<xsl:apply-templates select="m:den[1]" />
+					</mrow>
+				</mfrac>
+			</xsl:otherwise>
+		</xsl:choose>
 
-	  </xsl:template>
+	</xsl:template>
 
 
-	  <!-- %%Template: CreateMathMLFracProp 
-		
-			Make fraction properties based on supplied parameters.
-			OMML differentiates between a linear fraction and a skewed
-			one. For MathML, we write both as bevelled.
-	-->
+	<!-- %%Template: CreateMathMLFracProp Make fraction properties based on 
+		supplied parameters. OMML differentiates between a linear fraction and a 
+		skewed one. For MathML, we write both as bevelled. -->
 	<xsl:template name="CreateMathMLFracProp">
-		    <xsl:param name="type"/>
-		    <xsl:variable name="sLowerCaseType"
-                    select="translate($type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
+		<xsl:param name="type" />
+		<xsl:variable name="sLowerCaseType"
+			select="translate($type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" />
 
-		    <xsl:if test="$sLowerCaseType='skw' or $sLowerCaseType='lin'">
-			      <xsl:attribute name="bevelled">true</xsl:attribute>
-		    </xsl:if>
-		    <xsl:if test="$sLowerCaseType='nobar'">
-			      <xsl:attribute name="linethickness">0pt</xsl:attribute>
-		    </xsl:if>
-		    <xsl:choose>
-			      <xsl:when test="sLowerCaseNumJc='right'">
-				        <xsl:attribute name="numalign">right</xsl:attribute>
-			      </xsl:when>
-			      <xsl:when test="sLowerCaseNumJc='left'">
-				        <xsl:attribute name="numalign">left</xsl:attribute>
-			      </xsl:when>
-		    </xsl:choose>
-		    <xsl:choose>
-			      <xsl:when test="sLowerCaseDenJc='right'">
-				        <xsl:attribute name="numalign">right</xsl:attribute>
-			      </xsl:when>
-			      <xsl:when test="sLowerCaseDenJc='left'">
-				        <xsl:attribute name="numalign">left</xsl:attribute>
-			      </xsl:when>
-		    </xsl:choose>
-	  </xsl:template>
+		<xsl:if test="$sLowerCaseType='skw' or $sLowerCaseType='lin'">
+			<xsl:attribute name="bevelled">true</xsl:attribute>
+		</xsl:if>
+		<xsl:if test="$sLowerCaseType='nobar'">
+			<xsl:attribute name="linethickness">0pt</xsl:attribute>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="sLowerCaseNumJc='right'">
+				<xsl:attribute name="numalign">right</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="sLowerCaseNumJc='left'">
+				<xsl:attribute name="numalign">left</xsl:attribute>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="sLowerCaseDenJc='right'">
+				<xsl:attribute name="numalign">right</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="sLowerCaseDenJc='left'">
+				<xsl:attribute name="numalign">left</xsl:attribute>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-	  <!-- %%Template: match m:e | m:den | m:num | m:lim | m:sup | m:sub 
-		
-		These element delinate parts of an expression (like the numerator).  -->
-	<xsl:template match="m:e | m:den | m:num | m:lim | m:sup | m:sub">
-		    <xsl:choose>
+	<!-- %%Template: match m:e | m:den | m:num | m:lim | m:sup | m:sub These 
+		element delinate parts of an expression (like the numerator). -->
+	<xsl:template
+		match="m:e | m:den | m:num | m:lim | m:sup | m:sub">
+		<xsl:choose>
 
 			<!-- If there is no scriptLevel specified, just call through -->
 			<xsl:when test="not(m:argPr[last()]/m:scrLvl/@m:val)">
-				        <xsl:apply-templates select="*"/>
-			      </xsl:when>
+				<xsl:apply-templates select="*" />
+			</xsl:when>
 
-			      <!-- Otherwise, create an mstyle and set the script level -->
+			<!-- Otherwise, create an mstyle and set the script level -->
 			<xsl:otherwise>
-				        <mstyle>
-					          <xsl:attribute name="scriptlevel">
-						            <xsl:value-of select="m:argPr[last()]/m:scrLvl/@m:val"/>
+				<mstyle>
+					<xsl:attribute name="scriptlevel">
+						            <xsl:value-of
+						select="m:argPr[last()]/m:scrLvl/@m:val" />
 					          </xsl:attribute>
-					          <xsl:apply-templates select="*"/>
-				        </mstyle>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+					<xsl:apply-templates select="*" />
+				</mstyle>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <xsl:template match="m:bar">
-		    <xsl:variable name="sLowerCasePos"
-                    select="translate(m:barPr/m:pos/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                           'abcdefghijklmnopqrstuvwxyz')"/>
+	<xsl:template match="m:bar">
+		<xsl:variable name="sLowerCasePos"
+			select="translate(m:barPr/m:pos/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                           'abcdefghijklmnopqrstuvwxyz')" />
 
-		    <xsl:variable name="fTop">
+		<xsl:variable name="fTop">
 
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCasePos='top'">1</xsl:when>
-				        <xsl:otherwise>0</xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:choose>
-			      <xsl:when test="$fTop=1">
-				        <mover>
-					          <mrow>
-						            <xsl:apply-templates select="m:e[1]"/>
-					          </mrow>
-					          <mo>
-						            <xsl:text>&#x000AF;</xsl:text>
-					          </mo>
-				        </mover>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <munder>
-					          <mrow>
-						            <xsl:apply-templates select="m:e[1]"/>
-					          </mrow>
-					          <mo>
-						            <xsl:text>&#x00332;</xsl:text>
-					          </mo>
-				        </munder>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+			<xsl:choose>
+				<xsl:when test="$sLowerCasePos='top'">
+					1
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$fTop=1">
+				<mover>
+					<mrow>
+						<xsl:apply-templates select="m:e[1]" />
+					</mrow>
+					<mo>
+						<xsl:text>&#x000AF;</xsl:text>
+					</mo>
+				</mover>
+			</xsl:when>
+			<xsl:otherwise>
+				<munder>
+					<mrow>
+						<xsl:apply-templates select="m:e[1]" />
+					</mrow>
+					<mo>
+						<xsl:text>&#x00332;</xsl:text>
+					</mo>
+				</munder>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <!-- %%Template match m:d
-
-		Process a delimiter. 
-	-->
+	<!-- %%Template match m:d Process a delimiter. -->
 	<xsl:template match="m:d">
-		    <mfenced>
+		<mfenced>
 			<!-- open: default is '(' for both OMML and MathML -->
-			<xsl:if test="m:dPr[1]/m:begChr/@m:val and not(m:dPr[1]/m:begChr/@m:val ='(')">
-				        <xsl:attribute name="open">
-					          <xsl:value-of select="m:dPr[1]/m:begChr/@m:val"/>
+			<xsl:if
+				test="m:dPr[1]/m:begChr/@m:val and not(m:dPr[1]/m:begChr/@m:val ='(')">
+				<xsl:attribute name="open">
+					          <xsl:value-of
+					select="m:dPr[1]/m:begChr/@m:val" />
 				        </xsl:attribute>
-			      </xsl:if>
+			</xsl:if>
 
-			      <!-- close: default is ')' for both OMML and MathML -->
-			<xsl:if test="m:dPr[1]/m:endChr/@m:val and not(m:dPr[1]/m:endChr/@m:val =')')">
-				        <xsl:attribute name="close">
-					          <xsl:value-of select="m:dPr[1]/m:endChr/@m:val"/>
+			<!-- close: default is ')' for both OMML and MathML -->
+			<xsl:if
+				test="m:dPr[1]/m:endChr/@m:val and not(m:dPr[1]/m:endChr/@m:val =')')">
+				<xsl:attribute name="close">
+					          <xsl:value-of
+					select="m:dPr[1]/m:endChr/@m:val" />
 				        </xsl:attribute>
-			      </xsl:if>
+			</xsl:if>
 
-			      <!-- separator: the default is ',' for MathML, and '|' for OMML -->
+			<!-- separator: the default is ',' for MathML, and '|' for OMML -->
 			<xsl:choose>
 				<!-- Matches MathML default. Write nothing -->
-				<xsl:when test="m:dPr[1]/m:sepChr/@m:val = ','"/>
+				<xsl:when test="m:dPr[1]/m:sepChr/@m:val = ','" />
 
-				        <!-- OMML default: | -->
+				<!-- OMML default: | -->
 				<xsl:when test="not(m:dPr[1]/m:sepChr/@m:val)">
-					          <xsl:attribute name="separators">
-						            <xsl:value-of select="'|'"/>
+					<xsl:attribute name="separators">
+						            <xsl:value-of select="'|'" />
 					          </xsl:attribute>
-				        </xsl:when>
+				</xsl:when>
 
-				        <xsl:otherwise>
-					          <xsl:attribute name="separators">
-						            <xsl:value-of select="m:dPr[1]/m:sepChr/@m:val"/>
+				<xsl:otherwise>
+					<xsl:attribute name="separators">
+						            <xsl:value-of
+						select="m:dPr[1]/m:sepChr/@m:val" />
 					          </xsl:attribute>
-				        </xsl:otherwise>
-			      </xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
 
-			      <!-- now write all the children. Put each one into an mrow
-			just in case it produces multiple runs, etc -->
+			<!-- now write all the children. Put each one into an mrow just in case 
+				it produces multiple runs, etc -->
 			<xsl:for-each select="m:e">
-				        <mrow>
-					          <xsl:apply-templates select="."/>
-				        </mrow>
-			      </xsl:for-each>
-		    </mfenced>
-	  </xsl:template>
+				<mrow>
+					<xsl:apply-templates select="." />
+				</mrow>
+			</xsl:for-each>
+		</mfenced>
+	</xsl:template>
 
-	  <xsl:template match="m:r">
-		    <xsl:variable name="sLowerCaseNor"
-                    select="translate(child::m:rPr[last()]/m:nor/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                           'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:variable name="sLowerCaseLit"
-                    select="translate(child::m:rPr[child::m:lit][last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                           'abcdefghijklmnopqrstuvwxyz')"/>
+	<xsl:template match="m:r">
+		<xsl:variable name="sLowerCaseNor"
+			select="translate(child::m:rPr[last()]/m:nor/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                           'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:variable name="sLowerCaseLit"
+			select="translate(child::m:rPr[child::m:lit][last()]/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                                           'abcdefghijklmnopqrstuvwxyz')" />
 
-		    <xsl:variable name="fNor">
-			      <xsl:choose>
-				        <xsl:when test="$sLowerCaseNor='off' or count(child::m:rPr[last()]/m:nor) = 0">0</xsl:when>
-				        <xsl:otherwise>1</xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
-		    <xsl:variable name="fLit">
-			      <xsl:choose>
-				        <xsl:when test="not(child::m:rPr[child::m:lit][last()]) or $sLowerCaseLit='off'">0</xsl:when>
-				        <xsl:otherwise>1</xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:variable>
+		<xsl:variable name="fNor">
+			<xsl:choose>
+				<xsl:when
+					test="$sLowerCaseNor='off' or count(child::m:rPr[last()]/m:nor) = 0">
+					0
+				</xsl:when>
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="fLit">
+			<xsl:choose>
+				<xsl:when
+					test="not(child::m:rPr[child::m:lit][last()]) or $sLowerCaseLit='off'">
+					0
+				</xsl:when>
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-		    <xsl:choose>
-			      <xsl:when test="$fNor=1">
-				        <xsl:choose>
-					          <xsl:when test="$fLit=1">
-						            <maction actiontype="lit">
-							              <mtext>
-									<xsl:call-template name="checkDirectFormatting"/>
-								                <xsl:value-of select=".//m:t"/>
-							              </mtext>
-						            </maction>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <mtext>
-									<xsl:call-template name="checkDirectFormatting"/>
-							              <xsl:value-of select=".//m:t"/>
-						            </mtext>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:choose>
-					          <xsl:when test="$fLit=1">
-						            <maction actiontype="lit">
-							              <xsl:for-each select=".//m:t">
-								                <xsl:call-template name="ParseMt">
-									                  <xsl:with-param name="sToParse" select="text()"/>
-									                  <xsl:with-param name="scr" select="../m:rPr[last()]/m:scr/@m:val"/>
-									                  <xsl:with-param name="sty" select="../m:rPr[last()]/m:sty/@m:val"/>
-									                  <xsl:with-param name="nor" select="../m:rPr[last()]/m:nor/@m:val"/>
-								                </xsl:call-template>
-							              </xsl:for-each>
-						            </maction>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <xsl:for-each select=".//m:t">
-							              <xsl:call-template name="ParseMt">
-								                <xsl:with-param name="sToParse" select="text()"/>
-								                <xsl:with-param name="scr" select="../m:rPr[last()]/m:scr/@m:val"/>
-								                <xsl:with-param name="sty" select="../m:rPr[last()]/m:sty/@m:val"/>
-								                <xsl:with-param name="nor" select="../m:rPr[last()]/m:nor/@m:val"/>
-							              </xsl:call-template>
-						            </xsl:for-each>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+		<xsl:choose>
+			<xsl:when test="$fNor=1">
+				<xsl:choose>
+					<xsl:when test="$fLit=1">
+						<maction actiontype="lit">
+							<mtext>
+								<xsl:call-template
+									name="checkDirectFormatting" />
+								<xsl:value-of select=".//m:t" />
+							</mtext>
+						</maction>
+					</xsl:when>
+					<xsl:otherwise>
+						<mtext>
+							<xsl:call-template name="checkDirectFormatting" />
+							<xsl:value-of select=".//m:t" />
+						</mtext>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="$fLit=1">
+						<maction actiontype="lit">
+							<xsl:for-each select=".//m:t">
+								<xsl:call-template name="ParseMt">
+									<xsl:with-param name="sToParse" select="text()" />
+									<xsl:with-param name="scr"
+										select="../m:rPr[last()]/m:scr/@m:val" />
+									<xsl:with-param name="sty"
+										select="../m:rPr[last()]/m:sty/@m:val" />
+									<xsl:with-param name="nor"
+										select="../m:rPr[last()]/m:nor/@m:val" />
+								</xsl:call-template>
+							</xsl:for-each>
+						</maction>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:for-each select=".//m:t">
+							<xsl:call-template name="ParseMt">
+								<xsl:with-param name="sToParse" select="text()" />
+								<xsl:with-param name="scr"
+									select="../m:rPr[last()]/m:scr/@m:val" />
+								<xsl:with-param name="sty"
+									select="../m:rPr[last()]/m:sty/@m:val" />
+								<xsl:with-param name="nor"
+									select="../m:rPr[last()]/m:nor/@m:val" />
+							</xsl:call-template>
+						</xsl:for-each>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-	  <xsl:template name="CreateTokenAttributes">
-		    <xsl:param name="scr"/>
-		    <xsl:param name="sty"/>
-		    <xsl:param name="nor"/>
-		    <xsl:param name="nCharToPrint"/>
-		    <xsl:param name="sTokenType"/>
-		    <xsl:variable name="sLowerCaseNor"
-                    select="translate($nor, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                               'abcdefghijklmnopqrstuvwxyz')"/>
-		    <xsl:choose>
-			      <xsl:when test="$sLowerCaseNor = 'on'">
-				        <xsl:attribute name="mathvariant">normal</xsl:attribute>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:variable name="mathvariant">
-					          <xsl:choose>
+	<xsl:template name="CreateTokenAttributes">
+		<xsl:param name="scr" />
+		<xsl:param name="sty" />
+		<xsl:param name="nor" />
+		<xsl:param name="nCharToPrint" />
+		<xsl:param name="sTokenType" />
+		<xsl:variable name="sLowerCaseNor"
+			select="translate($nor, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',                                                               'abcdefghijklmnopqrstuvwxyz')" />
+		<xsl:choose>
+			<xsl:when test="$sLowerCaseNor = 'on'">
+				<xsl:attribute name="mathvariant">normal</xsl:attribute>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="mathvariant">
+					<xsl:choose>
 						<!-- numbers don't care -->
-						<xsl:when test="$sTokenType='mn'"/>
+						<xsl:when test="$sTokenType='mn'" />
 
-						            <xsl:when test="$scr='monospace'">monospace</xsl:when>
-						            <xsl:when test="$scr='sans-serif' and $sty='i'">sans-serif-italic</xsl:when>
-						            <xsl:when test="$scr='sans-serif' and $sty='b'">bold-sans-serif</xsl:when>
-						            <xsl:when test="$scr='sans-serif' and $sty='bi'">sans-serif-bold-italic</xsl:when>
-						            <xsl:when test="$scr='sans-serif'">sans-serif</xsl:when>
-						            <xsl:when test="$scr='fraktur' and $sty='b'">bold-fraktur</xsl:when>
-						            <xsl:when test="$scr='fraktur'">fraktur</xsl:when>
-						            <xsl:when test="$scr='double-struck'">double-struck</xsl:when>
-						            <xsl:when test="$scr='script' and $sty='b'">bold-script</xsl:when>
-						            <xsl:when test="$scr='script'">script</xsl:when>
-						            <xsl:when test="($scr='roman' or not($scr) or $scr='') and $sty='b'">bold</xsl:when>
-						            <xsl:when test="($scr='roman' or not($scr) or $scr='') and $sty='i'">italic</xsl:when>
-						            <xsl:when test="($scr='roman' or not($scr) or $scr='') and $sty='p'">normal</xsl:when>
-						            <xsl:when test="($scr='roman' or not($scr) or $scr='') and $sty='bi'">bold-italic</xsl:when>
-						            <xsl:otherwise/>
-					          </xsl:choose>
-				        </xsl:variable>
-				        <xsl:variable name="fontweight">
-					          <xsl:choose>
-						            <xsl:when test="$sty='b' or $sty='bi'">bold</xsl:when>
-						            <xsl:otherwise>normal</xsl:otherwise>
-					          </xsl:choose>
-				        </xsl:variable>
-				        <xsl:variable name="fontstyle">
-					          <xsl:choose>
-						            <xsl:when test="$sty='p' or $sty='b'">normal</xsl:when>
-						            <xsl:otherwise>italic</xsl:otherwise>
-					          </xsl:choose>
-				        </xsl:variable>
+						<xsl:when test="$scr='monospace'">
+							monospace
+						</xsl:when>
+						<xsl:when test="$scr='sans-serif' and $sty='i'">
+							sans-serif-italic
+						</xsl:when>
+						<xsl:when test="$scr='sans-serif' and $sty='b'">
+							bold-sans-serif
+						</xsl:when>
+						<xsl:when test="$scr='sans-serif' and $sty='bi'">
+							sans-serif-bold-italic
+						</xsl:when>
+						<xsl:when test="$scr='sans-serif'">
+							sans-serif
+						</xsl:when>
+						<xsl:when test="$scr='fraktur' and $sty='b'">
+							bold-fraktur
+						</xsl:when>
+						<xsl:when test="$scr='fraktur'">
+							fraktur
+						</xsl:when>
+						<xsl:when test="$scr='double-struck'">
+							double-struck
+						</xsl:when>
+						<xsl:when test="$scr='script' and $sty='b'">
+							bold-script
+						</xsl:when>
+						<xsl:when test="$scr='script'">
+							script
+						</xsl:when>
+						<xsl:when
+							test="($scr='roman' or not($scr) or $scr='') and $sty='b'">
+							bold
+						</xsl:when>
+						<xsl:when
+							test="($scr='roman' or not($scr) or $scr='') and $sty='i'">
+							italic
+						</xsl:when>
+						<xsl:when
+							test="($scr='roman' or not($scr) or $scr='') and $sty='p'">
+							normal
+						</xsl:when>
+						<xsl:when
+							test="($scr='roman' or not($scr) or $scr='') and $sty='bi'">
+							bold-italic
+						</xsl:when>
+						<xsl:otherwise />
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="fontweight">
+					<xsl:choose>
+						<xsl:when test="$sty='b' or $sty='bi'">
+							bold
+						</xsl:when>
+						<xsl:otherwise>
+							normal
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="fontstyle">
+					<xsl:choose>
+						<xsl:when test="$sty='p' or $sty='b'">
+							normal
+						</xsl:when>
+						<xsl:otherwise>
+							italic
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
 
-				        <!-- Writing of attributes begins here -->
+				<!-- Writing of attributes begins here -->
 				<xsl:choose>
 					<!-- Don't write mathvariant for operators unless they want to be normal -->
-					<xsl:when test="$sTokenType='mo' and $mathvariant!='normal'"/>
+					<xsl:when
+						test="$sTokenType='mo' and $mathvariant!='normal'" />
 
-					          <!-- A single character within an mi is already italics, don't write -->
-					<xsl:when test="$sTokenType='mi' and $nCharToPrint=1 and ($mathvariant='' or $mathvariant='italic')"/>
+					<!-- A single character within an mi is already italics, don't write -->
+					<xsl:when
+						test="$sTokenType='mi' and $nCharToPrint=1 and ($mathvariant='' or $mathvariant='italic')" />
 
-					          <xsl:when test="$sTokenType='mi' and $nCharToPrint &gt; 1 and ($mathvariant='' or $mathvariant='italic')">
-						            <xsl:attribute name="mathvariant">
-							              <xsl:value-of select="'italic'"/>
+					<xsl:when
+						test="$sTokenType='mi' and $nCharToPrint &gt; 1 and ($mathvariant='' or $mathvariant='italic')">
+						<xsl:attribute name="mathvariant">
+							              <xsl:value-of select="'italic'" />
 						            </xsl:attribute>
-					          </xsl:when>
-					          <xsl:when test="$mathvariant!='italic' and $mathvariant!=''">
-						            <xsl:attribute name="mathvariant">
-							              <xsl:value-of select="$mathvariant"/>
+					</xsl:when>
+					<xsl:when
+						test="$mathvariant!='italic' and $mathvariant!=''">
+						<xsl:attribute name="mathvariant">
+							              <xsl:value-of select="$mathvariant" />
 						            </xsl:attribute>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <xsl:if test="not($sTokenType='mi' and $nCharToPrint=1) and $fontstyle='italic'">
-							              <xsl:attribute name="fontstyle">italic</xsl:attribute>
-						            </xsl:if>
-						            <xsl:if test="$fontweight='bold'">
-							              <xsl:attribute name="fontweight">bold</xsl:attribute>
-						            </xsl:if>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:if
+							test="not($sTokenType='mi' and $nCharToPrint=1) and $fontstyle='italic'">
+							<xsl:attribute name="fontstyle">italic</xsl:attribute>
+						</xsl:if>
+						<xsl:if test="$fontweight='bold'">
+							<xsl:attribute name="fontweight">bold</xsl:attribute>
+						</xsl:if>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <xsl:template match="m:eqArr">
-		    <mtable>
-			      <xsl:for-each select="m:e">
-				        <mtr>
-					          <mtd>
-						            <xsl:choose>
-							              <xsl:when test="m:argPr[last()]/m:scrLvl/@m:val!='0' or                   not(m:argPr[last()]/m:scrLvl/@m:val)  or                   m:argPr[last()]/m:scrLvl/@m:val=''">
-								                <mrow>
-									                  <maligngroup/>
-									                  <xsl:call-template name="CreateEqArrRow">
-										                    <xsl:with-param name="align" select="1"/>
-										                    <xsl:with-param name="ndCur" select="*[1]"/>
-									                  </xsl:call-template>
-								                </mrow>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <mstyle>
-									                  <xsl:attribute name="scriptlevel">
-										                    <xsl:value-of select="m:argPr[last()]/m:scrLvl/@m:val"/>
+	<xsl:template match="m:eqArr">
+		<mtable>
+			<xsl:for-each select="m:e">
+				<mtr>
+					<mtd>
+						<xsl:choose>
+							<xsl:when
+								test="m:argPr[last()]/m:scrLvl/@m:val!='0' or                   not(m:argPr[last()]/m:scrLvl/@m:val)  or                   m:argPr[last()]/m:scrLvl/@m:val=''">
+								<mrow>
+									<maligngroup />
+									<xsl:call-template name="CreateEqArrRow">
+										<xsl:with-param name="align" select="1" />
+										<xsl:with-param name="ndCur" select="*[1]" />
+									</xsl:call-template>
+								</mrow>
+							</xsl:when>
+							<xsl:otherwise>
+								<mstyle>
+									<xsl:attribute name="scriptlevel">
+										                    <xsl:value-of
+										select="m:argPr[last()]/m:scrLvl/@m:val" />
 									                  </xsl:attribute>
-									                  <maligngroup/>
-									                  <xsl:call-template name="CreateEqArrRow">
-										                    <xsl:with-param name="align" select="1"/>
-										                    <xsl:with-param name="ndCur" select="*[1]"/>
-									                  </xsl:call-template>
-								                </mstyle>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </mtd>
-				        </mtr>
-			      </xsl:for-each>
-		    </mtable>
-	  </xsl:template>
+									<maligngroup />
+									<xsl:call-template name="CreateEqArrRow">
+										<xsl:with-param name="align" select="1" />
+										<xsl:with-param name="ndCur" select="*[1]" />
+									</xsl:call-template>
+								</mstyle>
+							</xsl:otherwise>
+						</xsl:choose>
+					</mtd>
+				</mtr>
+			</xsl:for-each>
+		</mtable>
+	</xsl:template>
 
-	  <xsl:template name="CreateEqArrRow">
-		    <xsl:param name="align"/>
-		    <xsl:param name="ndCur"/>
-		    <xsl:variable name="sAllMt">
-			      <xsl:for-each select="$ndCur/m:t">
-				        <xsl:value-of select="."/>
-			      </xsl:for-each>
-		    </xsl:variable>
-		    <xsl:choose>
-			      <xsl:when test="$ndCur/self::m:r">
-				        <xsl:call-template name="ParseEqArrMr">
-					          <xsl:with-param name="sToParse" select="$sAllMt"/>
-					          <xsl:with-param name="scr" select="../m:rPr[last()]/m:scr/@m:val"/>
-					          <xsl:with-param name="sty" select="../m:rPr[last()]/m:sty/@m:val"/>
-					          <xsl:with-param name="nor" select="../m:rPr[last()]/m:nor/@m:val"/>
-					          <xsl:with-param name="align" select="$align"/>
-				        </xsl:call-template>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:apply-templates select="$ndCur"/>
-			      </xsl:otherwise>
-		    </xsl:choose>
-		    <xsl:if test="count($ndCur/following-sibling::*) &gt; 0">
-			      <xsl:variable name="cAmp">
-				        <xsl:call-template name="CountAmp">
-					          <xsl:with-param name="sAllMt" select="$sAllMt"/>
-					          <xsl:with-param name="cAmp" select="0"/>
-				        </xsl:call-template>
-			      </xsl:variable>
-			      <xsl:call-template name="CreateEqArrRow">
-				        <xsl:with-param name="align" select="($align+($cAmp mod 2)) mod 2"/>
-				        <xsl:with-param name="ndCur" select="$ndCur/following-sibling::*[1]"/>
-			      </xsl:call-template>
-		    </xsl:if>
-	  </xsl:template>
+	<xsl:template name="CreateEqArrRow">
+		<xsl:param name="align" />
+		<xsl:param name="ndCur" />
+		<xsl:variable name="sAllMt">
+			<xsl:for-each select="$ndCur/m:t">
+				<xsl:value-of select="." />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$ndCur/self::m:r">
+				<xsl:call-template name="ParseEqArrMr">
+					<xsl:with-param name="sToParse" select="$sAllMt" />
+					<xsl:with-param name="scr"
+						select="../m:rPr[last()]/m:scr/@m:val" />
+					<xsl:with-param name="sty"
+						select="../m:rPr[last()]/m:sty/@m:val" />
+					<xsl:with-param name="nor"
+						select="../m:rPr[last()]/m:nor/@m:val" />
+					<xsl:with-param name="align" select="$align" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="$ndCur" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if test="count($ndCur/following-sibling::*) &gt; 0">
+			<xsl:variable name="cAmp">
+				<xsl:call-template name="CountAmp">
+					<xsl:with-param name="sAllMt" select="$sAllMt" />
+					<xsl:with-param name="cAmp" select="0" />
+				</xsl:call-template>
+			</xsl:variable>
+			<xsl:call-template name="CreateEqArrRow">
+				<xsl:with-param name="align"
+					select="($align+($cAmp mod 2)) mod 2" />
+				<xsl:with-param name="ndCur"
+					select="$ndCur/following-sibling::*[1]" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-	  <xsl:template name="CountAmp">
-		    <xsl:param name="sAllMt"/>
-		    <xsl:param name="cAmp"/>
-		    <xsl:choose>
-			      <xsl:when test="string-length(substring-after($sAllMt, '&amp;')) &gt; 0 or                     substring($sAllMt, string-length($sAllMt))='&amp;'">
-				        <xsl:call-template name="CountAmp">
-					          <xsl:with-param name="sAllMt" select="substring-after($sAllMt, '&amp;')"/>
-					          <xsl:with-param name="cAmp" select="$cAmp+1"/>
-				        </xsl:call-template>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:value-of select="$cAmp"/>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+	<xsl:template name="CountAmp">
+		<xsl:param name="sAllMt" />
+		<xsl:param name="cAmp" />
+		<xsl:choose>
+			<xsl:when
+				test="string-length(substring-after($sAllMt, '&amp;')) &gt; 0 or                     substring($sAllMt, string-length($sAllMt))='&amp;'">
+				<xsl:call-template name="CountAmp">
+					<xsl:with-param name="sAllMt"
+						select="substring-after($sAllMt, '&amp;')" />
+					<xsl:with-param name="cAmp" select="$cAmp+1" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$cAmp" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <!-- %%Template: ParseEqArrMr
-			
-			Similar to ParseMt, but this one has to do more for an equation array. 
-      In equation arrays &amp; is a special character which denotes alignment.
-      
-      The &amp; in an equation works by alternating between meaning insert alignment spacing
-      and insert alignment mark.  For each equation in the equation array
-      there is an implied align space at the beginning of the equation.  Within each equation,
-      the first &amp; means alignmark, the second, align space, the third, alignmark, etc.
-      
-      For this reason when parsing m:r's in equation arrays it is important to keep track of what
-      the next ampersand will mean.
-      
-      $align=0 => Omml's align space, which is similar to MathML's maligngroup.
-      $align=1 => Omml's alignment mark, which is similar to MathML's malignmark.
-	-->
+	<!-- %%Template: ParseEqArrMr Similar to ParseMt, but this one has to do 
+		more for an equation array. In equation arrays &amp; is a special character 
+		which denotes alignment. The &amp; in an equation works by alternating between 
+		meaning insert alignment spacing and insert alignment mark. For each equation 
+		in the equation array there is an implied align space at the beginning of 
+		the equation. Within each equation, the first &amp; means alignmark, the 
+		second, align space, the third, alignmark, etc. For this reason when parsing 
+		m:r's in equation arrays it is important to keep track of what the next ampersand 
+		will mean. $align=0 => Omml's align space, which is similar to MathML's maligngroup. 
+		$align=1 => Omml's alignment mark, which is similar to MathML's malignmark. -->
 	<xsl:template name="ParseEqArrMr">
-		    <xsl:param name="sToParse"/>
-		    <xsl:param name="sty"/>
-		    <xsl:param name="scr"/>
-		    <xsl:param name="nor"/>
-		    <xsl:param name="align"/>
+		<xsl:param name="sToParse" />
+		<xsl:param name="sty" />
+		<xsl:param name="scr" />
+		<xsl:param name="nor" />
+		<xsl:param name="align" />
 
-		    <xsl:if test="string-length($sToParse) &gt; 0">
-			      <xsl:choose>
-				        <xsl:when test="substring($sToParse,1,1) = '&amp;'">
-					          <xsl:choose>
-						            <xsl:when test="$align=0">
-							              <maligngroup/>
-						            </xsl:when>
-						            <xsl:when test="$align=1">
-							              <malignmark/>
-						            </xsl:when>
-					          </xsl:choose>
-					          <xsl:call-template name="ParseEqArrMr">
-						            <xsl:with-param name="sToParse" select="substring($sToParse,2)"/>
-						            <xsl:with-param name="scr" select="$scr"/>
-						            <xsl:with-param name="sty" select="$sty"/>
-						            <xsl:with-param name="nor" select="$nor"/>
-						            <xsl:with-param name="align">
-							              <xsl:choose>
-								                <xsl:when test="$align=1">0</xsl:when>
-								                <xsl:otherwise>1</xsl:otherwise>
-							              </xsl:choose>
-						            </xsl:with-param>
-					          </xsl:call-template>
-				        </xsl:when>
-				        <xsl:otherwise>
-					          <xsl:variable name="sRepNumWith0">
-						            <xsl:call-template name="SReplaceNumWithZero">
-							              <xsl:with-param name="sToParse" select="$sToParse"/>
-						            </xsl:call-template>
-					          </xsl:variable>
-					          <xsl:variable name="sRepOperWith-">
-						            <xsl:call-template name="SReplaceOperWithMinus">
-							              <xsl:with-param name="sToParse" select="$sRepNumWith0"/>
-						            </xsl:call-template>
-					          </xsl:variable>
+		<xsl:if test="string-length($sToParse) &gt; 0">
+			<xsl:choose>
+				<xsl:when test="substring($sToParse,1,1) = '&amp;'">
+					<xsl:choose>
+						<xsl:when test="$align=0">
+							<maligngroup />
+						</xsl:when>
+						<xsl:when test="$align=1">
+							<malignmark />
+						</xsl:when>
+					</xsl:choose>
+					<xsl:call-template name="ParseEqArrMr">
+						<xsl:with-param name="sToParse"
+							select="substring($sToParse,2)" />
+						<xsl:with-param name="scr" select="$scr" />
+						<xsl:with-param name="sty" select="$sty" />
+						<xsl:with-param name="nor" select="$nor" />
+						<xsl:with-param name="align">
+							<xsl:choose>
+								<xsl:when test="$align=1">
+									0
+								</xsl:when>
+								<xsl:otherwise>
+									1
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="sRepNumWith0">
+						<xsl:call-template name="SReplaceNumWithZero">
+							<xsl:with-param name="sToParse" select="$sToParse" />
+						</xsl:call-template>
+					</xsl:variable>
+					<xsl:variable name="sRepOperWith-">
+						<xsl:call-template name="SReplaceOperWithMinus">
+							<xsl:with-param name="sToParse"
+								select="$sRepNumWith0" />
+						</xsl:call-template>
+					</xsl:variable>
 
-					          <xsl:variable name="iFirstOper"
-                             select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '-'))"/>
-					          <xsl:variable name="iFirstNum"
-                             select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '0'))"/>
-					          <xsl:variable name="iFirstAmp"
-                             select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '&amp;'))"/>
-					          <xsl:variable name="fNumAtPos1">
-						            <xsl:choose>
-							              <xsl:when test="substring($sRepOperWith-,1,1)='0'">1</xsl:when>
-							              <xsl:otherwise>0</xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:variable>
-					          <xsl:variable name="fOperAtPos1">
-						            <xsl:choose>
-							              <xsl:when test="substring($sRepOperWith-,1,1)='-'">1</xsl:when>
-							              <xsl:otherwise>0</xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:variable>
-					          <xsl:choose>
+					<xsl:variable name="iFirstOper"
+						select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '-'))" />
+					<xsl:variable name="iFirstNum"
+						select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '0'))" />
+					<xsl:variable name="iFirstAmp"
+						select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '&amp;'))" />
+					<xsl:variable name="fNumAtPos1">
+						<xsl:choose>
+							<xsl:when test="substring($sRepOperWith-,1,1)='0'">
+								1
+							</xsl:when>
+							<xsl:otherwise>
+								0
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="fOperAtPos1">
+						<xsl:choose>
+							<xsl:when test="substring($sRepOperWith-,1,1)='-'">
+								1
+							</xsl:when>
+							<xsl:otherwise>
+								0
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:choose>
 
 						<!-- Case I: The string begins with neither a number, nor an operator -->
 						<xsl:when test="$fNumAtPos1='0' and $fOperAtPos1='0'">
-							              <mi>
-								                <xsl:call-template name="CreateTokenAttributes">
-									                  <xsl:with-param name="scr" select="$scr"/>
-									                  <xsl:with-param name="sty" select="$sty"/>
-									                  <xsl:with-param name="nor" select="$nor"/>
-									                  <xsl:with-param name="nCharToPrint" select="1"/>
-									                  <xsl:with-param name="sTokenType" select="'mi'"/>
-								                </xsl:call-template>
-								                <xsl:value-of select="substring($sToParse,1,1)"/>
-							              </mi>
-							              <xsl:call-template name="ParseEqArrMr">
-								                <xsl:with-param name="sToParse" select="substring($sToParse, 2)"/>
-								                <xsl:with-param name="scr" select="$scr"/>
-								                <xsl:with-param name="sty" select="$sty"/>
-								                <xsl:with-param name="nor" select="$nor"/>
-								                <xsl:with-param name="align" select="$align"/>
-							              </xsl:call-template>
-						            </xsl:when>
+							<mi>
+								<xsl:call-template
+									name="CreateTokenAttributes">
+									<xsl:with-param name="scr" select="$scr" />
+									<xsl:with-param name="sty" select="$sty" />
+									<xsl:with-param name="nor" select="$nor" />
+									<xsl:with-param name="nCharToPrint" select="1" />
+									<xsl:with-param name="sTokenType" select="'mi'" />
+								</xsl:call-template>
+								<xsl:value-of select="substring($sToParse,1,1)" />
+							</mi>
+							<xsl:call-template name="ParseEqArrMr">
+								<xsl:with-param name="sToParse"
+									select="substring($sToParse, 2)" />
+								<xsl:with-param name="scr" select="$scr" />
+								<xsl:with-param name="sty" select="$sty" />
+								<xsl:with-param name="nor" select="$nor" />
+								<xsl:with-param name="align" select="$align" />
+							</xsl:call-template>
+						</xsl:when>
 
-						            <!-- Case II: There is an operator at position 1 -->
+						<!-- Case II: There is an operator at position 1 -->
 						<xsl:when test="$fOperAtPos1='1'">
-							              <mo>
-								                <xsl:call-template name="CreateTokenAttributes">
-									                  <xsl:with-param name="scr"/>
-									                  <xsl:with-param name="sty"/>
-									                  <xsl:with-param name="nor" select="$nor"/>
-									                  <xsl:with-param name="sTokenType" select="'mo'"/>
-								                </xsl:call-template>
-								                <xsl:value-of select="substring($sToParse,1,1)"/>
-							              </mo>
-							              <xsl:call-template name="ParseEqArrMr">
-								                <xsl:with-param name="sToParse" select="substring($sToParse, 2)"/>
-								                <xsl:with-param name="scr" select="$scr"/>
-								                <xsl:with-param name="sty" select="$sty"/>
-								                <xsl:with-param name="nor" select="$nor"/>
-								                <xsl:with-param name="align" select="$align"/>
-							              </xsl:call-template>
-						            </xsl:when>
+							<mo>
+								<xsl:call-template
+									name="CreateTokenAttributes">
+									<xsl:with-param name="scr" />
+									<xsl:with-param name="sty" />
+									<xsl:with-param name="nor" select="$nor" />
+									<xsl:with-param name="sTokenType" select="'mo'" />
+								</xsl:call-template>
+								<xsl:value-of select="substring($sToParse,1,1)" />
+							</mo>
+							<xsl:call-template name="ParseEqArrMr">
+								<xsl:with-param name="sToParse"
+									select="substring($sToParse, 2)" />
+								<xsl:with-param name="scr" select="$scr" />
+								<xsl:with-param name="sty" select="$sty" />
+								<xsl:with-param name="nor" select="$nor" />
+								<xsl:with-param name="align" select="$align" />
+							</xsl:call-template>
+						</xsl:when>
 
-						            <!-- Case III: There is a number at position 1 -->
+						<!-- Case III: There is a number at position 1 -->
 						<xsl:otherwise>
-							              <xsl:variable name="sConsecNum">
-								                <xsl:call-template name="SNumStart">
-									                  <xsl:with-param name="sToParse" select="$sToParse"/>
-									                  <xsl:with-param name="sPattern" select="$sRepNumWith0"/>
-								                </xsl:call-template>
-							              </xsl:variable>
-							              <mn>
-								                <xsl:call-template name="CreateTokenAttributes">
-									                  <xsl:with-param name="scr"/>
-									                  <xsl:with-param name="sty" select="'p'"/>
-									                  <xsl:with-param name="nor" select="$nor"/>
-									                  <xsl:with-param name="sTokenType" select="'mn'"/>
-								                </xsl:call-template>
-								                <xsl:value-of select="$sConsecNum"/>
-							              </mn>
-							              <xsl:call-template name="ParseEqArrMr">
-								                <xsl:with-param name="sToParse" select="substring-after($sToParse, $sConsecNum)"/>
-								                <xsl:with-param name="scr" select="$scr"/>
-								                <xsl:with-param name="sty" select="$sty"/>
-								                <xsl:with-param name="nor" select="$nor"/>
-								                <xsl:with-param name="align" select="$align"/>
-							              </xsl:call-template>
-						            </xsl:otherwise>
-					          </xsl:choose>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:if>
-	  </xsl:template>
+							<xsl:variable name="sConsecNum">
+								<xsl:call-template name="SNumStart">
+									<xsl:with-param name="sToParse"
+										select="$sToParse" />
+									<xsl:with-param name="sPattern"
+										select="$sRepNumWith0" />
+								</xsl:call-template>
+							</xsl:variable>
+							<mn>
+								<xsl:call-template
+									name="CreateTokenAttributes">
+									<xsl:with-param name="scr" />
+									<xsl:with-param name="sty" select="'p'" />
+									<xsl:with-param name="nor" select="$nor" />
+									<xsl:with-param name="sTokenType" select="'mn'" />
+								</xsl:call-template>
+								<xsl:value-of select="$sConsecNum" />
+							</mn>
+							<xsl:call-template name="ParseEqArrMr">
+								<xsl:with-param name="sToParse"
+									select="substring-after($sToParse, $sConsecNum)" />
+								<xsl:with-param name="scr" select="$scr" />
+								<xsl:with-param name="sty" select="$sty" />
+								<xsl:with-param name="nor" select="$nor" />
+								<xsl:with-param name="align" select="$align" />
+							</xsl:call-template>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
-	  <!-- %%Template: ParseMt
-
-			Produce a run of text. Technically, OMML makes no distinction 
-			between numbers, operators, and other characters in a run. For 
-			MathML we need to break these into mi, mn, or mo elements. 
-			
-			See also ParseEqArrMr
-	-->
+	<!-- %%Template: ParseMt Produce a run of text. Technically, OMML makes 
+		no distinction between numbers, operators, and other characters in a run. 
+		For MathML we need to break these into mi, mn, or mo elements. See also ParseEqArrMr -->
 	<xsl:template name="ParseMt">
-		    <xsl:param name="sToParse"/>
-		    <xsl:param name="sty"/>
-		    <xsl:param name="scr"/>
-		    <xsl:param name="nor"/>
-		    <xsl:if test="string-length($sToParse) &gt; 0">
-			      <xsl:variable name="sRepNumWith0">
-				        <xsl:call-template name="SReplaceNumWithZero">
-					          <xsl:with-param name="sToParse" select="$sToParse"/>
-				        </xsl:call-template>
-			      </xsl:variable>
-			      <xsl:variable name="sRepOperWith-">
-				        <xsl:call-template name="SReplaceOperWithMinus">
-					          <xsl:with-param name="sToParse" select="$sRepNumWith0"/>
-				        </xsl:call-template>
-			      </xsl:variable>
+		<xsl:param name="sToParse" />
+		<xsl:param name="sty" />
+		<xsl:param name="scr" />
+		<xsl:param name="nor" />
+		<xsl:if test="string-length($sToParse) &gt; 0">
+			<xsl:variable name="sRepNumWith0">
+				<xsl:call-template name="SReplaceNumWithZero">
+					<xsl:with-param name="sToParse" select="$sToParse" />
+				</xsl:call-template>
+			</xsl:variable>
+			<xsl:variable name="sRepOperWith-">
+				<xsl:call-template name="SReplaceOperWithMinus">
+					<xsl:with-param name="sToParse"
+						select="$sRepNumWith0" />
+				</xsl:call-template>
+			</xsl:variable>
 
-			      <xsl:variable name="iFirstOper"
-                       select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '-'))"/>
-			      <xsl:variable name="iFirstNum"
-                       select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '0'))"/>
-			      <xsl:variable name="fNumAtPos1">
-				        <xsl:choose>
-					          <xsl:when test="substring($sRepOperWith-,1,1)='0'">1</xsl:when>
-					          <xsl:otherwise>0</xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:variable>
-			      <xsl:variable name="fOperAtPos1">
-				        <xsl:choose>
-					          <xsl:when test="substring($sRepOperWith-,1,1)='-'">1</xsl:when>
-					          <xsl:otherwise>0</xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:variable>
+			<xsl:variable name="iFirstOper"
+				select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '-'))" />
+			<xsl:variable name="iFirstNum"
+				select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '0'))" />
+			<xsl:variable name="fNumAtPos1">
+				<xsl:choose>
+					<xsl:when test="substring($sRepOperWith-,1,1)='0'">
+						1
+					</xsl:when>
+					<xsl:otherwise>
+						0
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
+			<xsl:variable name="fOperAtPos1">
+				<xsl:choose>
+					<xsl:when test="substring($sRepOperWith-,1,1)='-'">
+						1
+					</xsl:when>
+					<xsl:otherwise>
+						0
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>
 
-			      <xsl:choose>
+			<xsl:choose>
 
 				<!-- Case I: The string begins with neither a number, nor an operator -->
 				<xsl:when test="$fOperAtPos1='0' and $fNumAtPos1='0'">
-					          <xsl:variable name="nCharToPrint">
-						            <xsl:choose>
-							              <xsl:when test="ancestor::m:fName">
-								                <xsl:choose>
-									                  <xsl:when test="($iFirstOper=$iFirstNum) and             ($iFirstOper=string-length($sToParse)) and                        (substring($sRepOperWith-, string-length($sRepOperWith-))!='0') and                         (substring($sRepOperWith-, string-length($sRepOperWith-))!='-')">
-										                    <xsl:value-of select="string-length($sToParse)"/>
-									                  </xsl:when>
-									                  <xsl:when test="$iFirstOper &lt; $iFirstNum">
-										                    <xsl:value-of select="$iFirstOper - 1"/>
-									                  </xsl:when>
-									                  <xsl:otherwise>
-										                    <xsl:value-of select="$iFirstNum - 1"/>
-									                  </xsl:otherwise>
-								                </xsl:choose>
-							              </xsl:when>
-							              <xsl:otherwise>1</xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:variable>
+					<xsl:variable name="nCharToPrint">
+						<xsl:choose>
+							<xsl:when test="ancestor::m:fName">
+								<xsl:choose>
+									<xsl:when
+										test="($iFirstOper=$iFirstNum) and             ($iFirstOper=string-length($sToParse)) and                        (substring($sRepOperWith-, string-length($sRepOperWith-))!='0') and                         (substring($sRepOperWith-, string-length($sRepOperWith-))!='-')">
+										<xsl:value-of select="string-length($sToParse)" />
+									</xsl:when>
+									<xsl:when test="$iFirstOper &lt; $iFirstNum">
+										<xsl:value-of select="$iFirstOper - 1" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of select="$iFirstNum - 1" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:when>
+							<xsl:otherwise>
+								1
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
 
-					          <mi>
-						            <xsl:call-template name="CreateTokenAttributes">
-							              <xsl:with-param name="scr" select="$scr"/>
-							              <xsl:with-param name="sty" select="$sty"/>
-							              <xsl:with-param name="nor" select="$nor"/>
-							              <xsl:with-param name="nCharToPrint" select="$nCharToPrint"/>
-							              <xsl:with-param name="sTokenType" select="'mi'"/>
-						            </xsl:call-template>
-						            <xsl:value-of select="substring($sToParse, 1, $nCharToPrint)"/>
-					          </mi>
-					          <xsl:call-template name="ParseMt">
-						            <xsl:with-param name="sToParse" select="substring($sToParse, $nCharToPrint+1)"/>
-						            <xsl:with-param name="scr" select="$scr"/>
-						            <xsl:with-param name="sty" select="$sty"/>
-						            <xsl:with-param name="nor" select="$nor"/>
-					          </xsl:call-template>
-				        </xsl:when>
+					<mi>
+						<xsl:call-template name="CreateTokenAttributes">
+							<xsl:with-param name="scr" select="$scr" />
+							<xsl:with-param name="sty" select="$sty" />
+							<xsl:with-param name="nor" select="$nor" />
+							<xsl:with-param name="nCharToPrint"
+								select="$nCharToPrint" />
+							<xsl:with-param name="sTokenType" select="'mi'" />
+						</xsl:call-template>
+						<xsl:value-of
+							select="substring($sToParse, 1, $nCharToPrint)" />
+					</mi>
+					<xsl:call-template name="ParseMt">
+						<xsl:with-param name="sToParse"
+							select="substring($sToParse, $nCharToPrint+1)" />
+						<xsl:with-param name="scr" select="$scr" />
+						<xsl:with-param name="sty" select="$sty" />
+						<xsl:with-param name="nor" select="$nor" />
+					</xsl:call-template>
+				</xsl:when>
 
-				        <!-- Case II: There is an operator at position 1 -->
+				<!-- Case II: There is an operator at position 1 -->
 				<xsl:when test="$fOperAtPos1='1'">
-					          <mo>
-						            <xsl:call-template name="CreateTokenAttributes">
-							              <xsl:with-param name="scr"/>
-							              <xsl:with-param name="sty"/>
-							              <xsl:with-param name="nor" select="$nor"/>
-							              <xsl:with-param name="sTokenType" select="'mo'"/>
-						            </xsl:call-template>
-						            <xsl:value-of select="substring($sToParse,1,1)"/>
-					          </mo>
-					          <xsl:call-template name="ParseMt">
-						            <xsl:with-param name="sToParse" select="substring($sToParse, 2)"/>
-						            <xsl:with-param name="scr" select="$scr"/>
-						            <xsl:with-param name="sty" select="$sty"/>
-						            <xsl:with-param name="nor" select="$nor"/>
-					          </xsl:call-template>
-				        </xsl:when>
+					<mo>
+						<xsl:call-template name="CreateTokenAttributes">
+							<xsl:with-param name="scr" />
+							<xsl:with-param name="sty" />
+							<xsl:with-param name="nor" select="$nor" />
+							<xsl:with-param name="sTokenType" select="'mo'" />
+						</xsl:call-template>
+						<xsl:value-of select="substring($sToParse,1,1)" />
+					</mo>
+					<xsl:call-template name="ParseMt">
+						<xsl:with-param name="sToParse"
+							select="substring($sToParse, 2)" />
+						<xsl:with-param name="scr" select="$scr" />
+						<xsl:with-param name="sty" select="$sty" />
+						<xsl:with-param name="nor" select="$nor" />
+					</xsl:call-template>
+				</xsl:when>
 
-				        <!-- Case III: There is a number at position 1 -->
+				<!-- Case III: There is a number at position 1 -->
 				<xsl:otherwise>
-					          <xsl:variable name="sConsecNum">
-						            <xsl:call-template name="SNumStart">
-							              <xsl:with-param name="sToParse" select="$sToParse"/>
-							              <xsl:with-param name="sPattern" select="$sRepNumWith0"/>
-						            </xsl:call-template>
-					          </xsl:variable>
-					          <mn>
-						            <xsl:call-template name="CreateTokenAttributes">
-							              <xsl:with-param name="scr" select="$scr"/>
-							              <xsl:with-param name="sty" select="'p'"/>
-							              <xsl:with-param name="nor" select="$nor"/>
-							              <xsl:with-param name="sTokenType" select="'mn'"/>
-						            </xsl:call-template>
-						            <xsl:value-of select="$sConsecNum"/>
-					          </mn>
-					          <xsl:call-template name="ParseMt">
-						            <xsl:with-param name="sToParse" select="substring-after($sToParse, $sConsecNum)"/>
-						            <xsl:with-param name="scr" select="$scr"/>
-						            <xsl:with-param name="sty" select="$sty"/>
-						            <xsl:with-param name="nor" select="$nor"/>
-					          </xsl:call-template>
-				        </xsl:otherwise>
-			      </xsl:choose>
-		    </xsl:if>
-	  </xsl:template>
+					<xsl:variable name="sConsecNum">
+						<xsl:call-template name="SNumStart">
+							<xsl:with-param name="sToParse" select="$sToParse" />
+							<xsl:with-param name="sPattern"
+								select="$sRepNumWith0" />
+						</xsl:call-template>
+					</xsl:variable>
+					<mn>
+						<xsl:call-template name="CreateTokenAttributes">
+							<xsl:with-param name="scr" select="$scr" />
+							<xsl:with-param name="sty" select="'p'" />
+							<xsl:with-param name="nor" select="$nor" />
+							<xsl:with-param name="sTokenType" select="'mn'" />
+						</xsl:call-template>
+						<xsl:value-of select="$sConsecNum" />
+					</mn>
+					<xsl:call-template name="ParseMt">
+						<xsl:with-param name="sToParse"
+							select="substring-after($sToParse, $sConsecNum)" />
+						<xsl:with-param name="scr" select="$scr" />
+						<xsl:with-param name="sty" select="$sty" />
+						<xsl:with-param name="nor" select="$nor" />
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
 
-	  <!-- %%Template: SNumStart 
-	
-		Return the longest substring of sToParse starting from the 
-		start of sToParse that is a number. In addition, it takes the
-		pattern string, which is sToParse with all of its numbers 
-		replaced with a 0. sPattern should be the same length 
-		as sToParse		
-	-->
+	<!-- %%Template: SNumStart Return the longest substring of sToParse starting 
+		from the start of sToParse that is a number. In addition, it takes the pattern 
+		string, which is sToParse with all of its numbers replaced with a 0. sPattern 
+		should be the same length as sToParse -->
 	<xsl:template name="SNumStart">
-		    <xsl:param name="sToParse" select="''"/>
-		    <!-- if we don't get anything, take the string itself -->
-		<xsl:param name="sPattern" select="'$sToParse'"/>
+		<xsl:param name="sToParse" select="''" />
+		<!-- if we don't get anything, take the string itself -->
+		<xsl:param name="sPattern" select="'$sToParse'" />
 
 
-		    <xsl:choose>
+		<xsl:choose>
 			<!-- the pattern says this is a number, recurse with the rest -->
 			<xsl:when test="substring($sPattern, 1, 1) = '0'">
-				        <xsl:call-template name="SNumStart">
-					          <xsl:with-param name="sToParse" select="$sToParse"/>
-					          <xsl:with-param name="sPattern" select="substring($sPattern, 2)"/>
-				        </xsl:call-template>
-			      </xsl:when>
+				<xsl:call-template name="SNumStart">
+					<xsl:with-param name="sToParse" select="$sToParse" />
+					<xsl:with-param name="sPattern"
+						select="substring($sPattern, 2)" />
+				</xsl:call-template>
+			</xsl:when>
 
-			      <!-- the pattern says we've run out of numbers. Take as many
-				characters from sToParse as we shaved off sPattern -->
+			<!-- the pattern says we've run out of numbers. Take as many characters 
+				from sToParse as we shaved off sPattern -->
 			<xsl:otherwise>
-				        <xsl:value-of select="substring($sToParse, 1, string-length($sToParse) - string-length($sPattern))"/>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+				<xsl:value-of
+					select="substring($sToParse, 1, string-length($sToParse) - string-length($sPattern))" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-	  <!-- %%Template SRepeatCharAcc
-	
-			The core of SRepeatChar with an accumulator. The current
-			string is in param $acc, and we will double and recurse,
-			if we're less than half of the required length or else just 
-			add the right amount of characters to the accumulator and
-			return
-	-->
+	<!-- %%Template SRepeatCharAcc The core of SRepeatChar with an accumulator. 
+		The current string is in param $acc, and we will double and recurse, if we're 
+		less than half of the required length or else just add the right amount of 
+		characters to the accumulator and return -->
 	<xsl:template name="SRepeatCharAcc">
-		    <xsl:param name="cchRequired" select="1"/>
-		    <xsl:param name="ch" select="'-'"/>
-		    <xsl:param name="acc" select="$ch"/>
+		<xsl:param name="cchRequired" select="1" />
+		<xsl:param name="ch" select="'-'" />
+		<xsl:param name="acc" select="$ch" />
 
-		    <xsl:variable name="cchAcc" select="string-length($acc)"/>
-		    <xsl:choose>
-			      <xsl:when test="(2 * $cchAcc) &lt; $cchRequired">
-				        <xsl:call-template name="SRepeatCharAcc">
-					          <xsl:with-param name="cchRequired" select="$cchRequired"/>
-					          <xsl:with-param name="ch" select="$ch"/>
-					          <xsl:with-param name="acc" select="concat($acc, $acc)"/>
-				        </xsl:call-template>
-			      </xsl:when>
+		<xsl:variable name="cchAcc" select="string-length($acc)" />
+		<xsl:choose>
+			<xsl:when test="(2 * $cchAcc) &lt; $cchRequired">
+				<xsl:call-template name="SRepeatCharAcc">
+					<xsl:with-param name="cchRequired"
+						select="$cchRequired" />
+					<xsl:with-param name="ch" select="$ch" />
+					<xsl:with-param name="acc"
+						select="concat($acc, $acc)" />
+				</xsl:call-template>
+			</xsl:when>
 
-			      <xsl:otherwise>
-				        <xsl:value-of select="concat($acc, substring($acc, 1, $cchRequired - $cchAcc))"/>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+			<xsl:otherwise>
+				<xsl:value-of
+					select="concat($acc, substring($acc, 1, $cchRequired - $cchAcc))" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-	  <!-- %%Template SRepeatChar
-	
-			Generates a string nchRequired long by repeating the given character ch
-	-->
+	<!-- %%Template SRepeatChar Generates a string nchRequired long by repeating 
+		the given character ch -->
 	<xsl:template name="SRepeatChar">
-		    <xsl:param name="cchRequired" select="1"/>
-		    <xsl:param name="ch" select="'-'"/>
+		<xsl:param name="cchRequired" select="1" />
+		<xsl:param name="ch" select="'-'" />
 
-		    <xsl:call-template name="SRepeatCharAcc">
-			      <xsl:with-param name="cchRequired" select="$cchRequired"/>
-			      <xsl:with-param name="ch" select="$ch"/>
-			      <xsl:with-param name="acc" select="$ch"/>
-		    </xsl:call-template>
-	  </xsl:template>
+		<xsl:call-template name="SRepeatCharAcc">
+			<xsl:with-param name="cchRequired"
+				select="$cchRequired" />
+			<xsl:with-param name="ch" select="$ch" />
+			<xsl:with-param name="acc" select="$ch" />
+		</xsl:call-template>
+	</xsl:template>
 
-	  <!-- %%Template SReplaceOperWithMinus
-	
-		Go through the given string and replace every instance
-		of an operator with a minus '-'. This helps quickly identify
-		the first instance of an operator.  
-	-->
+	<!-- %%Template SReplaceOperWithMinus Go through the given string and replace 
+		every instance of an operator with a minus '-'. This helps quickly identify 
+		the first instance of an operator. -->
 	<xsl:template name="SReplaceOperWithMinus">
-		    <xsl:param name="sToParse" select="''"/>
+		<xsl:param name="sToParse" select="''" />
 
-		    <xsl:value-of select="translate($sToParse, $sOperators, $sMinuses)"/>
-	  </xsl:template>
+		<xsl:value-of
+			select="translate($sToParse, $sOperators, $sMinuses)" />
+	</xsl:template>
 
-	  <!-- %%Template SReplaceNumWithZero
-	
-		Go through the given string and replace every instance
-		of an number with a zero '0'. This helps quickly identify
-		the first occurence of a number. 
-		
-		Considers the '.' and ',' part of a number iff they are sandwiched 
-		between two other numbers. 0.3 will be recognized as a number,
-		x.3 will not be. Since these characters can also be an operator, this 
-		should be called before SReplaceOperWithMinus.
-	-->
+	<!-- %%Template SReplaceNumWithZero Go through the given string and replace 
+		every instance of an number with a zero '0'. This helps quickly identify 
+		the first occurence of a number. Considers the '.' and ',' part of a number 
+		iff they are sandwiched between two other numbers. 0.3 will be recognized 
+		as a number, x.3 will not be. Since these characters can also be an operator, 
+		this should be called before SReplaceOperWithMinus. -->
 	<xsl:template name="SReplaceNumWithZero">
-		    <xsl:param name="sToParse" select="''"/>
+		<xsl:param name="sToParse" select="''" />
 
-		    <!-- First do a simple replace. Numbers will all be come 0's.
-			After this point, the pattern involving the . or , that 
-			we are looking for will become 0.0 or 0,0 -->
-		<xsl:variable name="sSimpleReplace" select="translate($sToParse, $sNumbers, $sZeros)"/>
+		<!-- First do a simple replace. Numbers will all be come 0's. After this 
+			point, the pattern involving the . or , that we are looking for will become 
+			0.0 or 0,0 -->
+		<xsl:variable name="sSimpleReplace"
+			select="translate($sToParse, $sNumbers, $sZeros)" />
 
-		    <!-- And then, replace 0.0 with just 000. This means that the . will 
-			become part of the number -->
+		<!-- And then, replace 0.0 with just 000. This means that the . will become 
+			part of the number -->
 		<xsl:variable name="sReplacePeriod">
-			      <xsl:call-template name="SReplace">
-				        <xsl:with-param name="sInput" select="$sSimpleReplace"/>
-				        <xsl:with-param name="sOrig" select="'0.0'"/>
-				        <xsl:with-param name="sReplacement" select="'000'"/>
-			      </xsl:call-template>
-		    </xsl:variable>
+			<xsl:call-template name="SReplace">
+				<xsl:with-param name="sInput"
+					select="$sSimpleReplace" />
+				<xsl:with-param name="sOrig" select="'0.0'" />
+				<xsl:with-param name="sReplacement" select="'000'" />
+			</xsl:call-template>
+		</xsl:variable>
 
-		    <!-- And then, replace 0,0 with just 000. This means that the , will 
-			become part of the number -->
+		<!-- And then, replace 0,0 with just 000. This means that the , will become 
+			part of the number -->
 		<xsl:call-template name="SReplace">
-			      <xsl:with-param name="sInput" select="$sReplacePeriod"/>
-			      <xsl:with-param name="sOrig" select="'0,0'"/>
-			      <xsl:with-param name="sReplacement" select="'000'"/>
-		    </xsl:call-template>
-	  </xsl:template>
+			<xsl:with-param name="sInput" select="$sReplacePeriod" />
+			<xsl:with-param name="sOrig" select="'0,0'" />
+			<xsl:with-param name="sReplacement" select="'000'" />
+		</xsl:call-template>
+	</xsl:template>
 
-	  <!-- Template to translate Word's borderBox properties into the menclose notation attribute
-       The initial call to this SHOULD NOT pass an sAttribute.  Subsequent calls to 
-       CreateMencloseNotationAttrFromBorderBoxAttr by CreateMencloseNotationAttrFromBorderBoxAttr will
-       update the sAttribute as appropriate.
-       
-       CreateMencloseNotationAttrFromBorderBoxAttr looks at each attribute (fHideTop, fHideBot, etc.) one at a time
-       in the order they are listed and passes a modified sAttribute to CreateMencloseNotationAttrFromBorderBoxAttr.
-       Each successive call to CreateMencloseNotationAttrFromBorderBoxAttr knows which attribute to look at because 
-       the previous call should have omitted passing the attribute it just analyzed.  This is why as you read lower 
-       and lower in the template that each call to CreateMencloseNotationAttrFromBorderBoxAttr has fewer and fewer attributes.
-       -->
-	<xsl:template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-		    <xsl:param name="fHideTop"/>
-		    <xsl:param name="fHideBot"/>
-		    <xsl:param name="fHideLeft"/>
-		    <xsl:param name="fHideRight"/>
-		    <xsl:param name="fStrikeH"/>
-		    <xsl:param name="fStrikeV"/>
-		    <xsl:param name="fStrikeBLTR"/>
-		    <xsl:param name="fStrikeTLBR"/>
-		    <xsl:param name="sAttribute"/>
+	<!-- Template to translate Word's borderBox properties into the menclose 
+		notation attribute The initial call to this SHOULD NOT pass an sAttribute. 
+		Subsequent calls to CreateMencloseNotationAttrFromBorderBoxAttr by CreateMencloseNotationAttrFromBorderBoxAttr 
+		will update the sAttribute as appropriate. CreateMencloseNotationAttrFromBorderBoxAttr 
+		looks at each attribute (fHideTop, fHideBot, etc.) one at a time in the order 
+		they are listed and passes a modified sAttribute to CreateMencloseNotationAttrFromBorderBoxAttr. 
+		Each successive call to CreateMencloseNotationAttrFromBorderBoxAttr knows 
+		which attribute to look at because the previous call should have omitted 
+		passing the attribute it just analyzed. This is why as you read lower and 
+		lower in the template that each call to CreateMencloseNotationAttrFromBorderBoxAttr 
+		has fewer and fewer attributes. -->
+	<xsl:template
+		name="CreateMencloseNotationAttrFromBorderBoxAttr">
+		<xsl:param name="fHideTop" />
+		<xsl:param name="fHideBot" />
+		<xsl:param name="fHideLeft" />
+		<xsl:param name="fHideRight" />
+		<xsl:param name="fStrikeH" />
+		<xsl:param name="fStrikeV" />
+		<xsl:param name="fStrikeBLTR" />
+		<xsl:param name="fStrikeTLBR" />
+		<xsl:param name="sAttribute" />
 
-		    <xsl:choose>
-			      <xsl:when test="string-length($sAttribute) = 0">
-				        <xsl:choose>
-					          <xsl:when test="string-length($fHideTop) &gt; 0                       and string-length($fHideBot) &gt; 0                        and string-length($fHideLeft) &gt; 0                       and string-length($fHideRight) &gt; 0">
+		<xsl:choose>
+			<xsl:when test="string-length($sAttribute) = 0">
+				<xsl:choose>
+					<xsl:when
+						test="string-length($fHideTop) &gt; 0                       and string-length($fHideBot) &gt; 0                        and string-length($fHideLeft) &gt; 0                       and string-length($fHideRight) &gt; 0">
 
-						            <xsl:choose>
-							              <xsl:when test="$fHideTop = 0                                and $fHideBot = 0                               and $fHideLeft = 0                                and $fHideRight = 0">
-								<!-- We can use 'box' instead of top, bot, left, and right.  Therefore,
-                  replace sAttribute with 'box' and begin analyzing params fStrikeH
-                  and below. -->
-								<xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute">
-										                    <xsl:text>box</xsl:text>
-									                  </xsl:with-param>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
+						<xsl:choose>
+							<xsl:when
+								test="$fHideTop = 0                                and $fHideBot = 0                               and $fHideLeft = 0                                and $fHideRight = 0">
+								<!-- We can use 'box' instead of top, bot, left, and right. Therefore, 
+									replace sAttribute with 'box' and begin analyzing params fStrikeH and below. -->
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute">
+										<xsl:text>box</xsl:text>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
 								<!-- Can't use 'box', theremore, must analyze all attributes -->
-								<xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fHideTop" select="$fHideTop"/>
-									                  <xsl:with-param name="fHideBot" select="$fHideBot"/>
-									                  <xsl:with-param name="fHideLeft" select="$fHideLeft"/>
-									                  <xsl:with-param name="fHideRight" select="$fHideRight"/>
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute">
-										<!-- Assume using all four (left right top bottom).  Subsequent calls
-                         will remove the sides which aren't to be includes. -->
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fHideTop"
+										select="$fHideTop" />
+									<xsl:with-param name="fHideBot"
+										select="$fHideBot" />
+									<xsl:with-param name="fHideLeft"
+										select="$fHideLeft" />
+									<xsl:with-param name="fHideRight"
+										select="$fHideRight" />
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute">
+										<!-- Assume using all four (left right top bottom). Subsequent 
+											calls will remove the sides which aren't to be includes. -->
 										<xsl:text>left right top bottom</xsl:text>
-									                  </xsl:with-param>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-				        </xsl:choose>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:choose>
-					          <xsl:when test="string-length($fHideTop) &gt; 0">
-						            <xsl:choose>
-							              <xsl:when test="$fHideTop=1">
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fHideBot" select="$fHideBot"/>
-									                  <xsl:with-param name="fHideLeft" select="$fHideLeft"/>
-									                  <xsl:with-param name="fHideRight" select="$fHideRight"/>
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute">
-										                    <xsl:call-template name="SReplace">
-											                      <xsl:with-param name="sInput" select="$sAttribute"/>
-											                      <xsl:with-param name="sOrig" select="'top'"/>
-											                      <xsl:with-param name="sReplacement" select="''"/>
-										                    </xsl:call-template>
-									                  </xsl:with-param>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fHideBot" select="$fHideBot"/>
-									                  <xsl:with-param name="fHideLeft" select="$fHideLeft"/>
-									                  <xsl:with-param name="fHideRight" select="$fHideRight"/>
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="$sAttribute"/>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-					          <xsl:when test="string-length($fHideBot) &gt; 0">
-						            <xsl:choose>
-							              <xsl:when test="$fHideBot=1">
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fHideLeft" select="$fHideLeft"/>
-									                  <xsl:with-param name="fHideRight" select="$fHideRight"/>
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute">
-										                    <xsl:call-template name="SReplace">
-											                      <xsl:with-param name="sInput" select="$sAttribute"/>
-											                      <xsl:with-param name="sOrig" select="'bottom'"/>
-											                      <xsl:with-param name="sReplacement" select="''"/>
-										                    </xsl:call-template>
-									                  </xsl:with-param>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fHideLeft" select="$fHideLeft"/>
-									                  <xsl:with-param name="fHideRight" select="$fHideRight"/>
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="$sAttribute"/>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-					          <xsl:when test="string-length($fHideLeft) &gt; 0">
-						            <xsl:choose>
-							              <xsl:when test="$fHideLeft=1">
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fHideRight" select="$fHideRight"/>
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute">
-										                    <xsl:call-template name="SReplace">
-											                      <xsl:with-param name="sInput" select="$sAttribute"/>
-											                      <xsl:with-param name="sOrig" select="'left'"/>
-											                      <xsl:with-param name="sReplacement" select="''"/>
-										                    </xsl:call-template>
-									                  </xsl:with-param>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fHideRight" select="$fHideRight"/>
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="$sAttribute"/>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-					          <xsl:when test="string-length($fHideRight) &gt; 0">
-						            <xsl:choose>
-							              <xsl:when test="$fHideRight=1">
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute">
-										                    <xsl:call-template name="SReplace">
-											                      <xsl:with-param name="sInput" select="$sAttribute"/>
-											                      <xsl:with-param name="sOrig" select="'right'"/>
-											                      <xsl:with-param name="sReplacement" select="''"/>
-										                    </xsl:call-template>
-									                  </xsl:with-param>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeH" select="$fStrikeH"/>
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="$sAttribute"/>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-					          <xsl:when test="string-length($fStrikeH) &gt; 0">
-						            <xsl:choose>
-							              <xsl:when test="$fStrikeH=1">
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="concat($sAttribute, ' horizontalstrike')"/>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeV" select="$fStrikeV"/>
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="$sAttribute"/>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-					          <xsl:when test="string-length($fStrikeV) &gt; 0">
-						            <xsl:choose>
-							              <xsl:when test="$fStrikeV=1">
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="concat($sAttribute, ' verticalstrike')"/>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeBLTR" select="$fStrikeBLTR"/>
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="$sAttribute"/>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-					          <xsl:when test="string-length($fStrikeBLTR) &gt; 0">
-						            <xsl:choose>
-							              <xsl:when test="$fStrikeBLTR=1">
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="concat($sAttribute, ' updiagonalstrike')"/>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="fStrikeTLBR" select="$fStrikeTLBR"/>
-									                  <xsl:with-param name="sAttribute" select="$sAttribute"/>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-					          <xsl:when test="string-length($fStrikeTLBR) &gt; 0">
-						            <xsl:choose>
-							              <xsl:when test="$fStrikeTLBR=1">
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="sAttribute" select="concat($sAttribute, ' downdiagonalstrike')"/>
-								                </xsl:call-template>
-							              </xsl:when>
-							              <xsl:otherwise>
-								                <xsl:call-template name="CreateMencloseNotationAttrFromBorderBoxAttr">
-									                  <xsl:with-param name="sAttribute" select="$sAttribute"/>
-								                </xsl:call-template>
-							              </xsl:otherwise>
-						            </xsl:choose>
-					          </xsl:when>
-					          <xsl:otherwise>
-						            <xsl:attribute name="notation">
-							              <xsl:value-of select="normalize-space($sAttribute)"/>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="string-length($fHideTop) &gt; 0">
+						<xsl:choose>
+							<xsl:when test="$fHideTop=1">
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fHideBot"
+										select="$fHideBot" />
+									<xsl:with-param name="fHideLeft"
+										select="$fHideLeft" />
+									<xsl:with-param name="fHideRight"
+										select="$fHideRight" />
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute">
+										<xsl:call-template name="SReplace">
+											<xsl:with-param name="sInput"
+												select="$sAttribute" />
+											<xsl:with-param name="sOrig" select="'top'" />
+											<xsl:with-param name="sReplacement"
+												select="''" />
+										</xsl:call-template>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fHideBot"
+										select="$fHideBot" />
+									<xsl:with-param name="fHideLeft"
+										select="$fHideLeft" />
+									<xsl:with-param name="fHideRight"
+										select="$fHideRight" />
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="$sAttribute" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when test="string-length($fHideBot) &gt; 0">
+						<xsl:choose>
+							<xsl:when test="$fHideBot=1">
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fHideLeft"
+										select="$fHideLeft" />
+									<xsl:with-param name="fHideRight"
+										select="$fHideRight" />
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute">
+										<xsl:call-template name="SReplace">
+											<xsl:with-param name="sInput"
+												select="$sAttribute" />
+											<xsl:with-param name="sOrig" select="'bottom'" />
+											<xsl:with-param name="sReplacement"
+												select="''" />
+										</xsl:call-template>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fHideLeft"
+										select="$fHideLeft" />
+									<xsl:with-param name="fHideRight"
+										select="$fHideRight" />
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="$sAttribute" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when test="string-length($fHideLeft) &gt; 0">
+						<xsl:choose>
+							<xsl:when test="$fHideLeft=1">
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fHideRight"
+										select="$fHideRight" />
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute">
+										<xsl:call-template name="SReplace">
+											<xsl:with-param name="sInput"
+												select="$sAttribute" />
+											<xsl:with-param name="sOrig" select="'left'" />
+											<xsl:with-param name="sReplacement"
+												select="''" />
+										</xsl:call-template>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fHideRight"
+										select="$fHideRight" />
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="$sAttribute" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when test="string-length($fHideRight) &gt; 0">
+						<xsl:choose>
+							<xsl:when test="$fHideRight=1">
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute">
+										<xsl:call-template name="SReplace">
+											<xsl:with-param name="sInput"
+												select="$sAttribute" />
+											<xsl:with-param name="sOrig" select="'right'" />
+											<xsl:with-param name="sReplacement"
+												select="''" />
+										</xsl:call-template>
+									</xsl:with-param>
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeH"
+										select="$fStrikeH" />
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="$sAttribute" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when test="string-length($fStrikeH) &gt; 0">
+						<xsl:choose>
+							<xsl:when test="$fStrikeH=1">
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="concat($sAttribute, ' horizontalstrike')" />
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeV"
+										select="$fStrikeV" />
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="$sAttribute" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when test="string-length($fStrikeV) &gt; 0">
+						<xsl:choose>
+							<xsl:when test="$fStrikeV=1">
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="concat($sAttribute, ' verticalstrike')" />
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeBLTR"
+										select="$fStrikeBLTR" />
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="$sAttribute" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when test="string-length($fStrikeBLTR) &gt; 0">
+						<xsl:choose>
+							<xsl:when test="$fStrikeBLTR=1">
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="concat($sAttribute, ' updiagonalstrike')" />
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="fStrikeTLBR"
+										select="$fStrikeTLBR" />
+									<xsl:with-param name="sAttribute"
+										select="$sAttribute" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when test="string-length($fStrikeTLBR) &gt; 0">
+						<xsl:choose>
+							<xsl:when test="$fStrikeTLBR=1">
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="sAttribute"
+										select="concat($sAttribute, ' downdiagonalstrike')" />
+								</xsl:call-template>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template
+									name="CreateMencloseNotationAttrFromBorderBoxAttr">
+									<xsl:with-param name="sAttribute"
+										select="$sAttribute" />
+								</xsl:call-template>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:attribute name="notation">
+							              <xsl:value-of
+							select="normalize-space($sAttribute)" />
 						            </xsl:attribute>
-					          </xsl:otherwise>
-				        </xsl:choose>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-	  <xsl:template name="checkDirectFormatting">
-	    <xsl:if test="w:rPr/w:rFonts/@w:ascii and not(w:rPr/w:rFonts/@w:ascii='Cambria Math')">
-	      <xsl:attribute name="fontfamily" select="w:rPr/w:rFonts/@w:ascii"/>
-	    </xsl:if>
-	    <xsl:choose>
-	      <xsl:when test="w:rPr/w:b[not(@w:val='0')]">
-		<xsl:attribute name="fontweight">bold</xsl:attribute>
-	      </xsl:when>
-	      <xsl:when test="w:rPr/w:b[@w:val='0']">
-		<xsl:attribute name="fontweight">normal</xsl:attribute>
-	      </xsl:when>
-	    </xsl:choose>
-	    <xsl:choose>
-	      <xsl:when test="w:rPr/w:i[not(@w:val='0')]">
-		<xsl:attribute name="fontstyle">italic</xsl:attribute>
-	      </xsl:when>
-	      <xsl:when test="w:rPr/w:i[@w:val='0']">
-		<xsl:attribute name="fontstyle">upright</xsl:attribute>
-	      </xsl:when>
-	    </xsl:choose>
-	  </xsl:template>
+	<xsl:template name="checkDirectFormatting">
+		<xsl:if
+			test="w:rPr/w:rFonts/@w:ascii and not(w:rPr/w:rFonts/@w:ascii='Cambria Math')">
+			<xsl:attribute name="fontfamily"
+				select="w:rPr/w:rFonts/@w:ascii" />
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="w:rPr/w:b[not(@w:val='0')]">
+				<xsl:attribute name="fontweight">bold</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="w:rPr/w:b[@w:val='0']">
+				<xsl:attribute name="fontweight">normal</xsl:attribute>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="w:rPr/w:i[not(@w:val='0')]">
+				<xsl:attribute name="fontstyle">italic</xsl:attribute>
+			</xsl:when>
+			<xsl:when test="w:rPr/w:i[@w:val='0']">
+				<xsl:attribute name="fontstyle">upright</xsl:attribute>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/functions.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/functions.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/functions.xsl	(revision 2397)
@@ -1,242 +1,318 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-		xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                version="2.0"
-                exclude-result-prefixes="cals ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn">
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI Utility stylesheet for making Word docx files
-        from TEI XML (see docx-tei.xsl)</p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" version="2.0"
+	exclude-result-prefixes="cals ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI Utility stylesheet for making Word docx files
+				from TEI XML (see docx-tei.xsl)</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: functions.xsl 9998 2012-01-02 18:27:15Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc></doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    
-      <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Converts a dimension into the 20th of a point.</desc></doc>
-      <xsl:function name="tei:convert-dim-pt20" as="xs:integer">
-        <xsl:param name="dim"/>
-	<xsl:value-of select="tei:convert-dim-pt($dim) * 20"/>
-      </xsl:function>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Convert a dimension into point.</desc></doc>
-      <xsl:function name="tei:convert-dim-pt" as="xs:integer">
-        <xsl:param name="dim"/>
-        <xsl:choose>
-	  <xsl:when test="ends-with($dim,'%')">
-	    <xsl:value-of select="number($pageWidth * number(substring($dim,0,string-length($dim)))) cast as xs:integer"/>
-	  </xsl:when>
-	  <xsl:when test="ends-with($dim,'cm')">
-	    <xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*28.3464567) cast as xs:integer"/>
-	  </xsl:when>
-	  <xsl:when test="ends-with($dim,'in')">
-	    <xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*72) cast as xs:integer"/>
-	  </xsl:when>
-	  <xsl:when test="ends-with($dim,'mm')">
-	    <xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*2.83464567) cast as xs:integer"/>
-	  </xsl:when>
-	  <xsl:when test="ends-with($dim,'pt')">
-	    <xsl:value-of select="number(substring($dim,0,string-length($dim)-1)) cast as xs:integer"/>
-	  </xsl:when>
-	  <xsl:when test="ends-with($dim,'px')">
-	    <xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*0.75) cast as xs:integer"/>
-	  </xsl:when>            
-	  <xsl:otherwise>
-	    -1
-	  </xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
-    
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Convert a dimension into english metric unit.</desc></doc>
-    <xsl:function name="tei:convert-dim-emu" as="xs:integer">
-        <xsl:param name="dim"/>
-	<xsl:variable name="result">
-	  <xsl:choose>
-            <xsl:when test="ends-with($dim,'cm')">
-	      <xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*3600) cast as xs:integer"/>
-            </xsl:when>
-            <xsl:when test="ends-with($dim,'in')">
-	      <xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*9144) cast as xs:integer"/>
-            </xsl:when>
-            <xsl:when test="ends-with($dim,'mm')">
-                <xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*360) cast as xs:integer"/>
-            </xsl:when>
-            <xsl:when test="ends-with($dim,'pt')">
-                <xsl:value-of select="number(number(number(substring($dim,0,string-length($dim)-1)) div 72) * 9144) cast as xs:integer"/>
-            </xsl:when>
-            <xsl:when test="ends-with($dim,'px')">
-                <xsl:value-of select="number(number(substring($dim,0,string-length($dim)-1))*95.25) cast as xs:integer"/>
-            </xsl:when>            
-            <xsl:otherwise>
-                -1
-            </xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
-	<xsl:value-of select="$result"/>
-    </xsl:function>
-    
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Returns a listtype for a given stylename (return empty string to figure it out dynamically).</desc></doc>
-    <xsl:function name="tei:get-listtype" as="xs:string">
-        <xsl:param name="style"/>
-        <xsl:text/>
-    </xsl:function>
-    
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Returns the correct heading style (return empty string to figure it out dynamically).</desc></doc>
-    <xsl:function name="tei:get-headingstyle" as="xs:string">
-        <xsl:param name="element"/>
-        <xsl:param name="level"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-        <xsl:text/>
-    </xsl:function>    
-    
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Defines whether or not a word paragraph is a first level heading.</desc></doc>
-    <xsl:function name="tei:is-firstlevel-heading" as="xs:boolean">
-        <xsl:param name="p"/>
-        
-        <xsl:choose>
-            <xsl:when test="$p[w:pPr/w:pStyle/@w:val='heading 1']">true</xsl:when>
-            <xsl:when test="$p[w:pPr/w:pStyle/@w:val='Heading 1']">true</xsl:when>
-            <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
-    
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Defines whether or not a word paragraph is a  heading.</desc></doc>
-    <xsl:function name="tei:is-heading" as="xs:boolean">
-        <xsl:param name="p"/>
-	<xsl:variable name="s" select="$p/w:pPr/w:pStyle/@w:val"/>
-      
-        <xsl:choose>
-            <xsl:when test="starts-with($s,'Heading')">true</xsl:when>
-            <xsl:when test="starts-with($s,'heading')">true</xsl:when>
-            <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: functions.xsl 9998 2012-01-02 18:27:15Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Defines whether or not a word paragraph is a list element.</desc></doc>
-    <xsl:function name="tei:is-list" as="xs:boolean">
-        <xsl:param name="p"/>        
-        <xsl:choose>
-            <xsl:when test="$p[contains(w:pPr/w:pStyle/@w:val,'List')]">true</xsl:when>
-            <xsl:when test="$p[w:pPr/w:pStyle/@w:val='dl']">true</xsl:when>
-            <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
 
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Defines whether or not a word paragraph is a table of contents.</desc></doc>
-    <xsl:function name="tei:is-toc" as="xs:boolean">
-        <xsl:param name="p"/>        
-        <xsl:choose>
-            <xsl:when test="$p[contains(w:pPr/w:pStyle/@w:val,'toc')]">true</xsl:when>
-            <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Converts a dimension into the 20th of a point.</desc>
+	</doc>
+	<xsl:function name="tei:convert-dim-pt20" as="xs:integer">
+		<xsl:param name="dim" />
+		<xsl:value-of select="tei:convert-dim-pt($dim) * 20" />
+	</xsl:function>
 
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Defines whether or not a word paragraph is a figure element.</desc></doc>
-    <xsl:function name="tei:is-figure" as="xs:boolean">
-        <xsl:param name="p"/>        
-        <xsl:choose>
-            <xsl:when test="$p[contains(w:pPr/w:pStyle/@w:val,'Figure')]">true</xsl:when>
-            <xsl:when test="$p[contains(w:pPr/w:pStyle/@w:val,'Caption')]">true</xsl:when>
-            <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
-    
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Convert a dimension into point.</desc>
+	</doc>
+	<xsl:function name="tei:convert-dim-pt" as="xs:integer">
+		<xsl:param name="dim" />
+		<xsl:choose>
+			<xsl:when test="ends-with($dim,'%')">
+				<xsl:value-of
+					select="number($pageWidth * number(substring($dim,0,string-length($dim)))) cast as xs:integer" />
+			</xsl:when>
+			<xsl:when test="ends-with($dim,'cm')">
+				<xsl:value-of
+					select="number(number(substring($dim,0,string-length($dim)-1))*28.3464567) cast as xs:integer" />
+			</xsl:when>
+			<xsl:when test="ends-with($dim,'in')">
+				<xsl:value-of
+					select="number(number(substring($dim,0,string-length($dim)-1))*72) cast as xs:integer" />
+			</xsl:when>
+			<xsl:when test="ends-with($dim,'mm')">
+				<xsl:value-of
+					select="number(number(substring($dim,0,string-length($dim)-1))*2.83464567) cast as xs:integer" />
+			</xsl:when>
+			<xsl:when test="ends-with($dim,'pt')">
+				<xsl:value-of
+					select="number(substring($dim,0,string-length($dim)-1)) cast as xs:integer" />
+			</xsl:when>
+			<xsl:when test="ends-with($dim,'px')">
+				<xsl:value-of
+					select="number(number(substring($dim,0,string-length($dim)-1))*0.75) cast as xs:integer" />
+			</xsl:when>
+			<xsl:otherwise>
+				-1
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
 
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Defines whether or not a word paragraph is a line of poetry.</desc></doc>
-    <xsl:function name="tei:is-line" as="xs:boolean">
-        <xsl:param name="p"/>        
-        <xsl:choose>
-            <xsl:when test="$p[w:pPr/w:pStyle/@w:val='tei_l']">true</xsl:when>
-            <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Convert a dimension into english metric unit.</desc>
+	</doc>
+	<xsl:function name="tei:convert-dim-emu" as="xs:integer">
+		<xsl:param name="dim" />
+		<xsl:variable name="result">
+			<xsl:choose>
+				<xsl:when test="ends-with($dim,'cm')">
+					<xsl:value-of
+						select="number(number(substring($dim,0,string-length($dim)-1))*3600) cast as xs:integer" />
+				</xsl:when>
+				<xsl:when test="ends-with($dim,'in')">
+					<xsl:value-of
+						select="number(number(substring($dim,0,string-length($dim)-1))*9144) cast as xs:integer" />
+				</xsl:when>
+				<xsl:when test="ends-with($dim,'mm')">
+					<xsl:value-of
+						select="number(number(substring($dim,0,string-length($dim)-1))*360) cast as xs:integer" />
+				</xsl:when>
+				<xsl:when test="ends-with($dim,'pt')">
+					<xsl:value-of
+						select="number(number(number(substring($dim,0,string-length($dim)-1)) div 72) * 9144) cast as xs:integer" />
+				</xsl:when>
+				<xsl:when test="ends-with($dim,'px')">
+					<xsl:value-of
+						select="number(number(substring($dim,0,string-length($dim)-1))*95.25) cast as xs:integer" />
+				</xsl:when>
+				<xsl:otherwise>
+					-1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:value-of select="$result" />
+	</xsl:function>
 
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Defines whether or not a word paragraph is gloss list.</desc></doc>
-    <xsl:function name="tei:is-glosslist" as="xs:boolean">
-        <xsl:param name="p"/>        
-        <xsl:choose>
-            <xsl:when test="$p[w:pPr/w:pStyle/@w:val='dl']">true</xsl:when>
-            <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
-    
-        <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Is given a header style and returns the style for the next level header.</desc></doc>
-    <xsl:function name="tei:get-nextlevel-header" as="xs:string">
-        <xsl:param name="current-header"/>
-        <xsl:value-of select="translate($current-header,'12345678','23456789')"/>
-    </xsl:function>
-    
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Returns a listtype for a given stylename (return empty string to
+			figure it out dynamically).</desc>
+	</doc>
+	<xsl:function name="tei:get-listtype" as="xs:string">
+		<xsl:param name="style" />
+		<xsl:text />
+	</xsl:function>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-		Returns the current date.</desc></doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Returns the correct heading style (return empty string to figure
+			it out dynamically).</desc>
+	</doc>
+	<xsl:function name="tei:get-headingstyle" as="xs:string">
+		<xsl:param name="element" />
+		<xsl:param name="level" />
 
-	  <xsl:function name="tei:whatsTheDate">
-        <xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')"/>
-    </xsl:function>
+		<xsl:text />
+	</xsl:function>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Defines whether or not a word paragraph is a first level
+			heading.</desc>
+	</doc>
+	<xsl:function name="tei:is-firstlevel-heading"
+		as="xs:boolean">
+		<xsl:param name="p" />
+
+		<xsl:choose>
+			<xsl:when test="$p[w:pPr/w:pStyle/@w:val='heading 1']">
+				true
+			</xsl:when>
+			<xsl:when test="$p[w:pPr/w:pStyle/@w:val='Heading 1']">
+				true
+			</xsl:when>
+			<xsl:otherwise>
+				false
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Defines whether or not a word paragraph is a heading.</desc>
+	</doc>
+	<xsl:function name="tei:is-heading" as="xs:boolean">
+		<xsl:param name="p" />
+		<xsl:variable name="s" select="$p/w:pPr/w:pStyle/@w:val" />
+
+		<xsl:choose>
+			<xsl:when test="starts-with($s,'Heading')">
+				true
+			</xsl:when>
+			<xsl:when test="starts-with($s,'heading')">
+				true
+			</xsl:when>
+			<xsl:otherwise>
+				false
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Defines whether or not a word paragraph is a list element.</desc>
+	</doc>
+	<xsl:function name="tei:is-list" as="xs:boolean">
+		<xsl:param name="p" />
+		<xsl:choose>
+			<xsl:when test="$p[contains(w:pPr/w:pStyle/@w:val,'List')]">
+				true
+			</xsl:when>
+			<xsl:when test="$p[w:pPr/w:pStyle/@w:val='dl']">
+				true
+			</xsl:when>
+			<xsl:otherwise>
+				false
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Defines whether or not a word paragraph is a table of contents.</desc>
+	</doc>
+	<xsl:function name="tei:is-toc" as="xs:boolean">
+		<xsl:param name="p" />
+		<xsl:choose>
+			<xsl:when test="$p[contains(w:pPr/w:pStyle/@w:val,'toc')]">
+				true
+			</xsl:when>
+			<xsl:otherwise>
+				false
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Defines whether or not a word paragraph is a figure element.</desc>
+	</doc>
+	<xsl:function name="tei:is-figure" as="xs:boolean">
+		<xsl:param name="p" />
+		<xsl:choose>
+			<xsl:when
+				test="$p[contains(w:pPr/w:pStyle/@w:val,'Figure')]">
+				true
+			</xsl:when>
+			<xsl:when
+				test="$p[contains(w:pPr/w:pStyle/@w:val,'Caption')]">
+				true
+			</xsl:when>
+			<xsl:otherwise>
+				false
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Defines whether or not a word paragraph is a line of poetry.</desc>
+	</doc>
+	<xsl:function name="tei:is-line" as="xs:boolean">
+		<xsl:param name="p" />
+		<xsl:choose>
+			<xsl:when test="$p[w:pPr/w:pStyle/@w:val='tei_l']">
+				true
+			</xsl:when>
+			<xsl:otherwise>
+				false
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Defines whether or not a word paragraph is gloss list.</desc>
+	</doc>
+	<xsl:function name="tei:is-glosslist" as="xs:boolean">
+		<xsl:param name="p" />
+		<xsl:choose>
+			<xsl:when test="$p[w:pPr/w:pStyle/@w:val='dl']">
+				true
+			</xsl:when>
+			<xsl:otherwise>
+				false
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Is given a header style and returns the style for the next level
+			header.</desc>
+	</doc>
+	<xsl:function name="tei:get-nextlevel-header"
+		as="xs:string">
+		<xsl:param name="current-header" />
+		<xsl:value-of
+			select="translate($current-header,'12345678','23456789')" />
+	</xsl:function>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Returns the current date.</desc>
+	</doc>
+
+	<xsl:function name="tei:whatsTheDate">
+		<xsl:value-of
+			select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')" />
+	</xsl:function>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/variables.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/variables.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/variables.xsl	(revision 2397)
@@ -1,80 +1,144 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                
-                version="2.0">
-	
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI Utility stylesheet for making Word docx files from TEI XML (see tei-docx.xsl)</p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI Utility stylesheet for making Word docx files from TEI XML
+				(see tei-docx.xsl)</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: variables.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-	
-	
-	  <xsl:variable name="Heading">heading</xsl:variable>
-	  <xsl:variable name="Heading1">heading 1</xsl:variable>
-	  <xsl:variable name="Heading2">heading 2</xsl:variable>
-	  <xsl:variable name="Heading3">heading 3</xsl:variable>
-	  <xsl:variable name="Heading4">heading 4</xsl:variable>
-	  <xsl:variable name="Heading5">heading 5</xsl:variable>
-	  <xsl:variable name="Heading6">heading 6</xsl:variable>
-	  <xsl:variable name="List">List</xsl:variable>
-	  <xsl:variable name="List2">List 2</xsl:variable>
-	  <xsl:variable name="List3">List 3</xsl:variable>
-	  <xsl:variable name="List4">List 4</xsl:variable>
-	  <xsl:variable name="List5">List 5</xsl:variable>
-	  <xsl:variable name="ListBullet">List Bullet</xsl:variable>
-	  <xsl:variable name="ListBullet2">List Bullet 2</xsl:variable>
-	  <xsl:variable name="ListBullet3">List Bullet 3</xsl:variable>
-	  <xsl:variable name="ListBullet4">List Bullet 4</xsl:variable>
-	  <xsl:variable name="ListBullet5">List Bullet 5</xsl:variable>
-	  <xsl:variable name="ListContinue">List Continue</xsl:variable>
-	  <xsl:variable name="ListContinue2">List Continue 2</xsl:variable>
-	  <xsl:variable name="ListContinue3">List Continue 3</xsl:variable>
-	  <xsl:variable name="ListContinue4">List Continue 4</xsl:variable>
-	  <xsl:variable name="ListContinue5">List Continue 5</xsl:variable>
-	  <xsl:variable name="ListNumber">List Number</xsl:variable>
-	  <xsl:variable name="ListNumber2">List Number 2</xsl:variable>
-	  <xsl:variable name="ListNumber3">List Number 3</xsl:variable>
-	  <xsl:variable name="ListNumber4">List Number 4</xsl:variable>
-	  <xsl:variable name="ListNumber5">List Number 5</xsl:variable>
-	  <xsl:variable name="Note">Note</xsl:variable>
-	  <xsl:variable name="TableText">Tabletext9</xsl:variable>
-	  <xsl:variable name="Tabletitle">Table title</xsl:variable>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: variables.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+	<xsl:variable name="Heading">
+		heading
+	</xsl:variable>
+	<xsl:variable name="Heading1">
+		heading 1
+	</xsl:variable>
+	<xsl:variable name="Heading2">
+		heading 2
+	</xsl:variable>
+	<xsl:variable name="Heading3">
+		heading 3
+	</xsl:variable>
+	<xsl:variable name="Heading4">
+		heading 4
+	</xsl:variable>
+	<xsl:variable name="Heading5">
+		heading 5
+	</xsl:variable>
+	<xsl:variable name="Heading6">
+		heading 6
+	</xsl:variable>
+	<xsl:variable name="List">
+		List
+	</xsl:variable>
+	<xsl:variable name="List2">
+		List 2
+	</xsl:variable>
+	<xsl:variable name="List3">
+		List 3
+	</xsl:variable>
+	<xsl:variable name="List4">
+		List 4
+	</xsl:variable>
+	<xsl:variable name="List5">
+		List 5
+	</xsl:variable>
+	<xsl:variable name="ListBullet">
+		List Bullet
+	</xsl:variable>
+	<xsl:variable name="ListBullet2">
+		List Bullet 2
+	</xsl:variable>
+	<xsl:variable name="ListBullet3">
+		List Bullet 3
+	</xsl:variable>
+	<xsl:variable name="ListBullet4">
+		List Bullet 4
+	</xsl:variable>
+	<xsl:variable name="ListBullet5">
+		List Bullet 5
+	</xsl:variable>
+	<xsl:variable name="ListContinue">
+		List Continue
+	</xsl:variable>
+	<xsl:variable name="ListContinue2">
+		List Continue 2
+	</xsl:variable>
+	<xsl:variable name="ListContinue3">
+		List Continue 3
+	</xsl:variable>
+	<xsl:variable name="ListContinue4">
+		List Continue 4
+	</xsl:variable>
+	<xsl:variable name="ListContinue5">
+		List Continue 5
+	</xsl:variable>
+	<xsl:variable name="ListNumber">
+		List Number
+	</xsl:variable>
+	<xsl:variable name="ListNumber2">
+		List Number 2
+	</xsl:variable>
+	<xsl:variable name="ListNumber3">
+		List Number 3
+	</xsl:variable>
+	<xsl:variable name="ListNumber4">
+		List Number 4
+	</xsl:variable>
+	<xsl:variable name="ListNumber5">
+		List Number 5
+	</xsl:variable>
+	<xsl:variable name="Note">
+		Note
+	</xsl:variable>
+	<xsl:variable name="TableText">
+		Tabletext9
+	</xsl:variable>
+	<xsl:variable name="Tabletitle">
+		Table title
+	</xsl:variable>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/graphics/fixgraphics.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/graphics/fixgraphics.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/graphics/fixgraphics.xsl	(revision 2397)
@@ -1,95 +1,105 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the core module. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module. </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: fixgraphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:output method="xml" indent="yes"/>
-  <xsl:param name="DIR"/>
-  <xsl:key name="W" match="tiff:ImageWidth" use="1"/>
-  <xsl:key name="H" match="tiff:ImageLength" use="1"/>
-  <xsl:template match="@*|text()|comment()|processing-instruction()">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  
-  <xsl:template match="*">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-  </xsl:template>
-  
-  
-  <xsl:template match="tei:graphic">
-      <xsl:copy>
-	        <xsl:variable name="newName">
-	           <xsl:text>media/resource</xsl:text>
-	           <xsl:number level="any"/>
-	           <xsl:text>.</xsl:text>
-	           <xsl:value-of select="tokenize(@url,'\.')[last()]"/>
-	        </xsl:variable>
-	        <xsl:attribute name="url">
-	           <xsl:value-of select="$newName"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: fixgraphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:output method="xml" indent="yes" />
+	<xsl:param name="DIR" />
+	<xsl:key name="W" match="tiff:ImageWidth" use="1" />
+	<xsl:key name="H" match="tiff:ImageLength" use="1" />
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+
+	<xsl:template match="tei:graphic">
+		<xsl:copy>
+			<xsl:variable name="newName">
+				<xsl:text>media/resource</xsl:text>
+				<xsl:number level="any" />
+				<xsl:text>.</xsl:text>
+				<xsl:value-of select="tokenize(@url,'\.')[last()]" />
+			</xsl:variable>
+			<xsl:attribute name="url">
+	           <xsl:value-of select="$newName" />
 	        </xsl:attribute>
-	        <xsl:copy-of select="@n"/>
-	        <xsl:copy-of select="@height"/>
-	        <xsl:copy-of select="@width"/>
-	        <xsl:copy-of select="@scale"/>
-		
-	        <xsl:if test="doc-available(concat($DIR,'/',$newName,'.xmp'))">
-	           <xsl:attribute name="tei:width">
-	              <xsl:for-each select="document(concat($DIR,'/',$newName,'.xmp'),/)">
-	                 <xsl:value-of select="(number(key('W',1)) div 72) * 9144"/>
+			<xsl:copy-of select="@n" />
+			<xsl:copy-of select="@height" />
+			<xsl:copy-of select="@width" />
+			<xsl:copy-of select="@scale" />
+
+			<xsl:if test="doc-available(concat($DIR,'/',$newName,'.xmp'))">
+				<xsl:attribute name="tei:width">
+	              <xsl:for-each
+					select="document(concat($DIR,'/',$newName,'.xmp'),/)">
+	                 <xsl:value-of
+					select="(number(key('W',1)) div 72) * 9144" />
 	              </xsl:for-each>
 	           </xsl:attribute>
-	  
-	           <xsl:attribute name="tei:height">
-	              <xsl:for-each select="document(concat($DIR,'/',$newName,'.xmp'),/)">
-	                 <xsl:value-of select="(number(key('H',1)) div 72) * 9144"/>
+
+				<xsl:attribute name="tei:height">
+	              <xsl:for-each
+					select="document(concat($DIR,'/',$newName,'.xmp'),/)">
+	                 <xsl:value-of
+					select="(number(key('H',1)) div 72) * 9144" />
 	              </xsl:for-each>
 	           </xsl:attribute>
-	        </xsl:if>
-      </xsl:copy>
-  </xsl:template>
+			</xsl:if>
+		</xsl:copy>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/graphics/listgraphics.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/graphics/listgraphics.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/utils/graphics/listgraphics.xsl	(revision 2397)
@@ -1,105 +1,111 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-		xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet to make a script to copy graphics files</p>
-         <p>This software is dual-licensed:
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet to make a script to copy graphics files</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: listgraphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:output method="text"/>
-  <xsl:param name="DIR"/>
-  <xsl:param name="ORIG">.</xsl:param>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: listgraphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <xsl:key match="tei:graphic[not(ancestor::teix:egXML)]" use="1" name="G"/>
-  <xsl:key match="o:OLEObject" use="1" name="BINARY"/>
-  <xsl:key match="v:imagedata" use="1" name="BINARY"/>
+	<xsl:output method="text" />
+	<xsl:param name="DIR" />
+	<xsl:param name="ORIG">
+		.
+	</xsl:param>
 
-  <xsl:template match="/">
-      <xsl:for-each select="key('BINARY',1)">
-	     <xsl:text>cp </xsl:text>
-	     <xsl:value-of select="@r:id"/>
-	     <xsl:text> </xsl:text>
-	     <xsl:value-of select="$DIR"/>
-	     <xsl:text>&#10;</xsl:text>
-      </xsl:for-each>
-      <xsl:for-each select="key('G',1)">
-         <xsl:variable name="F">
-            <xsl:value-of select="@url"/>
-         </xsl:variable>
-	 <xsl:variable name="target">
-	   <xsl:value-of select="$DIR"/>
-	   <xsl:text>/image</xsl:text>
-	   <xsl:number level="any"/>
-	   <xsl:text>.</xsl:text>
-	   <xsl:value-of select="tokenize($F,'\.')[last()]"/>
-	 </xsl:variable>
-         <xsl:choose>
-	   <xsl:when test="starts-with($F,'http')">
-	     <xsl:text>curl -s -o </xsl:text>
-	     <xsl:value-of select="$target"/>
-	     <xsl:text> </xsl:text>
-	     <xsl:value-of select="$F"/> 
-	   </xsl:when>
-	   <xsl:when test="starts-with($F,'/')">
-	     <xsl:text>cp "</xsl:text>
-	     <xsl:value-of select="$F"/> 
-	     <xsl:text>" </xsl:text>
-	     <xsl:value-of select="$target"/>
-	   </xsl:when>
-	   <xsl:otherwise> 
-	     <xsl:text>cp "</xsl:text>
-	     <xsl:value-of select="$ORIG"/>
-	     <xsl:text>/</xsl:text>
-	     <xsl:value-of select="$F"/> 
-	     <xsl:text>" </xsl:text>
-	     <xsl:value-of select="$target"/>
-	   </xsl:otherwise>
-         </xsl:choose>
-         <xsl:text>&#10;</xsl:text>
-      </xsl:for-each>
+	<xsl:key match="tei:graphic[not(ancestor::teix:egXML)]" use="1"
+		name="G" />
+	<xsl:key match="o:OLEObject" use="1" name="BINARY" />
+	<xsl:key match="v:imagedata" use="1" name="BINARY" />
 
-  </xsl:template>
+	<xsl:template match="/">
+		<xsl:for-each select="key('BINARY',1)">
+			<xsl:text>cp </xsl:text>
+			<xsl:value-of select="@r:id" />
+			<xsl:text> </xsl:text>
+			<xsl:value-of select="$DIR" />
+			<xsl:text>&#10;</xsl:text>
+		</xsl:for-each>
+		<xsl:for-each select="key('G',1)">
+			<xsl:variable name="F">
+				<xsl:value-of select="@url" />
+			</xsl:variable>
+			<xsl:variable name="target">
+				<xsl:value-of select="$DIR" />
+				<xsl:text>/image</xsl:text>
+				<xsl:number level="any" />
+				<xsl:text>.</xsl:text>
+				<xsl:value-of select="tokenize($F,'\.')[last()]" />
+			</xsl:variable>
+			<xsl:choose>
+				<xsl:when test="starts-with($F,'http')">
+					<xsl:text>curl -s -o </xsl:text>
+					<xsl:value-of select="$target" />
+					<xsl:text> </xsl:text>
+					<xsl:value-of select="$F" />
+				</xsl:when>
+				<xsl:when test="starts-with($F,'/')">
+					<xsl:text>cp "</xsl:text>
+					<xsl:value-of select="$F" />
+					<xsl:text>" </xsl:text>
+					<xsl:value-of select="$target" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>cp "</xsl:text>
+					<xsl:value-of select="$ORIG" />
+					<xsl:text>/</xsl:text>
+					<xsl:value-of select="$F" />
+					<xsl:text>" </xsl:text>
+					<xsl:value-of select="$target" />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>&#10;</xsl:text>
+		</xsl:for-each>
 
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/maths/maths.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/maths/maths.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/maths/maths.xsl	(revision 2397)
@@ -1,168 +1,177 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-		xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso   rel  tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso   rel  tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: maths.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-    <xsl:template match="m:oMath">
-        <xsl:apply-templates select="." mode="iden"/>
-    </xsl:template>
-    
-    
-    <xsl:template match="mml:math">
-      <oMath xmlns="http://schemas.openxmlformats.org/officeDocument/2006/math">
-	        <xsl:apply-templates mode="mml"/>
-      </oMath>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Process Word objects
-    </desc>
-   </doc>
-   <xsl:template match="w:object">
-     <xsl:variable name="renderingProperties">
-       <xsl:for-each select="..">
-	 <xsl:call-template name="applyRend"/>
-       </xsl:for-each>
-     </xsl:variable>
-     <w:r>
-       <xsl:if test="$renderingProperties/*">
-	 <w:rPr>
-	   <xsl:copy-of select="$renderingProperties"/>
-	 </w:rPr>
-       </xsl:if>
-       <xsl:copy>
-	 <xsl:apply-templates mode="iden"/>
-       </xsl:copy>
-     </w:r>
-   </xsl:template>
+				All rights reserved.
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Image data 
-    </desc>
-   </doc>
-    <xsl:template match="v:imagedata" mode="iden">
-        <xsl:variable name="current" select="@r:id"/>
-	<xsl:copy>
-	    <!-- override r:id -->
-            <xsl:attribute name="r:id">
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: maths.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:template match="m:oMath">
+		<xsl:apply-templates select="." mode="iden" />
+	</xsl:template>
+
+
+	<xsl:template match="mml:math">
+		<oMath
+			xmlns="http://schemas.openxmlformats.org/officeDocument/2006/math">
+			<xsl:apply-templates mode="mml" />
+		</oMath>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Process Word objects
+		</desc>
+	</doc>
+	<xsl:template match="w:object">
+		<xsl:variable name="renderingProperties">
+			<xsl:for-each select="..">
+				<xsl:call-template name="applyRend" />
+			</xsl:for-each>
+		</xsl:variable>
+		<w:r>
+			<xsl:if test="$renderingProperties/*">
+				<w:rPr>
+					<xsl:copy-of select="$renderingProperties" />
+				</w:rPr>
+			</xsl:if>
+			<xsl:copy>
+				<xsl:apply-templates mode="iden" />
+			</xsl:copy>
+		</w:r>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Image data
+		</desc>
+	</doc>
+	<xsl:template match="v:imagedata" mode="iden">
+		<xsl:variable name="current" select="@r:id" />
+		<xsl:copy>
+			<!-- override r:id -->
+			<xsl:attribute name="r:id">
 	      <xsl:choose>
 		<xsl:when test="$isofreestanding='true'">
-		  <xsl:variable name="me" select="generate-id()"/>
+		  <xsl:variable name="me" select="generate-id()" />
 		  <xsl:for-each select="key('IMAGEDATA',1)">
 		    <xsl:if test="generate-id()=$me">
-		      <xsl:value-of select="concat('rId', string(1000 + position()))"/>
+		      <xsl:value-of
+				select="concat('rId', string(1000 + position()))" />
 		    </xsl:if>
 		  </xsl:for-each>
 		</xsl:when>
 		<xsl:otherwise>
-		  <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Target=$current]/@Id"/>
+		  <xsl:value-of
+				select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Target=$current]/@Id" />
 		</xsl:otherwise>
 	      </xsl:choose>
             </xsl:attribute>
-	</xsl:copy>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        OLE objects
-    </desc>
-   </doc>
-    <xsl:template match="o:OLEObject" mode="iden">
-        <xsl:variable name="current" select="@r:id"/>
-        <xsl:copy>
-            <!-- copy all attributes -->
-            <xsl:copy-of select="@*"/>
-            <!-- set rId -->
-            <xsl:attribute name="r:id">
+		</xsl:copy>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			OLE objects
+		</desc>
+	</doc>
+	<xsl:template match="o:OLEObject" mode="iden">
+		<xsl:variable name="current" select="@r:id" />
+		<xsl:copy>
+			<!-- copy all attributes -->
+			<xsl:copy-of select="@*" />
+			<!-- set rId -->
+			<xsl:attribute name="r:id">
 	      <xsl:choose>
 		<xsl:when test="$isofreestanding='true'">
-		  <xsl:variable name="me" select="generate-id()"/>
+		  <xsl:variable name="me" select="generate-id()" />
 		  <xsl:for-each select="key('OLEOBJECTS',1)">
 		    <xsl:if test="generate-id()=$me">
-		      <xsl:value-of select="concat('rId', string(2000 + position()))"/>
+		      <xsl:value-of
+				select="concat('rId', string(2000 + position()))" />
 		    </xsl:if>
 		  </xsl:for-each>
 		</xsl:when>
 		<xsl:otherwise>
-		  <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Target=$current]/@Id"/>
+		  <xsl:value-of
+				select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Target=$current]/@Id" />
 		</xsl:otherwise>
 	      </xsl:choose>
             </xsl:attribute>
-	</xsl:copy>
-    </xsl:template>
-    
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/lists/lists.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/lists/lists.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/lists/lists.xsl	(revision 2397)
@@ -1,231 +1,244 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-    <xsl:key name="AN"
-	 match="w:abstractNum"
-	 use="w:lvl/w:pStyle/@w:val"/>
-    <xsl:key name="NUMS"
-	     match="w:num[not(w:lvlOverride)]"
-	     use="w:abstractNumId/@w:val"/>
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:key name="AN" match="w:abstractNum"
+		use="w:lvl/w:pStyle/@w:val" />
+	<xsl:key name="NUMS" match="w:num[not(w:lvlOverride)]"
+		use="w:abstractNumId/@w:val" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: lists.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Handle value lists
-    </desc>
-   </doc>
-    <xsl:template match="tei:label[following-sibling::tei:*[1]/self::tei:item]">
-        <xsl:param name="nop"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-        <w:p>
-            <w:pPr>
-                <w:pStyle w:val="dl"/>
-                <w:ind w:left="567" w:hanging="567"/>
-            </w:pPr>
-            <xsl:apply-templates>
-                <xsl:with-param name="nop">true</xsl:with-param>
-            </xsl:apply-templates>
-            <w:r>
-                <w:tab/>
-            </w:r>
-            <xsl:for-each select="following-sibling::tei:item[1]">
-                <xsl:apply-templates>
-                    <xsl:with-param name="nop">true</xsl:with-param>
-                </xsl:apply-templates>
-            </xsl:for-each>
-        </w:p>
-    </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: lists.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-    <xsl:template match="tei:item/tei:list">
-        <xsl:param name="nop"/>
-        <xsl:apply-templates>
-            <xsl:with-param name="nop">false</xsl:with-param>
-        </xsl:apply-templates>
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handle value lists
+		</desc>
+	</doc>
+	<xsl:template
+		match="tei:label[following-sibling::tei:*[1]/self::tei:item]">
+		<xsl:param name="nop" />
 
-    <xsl:template match="tei:item[preceding-sibling::tei:*[1]/self::tei:label]"/>
+		<w:p>
+			<w:pPr>
+				<w:pStyle w:val="dl" />
+				<w:ind w:left="567" w:hanging="567" />
+			</w:pPr>
+			<xsl:apply-templates>
+				<xsl:with-param name="nop">
+					true
+				</xsl:with-param>
+			</xsl:apply-templates>
+			<w:r>
+				<w:tab />
+			</w:r>
+			<xsl:for-each select="following-sibling::tei:item[1]">
+				<xsl:apply-templates>
+					<xsl:with-param name="nop">
+						true
+					</xsl:with-param>
+				</xsl:apply-templates>
+			</xsl:for-each>
+		</w:p>
+	</xsl:template>
 
+	<xsl:template match="tei:item/tei:list">
+		<xsl:param name="nop" />
+		<xsl:apply-templates>
+			<xsl:with-param name="nop">
+				false
+			</xsl:with-param>
+		</xsl:apply-templates>
+	</xsl:template>
 
-    <xsl:template match="comment()"/>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc> 
-        Handle list items
-    </desc>
-   </doc>
-    <xsl:template match="tei:item">
-        <xsl:param name="nop"/>
-        <xsl:variable name="listStyle">
-            <xsl:choose>
-                <xsl:when test="../@type='unordered' or ../@type='simple' or not(../@type)">
-                    <xsl:call-template name="getStyleName">
-                        <xsl:with-param name="in">
-                            <xsl:text>List Continue</xsl:text>
-                            <xsl:call-template name="listNumberDepth"/>
-                        </xsl:with-param>
-                    </xsl:call-template>
-                </xsl:when>
-                <xsl:when test="../@type='ordered'">
-                    <xsl:call-template name="getStyleName">
-                        <xsl:with-param name="in">
-                            <xsl:text>List Number</xsl:text>
-                            <xsl:call-template name="listNumberDepth"/>
-                        </xsl:with-param>
-                    </xsl:call-template>
-                </xsl:when>
-                <xsl:when test="../@type='termlist'"/>
-                <xsl:otherwise>
-                    <xsl:text>ListParagraph</xsl:text>
-                </xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
-        <xsl:variable name="pPr">
-            <w:pPr>
-                <xsl:if test="string-length($listStyle) &gt; 1">
-                    <w:pStyle w:val="{$listStyle}"/>
-                </xsl:if>
-                <xsl:choose>
-                    <xsl:when test="../@type='unordered' or not(../@type)">
-                        <w:numPr>
-                            <w:ilvl>
-                                <xsl:attribute name="w:val">
-                                    <xsl:value-of select="count(ancestor::tei:list) - 1"/>
+	<xsl:template
+		match="tei:item[preceding-sibling::tei:*[1]/self::tei:label]" />
+
+
+	<xsl:template match="comment()" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handle list items
+		</desc>
+	</doc>
+	<xsl:template match="tei:item">
+		<xsl:param name="nop" />
+		<xsl:variable name="listStyle">
+			<xsl:choose>
+				<xsl:when
+					test="../@type='unordered' or ../@type='simple' or not(../@type)">
+					<xsl:call-template name="getStyleName">
+						<xsl:with-param name="in">
+							<xsl:text>List Continue</xsl:text>
+							<xsl:call-template name="listNumberDepth" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:when test="../@type='ordered'">
+					<xsl:call-template name="getStyleName">
+						<xsl:with-param name="in">
+							<xsl:text>List Number</xsl:text>
+							<xsl:call-template name="listNumberDepth" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:when test="../@type='termlist'" />
+				<xsl:otherwise>
+					<xsl:text>ListParagraph</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="pPr">
+			<w:pPr>
+				<xsl:if test="string-length($listStyle) &gt; 1">
+					<w:pStyle w:val="{$listStyle}" />
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="../@type='unordered' or not(../@type)">
+						<w:numPr>
+							<w:ilvl>
+								<xsl:attribute name="w:val">
+                                    <xsl:value-of
+									select="count(ancestor::tei:list) - 1" />
                                 </xsl:attribute>
-                            </w:ilvl>
-			    <w:numId>
-			      <xsl:attribute name="w:val">
+							</w:ilvl>
+							<w:numId>
+								<xsl:attribute name="w:val">
 				<xsl:choose>
-				  <xsl:when
-				      test="$isofreestanding='true'">
+				  <xsl:when test="$isofreestanding='true'">
 				    <xsl:text>2</xsl:text>
 				  </xsl:when>
 				  <xsl:otherwise>
-				    <xsl:for-each select="document(concat($wordDirectory,'/word/numbering.xml'))">
+				    <xsl:for-each
+									select="document(concat($wordDirectory,'/word/numbering.xml'))">
 				      <xsl:variable name="abstractNumId"
-						    select="key('AN',$listStyle)/@w:abstractNumId"/>
-				      <xsl:value-of select="key('NUMS',$abstractNumId)/@w:numId"/>
+									select="key('AN',$listStyle)/@w:abstractNumId" />
+				      <xsl:value-of
+									select="key('NUMS',$abstractNumId)/@w:numId" />
 				    </xsl:for-each>
 				  </xsl:otherwise>
 				</xsl:choose>
 			      </xsl:attribute>
-			    </w:numId>
-			</w:numPr>
-                    </xsl:when>
-                    <xsl:when test="../@type='ordered'">
-                        <w:numPr>
-                            <w:ilvl>
-                                <xsl:attribute name="w:val">
-                                    <xsl:value-of select="count(ancestor::tei:list) - 1"/>
+							</w:numId>
+						</w:numPr>
+					</xsl:when>
+					<xsl:when test="../@type='ordered'">
+						<w:numPr>
+							<w:ilvl>
+								<xsl:attribute name="w:val">
+                                    <xsl:value-of
+									select="count(ancestor::tei:list) - 1" />
                                 </xsl:attribute>
-                            </w:ilvl>
-                            <w:numId>
-			      <xsl:attribute name="w:val">
+							</w:ilvl>
+							<w:numId>
+								<xsl:attribute name="w:val">
 				<!-- @see template: numbering-definition ordered lists -->
 				<xsl:variable name="CurrentList">
-				  <xsl:value-of select="generate-id(..)"/>
+				  <xsl:value-of select="generate-id(..)" />
 				</xsl:variable>
 				<xsl:for-each select="key('OL',1)">
 				  <xsl:if test="$CurrentList=generate-id(.)">
-				    <xsl:value-of select="position()+100"/>
+				    <xsl:value-of select="position()+100" />
 				  </xsl:if>
 				</xsl:for-each>
 			      </xsl:attribute>
-                            </w:numId>
-                        </w:numPr>
-                    </xsl:when>
-                </xsl:choose>
-            </w:pPr>
-        </xsl:variable>
-	<!--
-	    <xsl:message>List item <xsl:value-of select="."/>, <xsl:value-of
-	    select="$nop"/>, <xsl:value-of select="$listStyle"/></xsl:message>
-	-->
-        <xsl:call-template name="block-element">
-            <xsl:with-param name="pPr" select="$pPr"/>
-            <xsl:with-param name="nop" select="$nop"/>
-        </xsl:call-template>
-    </xsl:template>
+							</w:numId>
+						</w:numPr>
+					</xsl:when>
+				</xsl:choose>
+			</w:pPr>
+		</xsl:variable>
+		<!-- <xsl:message>List item <xsl:value-of select="."/>, <xsl:value-of select="$nop"/>, 
+			<xsl:value-of select="$listStyle"/></xsl:message> -->
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="pPr" select="$pPr" />
+			<xsl:with-param name="nop" select="$nop" />
+		</xsl:call-template>
+	</xsl:template>
 
-    <xsl:template name="listNumberDepth">
-        <xsl:choose>
-            <xsl:when test="ancestor::tei:glossListEntry">
-                <xsl:value-of select="count(ancestor::tei:list)                 + ancestor::tei:glossListEntry/@count"/>
-            </xsl:when>
-            <xsl:when test="parent::tei:list/ancestor::tei:list">
-                <xsl:text> </xsl:text>
-                <xsl:value-of select="count(ancestor::tei:list)"/>
-            </xsl:when>
-        </xsl:choose>
-    </xsl:template>
+	<xsl:template name="listNumberDepth">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:glossListEntry">
+				<xsl:value-of
+					select="count(ancestor::tei:list)                 + ancestor::tei:glossListEntry/@count" />
+			</xsl:when>
+			<xsl:when test="parent::tei:list/ancestor::tei:list">
+				<xsl:text> </xsl:text>
+				<xsl:value-of select="count(ancestor::tei:list)" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/templates/default.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/templates/default.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/templates/default.xml	(revision 2397)
@@ -1,48 +1,61 @@
-<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0"
-     xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-     xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-     xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-     xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-     xml:lang="en">
-  <text>
-      <fw xml:id="rId101" type="footer">
-         <p rend="Footer">
-            <teidocx:dynamicContent type="pagenumber"/>
-            <c rend="ptab" type="center">	</c>
-            <c rend="ptab" type="right">	</c></p>
-      </fw>
-      <fw xml:id="rId102" type="footer">
-         <p rend="Footer">
-	   <c rend="ptab" type="center">	</c>
-	   <c rend="ptab" type="right">	</c>
-	   <teidocx:dynamicContent type="pagenumber"/>
-         </p>
-      </fw>
-      <fw xml:id="rId103" type="footer">
-         <p rend="Footer">
-	   <c rend="ptab" type="center">	</c>
-	   <teidocx:dynamicContent type="pagenumber"/>
-         </p>
-      </fw>
-      <fw xml:id="rId104" type="header">
-         <p rend="Header"><seg> </seg>
-         </p>
-      </fw>
-      <fw xml:id="rId105" type="header">
-         <p rend="Header"><seg> </seg>
-         </p>
-      </fw>
-      <fw xml:id="rId106" type="header">
-         <p rend="Header"><seg> </seg>
-         </p>
-      </fw>
-      <milestone unit="section">
-	<teidocx:footer type="even" ref="rId101"/>
-	<teidocx:footer type="default" ref="rId102"/>
-	<teidocx:footer type="first" ref="rId103"/>
-	<teidocx:header type="even" ref="rId104"/>
-	<teidocx:header type="default" ref="rId105"/>
-	<teidocx:header type="first" ref="rId106"/>
-      </milestone>
-  </text>
+<TEI xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xml:lang="en">
+	<text>
+		<fw xml:id="rId101" type="footer">
+			<p rend="Footer">
+				<teidocx:dynamicContent type="pagenumber" />
+				<c rend="ptab" type="center">
+				</c>
+				<c rend="ptab" type="right">
+				</c>
+			</p>
+		</fw>
+		<fw xml:id="rId102" type="footer">
+			<p rend="Footer">
+				<c rend="ptab" type="center">
+				</c>
+				<c rend="ptab" type="right">
+				</c>
+				<teidocx:dynamicContent type="pagenumber" />
+			</p>
+		</fw>
+		<fw xml:id="rId103" type="footer">
+			<p rend="Footer">
+				<c rend="ptab" type="center">
+				</c>
+				<teidocx:dynamicContent type="pagenumber" />
+			</p>
+		</fw>
+		<fw xml:id="rId104" type="header">
+			<p rend="Header">
+				<seg>
+				</seg>
+			</p>
+		</fw>
+		<fw xml:id="rId105" type="header">
+			<p rend="Header">
+				<seg>
+				</seg>
+			</p>
+		</fw>
+		<fw xml:id="rId106" type="header">
+			<p rend="Header">
+				<seg>
+				</seg>
+			</p>
+		</fw>
+		<milestone unit="section">
+			<teidocx:footer type="even" ref="rId101" />
+			<teidocx:footer type="default" ref="rId102" />
+			<teidocx:footer type="first" ref="rId103" />
+			<teidocx:header type="even" ref="rId104" />
+			<teidocx:header type="default" ref="rId105" />
+			<teidocx:header type="first" ref="rId106" />
+		</milestone>
+	</text>
 </TEI>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/relationships.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/relationships.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/relationships.xsl	(revision 2397)
@@ -1,266 +1,264 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-  <!-- <xsl:key name="TARGETS" use="1" match="tei:ref[@target]|tei:ptr[@target]"/>-->
-    <xsl:key name="GRAPHICS" use="1" match="tei:graphic[@url]"/>
-    <xsl:key name="OLEOBJECTS" use="1" match="o:OLEObject"/>
-    <xsl:key name="IMAGEDATA" use="1" match="v:imagedata"/>
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<!-- <xsl:key name="TARGETS" use="1" match="tei:ref[@target]|tei:ptr[@target]"/> -->
+	<xsl:key name="GRAPHICS" use="1" match="tei:graphic[@url]" />
+	<xsl:key name="OLEOBJECTS" use="1" match="o:OLEObject" />
+	<xsl:key name="IMAGEDATA" use="1" match="v:imagedata" />
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: relationships.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Write _rels/.rels
-    </desc>
-   </doc>
-    <xsl:template name="write-docxfile-main-relationships">
-      <xsl:if test="$debug='true'">
-	<xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/_rels/.rels')"/>
-	</xsl:message>
-      </xsl:if>
+				All rights reserved.
 
-        <xsl:result-document href="{concat($wordDirectory,'/_rels/.rels')}" standalone="yes">
-            <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
-                <Relationship Id="rId1"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
-                          Target="word/document.xml"/>
-                <Relationship Id="rId2"
-                          Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"
-                          Target="docProps/core.xml"/>
-                <Relationship Id="rId3"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"
-                          Target="docProps/app.xml"/>
-                <Relationship Id="rId4"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties"
-                          Target="docProps/custom.xml"/>
-            </Relationships>
-        </xsl:result-document>
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Write word/_rels/document.xml.rels
-    </desc>
-   </doc>
-    <xsl:template name="write-docxfile-relationships">
-      <xsl:if test="$debug='true'">
-	<xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/word/_rels/document.xml.rels')"/>
-	</xsl:message>
-      </xsl:if>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-        <xsl:result-document href="{concat($wordDirectory,'/word/_rels/document.xml.rels')}"
-                           standalone="yes">
-            <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
-                
-                <!-- Mandatory Relationships -->
-                <Relationship Id="rId3"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"
-                          Target="numbering.xml"/>
-                <Relationship Id="rId4"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
-                          Target="styles.xml"/>
-                <Relationship Id="rId5"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"
-                          Target="settings.xml"/>
-                <Relationship Id="rId7"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"
-                          Target="footnotes.xml"/>
-                <Relationship Id="rId8"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"
-                          Target="endnotes.xml"/>
-                <Relationship Id="rId9"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
-                          Target="comments.xml"/>
-                <!-- odd stuff -->
-                <Relationship Id="rId18"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"
-                          Target="fontTable.xml"/>
-                
-                <!-- Any raw blips left in? -->
-                
-                <xsl:for-each select="key('BLIP',1)">
-                    <xsl:choose>
-                        <xsl:when test="@r:embed">
-                            <Relationship Id="rId{position() + 200}"
-                                   Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
-                                   Target="{@r:embed}"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                            <Relationship Id="rId{position() + 200}"
-                                   Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
-                                   Target="{@r:link}"
-                                   TargetMode="External"/>
-                        </xsl:otherwise>
-                    </xsl:choose>
-                </xsl:for-each>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-		<!-- TEI images -->
-                
-                <xsl:for-each select="key('GRAPHICS',1)">
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-		  <xsl:variable name="n">
-		    <xsl:number level="any"/>
-		  <!--
-		    <xsl:choose>
-		      <xsl:when test="@n">
-			<xsl:number level="any"/>
-		      </xsl:when>
-		      <xsl:otherwise>
-			<xsl:number level="any"/>
-		      </xsl:otherwise>
-		    </xsl:choose>
-		    -->
-		  </xsl:variable>
-                    <Relationship Id="rId{$n + 300}"
-                             Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
-                             Target="media/resource{$n}.{tokenize(@url,'\.')[last()]}"/>
-                </xsl:for-each>
-                
-                <!-- hyperlinks -->
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: relationships.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-		<!-- 
-		<xsl:for-each select="key('TARGETS',1)">
-		  <xsl:if test="not(starts-with(@target,'#'))">
-                    <Relationship 
-			Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
-			Target="{@target}" 
-			TargetMode="External">
-		      <xsl:attribute name="Id">
-			<xsl:text>rId</xsl:text>
-			<xsl:variable name="n">
-			  <xsl:number level="any"/>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Write _rels/.rels
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfile-main-relationships">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/_rels/.rels')" />
+			</xsl:message>
+		</xsl:if>
+
+		<xsl:result-document
+			href="{concat($wordDirectory,'/_rels/.rels')}" standalone="yes">
+			<Relationships
+				xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
+				<Relationship Id="rId1"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
+					Target="word/document.xml" />
+				<Relationship Id="rId2"
+					Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"
+					Target="docProps/core.xml" />
+				<Relationship Id="rId3"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"
+					Target="docProps/app.xml" />
+				<Relationship Id="rId4"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties"
+					Target="docProps/custom.xml" />
+			</Relationships>
+		</xsl:result-document>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Write word/_rels/document.xml.rels
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfile-relationships">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/word/_rels/document.xml.rels')" />
+			</xsl:message>
+		</xsl:if>
+
+		<xsl:result-document
+			href="{concat($wordDirectory,'/word/_rels/document.xml.rels')}"
+			standalone="yes">
+			<Relationships
+				xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
+
+				<!-- Mandatory Relationships -->
+				<Relationship Id="rId3"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"
+					Target="numbering.xml" />
+				<Relationship Id="rId4"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
+					Target="styles.xml" />
+				<Relationship Id="rId5"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"
+					Target="settings.xml" />
+				<Relationship Id="rId7"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"
+					Target="footnotes.xml" />
+				<Relationship Id="rId8"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"
+					Target="endnotes.xml" />
+				<Relationship Id="rId9"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
+					Target="comments.xml" />
+				<!-- odd stuff -->
+				<Relationship Id="rId18"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"
+					Target="fontTable.xml" />
+
+				<!-- Any raw blips left in? -->
+
+				<xsl:for-each select="key('BLIP',1)">
+					<xsl:choose>
+						<xsl:when test="@r:embed">
+							<Relationship Id="rId{position() + 200}"
+								Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
+								Target="{@r:embed}" />
+						</xsl:when>
+						<xsl:otherwise>
+							<Relationship Id="rId{position() + 200}"
+								Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
+								Target="{@r:link}" TargetMode="External" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+
+				<!-- TEI images -->
+
+				<xsl:for-each select="key('GRAPHICS',1)">
+
+					<xsl:variable name="n">
+						<xsl:number level="any" />
+						<!-- <xsl:choose> <xsl:when test="@n"> <xsl:number level="any"/> </xsl:when> 
+							<xsl:otherwise> <xsl:number level="any"/> </xsl:otherwise> </xsl:choose> -->
+					</xsl:variable>
+					<Relationship Id="rId{$n + 300}"
+						Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
+						Target="media/resource{$n}.{tokenize(@url,'\.')[last()]}" />
+				</xsl:for-each>
+
+				<!-- hyperlinks -->
+
+				<!-- <xsl:for-each select="key('TARGETS',1)"> <xsl:if test="not(starts-with(@target,'#'))"> 
+					<Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" 
+					Target="{@target}" TargetMode="External"> <xsl:attribute name="Id"> <xsl:text>rId</xsl:text> 
+					<xsl:variable name="n"> <xsl:number level="any"/> </xsl:variable> <xsl:value-of 
+					select="$n + 3000"/> </xsl:attribute> </Relationship> </xsl:if> </xsl:for-each> -->
+
+				<!-- Formulas -->
+				<xsl:for-each select="key('IMAGEDATA',1)">
+					<Relationship Id="rId{position() + 1000}"
+						Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
+						Target="{@r:id}" />
+				</xsl:for-each>
+
+				<xsl:for-each select="key('OLEOBJECTS',1)">
+					<Relationship Id="rId{position() + 2000}"
+						Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
+						Target="{@r:id}" />
+				</xsl:for-each>
+
+
+
+				<!-- our headers and footers -->
+				<xsl:choose>
+					<xsl:when
+						test="count(key('ALLHEADERS',1))=0 and count(key('ALLFOOTERS',1))=0">
+						<xsl:for-each
+							select="document($defaultHeaderFooterFile)">
+							<xsl:call-template
+								name="writeRelationshipsHeadersAndFooters" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template
+							name="writeRelationshipsHeadersAndFooters" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</Relationships>
+		</xsl:result-document>
+
+	</xsl:template>
+
+	<xsl:template name="writeRelationshipsHeadersAndFooters">
+		<xsl:for-each select="key('ALLFOOTERS',1)">
+			<xsl:variable name="num">
+				<xsl:number />
 			</xsl:variable>
-			<xsl:value-of select="$n + 3000"/>
-		      </xsl:attribute>
-		    </Relationship>
-		  </xsl:if>
+			<Relationship
+				xmlns="http://schemas.openxmlformats.org/package/2006/relationships"
+				Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"
+				Target="{concat('footer',position(),'.xml')}"
+				Id="{concat('rId',100+$num)}" />
 		</xsl:for-each>
-		-->
 
-                <!-- Formulas -->
-                <xsl:for-each select="key('IMAGEDATA',1)">
-                    <Relationship Id="rId{position() + 1000}"
-                             Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
-                             Target="{@r:id}"/>
-                </xsl:for-each>
-                
-                <xsl:for-each select="key('OLEOBJECTS',1)">
-                    <Relationship Id="rId{position() + 2000}"
-                             Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
-                             Target="{@r:id}"/>
-                </xsl:for-each>
-                
-                
-                
-                <!-- our headers and footers -->
-                <xsl:choose>
-                    <xsl:when test="count(key('ALLHEADERS',1))=0 and count(key('ALLFOOTERS',1))=0">
-                        <xsl:for-each select="document($defaultHeaderFooterFile)">
-                            <xsl:call-template name="writeRelationshipsHeadersAndFooters"/>
-                        </xsl:for-each>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <xsl:call-template name="writeRelationshipsHeadersAndFooters"/>
-                    </xsl:otherwise>
-                </xsl:choose>
-            </Relationships>
-        </xsl:result-document>
-        
-    </xsl:template>
-    
-    <xsl:template name="writeRelationshipsHeadersAndFooters">
-        <xsl:for-each select="key('ALLFOOTERS',1)">
-            <xsl:variable name="num">
-                <xsl:number/>
-            </xsl:variable>
-            <Relationship xmlns="http://schemas.openxmlformats.org/package/2006/relationships"
-                       Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"
-                       Target="{concat('footer',position(),'.xml')}"
-                       Id="{concat('rId',100+$num)}"/>
-        </xsl:for-each>
-        
-        <!-- count all footers -->
-        <xsl:for-each select="key('ALLHEADERS',1)">
-            <xsl:variable name="num">
-                <xsl:number/>
-            </xsl:variable>
-            <Relationship xmlns="http://schemas.openxmlformats.org/package/2006/relationships"
-                       Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"
-                       Target="{concat('header',position(),'.xml')}"
-                       Id="{concat('rId',100+$num)}"/>
-        </xsl:for-each>
-    </xsl:template>
-    
+		<!-- count all footers -->
+		<xsl:for-each select="key('ALLHEADERS',1)">
+			<xsl:variable name="num">
+				<xsl:number />
+			</xsl:variable>
+			<Relationship
+				xmlns="http://schemas.openxmlformats.org/package/2006/relationships"
+				Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"
+				Target="{concat('header',position(),'.xml')}"
+				Id="{concat('rId',100+$num)}" />
+		</xsl:for-each>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/comments.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/comments.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/comments.xsl	(revision 2397)
@@ -1,121 +1,132 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso     tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso     tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: comments.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <xsl:key name="COMMENTS" match="tei:note[@place='comment']"    use="1"/>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Create the comments file
-    </desc>
-   </doc>
-    <!-- write out comments -->
-    <xsl:template name="write-docxfile-comments-file">
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-      <xsl:if test="count(key('COMMENTS',1))&gt;0">
-	<xsl:if test="$debug='true'">
-	  <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'word/comments.xml')"/>
-	  </xsl:message>
-	</xsl:if>
-	<xsl:result-document href="{concat($wordDirectory,'/word/comments.xml')}" standalone="yes">
-	  <w:comments>
-	    <xsl:for-each select="key('COMMENTS',1)">
-	      <w:comment w:id="{position()-1}" w:author="{@resp}">
-		<xsl:attribute name="w:date">
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: comments.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:key name="COMMENTS" match="tei:note[@place='comment']"
+		use="1" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Create the comments file
+		</desc>
+	</doc>
+	<!-- write out comments -->
+	<xsl:template name="write-docxfile-comments-file">
+
+		<xsl:if test="count(key('COMMENTS',1))&gt;0">
+			<xsl:if test="$debug='true'">
+				<xsl:message>
+					Writing out
+					<xsl:value-of
+						select="concat($wordDirectory,'word/comments.xml')" />
+				</xsl:message>
+			</xsl:if>
+			<xsl:result-document
+				href="{concat($wordDirectory,'/word/comments.xml')}"
+				standalone="yes">
+				<w:comments>
+					<xsl:for-each select="key('COMMENTS',1)">
+						<w:comment w:id="{position()-1}" w:author="{@resp}">
+							<xsl:attribute name="w:date">
 		  <xsl:choose>
 		  <xsl:when test="tei:date/@when">
-		    <xsl:value-of select="tei:date/@when"/>
+		    <xsl:value-of select="tei:date/@when" />
 		  </xsl:when>
 		  <xsl:otherwise>
-		    <xsl:value-of select="tei:whatsTheDate()"/>
+		    <xsl:value-of select="tei:whatsTheDate()" />
 		  </xsl:otherwise>
 		  </xsl:choose>
 		</xsl:attribute>
-		<w:p>
-		  <w:pPr>
-		  <w:pStyle w:val="CommentText"/></w:pPr>
-		  <w:r>
-		    <w:rPr>
-		      <w:rStyle w:val="CommentReference"/>
-		    </w:rPr>
-		    <w:annotationRef/>
-		  </w:r>
-		  <xsl:apply-templates/>
-		</w:p>
-	      </w:comment>
-	    </xsl:for-each>
-	  </w:comments>
-	</xsl:result-document>
-      </xsl:if>
-    </xsl:template>
+							<w:p>
+								<w:pPr>
+									<w:pStyle w:val="CommentText" />
+								</w:pPr>
+								<w:r>
+									<w:rPr>
+										<w:rStyle w:val="CommentReference" />
+									</w:rPr>
+									<w:annotationRef />
+								</w:r>
+								<xsl:apply-templates />
+							</w:p>
+						</w:comment>
+					</xsl:for-each>
+				</w:comments>
+			</xsl:result-document>
+		</xsl:if>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/headers.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/headers.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/headers.xsl	(revision 2397)
@@ -1,117 +1,128 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: headers.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        
-    </desc>
-   </doc>
-    <xsl:template name="write-docxfile-header-files">
-        <xsl:choose>
-            <xsl:when test="count(key('ALLHEADERS',1))=0">
-                <xsl:for-each select="document($defaultHeaderFooterFile)">
-                    <xsl:call-template name="write-docxfile-specific-header-file"/>
-                </xsl:for-each>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:call-template name="write-docxfile-specific-header-file"/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        
-    </desc>
-   </doc>
-    <xsl:template name="write-docxfile-specific-header-file">
-        <xsl:for-each select="key('ALLHEADERS',1)">
-	        <xsl:if test="$debug='true'">
-	           <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/word/header',position(),'.xml')"/>
-            </xsl:message>
-	        </xsl:if>
+				All rights reserved.
 
-            <xsl:result-document href="{concat($wordDirectory,'/word/header',position(),'.xml')}">
-                <w:hdr xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                   xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main">
-                    <xsl:apply-templates select="."/>
-                </w:hdr>
-            </xsl:result-document>
-        </xsl:for-each>
-    </xsl:template>
-    
-    
-    
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: headers.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfile-header-files">
+		<xsl:choose>
+			<xsl:when test="count(key('ALLHEADERS',1))=0">
+				<xsl:for-each
+					select="document($defaultHeaderFooterFile)">
+					<xsl:call-template
+						name="write-docxfile-specific-header-file" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template
+					name="write-docxfile-specific-header-file" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfile-specific-header-file">
+		<xsl:for-each select="key('ALLHEADERS',1)">
+			<xsl:if test="$debug='true'">
+				<xsl:message>
+					Writing out
+					<xsl:value-of
+						select="concat($wordDirectory,'/word/header',position(),'.xml')" />
+				</xsl:message>
+			</xsl:if>
+
+			<xsl:result-document
+				href="{concat($wordDirectory,'/word/header',position(),'.xml')}">
+				<w:hdr xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+					xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main">
+					<xsl:apply-templates select="." />
+				</w:hdr>
+			</xsl:result-document>
+		</xsl:for-each>
+	</xsl:template>
+
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/content-types.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/content-types.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/content-types.xsl	(revision 2397)
@@ -1,183 +1,204 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: content-types.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <xsl:template name="write-docxfile-content-types">
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/%5BContent_Types%5D.xml')"/>
-         </xsl:message>
-	     </xsl:if>
+				All rights reserved.
 
-        <xsl:result-document href="{concat($wordDirectory,'/%5BContent_Types%5D.xml')}">
-            
-            <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
-                
-                <Default Extension="jpeg" ContentType="image/jpeg"/>
-                <Default Extension="jpg" ContentType="image/jpeg"/>
-                <Default Extension="png" ContentType="image/png"/>
-                <Default Extension="tiff" ContentType="image/tiff"/>
-                <Default Extension="rels"
-                     ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
-                <Default Extension="xml" ContentType="application/xml"/>
-                <Default Extension="bin"
-                     ContentType="application/vnd.openxmlformats-officedocument.oleObject"/>
-                <Default Extension="wmf" ContentType="image/x-wmf"/>
-                <Default Extension="emf" ContentType="image/x-emf"/>
-                
-                
-                <!-- docprops -->
-                <Override PartName="/docProps/core.xml"
-                      ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
-                <Override PartName="/docProps/app.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
-                <Override PartName="/docProps/custom.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"/>
-                
-                <!-- word -->
-                <Override PartName="/word/document.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
-                <Override PartName="/word/styles.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
-                <Override PartName="/word/numbering.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>
-                <Override PartName="/word/webSettings.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"/>
-                
-                <Override PartName="/word/endnotes.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"/>
-                <Override PartName="/word/fontTable.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/>
-                <Override PartName="/word/footnotes.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"/>
-                <Override PartName="/word/settings.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/>
-		<Override PartName="/word/comments.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"/>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-                <!-- others -->
-                <Override PartName="/word/theme/theme1.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
-                
-                <!-- headers -->
-                <xsl:choose>
-                    <xsl:when test="count(key('ALLHEADERS',1))=0">
-                        <xsl:for-each select="document($defaultHeaderFooterFile)">
-                            <xsl:call-template name="write-docxfile-content-types-header-references"/>
-                        </xsl:for-each>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <xsl:call-template name="write-docxfile-content-types-header-references"/>
-                    </xsl:otherwise>
-                </xsl:choose>
-                
-                
-                <!-- footers -->
-                <xsl:choose>
-                    <xsl:when test="count(key('ALLFOOTERS',1))=0">
-                        <xsl:for-each select="document($defaultHeaderFooterFile)">
-                            <xsl:call-template name="write-docxfile-content-types-footer-references"/>
-                        </xsl:for-each>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <xsl:call-template name="write-docxfile-content-types-footer-references"/>
-                    </xsl:otherwise>
-                </xsl:choose>
-            </Types>
-            
-        </xsl:result-document>
-    </xsl:template>
-    
-    
-    
-    <xsl:template name="write-docxfile-content-types-footer-references">
-        <xsl:for-each select="key('ALLFOOTERS',1)">
-            <Override xmlns="http://schemas.openxmlformats.org/package/2006/content-types"
-                   ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml">
-                <xsl:attribute name="PartName" select="concat('/word/footer', position(), '.xml')"/>
-            </Override>            
-        </xsl:for-each>
-    </xsl:template>
-    
-    <xsl:template name="write-docxfile-content-types-header-references">
-        <xsl:for-each select="key('ALLHEADERS',1)">
-            <Override xmlns="http://schemas.openxmlformats.org/package/2006/content-types"
-                   ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml">
-                <xsl:attribute name="PartName" select="concat('/word/header', position(), '.xml')"/>
-            </Override>
-        </xsl:for-each>
-    </xsl:template>
-    
-    
-    
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: content-types.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:template name="write-docxfile-content-types">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/%5BContent_Types%5D.xml')" />
+			</xsl:message>
+		</xsl:if>
+
+		<xsl:result-document
+			href="{concat($wordDirectory,'/%5BContent_Types%5D.xml')}">
+
+			<Types
+				xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
+
+				<Default Extension="jpeg" ContentType="image/jpeg" />
+				<Default Extension="jpg" ContentType="image/jpeg" />
+				<Default Extension="png" ContentType="image/png" />
+				<Default Extension="tiff" ContentType="image/tiff" />
+				<Default Extension="rels"
+					ContentType="application/vnd.openxmlformats-package.relationships+xml" />
+				<Default Extension="xml" ContentType="application/xml" />
+				<Default Extension="bin"
+					ContentType="application/vnd.openxmlformats-officedocument.oleObject" />
+				<Default Extension="wmf" ContentType="image/x-wmf" />
+				<Default Extension="emf" ContentType="image/x-emf" />
+
+
+				<!-- docprops -->
+				<Override PartName="/docProps/core.xml"
+					ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
+				<Override PartName="/docProps/app.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" />
+				<Override PartName="/docProps/custom.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml" />
+
+				<!-- word -->
+				<Override PartName="/word/document.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" />
+				<Override PartName="/word/styles.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" />
+				<Override PartName="/word/numbering.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" />
+				<Override PartName="/word/webSettings.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml" />
+
+				<Override PartName="/word/endnotes.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml" />
+				<Override PartName="/word/fontTable.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml" />
+				<Override PartName="/word/footnotes.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" />
+				<Override PartName="/word/settings.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml" />
+				<Override PartName="/word/comments.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" />
+
+				<!-- others -->
+				<Override PartName="/word/theme/theme1.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.theme+xml" />
+
+				<!-- headers -->
+				<xsl:choose>
+					<xsl:when test="count(key('ALLHEADERS',1))=0">
+						<xsl:for-each
+							select="document($defaultHeaderFooterFile)">
+							<xsl:call-template
+								name="write-docxfile-content-types-header-references" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template
+							name="write-docxfile-content-types-header-references" />
+					</xsl:otherwise>
+				</xsl:choose>
+
+
+				<!-- footers -->
+				<xsl:choose>
+					<xsl:when test="count(key('ALLFOOTERS',1))=0">
+						<xsl:for-each
+							select="document($defaultHeaderFooterFile)">
+							<xsl:call-template
+								name="write-docxfile-content-types-footer-references" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template
+							name="write-docxfile-content-types-footer-references" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</Types>
+
+		</xsl:result-document>
+	</xsl:template>
+
+
+
+	<xsl:template
+		name="write-docxfile-content-types-footer-references">
+		<xsl:for-each select="key('ALLFOOTERS',1)">
+			<Override
+				xmlns="http://schemas.openxmlformats.org/package/2006/content-types"
+				ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml">
+				<xsl:attribute name="PartName"
+					select="concat('/word/footer', position(), '.xml')" />
+			</Override>
+		</xsl:for-each>
+	</xsl:template>
+
+	<xsl:template
+		name="write-docxfile-content-types-header-references">
+		<xsl:for-each select="key('ALLHEADERS',1)">
+			<Override
+				xmlns="http://schemas.openxmlformats.org/package/2006/content-types"
+				ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml">
+				<xsl:attribute name="PartName"
+					select="concat('/word/header', position(), '.xml')" />
+			</Override>
+		</xsl:for-each>
+	</xsl:template>
+
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/numbering-definition.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/numbering-definition.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/numbering-definition.xsl	(revision 2397)
@@ -1,965 +1,980 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: numbering-definition.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-     <xsl:template name="write-docxfile-numbering-definition">
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/word/numbering.xml')"/>
-         </xsl:message>
-	     </xsl:if>
+				All rights reserved.
 
-        <xsl:result-document href="{concat($wordDirectory,'/word/numbering.xml')}">
-            <w:numbering>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-                <!-- for headlines -->
-                <w:abstractNum w:abstractNumId="1">
-                    <w:multiLevelType w:val="multilevel"/>
-                    <w:name w:val="heading"/>
-                    <w:lvl w:ilvl="0">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading1"/>
-                        <w:lvlText w:val="%1"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="432" w:hanging="432"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="1">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading2"/>
-                        <w:lvlText w:val="%1.%2"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="648" w:hanging="648"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="2">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading3"/>
-                        <w:lvlText w:val="%1.%2.%3"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="864" w:hanging="864"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="3">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading4"/>
-                        <w:lvlText w:val="%1.%2.%3.%4"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1080" w:hanging="1080"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="4">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading5"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1296" w:hanging="1296"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="5">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading6"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5.%6"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1512" w:hanging="1512"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="6">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading7"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1728" w:hanging="1728"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="7">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading8"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7.%8"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1944" w:hanging="1944"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="8">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Heading9"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7.%8.%9"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2160" w:hanging="2160"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                </w:abstractNum>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-                <!-- unordered lists -->
-		<xsl:call-template name="defineUnorderedLists"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: numbering-definition.xsl 9646 2011-11-05 23:39:08Z rahtz
+				$</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-                <!-- ordered lists -->
-		<xsl:call-template name="defineOrderedLists"/>
 
+	<xsl:template name="write-docxfile-numbering-definition">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/word/numbering.xml')" />
+			</xsl:message>
+		</xsl:if>
 
-                <!-- for sections in Annex -->
-                <w:abstractNum w:abstractNumId="4">
-                    <w:multiLevelType w:val="multilevel"/>
-                    <w:lvl w:ilvl="0">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="upperLetter"/>
-                        <w:pStyle w:val="ANNEX"/>
-                        <w:suff w:val="nothing"/>
-                        <w:lvlText w:val="Annex %1: "/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="0" w:firstLine="0"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="1">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="a2"/>
-                        <w:lvlText w:val="%1.%2"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="720" w:hanging="720"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="2">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="a3"/>
-                        <w:lvlText w:val="%1.%2.%3"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="936" w:hanging="936"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="3">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="a4"/>
-                        <w:lvlText w:val="%1.%2.%3.%4"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1152" w:hanging="1152"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="4">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="a5"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1368" w:hanging="1368"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="5">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="a6"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5.%6"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1584" w:hanging="1584"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="6">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1800" w:hanging="1800"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="7">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7.%8"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2016" w:hanging="2016"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="8">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7.%8.%9"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2232" w:hanging="2232"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                </w:abstractNum>
+		<xsl:result-document
+			href="{concat($wordDirectory,'/word/numbering.xml')}">
+			<w:numbering>
 
-                <!-- for tables -->
-                <w:abstractNum w:abstractNumId="5">
-                    <w:multiLevelType w:val="hybridMultilevel"/>
-                    <w:lvl w:ilvl="0">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Tabletitle"/>
-                        <w:suff w:val="space"/>
-                        <w:lvlText w:val="Table %1"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="720" w:hanging="360"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="1">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%2."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1440" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="2">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%3."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="2160" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="3">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%4."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2880" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="4">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%5."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="3600" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="5">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%6."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="4320" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="6">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%7."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="5040" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="7">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%8."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="5760" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="8">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%9."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="6480" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                </w:abstractNum>
+				<!-- for headlines -->
+				<w:abstractNum w:abstractNumId="1">
+					<w:multiLevelType w:val="multilevel" />
+					<w:name w:val="heading" />
+					<w:lvl w:ilvl="0">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading1" />
+						<w:lvlText w:val="%1" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="432" w:hanging="432" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="1">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading2" />
+						<w:lvlText w:val="%1.%2" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="648" w:hanging="648" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="2">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading3" />
+						<w:lvlText w:val="%1.%2.%3" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="864" w:hanging="864" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="3">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading4" />
+						<w:lvlText w:val="%1.%2.%3.%4" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1080" w:hanging="1080" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="4">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading5" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1296" w:hanging="1296" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="5">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading6" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5.%6" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1512" w:hanging="1512" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="6">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading7" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1728" w:hanging="1728" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="7">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading8" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7.%8" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1944" w:hanging="1944" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="8">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Heading9" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7.%8.%9" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="2160" w:hanging="2160" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+				</w:abstractNum>
 
-                <!-- for bibliography -->
-                <w:abstractNum w:abstractNumId="6">
-                    <w:multiLevelType w:val="hybridMultilevel"/>
-                    <w:lvl w:ilvl="0">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Bibliography"/>
-                        <w:lvlText w:val="[%1]"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1080" w:hanging="1080"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="1">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%2."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1440" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="2">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%3."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="2160" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="3">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%4."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2880" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="4">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%5."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="3600" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="5">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%6."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="4320" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="6">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%7."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="5040" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="7">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%8."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="5760" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="8">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%9."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="6480" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                </w:abstractNum>
 
-                <!-- for figures -->
-                <w:abstractNum w:abstractNumId="7">
-                    <w:multiLevelType w:val="hybridMultilevel"/>
-                    <w:lvl w:ilvl="0">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:pStyle w:val="Figuretitle"/>
-                        <w:suff w:val="space"/>
-                        <w:lvlText w:val="Figure %1"/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="0" w:firstLine="0"/>
-                        </w:pPr>
-                        <w:rPr>
-                            <w:rFonts w:hint="default"/>
-                        </w:rPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="1">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%2."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="1440" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="2">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%3."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="2160" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="3">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%4."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="2880" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="4">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%5."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="3600" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="5">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%6."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="4320" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="6">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="decimal"/>
-                        <w:lvlText w:val="%7."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="5040" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="7">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerLetter"/>
-                        <w:lvlText w:val="%8."/>
-                        <w:lvlJc w:val="left"/>
-                        <w:pPr>
-                            <w:ind w:left="5760" w:hanging="360"/>
-                        </w:pPr>
-                    </w:lvl>
-                    <w:lvl w:ilvl="8">
-                        <w:start w:val="1"/>
-                        <w:numFmt w:val="lowerRoman"/>
-                        <w:lvlText w:val="%9."/>
-                        <w:lvlJc w:val="right"/>
-                        <w:pPr>
-                            <w:ind w:left="6480" w:hanging="180"/>
-                        </w:pPr>
-                    </w:lvl>
-                </w:abstractNum>
+				<!-- unordered lists -->
+				<xsl:call-template name="defineUnorderedLists" />
 
-                <!-- for headlines -->
-                <w:num w:numId="1">
-                    <w:abstractNumId w:val="1"/>
-                </w:num>
+				<!-- ordered lists -->
+				<xsl:call-template name="defineOrderedLists" />
 
-                <!-- unordered lists -->
-                <w:num w:numId="2">
-                    <w:abstractNumId w:val="2"/>
-                </w:num>
 
-                <!-- for annex sections -->
-                <w:num w:numId="3">
-                    <w:abstractNumId w:val="4"/>
-                </w:num>
+				<!-- for sections in Annex -->
+				<w:abstractNum w:abstractNumId="4">
+					<w:multiLevelType w:val="multilevel" />
+					<w:lvl w:ilvl="0">
+						<w:start w:val="1" />
+						<w:numFmt w:val="upperLetter" />
+						<w:pStyle w:val="ANNEX" />
+						<w:suff w:val="nothing" />
+						<w:lvlText w:val="Annex %1: " />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="0" w:firstLine="0" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="1">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="a2" />
+						<w:lvlText w:val="%1.%2" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="720" w:hanging="720" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="2">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="a3" />
+						<w:lvlText w:val="%1.%2.%3" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="936" w:hanging="936" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="3">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="a4" />
+						<w:lvlText w:val="%1.%2.%3.%4" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1152" w:hanging="1152" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="4">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="a5" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1368" w:hanging="1368" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="5">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="a6" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5.%6" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1584" w:hanging="1584" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="6">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1800" w:hanging="1800" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="7">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7.%8" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="2016" w:hanging="2016" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="8">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%1.%2.%3.%4.%5.%6.%7.%8.%9" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="2232" w:hanging="2232" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+				</w:abstractNum>
 
-                <!-- for tables -->
-                <w:num w:numId="5">
-                    <w:abstractNumId w:val="5"/>
-                </w:num>
+				<!-- for tables -->
+				<w:abstractNum w:abstractNumId="5">
+					<w:multiLevelType w:val="hybridMultilevel" />
+					<w:lvl w:ilvl="0">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Tabletitle" />
+						<w:suff w:val="space" />
+						<w:lvlText w:val="Table %1" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="720" w:hanging="360" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="1">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%2." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1440" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="2">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%3." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="2160" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="3">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%4." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="2880" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="4">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%5." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="3600" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="5">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%6." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="4320" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="6">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%7." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="5040" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="7">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%8." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="5760" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="8">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%9." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="6480" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+				</w:abstractNum>
 
-                <!-- for bibliography -->
-                <w:num w:numId="6">
-                    <w:abstractNumId w:val="6"/>
-                </w:num>
+				<!-- for bibliography -->
+				<w:abstractNum w:abstractNumId="6">
+					<w:multiLevelType w:val="hybridMultilevel" />
+					<w:lvl w:ilvl="0">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Bibliography" />
+						<w:lvlText w:val="[%1]" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1080" w:hanging="1080" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="1">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%2." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1440" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="2">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%3." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="2160" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="3">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%4." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="2880" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="4">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%5." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="3600" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="5">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%6." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="4320" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="6">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%7." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="5040" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="7">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%8." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="5760" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="8">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%9." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="6480" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+				</w:abstractNum>
 
-                <!-- for figures -->
-                <w:num w:numId="7">
-                    <w:abstractNumId w:val="7"/>
-                </w:num>
+				<!-- for figures -->
+				<w:abstractNum w:abstractNumId="7">
+					<w:multiLevelType w:val="hybridMultilevel" />
+					<w:lvl w:ilvl="0">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:pStyle w:val="Figuretitle" />
+						<w:suff w:val="space" />
+						<w:lvlText w:val="Figure %1" />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="0" w:firstLine="0" />
+						</w:pPr>
+						<w:rPr>
+							<w:rFonts w:hint="default" />
+						</w:rPr>
+					</w:lvl>
+					<w:lvl w:ilvl="1">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%2." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="1440" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="2">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%3." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="2160" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="3">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%4." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="2880" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="4">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%5." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="3600" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="5">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%6." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="4320" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="6">
+						<w:start w:val="1" />
+						<w:numFmt w:val="decimal" />
+						<w:lvlText w:val="%7." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="5040" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="7">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerLetter" />
+						<w:lvlText w:val="%8." />
+						<w:lvlJc w:val="left" />
+						<w:pPr>
+							<w:ind w:left="5760" w:hanging="360" />
+						</w:pPr>
+					</w:lvl>
+					<w:lvl w:ilvl="8">
+						<w:start w:val="1" />
+						<w:numFmt w:val="lowerRoman" />
+						<w:lvlText w:val="%9." />
+						<w:lvlJc w:val="right" />
+						<w:pPr>
+							<w:ind w:left="6480" w:hanging="180" />
+						</w:pPr>
+					</w:lvl>
+				</w:abstractNum>
 
-                <!-- for the ordered lists style -->
-                <w:num w:numId="8">
-                    <w:abstractNumId w:val="3"/>
-                    <w:lvlOverride w:ilvl="0">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                    <w:lvlOverride w:ilvl="1">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                    <w:lvlOverride w:ilvl="2">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                    <w:lvlOverride w:ilvl="3">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                    <w:lvlOverride w:ilvl="4">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                    <w:lvlOverride w:ilvl="5">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                    <w:lvlOverride w:ilvl="6">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                    <w:lvlOverride w:ilvl="7">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                    <w:lvlOverride w:ilvl="8">
-                        <w:startOverride w:val="1"/>
-                    </w:lvlOverride>
-                </w:num>
+				<!-- for headlines -->
+				<w:num w:numId="1">
+					<w:abstractNumId w:val="1" />
+				</w:num>
 
-                <!-- for the unordered lists style -->
-                <w:num w:numId="9">
-                    <w:abstractNumId w:val="2"/>
-                </w:num>
+				<!-- unordered lists -->
+				<w:num w:numId="2">
+					<w:abstractNumId w:val="2" />
+				</w:num>
 
+				<!-- for annex sections -->
+				<w:num w:numId="3">
+					<w:abstractNumId w:val="4" />
+				</w:num>
 
-                <!-- ordered lists -->
-                <!-- 
-                    We have to generate an instance for each list present in the
-                    document.
-                -->
-                <xsl:for-each select="key('OL',1)">
-                    <w:num>
-                        <xsl:attribute name="w:numId">
-                            <xsl:value-of select="position()+100"/>
+				<!-- for tables -->
+				<w:num w:numId="5">
+					<w:abstractNumId w:val="5" />
+				</w:num>
+
+				<!-- for bibliography -->
+				<w:num w:numId="6">
+					<w:abstractNumId w:val="6" />
+				</w:num>
+
+				<!-- for figures -->
+				<w:num w:numId="7">
+					<w:abstractNumId w:val="7" />
+				</w:num>
+
+				<!-- for the ordered lists style -->
+				<w:num w:numId="8">
+					<w:abstractNumId w:val="3" />
+					<w:lvlOverride w:ilvl="0">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+					<w:lvlOverride w:ilvl="1">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+					<w:lvlOverride w:ilvl="2">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+					<w:lvlOverride w:ilvl="3">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+					<w:lvlOverride w:ilvl="4">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+					<w:lvlOverride w:ilvl="5">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+					<w:lvlOverride w:ilvl="6">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+					<w:lvlOverride w:ilvl="7">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+					<w:lvlOverride w:ilvl="8">
+						<w:startOverride w:val="1" />
+					</w:lvlOverride>
+				</w:num>
+
+				<!-- for the unordered lists style -->
+				<w:num w:numId="9">
+					<w:abstractNumId w:val="2" />
+				</w:num>
+
+
+				<!-- ordered lists -->
+				<!-- We have to generate an instance for each list present in the document. -->
+				<xsl:for-each select="key('OL',1)">
+					<w:num>
+						<xsl:attribute name="w:numId">
+                            <xsl:value-of
+							select="position()+100" />
                         </xsl:attribute>
-                        <w:abstractNumId w:val="3"/>
-                        <w:lvlOverride w:ilvl="0">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                        <w:lvlOverride w:ilvl="1">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                        <w:lvlOverride w:ilvl="2">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                        <w:lvlOverride w:ilvl="3">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                        <w:lvlOverride w:ilvl="4">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                        <w:lvlOverride w:ilvl="5">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                        <w:lvlOverride w:ilvl="6">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                        <w:lvlOverride w:ilvl="7">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                        <w:lvlOverride w:ilvl="8">
-                            <w:startOverride w:val="1"/>
-                        </w:lvlOverride>
-                    </w:num>
-                </xsl:for-each>
+						<w:abstractNumId w:val="3" />
+						<w:lvlOverride w:ilvl="0">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+						<w:lvlOverride w:ilvl="1">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+						<w:lvlOverride w:ilvl="2">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+						<w:lvlOverride w:ilvl="3">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+						<w:lvlOverride w:ilvl="4">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+						<w:lvlOverride w:ilvl="5">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+						<w:lvlOverride w:ilvl="6">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+						<w:lvlOverride w:ilvl="7">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+						<w:lvlOverride w:ilvl="8">
+							<w:startOverride w:val="1" />
+						</w:lvlOverride>
+					</w:num>
+				</xsl:for-each>
 
 
-            </w:numbering>
-        </xsl:result-document>
-    </xsl:template>
-    
-    
-    
-    
-    <xsl:template name="defineUnorderedLists">
-        <w:abstractNum w:abstractNumId="2">
-            <w:multiLevelType w:val="multilevel"/>
-            <w:lvl w:ilvl="0">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="bullet"/>
-                <w:pStyle w:val="ListBullet"/>
-                <w:lvlText w:val="{$bulletOne}"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="360" w:hanging="0"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
-                    <w:color w:val="auto"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="1">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="bullet"/>
-                <w:pStyle w:val="ListBullet"/>
-                <w:lvlText w:val="{$bulletTwo}"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="720" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
-                    <w:color w:val="auto"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="2">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="bullet"/>
-                <w:pStyle w:val="ListBullet"/>
-                <w:lvlText w:val="{$bulletThree}"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="1080" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
-                    <w:color w:val="auto"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="3">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="bullet"/>
-                <w:pStyle w:val="ListBullet"/>
-                <w:lvlText w:val="{$bulletFour}"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="1440" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
-                    <w:color w:val="auto"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="4">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="bullet"/>
-                <w:pStyle w:val="ListBullet"/>
-                <w:lvlText w:val="{$bulletFive}"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="1800" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
-                    <w:color w:val="auto"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="5">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="bullet"/>
-                <w:pStyle w:val="ListBullet"/>
-                <w:lvlText w:val="{$bulletSix}"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="2160" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
-                    <w:color w:val="auto"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="6">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="bullet"/>
-                <w:pStyle w:val="ListBullet"/>
-                <w:lvlText w:val="{$bulletSeven}"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="2520" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
-                    <w:color w:val="auto"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="7">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="bullet"/>
-                <w:pStyle w:val="ListBullet"/>
-                <w:lvlText w:val="{$bulletEight}"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="2880" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
-                    <w:color w:val="auto"/>
-                </w:rPr>
-            </w:lvl>
-            
-        </w:abstractNum>
-    </xsl:template>
-    
-    <!-- ordered lists -->
-    <xsl:template name="defineOrderedLists">
-        <w:abstractNum w:abstractNumId="3">
-            <w:multiLevelType w:val="multilevel"/>
-            <w:lvl w:ilvl="0">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="lowerLetter"/>
-                <w:pStyle w:val="ListNumber"/>
-                <w:lvlText w:val="%1)"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="360" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="1">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="decimal"/>
-                <w:pStyle w:val="ListNumber2"/>
-                <w:lvlText w:val="%2)"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="720" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="2">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="lowerRoman"/>
-                <w:pStyle w:val="ListNumber3"/>
-                <w:lvlText w:val="%3)"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="1080" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="3">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="upperRoman"/>
-                <w:pStyle w:val="ListNumber4"/>
-                <w:lvlText w:val="%4)"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="1440" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="4">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="lowerLetter"/>
-                <w:lvlText w:val="(%5)"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="1800" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="5">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="lowerRoman"/>
-                <w:lvlText w:val="(%6)"/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="2160" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="6">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="decimal"/>
-                <w:lvlText w:val="%7."/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="2520" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="7">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="lowerLetter"/>
-                <w:lvlText w:val="%8."/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="2880" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-            <w:lvl w:ilvl="8">
-                <w:start w:val="1"/>
-                <w:numFmt w:val="lowerRoman"/>
-                <w:lvlText w:val="%9."/>
-                <w:lvlJc w:val="left"/>
-                <w:pPr>
-                    <w:ind w:left="3240" w:hanging="360"/>
-                </w:pPr>
-                <w:rPr>
-                    <w:rFonts w:hint="default"/>
-                </w:rPr>
-            </w:lvl>
-        </w:abstractNum>
-        
-    </xsl:template>
-    
+			</w:numbering>
+		</xsl:result-document>
+	</xsl:template>
+
+
+
+
+	<xsl:template name="defineUnorderedLists">
+		<w:abstractNum w:abstractNumId="2">
+			<w:multiLevelType w:val="multilevel" />
+			<w:lvl w:ilvl="0">
+				<w:start w:val="1" />
+				<w:numFmt w:val="bullet" />
+				<w:pStyle w:val="ListBullet" />
+				<w:lvlText w:val="{$bulletOne}" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="360" w:hanging="0" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol"
+						w:hint="default" />
+					<w:color w:val="auto" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="1">
+				<w:start w:val="1" />
+				<w:numFmt w:val="bullet" />
+				<w:pStyle w:val="ListBullet" />
+				<w:lvlText w:val="{$bulletTwo}" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="720" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol"
+						w:hint="default" />
+					<w:color w:val="auto" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="2">
+				<w:start w:val="1" />
+				<w:numFmt w:val="bullet" />
+				<w:pStyle w:val="ListBullet" />
+				<w:lvlText w:val="{$bulletThree}" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1080" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol"
+						w:hint="default" />
+					<w:color w:val="auto" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="3">
+				<w:start w:val="1" />
+				<w:numFmt w:val="bullet" />
+				<w:pStyle w:val="ListBullet" />
+				<w:lvlText w:val="{$bulletFour}" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1440" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol"
+						w:hint="default" />
+					<w:color w:val="auto" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="4">
+				<w:start w:val="1" />
+				<w:numFmt w:val="bullet" />
+				<w:pStyle w:val="ListBullet" />
+				<w:lvlText w:val="{$bulletFive}" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1800" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol"
+						w:hint="default" />
+					<w:color w:val="auto" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="5">
+				<w:start w:val="1" />
+				<w:numFmt w:val="bullet" />
+				<w:pStyle w:val="ListBullet" />
+				<w:lvlText w:val="{$bulletSix}" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2160" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol"
+						w:hint="default" />
+					<w:color w:val="auto" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="6">
+				<w:start w:val="1" />
+				<w:numFmt w:val="bullet" />
+				<w:pStyle w:val="ListBullet" />
+				<w:lvlText w:val="{$bulletSeven}" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2520" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol"
+						w:hint="default" />
+					<w:color w:val="auto" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="7">
+				<w:start w:val="1" />
+				<w:numFmt w:val="bullet" />
+				<w:pStyle w:val="ListBullet" />
+				<w:lvlText w:val="{$bulletEight}" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2880" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol"
+						w:hint="default" />
+					<w:color w:val="auto" />
+				</w:rPr>
+			</w:lvl>
+
+		</w:abstractNum>
+	</xsl:template>
+
+	<!-- ordered lists -->
+	<xsl:template name="defineOrderedLists">
+		<w:abstractNum w:abstractNumId="3">
+			<w:multiLevelType w:val="multilevel" />
+			<w:lvl w:ilvl="0">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerLetter" />
+				<w:pStyle w:val="ListNumber" />
+				<w:lvlText w:val="%1)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="360" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="1">
+				<w:start w:val="1" />
+				<w:numFmt w:val="decimal" />
+				<w:pStyle w:val="ListNumber2" />
+				<w:lvlText w:val="%2)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="720" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="2">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerRoman" />
+				<w:pStyle w:val="ListNumber3" />
+				<w:lvlText w:val="%3)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1080" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="3">
+				<w:start w:val="1" />
+				<w:numFmt w:val="upperRoman" />
+				<w:pStyle w:val="ListNumber4" />
+				<w:lvlText w:val="%4)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1440" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="4">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerLetter" />
+				<w:lvlText w:val="(%5)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="1800" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="5">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerRoman" />
+				<w:lvlText w:val="(%6)" />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2160" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="6">
+				<w:start w:val="1" />
+				<w:numFmt w:val="decimal" />
+				<w:lvlText w:val="%7." />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2520" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="7">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerLetter" />
+				<w:lvlText w:val="%8." />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="2880" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+			<w:lvl w:ilvl="8">
+				<w:start w:val="1" />
+				<w:numFmt w:val="lowerRoman" />
+				<w:lvlText w:val="%9." />
+				<w:lvlJc w:val="left" />
+				<w:pPr>
+					<w:ind w:left="3240" w:hanging="360" />
+				</w:pPr>
+				<w:rPr>
+					<w:rFonts w:hint="default" />
+				</w:rPr>
+			</w:lvl>
+		</w:abstractNum>
+
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/endnotes.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/endnotes.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/endnotes.xsl	(revision 2397)
@@ -1,138 +1,148 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: endnotes.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Create the endnotes file
-    </desc>
-   </doc>
-    <xsl:template name="write-docxfile-endnotes-file">
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/word/endnotes.xml')"/>
-         </xsl:message>
-	     </xsl:if>
+				All rights reserved.
 
-        <xsl:result-document href="{concat($wordDirectory,'/word/endnotes.xml')}">
-            <w:endnotes>
-                <w:endnote w:type="separator" w:id="-1">
-                    <w:p>
-                        <w:pPr>
-                            <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
-                        </w:pPr>
-                        <w:r>
-                            <w:separator/>
-                        </w:r>
-                    </w:p>
-                    <w:p/>
-                    <w:p/>
-                </w:endnote>
-                <w:endnote w:type="continuationSeparator" w:id="0">
-                    <w:p>
-                        <w:pPr>
-                            <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
-                        </w:pPr>
-                        <w:r>
-                            <w:continuationSeparator/>
-                        </w:r>
-                    </w:p>
-                    <w:p/>
-                    <w:p/>
-                </w:endnote>
-                
-                <xsl:for-each select="key('ENDNOTES',1)">
-                    <xsl:variable name="id" select="position()+1"/>
-                    <w:endnote w:id="{$id}">
-                        <xsl:call-template name="block-element">
-                            <xsl:with-param name="pPr">
-                                <w:pPr>
-                                    <w:pStyle w:val="EndnoteText"/>
-                                </w:pPr>
-                                <w:r>
-                                    <w:rPr>
-                                        <w:rStyle w:val="EndnoteReference"/>
-                                    </w:rPr>
-                                    <w:endnoteRef/>
-                                </w:r>
-				<w:r><w:t xml:space="preserve"> </w:t></w:r>
-			    </xsl:with-param>
-                        </xsl:call-template>
-                    </w:endnote>
-                </xsl:for-each>
-                
-            </w:endnotes>
-        </xsl:result-document>
-    </xsl:template>
-    
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: endnotes.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Create the endnotes file
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfile-endnotes-file">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/word/endnotes.xml')" />
+			</xsl:message>
+		</xsl:if>
+
+		<xsl:result-document
+			href="{concat($wordDirectory,'/word/endnotes.xml')}">
+			<w:endnotes>
+				<w:endnote w:type="separator" w:id="-1">
+					<w:p>
+						<w:pPr>
+							<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
+						</w:pPr>
+						<w:r>
+							<w:separator />
+						</w:r>
+					</w:p>
+					<w:p />
+					<w:p />
+				</w:endnote>
+				<w:endnote w:type="continuationSeparator" w:id="0">
+					<w:p>
+						<w:pPr>
+							<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
+						</w:pPr>
+						<w:r>
+							<w:continuationSeparator />
+						</w:r>
+					</w:p>
+					<w:p />
+					<w:p />
+				</w:endnote>
+
+				<xsl:for-each select="key('ENDNOTES',1)">
+					<xsl:variable name="id" select="position()+1" />
+					<w:endnote w:id="{$id}">
+						<xsl:call-template name="block-element">
+							<xsl:with-param name="pPr">
+								<w:pPr>
+									<w:pStyle w:val="EndnoteText" />
+								</w:pPr>
+								<w:r>
+									<w:rPr>
+										<w:rStyle w:val="EndnoteReference" />
+									</w:rPr>
+									<w:endnoteRef />
+								</w:r>
+								<w:r>
+									<w:t xml:space="preserve"> </w:t>
+								</w:r>
+							</xsl:with-param>
+						</xsl:call-template>
+					</w:endnote>
+				</xsl:for-each>
+
+			</w:endnotes>
+		</xsl:result-document>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/footnotes.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/footnotes.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/footnotes.xsl	(revision 2397)
@@ -1,148 +1,157 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: footnotes.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        
-    </desc>
-   </doc>
-    <xsl:template name="write-docxfile-footnotes-file">
-      <xsl:if test="$debug='true'">
-	<xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/word/footnotes.xml')"/>    </xsl:message>
-      </xsl:if>
-        <xsl:result-document href="{concat($wordDirectory,'/word/footnotes.xml')}">
-            <w:footnotes>
-                <w:footnote w:type="separator" w:id="-1">
-                    <w:p>
-                        <w:pPr>
-                            <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
-                        </w:pPr>
-                        <w:r>
-                            <w:separator/>
-                        </w:r>
-                    </w:p>
-                </w:footnote>
-                <w:footnote w:type="continuationSeparator" w:id="0">
-                    <w:p>
-                        <w:pPr>
-                            <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
-                        </w:pPr>
-                        <w:r>
-                            <w:continuationSeparator/>
-                        </w:r>
-                    </w:p>
-                    <w:p/>
-                    <w:p/>
-                </w:footnote>
-                
-                <xsl:for-each select="key('FOOTNOTES',1)">
-                    <xsl:variable name="id" select="position()+1"/>
-                    <w:footnote w:id="{$id}">
-                        <xsl:call-template name="block-element">
-                            <xsl:with-param name="pPr">
-                                <w:pPr>
-                                    <w:pStyle w:val="FootnoteText"/>
-                                </w:pPr>
-                                <w:r>
-                                    <w:rPr>
-                                        <w:rStyle w:val="FootnoteReference"/>
-                                    </w:rPr>
-                                    <w:footnoteRef/>
-                                </w:r>
-				<xsl:choose>
-				  <xsl:when test="ancestor::tei:bibl">
-				    <w:r>
-				      <w:rPr>
-					<w:rStyle w:val="FootnoteReference"/>
-				      </w:rPr>
-				      <w:t>)</w:t>
-				    </w:r>
-				  </xsl:when>
-				  <xsl:otherwise>
-				    <w:r>
-				      <w:t xml:space="preserve"> </w:t>
-				    </w:r>	
-				  </xsl:otherwise>
-				</xsl:choose>
-                            </xsl:with-param>
-                        </xsl:call-template>
-                    </w:footnote>
-                </xsl:for-each>
-            </w:footnotes>
-        </xsl:result-document>
-    </xsl:template>
-    
-    
+				All rights reserved.
+
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: footnotes.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfile-footnotes-file">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/word/footnotes.xml')" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			href="{concat($wordDirectory,'/word/footnotes.xml')}">
+			<w:footnotes>
+				<w:footnote w:type="separator" w:id="-1">
+					<w:p>
+						<w:pPr>
+							<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
+						</w:pPr>
+						<w:r>
+							<w:separator />
+						</w:r>
+					</w:p>
+				</w:footnote>
+				<w:footnote w:type="continuationSeparator" w:id="0">
+					<w:p>
+						<w:pPr>
+							<w:spacing w:after="0" w:line="240" w:lineRule="auto" />
+						</w:pPr>
+						<w:r>
+							<w:continuationSeparator />
+						</w:r>
+					</w:p>
+					<w:p />
+					<w:p />
+				</w:footnote>
+
+				<xsl:for-each select="key('FOOTNOTES',1)">
+					<xsl:variable name="id" select="position()+1" />
+					<w:footnote w:id="{$id}">
+						<xsl:call-template name="block-element">
+							<xsl:with-param name="pPr">
+								<w:pPr>
+									<w:pStyle w:val="FootnoteText" />
+								</w:pPr>
+								<w:r>
+									<w:rPr>
+										<w:rStyle w:val="FootnoteReference" />
+									</w:rPr>
+									<w:footnoteRef />
+								</w:r>
+								<xsl:choose>
+									<xsl:when test="ancestor::tei:bibl">
+										<w:r>
+											<w:rPr>
+												<w:rStyle w:val="FootnoteReference" />
+											</w:rPr>
+											<w:t>)</w:t>
+										</w:r>
+									</xsl:when>
+									<xsl:otherwise>
+										<w:r>
+											<w:t xml:space="preserve"> </w:t>
+										</w:r>
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:with-param>
+						</xsl:call-template>
+					</w:footnote>
+				</xsl:for-each>
+			</w:footnotes>
+		</xsl:result-document>
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/settings.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/settings.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/settings.xsl	(revision 2397)
@@ -1,138 +1,145 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: settings.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        write: word/settings.xml 
-    </desc>
-   </doc>
-    <xsl:template name="write-docxfile-settings">
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/word/settings.xml')"/>
-         </xsl:message>
-	     </xsl:if>
+				All rights reserved.
 
-        <xsl:result-document href="{concat($wordDirectory,'/word/settings.xml')}" standalone="yes">
-            
-            <w:settings xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">
-                <w:zoom w:percent="100"/>
-                <w:stylePaneSortMethod w:val="0000"/>
-                <w:defaultTabStop w:val="720"/>
-                <w:evenAndOddHeaders/>
-                <w:characterSpacingControl w:val="doNotCompress"/>
-                <w:footnotePr>
-                    <w:footnote w:id="-1"/>
-                    <w:footnote w:id="0"/>
-                </w:footnotePr>
-                <w:endnotePr>
-                    <w:endnote w:id="-1"/>
-                    <w:endnote w:id="0"/>
-                </w:endnotePr>
-                <w:compat/>
-                <m:mathPr>
-                    <m:mathFont m:val="Cambria Math"/>
-                    <m:brkBin m:val="before"/>
-                    <m:brkBinSub m:val="--"/>
-                    <m:smallFrac/>
-                    <m:dispDef/>
-                    <m:lMargin m:val="432"/>
-                    <m:rMargin m:val="0"/>
-                    <m:defJc m:val="left"/>
-                    <m:wrapIndent m:val="1440"/>
-                    <m:intLim m:val="subSup"/>
-                    <m:naryLim m:val="undOvr"/>
-                </m:mathPr>
-                <w:attachedSchema w:val="ActionsPane3"/>
-                <w:themeFontLang w:val="en-US"/>
-                <w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1"
-                                w:accent2="accent2"
-                                w:accent3="accent3"
-                                w:accent4="accent4"
-                                w:accent5="accent5"
-                                w:accent6="accent6"
-                                w:hyperlink="hyperlink"
-                                w:followedHyperlink="followedHyperlink"/>
-                <w:decimalSymbol w:val="."/>
-                <w:listSeparator w:val=","/>
-            </w:settings>
-        </xsl:result-document>
-    </xsl:template>
-    
-    
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: settings.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			write: word/settings.xml
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfile-settings">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/word/settings.xml')" />
+			</xsl:message>
+		</xsl:if>
+
+		<xsl:result-document
+			href="{concat($wordDirectory,'/word/settings.xml')}" standalone="yes">
+
+			<w:settings
+				xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">
+				<w:zoom w:percent="100" />
+				<w:stylePaneSortMethod w:val="0000" />
+				<w:defaultTabStop w:val="720" />
+				<w:evenAndOddHeaders />
+				<w:characterSpacingControl
+					w:val="doNotCompress" />
+				<w:footnotePr>
+					<w:footnote w:id="-1" />
+					<w:footnote w:id="0" />
+				</w:footnotePr>
+				<w:endnotePr>
+					<w:endnote w:id="-1" />
+					<w:endnote w:id="0" />
+				</w:endnotePr>
+				<w:compat />
+				<m:mathPr>
+					<m:mathFont m:val="Cambria Math" />
+					<m:brkBin m:val="before" />
+					<m:brkBinSub m:val="--" />
+					<m:smallFrac />
+					<m:dispDef />
+					<m:lMargin m:val="432" />
+					<m:rMargin m:val="0" />
+					<m:defJc m:val="left" />
+					<m:wrapIndent m:val="1440" />
+					<m:intLim m:val="subSup" />
+					<m:naryLim m:val="undOvr" />
+				</m:mathPr>
+				<w:attachedSchema w:val="ActionsPane3" />
+				<w:themeFontLang w:val="en-US" />
+				<w:clrSchemeMapping w:bg1="light1" w:t1="dark1"
+					w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2"
+					w:accent3="accent3" w:accent4="accent4" w:accent5="accent5"
+					w:accent6="accent6" w:hyperlink="hyperlink"
+					w:followedHyperlink="followedHyperlink" />
+				<w:decimalSymbol w:val="." />
+				<w:listSeparator w:val="," />
+			</w:settings>
+		</xsl:result-document>
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/footers.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/footers.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/footers.xsl	(revision 2397)
@@ -1,110 +1,121 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: footers.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        
-    </desc>
-   </doc>
-    <xsl:template name="write-docxfile-footer-files">
-        <xsl:choose>
-            <xsl:when test="count(key('ALLFOOTERS',1))=0">
-                <xsl:for-each select="document($defaultHeaderFooterFile)">
-                    <xsl:call-template name="write-docxfile-specific-footer-file"/>
-                </xsl:for-each>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:call-template name="write-docxfile-specific-footer-file"/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
-    
-    <xsl:template name="write-docxfile-specific-footer-file">
-        <xsl:for-each select="key('ALLFOOTERS',1)">
-	        <xsl:if test="$debug='true'">
-	           <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/word/footer',position(),'.xml')"/>
-            </xsl:message>
-	        </xsl:if>
+				All rights reserved.
 
-            <xsl:result-document href="{concat($wordDirectory,'/word/footer',position(),'.xml')}">
-                <w:ftr xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                   xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main">
-                    <xsl:apply-templates select="."/>
-                </w:ftr>
-            </xsl:result-document>
-        </xsl:for-each>
-    </xsl:template>
-    
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: footers.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfile-footer-files">
+		<xsl:choose>
+			<xsl:when test="count(key('ALLFOOTERS',1))=0">
+				<xsl:for-each
+					select="document($defaultHeaderFooterFile)">
+					<xsl:call-template
+						name="write-docxfile-specific-footer-file" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template
+					name="write-docxfile-specific-footer-file" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="write-docxfile-specific-footer-file">
+		<xsl:for-each select="key('ALLFOOTERS',1)">
+			<xsl:if test="$debug='true'">
+				<xsl:message>
+					Writing out
+					<xsl:value-of
+						select="concat($wordDirectory,'/word/footer',position(),'.xml')" />
+				</xsl:message>
+			</xsl:if>
+
+			<xsl:result-document
+				href="{concat($wordDirectory,'/word/footer',position(),'.xml')}">
+				<w:ftr xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+					xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main">
+					<xsl:apply-templates select="." />
+				</w:ftr>
+			</xsl:result-document>
+		</xsl:for-each>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/application.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/application.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/docxfiles/application.xsl	(revision 2397)
@@ -1,195 +1,222 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: application.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <xsl:template name="write-docxfile-docprops-core">
-        <xsl:variable name="now" select="tei:whatsTheDate()"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-        <xsl:variable name="coreFile">
-            <xsl:value-of select="$wordDirectory"/>
-            <xsl:text>/docProps/core.xml</xsl:text>
-        </xsl:variable>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: application.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-        <xsl:variable name="createdDate">
-            <xsl:choose>
-                <xsl:when test="doc-available($coreFile)">
-                    <xsl:for-each select="document($coreFile)">
-                        <xsl:value-of select="cp:coreProperties/dcterms:created"/>
-                    </xsl:for-each>
-                </xsl:when>
-                <xsl:otherwise>
-                    <xsl:value-of select="$now"/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
+	<xsl:template name="write-docxfile-docprops-core">
+		<xsl:variable name="now" select="tei:whatsTheDate()" />
 
-        <xsl:variable name="revision">
-            <xsl:choose>
-                <xsl:when test="doc-available($coreFile)">
-                    <xsl:for-each select="document($coreFile)">
-                        <xsl:value-of select="cp:coreProperties/cp:revision + 1"/>
-                    </xsl:for-each>
-                </xsl:when>
-                <xsl:otherwise>1</xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
+		<xsl:variable name="coreFile">
+			<xsl:value-of select="$wordDirectory" />
+			<xsl:text>/docProps/core.xml</xsl:text>
+		</xsl:variable>
 
-        <!-- after opening core.xml, we cannot write back to it; so save
-            under new name -->
-	<xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/docProps/newcore.xml')"/>
-         </xsl:message>
-	     </xsl:if>
+		<xsl:variable name="createdDate">
+			<xsl:choose>
+				<xsl:when test="doc-available($coreFile)">
+					<xsl:for-each select="document($coreFile)">
+						<xsl:value-of
+							select="cp:coreProperties/dcterms:created" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$now" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-        <xsl:result-document href="{concat($wordDirectory,'/docProps/newcore.xml')}" standalone="yes">
-            <cp:coreProperties>
-                <dc:title>
-		  <xsl:variable name="t">
-                    <xsl:call-template name="generateTitle"/>
-		  </xsl:variable>
-		  <xsl:value-of select="$t"/>
-                </dc:title>
-                <dc:creator>
-		  <xsl:variable name="a">
-                    <xsl:call-template name="generateAuthor"/>
-		  </xsl:variable>
-		  <xsl:value-of select="$a"/>
-                </dc:creator>
-                <cp:lastModifiedBy>TEI stylesheets</cp:lastModifiedBy>
-                <cp:revision>
-                    <xsl:value-of select="$revision"/>
-                </cp:revision>
-                <dcterms:created xsi:type="dcterms:W3CDTF">
-                    <xsl:value-of select="$createdDate"/>
-                </dcterms:created>
-                <dcterms:modified xsi:type="dcterms:W3CDTF">
-                    <xsl:value-of select="$now"/>
-                </dcterms:modified>
-            </cp:coreProperties>
-        </xsl:result-document>
-    </xsl:template>
+		<xsl:variable name="revision">
+			<xsl:choose>
+				<xsl:when test="doc-available($coreFile)">
+					<xsl:for-each select="document($coreFile)">
+						<xsl:value-of
+							select="cp:coreProperties/cp:revision + 1" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
+		<!-- after opening core.xml, we cannot write back to it; so save under 
+			new name -->
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/docProps/newcore.xml')" />
+			</xsl:message>
+		</xsl:if>
 
-    <xsl:template name="write-docxfile-docprops-app">
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/docProps/app.xml')"/>
-         </xsl:message>
-	     </xsl:if>
+		<xsl:result-document
+			href="{concat($wordDirectory,'/docProps/newcore.xml')}"
+			standalone="yes">
+			<cp:coreProperties>
+				<dc:title>
+					<xsl:variable name="t">
+						<xsl:call-template name="generateTitle" />
+					</xsl:variable>
+					<xsl:value-of select="$t" />
+				</dc:title>
+				<dc:creator>
+					<xsl:variable name="a">
+						<xsl:call-template name="generateAuthor" />
+					</xsl:variable>
+					<xsl:value-of select="$a" />
+				</dc:creator>
+				<cp:lastModifiedBy>TEI stylesheets</cp:lastModifiedBy>
+				<cp:revision>
+					<xsl:value-of select="$revision" />
+				</cp:revision>
+				<dcterms:created xsi:type="dcterms:W3CDTF">
+					<xsl:value-of select="$createdDate" />
+				</dcterms:created>
+				<dcterms:modified xsi:type="dcterms:W3CDTF">
+					<xsl:value-of select="$now" />
+				</dcterms:modified>
+			</cp:coreProperties>
+		</xsl:result-document>
+	</xsl:template>
 
-        <xsl:result-document href="{concat($wordDirectory,'/docProps/app.xml')}" standalone="yes">
-            <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
-                     xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
-                <Template>STD_3_0_0.dotx</Template>
-                <Application>TEIISO tei-docx.xsl</Application>
-                <DocSecurity>0</DocSecurity>
-                <SharedDoc>true</SharedDoc>
-                <AppVersion>1.0</AppVersion>
-            </Properties>
-        </xsl:result-document>
-    </xsl:template>
 
-    <!-- after opening custom.xml, we cannot write back to it; so save
-	 under new name -->
-    <xsl:template name="write-docxfile-docprops-custom">
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/docProps/newcustom.xml')"/>    </xsl:message>
-	     </xsl:if>
-        <xsl:result-document href="{concat($wordDirectory,'/docProps/newcustom.xml')}" standalone="yes">
-            <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                     xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
-                <property pid="1001" name="TEI_toDOCX">
-                    <xsl:attribute name="fmtid">
+	<xsl:template name="write-docxfile-docprops-app">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/docProps/app.xml')" />
+			</xsl:message>
+		</xsl:if>
+
+		<xsl:result-document
+			href="{concat($wordDirectory,'/docProps/app.xml')}" standalone="yes">
+			<Properties
+				xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
+				xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
+				<Template>STD_3_0_0.dotx</Template>
+				<Application>TEIISO tei-docx.xsl</Application>
+				<DocSecurity>0</DocSecurity>
+				<SharedDoc>true</SharedDoc>
+				<AppVersion>1.0</AppVersion>
+			</Properties>
+		</xsl:result-document>
+	</xsl:template>
+
+	<!-- after opening custom.xml, we cannot write back to it; so save under 
+		new name -->
+	<xsl:template name="write-docxfile-docprops-custom">
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/docProps/newcustom.xml')" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			href="{concat($wordDirectory,'/docProps/newcustom.xml')}"
+			standalone="yes">
+			<Properties
+				xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+				xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
+				<property pid="1001" name="TEI_toDOCX">
+					<xsl:attribute name="fmtid">
                         <xsl:text>{D5CDD505-2E9C-101B-9397-08002B2CF9AE}</xsl:text>
                     </xsl:attribute>
-                    <vt:lpwstr>2.15.0</vt:lpwstr>
-                </property>
-                <xsl:for-each select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:encodingDesc/tei:appInfo/tei:application">
-                    <xsl:if test="not(@ident='TEI_toDOCX')">
-                        <property name="{@ident}">
-                            <xsl:attribute name="pid">
-                                <xsl:value-of select="position()+1001"/>
+					<vt:lpwstr>2.15.0</vt:lpwstr>
+				</property>
+				<xsl:for-each
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:encodingDesc/tei:appInfo/tei:application">
+					<xsl:if test="not(@ident='TEI_toDOCX')">
+						<property name="{@ident}">
+							<xsl:attribute name="pid">
+                                <xsl:value-of
+								select="position()+1001" />
                             </xsl:attribute>
-                            <xsl:attribute name="fmtid">
+							<xsl:attribute name="fmtid">
                                 <xsl:text>{D5CDD505-2E9C-101B-9397-08002B2CF9AE}</xsl:text>
                             </xsl:attribute>
-                            <vt:lpwstr>
-                                <xsl:value-of select="@version"/>
-                            </vt:lpwstr>
-                        </property>
-                    </xsl:if>
-                </xsl:for-each>
-            </Properties>
-        </xsl:result-document>
-    </xsl:template>
+							<vt:lpwstr>
+								<xsl:value-of select="@version" />
+							</vt:lpwstr>
+						</property>
+					</xsl:if>
+				</xsl:for-each>
+			</Properties>
+		</xsl:result-document>
+	</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/graphics/graphics.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/graphics/graphics.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/graphics/graphics.xsl	(revision 2397)
@@ -1,464 +1,485 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-		xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne
 					 mml tbx iso  tei a xs
 					 pic fn xsi dc dcterms
 					 dcmitype rel contypes teidocx teix html cals">
-    
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML
-         </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: graphics.xsl 9998 2012-01-02 18:27:15Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-    <xsl:key name="W" match="image" use="@url"/>
-    <xsl:key name="H" match="image" use="@url"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: graphics.xsl 9998 2012-01-02 18:27:15Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Guides the identity transformation for graphics
-    </desc>
-   </doc>
-    <xsl:template match="a:blip" mode="iden">
-        <xsl:variable name="me" select="generate-id()"/>
-        <a:blip>
-            <xsl:variable name="rId">
-                <xsl:for-each select="key('BLIP',1)">
-                    <xsl:if test="generate-id()=$me">
-                        <xsl:value-of select="concat('rId', string(200 + position()))"/>
-                    </xsl:if>
-                </xsl:for-each>
-            </xsl:variable>
-            <xsl:choose>
-                <xsl:when test="@r:embed">
-                    <xsl:attribute name="r:embed" select="$rId"/>
-                </xsl:when>
-                <xsl:otherwise>
-                    <xsl:attribute name="r:link" select="$rId"/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </a:blip>
-    </xsl:template>
-    
-    <!-- 
-        Handle figures 
-    -->
-    
-    <xsl:template match="tei:figure">
-      <xsl:choose>
-	<xsl:when test="@rend='inline' or @place='inline'">
-	  <xsl:apply-templates/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:call-template name="block-element">
-            <xsl:with-param name="pPr">
-	      <w:pPr>
-		<w:spacing w:before="240"/>
-		<w:jc w:val="{$alignFigures}"/>
-	      </w:pPr>
-            </xsl:with-param>
-	  </xsl:call-template>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
 
-    <xsl:template match="tei:figure/tei:figDesc"/>
-    
-    <xsl:template match="tei:figure/tei:head">
-      <xsl:variable name="number">
-	<xsl:number level="any"/>
-      </xsl:variable>
-      <xsl:choose>
-	<xsl:when test="../@xml:id">
-	    <!-- we want a bookmark for referencing this figure -->
-	  <xsl:call-template name="block-element">
-            <xsl:with-param name="style">
-	      <xsl:choose>
-		<xsl:when test="ancestor::tei:back">Figuretitleannex</xsl:when>
-		<xsl:otherwise>Figuretitle</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:with-param>
-	    <xsl:with-param name="bookmark-id">
-	      <xsl:value-of select="1000+$number"/>
-	    </xsl:with-param>
-	    <xsl:with-param name="bookmark-name">
-	      <xsl:text>_</xsl:text>
-	      <xsl:value-of select="../@xml:id"/>
-	    </xsl:with-param>
-	  </xsl:call-template>
-	</xsl:when>
-	<xsl:otherwise>  
-	  <xsl:call-template name="block-element">
-            <xsl:with-param name="style">
-	      <xsl:choose>
-		<xsl:when test="ancestor::tei:back">Figuretitleannex</xsl:when>
-		<xsl:otherwise>Figuretitle</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:with-param>
-	  </xsl:call-template>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-    
-    <xsl:template match="tei:graphic">
-        <!-- perform some tests on the graphic -->
-	<xsl:variable name="maxWidth" select="number(number($pageWidth)*100) cast as xs:integer"/>
-	<xsl:variable name="maxHeight"
-		      select="number(number($pageHeight)*100) cast as
-			      xs:integer"/>
-	<xsl:variable name="filename">
-	  <xsl:text>media/resource</xsl:text>
-	  <xsl:number level="any"/>
-	  <xsl:text>.</xsl:text>
-	  <xsl:value-of select="tokenize(@url,'\.')[last()]"/>
-	</xsl:variable>
-	<xsl:variable name="origheight">
-	  <xsl:choose>
-	    <xsl:when test="@teidocx:height">
-	      <xsl:value-of select="@teidocx:height"/>
-	    </xsl:when>
-	    <xsl:when test="doc-available(concat($wordDirectory,'/image-size-info.xml'))">
-		<xsl:for-each select="document(concat($wordDirectory,'/image-size-info.xml'))">
-		  <xsl:value-of select="(number(key('H',$filename)/height) div 72) * 9144"/>
-		</xsl:for-each>
-	    </xsl:when>
-	    <xsl:otherwise>0</xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
+	<xsl:key name="W" match="image" use="@url" />
+	<xsl:key name="H" match="image" use="@url" />
 
-	<xsl:variable name="origwidth">
-	  <xsl:choose>
-	    <xsl:when test="@teidocx:width">
-	      <xsl:value-of select="@teidocx:width"/>
-	    </xsl:when>
-	    <xsl:when test="doc-available(concat($wordDirectory,'/image-size-info.xml'))">
-		<xsl:for-each select="document(concat($wordDirectory,'/image-size-info.xml'))">
-		  <xsl:value-of select="(number(key('W',$filename)/width) div 72) * 9144"/>
-		</xsl:for-each>
-	    </xsl:when>
-	    <xsl:otherwise>0</xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
-	<xsl:choose>
-	  <xsl:when test="$filename and  ( ($origwidth &gt; 0 and $origheight &gt; 0) or (@width and @height))">
-            
-            <!--
-                
-                is there a number present?
-                
-                not(number(substring(@width,0,string-length(@width)-1))=NAN) and 
-                not(number(substring(@height,0,string-length(@height)-1))=NAN)">
-                
-            -->
-            
-            <xsl:variable name="Width">
-	      <!-- remembering that pageWidth is already divided by 100 -->
-                <xsl:choose>
-                    <xsl:when test="contains(@width,'%')">
-                        <xsl:value-of select="number($pageWidth * number(substring-before(@width,'%'))) cast as xs:integer"/>
-                    </xsl:when>
-                    <xsl:when test="@width">
-                        <xsl:value-of select="tei:convert-dim-emu(@width)"/>
-                    </xsl:when>
-                    <xsl:when test="@scale and $origwidth">
-                        <xsl:value-of select="($origwidth *  number(@scale)) cast as xs:integer"/>
-                    </xsl:when>
-                    <xsl:when test="@height and $origheight and $origwidth">
-		      <xsl:variable name="h">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Guides the identity transformation for graphics
+		</desc>
+	</doc>
+	<xsl:template match="a:blip" mode="iden">
+		<xsl:variable name="me" select="generate-id()" />
+		<a:blip>
+			<xsl:variable name="rId">
+				<xsl:for-each select="key('BLIP',1)">
+					<xsl:if test="generate-id()=$me">
+						<xsl:value-of
+							select="concat('rId', string(200 + position()))" />
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:variable>
 			<xsl:choose>
-			  <xsl:when test="contains(@height,'%')">
-			    <xsl:value-of select="number($pageHeight * (number(substring-before(@height,'%')))) cast as xs:integer"/>
-			  </xsl:when>
-			  <xsl:otherwise>
-			    <xsl:value-of
-				select="tei:convert-dim-emu(@height)"/>
-			  </xsl:otherwise>
+				<xsl:when test="@r:embed">
+					<xsl:attribute name="r:embed" select="$rId" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="r:link" select="$rId" />
+				</xsl:otherwise>
 			</xsl:choose>
-		      </xsl:variable>
-		      <xsl:value-of select="number(($h * $origwidth) div $origheight)    cast as xs:integer"/>
-                    </xsl:when>
-                    <xsl:when test="$origwidth">
-                        <xsl:value-of select="$origwidth"/>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <xsl:message terminate="yes">no way to work out image width for
-                            <xsl:value-of select="$filename"/>
-                        </xsl:message>
-                    </xsl:otherwise>
-                </xsl:choose>
-            </xsl:variable>
-            
-            <xsl:variable name="Height">
-                <xsl:choose>
-                    <xsl:when test="contains(@height,'%')">
-                        <xsl:value-of select="number($pageHeight * (number(substring-before(@height,'%')))) cast as xs:integer"/>
-                    </xsl:when>
-                    <xsl:when test="@height">
-                        <xsl:value-of select="tei:convert-dim-emu(@height)"/>
-                    </xsl:when>
-                    <xsl:when test="@scale and $origheight">
-                        <xsl:value-of select="($origheight * number(@scale)) cast as xs:integer"/>
-                    </xsl:when>
-                    <xsl:when test="@width and $origheight and $origwidth">
-                        <xsl:value-of select="number(  ($Width *  $origheight) div $origwidth) cast as xs:integer"/>
-                    </xsl:when>
-                    <xsl:when test="$origheight">
-                        <xsl:value-of select="$origheight"/>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <xsl:message terminate="yes">no way to work out image height for
-                            <xsl:value-of select="$filename"/>
-                        </xsl:message>
-                    </xsl:otherwise>
-                </xsl:choose>
-            </xsl:variable>
-            
-	    <!-- check for sense -->
-            <xsl:variable name="imageWidth">
-	      <xsl:choose>
-		<xsl:when test="$Width = -1">
-		  <xsl:value-of select="$maxWidth"/>
-		</xsl:when>
-		<xsl:when test="$Width &gt; $maxWidth">
-		  <xsl:value-of select="$maxWidth"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <xsl:value-of select="$Width"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:variable>
-            <xsl:variable name="imageHeight">
-	      <xsl:choose>
-		<xsl:when test="$Height = -1">
-		  <xsl:value-of select="$maxHeight"/>
-		</xsl:when>
-		<xsl:when test="$Height &gt; $maxHeight">
-		  <xsl:value-of select="$maxHeight"/>
-		</xsl:when>
-		<xsl:when test="$Width &gt; $maxWidth">
-		  <xsl:value-of select="($Height * ($maxWidth div
-					$Width) ) cast as xs:integer"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <xsl:value-of select="$Height"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:variable>
-	    <!--
-		
-		<xsl:message>
-		========================
-		<xsl:for-each select="@*">
-		- @<xsl:value-of select="name(.)"/>: <xsl:value-of select="."/>
-		</xsl:for-each>
-		
-		- maxWidth: <xsl:value-of select="$maxWidth"/>
-		- maxHeight: <xsl:value-of select="$maxHeight"/>
-		- Width: <xsl:value-of select="$Width"/>
-		- Height: <xsl:value-of select="$Height"/>
-		* imageWidth: <xsl:value-of select="$imageWidth"/>
-		* imageHeight: <xsl:value-of select="$imageHeight"/>
-		</xsl:message>
-	    -->
-	    <!-- prepare actual graphic -->
-	    <xsl:variable name="generatedID">
-	      <xsl:number level="any"/>
-	    <!--
+		</a:blip>
+	</xsl:template>
+
+	<!-- Handle figures -->
+
+	<xsl:template match="tei:figure">
 		<xsl:choose>
-		<xsl:when test="@n">
-		  <xsl:value-of select="@n"/>
-		</xsl:when>
-		<xsl:otherwise>
-		  <xsl:number level="any"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	      -->
-	    </xsl:variable>
+			<xsl:when test="@rend='inline' or @place='inline'">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="block-element">
+					<xsl:with-param name="pPr">
+						<w:pPr>
+							<w:spacing w:before="240" />
+							<w:jc w:val="{$alignFigures}" />
+						</w:pPr>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-            <xsl:variable name="graphic-element">
-                <a:graphic>
-                    <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
-                        <pic:pic>
-                            <pic:nvPicPr>
-                                <pic:cNvPr name="{tokenize($filename, '/')[last()]}">
-                                    <xsl:attribute name="id">
-                                        <xsl:number level="any"/>
+	<xsl:template match="tei:figure/tei:figDesc" />
+
+	<xsl:template match="tei:figure/tei:head">
+		<xsl:variable name="number">
+			<xsl:number level="any" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="../@xml:id">
+				<!-- we want a bookmark for referencing this figure -->
+				<xsl:call-template name="block-element">
+					<xsl:with-param name="style">
+						<xsl:choose>
+							<xsl:when test="ancestor::tei:back">
+								Figuretitleannex
+							</xsl:when>
+							<xsl:otherwise>
+								Figuretitle
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+					<xsl:with-param name="bookmark-id">
+						<xsl:value-of select="1000+$number" />
+					</xsl:with-param>
+					<xsl:with-param name="bookmark-name">
+						<xsl:text>_</xsl:text>
+						<xsl:value-of select="../@xml:id" />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="block-element">
+					<xsl:with-param name="style">
+						<xsl:choose>
+							<xsl:when test="ancestor::tei:back">
+								Figuretitleannex
+							</xsl:when>
+							<xsl:otherwise>
+								Figuretitle
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="tei:graphic">
+		<!-- perform some tests on the graphic -->
+		<xsl:variable name="maxWidth"
+			select="number(number($pageWidth)*100) cast as xs:integer" />
+		<xsl:variable name="maxHeight"
+			select="number(number($pageHeight)*100) cast as
+			      xs:integer" />
+		<xsl:variable name="filename">
+			<xsl:text>media/resource</xsl:text>
+			<xsl:number level="any" />
+			<xsl:text>.</xsl:text>
+			<xsl:value-of select="tokenize(@url,'\.')[last()]" />
+		</xsl:variable>
+		<xsl:variable name="origheight">
+			<xsl:choose>
+				<xsl:when test="@teidocx:height">
+					<xsl:value-of select="@teidocx:height" />
+				</xsl:when>
+				<xsl:when
+					test="doc-available(concat($wordDirectory,'/image-size-info.xml'))">
+					<xsl:for-each
+						select="document(concat($wordDirectory,'/image-size-info.xml'))">
+						<xsl:value-of
+							select="(number(key('H',$filename)/height) div 72) * 9144" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+
+		<xsl:variable name="origwidth">
+			<xsl:choose>
+				<xsl:when test="@teidocx:width">
+					<xsl:value-of select="@teidocx:width" />
+				</xsl:when>
+				<xsl:when
+					test="doc-available(concat($wordDirectory,'/image-size-info.xml'))">
+					<xsl:for-each
+						select="document(concat($wordDirectory,'/image-size-info.xml'))">
+						<xsl:value-of
+							select="(number(key('W',$filename)/width) div 72) * 9144" />
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:otherwise>
+					0
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="$filename and  ( ($origwidth &gt; 0 and $origheight &gt; 0) or (@width and @height))">
+
+				<!-- is there a number present? not(number(substring(@width,0,string-length(@width)-1))=NAN) 
+					and not(number(substring(@height,0,string-length(@height)-1))=NAN)"> -->
+
+				<xsl:variable name="Width">
+					<!-- remembering that pageWidth is already divided by 100 -->
+					<xsl:choose>
+						<xsl:when test="contains(@width,'%')">
+							<xsl:value-of
+								select="number($pageWidth * number(substring-before(@width,'%'))) cast as xs:integer" />
+						</xsl:when>
+						<xsl:when test="@width">
+							<xsl:value-of select="tei:convert-dim-emu(@width)" />
+						</xsl:when>
+						<xsl:when test="@scale and $origwidth">
+							<xsl:value-of
+								select="($origwidth *  number(@scale)) cast as xs:integer" />
+						</xsl:when>
+						<xsl:when test="@height and $origheight and $origwidth">
+							<xsl:variable name="h">
+								<xsl:choose>
+									<xsl:when test="contains(@height,'%')">
+										<xsl:value-of
+											select="number($pageHeight * (number(substring-before(@height,'%')))) cast as xs:integer" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:value-of
+											select="tei:convert-dim-emu(@height)" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:value-of
+								select="number(($h * $origwidth) div $origheight)    cast as xs:integer" />
+						</xsl:when>
+						<xsl:when test="$origwidth">
+							<xsl:value-of select="$origwidth" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:message terminate="yes">
+								no way to work out image width for
+								<xsl:value-of select="$filename" />
+							</xsl:message>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+
+				<xsl:variable name="Height">
+					<xsl:choose>
+						<xsl:when test="contains(@height,'%')">
+							<xsl:value-of
+								select="number($pageHeight * (number(substring-before(@height,'%')))) cast as xs:integer" />
+						</xsl:when>
+						<xsl:when test="@height">
+							<xsl:value-of select="tei:convert-dim-emu(@height)" />
+						</xsl:when>
+						<xsl:when test="@scale and $origheight">
+							<xsl:value-of
+								select="($origheight * number(@scale)) cast as xs:integer" />
+						</xsl:when>
+						<xsl:when test="@width and $origheight and $origwidth">
+							<xsl:value-of
+								select="number(  ($Width *  $origheight) div $origwidth) cast as xs:integer" />
+						</xsl:when>
+						<xsl:when test="$origheight">
+							<xsl:value-of select="$origheight" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:message terminate="yes">
+								no way to work out image height for
+								<xsl:value-of select="$filename" />
+							</xsl:message>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+
+				<!-- check for sense -->
+				<xsl:variable name="imageWidth">
+					<xsl:choose>
+						<xsl:when test="$Width = -1">
+							<xsl:value-of select="$maxWidth" />
+						</xsl:when>
+						<xsl:when test="$Width &gt; $maxWidth">
+							<xsl:value-of select="$maxWidth" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$Width" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="imageHeight">
+					<xsl:choose>
+						<xsl:when test="$Height = -1">
+							<xsl:value-of select="$maxHeight" />
+						</xsl:when>
+						<xsl:when test="$Height &gt; $maxHeight">
+							<xsl:value-of select="$maxHeight" />
+						</xsl:when>
+						<xsl:when test="$Width &gt; $maxWidth">
+							<xsl:value-of
+								select="($Height * ($maxWidth div
+					$Width) ) cast as xs:integer" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$Height" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<!-- <xsl:message> ======================== <xsl:for-each select="@*"> 
+					- @<xsl:value-of select="name(.)"/>: <xsl:value-of select="."/> </xsl:for-each> 
+					- maxWidth: <xsl:value-of select="$maxWidth"/> - maxHeight: <xsl:value-of 
+					select="$maxHeight"/> - Width: <xsl:value-of select="$Width"/> - Height: 
+					<xsl:value-of select="$Height"/> * imageWidth: <xsl:value-of select="$imageWidth"/> 
+					* imageHeight: <xsl:value-of select="$imageHeight"/> </xsl:message> -->
+				<!-- prepare actual graphic -->
+				<xsl:variable name="generatedID">
+					<xsl:number level="any" />
+					<!-- <xsl:choose> <xsl:when test="@n"> <xsl:value-of select="@n"/> </xsl:when> 
+						<xsl:otherwise> <xsl:number level="any"/> </xsl:otherwise> </xsl:choose> -->
+				</xsl:variable>
+
+				<xsl:variable name="graphic-element">
+					<a:graphic>
+						<a:graphicData
+							uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
+							<pic:pic>
+								<pic:nvPicPr>
+									<pic:cNvPr name="{tokenize($filename, '/')[last()]}">
+										<xsl:attribute name="id">
+                                        <xsl:number
+											level="any" />
                                     </xsl:attribute>
-                                </pic:cNvPr>
-                                <pic:cNvPicPr/>
-                            </pic:nvPicPr>
-                            <pic:blipFill>
-                                <a:blip>
-				  <xsl:attribute name="r:embed">
+									</pic:cNvPr>
+									<pic:cNvPicPr />
+								</pic:nvPicPr>
+								<pic:blipFill>
+									<a:blip>
+										<xsl:attribute name="r:embed">
 				    <xsl:choose>
 				      <xsl:when test="$isofreestanding='true'">
 					<xsl:text>rId</xsl:text>
 					<xsl:value-of
-					    select="number($generatedID)
-						    + 300"/>
+											select="number($generatedID)
+						    + 300" />
 				      </xsl:when>
 				      <xsl:otherwise>
-					<xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Target=$filename]/@Id"/>
+					<xsl:value-of
+											select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Target=$filename]/@Id" />
 				      </xsl:otherwise>
 				    </xsl:choose>
 				  </xsl:attribute>
-				</a:blip>
-				<a:stretch>
-				  <a:fillRect/>
-                                </a:stretch>
-                            </pic:blipFill>
-                            <pic:spPr>
-                                <a:xfrm>
-                                    <a:off x="0" y="0"/>
-                                    <a:ext cx="{$imageWidth}00" cy="{$imageHeight}00"/>
-                                </a:xfrm>
-                                <a:prstGeom prst="rect">
-                                    <a:avLst/>
-                                </a:prstGeom>
-				<xsl:if test="$shadowGraphics='true'
+									</a:blip>
+									<a:stretch>
+										<a:fillRect />
+									</a:stretch>
+								</pic:blipFill>
+								<pic:spPr>
+									<a:xfrm>
+										<a:off x="0" y="0" />
+										<a:ext cx="{$imageWidth}00" cy="{$imageHeight}00" />
+									</a:xfrm>
+									<a:prstGeom prst="rect">
+										<a:avLst />
+									</a:prstGeom>
+									<xsl:if
+										test="$shadowGraphics='true'
 					      and parent::tei:figure">
-				  <a:effectLst>
-				    <a:outerShdw blurRad="50800" dist="88900" dir="2700000" algn="tl" rotWithShape="0">
-				      <a:schemeClr val="tx1">
-					<a:alpha val="49000"/>
-				      </a:schemeClr>
-				    </a:outerShdw>
-				  </a:effectLst>
-				</xsl:if>
-                            </pic:spPr>
-                        </pic:pic>
-                    </a:graphicData>
-                </a:graphic>
-            </xsl:variable>
-            <!-- end graphic element -->
-            
-            <w:r>
-                <w:drawing>
-                    <!-- choose between inline and block -->
-                    <xsl:choose>
-		      <xsl:when test="parent::tei:figure[@place='left'
+										<a:effectLst>
+											<a:outerShdw blurRad="50800" dist="88900"
+												dir="2700000" algn="tl" rotWithShape="0">
+												<a:schemeClr val="tx1">
+													<a:alpha val="49000" />
+												</a:schemeClr>
+											</a:outerShdw>
+										</a:effectLst>
+									</xsl:if>
+								</pic:spPr>
+							</pic:pic>
+						</a:graphicData>
+					</a:graphic>
+				</xsl:variable>
+				<!-- end graphic element -->
+
+				<w:r>
+					<w:drawing>
+						<!-- choose between inline and block -->
+						<xsl:choose>
+							<xsl:when
+								test="parent::tei:figure[@place='left'
 				      or @place='centre' or @place='right' or @place='center']">
-			<wp:anchor simplePos="0" relativeHeight="10" behindDoc="0" locked="0" layoutInCell="1"
-				   allowOverlap="1">
-			  <wp:simplePos x="0" y="0"/>
-			  <wp:positionH relativeFrom="margin">
-			    <wp:align>
-			      <xsl:value-of select="parent::tei:figure/@place"/>
-			    </wp:align>
-			  </wp:positionH>
-			  <wp:positionV relativeFrom="paragraph">
-			    <wp:align>center</wp:align>
-			  </wp:positionV>
-			  <wp:extent cx="{$imageWidth}00" cy="{$imageHeight}00"/>
-			  <xsl:if test="$shadowGraphics='true'">
-			    <wp:effectExtent l="50800" t="25400" r="101600" b="63500"/>
-			  </xsl:if>
-			  <wp:wrapSquare wrapText="bothSides"/>
-			  <wp:docPr  name="{tokenize($filename, '/')[last()]}">
-			    <xsl:attribute name="id">
-			      <xsl:value-of select="$generatedID"/>
+								<wp:anchor simplePos="0" relativeHeight="10"
+									behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1">
+									<wp:simplePos x="0" y="0" />
+									<wp:positionH relativeFrom="margin">
+										<wp:align>
+											<xsl:value-of select="parent::tei:figure/@place" />
+										</wp:align>
+									</wp:positionH>
+									<wp:positionV relativeFrom="paragraph">
+										<wp:align>center</wp:align>
+									</wp:positionV>
+									<wp:extent cx="{$imageWidth}00" cy="{$imageHeight}00" />
+									<xsl:if test="$shadowGraphics='true'">
+										<wp:effectExtent l="50800" t="25400"
+											r="101600" b="63500" />
+									</xsl:if>
+									<wp:wrapSquare wrapText="bothSides" />
+									<wp:docPr name="{tokenize($filename, '/')[last()]}">
+										<xsl:attribute name="id">
+			      <xsl:value-of select="$generatedID" />
 			    </xsl:attribute>
-			  </wp:docPr>                                
-			  <xsl:if test="$shadowGraphics='true'">
-			    <wp:cNvGraphicFramePr/>
-			  </xsl:if>
-			  <xsl:copy-of select="$graphic-element"/>
-			</wp:anchor>
-		      </xsl:when>
-		      <xsl:otherwise>
-			<wp:inline distT="0" distB="0" distL="0" distR="0">
-			  <wp:extent cx="{$imageWidth}00" cy="{$imageHeight}00"/>
-			  <xsl:if test="$shadowGraphics='true'">
-			    <wp:effectExtent l="50800" t="25400" r="101600" b="63500"/>
-			  </xsl:if>
-			  <wp:docPr  name="{tokenize($filename, '/')[last()]}">
-			    <xsl:attribute name="id">
-			      <xsl:value-of select="$generatedID"/>
+									</wp:docPr>
+									<xsl:if test="$shadowGraphics='true'">
+										<wp:cNvGraphicFramePr />
+									</xsl:if>
+									<xsl:copy-of select="$graphic-element" />
+								</wp:anchor>
+							</xsl:when>
+							<xsl:otherwise>
+								<wp:inline distT="0" distB="0" distL="0" distR="0">
+									<wp:extent cx="{$imageWidth}00" cy="{$imageHeight}00" />
+									<xsl:if test="$shadowGraphics='true'">
+										<wp:effectExtent l="50800" t="25400"
+											r="101600" b="63500" />
+									</xsl:if>
+									<wp:docPr name="{tokenize($filename, '/')[last()]}">
+										<xsl:attribute name="id">
+			      <xsl:value-of select="$generatedID" />
 			    </xsl:attribute>
-			  </wp:docPr>                                
-			  <xsl:if test="$shadowGraphics='true'">
-			    <wp:cNvGraphicFramePr/>
-			  </xsl:if>
-			  <xsl:copy-of select="$graphic-element"/>
-			</wp:inline>
-		      </xsl:otherwise>
-                    </xsl:choose>
-                </w:drawing>
-            </w:r>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <xsl:message terminate="yes">ERROR. no image size info for  <xsl:value-of select="$filename"/>, cannot proceed</xsl:message>
+									</wp:docPr>
+									<xsl:if test="$shadowGraphics='true'">
+										<wp:cNvGraphicFramePr />
+									</xsl:if>
+									<xsl:copy-of select="$graphic-element" />
+								</wp:inline>
+							</xsl:otherwise>
+						</xsl:choose>
+					</w:drawing>
+				</w:r>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:message terminate="yes">
+					ERROR. no image size info for
+					<xsl:value-of select="$filename" />
+					, cannot proceed
+				</xsl:message>
 
-	  </xsl:otherwise>
-	</xsl:choose>
-    </xsl:template>
-    
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/wordsections/wordsections.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/wordsections/wordsections.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/wordsections/wordsections.xsl	(revision 2397)
@@ -1,164 +1,174 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: wordsections.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Dealing with sections
-    </desc>
-   </doc>
-    <xsl:template match="tei:milestone">
-        <xsl:param name="final-section">false</xsl:param>
-        
-        
-        <!-- construct sectPr -->
-        <xsl:variable name="sectPr">
-            <w:sectPr>
-	      <xsl:for-each select="tei:footer">
-		<xsl:variable name="ref" select="@ref"/>
-		<xsl:if test="count(key('FOOTERS',$ref))&gt;0">
-		  <xsl:variable name="footernum">
-		    <xsl:for-each select="key('FOOTERS',$ref)">
-		      <xsl:number level="any"/>
-		    </xsl:for-each>
-		  </xsl:variable>
-		  <w:footerReference w:type="{@type}" r:id="{concat('rId',100+$footernum)}"/>
-		</xsl:if>
-	      </xsl:for-each>
-	      
-	      <xsl:for-each select="tei:header">
-		<xsl:variable name="ref" select="@ref"/>
-		<xsl:if test="count(key('HEADERS',$ref))&gt;0">
-		  <xsl:variable name="headernum">
-		    <xsl:for-each select="key('HEADERS',$ref)">
-		      <xsl:number level="any"/>
-		    </xsl:for-each>
-		  </xsl:variable>
-		  <w:headerReference w:type="{@type}" r:id="{concat('rId',100+$headernum)}"/>
-		</xsl:if>
-	      </xsl:for-each>
-	      
-	      <w:pgSz>
+				All rights reserved.
+
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: wordsections.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Dealing with sections
+		</desc>
+	</doc>
+	<xsl:template match="tei:milestone">
+		<xsl:param name="final-section">
+			false
+		</xsl:param>
+
+
+		<!-- construct sectPr -->
+		<xsl:variable name="sectPr">
+			<w:sectPr>
+				<xsl:for-each select="tei:footer">
+					<xsl:variable name="ref" select="@ref" />
+					<xsl:if test="count(key('FOOTERS',$ref))&gt;0">
+						<xsl:variable name="footernum">
+							<xsl:for-each select="key('FOOTERS',$ref)">
+								<xsl:number level="any" />
+							</xsl:for-each>
+						</xsl:variable>
+						<w:footerReference w:type="{@type}"
+							r:id="{concat('rId',100+$footernum)}" />
+					</xsl:if>
+				</xsl:for-each>
+
+				<xsl:for-each select="tei:header">
+					<xsl:variable name="ref" select="@ref" />
+					<xsl:if test="count(key('HEADERS',$ref))&gt;0">
+						<xsl:variable name="headernum">
+							<xsl:for-each select="key('HEADERS',$ref)">
+								<xsl:number level="any" />
+							</xsl:for-each>
+						</xsl:variable>
+						<w:headerReference w:type="{@type}"
+							r:id="{concat('rId',100+$headernum)}" />
+					</xsl:if>
+				</xsl:for-each>
+
+				<w:pgSz>
+					<xsl:choose>
+						<!-- landscape -->
+						<xsl:when test="tei:orientation/@type='landscape'">
+							<xsl:attribute name="w:orient">landscape</xsl:attribute>
+							<xsl:attribute name="w:w">15840</xsl:attribute>
+							<xsl:attribute name="w:h">12240</xsl:attribute>
+						</xsl:when>
+						<!-- portrait -->
+						<xsl:otherwise>
+							<xsl:attribute name="w:w">12240</xsl:attribute>
+							<xsl:attribute name="w:h">15840</xsl:attribute>
+						</xsl:otherwise>
+					</xsl:choose>
+				</w:pgSz>
+				<w:pgMar w:top="1440" w:right="1440" w:bottom="1440"
+					w:left="1440" w:gutter="0" w:footer="720" w:header="720" />
+				<xsl:if test="tei:pageNumbering">
+					<w:pgNumType>
+						<xsl:if test="tei:pageNumbering/@start">
+							<xsl:attribute name="w:start"
+								select="tei:pageNumbering/@start" />
+						</xsl:if>
+						<xsl:if test="tei:pageNumbering/@type">
+							<xsl:attribute name="w:fmt"
+								select="tei:pageNumbering/@type" />
+						</xsl:if>
+					</w:pgNumType>
+				</xsl:if>
+				<xsl:if
+					test="tei:header/@type='first' or tei:footer/@type='first'">
+					<w:titlePg />
+				</xsl:if>
+				<w:docGrid w:linePitch="360" />
+			</w:sectPr>
+		</xsl:variable>
+
+		<!-- write out sectPr -->
 		<xsl:choose>
-		  <!-- landscape -->
-		  <xsl:when test="tei:orientation/@type='landscape'">
-		    <xsl:attribute name="w:orient">landscape</xsl:attribute>
-		    <xsl:attribute name="w:w">15840</xsl:attribute>
-		    <xsl:attribute name="w:h">12240</xsl:attribute>
-		  </xsl:when>
-		  <!-- portrait -->
-		  <xsl:otherwise>
-		    <xsl:attribute name="w:w">12240</xsl:attribute>
-		    <xsl:attribute name="w:h">15840</xsl:attribute>
-		  </xsl:otherwise>
+			<xsl:when test="$final-section='false'">
+				<w:p>
+					<w:pPr>
+						<xsl:copy-of select="$sectPr" />
+					</w:pPr>
+				</w:p>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="$sectPr" />
+			</xsl:otherwise>
 		</xsl:choose>
-	      </w:pgSz>
-	      <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:gutter="0"
-		       w:footer="720"
-		       w:header="720"/>
-	      <xsl:if test="tei:pageNumbering">
-		<w:pgNumType>
-		  <xsl:if test="tei:pageNumbering/@start">
-		    <xsl:attribute name="w:start" select="tei:pageNumbering/@start"/>
-		  </xsl:if>
-		  <xsl:if test="tei:pageNumbering/@type">
-		    <xsl:attribute name="w:fmt" select="tei:pageNumbering/@type"/>
-		  </xsl:if>
-		</w:pgNumType>
-	      </xsl:if>
-	      <xsl:if test="tei:header/@type='first' or tei:footer/@type='first'">
-		<w:titlePg/>
-	      </xsl:if>
-	      <w:docGrid w:linePitch="360"/>
-	    </w:sectPr>
-	</xsl:variable>
-        
-        <!-- write out sectPr -->
-        <xsl:choose>
-            <xsl:when test="$final-section='false'">
-                <w:p>
-                    <w:pPr>
-                        <xsl:copy-of select="$sectPr"/>
-                    </w:pPr>
-                </w:p>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:copy-of select="$sectPr"/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
-    
-    
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/drama/drama.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/drama/drama.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/drama/drama.xsl	(revision 2397)
@@ -1,143 +1,155 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-		xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne
 					 mml tbx iso tei a xs
 					 pic fn xsi dc dcterms
 					 dcmitype rel contypes teidocx teix html cals">
-    
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML
-         </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        A speaker's name
-    </desc>
-   </doc>
-    <xsl:template match="tei:sp/tei:speaker" >
-      <xsl:call-template name="block-element">
-	<xsl:with-param name="style">teispeaker</xsl:with-param>
-      </xsl:call-template>
-    </xsl:template>
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        A bit of speech name
-    </desc>
-   </doc>
-    <xsl:template match="tei:sp/tei:p" >
-      <xsl:call-template name="block-element">
-	<xsl:with-param name="style">teispeech</xsl:with-param>
-      </xsl:call-template>
-    </xsl:template>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        A stage direction
-    </desc>
-   </doc>
-    <xsl:template match="tei:sp/tei:stage" >
-      <xsl:call-template name="block-element">
-            <xsl:with-param name="style">teistage</xsl:with-param>
-      </xsl:call-template>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        A line of verse
-    </desc>
-   </doc>
-    <xsl:template match="tei:l">
-      <xsl:call-template name="block-element">
-	<xsl:with-param name="style">teil</xsl:with-param>
-      </xsl:call-template>
-    </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        A block of verse
-    </desc>
-    </doc>
-    <xsl:template match="tei:lg">
-      <xsl:apply-templates/>
-      <w:p>
-	<w:pPr>
-	  <w:pStyle w:val="teilg"/>
-	</w:pPr>
-        <w:r>
-	  <w:br/>
-        </w:r>
-      </w:p>
-    </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			A speaker's name
+		</desc>
+	</doc>
+	<xsl:template match="tei:sp/tei:speaker">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				teispeaker
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			A bit of speech name
+		</desc>
+	</doc>
+	<xsl:template match="tei:sp/tei:p">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				teispeech
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			A stage direction
+		</desc>
+	</doc>
+	<xsl:template match="tei:sp/tei:stage">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				teistage
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			A line of verse
+		</desc>
+	</doc>
+	<xsl:template match="tei:l">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				teil
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			A block of verse
+		</desc>
+	</doc>
+	<xsl:template match="tei:lg">
+		<xsl:apply-templates />
+		<w:p>
+			<w:pPr>
+				<w:pStyle w:val="teilg" />
+			</w:pPr>
+			<w:r>
+				<w:br />
+			</w:r>
+		</w:p>
+	</xsl:template>
+
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/dynamic/dynamic.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/dynamic/dynamic.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/dynamic/dynamic.xsl	(revision 2397)
@@ -1,143 +1,147 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso     tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso     tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: dynamic.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc> 
-        dynamic content
-    </desc>
-   </doc>    
-    <xsl:template match="tei:dynamicContent">
-        <xsl:choose>
-            <xsl:when test="@type='pagenumber'">
-                <w:fldSimple w:instr=" PAGE \* MERGEFORMAT ">
-                    <w:r>
-                        <w:rPr>
-                            <w:noProof/>
-                        </w:rPr>
-                        <w:t>1</w:t>
-                    </w:r>
-                </w:fldSimple>
-            </xsl:when>
-        </xsl:choose>
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Dealing with divGens
-    </desc>
-   </doc>
-    <xsl:template match="tei:divGen">
-        <xsl:choose>
-            <xsl:when test="@type='toc'">
-                <xsl:call-template name="generate-toc"/>
-            </xsl:when>
-        </xsl:choose>
-        
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Table of Contents:
-        Feel free to overwrite this one.
-    </desc>
-   </doc>
-    <xsl:template name="generate-toc">
-        <w:p>
-            <w:pPr>
-                <w:pStyle w:val="TOC1"/>
-                <w:tabs>
-                    <w:tab w:val="right" w:leader="dot" w:pos="9350"/>
-                </w:tabs>
-            </w:pPr>
-            <w:r>
-                <w:fldChar w:fldCharType="begin"/>
-            </w:r>
-            <w:r>
-                <w:rPr>
-                    <w:noProof/>
-                </w:rPr>
-                <w:instrText xml:space="preserve"> TOC \o "1-6" \h \z </w:instrText>
-            </w:r>
-            <w:r>
-                <w:fldChar w:fldCharType="separate"/>
-            </w:r>
-            <w:r>
-                <w:fldChar w:fldCharType="end"/>
-            </w:r>
-        </w:p>
-    </xsl:template>
-    
+				All rights reserved.
+
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: dynamic.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			dynamic content
+		</desc>
+	</doc>
+	<xsl:template match="tei:dynamicContent">
+		<xsl:choose>
+			<xsl:when test="@type='pagenumber'">
+				<w:fldSimple w:instr=" PAGE \* MERGEFORMAT ">
+					<w:r>
+						<w:rPr>
+							<w:noProof />
+						</w:rPr>
+						<w:t>1</w:t>
+					</w:r>
+				</w:fldSimple>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Dealing with divGens
+		</desc>
+	</doc>
+	<xsl:template match="tei:divGen">
+		<xsl:choose>
+			<xsl:when test="@type='toc'">
+				<xsl:call-template name="generate-toc" />
+			</xsl:when>
+		</xsl:choose>
+
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Table of Contents:
+			Feel free to overwrite this one.
+		</desc>
+	</doc>
+	<xsl:template name="generate-toc">
+		<w:p>
+			<w:pPr>
+				<w:pStyle w:val="TOC1" />
+				<w:tabs>
+					<w:tab w:val="right" w:leader="dot" w:pos="9350" />
+				</w:tabs>
+			</w:pPr>
+			<w:r>
+				<w:fldChar w:fldCharType="begin" />
+			</w:r>
+			<w:r>
+				<w:rPr>
+					<w:noProof />
+				</w:rPr>
+				<w:instrText xml:space="preserve"> TOC \o "1-6" \h \z </w:instrText>
+			</w:r>
+			<w:r>
+				<w:fldChar w:fldCharType="separate" />
+			</w:r>
+			<w:r>
+				<w:fldChar w:fldCharType="end" />
+			</w:r>
+		</w:p>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/teitodocx.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/teitodocx.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/teitodocx.xsl	(revision 2397)
@@ -1,2388 +1,2699 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:cals="http://www.oasis-open.org/specs/tm9901" xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types" xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:iso="http://www.iso.org/ns/1.0" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:its="http://www.w3.org/2005/11/its" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso its tei a xs pic fn xsi dc dcterms dcmitype contypes teidocx teix html cals">
-  <xsl:import href="placeholders.xsl"/>
-  <xsl:import href="../../common2/functions.xsl"/>
-  <xsl:import href="../utils/functions.xsl"/>
-  <xsl:import href="../utils/variables.xsl"/>
-  <xsl:import href="../utils/identity/identity.xsl"/>
-  <xsl:import href="../utils/verbatim/tei-docx-verbatim.xsl"/>
-  <xsl:import href="../utils/maths/mml2omml.xsl"/>
-  <xsl:import href="../../common2/core.xsl"/>
-  <xsl:import href="../../common2/msdescription.xsl"/>
-  <!-- Deals with dynamic text creation such as toc -->
-  <xsl:include href="dynamic/dynamic.xsl"/>
-  <!-- Templates transforming graphic elements -->
-  <xsl:include href="graphics/graphics.xsl"/>
-  <!-- Templates transforming elements from drama -->
-  <xsl:include href="drama/drama.xsl"/>
-  <!-- Templates transforming lists -->
-  <xsl:include href="lists/lists.xsl"/>
-  <!-- Templates transforming math elements -->
-  <xsl:include href="maths/maths.xsl"/>
-  <!-- Templates transforming ODD-related elements -->
-  <xsl:include href="odds/tagdocs.xsl"/>
-  <!-- Templates transforming tei milestones into sectPr -->
-  <xsl:include href="wordsections/wordsections.xsl"/>
-  <!-- Load stylesheets helping with the creation of special files -->
-  <xsl:include href="docxfiles/application.xsl"/>
-  <xsl:include href="docxfiles/content-types.xsl"/>
-  <xsl:include href="docxfiles/endnotes.xsl"/>
-  <xsl:include href="docxfiles/footers.xsl"/>
-  <xsl:include href="docxfiles/comments.xsl"/>
-  <xsl:include href="docxfiles/footnotes.xsl"/>
-  <xsl:include href="docxfiles/headers.xsl"/>
-  <xsl:include href="docxfiles/numbering-definition.xsl"/>
-  <xsl:include href="docxfiles/relationships.xsl"/>
-  <xsl:include href="docxfiles/settings.xsl"/>
-  <xsl:param name="createanttask">false</xsl:param>
-  <xsl:param name="useHeaderFrontMatter">false</xsl:param>
-  <xsl:param name="useFixedDate">false</xsl:param>
-  <!--
-        A4 is 210mm x 297mm; leaving 1in margin (25mm),
-        gives 160 x 247 approx useable area. For figures,
-	Microsoft use English metrical units (emu), in which
-        1mm = 3600 units. So page size is 57600 * 889200
-        Divide by 100 to avoid overflow in calculations.
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:its="http://www.w3.org/2005/11/its"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso its tei a xs pic fn xsi dc dcterms dcmitype contypes teidocx teix html cals">
+	<xsl:import href="placeholders.xsl" />
+	<xsl:import href="../../common2/functions.xsl" />
+	<xsl:import href="../utils/functions.xsl" />
+	<xsl:import href="../utils/variables.xsl" />
+	<xsl:import href="../utils/identity/identity.xsl" />
+	<xsl:import href="../utils/verbatim/tei-docx-verbatim.xsl" />
+	<xsl:import href="../utils/maths/mml2omml.xsl" />
+	<xsl:import href="../../common2/core.xsl" />
+	<xsl:import href="../../common2/msdescription.xsl" />
+	<!-- Deals with dynamic text creation such as toc -->
+	<xsl:include href="dynamic/dynamic.xsl" />
+	<!-- Templates transforming graphic elements -->
+	<xsl:include href="graphics/graphics.xsl" />
+	<!-- Templates transforming elements from drama -->
+	<xsl:include href="drama/drama.xsl" />
+	<!-- Templates transforming lists -->
+	<xsl:include href="lists/lists.xsl" />
+	<!-- Templates transforming math elements -->
+	<xsl:include href="maths/maths.xsl" />
+	<!-- Templates transforming ODD-related elements -->
+	<xsl:include href="odds/tagdocs.xsl" />
+	<!-- Templates transforming tei milestones into sectPr -->
+	<xsl:include href="wordsections/wordsections.xsl" />
+	<!-- Load stylesheets helping with the creation of special files -->
+	<xsl:include href="docxfiles/application.xsl" />
+	<xsl:include href="docxfiles/content-types.xsl" />
+	<xsl:include href="docxfiles/endnotes.xsl" />
+	<xsl:include href="docxfiles/footers.xsl" />
+	<xsl:include href="docxfiles/comments.xsl" />
+	<xsl:include href="docxfiles/footnotes.xsl" />
+	<xsl:include href="docxfiles/headers.xsl" />
+	<xsl:include href="docxfiles/numbering-definition.xsl" />
+	<xsl:include href="docxfiles/relationships.xsl" />
+	<xsl:include href="docxfiles/settings.xsl" />
+	<xsl:param name="createanttask">
+		false
+	</xsl:param>
+	<xsl:param name="useHeaderFrontMatter">
+		false
+	</xsl:param>
+	<xsl:param name="useFixedDate">
+		false
+	</xsl:param>
+	<!-- A4 is 210mm x 297mm; leaving 1in margin (25mm), gives 160 x 247 approx 
+		useable area. For figures, Microsoft use English metrical units (emu), in 
+		which 1mm = 3600 units. So page size is 57600 * 889200 Divide by 100 to avoid 
+		overflow in calculations. For other measurements in Word, see useful discussion 
+		at http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/ -->
+	<xsl:param name="pageWidth">
+		576
+	</xsl:param>
+	<xsl:param name="pageHeight">
+		890
+	</xsl:param>
+	<xsl:param name="tableWidthPercentage"></xsl:param>
+	<xsl:param name="defaultHeaderFooterFile">
+		templates/default.xml
+	</xsl:param>
+	<xsl:param name="postQuote">
+		’
+	</xsl:param>
+	<xsl:param name="preQuote">
+		‘
+	</xsl:param>
+	<xsl:param name="bulletOne">
+		
+	</xsl:param>
+	<xsl:param name="bulletTwo">
+		•
+	</xsl:param>
+	<xsl:param name="bulletThree">
+		*
+	</xsl:param>
+	<xsl:param name="bulletFour">
+		+
+	</xsl:param>
+	<xsl:param name="bulletFive">
+		•
+	</xsl:param>
+	<xsl:param name="bulletSix">
+		•
+	</xsl:param>
+	<xsl:param name="bulletSeven">
+		•
+	</xsl:param>
+	<xsl:param name="bulletEight">
+		•
+	</xsl:param>
+	<xsl:param name="word-directory">
+		..
+	</xsl:param>
+	<xsl:param name="inputDir">
+		.
+	</xsl:param>
+	<xsl:param name="debug">
+		false
+	</xsl:param>
+	<xsl:param name="styleDoc">
+		<xsl:value-of
+			select="concat($wordDirectory, '/word/styles.xml')" />
+	</xsl:param>
+	<xsl:param name="docDoc">
+		<xsl:value-of
+			select="concat($wordDirectory, '/word/document.xml')" />
+	</xsl:param>
+	<xsl:param name="shadowGraphics">
+		false
+	</xsl:param>
+	<xsl:param name="alignFigures">
+		center
+	</xsl:param>
+	<xsl:param name="renderAddDel">
+		true
+	</xsl:param>
+	<xsl:param name="addColour">
+		red
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>
+				<h1 xmlns="">Stylesheet documentation</h1>
+				<h2 xmlns="">template modes</h2>
+				<h3 xmlns="">get-style</h3>
+				<h1 xmlns="">License</h1>
+				This software is dual-licensed:
 
-        For other measurements in Word, see useful discussion at
-	http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/
-    -->
-  <xsl:param name="pageWidth">576</xsl:param>
-  <xsl:param name="pageHeight">890</xsl:param>
-  <xsl:param name="tableWidthPercentage"></xsl:param>
-  <xsl:param name="defaultHeaderFooterFile">templates/default.xml</xsl:param>
-  <xsl:param name="postQuote">’</xsl:param>
-  <xsl:param name="preQuote">‘</xsl:param>
-  <xsl:param name="bulletOne"></xsl:param>
-  <xsl:param name="bulletTwo">•</xsl:param>
-  <xsl:param name="bulletThree">*</xsl:param>
-  <xsl:param name="bulletFour">+</xsl:param>
-  <xsl:param name="bulletFive">•</xsl:param>
-  <xsl:param name="bulletSix">•</xsl:param>
-  <xsl:param name="bulletSeven">•</xsl:param>
-  <xsl:param name="bulletEight">•</xsl:param>
-  <xsl:param name="word-directory">..</xsl:param>
-  <xsl:param name="inputDir">.</xsl:param>
-  <xsl:param name="debug">false</xsl:param>
-  <xsl:param name="styleDoc">
-    <xsl:value-of select="concat($wordDirectory, '/word/styles.xml')"/>
-  </xsl:param>
-  <xsl:param name="docDoc">
-    <xsl:value-of select="concat($wordDirectory, '/word/document.xml')"/>
-  </xsl:param>
-  <xsl:param name="shadowGraphics">false</xsl:param>
-  <xsl:param name="alignFigures">center</xsl:param>
-  <xsl:param name="renderAddDel">true</xsl:param>
-  <xsl:param name="addColour">red</xsl:param>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for making Word docx files from TEI XML </p>
-      <p><h1 xmlns="">Stylesheet documentation</h1><h2 xmlns="">template modes</h2><h3 xmlns="">get-style</h3><h1 xmlns="">License</h1>This software is dual-licensed:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: teitodocx.xsl 9998 2012-01-02 18:27:15Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
-  <xsl:strip-space elements="*"/>
-  <xsl:preserve-space elements="tei:text"/>
-  <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
-  <xsl:param name="isofreestanding">true</xsl:param>
-  <xsl:key name="FOOTERS" match="tei:fw[@type='footer']" use="@xml:id"/>
-  <xsl:key name="HEADERS" match="tei:fw[@type='header']" use="@xml:id"/>
-  <xsl:key name="ALLFOOTERS" match="tei:fw[@type='footer']" use="1"/>
-  <xsl:key name="ALLHEADERS" match="tei:fw[@type='header']" use="1"/>
-  <xsl:key name="ENDNOTES" match="tei:note[@place='end']" use="1"/>
-  <xsl:key name="FOOTNOTES" match="tei:note[@place='foot' or @place='bottom' ]" use="1"/>
-  <xsl:key name="OL" match="tei:list[@type='ordered']" use="1"/>
-  <xsl:key name="BLIP" match="a:blip" use="1"/>
-  <xsl:key name="Styles" match="w:style/w:name" use="@w:val"/>
-  <xsl:variable name="align">right</xsl:variable>
-  <xsl:variable name="wordDirectory">
-    <xsl:value-of select="translate($word-directory,'\\','/')"/>
-  </xsl:variable>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Generic template from msDescription for high-level section
-    </desc>
-  </doc>
-  <xsl:template name="msSection">
-    <xsl:param name="level"/>
-    <xsl:param name="implicitBlock"/>
-    <xsl:param name="heading"/>
-    <w:p>
-      <w:pPr>
-        <w:pStyle w:val="tei{local-name()}"/>
-      </w:pPr>
-      <w:r>
-        <w:t>
-          <xsl:value-of select="$heading"/>
-        </w:t>
-      </w:r>
-    </w:p>
-    <xsl:call-template name="block-element"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Generic template from msDescription for inline objects
-    </desc>
-  </doc>
-  <xsl:template name="msInline">
-    <xsl:param name="before"/>
-    <xsl:param name="after"/>
-    <xsl:param name="style"/>
-    <w:r>
-      <w:rPr>
-        <w:rStyle w:val="tei{local-name()}"/>
-        <xsl:choose>
-          <xsl:when test="$style='italic'">
-            <w:i/>
-          </xsl:when>
-          <xsl:when test="$style='bold'">
-            <w:b/>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:if test="$renderAddDel='true' and ancestor-or-self::tei:del">
-          <w:strike/>
-        </xsl:if>
-      </w:rPr>
-      <w:t>
-        <xsl:value-of select="$before"/>
-        <xsl:value-of select="."/>
-        <xsl:value-of select="$after"/>
-      </w:t>
-    </w:r>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Generic template from msDescription for mid-level block
-    </desc>
-  </doc>
-  <xsl:template name="msBlock">
-    <xsl:param name="style"/>
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">
-        <xsl:value-of select="$style"/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Generic template from msDescription for labelled object
-    </desc>
-  </doc>
-  <xsl:template name="msLabelled">
-    <xsl:param name="before"/>
-    <w:r>
-      <w:rPr>
-        <w:i/>
-      </w:rPr>
-      <w:t>
-        <xsl:attribute name="xml:space">preserve</xsl:attribute>
-        <xsl:value-of select="$before"/>
-        <xsl:text>: </xsl:text>
-      </w:t>
-    </w:r>
-    <w:r>
-      <w:rPr>
-        <w:rStyle w:val="tei{local-name()}"/>
-      </w:rPr>
-      <w:t>
-        <xsl:value-of select="."/>
-      </w:t>
-    </w:r>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Generic template from msDescription for literal text
-    </desc>
-  </doc>
-  <xsl:template name="msLiteral">
-    <xsl:param name="text"/>
-    <w:r>
-      <w:rPr/>
-      <w:t>
-        <xsl:attribute name="xml:space">preserve</xsl:attribute>
-        <xsl:value-of select="$text"/>
-      </w:t>
-    </w:r>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        The starting point in the conversion to docx.
-    </desc>
-  </doc>
-  <xsl:template match="/tei:TEI">
-    <xsl:call-template name="write-docxfiles"/>
-    <xsl:call-template name="create-document-dot-xml"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Calls templates that are responsible for creating all necessary files besides the
-            main document.xml
-    </desc>
-  </doc>
-  <xsl:template name="write-docxfiles">
-    <!-- header and footers -->
-    <xsl:call-template name="write-docxfile-header-files"/>
-    <!-- footer files -->
-    <xsl:call-template name="write-docxfile-footer-files"/>
-    <!-- numbering file -->
-    <xsl:call-template name="write-docxfile-numbering-definition"/>
-    <!-- footnotes file -->
-    <xsl:call-template name="write-docxfile-footnotes-file"/>
-    <!-- endnotes file -->
-    <xsl:call-template name="write-docxfile-endnotes-file"/>
-    <!-- comments file -->
-    <xsl:call-template name="write-docxfile-comments-file"/>
-    <!-- main relationships -->
-    <xsl:call-template name="write-docxfile-main-relationships"/>
-    <!-- relationships -->
-    <xsl:call-template name="write-docxfile-relationships"/>
-    <!-- write Content Types -->
-    <xsl:call-template name="write-docxfile-content-types"/>
-    <!-- settings -->
-    <xsl:call-template name="write-docxfile-settings"/>
-    <!-- app files -->
-    <xsl:call-template name="write-docxfile-docprops-core"/>
-    <xsl:call-template name="write-docxfile-docprops-app"/>
-    <xsl:call-template name="write-docxfile-docprops-custom"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Create the contents of the main document.xml file, that contains all "real" content.
-    </desc>
-  </doc>
-  <xsl:template name="create-document-dot-xml">
-    <w:document>
-      <w:body>
-        <!-- Front -->
-        <xsl:call-template name="write-document-dot-xml-frontmatter"/>
-        <!-- Main -->
-        <xsl:call-template name="write-document-dot-xml-maincontent"/>
-        <!-- Back -->
-        <xsl:call-template name="write-document-dot-xml-backmatter"/>
-        <!-- Clearing up at the end -->
-        <xsl:call-template name="write-document-dot-xml-postclearing"/>
-      </w:body>
-    </w:document>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Handles the front matter
-    </desc>
-  </doc>
-  <xsl:template name="write-document-dot-xml-frontmatter">
-    <!-- are there specific titlepages -->
-    <xsl:call-template name="titlepages"/>
-    <!-- header components -->
-    <xsl:call-template name="headerParts"/>
-    <!-- The front matter -->
-    <xsl:apply-templates select="tei:text/tei:front"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Handles the main content
-    </desc>
-  </doc>
-  <xsl:template name="write-document-dot-xml-maincontent">
-    <!-- document title -->
-    <xsl:call-template name="document-title"/>
-    <!-- Describes the main part of the document -->
-    <xsl:apply-templates select="tei:text/tei:body"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Handles the back matter
-    </desc>
-  </doc>
-  <xsl:template name="write-document-dot-xml-backmatter">
-    <!-- Describes the back matter of the document -->
-    <xsl:apply-templates select="tei:text/tei:back"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Inserts final word specific sections</p>
-      <p> Inserts a final sectPr section if we need one </p>
-    </desc>
-  </doc>
-  <xsl:template name="write-document-dot-xml-postclearing">
-    <!-- write out final sectPr .. if exists -->
-    <xsl:choose>
-      <xsl:when test="tei:text/tei:milestone">
-        <xsl:apply-templates select="tei:text/tei:milestone[1]">
-          <xsl:with-param name="final-section">true</xsl:with-param>
-        </xsl:apply-templates>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates select="document($defaultHeaderFooterFile)/tei:TEI/tei:text/tei:milestone">
-          <xsl:with-param name="final-section">true</xsl:with-param>
-        </xsl:apply-templates>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>Template used to process block elements:</p>
-      <ul>
-        <li><b>style</b>: A style for all the <gi>w:p</gi>s</li>
-        <li><b>pPr</b>: An entire <gi>pPr</gi> element to use </li>
-        <li><b>nop</b>: a w:p has already been created and no new w:p is to be created </li>
-        <li><b>bookmark-id</b>: if present in conjunction with bookmark-name, a bookmark is created around the current element </li>
-        <li><b>bookmark-name</b>: see bookmark-id </li>
-      </ul>
-    </desc>
-  </doc>
-  <xsl:template name="block-element">
-    <xsl:param name="style"/>
-    <xsl:param name="select" select="."/>
-    <xsl:param name="pPr"/>
-    <xsl:param name="nop">false</xsl:param>
-    <xsl:param name="bookmark-id"/>
-    <xsl:param name="bookmark-name"/>
-    <xsl:for-each select="$select">
-      <xsl:for-each-group select="*|processing-instruction()|text()" group-adjacent="1">
-        <xsl:call-template name="_process-blockelement">
-          <xsl:with-param name="style" select="$style"/>
-          <xsl:with-param name="pPr" select="$pPr"/>
-          <xsl:with-param name="nop" select="$nop"/>
-          <xsl:with-param name="bookmark-id" select="$bookmark-id"/>
-          <xsl:with-param name="bookmark-name" select="$bookmark-name"/>
-        </xsl:call-template>
-      </xsl:for-each-group>
-    </xsl:for-each>
-  </xsl:template>
-  <!-- end template block-element -->
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-      <p>
-            This template processes block elements (or better to say the children of a block element)
-            and should never be called directly 
-            (call block-element instead). The function processes all children and puts
-            all inline elements into one w:p. If it encounters a nested block element
-            (e.g. a note inside a p) then it closes the previous w:p processes that block
-            element and then again starts putting all following inline elements into another
-            w:p element.
-            
-            @see block-element
-        </p>
-    </desc>
-  </doc>
-  <xsl:template name="_process-blockelement">
-    <xsl:param name="style"/>
-    <xsl:param name="pPr"/>
-    <xsl:param name="nop"/>
-    <xsl:param name="bookmark-id"/>
-    <xsl:param name="bookmark-name"/>
-    <!-- Process Child elements -->
-    <xsl:for-each-group select="current-group()" group-starting-with="*[not(tei:is-inline(.))]">
-      <xsl:choose>
-        <!-- if the current item is a block element, we process that one,
-                     and then take call this function recursively was all the other
-                     elements -->
-        <xsl:when test="self::*[not(tei:is-inline(.))]">
-          <!-- process block element -->
-          <xsl:apply-templates select=".">
-            <xsl:with-param name="style" select="$style"/>
-            <xsl:with-param name="pPr" select="$pPr"/>
-            <xsl:with-param name="nop" select="$nop"/>
-          </xsl:apply-templates>
-          <!-- process all the other elements in the current group -->
-          <xsl:for-each-group select="current-group() except ." group-adjacent="1">
-            <xsl:call-template name="_process-blockelement">
-              <xsl:with-param name="style" select="$style"/>
-              <xsl:with-param name="pPr" select="$pPr"/>
-              <xsl:with-param name="nop" select="$nop"/>
-            </xsl:call-template>
-          </xsl:for-each-group>
-        </xsl:when>
-        <!-- we encountered an inline element. This means that the current group only
-                     contains inline elements -->
-        <xsl:otherwise>
-          <!--
-	  <xsl:message>+@@ <xsl:value-of select="name()"/>: pPr:	  <xsl:if test="not(empty($pPr))"><xsl:copy-of
-	  select="$pPr"/></xsl:if>; style: <xsl:if
-	  test="not(empty($style))"><xsl:copy-of
-	  select="$style"/></xsl:if></xsl:message>
--->
-          <!-- create all text runs for each item in the current group. we will later
-                         on decide whether we are grouping them together in a w:p or not. -->
-          <xsl:variable name="innerRuns">
-            <!-- add paragraph properties (if nobody else created a w:p ($nop)) -->
-            <xsl:if test="$nop!='true'">
-              <xsl:choose>
-                <xsl:when test="not($style='')">
-                  <w:pPr>
-                    <w:pStyle>
-                      <xsl:attribute name="w:val" select="$style"/>
-                    </w:pStyle>
-                  </w:pPr>
-                </xsl:when>
-                <xsl:when test="not(empty($pPr))">
-                  <xsl:copy-of select="$pPr"/>
-                </xsl:when>
-              </xsl:choose>
-            </xsl:if>
-            <!-- bookmark start -->
-            <xsl:if test="string-length($bookmark-name) &gt; 0 and string-length($bookmark-id) &gt; 0">
-              <w:bookmarkStart w:id="{$bookmark-id}" w:name="{$bookmark-name}"/>
-            </xsl:if>
-            <!-- Create text runs -->
-            <xsl:for-each select="current-group()">
-              <xsl:apply-templates select=".">
-                <xsl:with-param name="style" select="$style"/>
-                <xsl:with-param name="pPr" select="$pPr"/>
-              </xsl:apply-templates>
-            </xsl:for-each>
-            <!-- bookmark end-->
-            <xsl:if test="string-length($bookmark-name) &gt; 0 and string-length($bookmark-id) &gt; 0">
-              <w:bookmarkEnd w:id="{$bookmark-id}"/>
-            </xsl:if>
-          </xsl:variable>
-          <!-- write out text runs.
-                         if someone has already created a w:p ($nop) we may not create another one. -->
-          <xsl:choose>
-            <xsl:when test="$nop='true'">
-              <xsl:copy-of select="$innerRuns"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <w:p>
-                <xsl:copy-of select="$innerRuns"/>
-              </w:p>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each-group>
-    <!-- end process children -->
-  </xsl:template>
-  <!-- end template _process-blockelement -->
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Anchors
-    </desc>
-  </doc>
-  <xsl:template match="tei:anchor">
-    <xsl:variable name="N">
-      <xsl:number level="any"/>
-    </xsl:variable>
-    <w:bookmarkStart w:id="{number($N) + 20000}" w:name="{@xml:id}"/>
-    <w:bookmarkEnd w:id="{number($N) + 20000}"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Handles text sections. Adds a bookmark if they are the
-	first text in this object. 
-    </desc>
-  </doc>
-  <xsl:template match="text()">
-    <xsl:param name="character-style"/>
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:head"/>
-      <xsl:when test="ancestor::tei:bibl"/>
-      <xsl:when test="preceding-sibling::text()"/>
-      <xsl:when test="parent::tei:head/parent::tei:*/@xml:id">
-        <xsl:for-each select="parent::tei:head/parent::tei:*">
-          <xsl:variable name="N">
-            <xsl:number level="any"/>
-          </xsl:variable>
-          <w:bookmarkStart w:id="{number($N) + 10000}" w:name="{@xml:id}"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:when test="../@xml:id">
-        <xsl:for-each select="..">
-          <xsl:variable name="N">
-            <xsl:number level="any"/>
-          </xsl:variable>
-          <w:bookmarkStart w:id="{number($N) + 10000}" w:name="{@xml:id}"/>
-        </xsl:for-each>
-      </xsl:when>
-    </xsl:choose>
-    <xsl:if test="parent::tei:head/parent::tei:div[@iso:status]">
-      <w:r>
-        <w:t>
-          <xsl:attribute name="xml:space">preserve</xsl:attribute>
-          <xsl:text> (</xsl:text>
-          <xsl:value-of select="../../@iso:status"/>
-          <xsl:text>) </xsl:text>
-        </w:t>
-      </w:r>
-    </xsl:if>
-    <!-- if no specific style is assigned we might check for any other indication to assign 
-	   some style ... -->
-    <xsl:variable name="renderingProperties">
-      <xsl:for-each select="..">
-        <xsl:call-template name="applyRend"/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:variable name="rProps">
-      <xsl:if test="string-length($character-style) &gt; 0 or not(empty($renderingProperties))">
-        <w:rPr>
-          <xsl:if test="string-length($character-style) &gt; 0">
-            <w:rStyle>
-              <xsl:choose>
-                <!-- this is a rogue - trap it and kill it -->
-                <xsl:when test="$character-style='footnote reference'">
-                  <xsl:attribute name="w:val" select="'FootnoteReference'"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:attribute name="w:val" select="$character-style"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </w:rStyle>
-          </xsl:if>
-          <xsl:copy-of select="$renderingProperties"/>
-          <xsl:if test="ancestor::*[@xml:lang]">
-            <w:lang w:val="{ancestor::*[@xml:lang][1]/@xml:lang}"/>
-          </xsl:if>
-        </w:rPr>
-      </xsl:if>
-    </xsl:variable>
-    <xsl:choose>
-      <xsl:when test="$renderAddDel='true'">
-        <w:r>
-          <xsl:copy-of select="$rProps"/>
-          <w:t>
-            <xsl:call-template name="Text"/>
-          </w:t>
-        </w:r>
-      </xsl:when>
-      <xsl:when test="parent::tei:del">
-        <w:del>
-          <xsl:variable name="N">
-            <xsl:for-each select="..">
-              <xsl:number level="any"/>
-            </xsl:for-each>
-          </xsl:variable>
-          <xsl:attribute name="w:id" select="number($N) + 50000"/>
-          <xsl:if test="../@when">
-            <xsl:attribute name="w:date">
-              <xsl:value-of select="../@when"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: teitodocx.xsl 9998 2012-01-02 18:27:15Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:strip-space elements="*" />
+	<xsl:preserve-space elements="tei:text" />
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" />
+	<xsl:param name="isofreestanding">
+		true
+	</xsl:param>
+	<xsl:key name="FOOTERS" match="tei:fw[@type='footer']"
+		use="@xml:id" />
+	<xsl:key name="HEADERS" match="tei:fw[@type='header']"
+		use="@xml:id" />
+	<xsl:key name="ALLFOOTERS" match="tei:fw[@type='footer']"
+		use="1" />
+	<xsl:key name="ALLHEADERS" match="tei:fw[@type='header']"
+		use="1" />
+	<xsl:key name="ENDNOTES" match="tei:note[@place='end']" use="1" />
+	<xsl:key name="FOOTNOTES"
+		match="tei:note[@place='foot' or @place='bottom' ]" use="1" />
+	<xsl:key name="OL" match="tei:list[@type='ordered']" use="1" />
+	<xsl:key name="BLIP" match="a:blip" use="1" />
+	<xsl:key name="Styles" match="w:style/w:name" use="@w:val" />
+	<xsl:variable name="align">
+		right
+	</xsl:variable>
+	<xsl:variable name="wordDirectory">
+		<xsl:value-of
+			select="translate($word-directory,'\\','/')" />
+	</xsl:variable>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Generic template from msDescription for high-level section
+		</desc>
+	</doc>
+	<xsl:template name="msSection">
+		<xsl:param name="level" />
+		<xsl:param name="implicitBlock" />
+		<xsl:param name="heading" />
+		<w:p>
+			<w:pPr>
+				<w:pStyle w:val="tei{local-name()}" />
+			</w:pPr>
+			<w:r>
+				<w:t>
+					<xsl:value-of select="$heading" />
+				</w:t>
+			</w:r>
+		</w:p>
+		<xsl:call-template name="block-element" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Generic template from msDescription for inline objects
+		</desc>
+	</doc>
+	<xsl:template name="msInline">
+		<xsl:param name="before" />
+		<xsl:param name="after" />
+		<xsl:param name="style" />
+		<w:r>
+			<w:rPr>
+				<w:rStyle w:val="tei{local-name()}" />
+				<xsl:choose>
+					<xsl:when test="$style='italic'">
+						<w:i />
+					</xsl:when>
+					<xsl:when test="$style='bold'">
+						<w:b />
+					</xsl:when>
+				</xsl:choose>
+				<xsl:if
+					test="$renderAddDel='true' and ancestor-or-self::tei:del">
+					<w:strike />
+				</xsl:if>
+			</w:rPr>
+			<w:t>
+				<xsl:value-of select="$before" />
+				<xsl:value-of select="." />
+				<xsl:value-of select="$after" />
+			</w:t>
+		</w:r>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Generic template from msDescription for mid-level block
+		</desc>
+	</doc>
+	<xsl:template name="msBlock">
+		<xsl:param name="style" />
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				<xsl:value-of select="$style" />
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Generic template from msDescription for labelled object
+		</desc>
+	</doc>
+	<xsl:template name="msLabelled">
+		<xsl:param name="before" />
+		<w:r>
+			<w:rPr>
+				<w:i />
+			</w:rPr>
+			<w:t>
+				<xsl:attribute name="xml:space">preserve</xsl:attribute>
+				<xsl:value-of select="$before" />
+				<xsl:text>: </xsl:text>
+			</w:t>
+		</w:r>
+		<w:r>
+			<w:rPr>
+				<w:rStyle w:val="tei{local-name()}" />
+			</w:rPr>
+			<w:t>
+				<xsl:value-of select="." />
+			</w:t>
+		</w:r>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Generic template from msDescription for literal text
+		</desc>
+	</doc>
+	<xsl:template name="msLiteral">
+		<xsl:param name="text" />
+		<w:r>
+			<w:rPr />
+			<w:t>
+				<xsl:attribute name="xml:space">preserve</xsl:attribute>
+				<xsl:value-of select="$text" />
+			</w:t>
+		</w:r>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			The starting point in the conversion to docx.
+		</desc>
+	</doc>
+	<xsl:template match="/tei:TEI">
+		<xsl:call-template name="write-docxfiles" />
+		<xsl:call-template name="create-document-dot-xml" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Calls templates that are responsible for creating all necessary files
+			besides the
+			main document.xml
+		</desc>
+	</doc>
+	<xsl:template name="write-docxfiles">
+		<!-- header and footers -->
+		<xsl:call-template
+			name="write-docxfile-header-files" />
+		<!-- footer files -->
+		<xsl:call-template
+			name="write-docxfile-footer-files" />
+		<!-- numbering file -->
+		<xsl:call-template
+			name="write-docxfile-numbering-definition" />
+		<!-- footnotes file -->
+		<xsl:call-template
+			name="write-docxfile-footnotes-file" />
+		<!-- endnotes file -->
+		<xsl:call-template
+			name="write-docxfile-endnotes-file" />
+		<!-- comments file -->
+		<xsl:call-template
+			name="write-docxfile-comments-file" />
+		<!-- main relationships -->
+		<xsl:call-template
+			name="write-docxfile-main-relationships" />
+		<!-- relationships -->
+		<xsl:call-template
+			name="write-docxfile-relationships" />
+		<!-- write Content Types -->
+		<xsl:call-template
+			name="write-docxfile-content-types" />
+		<!-- settings -->
+		<xsl:call-template name="write-docxfile-settings" />
+		<!-- app files -->
+		<xsl:call-template
+			name="write-docxfile-docprops-core" />
+		<xsl:call-template
+			name="write-docxfile-docprops-app" />
+		<xsl:call-template
+			name="write-docxfile-docprops-custom" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Create the contents of the main document.xml file, that contains all "real"
+			content.
+		</desc>
+	</doc>
+	<xsl:template name="create-document-dot-xml">
+		<w:document>
+			<w:body>
+				<!-- Front -->
+				<xsl:call-template
+					name="write-document-dot-xml-frontmatter" />
+				<!-- Main -->
+				<xsl:call-template
+					name="write-document-dot-xml-maincontent" />
+				<!-- Back -->
+				<xsl:call-template
+					name="write-document-dot-xml-backmatter" />
+				<!-- Clearing up at the end -->
+				<xsl:call-template
+					name="write-document-dot-xml-postclearing" />
+			</w:body>
+		</w:document>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handles the front matter
+		</desc>
+	</doc>
+	<xsl:template name="write-document-dot-xml-frontmatter">
+		<!-- are there specific titlepages -->
+		<xsl:call-template name="titlepages" />
+		<!-- header components -->
+		<xsl:call-template name="headerParts" />
+		<!-- The front matter -->
+		<xsl:apply-templates select="tei:text/tei:front" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handles the main content
+		</desc>
+	</doc>
+	<xsl:template name="write-document-dot-xml-maincontent">
+		<!-- document title -->
+		<xsl:call-template name="document-title" />
+		<!-- Describes the main part of the document -->
+		<xsl:apply-templates select="tei:text/tei:body" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handles the back matter
+		</desc>
+	</doc>
+	<xsl:template name="write-document-dot-xml-backmatter">
+		<!-- Describes the back matter of the document -->
+		<xsl:apply-templates select="tei:text/tei:back" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Inserts final word specific sections</p>
+			<p> Inserts a final sectPr section if we need one </p>
+		</desc>
+	</doc>
+	<xsl:template name="write-document-dot-xml-postclearing">
+		<!-- write out final sectPr .. if exists -->
+		<xsl:choose>
+			<xsl:when test="tei:text/tei:milestone">
+				<xsl:apply-templates
+					select="tei:text/tei:milestone[1]">
+					<xsl:with-param name="final-section">
+						true
+					</xsl:with-param>
+				</xsl:apply-templates>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates
+					select="document($defaultHeaderFooterFile)/tei:TEI/tei:text/tei:milestone">
+					<xsl:with-param name="final-section">
+						true
+					</xsl:with-param>
+				</xsl:apply-templates>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Template used to process block elements:</p>
+			<ul>
+				<li>
+					<b>style</b>
+					: A style for all the
+					<gi>w:p</gi>
+					s
+				</li>
+				<li>
+					<b>pPr</b>
+					: An entire
+					<gi>pPr</gi>
+					element to use
+				</li>
+				<li>
+					<b>nop</b>
+					: a w:p has already been created and no new w:p is to be created
+				</li>
+				<li>
+					<b>bookmark-id</b>
+					: if present in conjunction with bookmark-name, a bookmark is
+					created around the current element
+				</li>
+				<li>
+					<b>bookmark-name</b>
+					: see bookmark-id
+				</li>
+			</ul>
+		</desc>
+	</doc>
+	<xsl:template name="block-element">
+		<xsl:param name="style" />
+		<xsl:param name="select" select="." />
+		<xsl:param name="pPr" />
+		<xsl:param name="nop">
+			false
+		</xsl:param>
+		<xsl:param name="bookmark-id" />
+		<xsl:param name="bookmark-name" />
+		<xsl:for-each select="$select">
+			<xsl:for-each-group
+				select="*|processing-instruction()|text()" group-adjacent="1">
+				<xsl:call-template name="_process-blockelement">
+					<xsl:with-param name="style" select="$style" />
+					<xsl:with-param name="pPr" select="$pPr" />
+					<xsl:with-param name="nop" select="$nop" />
+					<xsl:with-param name="bookmark-id"
+						select="$bookmark-id" />
+					<xsl:with-param name="bookmark-name"
+						select="$bookmark-name" />
+				</xsl:call-template>
+			</xsl:for-each-group>
+		</xsl:for-each>
+	</xsl:template>
+	<!-- end template block-element -->
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>
+				This template processes block elements (or better to say the children of
+				a block element)
+				and should never be called directly
+				(call block-element instead). The function processes all children and
+				puts
+				all inline elements into one w:p. If it encounters a nested block
+				element
+				(e.g. a note inside a p) then it closes the previous w:p processes that
+				block
+				element and then again starts putting all following inline elements into
+				another
+				w:p element.
+
+				@see block-element
+			</p>
+		</desc>
+	</doc>
+	<xsl:template name="_process-blockelement">
+		<xsl:param name="style" />
+		<xsl:param name="pPr" />
+		<xsl:param name="nop" />
+		<xsl:param name="bookmark-id" />
+		<xsl:param name="bookmark-name" />
+		<!-- Process Child elements -->
+		<xsl:for-each-group select="current-group()"
+			group-starting-with="*[not(tei:is-inline(.))]">
+			<xsl:choose>
+				<!-- if the current item is a block element, we process that one, and 
+					then take call this function recursively was all the other elements -->
+				<xsl:when test="self::*[not(tei:is-inline(.))]">
+					<!-- process block element -->
+					<xsl:apply-templates select=".">
+						<xsl:with-param name="style" select="$style" />
+						<xsl:with-param name="pPr" select="$pPr" />
+						<xsl:with-param name="nop" select="$nop" />
+					</xsl:apply-templates>
+					<!-- process all the other elements in the current group -->
+					<xsl:for-each-group
+						select="current-group() except ." group-adjacent="1">
+						<xsl:call-template name="_process-blockelement">
+							<xsl:with-param name="style" select="$style" />
+							<xsl:with-param name="pPr" select="$pPr" />
+							<xsl:with-param name="nop" select="$nop" />
+						</xsl:call-template>
+					</xsl:for-each-group>
+				</xsl:when>
+				<!-- we encountered an inline element. This means that the current group 
+					only contains inline elements -->
+				<xsl:otherwise>
+					<!-- <xsl:message>+@@ <xsl:value-of select="name()"/>: pPr: <xsl:if 
+						test="not(empty($pPr))"><xsl:copy-of select="$pPr"/></xsl:if>; style: <xsl:if 
+						test="not(empty($style))"><xsl:copy-of select="$style"/></xsl:if></xsl:message> -->
+					<!-- create all text runs for each item in the current group. we will 
+						later on decide whether we are grouping them together in a w:p or not. -->
+					<xsl:variable name="innerRuns">
+						<!-- add paragraph properties (if nobody else created a w:p ($nop)) -->
+						<xsl:if test="$nop!='true'">
+							<xsl:choose>
+								<xsl:when test="not($style='')">
+									<w:pPr>
+										<w:pStyle>
+											<xsl:attribute name="w:val" select="$style" />
+										</w:pStyle>
+									</w:pPr>
+								</xsl:when>
+								<xsl:when test="not(empty($pPr))">
+									<xsl:copy-of select="$pPr" />
+								</xsl:when>
+							</xsl:choose>
+						</xsl:if>
+						<!-- bookmark start -->
+						<xsl:if
+							test="string-length($bookmark-name) &gt; 0 and string-length($bookmark-id) &gt; 0">
+							<w:bookmarkStart w:id="{$bookmark-id}"
+								w:name="{$bookmark-name}" />
+						</xsl:if>
+						<!-- Create text runs -->
+						<xsl:for-each select="current-group()">
+							<xsl:apply-templates select=".">
+								<xsl:with-param name="style" select="$style" />
+								<xsl:with-param name="pPr" select="$pPr" />
+							</xsl:apply-templates>
+						</xsl:for-each>
+						<!-- bookmark end -->
+						<xsl:if
+							test="string-length($bookmark-name) &gt; 0 and string-length($bookmark-id) &gt; 0">
+							<w:bookmarkEnd w:id="{$bookmark-id}" />
+						</xsl:if>
+					</xsl:variable>
+					<!-- write out text runs. if someone has already created a w:p ($nop) 
+						we may not create another one. -->
+					<xsl:choose>
+						<xsl:when test="$nop='true'">
+							<xsl:copy-of select="$innerRuns" />
+						</xsl:when>
+						<xsl:otherwise>
+							<w:p>
+								<xsl:copy-of select="$innerRuns" />
+							</w:p>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+		<!-- end process children -->
+	</xsl:template>
+	<!-- end template _process-blockelement -->
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Anchors
+		</desc>
+	</doc>
+	<xsl:template match="tei:anchor">
+		<xsl:variable name="N">
+			<xsl:number level="any" />
+		</xsl:variable>
+		<w:bookmarkStart w:id="{number($N) + 20000}"
+			w:name="{@xml:id}" />
+		<w:bookmarkEnd w:id="{number($N) + 20000}" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handles text sections. Adds a bookmark if they are the
+			first text in this object.
+		</desc>
+	</doc>
+	<xsl:template match="text()">
+		<xsl:param name="character-style" />
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:head" />
+			<xsl:when test="ancestor::tei:bibl" />
+			<xsl:when test="preceding-sibling::text()" />
+			<xsl:when test="parent::tei:head/parent::tei:*/@xml:id">
+				<xsl:for-each select="parent::tei:head/parent::tei:*">
+					<xsl:variable name="N">
+						<xsl:number level="any" />
+					</xsl:variable>
+					<w:bookmarkStart w:id="{number($N) + 10000}"
+						w:name="{@xml:id}" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="../@xml:id">
+				<xsl:for-each select="..">
+					<xsl:variable name="N">
+						<xsl:number level="any" />
+					</xsl:variable>
+					<w:bookmarkStart w:id="{number($N) + 10000}"
+						w:name="{@xml:id}" />
+				</xsl:for-each>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:if test="parent::tei:head/parent::tei:div[@iso:status]">
+			<w:r>
+				<w:t>
+					<xsl:attribute name="xml:space">preserve</xsl:attribute>
+					<xsl:text> (</xsl:text>
+					<xsl:value-of select="../../@iso:status" />
+					<xsl:text>) </xsl:text>
+				</w:t>
+			</w:r>
+		</xsl:if>
+		<!-- if no specific style is assigned we might check for any other indication 
+			to assign some style ... -->
+		<xsl:variable name="renderingProperties">
+			<xsl:for-each select="..">
+				<xsl:call-template name="applyRend" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:variable name="rProps">
+			<xsl:if
+				test="string-length($character-style) &gt; 0 or not(empty($renderingProperties))">
+				<w:rPr>
+					<xsl:if test="string-length($character-style) &gt; 0">
+						<w:rStyle>
+							<xsl:choose>
+								<!-- this is a rogue - trap it and kill it -->
+								<xsl:when test="$character-style='footnote reference'">
+									<xsl:attribute name="w:val"
+										select="'FootnoteReference'" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:attribute name="w:val"
+										select="$character-style" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</w:rStyle>
+					</xsl:if>
+					<xsl:copy-of select="$renderingProperties" />
+					<xsl:if test="ancestor::*[@xml:lang]">
+						<w:lang w:val="{ancestor::*[@xml:lang][1]/@xml:lang}" />
+					</xsl:if>
+				</w:rPr>
+			</xsl:if>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$renderAddDel='true'">
+				<w:r>
+					<xsl:copy-of select="$rProps" />
+					<w:t>
+						<xsl:call-template name="Text" />
+					</w:t>
+				</w:r>
+			</xsl:when>
+			<xsl:when test="parent::tei:del">
+				<w:del>
+					<xsl:variable name="N">
+						<xsl:for-each select="..">
+							<xsl:number level="any" />
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:attribute name="w:id"
+						select="number($N) + 50000" />
+					<xsl:if test="../@when">
+						<xsl:attribute name="w:date">
+              <xsl:value-of select="../@when" />
             </xsl:attribute>
-          </xsl:if>
-          <w:r>
-            <xsl:copy-of select="$rProps"/>
-            <w:delText>
-              <xsl:call-template name="Text"/>
-            </w:delText>
-          </w:r>
-        </w:del>
-      </xsl:when>
-      <xsl:when test="parent::tei:add">
-        <w:ins>
-          <xsl:variable name="N">
-            <xsl:for-each select="..">
-              <xsl:number level="any"/>
-            </xsl:for-each>
-          </xsl:variable>
-          <xsl:attribute name="w:id" select="number($N) + 50000"/>
-          <xsl:if test="../@when">
-            <xsl:attribute name="w:date">
-              <xsl:value-of select="../@when"/>
+					</xsl:if>
+					<w:r>
+						<xsl:copy-of select="$rProps" />
+						<w:delText>
+							<xsl:call-template name="Text" />
+						</w:delText>
+					</w:r>
+				</w:del>
+			</xsl:when>
+			<xsl:when test="parent::tei:add">
+				<w:ins>
+					<xsl:variable name="N">
+						<xsl:for-each select="..">
+							<xsl:number level="any" />
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:attribute name="w:id"
+						select="number($N) + 50000" />
+					<xsl:if test="../@when">
+						<xsl:attribute name="w:date">
+              <xsl:value-of select="../@when" />
             </xsl:attribute>
-          </xsl:if>
-          <w:r>
-            <xsl:copy-of select="$rProps"/>
-            <w:t>
-              <xsl:call-template name="Text"/>
-            </w:t>
-          </w:r>
-        </w:ins>
-      </xsl:when>
-      <xsl:otherwise>
-        <w:r>
-          <xsl:copy-of select="$rProps"/>
-          <w:t>
-            <xsl:call-template name="Text"/>
-          </w:t>
-        </w:r>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:head"/>
-      <xsl:when test="ancestor::tei:bibl"/>
-      <xsl:when test="following-sibling::text()"/>
-      <xsl:when test="../@xml:id">
-        <xsl:for-each select="..">
-          <xsl:variable name="N">
-            <xsl:number level="any"/>
-          </xsl:variable>
-          <w:bookmarkEnd w:id="{number($N) + 10000}"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:when test="parent::tei:head/parent::tei:*/@xml:id">
-        <xsl:for-each select="parent::tei:head/parent::tei:*">
-          <xsl:variable name="N">
-            <xsl:number level="any"/>
-          </xsl:variable>
-          <w:bookmarkEnd w:id="{number($N) + 10000}"/>
-        </xsl:for-each>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="Text">
-    <xsl:choose>
-      <xsl:when test="parent::w:body">
-        <xsl:message terminate="yes">CDATA found in body! [<xsl:value-of select="."/>]</xsl:message>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="out">
-          <xsl:choose>
-            <xsl:when test=".=' ' or ../@xml:space='preserve'">
-              <xsl:value-of select="."/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:if test="starts-with(.,' ') or starts-with(.,'&#10;')">
-                <xsl:text> </xsl:text>
-              </xsl:if>
-              <xsl:value-of select="normalize-space(.)"/>
-              <xsl:choose>
-                <xsl:when test="substring(.,string-length(.),1)=' '">
-                  <xsl:text> </xsl:text>
-                </xsl:when>
-                <xsl:when test="substring(.,string-length(.),1)='&#9;'">
-                  <xsl:text> </xsl:text>
-                </xsl:when>
-                <xsl:when test="substring(.,string-length(.),1)='&#10;'">
-                  <xsl:text> </xsl:text>
-                </xsl:when>
-              </xsl:choose>
-              <xsl:if test="substring(.,string-length(.),1)='&#10;'">
-                <xsl:text> </xsl:text>
-              </xsl:if>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:choose>
-          <xsl:when test="contains($out,'ߛ')">
-            <xsl:attribute name="xml:space">preserve</xsl:attribute>
-            <xsl:value-of select="substring-before($out,'ߛ')"/>
-            <w:noBreakHyphen/>
-            <xsl:attribute name="xml:space">preserve</xsl:attribute>
-            <xsl:value-of select="substring-after($out,'ߛ')"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:attribute name="xml:space">preserve</xsl:attribute>
-            <xsl:value-of select="$out"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        
-            Style definition templates: 
-            No default Style for any block or inline element
-        
-    </desc>
-  </doc>
-  <xsl:template match="*" mode="get-style"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc> 
-        to a given style name, this template returns the correct style id
-        looking it up in styles.xml 
-    </desc>
-  </doc>
-  <xsl:template name="getStyleName">
-    <xsl:param name="in"/>
-    <xsl:for-each select="document($styleDoc,/)">
-      <xsl:for-each select="key('Styles',$in)">
-        <xsl:value-of select="parent::w:style/@w:styleId"/>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        Tests whether to add rendering elements to a run.
-        Word styles cannot not be added in applyRend. If you want to add
-        a style go for a get-style template. The order of these
-	elements in Word does matter, by the way. 
-     </desc>
-  </doc>
-  <xsl:template name="applyRend">
-    <!-- use a custom font -->
-    <xsl:choose>
-      <xsl:when test="@iso:font">
-        <w:rFonts w:ascii="{@iso:font}" w:hAnsi="{@iso:font}"/>
-      </xsl:when>
-      <!-- typewriter font -->
-      <xsl:when test="contains(@rend,'typewriter') or tei:render-typewriter(.)">
-        <w:rFonts w:ascii="Courier" w:hAnsi="Courier"/>
-      </xsl:when>
-      <xsl:when test="contains(@rend, 'Special') or matches(@iso:style,'font-family')">
-        <xsl:call-template name="getStyleFonts">
-          <xsl:with-param name="css" select="@iso:style"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="matches(parent::*/@iso:style,'font-family')">
-        <xsl:call-template name="getStyleFonts">
-          <xsl:with-param name="css" select="parent::*/@iso:style"/>
-        </xsl:call-template>
-      </xsl:when>
-    </xsl:choose>
-    <!-- bold -->
-    <xsl:choose>
-      <xsl:when test="tei:render-bold(.)">
-        <w:b/>
-      </xsl:when>
-      <xsl:when test="self::tei:hi[not(@rend)]">
-        <w:b/>
-      </xsl:when>
-      <xsl:when test="self::tbx:hi[@style='bold']">
-        <w:i/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'bold')">
-        <w:b/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'normalweight')">
-        <w:b w:val="0"/>
-      </xsl:when>
-    </xsl:choose>
-    <!-- italic -->
-    <xsl:choose>
-      <xsl:when test="tei:render-italic(.)">
-        <w:i/>
-      </xsl:when>
-      <xsl:when test="self::tei:emph">
-        <w:i/>
-      </xsl:when>
-      <xsl:when test="self::tbx:hi[@style='italics']">
-        <w:i/>
-      </xsl:when>
-      <xsl:when test="self::tbx:hi[@style='it']">
-        <w:i/>
-      </xsl:when>
-    </xsl:choose>
-    <!-- small caps -->
-    <xsl:if test="tei:render-smallcaps(.)">
-      <w:smallCaps/>
-    </xsl:if>
-    <!-- all caps -->
-    <xsl:if test="contains(@rend,'capsall')">
-      <w:caps/>
-    </xsl:if>
-    <!-- strikethrough -->
-    <xsl:choose>
-      <xsl:when test="$renderAddDel='true' and ancestor-or-self::tei:del">
-        <w:strike/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'strikethrough')">
-        <w:strike/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'strikedoublethrough')">
-        <w:dstrike/>
-      </xsl:when>
-    </xsl:choose>
-    <!-- colour -->
-    <xsl:choose>
-      <xsl:when test="$renderAddDel='true' and ancestor-or-self::tei:add">
-        <w:color w:val="{$addColour}"/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'color(')">
-        <w:color w:val="{substring-before(substring-after(@rend,'color('),')')}"/>
-      </xsl:when>
-    </xsl:choose>
-    <!-- background color -->
-    <xsl:if test="contains(@rend,'background(')">
-      <w:highlight w:val="{substring-before(substring-after(@rend,'background('),')')}"/>
-    </xsl:if>
-    <!-- underline -->
-    <xsl:choose>
-      <xsl:when test="contains(@rend,'underline') ">
-        <w:u w:val="single"/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'underwavyline') ">
-        <w:u w:val="wave"/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'underdoubleline')">
-        <w:u w:val="double"/>
-      </xsl:when>
-    </xsl:choose>
-    <!-- sub- and superscript -->
-    <xsl:choose>
-      <xsl:when test="contains(@iso:style,'position')">
-        <w:position>
-          <xsl:attribute name="w:val">
-            <xsl:value-of select="normalize-space(substring-before((substring-after(@iso:style,'position:')),';'))"/>
+					</xsl:if>
+					<w:r>
+						<xsl:copy-of select="$rProps" />
+						<w:t>
+							<xsl:call-template name="Text" />
+						</w:t>
+					</w:r>
+				</w:ins>
+			</xsl:when>
+			<xsl:otherwise>
+				<w:r>
+					<xsl:copy-of select="$rProps" />
+					<w:t>
+						<xsl:call-template name="Text" />
+					</w:t>
+				</w:r>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:head" />
+			<xsl:when test="ancestor::tei:bibl" />
+			<xsl:when test="following-sibling::text()" />
+			<xsl:when test="../@xml:id">
+				<xsl:for-each select="..">
+					<xsl:variable name="N">
+						<xsl:number level="any" />
+					</xsl:variable>
+					<w:bookmarkEnd w:id="{number($N) + 10000}" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:when test="parent::tei:head/parent::tei:*/@xml:id">
+				<xsl:for-each select="parent::tei:head/parent::tei:*">
+					<xsl:variable name="N">
+						<xsl:number level="any" />
+					</xsl:variable>
+					<w:bookmarkEnd w:id="{number($N) + 10000}" />
+				</xsl:for-each>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="Text">
+		<xsl:choose>
+			<xsl:when test="parent::w:body">
+				<xsl:message terminate="yes">
+					CDATA found in body! [
+					<xsl:value-of select="." />
+					]
+				</xsl:message>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="out">
+					<xsl:choose>
+						<xsl:when test=".=' ' or ../@xml:space='preserve'">
+							<xsl:value-of select="." />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:if
+								test="starts-with(.,' ') or starts-with(.,'&#10;')">
+								<xsl:text> </xsl:text>
+							</xsl:if>
+							<xsl:value-of select="normalize-space(.)" />
+							<xsl:choose>
+								<xsl:when test="substring(.,string-length(.),1)=' '">
+									<xsl:text> </xsl:text>
+								</xsl:when>
+								<xsl:when test="substring(.,string-length(.),1)='&#9;'">
+									<xsl:text> </xsl:text>
+								</xsl:when>
+								<xsl:when
+									test="substring(.,string-length(.),1)='&#10;'">
+									<xsl:text> </xsl:text>
+								</xsl:when>
+							</xsl:choose>
+							<xsl:if test="substring(.,string-length(.),1)='&#10;'">
+								<xsl:text> </xsl:text>
+							</xsl:if>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="contains($out,'ߛ')">
+						<xsl:attribute name="xml:space">preserve</xsl:attribute>
+						<xsl:value-of select="substring-before($out,'ߛ')" />
+						<w:noBreakHyphen />
+						<xsl:attribute name="xml:space">preserve</xsl:attribute>
+						<xsl:value-of select="substring-after($out,'ߛ')" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:attribute name="xml:space">preserve</xsl:attribute>
+						<xsl:value-of select="$out" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			Style definition templates:
+			No default Style for any block or inline element
+
+		</desc>
+	</doc>
+	<xsl:template match="*" mode="get-style" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			to a given style name, this template returns the correct style id
+			looking it up in styles.xml
+		</desc>
+	</doc>
+	<xsl:template name="getStyleName">
+		<xsl:param name="in" />
+		<xsl:for-each select="document($styleDoc,/)">
+			<xsl:for-each select="key('Styles',$in)">
+				<xsl:value-of select="parent::w:style/@w:styleId" />
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Tests whether to add rendering elements to a run.
+			Word styles cannot not be added in applyRend. If you want to add
+			a style go for a get-style template. The order of these
+			elements in Word does matter, by the way.
+		</desc>
+	</doc>
+	<xsl:template name="applyRend">
+		<!-- use a custom font -->
+		<xsl:choose>
+			<xsl:when test="@iso:font">
+				<w:rFonts w:ascii="{@iso:font}" w:hAnsi="{@iso:font}" />
+			</xsl:when>
+			<!-- typewriter font -->
+			<xsl:when
+				test="contains(@rend,'typewriter') or tei:render-typewriter(.)">
+				<w:rFonts w:ascii="Courier" w:hAnsi="Courier" />
+			</xsl:when>
+			<xsl:when
+				test="contains(@rend, 'Special') or matches(@iso:style,'font-family')">
+				<xsl:call-template name="getStyleFonts">
+					<xsl:with-param name="css" select="@iso:style" />
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="matches(parent::*/@iso:style,'font-family')">
+				<xsl:call-template name="getStyleFonts">
+					<xsl:with-param name="css"
+						select="parent::*/@iso:style" />
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+		<!-- bold -->
+		<xsl:choose>
+			<xsl:when test="tei:render-bold(.)">
+				<w:b />
+			</xsl:when>
+			<xsl:when test="self::tei:hi[not(@rend)]">
+				<w:b />
+			</xsl:when>
+			<xsl:when test="self::tbx:hi[@style='bold']">
+				<w:i />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'bold')">
+				<w:b />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'normalweight')">
+				<w:b w:val="0" />
+			</xsl:when>
+		</xsl:choose>
+		<!-- italic -->
+		<xsl:choose>
+			<xsl:when test="tei:render-italic(.)">
+				<w:i />
+			</xsl:when>
+			<xsl:when test="self::tei:emph">
+				<w:i />
+			</xsl:when>
+			<xsl:when test="self::tbx:hi[@style='italics']">
+				<w:i />
+			</xsl:when>
+			<xsl:when test="self::tbx:hi[@style='it']">
+				<w:i />
+			</xsl:when>
+		</xsl:choose>
+		<!-- small caps -->
+		<xsl:if test="tei:render-smallcaps(.)">
+			<w:smallCaps />
+		</xsl:if>
+		<!-- all caps -->
+		<xsl:if test="contains(@rend,'capsall')">
+			<w:caps />
+		</xsl:if>
+		<!-- strikethrough -->
+		<xsl:choose>
+			<xsl:when
+				test="$renderAddDel='true' and ancestor-or-self::tei:del">
+				<w:strike />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'strikethrough')">
+				<w:strike />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'strikedoublethrough')">
+				<w:dstrike />
+			</xsl:when>
+		</xsl:choose>
+		<!-- colour -->
+		<xsl:choose>
+			<xsl:when
+				test="$renderAddDel='true' and ancestor-or-self::tei:add">
+				<w:color w:val="{$addColour}" />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'color(')">
+				<w:color
+					w:val="{substring-before(substring-after(@rend,'color('),')')}" />
+			</xsl:when>
+		</xsl:choose>
+		<!-- background color -->
+		<xsl:if test="contains(@rend,'background(')">
+			<w:highlight
+				w:val="{substring-before(substring-after(@rend,'background('),')')}" />
+		</xsl:if>
+		<!-- underline -->
+		<xsl:choose>
+			<xsl:when test="contains(@rend,'underline') ">
+				<w:u w:val="single" />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'underwavyline') ">
+				<w:u w:val="wave" />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'underdoubleline')">
+				<w:u w:val="double" />
+			</xsl:when>
+		</xsl:choose>
+		<!-- sub- and superscript -->
+		<xsl:choose>
+			<xsl:when test="contains(@iso:style,'position')">
+				<w:position>
+					<xsl:attribute name="w:val">
+            <xsl:value-of
+						select="normalize-space(substring-before((substring-after(@iso:style,'position:')),';'))" />
           </xsl:attribute>
-        </w:position>
-      </xsl:when>
-      <xsl:when test="self::tbx:hi[@style='subscript']">
-        <w:vertAlign w:val="subscript"/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'subscript')">
-        <w:vertAlign w:val="subscript"/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'sub')">
-        <w:vertAlign w:val="subscript"/>
-      </xsl:when>
-    </xsl:choose>
-    <xsl:choose>
-      <xsl:when test="self::tbx:hi[@style='superscript']">
-        <w:vertAlign w:val="superscript"/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'superscript')">
-        <w:vertAlign w:val="superscript"/>
-      </xsl:when>
-      <xsl:when test="contains(@rend,'sup')">
-        <w:vertAlign w:val="sup"/>
-      </xsl:when>
-    </xsl:choose>
-    <!-- text direction -->
-    <xsl:if test="@its:dir!=''">
-      <!-- only handling RTL at the moment -->
-      <xsl:if test="matches(@its:dir,'rtl')">
-        <w:rtl/>
-      </xsl:if>
-    </xsl:if>
-  </xsl:template>
-  <!-- 
-        Footnotes
-    -->
-  <xsl:template name="create-footnote">
-    <xsl:variable name="num">
-      <xsl:number count="tei:note[@place='foot' or @place='bottom' ]" level="any"/>
-    </xsl:variable>
-    <xsl:variable name="id" select="number($num)+1"/>
-    <w:r>
-      <w:rPr>
-        <w:rStyle w:val="FootnoteReference"/>
-      </w:rPr>
-      <w:footnoteReference w:id="{$id}"/>
-    </w:r>
-    <w:r>
-      <w:t xml:space="preserve"> </w:t>
-    </w:r>
-  </xsl:template>
-  <xsl:template name="create-comment">
-    <w:r>
-      <w:rPr>
-        <w:rStyle w:val="CommentReference"/>
-        <w:vanish/>
-      </w:rPr>
-      <xsl:variable name="n">
-        <xsl:number level="any" count="tei:note[@place='comment']"/>
-      </xsl:variable>
-      <w:commentReference w:id="{$n - 1}"/>
-    </w:r>
-  </xsl:template>
-  <!-- 
-        Endnotes
-    -->
-  <xsl:template name="create-endnote">
-    <xsl:variable name="num">
-      <xsl:number count="tei:note[@place='end']" level="any"/>
-    </xsl:variable>
-    <xsl:variable name="id" select="$num+1"/>
-    <w:r>
-      <w:rPr>
-        <w:rStyle w:val="EndnoteReference"/>
-        <w:noProof/>
-      </w:rPr>
-      <w:endnoteReference w:id="{$id}"/>
-    </w:r>
-    <w:r>
-      <w:t xml:space="preserve"> </w:t>
-    </w:r>
-  </xsl:template>
-  <!--
-        Headers and Sections  
-    -->
-  <xsl:template match="tei:head[parent::tei:div or parent::tei:div1 or parent::tei:div2 or parent::tei:div3 or parent::tei:div4 or parent::tei:div5 or parent::tei:div6 or parent::tei:div7]">
-    <xsl:param name="pPr"/>
-    <!-- find out what level we are at -->
-    <xsl:variable name="level">
-      <xsl:value-of select="count(ancestor-or-self::tei:div| ancestor-or-self::tei:div1| ancestor-or-self::tei:div2| ancestor-or-self::tei:div3| ancestor-or-self::tei:div4| ancestor-or-self::tei:div5| ancestor-or-self::tei:div6| ancestor-or-self::tei:div7)"/>
-    </xsl:variable>
-    <xsl:variable name="number">
-      <xsl:number level="any"/>
-    </xsl:variable>
-    <xsl:variable name="getstyle" select="tei:get-headingstyle(.,$level)"/>
-    <xsl:call-template name="block-element">
-      <!-- we want a bookmark for referencing this section -->
-      <xsl:with-param name="bookmark-id">
-        <xsl:value-of select="1000+$number"/>
-      </xsl:with-param>
-      <xsl:with-param name="bookmark-name">
-        <xsl:choose>
-          <xsl:when test="parent::tei:div/@xml:id">
-            <xsl:value-of select="parent::tei:div/@xml:id"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:text>_SECTION_</xsl:text>
-            <xsl:value-of select="1000+$number"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:with-param>
-      <!-- find the correct header style -->
-      <xsl:with-param name="style">
-        <xsl:choose>
-          <xsl:when test="not($pPr  instance of xs:string)">
-            <xsl:value-of select="$pPr/w:pPr/w:pStyle/@w:val"/>
-          </xsl:when>
-          <xsl:when test="string-length($getstyle) &gt; 0">
-            <xsl:call-template name="getStyleName">
-              <xsl:with-param name="in" select="$getstyle"/>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:when test="parent::tei:div/parent::tei:back">
-            <xsl:text>ANNEX</xsl:text>
-          </xsl:when>
-          <xsl:when test="ancestor::tei:back">
-            <xsl:value-of select="concat('a',$level)"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="getStyleName">
-              <xsl:with-param name="in">
-                <xsl:text>heading </xsl:text>
-                <xsl:value-of select="$level"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <!-- quoted text; if it surrounds egXML, just pass on -->
-  <xsl:template match="tei:q|tei:said|tei:soCalled">
-    <xsl:choose>
-      <xsl:when test="*[not(tei:is-inline(.))] or parent::tei:cit|parent::tei:div">
-        <xsl:call-template name="block-element"/>
-      </xsl:when>
-      <xsl:when test="tei:l">
-        <xsl:apply-templates/>
-      </xsl:when>
-      <xsl:otherwise>
-        <w:r>
-          <w:t>
-            <xsl:value-of select="$preQuote"/>
-          </w:t>
-        </w:r>
-        <xsl:apply-templates/>
-        <w:r>
-          <w:t>
-            <xsl:value-of select="$postQuote"/>
-          </w:t>
-        </w:r>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <!-- 
-        GI
-    -->
-  <xsl:template match="tei:hi[@rend='specList-elementSpec']">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:gi">
-    <w:r>
-      <w:t>&lt;</w:t>
-    </w:r>
-    <xsl:apply-templates/>
-    <w:r>
-      <w:t>&gt;</w:t>
-    </w:r>
-  </xsl:template>
-  <xsl:template match="tei:caesura">
-    <w:r>
-      <w:t>   </w:t>
-    </w:r>
-  </xsl:template>
-  <!-- 
-        Handle examples
-    -->
-  <xsl:template match="teix:egXML|tei:p[@rend='eg']">
-    <xsl:param name="simple">false</xsl:param>
-    <xsl:param name="highlight"/>
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="select">
-        <tei:p rend="Special" iso:style="font-family:DejaVu Sans Mono; font-size:18; text-align:left;">
-          <xsl:call-template name="create-egXML-section"/>
-        </tei:p>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:eg">
-    <xsl:variable name="content">
-      <xsl:apply-templates select="*|processing-instruction()|comment()|text()" mode="egcopy"/>
-    </xsl:variable>
-    <xsl:for-each select="$content">
-      <xsl:call-template name="block-element">
-        <xsl:with-param name="style">Special</xsl:with-param>
-        <xsl:with-param name="select">
-          <tei:p rend="Special" iso:style="font-family:DejaVu Sans Mono; font-size:18;text-align:left;">
-            <xsl:copy-of select="*|processing-instruction()|comment()|text()"/>
-          </tei:p>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="text()" mode="egcopy">
-    <xsl:for-each select="tokenize(.,'\n')">
-      <xsl:choose>
-        <xsl:when test="position()=last()">
-          <xsl:value-of select="."/>
-        </xsl:when>
-        <xsl:when test=".='' and position()=1">
-          <xsl:value-of select="."/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="."/>
-          <tei:lb/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="@*|comment()|processing-instruction()" mode="egcopy">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  <xsl:template match="*" mode="egcopy">
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="egcopy"/>
-    </xsl:copy>
-  </xsl:template>
-  <!-- 
-        Handle TEI tables 
-    -->
-  <xsl:template match="tei:table">
-    <xsl:call-template name="table-body"/>
-    <xsl:call-template name="table-header"/>
-  </xsl:template>
-  <xsl:template name="table-body">
-    <w:tbl>
-      <xsl:choose>
-        <xsl:when test="w:tblPr">
-          <xsl:copy-of select="w:tblPr"/>
-        </xsl:when>
-        <xsl:when test="@rend='attDef'">
-          <w:tblPr>
-            <w:tblW w:w="0" w:type="auto"/>
-            <w:jc w:val="left"/>
-            <w:tblBorders>
-              <w:top w:val="nil" w:space="0" w:color="auto"/>
-              <w:left w:val="nil" w:space="0" w:color="auto"/>
-              <w:bottom w:val="nil" w:space="0" w:color="auto"/>
-              <w:right w:val="nil" w:space="0" w:color="auto"/>
-              <w:insideH w:val="nil" w:space="0" w:color="auto"/>
-              <w:insideV w:val="nil" w:space="0" w:color="auto"/>
-            </w:tblBorders>
-          </w:tblPr>
-        </xsl:when>
-        <xsl:when test="@rend='attList'">
-          <w:tblPr>
-            <w:tblW w:w="0" w:type="auto"/>
-            <w:jc w:val="left"/>
-            <w:tblBorders>
-              <w:top w:val="nil" w:space="0" w:color="auto"/>
-              <w:left w:val="nil" w:space="0" w:color="auto"/>
-              <w:bottom w:val="nil" w:space="0" w:color="auto"/>
-              <w:right w:val="nil" w:space="0" w:color="auto"/>
-              <w:insideH w:val="nil" w:space="0" w:color="auto"/>
-              <w:insideV w:val="nil" w:space="0" w:color="auto"/>
-            </w:tblBorders>
-          </w:tblPr>
-        </xsl:when>
-        <xsl:when test="@rend='norules'">
-          <w:tblPr>
-            <w:tblW w:w="0" w:type="auto"/>
-            <w:jc w:val="left"/>
-            <w:tblBorders>
-              <w:top w:val="nil" w:space="0" w:color="auto"/>
-              <w:left w:val="nil" w:space="0" w:color="auto"/>
-              <w:bottom w:val="nil" w:space="0" w:color="auto"/>
-              <w:right w:val="nil" w:space="0" w:color="auto"/>
-              <w:insideH w:val="nil" w:space="0" w:color="auto"/>
-              <w:insideV w:val="nil" w:space="0" w:color="auto"/>
-            </w:tblBorders>
-          </w:tblPr>
-        </xsl:when>
-        <xsl:when test="@rend='wovenodd'">
-          <w:tblPr>
-            <w:tblW w:w="0" w:type="auto"/>
-            <w:jc w:val="left"/>
-            <w:tblBorders>
-              <w:top w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:left w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:insideH w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:insideV w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-            </w:tblBorders>
-          </w:tblPr>
-        </xsl:when>
-        <xsl:otherwise>
-          <w:tblPr>
-            <w:tblW w:w="0" w:type="auto"/>
-            <w:jc w:val="center"/>
-            <w:tblBorders>
-              <w:top w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:left w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:insideH w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-              <w:insideV w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-            </w:tblBorders>
-          </w:tblPr>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:choose>
-        <xsl:when test="html:colgroup">
-          <w:tblGrid>
-            <xsl:for-each select="html:colgroup/html:col">
-              <w:gridCol w:w="{tei:convert-dim-pt20(@width)}"/>
-            </xsl:for-each>
-          </w:tblGrid>
-        </xsl:when>
-        <!-- if it is defined in word's namespace -->
-        <xsl:when test="w:tblGrid">
-          <xsl:copy-of select="w:tblGrid"/>
-        </xsl:when>
-        <xsl:otherwise>
-	  <xsl:variable name="maxcols" select="max(.//tei:row/count(tei:cell))"/>
-          <w:tblGrid>
-            <xsl:for-each select="1 to $maxcols">
-              <w:gridCol w:type="pct" w:w="{round((100 div $maxcols) *  50)}"/>
-            </xsl:for-each>
-          </w:tblGrid>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:apply-templates select="tei:row"/>
-    </w:tbl>
-    <w:p/>
-  </xsl:template>
-  <xsl:template name="table-header">
-    <xsl:if test="tei:head">
-      <xsl:variable name="number">
-        <xsl:number level="any"/>
-      </xsl:variable>
-      <xsl:for-each select="tei:head[1]">
-        <xsl:choose>
-          <xsl:when test="../@xml:id">
-            <xsl:call-template name="block-element">
-              <xsl:with-param name="style">Tabletitle</xsl:with-param>
-              <!-- we want a bookmark for referencing this table -->
-              <xsl:with-param name="bookmark-id">
-                <xsl:value-of select="1000+$number"/>
-              </xsl:with-param>
-              <xsl:with-param name="bookmark-name">
-                <xsl:value-of select="../@xml:id"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="block-element">
-              <xsl:with-param name="style">Tabletitle</xsl:with-param>
-            </xsl:call-template>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:row">
-    <w:tr>
-      <xsl:choose>
-        <xsl:when test="w:trPr">
-          <xsl:copy-of select="w:trPr"/>
-        </xsl:when>
-        <xsl:otherwise> </xsl:otherwise>
-      </xsl:choose>
-      <w:tblPrEx>
-        <w:tblLayout w:type="autofit"/>
-      </w:tblPrEx>
-      <xsl:apply-templates select="tei:cell"/>
-    </w:tr>
-  </xsl:template>
-  <xsl:template match="tei:cell">
-    <w:tc>
-      <xsl:choose>
-        <xsl:when test="w:tcPr">
-          <xsl:copy-of select="w:tcPr"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <w:tcPr>
-            <!--w:tcW w:w="1915" w:type="dxa"/-->
-            <xsl:if test="@cols">
-              <w:gridSpan w:val="{@cols}"/>
-            </xsl:if>
-          </w:tcPr>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:choose>
-        <xsl:when test="tei:note">
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="block-element">
-            <xsl:with-param name="pPr">
-              <w:pPr>
-                <xsl:choose>
-                  <xsl:when test="@rend">
-                    <xsl:variable name="sName">
-                      <xsl:call-template name="getStyleName">
-                        <xsl:with-param name="in" select="@rend"/>
-                      </xsl:call-template>
-                    </xsl:variable>
-                    <xsl:choose>
-                      <xsl:when test="$sName=''">
-                        <w:pStyle w:val="{$TableText}"/>
-                      </xsl:when>
-                      <xsl:otherwise>
-                        <w:pStyle w:val="{$sName}"/>
-                      </xsl:otherwise>
-                    </xsl:choose>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <w:pStyle w:val="{$TableText}"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-                <xsl:choose>
-                  <xsl:when test="@teidocx:align">
-                    <w:jc w:val="{@teidocx:align}"/>
-                  </xsl:when>
-                  <xsl:when test="parent::tei:row[@role='label']          or @role='label'">
-                    <w:jc w:val="left"/>
-                  </xsl:when>
-                  <xsl:when test="starts-with(.,'[0-9]')">
-                    <w:jc w:val="right"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <w:jc w:val="left"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </w:pPr>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:otherwise>
-      </xsl:choose>
-      <!-- If we have no children, put an empty p here -->
-      <xsl:if test="not(descendant::text())">
-        <w:p>
-          <w:pPr>
-            <w:pStyle w:val="Tabletext9"/>
-          </w:pPr>
-          <w:r>
-            <w:t/>
-          </w:r>
-        </w:p>
-      </xsl:if>
-    </w:tc>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Turn iso:style attribute back into Word styles for
-        table, or work out some defaults based on @rowsep and
-        @colsep</desc>
-  </doc>
-  <xsl:template name="calculateTableBorders">
-    <xsl:param name="htmlStyles"/>
-    <xsl:choose>
-      <xsl:when test="$htmlStyles!=''">
-        <xsl:for-each select="tokenize($htmlStyles,';')">
-          <xsl:variable name="val">
-            <xsl:value-of select="normalize-space(substring-after(.,':'))"/>
-          </xsl:variable>
-          <xsl:if test="matches(.,'border-top')">
-            <xsl:choose>
-              <xsl:when test="$val=0">
-                <w:top w:val="nil"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <w:top w:val="single" w:sz="{$val}" w:space="0" w:color="auto"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:if>
-          <xsl:if test="matches(.,'border-left')">
-            <xsl:choose>
-              <xsl:when test="$val=0">
-                <w:left w:val="nil"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <w:left w:val="single" w:sz="{$val}" w:space="0" w:color="auto"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:if>
-          <xsl:if test="matches(.,'border-bottom')">
-            <xsl:choose>
-              <xsl:when test="$val=0">
-                <w:bottom w:val="nil"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <w:bottom w:val="single" w:sz="{$val}" w:space="0" w:color="auto"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:if>
-          <xsl:if test="matches(.,'border-right')">
-            <xsl:choose>
-              <xsl:when test="$val=0">
-                <w:right w:val="nil"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <w:right w:val="single" w:sz="{$val}" w:space="0" w:color="auto"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:if>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:if test="@rowsep='1' or (not(@rowsep ='0') and ancestor::cals:tgroup/@rowsep='1')">
-          <w:top w:val="single" w:sz="1"/>
-        </xsl:if>
-        <xsl:if test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
-          <w:left w:val="single" w:sz="1"/>
-        </xsl:if>
-        <xsl:if test="@rowsep='1' or (not(@rowsep ='0') and ancestor::cals:tgroup/@rowsep='1')">
-          <w:bottom w:val="single" w:sz="1"/>
-        </xsl:if>
-        <xsl:if test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
-          <w:right w:val="single" w:sz="1"/>
-        </xsl:if>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <!-- Handle CALS tables -->
-  <xsl:template match="cals:table">
-    <xsl:call-template name="tableheading-from-cals"/>
-    <w:tbl>
-      <w:tblPr>
-        <w:tblW>
-	  <xsl:choose>
-	    <xsl:when test="not($tableWidthPercentage='')">
-	      <xsl:attribute name="w:w">
-		<xsl:value-of  select="round(number($tableWidthPercentage)* 50)"/>
+				</w:position>
+			</xsl:when>
+			<xsl:when test="self::tbx:hi[@style='subscript']">
+				<w:vertAlign w:val="subscript" />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'subscript')">
+				<w:vertAlign w:val="subscript" />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'sub')">
+				<w:vertAlign w:val="subscript" />
+			</xsl:when>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="self::tbx:hi[@style='superscript']">
+				<w:vertAlign w:val="superscript" />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'superscript')">
+				<w:vertAlign w:val="superscript" />
+			</xsl:when>
+			<xsl:when test="contains(@rend,'sup')">
+				<w:vertAlign w:val="sup" />
+			</xsl:when>
+		</xsl:choose>
+		<!-- text direction -->
+		<xsl:if test="@its:dir!=''">
+			<!-- only handling RTL at the moment -->
+			<xsl:if test="matches(@its:dir,'rtl')">
+				<w:rtl />
+			</xsl:if>
+		</xsl:if>
+	</xsl:template>
+	<!-- Footnotes -->
+	<xsl:template name="create-footnote">
+		<xsl:variable name="num">
+			<xsl:number
+				count="tei:note[@place='foot' or @place='bottom' ]" level="any" />
+		</xsl:variable>
+		<xsl:variable name="id" select="number($num)+1" />
+		<w:r>
+			<w:rPr>
+				<w:rStyle w:val="FootnoteReference" />
+			</w:rPr>
+			<w:footnoteReference w:id="{$id}" />
+		</w:r>
+		<w:r>
+			<w:t xml:space="preserve"> </w:t>
+		</w:r>
+	</xsl:template>
+	<xsl:template name="create-comment">
+		<w:r>
+			<w:rPr>
+				<w:rStyle w:val="CommentReference" />
+				<w:vanish />
+			</w:rPr>
+			<xsl:variable name="n">
+				<xsl:number level="any"
+					count="tei:note[@place='comment']" />
+			</xsl:variable>
+			<w:commentReference w:id="{$n - 1}" />
+		</w:r>
+	</xsl:template>
+	<!-- Endnotes -->
+	<xsl:template name="create-endnote">
+		<xsl:variable name="num">
+			<xsl:number count="tei:note[@place='end']" level="any" />
+		</xsl:variable>
+		<xsl:variable name="id" select="$num+1" />
+		<w:r>
+			<w:rPr>
+				<w:rStyle w:val="EndnoteReference" />
+				<w:noProof />
+			</w:rPr>
+			<w:endnoteReference w:id="{$id}" />
+		</w:r>
+		<w:r>
+			<w:t xml:space="preserve"> </w:t>
+		</w:r>
+	</xsl:template>
+	<!-- Headers and Sections -->
+	<xsl:template
+		match="tei:head[parent::tei:div or parent::tei:div1 or parent::tei:div2 or parent::tei:div3 or parent::tei:div4 or parent::tei:div5 or parent::tei:div6 or parent::tei:div7]">
+		<xsl:param name="pPr" />
+		<!-- find out what level we are at -->
+		<xsl:variable name="level">
+			<xsl:value-of
+				select="count(ancestor-or-self::tei:div| ancestor-or-self::tei:div1| ancestor-or-self::tei:div2| ancestor-or-self::tei:div3| ancestor-or-self::tei:div4| ancestor-or-self::tei:div5| ancestor-or-self::tei:div6| ancestor-or-self::tei:div7)" />
+		</xsl:variable>
+		<xsl:variable name="number">
+			<xsl:number level="any" />
+		</xsl:variable>
+		<xsl:variable name="getstyle"
+			select="tei:get-headingstyle(.,$level)" />
+		<xsl:call-template name="block-element">
+			<!-- we want a bookmark for referencing this section -->
+			<xsl:with-param name="bookmark-id">
+				<xsl:value-of select="1000+$number" />
+			</xsl:with-param>
+			<xsl:with-param name="bookmark-name">
+				<xsl:choose>
+					<xsl:when test="parent::tei:div/@xml:id">
+						<xsl:value-of select="parent::tei:div/@xml:id" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>_SECTION_</xsl:text>
+						<xsl:value-of select="1000+$number" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:with-param>
+			<!-- find the correct header style -->
+			<xsl:with-param name="style">
+				<xsl:choose>
+					<xsl:when test="not($pPr  instance of xs:string)">
+						<xsl:value-of select="$pPr/w:pPr/w:pStyle/@w:val" />
+					</xsl:when>
+					<xsl:when test="string-length($getstyle) &gt; 0">
+						<xsl:call-template name="getStyleName">
+							<xsl:with-param name="in" select="$getstyle" />
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when test="parent::tei:div/parent::tei:back">
+						<xsl:text>ANNEX</xsl:text>
+					</xsl:when>
+					<xsl:when test="ancestor::tei:back">
+						<xsl:value-of select="concat('a',$level)" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="getStyleName">
+							<xsl:with-param name="in">
+								<xsl:text>heading </xsl:text>
+								<xsl:value-of select="$level" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<!-- quoted text; if it surrounds egXML, just pass on -->
+	<xsl:template match="tei:q|tei:said|tei:soCalled">
+		<xsl:choose>
+			<xsl:when
+				test="*[not(tei:is-inline(.))] or parent::tei:cit|parent::tei:div">
+				<xsl:call-template name="block-element" />
+			</xsl:when>
+			<xsl:when test="tei:l">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<w:r>
+					<w:t>
+						<xsl:value-of select="$preQuote" />
+					</w:t>
+				</w:r>
+				<xsl:apply-templates />
+				<w:r>
+					<w:t>
+						<xsl:value-of select="$postQuote" />
+					</w:t>
+				</w:r>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- GI -->
+	<xsl:template match="tei:hi[@rend='specList-elementSpec']">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="tei:gi">
+		<w:r>
+			<w:t>&lt;</w:t>
+		</w:r>
+		<xsl:apply-templates />
+		<w:r>
+			<w:t>&gt;</w:t>
+		</w:r>
+	</xsl:template>
+	<xsl:template match="tei:caesura">
+		<w:r>
+			<w:t>   </w:t>
+		</w:r>
+	</xsl:template>
+	<!-- Handle examples -->
+	<xsl:template match="teix:egXML|tei:p[@rend='eg']">
+		<xsl:param name="simple">
+			false
+		</xsl:param>
+		<xsl:param name="highlight" />
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="select">
+				<tei:p rend="Special"
+					iso:style="font-family:DejaVu Sans Mono; font-size:18; text-align:left;">
+					<xsl:call-template name="create-egXML-section" />
+				</tei:p>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:eg">
+		<xsl:variable name="content">
+			<xsl:apply-templates
+				select="*|processing-instruction()|comment()|text()" mode="egcopy" />
+		</xsl:variable>
+		<xsl:for-each select="$content">
+			<xsl:call-template name="block-element">
+				<xsl:with-param name="style">
+					Special
+				</xsl:with-param>
+				<xsl:with-param name="select">
+					<tei:p rend="Special"
+						iso:style="font-family:DejaVu Sans Mono; font-size:18;text-align:left;">
+						<xsl:copy-of
+							select="*|processing-instruction()|comment()|text()" />
+					</tei:p>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="text()" mode="egcopy">
+		<xsl:for-each select="tokenize(.,'\n')">
+			<xsl:choose>
+				<xsl:when test="position()=last()">
+					<xsl:value-of select="." />
+				</xsl:when>
+				<xsl:when test=".='' and position()=1">
+					<xsl:value-of select="." />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="." />
+					<tei:lb />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template
+		match="@*|comment()|processing-instruction()" mode="egcopy">
+		<xsl:copy-of select="." />
+	</xsl:template>
+	<xsl:template match="*" mode="egcopy">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()"
+				mode="egcopy" />
+		</xsl:copy>
+	</xsl:template>
+	<!-- Handle TEI tables -->
+	<xsl:template match="tei:table">
+		<xsl:call-template name="table-body" />
+		<xsl:call-template name="table-header" />
+	</xsl:template>
+	<xsl:template name="table-body">
+		<w:tbl>
+			<xsl:choose>
+				<xsl:when test="w:tblPr">
+					<xsl:copy-of select="w:tblPr" />
+				</xsl:when>
+				<xsl:when test="@rend='attDef'">
+					<w:tblPr>
+						<w:tblW w:w="0" w:type="auto" />
+						<w:jc w:val="left" />
+						<w:tblBorders>
+							<w:top w:val="nil" w:space="0" w:color="auto" />
+							<w:left w:val="nil" w:space="0" w:color="auto" />
+							<w:bottom w:val="nil" w:space="0" w:color="auto" />
+							<w:right w:val="nil" w:space="0" w:color="auto" />
+							<w:insideH w:val="nil" w:space="0" w:color="auto" />
+							<w:insideV w:val="nil" w:space="0" w:color="auto" />
+						</w:tblBorders>
+					</w:tblPr>
+				</xsl:when>
+				<xsl:when test="@rend='attList'">
+					<w:tblPr>
+						<w:tblW w:w="0" w:type="auto" />
+						<w:jc w:val="left" />
+						<w:tblBorders>
+							<w:top w:val="nil" w:space="0" w:color="auto" />
+							<w:left w:val="nil" w:space="0" w:color="auto" />
+							<w:bottom w:val="nil" w:space="0" w:color="auto" />
+							<w:right w:val="nil" w:space="0" w:color="auto" />
+							<w:insideH w:val="nil" w:space="0" w:color="auto" />
+							<w:insideV w:val="nil" w:space="0" w:color="auto" />
+						</w:tblBorders>
+					</w:tblPr>
+				</xsl:when>
+				<xsl:when test="@rend='norules'">
+					<w:tblPr>
+						<w:tblW w:w="0" w:type="auto" />
+						<w:jc w:val="left" />
+						<w:tblBorders>
+							<w:top w:val="nil" w:space="0" w:color="auto" />
+							<w:left w:val="nil" w:space="0" w:color="auto" />
+							<w:bottom w:val="nil" w:space="0" w:color="auto" />
+							<w:right w:val="nil" w:space="0" w:color="auto" />
+							<w:insideH w:val="nil" w:space="0" w:color="auto" />
+							<w:insideV w:val="nil" w:space="0" w:color="auto" />
+						</w:tblBorders>
+					</w:tblPr>
+				</xsl:when>
+				<xsl:when test="@rend='wovenodd'">
+					<w:tblPr>
+						<w:tblW w:w="0" w:type="auto" />
+						<w:jc w:val="left" />
+						<w:tblBorders>
+							<w:top w:val="single" w:sz="6" w:space="0" w:color="auto" />
+							<w:left w:val="single" w:sz="6" w:space="0" w:color="auto" />
+							<w:bottom w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+							<w:right w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+							<w:insideH w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+							<w:insideV w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+						</w:tblBorders>
+					</w:tblPr>
+				</xsl:when>
+				<xsl:otherwise>
+					<w:tblPr>
+						<w:tblW w:w="0" w:type="auto" />
+						<w:jc w:val="center" />
+						<w:tblBorders>
+							<w:top w:val="single" w:sz="6" w:space="0" w:color="auto" />
+							<w:left w:val="single" w:sz="6" w:space="0" w:color="auto" />
+							<w:bottom w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+							<w:right w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+							<w:insideH w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+							<w:insideV w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+						</w:tblBorders>
+					</w:tblPr>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="html:colgroup">
+					<w:tblGrid>
+						<xsl:for-each select="html:colgroup/html:col">
+							<w:gridCol w:w="{tei:convert-dim-pt20(@width)}" />
+						</xsl:for-each>
+					</w:tblGrid>
+				</xsl:when>
+				<!-- if it is defined in word's namespace -->
+				<xsl:when test="w:tblGrid">
+					<xsl:copy-of select="w:tblGrid" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="maxcols"
+						select="max(.//tei:row/count(tei:cell))" />
+					<w:tblGrid>
+						<xsl:for-each select="1 to $maxcols">
+							<w:gridCol w:type="pct"
+								w:w="{round((100 div $maxcols) *  50)}" />
+						</xsl:for-each>
+					</w:tblGrid>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:apply-templates select="tei:row" />
+		</w:tbl>
+		<w:p />
+	</xsl:template>
+	<xsl:template name="table-header">
+		<xsl:if test="tei:head">
+			<xsl:variable name="number">
+				<xsl:number level="any" />
+			</xsl:variable>
+			<xsl:for-each select="tei:head[1]">
+				<xsl:choose>
+					<xsl:when test="../@xml:id">
+						<xsl:call-template name="block-element">
+							<xsl:with-param name="style">
+								Tabletitle
+							</xsl:with-param>
+							<!-- we want a bookmark for referencing this table -->
+							<xsl:with-param name="bookmark-id">
+								<xsl:value-of select="1000+$number" />
+							</xsl:with-param>
+							<xsl:with-param name="bookmark-name">
+								<xsl:value-of select="../@xml:id" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="block-element">
+							<xsl:with-param name="style">
+								Tabletitle
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="tei:row">
+		<w:tr>
+			<xsl:choose>
+				<xsl:when test="w:trPr">
+					<xsl:copy-of select="w:trPr" />
+				</xsl:when>
+				<xsl:otherwise>
+				</xsl:otherwise>
+			</xsl:choose>
+			<w:tblPrEx>
+				<w:tblLayout w:type="autofit" />
+			</w:tblPrEx>
+			<xsl:apply-templates select="tei:cell" />
+		</w:tr>
+	</xsl:template>
+	<xsl:template match="tei:cell">
+		<w:tc>
+			<xsl:choose>
+				<xsl:when test="w:tcPr">
+					<xsl:copy-of select="w:tcPr" />
+				</xsl:when>
+				<xsl:otherwise>
+					<w:tcPr>
+						<!--w:tcW w:w="1915" w:type="dxa"/ -->
+						<xsl:if test="@cols">
+							<w:gridSpan w:val="{@cols}" />
+						</xsl:if>
+					</w:tcPr>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:choose>
+				<xsl:when test="tei:note">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="block-element">
+						<xsl:with-param name="pPr">
+							<w:pPr>
+								<xsl:choose>
+									<xsl:when test="@rend">
+										<xsl:variable name="sName">
+											<xsl:call-template name="getStyleName">
+												<xsl:with-param name="in" select="@rend" />
+											</xsl:call-template>
+										</xsl:variable>
+										<xsl:choose>
+											<xsl:when test="$sName=''">
+												<w:pStyle w:val="{$TableText}" />
+											</xsl:when>
+											<xsl:otherwise>
+												<w:pStyle w:val="{$sName}" />
+											</xsl:otherwise>
+										</xsl:choose>
+									</xsl:when>
+									<xsl:otherwise>
+										<w:pStyle w:val="{$TableText}" />
+									</xsl:otherwise>
+								</xsl:choose>
+								<xsl:choose>
+									<xsl:when test="@teidocx:align">
+										<w:jc w:val="{@teidocx:align}" />
+									</xsl:when>
+									<xsl:when
+										test="parent::tei:row[@role='label']          or @role='label'">
+										<w:jc w:val="left" />
+									</xsl:when>
+									<xsl:when test="starts-with(.,'[0-9]')">
+										<w:jc w:val="right" />
+									</xsl:when>
+									<xsl:otherwise>
+										<w:jc w:val="left" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</w:pPr>
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
+			<!-- If we have no children, put an empty p here -->
+			<xsl:if test="not(descendant::text())">
+				<w:p>
+					<w:pPr>
+						<w:pStyle w:val="Tabletext9" />
+					</w:pPr>
+					<w:r>
+						<w:t />
+					</w:r>
+				</w:p>
+			</xsl:if>
+		</w:tc>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Turn iso:style attribute back into Word styles for
+			table, or work out some defaults based on @rowsep and
+			@colsep</desc>
+	</doc>
+	<xsl:template name="calculateTableBorders">
+		<xsl:param name="htmlStyles" />
+		<xsl:choose>
+			<xsl:when test="$htmlStyles!=''">
+				<xsl:for-each select="tokenize($htmlStyles,';')">
+					<xsl:variable name="val">
+						<xsl:value-of
+							select="normalize-space(substring-after(.,':'))" />
+					</xsl:variable>
+					<xsl:if test="matches(.,'border-top')">
+						<xsl:choose>
+							<xsl:when test="$val=0">
+								<w:top w:val="nil" />
+							</xsl:when>
+							<xsl:otherwise>
+								<w:top w:val="single" w:sz="{$val}" w:space="0"
+									w:color="auto" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:if>
+					<xsl:if test="matches(.,'border-left')">
+						<xsl:choose>
+							<xsl:when test="$val=0">
+								<w:left w:val="nil" />
+							</xsl:when>
+							<xsl:otherwise>
+								<w:left w:val="single" w:sz="{$val}" w:space="0"
+									w:color="auto" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:if>
+					<xsl:if test="matches(.,'border-bottom')">
+						<xsl:choose>
+							<xsl:when test="$val=0">
+								<w:bottom w:val="nil" />
+							</xsl:when>
+							<xsl:otherwise>
+								<w:bottom w:val="single" w:sz="{$val}" w:space="0"
+									w:color="auto" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:if>
+					<xsl:if test="matches(.,'border-right')">
+						<xsl:choose>
+							<xsl:when test="$val=0">
+								<w:right w:val="nil" />
+							</xsl:when>
+							<xsl:otherwise>
+								<w:right w:val="single" w:sz="{$val}" w:space="0"
+									w:color="auto" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if
+					test="@rowsep='1' or (not(@rowsep ='0') and ancestor::cals:tgroup/@rowsep='1')">
+					<w:top w:val="single" w:sz="1" />
+				</xsl:if>
+				<xsl:if
+					test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
+					<w:left w:val="single" w:sz="1" />
+				</xsl:if>
+				<xsl:if
+					test="@rowsep='1' or (not(@rowsep ='0') and ancestor::cals:tgroup/@rowsep='1')">
+					<w:bottom w:val="single" w:sz="1" />
+				</xsl:if>
+				<xsl:if
+					test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
+					<w:right w:val="single" w:sz="1" />
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- Handle CALS tables -->
+	<xsl:template match="cals:table">
+		<xsl:call-template name="tableheading-from-cals" />
+		<w:tbl>
+			<w:tblPr>
+				<w:tblW>
+					<xsl:choose>
+						<xsl:when test="not($tableWidthPercentage='')">
+							<xsl:attribute name="w:w">
+		<xsl:value-of
+								select="round(number($tableWidthPercentage)* 50)" />
 	      </xsl:attribute>
-	      <xsl:attribute name="w:type">pct</xsl:attribute>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:attribute name="w:w">0</xsl:attribute>
-	      <xsl:attribute name="w:type">auto</xsl:attribute>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</w:tblW>
-        <w:jc w:val="center"/>
-        <w:tblBorders>
-          <xsl:variable name="tblBorders">
-            <xsl:call-template name="calculateTableBorders">
-              <xsl:with-param name="htmlStyles">
-                <xsl:value-of select="@iso:style"/>
-              </xsl:with-param>
-            </xsl:call-template>
-          </xsl:variable>
-          <xsl:choose>
-            <!-- only @frame turns borders on/off. If a
-		   border is 'on' *and* there is a corresponding 
-		   border in $tblBorders (ie created from
-		   info in iso:style) then the size from $tblBorders
-		   overrides the default size -->
-            <xsl:when test="@frame='none'">
-              <w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-            </xsl:when>
-            <xsl:when test="@frame='top'">
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:top">
-                  <xsl:copy-of select="$tblBorders/w:top"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:top w:val="none" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-            </xsl:when>
-            <xsl:when test="@frame='bottom'">
-              <w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:bottom">
-                  <xsl:copy-of select="$tblBorders/w:bottom"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-            </xsl:when>
-            <xsl:when test="@frame='topbot'">
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:top">
-                  <xsl:copy-of select="$tblBorders/w:top"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:top w:val="none" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <w:left w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:bottom">
-                  <xsl:copy-of select="$tblBorders/w:bottom"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <w:right w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-            </xsl:when>
-            <xsl:when test="@frame='sides'">
-              <w:top w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:left">
-                  <xsl:copy-of select="$tblBorders/w:left"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:left w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <w:bottom w:val="none" w:sz="0" w:space="0" w:color="auto"/>
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:right">
-                  <xsl:copy-of select="$tblBorders/w:right"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:when>
-            <xsl:when test="@frame='all'">
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:top">
-                  <xsl:copy-of select="$tblBorders/w:top"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:top w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:left">
-                  <xsl:copy-of select="$tblBorders/w:left"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:left w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:bottom">
-                  <xsl:copy-of select="$tblBorders/w:bottom"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <xsl:choose>
-                <xsl:when test="$tblBorders/w:right">
-                  <xsl:copy-of select="$tblBorders/w:right"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:when>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="@rowsep=1">
-              <w:insideH w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <w:insideH w:val="none" w:sz="6" w:space="0" w:color="auto"/>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="@colsep=1">
-              <w:insideV w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <w:insideV w:val="none" w:sz="6" w:space="0" w:color="auto"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </w:tblBorders>
-        <w:tblLayout w:type="fixed"/>
-      </w:tblPr>
-      <xsl:variable name="maxcols" select="max(.//cals:row/count(cals:entry))"/>
-      <xsl:choose>
-        <xsl:when test="cals:tgroup/cals:colspec">
-          <w:tblGrid>
-	    <xsl:variable name="totunits" select="sum(cals:tgroup/cals:colspec[ends-with(@colwidth,'*')]/number(substring-before(@colwidth,'*')))"/>
-            <xsl:for-each select="cals:tgroup/cals:colspec">
-              <w:gridCol>
-		  <xsl:choose>
-		    <!-- cell widths are specified in 50th of a percent -->
-		    <xsl:when test="ends-with(@colwidth,'*')">
-		      <xsl:attribute name="w:type">pct</xsl:attribute>
-		      <xsl:attribute name="w:w">
-			<xsl:value-of  select="round((number(substring-before(@colwidth,'*')) * 5000) div $totunits)"/>
+							<xsl:attribute name="w:type">pct</xsl:attribute>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:attribute name="w:w">0</xsl:attribute>
+							<xsl:attribute name="w:type">auto</xsl:attribute>
+						</xsl:otherwise>
+					</xsl:choose>
+				</w:tblW>
+				<w:jc w:val="center" />
+				<w:tblBorders>
+					<xsl:variable name="tblBorders">
+						<xsl:call-template name="calculateTableBorders">
+							<xsl:with-param name="htmlStyles">
+								<xsl:value-of select="@iso:style" />
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:variable>
+					<xsl:choose>
+						<!-- only @frame turns borders on/off. If a border is 'on' *and* there 
+							is a corresponding border in $tblBorders (ie created from info in iso:style) 
+							then the size from $tblBorders overrides the default size -->
+						<xsl:when test="@frame='none'">
+							<w:top w:val="none" w:sz="0" w:space="0" w:color="auto" />
+							<w:left w:val="none" w:sz="0" w:space="0" w:color="auto" />
+							<w:bottom w:val="none" w:sz="0" w:space="0"
+								w:color="auto" />
+							<w:right w:val="none" w:sz="0" w:space="0" w:color="auto" />
+						</xsl:when>
+						<xsl:when test="@frame='top'">
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:top">
+									<xsl:copy-of select="$tblBorders/w:top" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:top w:val="none" w:sz="6" w:space="0" w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<w:left w:val="none" w:sz="0" w:space="0" w:color="auto" />
+							<w:bottom w:val="none" w:sz="0" w:space="0"
+								w:color="auto" />
+							<w:right w:val="none" w:sz="0" w:space="0" w:color="auto" />
+						</xsl:when>
+						<xsl:when test="@frame='bottom'">
+							<w:top w:val="none" w:sz="0" w:space="0" w:color="auto" />
+							<w:left w:val="none" w:sz="0" w:space="0" w:color="auto" />
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:bottom">
+									<xsl:copy-of select="$tblBorders/w:bottom" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:bottom w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<w:right w:val="none" w:sz="0" w:space="0" w:color="auto" />
+						</xsl:when>
+						<xsl:when test="@frame='topbot'">
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:top">
+									<xsl:copy-of select="$tblBorders/w:top" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:top w:val="none" w:sz="6" w:space="0" w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<w:left w:val="none" w:sz="0" w:space="0" w:color="auto" />
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:bottom">
+									<xsl:copy-of select="$tblBorders/w:bottom" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:bottom w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<w:right w:val="none" w:sz="0" w:space="0" w:color="auto" />
+						</xsl:when>
+						<xsl:when test="@frame='sides'">
+							<w:top w:val="none" w:sz="0" w:space="0" w:color="auto" />
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:left">
+									<xsl:copy-of select="$tblBorders/w:left" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:left w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<w:bottom w:val="none" w:sz="0" w:space="0"
+								w:color="auto" />
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:right">
+									<xsl:copy-of select="$tblBorders/w:right" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:right w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:when test="@frame='all'">
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:top">
+									<xsl:copy-of select="$tblBorders/w:top" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:top w:val="single" w:sz="6" w:space="0" w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:left">
+									<xsl:copy-of select="$tblBorders/w:left" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:left w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:bottom">
+									<xsl:copy-of select="$tblBorders/w:bottom" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:bottom w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<xsl:choose>
+								<xsl:when test="$tblBorders/w:right">
+									<xsl:copy-of select="$tblBorders/w:right" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:right w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="@rowsep=1">
+							<w:insideH w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+						</xsl:when>
+						<xsl:otherwise>
+							<w:insideH w:val="none" w:sz="6" w:space="0"
+								w:color="auto" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="@colsep=1">
+							<w:insideV w:val="single" w:sz="6" w:space="0"
+								w:color="auto" />
+						</xsl:when>
+						<xsl:otherwise>
+							<w:insideV w:val="none" w:sz="6" w:space="0"
+								w:color="auto" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</w:tblBorders>
+				<w:tblLayout w:type="fixed" />
+			</w:tblPr>
+			<xsl:variable name="maxcols"
+				select="max(.//cals:row/count(cals:entry))" />
+			<xsl:choose>
+				<xsl:when test="cals:tgroup/cals:colspec">
+					<w:tblGrid>
+						<xsl:variable name="totunits"
+							select="sum(cals:tgroup/cals:colspec[ends-with(@colwidth,'*')]/number(substring-before(@colwidth,'*')))" />
+						<xsl:for-each select="cals:tgroup/cals:colspec">
+							<w:gridCol>
+								<xsl:choose>
+									<!-- cell widths are specified in 50th of a percent -->
+									<xsl:when test="ends-with(@colwidth,'*')">
+										<xsl:attribute name="w:type">pct</xsl:attribute>
+										<xsl:attribute name="w:w">
+			<xsl:value-of
+											select="round((number(substring-before(@colwidth,'*')) * 5000) div $totunits)" />
 		      </xsl:attribute>
-		    </xsl:when>
-		    <xsl:otherwise>
-		      <xsl:attribute name="w:w">
-			<xsl:value-of select="tei:convert-dim-pt20(@colwidth)"/>
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:attribute name="w:w">
+			<xsl:value-of select="tei:convert-dim-pt20(@colwidth)" />
 		      </xsl:attribute>
-		    </xsl:otherwise>
-		  </xsl:choose>
-	      </w:gridCol>
-	    </xsl:for-each>
-          </w:tblGrid>
-        </xsl:when>
-        <xsl:otherwise>
-          <w:tblGrid>
-            <xsl:for-each select="1 to $maxcols">
-              <w:gridCol w:type="pct" w:w="{round((100 div $maxcols) *  50)}"/>
-            </xsl:for-each>
-          </w:tblGrid>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:apply-templates select="cals:tgroup"/>
-    </w:tbl>
-    <w:p/>
-  </xsl:template>
-  <xsl:template name="tableheading-from-cals">
-    <xsl:if test="cals:title">
-      <xsl:for-each select="cals:title[1]">
-        <w:p>
-          <w:pPr>
-            <w:pStyle>
-              <xsl:attribute name="w:val">Tabletitle</xsl:attribute>
-            </w:pStyle>
-          </w:pPr>
-          <xsl:if test="not(normalize-space(.)='')">
-            <w:r>
-              <w:t xml:space="preserve">— </w:t>
-            </w:r>
-          </xsl:if>
-          <xsl:apply-templates/>
-        </w:p>
-      </xsl:for-each>
-      <xsl:for-each select="preceding-sibling::tei:p[@rend='Table units']">
-        <w:p>
-          <w:pPr>
-            <w:pStyle>
-              <xsl:attribute name="w:val">Tableunits</xsl:attribute>
-            </w:pStyle>
-          </w:pPr>
-          <xsl:apply-templates/>
-        </w:p>
-      </xsl:for-each>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="cals:tgroup">
-    <xsl:variable name="TABLE">
-      <xsl:copy>
-        <xsl:attribute name="iso:style">
-          <xsl:copy-of select="ancestor::cals:table/@iso:style"/>
+									</xsl:otherwise>
+								</xsl:choose>
+							</w:gridCol>
+						</xsl:for-each>
+					</w:tblGrid>
+				</xsl:when>
+				<xsl:otherwise>
+					<w:tblGrid>
+						<xsl:for-each select="1 to $maxcols">
+							<w:gridCol w:type="pct"
+								w:w="{round((100 div $maxcols) *  50)}" />
+						</xsl:for-each>
+					</w:tblGrid>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:apply-templates select="cals:tgroup" />
+		</w:tbl>
+		<w:p />
+	</xsl:template>
+	<xsl:template name="tableheading-from-cals">
+		<xsl:if test="cals:title">
+			<xsl:for-each select="cals:title[1]">
+				<w:p>
+					<w:pPr>
+						<w:pStyle>
+							<xsl:attribute name="w:val">Tabletitle</xsl:attribute>
+						</w:pStyle>
+					</w:pPr>
+					<xsl:if test="not(normalize-space(.)='')">
+						<w:r>
+							<w:t xml:space="preserve">— </w:t>
+						</w:r>
+					</xsl:if>
+					<xsl:apply-templates />
+				</w:p>
+			</xsl:for-each>
+			<xsl:for-each
+				select="preceding-sibling::tei:p[@rend='Table units']">
+				<w:p>
+					<w:pPr>
+						<w:pStyle>
+							<xsl:attribute name="w:val">Tableunits</xsl:attribute>
+						</w:pStyle>
+					</w:pPr>
+					<xsl:apply-templates />
+				</w:p>
+			</xsl:for-each>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="cals:tgroup">
+		<xsl:variable name="TABLE">
+			<xsl:copy>
+				<xsl:attribute name="iso:style">
+          <xsl:copy-of
+					select="ancestor::cals:table/@iso:style" />
         </xsl:attribute>
-        <xsl:copy-of select="@*"/>
-        <xsl:copy-of select="cals:colspec"/>
-        <xsl:for-each select="cals:tbody|cals:thead">
-          <xsl:copy>
-            <xsl:for-each select="cals:row">
-              <xsl:copy>
-                <xsl:copy-of select="@*"/>
-                <xsl:for-each select="cals:entry">
-                  <xsl:copy>
-                    <xsl:copy-of select="@*"/>
-                    <xsl:apply-templates mode="contents" select="."/>
-                  </xsl:copy>
-                  <xsl:variable name="rows" select="@rowsep"/>
-                  <xsl:variable name="cols" select="@colsep"/>
-                  <xsl:choose>
-                    <xsl:when test="@namest and ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
-                      <xsl:variable name="start">
-                        <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
-                          <xsl:choose>
-                            <xsl:when test="@colnum">
-                              <xsl:value-of select="@colnum"/>
-                            </xsl:when>
-                            <xsl:otherwise>
-                              <xsl:number/>
-                            </xsl:otherwise>
-                          </xsl:choose>
-                        </xsl:for-each>
-                      </xsl:variable>
-                      <xsl:variable name="end">
-                        <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@nameend]">
-                          <xsl:choose>
-                            <xsl:when test="@colnum">
-                              <xsl:value-of select="@colnum"/>
-                            </xsl:when>
-                            <xsl:otherwise>
-                              <xsl:number/>
-                            </xsl:otherwise>
-                          </xsl:choose>
-                        </xsl:for-each>
-                      </xsl:variable>
-                      <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[position()&gt;$start and position()&lt;=$end]">
-                        <cals:entry DUMMY="true" colname="{@colname}" colsep="{$cols}" rowsep="{$rows}"/>
-                      </xsl:for-each>
-                    </xsl:when>
-                    <xsl:when test="@namest">
-                      <xsl:message terminate="yes">ERROR Column <xsl:value-of select="@namest"/> 
-				    <xsl:text> referenced with @namest attribute </xsl:text>
-				    <xsl:text>is not named in the list of  &lt;colspec&gt; elements for this table</xsl:text>
-				  </xsl:message>
-                    </xsl:when>
-                  </xsl:choose>
-                </xsl:for-each>
-              </xsl:copy>
-            </xsl:for-each>
-          </xsl:copy>
-        </xsl:for-each>
-      </xsl:copy>
-    </xsl:variable>
-    <!--
-	<xsl:variable name="count">
-	  <xsl:number level="any"/>
-	</xsl:variable>
-	  <xsl:result-document indent="yes" href="/tmp/T{$count}.xml">
-	    <xsl:copy-of select="$TABLE"/>
-	  </xsl:result-document>
--->
-    <xsl:for-each select="$TABLE/cals:tgroup">
-      <xsl:apply-templates/>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="cals:row">
-    <xsl:variable name="borders">
-      <xsl:if test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
-        <w:left w:val="single" w:sz="1"/>
-      </xsl:if>
-    </xsl:variable>
-    <xsl:variable name="ROWPOS">
-      <xsl:number/>
-    </xsl:variable>
-    <xsl:variable name="TEMPLATE">
-      <xsl:for-each select="ancestor::cals:tgroup/cals:colspec">
-        <CELL name="{@colname}" num="{@colnum}" rowpos="{$ROWPOS}"/>
-      </xsl:for-each>
-    </xsl:variable>
-    <xsl:variable name="lastColnum">
-      <xsl:value-of select="ancestor::cals:tgroup/cals:colspec[last()]/@colnum"/>
-    </xsl:variable>
-    <xsl:variable name="lastColname">
-      <xsl:value-of select="ancestor::cals:tgroup/cals:colspec[last()]/@colname"/>
-    </xsl:variable>
-    <xsl:variable name="ME" select="."/>
-    <xsl:variable name="topEdge">
-      <xsl:choose>
-        <xsl:when test="parent::cals:tbody">
-          <xsl:if test="not(parent::cals:tbody/preceding-sibling::cals:thead/cals:row)">true</xsl:if>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:if test="not(preceding-sibling::cals:row)">true</xsl:if>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="bottomEdge">
-      <xsl:choose>
-        <xsl:when test="parent::cals:thead">
-          <xsl:if test="not(parent::cals:thead/following-sibling::cals:tbody/cals:row)">true</xsl:if>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:if test="not(following-sibling::cals:row)">true</xsl:if>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <w:tr>
-      <w:tblPrEx>
-        <w:tblLayout w:type="autofit"/>
-      </w:tblPrEx>
-      <xsl:for-each select="$TEMPLATE/CELL">
-        <xsl:variable name="N" select="@name"/>
-        <xsl:variable name="leftEdge">
-          <xsl:choose>
-            <xsl:when test="$N='c1' or $N='1'">true</xsl:when>
-            <xsl:when test="not(preceding-sibling::CELL)">true</xsl:when>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:variable name="rightEdge">
-          <xsl:choose>
-            <xsl:when test="not(following-sibling::CELL)">true</xsl:when>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:choose>
-          <xsl:when test="$ME/cals:entry[@colname=$N and @DUMMY='true']"/>
-          <xsl:when test="$ME/cals:entry[@colname=$N]">
-            <xsl:apply-templates select="$ME/cals:entry[@colname=$N]">
-              <xsl:with-param name="topEdge" select="$topEdge"/>
-              <xsl:with-param name="bottomEdge" select="$bottomEdge"/>
-              <xsl:with-param name="leftEdge" select="$leftEdge"/>
-              <xsl:with-param name="rightEdge" select="$rightEdge"/>
-            </xsl:apply-templates>
-          </xsl:when>
-          <xsl:otherwise>
-            <w:tc>
-              <w:tcPr>
-                <w:vMerge/>
-                <xsl:if test="$borders/w:left">
-                  <w:tcBorders>
-                    <xsl:copy-of select="$borders/w:left"/>
-                  </w:tcBorders>
-                </xsl:if>
-              </w:tcPr>
-              <w:p>    </w:p>
-            </w:tc>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each>
-    </w:tr>
-  </xsl:template>
-  <xsl:template match="cals:entry">
-    <xsl:param name="topEdge"/>
-    <xsl:param name="bottomEdge"/>
-    <xsl:param name="leftEdge"/>
-    <xsl:param name="rightEdge"/>
-    <xsl:variable name="cellBorders">
-      <xsl:call-template name="calculateTableBorders">
-        <xsl:with-param name="htmlStyles">
-          <xsl:value-of select="@iso:style"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:variable>
-    <xsl:variable name="tableBorders">
-      <xsl:call-template name="calculateTableBorders">
-        <xsl:with-param name="htmlStyles">
-          <xsl:value-of select="ancestor::cals:tgroup/@iso:style"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:variable>
-    <xsl:variable name="colname" select="@colname"/>
-    <w:tc>
-      <w:tcPr>
-        <xsl:if test="@namest">
-          <xsl:variable name="start">
-            <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
-              <xsl:choose>
-                <xsl:when test="@colnum">
-                  <xsl:value-of select="@colnum"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:number/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:for-each>
-          </xsl:variable>
-          <xsl:variable name="end">
-            <xsl:for-each select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@nameend]">
-              <xsl:choose>
-                <xsl:when test="@colnum">
-                  <xsl:value-of select="@colnum"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:number/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:for-each>
-          </xsl:variable>
-          <w:gridSpan w:val="{number($end)-number($start)+1}"/>
-        </xsl:if>
-        <xsl:if test="@morerows">
-          <w:vMerge w:val="restart"/>
-        </xsl:if>
-        <!--
-	    <xsl:message><xsl:value-of select="$colname"/>
-	    (<xsl:value-of select="."/>):    <xsl:value-of
-	    select="@rowsep"/> and <xsl:value-of
-	    select="parent::cals:row/preceding-sibling::cals:row[1]/cals:entry[@colname=$colname]/@rowsep"/></xsl:message>
-	    -->
-        <xsl:variable name="borders">
-          <!-- top border -->
-          <xsl:choose>
-            <xsl:when test="parent::cals:row/preceding-sibling::cals:row[1]/cals:entry[@colname=$colname]/@rowsep=0">
-              <w:top w:val="nil"/>
-            </xsl:when>
-            <xsl:when test="$topEdge='true'">
-              <!-- HERE -->
-              <xsl:if test="$tableBorders/w:top[@w:sz]">
-                <w:top w:val="single" w:sz="{$tableBorders/w:top/@w:sz}" w:space="0" w:color="auto"/>
-              </xsl:if>
-            </xsl:when>
-            <xsl:when test="@rowsep=0">
-              <w:top w:val="nil"/>
-            </xsl:when>
-            <xsl:when test="$cellBorders/w:top">
-              <xsl:copy-of select="$cellBorders/w:top"/>
-            </xsl:when>
-          </xsl:choose>
-          <!-- left border -->
-          <xsl:choose>
-            <xsl:when test="$leftEdge='true'">
-              <xsl:if test="$tableBorders/w:left[@w:sz]">
-                <w:left w:val="single" w:sz="{$tableBorders/w:left/@w:sz}" w:space="0" w:color="auto"/>
-              </xsl:if>
-            </xsl:when>
-            <xsl:when test="$cellBorders/w:left">
-              <xsl:copy-of select="$cellBorders/w:left"/>
-            </xsl:when>
-          </xsl:choose>
-          <!-- bottom border -->
-          <xsl:choose>
-            <xsl:when test="$bottomEdge='true'">
-              <xsl:if test="$tableBorders/w:bottom[@w:sz]">
-                <w:bottom w:val="single" w:sz="{$tableBorders/w:bottom/@w:sz}" w:space="0" w:color="auto"/>
-              </xsl:if>
-            </xsl:when>
-            <xsl:when test="@rowsep=0 or parent::cals:row/@rowsep=0">
-              <w:bottom w:val="nil"/>
-            </xsl:when>
-            <xsl:when test="@rowsep=1 or parent::cals:row/@rowsep=1">
-              <xsl:choose>
-                <xsl:when test="$cellBorders/w:bottom">
-                  <xsl:copy-of select="$cellBorders/w:bottom"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:bottom w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:when>
-          </xsl:choose>
-          <!-- right border -->
-          <xsl:choose>
-            <xsl:when test="following-sibling::cals:entry[1]/@colsep=0">
-              <w:right w:val="nil"/>
-            </xsl:when>
-            <xsl:when test="$rightEdge='true'">
-              <xsl:if test="$tableBorders/w:right[@w:sz]">
-                <w:right w:val="single" w:sz="{$tableBorders/w:right/@w:sz}" w:space="0" w:color="auto"/>
-              </xsl:if>
-            </xsl:when>
-            <xsl:when test="@colsep=0">
-              <w:right w:val="nil"/>
-            </xsl:when>
-            <xsl:when test="@colsep=1">
-              <xsl:choose>
-                <xsl:when test="$cellBorders/w:right">
-                  <xsl:copy-of select="$cellBorders/w:right"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:when>
-          </xsl:choose>
-        </xsl:variable>
-        <xsl:if test="$borders/*">
-          <w:tcBorders>
-            <xsl:copy-of select="$borders/w:top"/>
-            <xsl:copy-of select="$borders/w:left"/>
-            <xsl:copy-of select="$borders/w:bottom"/>
-            <xsl:copy-of select="$borders/w:right"/>
-          </w:tcBorders>
-        </xsl:if>
-        <xsl:if test="@rotate='1'">
-          <w:textDirection w:val="btLr"/>
-        </xsl:if>
-        <xsl:if test="@valign">
-          <w:vAlign>
-            <xsl:attribute name="w:val">
+				<xsl:copy-of select="@*" />
+				<xsl:copy-of select="cals:colspec" />
+				<xsl:for-each select="cals:tbody|cals:thead">
+					<xsl:copy>
+						<xsl:for-each select="cals:row">
+							<xsl:copy>
+								<xsl:copy-of select="@*" />
+								<xsl:for-each select="cals:entry">
+									<xsl:copy>
+										<xsl:copy-of select="@*" />
+										<xsl:apply-templates mode="contents"
+											select="." />
+									</xsl:copy>
+									<xsl:variable name="rows" select="@rowsep" />
+									<xsl:variable name="cols" select="@colsep" />
+									<xsl:choose>
+										<xsl:when
+											test="@namest and ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
+											<xsl:variable name="start">
+												<xsl:for-each
+													select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
+													<xsl:choose>
+														<xsl:when test="@colnum">
+															<xsl:value-of select="@colnum" />
+														</xsl:when>
+														<xsl:otherwise>
+															<xsl:number />
+														</xsl:otherwise>
+													</xsl:choose>
+												</xsl:for-each>
+											</xsl:variable>
+											<xsl:variable name="end">
+												<xsl:for-each
+													select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@nameend]">
+													<xsl:choose>
+														<xsl:when test="@colnum">
+															<xsl:value-of select="@colnum" />
+														</xsl:when>
+														<xsl:otherwise>
+															<xsl:number />
+														</xsl:otherwise>
+													</xsl:choose>
+												</xsl:for-each>
+											</xsl:variable>
+											<xsl:for-each
+												select="ancestor::cals:tgroup/cals:colspec[position()&gt;$start and position()&lt;=$end]">
+												<cals:entry DUMMY="true" colname="{@colname}"
+													colsep="{$cols}" rowsep="{$rows}" />
+											</xsl:for-each>
+										</xsl:when>
+										<xsl:when test="@namest">
+											<xsl:message terminate="yes">
+												ERROR Column
+												<xsl:value-of select="@namest" />
+												<xsl:text> referenced with @namest attribute </xsl:text>
+												<xsl:text>is not named in the list of  &lt;colspec&gt; elements for this table</xsl:text>
+											</xsl:message>
+										</xsl:when>
+									</xsl:choose>
+								</xsl:for-each>
+							</xsl:copy>
+						</xsl:for-each>
+					</xsl:copy>
+				</xsl:for-each>
+			</xsl:copy>
+		</xsl:variable>
+		<!-- <xsl:variable name="count"> <xsl:number level="any"/> </xsl:variable> 
+			<xsl:result-document indent="yes" href="/tmp/T{$count}.xml"> <xsl:copy-of 
+			select="$TABLE"/> </xsl:result-document> -->
+		<xsl:for-each select="$TABLE/cals:tgroup">
+			<xsl:apply-templates />
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template match="cals:row">
+		<xsl:variable name="borders">
+			<xsl:if
+				test="@colsep='1' or (not(@colsep ='0') and ancestor::cals:tgroup/@colsep='1')">
+				<w:left w:val="single" w:sz="1" />
+			</xsl:if>
+		</xsl:variable>
+		<xsl:variable name="ROWPOS">
+			<xsl:number />
+		</xsl:variable>
+		<xsl:variable name="TEMPLATE">
+			<xsl:for-each
+				select="ancestor::cals:tgroup/cals:colspec">
+				<CELL name="{@colname}" num="{@colnum}" rowpos="{$ROWPOS}" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:variable name="lastColnum">
+			<xsl:value-of
+				select="ancestor::cals:tgroup/cals:colspec[last()]/@colnum" />
+		</xsl:variable>
+		<xsl:variable name="lastColname">
+			<xsl:value-of
+				select="ancestor::cals:tgroup/cals:colspec[last()]/@colname" />
+		</xsl:variable>
+		<xsl:variable name="ME" select="." />
+		<xsl:variable name="topEdge">
+			<xsl:choose>
+				<xsl:when test="parent::cals:tbody">
+					<xsl:if
+						test="not(parent::cals:tbody/preceding-sibling::cals:thead/cals:row)">
+						true
+					</xsl:if>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:if test="not(preceding-sibling::cals:row)">
+						true
+					</xsl:if>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="bottomEdge">
+			<xsl:choose>
+				<xsl:when test="parent::cals:thead">
+					<xsl:if
+						test="not(parent::cals:thead/following-sibling::cals:tbody/cals:row)">
+						true
+					</xsl:if>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:if test="not(following-sibling::cals:row)">
+						true
+					</xsl:if>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<w:tr>
+			<w:tblPrEx>
+				<w:tblLayout w:type="autofit" />
+			</w:tblPrEx>
+			<xsl:for-each select="$TEMPLATE/CELL">
+				<xsl:variable name="N" select="@name" />
+				<xsl:variable name="leftEdge">
+					<xsl:choose>
+						<xsl:when test="$N='c1' or $N='1'">
+							true
+						</xsl:when>
+						<xsl:when test="not(preceding-sibling::CELL)">
+							true
+						</xsl:when>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:variable name="rightEdge">
+					<xsl:choose>
+						<xsl:when test="not(following-sibling::CELL)">
+							true
+						</xsl:when>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when
+						test="$ME/cals:entry[@colname=$N and @DUMMY='true']" />
+					<xsl:when test="$ME/cals:entry[@colname=$N]">
+						<xsl:apply-templates
+							select="$ME/cals:entry[@colname=$N]">
+							<xsl:with-param name="topEdge" select="$topEdge" />
+							<xsl:with-param name="bottomEdge"
+								select="$bottomEdge" />
+							<xsl:with-param name="leftEdge" select="$leftEdge" />
+							<xsl:with-param name="rightEdge"
+								select="$rightEdge" />
+						</xsl:apply-templates>
+					</xsl:when>
+					<xsl:otherwise>
+						<w:tc>
+							<w:tcPr>
+								<w:vMerge />
+								<xsl:if test="$borders/w:left">
+									<w:tcBorders>
+										<xsl:copy-of select="$borders/w:left" />
+									</w:tcBorders>
+								</xsl:if>
+							</w:tcPr>
+							<w:p>
+							</w:p>
+						</w:tc>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</w:tr>
+	</xsl:template>
+	<xsl:template match="cals:entry">
+		<xsl:param name="topEdge" />
+		<xsl:param name="bottomEdge" />
+		<xsl:param name="leftEdge" />
+		<xsl:param name="rightEdge" />
+		<xsl:variable name="cellBorders">
+			<xsl:call-template name="calculateTableBorders">
+				<xsl:with-param name="htmlStyles">
+					<xsl:value-of select="@iso:style" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:variable name="tableBorders">
+			<xsl:call-template name="calculateTableBorders">
+				<xsl:with-param name="htmlStyles">
+					<xsl:value-of
+						select="ancestor::cals:tgroup/@iso:style" />
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:variable name="colname" select="@colname" />
+		<w:tc>
+			<w:tcPr>
+				<xsl:if test="@namest">
+					<xsl:variable name="start">
+						<xsl:for-each
+							select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@namest]">
+							<xsl:choose>
+								<xsl:when test="@colnum">
+									<xsl:value-of select="@colnum" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:number />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:variable name="end">
+						<xsl:for-each
+							select="ancestor::cals:tgroup/cals:colspec[@colname=current()/@nameend]">
+							<xsl:choose>
+								<xsl:when test="@colnum">
+									<xsl:value-of select="@colnum" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:number />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:for-each>
+					</xsl:variable>
+					<w:gridSpan w:val="{number($end)-number($start)+1}" />
+				</xsl:if>
+				<xsl:if test="@morerows">
+					<w:vMerge w:val="restart" />
+				</xsl:if>
+				<!-- <xsl:message><xsl:value-of select="$colname"/> (<xsl:value-of select="."/>): 
+					<xsl:value-of select="@rowsep"/> and <xsl:value-of select="parent::cals:row/preceding-sibling::cals:row[1]/cals:entry[@colname=$colname]/@rowsep"/></xsl:message> -->
+				<xsl:variable name="borders">
+					<!-- top border -->
+					<xsl:choose>
+						<xsl:when
+							test="parent::cals:row/preceding-sibling::cals:row[1]/cals:entry[@colname=$colname]/@rowsep=0">
+							<w:top w:val="nil" />
+						</xsl:when>
+						<xsl:when test="$topEdge='true'">
+							<!-- HERE -->
+							<xsl:if test="$tableBorders/w:top[@w:sz]">
+								<w:top w:val="single" w:sz="{$tableBorders/w:top/@w:sz}"
+									w:space="0" w:color="auto" />
+							</xsl:if>
+						</xsl:when>
+						<xsl:when test="@rowsep=0">
+							<w:top w:val="nil" />
+						</xsl:when>
+						<xsl:when test="$cellBorders/w:top">
+							<xsl:copy-of select="$cellBorders/w:top" />
+						</xsl:when>
+					</xsl:choose>
+					<!-- left border -->
+					<xsl:choose>
+						<xsl:when test="$leftEdge='true'">
+							<xsl:if test="$tableBorders/w:left[@w:sz]">
+								<w:left w:val="single"
+									w:sz="{$tableBorders/w:left/@w:sz}" w:space="0" w:color="auto" />
+							</xsl:if>
+						</xsl:when>
+						<xsl:when test="$cellBorders/w:left">
+							<xsl:copy-of select="$cellBorders/w:left" />
+						</xsl:when>
+					</xsl:choose>
+					<!-- bottom border -->
+					<xsl:choose>
+						<xsl:when test="$bottomEdge='true'">
+							<xsl:if test="$tableBorders/w:bottom[@w:sz]">
+								<w:bottom w:val="single"
+									w:sz="{$tableBorders/w:bottom/@w:sz}" w:space="0"
+									w:color="auto" />
+							</xsl:if>
+						</xsl:when>
+						<xsl:when test="@rowsep=0 or parent::cals:row/@rowsep=0">
+							<w:bottom w:val="nil" />
+						</xsl:when>
+						<xsl:when test="@rowsep=1 or parent::cals:row/@rowsep=1">
+							<xsl:choose>
+								<xsl:when test="$cellBorders/w:bottom">
+									<xsl:copy-of select="$cellBorders/w:bottom" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:bottom w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+					</xsl:choose>
+					<!-- right border -->
+					<xsl:choose>
+						<xsl:when
+							test="following-sibling::cals:entry[1]/@colsep=0">
+							<w:right w:val="nil" />
+						</xsl:when>
+						<xsl:when test="$rightEdge='true'">
+							<xsl:if test="$tableBorders/w:right[@w:sz]">
+								<w:right w:val="single"
+									w:sz="{$tableBorders/w:right/@w:sz}" w:space="0" w:color="auto" />
+							</xsl:if>
+						</xsl:when>
+						<xsl:when test="@colsep=0">
+							<w:right w:val="nil" />
+						</xsl:when>
+						<xsl:when test="@colsep=1">
+							<xsl:choose>
+								<xsl:when test="$cellBorders/w:right">
+									<xsl:copy-of select="$cellBorders/w:right" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:right w:val="single" w:sz="6" w:space="0"
+										w:color="auto" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:if test="$borders/*">
+					<w:tcBorders>
+						<xsl:copy-of select="$borders/w:top" />
+						<xsl:copy-of select="$borders/w:left" />
+						<xsl:copy-of select="$borders/w:bottom" />
+						<xsl:copy-of select="$borders/w:right" />
+					</w:tcBorders>
+				</xsl:if>
+				<xsl:if test="@rotate='1'">
+					<w:textDirection w:val="btLr" />
+				</xsl:if>
+				<xsl:if test="@valign">
+					<w:vAlign>
+						<xsl:attribute name="w:val">
               <xsl:attribute name="valign">
                 <xsl:choose>
                   <xsl:when test="@valign='middle'">center</xsl:when>
                   <xsl:otherwise>
-                    <xsl:value-of select="@valign"/>
+                    <xsl:value-of select="@valign" />
                   </xsl:otherwise>
                 </xsl:choose>
               </xsl:attribute>
             </xsl:attribute>
-          </w:vAlign>
-        </xsl:if>
-      </w:tcPr>
-      <xsl:copy-of select="*"/>
-    </w:tc>
-  </xsl:template>
-  <xsl:template match="cals:entry" mode="contents">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="pPr">
-        <w:pPr>
-          <xsl:choose>
-            <xsl:when test="@rend">
-              <xsl:variable name="sName">
-                <xsl:call-template name="getStyleName">
-                  <xsl:with-param name="in" select="@rend"/>
-                </xsl:call-template>
-              </xsl:variable>
-              <xsl:choose>
-                <xsl:when test="$sName=''">
-                  <w:pStyle w:val="{$TableText}"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <w:pStyle w:val="{$sName}"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-              <w:pStyle w:val="{$TableText}"/>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:choose>
-            <xsl:when test="@align">
-              <w:jc w:val="{@align}"/>
-            </xsl:when>
-            <xsl:when test="parent::tei:row[@role='label']    or @role='label'">
-              <w:jc w:val="left"/>
-            </xsl:when>
-            <xsl:when test="starts-with(.,'[0-9]')">
-              <w:jc w:val="right"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <w:jc w:val="left"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </w:pPr>
-      </xsl:with-param>
-      <xsl:with-param name="nop">
-        <xsl:choose>
-          <xsl:when test="not(text()) and tei:note[(not(@place))]">true</xsl:when>
-          <!--NEN: next when commented to make footnotes in table possible-->
-          <!--<xsl:when test="not(text()) and tei:note[@place='foot']">true</xsl:when>-->
-	    <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-      </xsl:with-param>
-    </xsl:call-template>
-    <!-- If we have no children, put an empty p here -->
-    <xsl:choose>
-      <xsl:when test="*"/>
-      <xsl:when test="text()"/>
-      <xsl:otherwise>
-        <w:p>
-          <w:pPr>
-            <w:pStyle w:val="Tabletext9"/>
-          </w:pPr>
-          <w:r>
-            <w:t/>
-          </w:r>
-        </w:p>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <!-- 
-	 Inline Templates:
-    -->
-  <xsl:template match="tei:g[@ref='x:tab']">
-    <w:r>
-      <w:tab/>
-    </w:r>
-  </xsl:template>
-  <xsl:template match="tei:c[@rend='ptab']">
-    <w:r>
-      <w:ptab w:relativeTo="margin" w:alignment="{@type}" w:leader="none"/>
-    </w:r>
-  </xsl:template>
-  <xsl:template match="tei:lb">
-    <w:r>
-      <w:br/>
-    </w:r>
-  </xsl:template>
-  <!-- hyperlink -->
-  <xsl:template match="tei:ptr">
-    <xsl:call-template name="linkMe">
-      <xsl:with-param name="anchor">
-        <xsl:choose>
-          <xsl:when test="@type='cit'">[</xsl:when>
-          <xsl:when test="@type='figure'">Figure </xsl:when>
-          <xsl:when test="@type='table'">Table </xsl:when>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="starts-with(@target,'#')  and id(substring(@target,2))">
-            <xsl:variable name="target" select="substring(@target,2)"/>
-            <xsl:apply-templates select="id($target)" mode="xref"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="@target"/>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="@type='cit'">]</xsl:when>
-        </xsl:choose>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:ref[@target]">
-    <xsl:choose>
-      <xsl:when test="starts-with(@target,'#') and id(substring(@target,2))">
-        <xsl:call-template name="linkMe">
-          <xsl:with-param name="anchor">
-            <xsl:apply-templates/>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="linkMeUsingHyperlink">
-    <xsl:param name="anchor"/>
-    <xsl:choose>
-      <xsl:when test="starts-with(@target,'#')">
-        <w:r>
-          <w:fldChar w:fldCharType="begin"/>
-        </w:r>
-        <w:r>
-          <w:instrText>HYPERLINK "<xsl:value-of select="@target"/>" \h</w:instrText>
-        </w:r>
-        <w:r>
-          <w:fldChar w:fldCharType="separate"/>
-        </w:r>
-        <w:r w:rsidR="00765EBE">
-          <w:rPr>
-            <w:rStyle w:val="Hyperlink"/>
-            <w:u w:val="none"/>
-            <xsl:if test="ancestor::tei:cell">
-              <w:sz w:val="18"/>
-            </xsl:if>
-          </w:rPr>
-          <w:t>
-            <xsl:copy-of select="$anchor"/>
-          </w:t>
-        </w:r>
-        <w:r>
-          <w:fldChar w:fldCharType="end"/>
-        </w:r>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="rid">
-          <xsl:text>rId</xsl:text>
-          <xsl:variable name="n">
-            <xsl:number level="any"/>
-          </xsl:variable>
-          <xsl:value-of select="$n + 3000"/>
-        </xsl:variable>
-        <w:hyperlink r:id="{$rid}">
-          <w:r>
-            <w:rPr>
-              <w:rStyle w:val="Hyperlink"/>
-            </w:rPr>
-            <w:t>
-              <xsl:copy-of select="$anchor"/>
-            </w:t>
-          </w:r>
-        </w:hyperlink>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="linkMe">
-    <xsl:param name="anchor"/>
-    <!-- create the field codes for the complex field -->
-    <!-- based on information in tei:ref/@tei:rend -->
-    <xsl:variable name="instrText">
-      <xsl:choose>
-        <xsl:when test="starts-with(@target,'#')">
-          <xsl:variable name="target" select="substring(@target,2)"/>
-          <xsl:variable name="rend" select="@rend"/>
-          <xsl:choose>
-            <xsl:when test="contains($rend,'noteref')">
-              <xsl:text>NOTEREF </xsl:text>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:text>REF </xsl:text>
-            </xsl:otherwise>
-          </xsl:choose>
-          <xsl:value-of select="$target"/>
-          <xsl:for-each select="id($target)">
-            <xsl:choose>
-              <xsl:when test="contains($rend,'instr_')">
-                <xsl:if test="contains($rend,'instr_f')">
-                  <xsl:text> \f</xsl:text>
-                </xsl:if>
-                <xsl:if test="contains($rend,'instr_r')">
-                  <xsl:text> \r</xsl:text>
-                </xsl:if>
-                <xsl:if test="contains($rend,'instr_n')">
-                  <xsl:text> \n</xsl:text>
-                </xsl:if>
-              </xsl:when>
-              <xsl:when test="@type='refdoc'"/>
-              <xsl:otherwise>
-                <xsl:text> \n</xsl:text>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:for-each>
-          <xsl:text> \h</xsl:text>
-          <xsl:if test="contains(@rend,'mergeformat')">
-            <xsl:text> \* MERGEFORMAT</xsl:text>
-          </xsl:if>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:text>HYPERLINK "</xsl:text>
-          <xsl:value-of select="@target"/>
-          <xsl:text>" \h</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <w:r>
-      <w:fldChar w:fldCharType="begin"/>
-    </w:r>
-    <w:r>
-      <w:instrText>
-        <xsl:value-of select="$instrText"/>
-      </w:instrText>
-    </w:r>
-    <w:r>
-      <w:fldChar w:fldCharType="separate"/>
-    </w:r>
-    <w:r>
-      <xsl:variable name="rPr">
-        <xsl:apply-templates>
-          <xsl:with-param name="character-style" select="@iso:class"/>
-        </xsl:apply-templates>
-      </xsl:variable>
-      <w:rPr>
-        <xsl:if test="$rPr/w:r/w:rPr/w:rStyle/@w:val">
-          <w:rStyle w:val="{$rPr/w:r/w:rPr/w:rStyle/@w:val}"/>
-        </xsl:if>
-        <xsl:copy-of select="$anchor/w:r/w:rPr/*[not(self::w:rStyle)]"/>
-        <!-- oucs0037: why are we overriding special font styles??
-	       Comment this out for now! -->
-        <!--	  <xsl:if test="ancestor::tei:p[@rend='Special']">
-	    <w:rFonts w:ascii="Courier New" w:hAnsi="Courier New"/>
-	  </xsl:if> -->
-        <xsl:if test="$rPr/w:r/w:rPr/w:rStyle/@w:val='Hyperlink'">
-          <w:u w:val="none"/>
-        </xsl:if>
-      </w:rPr>
-      <xsl:choose>
-        <xsl:when test="$anchor/w:r">
-          <xsl:copy-of select="$anchor/w:r/w:t"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <w:t>
-            <xsl:copy-of select="$anchor"/>
-          </w:t>
-        </xsl:otherwise>
-      </xsl:choose>
-    </w:r>
-    <w:r>
-      <w:fldChar w:fldCharType="end"/>
-    </w:r>
-  </xsl:template>
-  <xsl:template match="tei:bibl|tei:biblStruct" mode="xref">
-    <xsl:number/>
-  </xsl:template>
-  <xsl:template match="tei:note|tei:figure|tei:table|tei:item" mode="xref">
-    <xsl:number/>
-  </xsl:template>
-  <xsl:template match="tei:div" mode="xref">
-    <xsl:choose>
-      <xsl:when test="ancestor::tei:front">
-        <xsl:number count="tei:div" from="tei:front" format="i" level="multiple"/>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:body">
-        <xsl:number count="tei:div" from="tei:body" format="1" level="multiple"/>
-      </xsl:when>
-      <xsl:when test="ancestor::tei:back">
-	   Annex <xsl:number count="tei:div" from="tei:back" format="A.1.1" level="multiple"/>
-         </xsl:when>
-    </xsl:choose>
-  </xsl:template>
-  <!-- 
-       §< Handle elements from different namespaces, such as wordML, wordMathML, MathML ...
-        -->
-  <xsl:template match="w:drawing">
-    <w:r>
-      <xsl:apply-templates select="." mode="iden"/>
-    </w:r>
-  </xsl:template>
-  <xsl:template match="iso:wordObject">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="w:*">
-    <xsl:if test="ancestor::w:tbl">
-      <xsl:copy>
-        <xsl:copy-of select="@*"/>
-        <xsl:apply-templates/>
-      </xsl:copy>
-    </xsl:if>
-  </xsl:template>
-  <xsl:template match="tei:titlePage">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template match="tei:docTitle/tei:titlePart[@type='main']">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">Title</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:docTitle/tei:titlePart[not(@type)]">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">Title</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:titlePage/tei:titlePart">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">Title</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:docTitle/tei:titlePart[@type='sub']">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">Subtitle</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:docTitle/tei:titlePart[2]" priority="99">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">Subtitle</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:titlePage/tei:docAuthor" priority="99">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">Author</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:titlePage/tei:byline" priority="99">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">Author</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <xsl:template match="tei:titlePage/tei:docDate" priority="99">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">Docdate</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <!-- place holders, used by ISO profile -->
-  <xsl:template name="getStyleFonts">
-    <xsl:param name="css"/>
-  </xsl:template>
-  <!-- no handling of index terms -->
-  <xsl:template match="tei:index"/>
-  <xsl:template name="applyRendition"/>
-  <xsl:template name="emphasize">
-    <xsl:param name="class"/>
-    <xsl:param name="content"/>
-    <w:r>
-      <xsl:choose>
-        <xsl:when test="$class='titlem'">
-          <w:rPr>
-            <w:i/>
-          </w:rPr>
-        </xsl:when>
-        <xsl:when test="$class='titlej'">
-          <w:rPr>
-            <w:i/>
-          </w:rPr>
-        </xsl:when>
-      </xsl:choose>
-      <w:t>
-        <xsl:attribute name="xml:space">preserve</xsl:attribute>
-        <xsl:choose>
-          <xsl:when test="$class='titles'">
-            <xsl:text>, </xsl:text>
-          </xsl:when>
-          <xsl:when test="$class='titleu'">
-            <xsl:text>‘</xsl:text>
-          </xsl:when>
-          <xsl:when test="$class='titlea'">
-            <xsl:text>‘</xsl:text>
-          </xsl:when>
-        </xsl:choose>
-        <xsl:value-of select="$content"/>
-        <xsl:choose>
-          <xsl:when test="$class='titleu'">
-            <xsl:text>’</xsl:text>
-          </xsl:when>
-          <xsl:when test="$class='titlea'">
-            <xsl:text>’</xsl:text>
-          </xsl:when>
-        </xsl:choose>
-      </w:t>
-    </w:r>
-  </xsl:template>
-  <!-- List Bibl -->
-  <xsl:template match="tei:listBibl">
-    <xsl:for-each select="tei:bibl|tei:biblStruct">
-      <xsl:choose>
-        <xsl:when test="@xml:id">
-          <xsl:variable name="number">
-            <xsl:number level="any"/>
-          </xsl:variable>
-          <xsl:call-template name="block-element">
-            <xsl:with-param name="style">Bibliography</xsl:with-param>
-            <xsl:with-param name="bookmark-id">
-              <xsl:value-of select="9000+$number"/>
-            </xsl:with-param>
-            <xsl:with-param name="bookmark-name">
-              <xsl:value-of select="@xml:id"/>
-            </xsl:with-param>
-          </xsl:call-template>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:call-template name="block-element">
-            <xsl:with-param name="style">Bibliography</xsl:with-param>
-          </xsl:call-template>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="tei:makeText">
-    <xsl:param name="letters"/>
-    <w:r>
-      <w:t>
-        <xsl:attribute name="xml:space">preserve</xsl:attribute>
-        <xsl:value-of select="$letters"/>
-      </w:t>
-    </w:r>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-	Page break
-      </desc>
-  </doc>
-  <xsl:template match="tei:pb">
-    <w:r>
-      <w:br w:type="page"/>
-    </w:r>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-        A signature block
-    </desc>
-  </doc>
-  <xsl:template match="tei:signed">
-    <xsl:call-template name="block-element">
-      <xsl:with-param name="style">teisigned</xsl:with-param>
-    </xsl:call-template>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>
-	If you meet an inline element with a link inside it, pass by
-	on the other side
-      </desc>
-  </doc>
-  <xsl:template match="tei:title[tei:ref]|tei:hi[tei:ref]" priority="-1">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template name="makeSpan">
-    <xsl:apply-templates/>
-  </xsl:template>
-  <xsl:template name="makeExternalLink">
-    <xsl:param name="ptr" as="xs:boolean" select="false()"/>
-    <xsl:param name="dest"/>
-    <xsl:value-of select="$dest"/>
-  </xsl:template>
+					</w:vAlign>
+				</xsl:if>
+			</w:tcPr>
+			<xsl:copy-of select="*" />
+		</w:tc>
+	</xsl:template>
+	<xsl:template match="cals:entry" mode="contents">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="pPr">
+				<w:pPr>
+					<xsl:choose>
+						<xsl:when test="@rend">
+							<xsl:variable name="sName">
+								<xsl:call-template name="getStyleName">
+									<xsl:with-param name="in" select="@rend" />
+								</xsl:call-template>
+							</xsl:variable>
+							<xsl:choose>
+								<xsl:when test="$sName=''">
+									<w:pStyle w:val="{$TableText}" />
+								</xsl:when>
+								<xsl:otherwise>
+									<w:pStyle w:val="{$sName}" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:otherwise>
+							<w:pStyle w:val="{$TableText}" />
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:choose>
+						<xsl:when test="@align">
+							<w:jc w:val="{@align}" />
+						</xsl:when>
+						<xsl:when
+							test="parent::tei:row[@role='label']    or @role='label'">
+							<w:jc w:val="left" />
+						</xsl:when>
+						<xsl:when test="starts-with(.,'[0-9]')">
+							<w:jc w:val="right" />
+						</xsl:when>
+						<xsl:otherwise>
+							<w:jc w:val="left" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</w:pPr>
+			</xsl:with-param>
+			<xsl:with-param name="nop">
+				<xsl:choose>
+					<xsl:when test="not(text()) and tei:note[(not(@place))]">
+						true
+					</xsl:when>
+					<!--NEN: next when commented to make footnotes in table possible -->
+					<!--<xsl:when test="not(text()) and tei:note[@place='foot']">true</xsl:when> -->
+					<xsl:otherwise>
+						false
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:with-param>
+		</xsl:call-template>
+		<!-- If we have no children, put an empty p here -->
+		<xsl:choose>
+			<xsl:when test="*" />
+			<xsl:when test="text()" />
+			<xsl:otherwise>
+				<w:p>
+					<w:pPr>
+						<w:pStyle w:val="Tabletext9" />
+					</w:pPr>
+					<w:r>
+						<w:t />
+					</w:r>
+				</w:p>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- Inline Templates: -->
+	<xsl:template match="tei:g[@ref='x:tab']">
+		<w:r>
+			<w:tab />
+		</w:r>
+	</xsl:template>
+	<xsl:template match="tei:c[@rend='ptab']">
+		<w:r>
+			<w:ptab w:relativeTo="margin" w:alignment="{@type}"
+				w:leader="none" />
+		</w:r>
+	</xsl:template>
+	<xsl:template match="tei:lb">
+		<w:r>
+			<w:br />
+		</w:r>
+	</xsl:template>
+	<!-- hyperlink -->
+	<xsl:template match="tei:ptr">
+		<xsl:call-template name="linkMe">
+			<xsl:with-param name="anchor">
+				<xsl:choose>
+					<xsl:when test="@type='cit'">
+						[
+					</xsl:when>
+					<xsl:when test="@type='figure'">
+						Figure
+					</xsl:when>
+					<xsl:when test="@type='table'">
+						Table
+					</xsl:when>
+				</xsl:choose>
+				<xsl:choose>
+					<xsl:when
+						test="starts-with(@target,'#')  and id(substring(@target,2))">
+						<xsl:variable name="target"
+							select="substring(@target,2)" />
+						<xsl:apply-templates select="id($target)"
+							mode="xref" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="@target" />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:choose>
+					<xsl:when test="@type='cit'">
+						]
+					</xsl:when>
+				</xsl:choose>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:ref[@target]">
+		<xsl:choose>
+			<xsl:when
+				test="starts-with(@target,'#') and id(substring(@target,2))">
+				<xsl:call-template name="linkMe">
+					<xsl:with-param name="anchor">
+						<xsl:apply-templates />
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="linkMeUsingHyperlink">
+		<xsl:param name="anchor" />
+		<xsl:choose>
+			<xsl:when test="starts-with(@target,'#')">
+				<w:r>
+					<w:fldChar w:fldCharType="begin" />
+				</w:r>
+				<w:r>
+					<w:instrText>
+						HYPERLINK "
+						<xsl:value-of select="@target" />
+						" \h
+					</w:instrText>
+				</w:r>
+				<w:r>
+					<w:fldChar w:fldCharType="separate" />
+				</w:r>
+				<w:r w:rsidR="00765EBE">
+					<w:rPr>
+						<w:rStyle w:val="Hyperlink" />
+						<w:u w:val="none" />
+						<xsl:if test="ancestor::tei:cell">
+							<w:sz w:val="18" />
+						</xsl:if>
+					</w:rPr>
+					<w:t>
+						<xsl:copy-of select="$anchor" />
+					</w:t>
+				</w:r>
+				<w:r>
+					<w:fldChar w:fldCharType="end" />
+				</w:r>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="rid">
+					<xsl:text>rId</xsl:text>
+					<xsl:variable name="n">
+						<xsl:number level="any" />
+					</xsl:variable>
+					<xsl:value-of select="$n + 3000" />
+				</xsl:variable>
+				<w:hyperlink r:id="{$rid}">
+					<w:r>
+						<w:rPr>
+							<w:rStyle w:val="Hyperlink" />
+						</w:rPr>
+						<w:t>
+							<xsl:copy-of select="$anchor" />
+						</w:t>
+					</w:r>
+				</w:hyperlink>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="linkMe">
+		<xsl:param name="anchor" />
+		<!-- create the field codes for the complex field -->
+		<!-- based on information in tei:ref/@tei:rend -->
+		<xsl:variable name="instrText">
+			<xsl:choose>
+				<xsl:when test="starts-with(@target,'#')">
+					<xsl:variable name="target"
+						select="substring(@target,2)" />
+					<xsl:variable name="rend" select="@rend" />
+					<xsl:choose>
+						<xsl:when test="contains($rend,'noteref')">
+							<xsl:text>NOTEREF </xsl:text>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:text>REF </xsl:text>
+						</xsl:otherwise>
+					</xsl:choose>
+					<xsl:value-of select="$target" />
+					<xsl:for-each select="id($target)">
+						<xsl:choose>
+							<xsl:when test="contains($rend,'instr_')">
+								<xsl:if test="contains($rend,'instr_f')">
+									<xsl:text> \f</xsl:text>
+								</xsl:if>
+								<xsl:if test="contains($rend,'instr_r')">
+									<xsl:text> \r</xsl:text>
+								</xsl:if>
+								<xsl:if test="contains($rend,'instr_n')">
+									<xsl:text> \n</xsl:text>
+								</xsl:if>
+							</xsl:when>
+							<xsl:when test="@type='refdoc'" />
+							<xsl:otherwise>
+								<xsl:text> \n</xsl:text>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each>
+					<xsl:text> \h</xsl:text>
+					<xsl:if test="contains(@rend,'mergeformat')">
+						<xsl:text> \* MERGEFORMAT</xsl:text>
+					</xsl:if>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>HYPERLINK "</xsl:text>
+					<xsl:value-of select="@target" />
+					<xsl:text>" \h</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<w:r>
+			<w:fldChar w:fldCharType="begin" />
+		</w:r>
+		<w:r>
+			<w:instrText>
+				<xsl:value-of select="$instrText" />
+			</w:instrText>
+		</w:r>
+		<w:r>
+			<w:fldChar w:fldCharType="separate" />
+		</w:r>
+		<w:r>
+			<xsl:variable name="rPr">
+				<xsl:apply-templates>
+					<xsl:with-param name="character-style"
+						select="@iso:class" />
+				</xsl:apply-templates>
+			</xsl:variable>
+			<w:rPr>
+				<xsl:if test="$rPr/w:r/w:rPr/w:rStyle/@w:val">
+					<w:rStyle w:val="{$rPr/w:r/w:rPr/w:rStyle/@w:val}" />
+				</xsl:if>
+				<xsl:copy-of
+					select="$anchor/w:r/w:rPr/*[not(self::w:rStyle)]" />
+				<!-- oucs0037: why are we overriding special font styles?? Comment this 
+					out for now! -->
+				<!-- <xsl:if test="ancestor::tei:p[@rend='Special']"> <w:rFonts w:ascii="Courier 
+					New" w:hAnsi="Courier New"/> </xsl:if> -->
+				<xsl:if test="$rPr/w:r/w:rPr/w:rStyle/@w:val='Hyperlink'">
+					<w:u w:val="none" />
+				</xsl:if>
+			</w:rPr>
+			<xsl:choose>
+				<xsl:when test="$anchor/w:r">
+					<xsl:copy-of select="$anchor/w:r/w:t" />
+				</xsl:when>
+				<xsl:otherwise>
+					<w:t>
+						<xsl:copy-of select="$anchor" />
+					</w:t>
+				</xsl:otherwise>
+			</xsl:choose>
+		</w:r>
+		<w:r>
+			<w:fldChar w:fldCharType="end" />
+		</w:r>
+	</xsl:template>
+	<xsl:template match="tei:bibl|tei:biblStruct" mode="xref">
+		<xsl:number />
+	</xsl:template>
+	<xsl:template
+		match="tei:note|tei:figure|tei:table|tei:item" mode="xref">
+		<xsl:number />
+	</xsl:template>
+	<xsl:template match="tei:div" mode="xref">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:front">
+				<xsl:number count="tei:div" from="tei:front" format="i"
+					level="multiple" />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:body">
+				<xsl:number count="tei:div" from="tei:body" format="1"
+					level="multiple" />
+			</xsl:when>
+			<xsl:when test="ancestor::tei:back">
+				Annex
+				<xsl:number count="tei:div" from="tei:back"
+					format="A.1.1" level="multiple" />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<!-- §< Handle elements from different namespaces, such as wordML, wordMathML, 
+		MathML ... -->
+	<xsl:template match="w:drawing">
+		<w:r>
+			<xsl:apply-templates select="." mode="iden" />
+		</w:r>
+	</xsl:template>
+	<xsl:template match="iso:wordObject">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="w:*">
+		<xsl:if test="ancestor::w:tbl">
+			<xsl:copy>
+				<xsl:copy-of select="@*" />
+				<xsl:apply-templates />
+			</xsl:copy>
+		</xsl:if>
+	</xsl:template>
+	<xsl:template match="tei:titlePage">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template
+		match="tei:docTitle/tei:titlePart[@type='main']">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				Title
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template
+		match="tei:docTitle/tei:titlePart[not(@type)]">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				Title
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:titlePage/tei:titlePart">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				Title
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template
+		match="tei:docTitle/tei:titlePart[@type='sub']">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				Subtitle
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:docTitle/tei:titlePart[2]"
+		priority="99">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				Subtitle
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:titlePage/tei:docAuthor"
+		priority="99">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				Author
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:titlePage/tei:byline"
+		priority="99">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				Author
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="tei:titlePage/tei:docDate"
+		priority="99">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				Docdate
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<!-- place holders, used by ISO profile -->
+	<xsl:template name="getStyleFonts">
+		<xsl:param name="css" />
+	</xsl:template>
+	<!-- no handling of index terms -->
+	<xsl:template match="tei:index" />
+	<xsl:template name="applyRendition" />
+	<xsl:template name="emphasize">
+		<xsl:param name="class" />
+		<xsl:param name="content" />
+		<w:r>
+			<xsl:choose>
+				<xsl:when test="$class='titlem'">
+					<w:rPr>
+						<w:i />
+					</w:rPr>
+				</xsl:when>
+				<xsl:when test="$class='titlej'">
+					<w:rPr>
+						<w:i />
+					</w:rPr>
+				</xsl:when>
+			</xsl:choose>
+			<w:t>
+				<xsl:attribute name="xml:space">preserve</xsl:attribute>
+				<xsl:choose>
+					<xsl:when test="$class='titles'">
+						<xsl:text>, </xsl:text>
+					</xsl:when>
+					<xsl:when test="$class='titleu'">
+						<xsl:text>‘</xsl:text>
+					</xsl:when>
+					<xsl:when test="$class='titlea'">
+						<xsl:text>‘</xsl:text>
+					</xsl:when>
+				</xsl:choose>
+				<xsl:value-of select="$content" />
+				<xsl:choose>
+					<xsl:when test="$class='titleu'">
+						<xsl:text>’</xsl:text>
+					</xsl:when>
+					<xsl:when test="$class='titlea'">
+						<xsl:text>’</xsl:text>
+					</xsl:when>
+				</xsl:choose>
+			</w:t>
+		</w:r>
+	</xsl:template>
+	<!-- List Bibl -->
+	<xsl:template match="tei:listBibl">
+		<xsl:for-each select="tei:bibl|tei:biblStruct">
+			<xsl:choose>
+				<xsl:when test="@xml:id">
+					<xsl:variable name="number">
+						<xsl:number level="any" />
+					</xsl:variable>
+					<xsl:call-template name="block-element">
+						<xsl:with-param name="style">
+							Bibliography
+						</xsl:with-param>
+						<xsl:with-param name="bookmark-id">
+							<xsl:value-of select="9000+$number" />
+						</xsl:with-param>
+						<xsl:with-param name="bookmark-name">
+							<xsl:value-of select="@xml:id" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="block-element">
+						<xsl:with-param name="style">
+							Bibliography
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="tei:makeText">
+		<xsl:param name="letters" />
+		<w:r>
+			<w:t>
+				<xsl:attribute name="xml:space">preserve</xsl:attribute>
+				<xsl:value-of select="$letters" />
+			</w:t>
+		</w:r>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Page break
+		</desc>
+	</doc>
+	<xsl:template match="tei:pb">
+		<w:r>
+			<w:br w:type="page" />
+		</w:r>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			A signature block
+		</desc>
+	</doc>
+	<xsl:template match="tei:signed">
+		<xsl:call-template name="block-element">
+			<xsl:with-param name="style">
+				teisigned
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			If you meet an inline element with a link inside it, pass by
+			on the other side
+		</desc>
+	</doc>
+	<xsl:template match="tei:title[tei:ref]|tei:hi[tei:ref]"
+		priority="-1">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template name="makeSpan">
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template name="makeExternalLink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="dest" />
+		<xsl:value-of select="$dest" />
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/odds/tagdocs.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/odds/tagdocs.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/odds/tagdocs.xsl	(revision 2397)
@@ -1,52 +1,52 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-   <xsl:template match="tei:seg[@rend='specChildModule']">
-    <w:r>
-      <w:rPr>
-        <w:rStyle w:val="tei{local-name()}"/>
-	<w:b/>
-      </w:rPr>
-      <w:t>
-	<xsl:attribute name="xml:space">preserve</xsl:attribute>
-	<xsl:text> </xsl:text>
-      </w:t>
-      <w:t>
-	<xsl:attribute name="xml:space">preserve</xsl:attribute>
-	<xsl:value-of select="."/>
-      </w:t>
-    </w:r>
-   </xsl:template>
 
+	<xsl:template match="tei:seg[@rend='specChildModule']">
+		<w:r>
+			<w:rPr>
+				<w:rStyle w:val="tei{local-name()}" />
+				<w:b />
+			</w:rPr>
+			<w:t>
+				<xsl:attribute name="xml:space">preserve</xsl:attribute>
+				<xsl:text> </xsl:text>
+			</w:t>
+			<w:t>
+				<xsl:attribute name="xml:space">preserve</xsl:attribute>
+				<xsl:value-of select="." />
+			</w:t>
+		</w:r>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/placeholders.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/placeholders.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/to/placeholders.xsl	(revision 2397)
@@ -1,205 +1,223 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
-    
-       <xsl:import href="../../common2/header.xsl"/>
-       <xsl:import href="../../common2/i18n.xsl"/>
+<xsl:stylesheet
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:contypes="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for making Word docx files from TEI XML </p>
-         <p>This software is dual-licensed:
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="cp ve o r m v wp w10 w wne mml tbx iso      tei a xs pic fn xsi dc dcterms dcmitype     contypes teidocx teix html cals">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:import href="../../common2/header.xsl" />
+	<xsl:import href="../../common2/i18n.xsl" />
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for making Word docx files from TEI XML </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: placeholders.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        A callback for any titlepages that belong to the front matter.
-    </desc>
-   </doc>
-    <xsl:template name="titlepages">
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-	Title of document        
-    </desc>
-   </doc>
-    <xsl:template name="document-title">
-        <xsl:choose>
-            <xsl:when test="/tei:TEI/tei:text/tei:front/tei:titlePage"/>
-            <xsl:when test="/tei:TEI/tei:text/tei:front/tei:docTitle"/>
-            <xsl:when
-		test="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='main']">
-                <xsl:for-each select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='main']">
-                    <xsl:call-template name="block-element">
-                        <xsl:with-param name="style">GeneratedTitle</xsl:with-param>
-                    </xsl:call-template>
-                </xsl:for-each>
-                <xsl:for-each select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='sub']">
-                    <xsl:call-template name="block-element">
-                        <xsl:with-param name="style">GeneratedSubtitle</xsl:with-param>
-                    </xsl:call-template>
-                </xsl:for-each>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:for-each select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title">
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: placeholders.xsl 9669 2011-11-07 19:17:54Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			A callback for any titlepages that belong to the front matter.
+		</desc>
+	</doc>
+	<xsl:template name="titlepages">
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Title of document
+		</desc>
+	</doc>
+	<xsl:template name="document-title">
+		<xsl:choose>
+			<xsl:when test="/tei:TEI/tei:text/tei:front/tei:titlePage" />
+			<xsl:when test="/tei:TEI/tei:text/tei:front/tei:docTitle" />
+			<xsl:when
+				test="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='main']">
+				<xsl:for-each
+					select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='main']">
+					<xsl:call-template name="block-element">
+						<xsl:with-param name="style">
+							GeneratedTitle
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+				<xsl:for-each
+					select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='sub']">
+					<xsl:call-template name="block-element">
+						<xsl:with-param name="style">
+							GeneratedSubtitle
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each
+					select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title">
+					<xsl:call-template name="block-element">
+						<xsl:with-param name="style">
+							GeneratedTitle
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<xsl:template name="created-by" />
+	<xsl:template name="headerParts" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			Template for all simple block elements.
+			This template looks for a style definition template (mode="get-style")
+			that
+			matches the block element that is currently processed. If none is specified
+			it copies the style definition from the parent element.
+
+			If some special rendering is required you should overwrite this
+			template.
+
+		</desc>
+	</doc>
+	<xsl:template match="*[not(tei:is-inline(.))]"
+		priority="-10">
+		<xsl:param name="style" />
+		<xsl:param name="pPr" />
+		<xsl:param name="nop" />
+		<!-- calculate style definition -->
+		<xsl:variable name="newStyle">
+			<xsl:apply-templates select="." mode="get-style" />
+		</xsl:variable>
+		<xsl:variable name="styleToPassOn">
+			<xsl:choose>
+				<xsl:when test="string-length($newStyle) &gt; 0">
+					<xsl:value-of select="$newStyle" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$style" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+
+		<!-- process children -->
 		<xsl:call-template name="block-element">
-		  <xsl:with-param name="style">GeneratedTitle</xsl:with-param>
+			<xsl:with-param name="style" select="$styleToPassOn" />
+			<xsl:with-param name="pPr" select="$pPr" />
+			<xsl:with-param name="nop" select="$nop" />
 		</xsl:call-template>
-	      </xsl:for-each>
-	    </xsl:otherwise>  
-        </xsl:choose>
-    </xsl:template>
-    
-    
-    <xsl:template name="created-by"/>
-    <xsl:template name="headerParts"/>
+	</xsl:template>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        
-        Template for all simple block elements.
-        This template looks for a style definition template (mode="get-style") that
-        matches the block element that is currently processed. If none is specified
-        it copies the style definition from the parent element.
-        
-        If some special rendering is required you should overwrite this template.
-        
-    </desc>
-   </doc>
-    <xsl:template match="*[not(tei:is-inline(.))]" priority="-10">
-        <xsl:param name="style"/>
-        <xsl:param name="pPr"/>
-        <xsl:param name="nop"/>
-        <!-- calculate style definition -->
-        <xsl:variable name="newStyle">
-            <xsl:apply-templates select="." mode="get-style"/>
-        </xsl:variable>
-        <xsl:variable name="styleToPassOn">
-            <xsl:choose>
-                <xsl:when test="string-length($newStyle) &gt; 0">
-                    <xsl:value-of select="$newStyle"/>
-                </xsl:when>
-                <xsl:otherwise>
-                    <xsl:value-of select="$style"/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
 
-        <!-- process children  -->
-        <xsl:call-template name="block-element">
-            <xsl:with-param name="style" select="$styleToPassOn"/>
-            <xsl:with-param name="pPr" select="$pPr"/>
-            <xsl:with-param name="nop" select="$nop"/>
-        </xsl:call-template>
-    </xsl:template>
+			Template for all simple inline elements
+			This template looks for a character style definition template
+			(mode="get-style")
+			for the currently processed element.
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        
-            Template for all simple inline elements
-            This template looks for a character style definition template (mode="get-style")
-            for the currently processed element.
-        
-    </desc>
-   </doc>
+		</desc>
+	</doc>
 
-    <xsl:template match="*[tei:is-inline(.)]" priority="-10">
-        <xsl:param name="character-style"/>
-        <xsl:param name="style"/>
-        <xsl:param name="pPr"/>
-        <xsl:variable name="style">
-            <xsl:apply-templates select="." mode="get-style"/>
-        </xsl:variable>
+	<xsl:template match="*[tei:is-inline(.)]" priority="-10">
+		<xsl:param name="character-style" />
+		<xsl:param name="style" />
+		<xsl:param name="pPr" />
+		<xsl:variable name="style">
+			<xsl:apply-templates select="." mode="get-style" />
+		</xsl:variable>
 
-	<xsl:variable name="iso-style">
-	  <xsl:if test=".//tbx:termNote/@iso:style">
-	    <xsl:value-of select=".//tbx:termNote/@iso:style"/>
-	  </xsl:if>
-	</xsl:variable>
+		<xsl:variable name="iso-style">
+			<xsl:if test=".//tbx:termNote/@iso:style">
+				<xsl:value-of select=".//tbx:termNote/@iso:style" />
+			</xsl:if>
+		</xsl:variable>
 
-        <xsl:variable name="use-style">
-            <xsl:choose>
-                <xsl:when test="(string-length($style) &gt; 0)">
-                    <xsl:value-of select="$style"/>
-                </xsl:when>
-		<xsl:when test="(string-length($iso-style) &gt; 0)">
-		  <xsl:value-of select="$iso-style"/>
-		</xsl:when>
-                <xsl:otherwise>
-                    <xsl:value-of select="$character-style"/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
+		<xsl:variable name="use-style">
+			<xsl:choose>
+				<xsl:when test="(string-length($style) &gt; 0)">
+					<xsl:value-of select="$style" />
+				</xsl:when>
+				<xsl:when test="(string-length($iso-style) &gt; 0)">
+					<xsl:value-of select="$iso-style" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$character-style" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-        <xsl:apply-templates>
-	  <xsl:with-param name="character-style" select="$use-style"/>
-        </xsl:apply-templates>
-    </xsl:template>
+		<xsl:apply-templates>
+			<xsl:with-param name="character-style"
+				select="$use-style" />
+		</xsl:apply-templates>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/graphics/graphics.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/graphics/graphics.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/graphics/graphics.xsl	(revision 2397)
@@ -1,186 +1,198 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: graphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Convert Word drawing objects
-    </desc>
-   </doc>
-    <xsl:template match="w:drawing">
-      <xsl:param name="n" tunnel="yes"/>
-        <xsl:choose>
-            <xsl:when test="$convert-graphics='true'">
-                <xsl:choose>
-                    <xsl:when test="descendant::a:blip[1]/@r:embed">
-                        <graphic>
-			    <xsl:variable name="c">
+				All rights reserved.
+
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: graphics.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Convert Word drawing objects
+		</desc>
+	</doc>
+	<xsl:template match="w:drawing">
+		<xsl:param name="n" tunnel="yes" />
+		<xsl:choose>
+			<xsl:when test="$convert-graphics='true'">
+				<xsl:choose>
+					<xsl:when test="descendant::a:blip[1]/@r:embed">
+						<graphic>
+							<xsl:variable name="c">
+								<xsl:choose>
+									<xsl:when test="ancestor::w:tbl">
+										<xsl:number level="any" from="w:tbl" />
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:number level="any" />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>
+							<xsl:attribute name="n">
 			      <xsl:choose>
-			      <xsl:when test="ancestor::w:tbl">
-				<xsl:number level="any" from="w:tbl"/>
-			      </xsl:when>
-			      <xsl:otherwise>
-				<xsl:number level="any"/>
-			      </xsl:otherwise>
-			      </xsl:choose>
-			    </xsl:variable>
-			    <xsl:attribute name="n">
-			      <xsl:choose>
 				<xsl:when test="number($n)">
-				  <xsl:value-of select="($n * 100) + $c"/>
+				  <xsl:value-of select="($n * 100) + $c" />
 				</xsl:when>
 				<xsl:otherwise>
 				  <xsl:text>100</xsl:text>
-				  <xsl:number level="any"/>
+				  <xsl:number level="any" />
 				</xsl:otherwise>
 			      </xsl:choose>
 			    </xsl:attribute>
-			  <xsl:attribute name="width"
-					 select="concat(number(descendant::wp:extent[1]/@cx) div 360000,'cm')"/>
-			  <xsl:attribute name="height"
-					 select="concat(number(descendant::wp:extent[1]/@cy) div 360000,'cm')"/>
-				 <xsl:variable name="media-url" select="descendant::pic:cNvPr/@descr"/>
-			 <xsl:choose>
-				 <xsl:when test="starts-with($media-url,'movie::' )">
-					 <xsl:attribute name="url">
+							<xsl:attribute name="width"
+								select="concat(number(descendant::wp:extent[1]/@cx) div 360000,'cm')" />
+							<xsl:attribute name="height"
+								select="concat(number(descendant::wp:extent[1]/@cy) div 360000,'cm')" />
+							<xsl:variable name="media-url"
+								select="descendant::pic:cNvPr/@descr" />
+							<xsl:choose>
+								<xsl:when test="starts-with($media-url,'movie::' )">
+									<xsl:attribute name="url">
 						 <!-- The proper way to do it would be to extract the name from this
 						      <xsl:value-of select="substring-after($media-url, 'movie::')"/>
 						-->
-						 <xsl:value-of select="descendant::pic:cNvPr/@name"/>
+						 <xsl:value-of select="descendant::pic:cNvPr/@name" />
 					 </xsl:attribute>
-					 <xsl:attribute name="mimeType">video/x-something</xsl:attribute>
-				 </xsl:when>
+									<xsl:attribute name="mimeType">video/x-something</xsl:attribute>
+								</xsl:when>
 
-				 <xsl:otherwise>
-					 <xsl:attribute name="url">
-						 <xsl:variable name="rid" select="descendant::a:blip[1]/@r:embed"/>
-						 <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
+								<xsl:otherwise>
+									<xsl:attribute name="url">
+						 <xsl:variable name="rid"
+										select="descendant::a:blip[1]/@r:embed" />
+						 <xsl:value-of
+										select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
 					 </xsl:attribute>
-				 </xsl:otherwise>
-			 </xsl:choose>
+								</xsl:otherwise>
+							</xsl:choose>
 
-				 <!-- inline or block -->
-			  <xsl:attribute name="rend">
+							<!-- inline or block -->
+							<xsl:attribute name="rend">
                                 <xsl:choose>
                                     <xsl:when test="wp:anchor">block</xsl:when>
                                     <xsl:otherwise>inline</xsl:otherwise>
                                 </xsl:choose>
                             </xsl:attribute>
-			    <xsl:if test=".//wp:docPr/@descr">
-			      <xsl:element name="desc">
-				<xsl:value-of select=".//wp:docPr/@descr"/>
-			      </xsl:element>
-			    </xsl:if>                            
-                        </graphic>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <graphic> Linked Graphic: <xsl:variable name="rid" select="@r:link"/>
-                            <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
-                        </graphic>
-                    </xsl:otherwise>
-                </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>
-                <w:drawing>
-                    <xsl:apply-templates mode="iden"/>
-                </w:drawing>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Guides the identity transformation of blips
-    </desc>
-   </doc>
-    <xsl:template match="a:blip" mode="iden">
-        <a:blip>
-            <xsl:choose>
-                <xsl:when test="@r:embed">
-                    <xsl:variable name="rid" select="@r:embed"/>
-                    <xsl:attribute name="r:embed">
-                        <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
+							<xsl:if test=".//wp:docPr/@descr">
+								<xsl:element name="desc">
+									<xsl:value-of select=".//wp:docPr/@descr" />
+								</xsl:element>
+							</xsl:if>
+						</graphic>
+					</xsl:when>
+					<xsl:otherwise>
+						<graphic>
+							Linked Graphic:
+							<xsl:variable name="rid" select="@r:link" />
+							<xsl:value-of
+								select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
+						</graphic>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<w:drawing>
+					<xsl:apply-templates mode="iden" />
+				</w:drawing>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Guides the identity transformation of blips
+		</desc>
+	</doc>
+	<xsl:template match="a:blip" mode="iden">
+		<a:blip>
+			<xsl:choose>
+				<xsl:when test="@r:embed">
+					<xsl:variable name="rid" select="@r:embed" />
+					<xsl:attribute name="r:embed">
+                        <xsl:value-of
+						select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
                     </xsl:attribute>
-                </xsl:when>
-                <xsl:otherwise>
-                    <xsl:variable name="rid" select="@r:link"/>
-                    <xsl:attribute name="r:link">
-                        <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:variable name="rid" select="@r:link" />
+					<xsl:attribute name="r:link">
+                        <xsl:value-of
+						select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
                     </xsl:attribute>
-                </xsl:otherwise>
-            </xsl:choose>
-            
-        </a:blip>
-    </xsl:template>
-    
+				</xsl:otherwise>
+			</xsl:choose>
+
+		</a:blip>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/utils/utility-templates.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/utils/utility-templates.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/utils/utility-templates.xsl	(revision 2397)
@@ -1,127 +1,136 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp ">
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp ">
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: utility-templates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <xsl:template name="generateAppInfo">
-      <appInfo>
-	        <application ident="TEI_fromDOCX" version="2.15.0">
-	           <label>DOCX to TEI</label>
-	        </application>
-	        <xsl:if test="doc-available(concat($wordDirectory,'/docProps/custom.xml'))">
-	           <xsl:for-each select="document(concat($wordDirectory,'/docProps/custom.xml'))/prop:Properties">
-	              <xsl:for-each select="prop:property">
-	                 <xsl:choose>
-		                   <xsl:when test="@name='TEI_fromDOCX'"/>
-		                   <xsl:when test="contains(@name,'TEI')">
-		                      <application ident="{@name}" version="{.}">
-		                         <label>
-		                            <xsl:value-of select="@name"/>
-		                         </label>
-		                      </application>
-		                   </xsl:when>
-	                 </xsl:choose>
-	              </xsl:for-each>
-		      <xsl:if test="prop:property[@name='WordTemplateURI']">
-			<application ident="WordTemplate" version="{prop:property[@name='WordTemplate']}">
-			  <label>Word template file</label>
-			  <ptr target="{prop:property[@name='WordTemplateURI']}"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: utility-templates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:template name="generateAppInfo">
+		<appInfo>
+			<application ident="TEI_fromDOCX" version="2.15.0">
+				<label>DOCX to TEI</label>
 			</application>
-		      </xsl:if>
-	           </xsl:for-each>
-	        </xsl:if>
-      </appInfo>
-    </xsl:template>
+			<xsl:if
+				test="doc-available(concat($wordDirectory,'/docProps/custom.xml'))">
+				<xsl:for-each
+					select="document(concat($wordDirectory,'/docProps/custom.xml'))/prop:Properties">
+					<xsl:for-each select="prop:property">
+						<xsl:choose>
+							<xsl:when test="@name='TEI_fromDOCX'" />
+							<xsl:when test="contains(@name,'TEI')">
+								<application ident="{@name}" version="{.}">
+									<label>
+										<xsl:value-of select="@name" />
+									</label>
+								</application>
+							</xsl:when>
+						</xsl:choose>
+					</xsl:for-each>
+					<xsl:if test="prop:property[@name='WordTemplateURI']">
+						<application ident="WordTemplate"
+							version="{prop:property[@name='WordTemplate']}">
+							<label>Word template file</label>
+							<ptr target="{prop:property[@name='WordTemplateURI']}" />
+						</application>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:if>
+		</appInfo>
+	</xsl:template>
 
-    <xsl:template name="getDocTitle">
-      <xsl:value-of select="$docProps/cp:coreProperties/dc:title"/>
-    </xsl:template>
+	<xsl:template name="getDocTitle">
+		<xsl:value-of
+			select="$docProps/cp:coreProperties/dc:title" />
+	</xsl:template>
 
-    <xsl:template name="getDocAuthor">
-      <xsl:value-of select="$docProps/cp:coreProperties/dc:creator"/>
-    </xsl:template>
+	<xsl:template name="getDocAuthor">
+		<xsl:value-of
+			select="$docProps/cp:coreProperties/dc:creator" />
+	</xsl:template>
 
-    <xsl:template name="getDocDate">
-      <xsl:value-of select="substring-before($docProps/cp:coreProperties/dcterms:created,'T')"/>
-    </xsl:template>
+	<xsl:template name="getDocDate">
+		<xsl:value-of
+			select="substring-before($docProps/cp:coreProperties/dcterms:created,'T')" />
+	</xsl:template>
 
-    <xsl:template name="identifyChange">
-      <xsl:param name="who"/>
-      <xsl:attribute name="resp">
+	<xsl:template name="identifyChange">
+		<xsl:param name="who" />
+		<xsl:attribute name="resp">
 	<xsl:text>#</xsl:text>
-	<xsl:value-of select="translate($who,' ','_')"/>
+	<xsl:value-of select="translate($who,' ','_')" />
       </xsl:attribute>
-    </xsl:template>
+	</xsl:template>
 
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/wordsections/wordsections.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/wordsections/wordsections.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/wordsections/wordsections.xsl	(revision 2397)
@@ -1,125 +1,133 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: wordsections.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>match strange word sections</p>
-         <p>
-            See comment at begin of document to understand why this template is calling
-            a named template. It matches strange Word "sections".
-        </p>
-      </desc>
-   </doc>
-    <xsl:template match="w:p[w:pPr/w:sectPr]|w:sectPr" mode="paragraph">
-        <xsl:call-template name="paragraph-sectpr"/>
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Template called by a match on w:p[w:pPr/w:sectPr]|w:sectPr
-    </desc>
-   </doc>
-    <xsl:template name="paragraph-sectpr">
-      <xsl:if test="$preserveWordSections='true'">
-        <xsl:for-each select="descendant-or-self::w:sectPr">
-            <milestone unit="section">
-                <xsl:for-each select="w:headerReference">
-                    <tei:header type="{@w:type}" ref="{@r:id}"/>
-                </xsl:for-each>
-                <xsl:for-each select="w:footerReference">
-                    <tei:footer type="{@w:type}" ref="{@r:id}"/>
-                </xsl:for-each>
-                <xsl:if test="w:pgSz/@w:orient='landscape'">
-                    <tei:orientation type="landscape"/>
-                </xsl:if>
-                <xsl:if test="w:pgNumType">
-                    <tei:pageNumbering>
-                        <xsl:if test="w:pgNumType/@w:start">
-                            <xsl:attribute name="start" select="w:pgNumType/@w:start"/>
-                        </xsl:if>
-                        <xsl:if test="w:pgNumType/@w:fmt">
-                            <xsl:attribute name="type" select="w:pgNumType/@w:fmt"/>
-                        </xsl:if>
-                    </tei:pageNumbering>
-                </xsl:if>
-            </milestone>
-        </xsl:for-each>
-      </xsl:if>
-      <xsl:next-match/>
-    </xsl:template>
-    
-    
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: wordsections.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>match strange word sections</p>
+			<p>
+				See comment at begin of document to understand why this template is
+				calling
+				a named template. It matches strange Word "sections".
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="w:p[w:pPr/w:sectPr]|w:sectPr"
+		mode="paragraph">
+		<xsl:call-template name="paragraph-sectpr" />
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Template called by a match on w:p[w:pPr/w:sectPr]|w:sectPr
+		</desc>
+	</doc>
+	<xsl:template name="paragraph-sectpr">
+		<xsl:if test="$preserveWordSections='true'">
+			<xsl:for-each select="descendant-or-self::w:sectPr">
+				<milestone unit="section">
+					<xsl:for-each select="w:headerReference">
+						<tei:header type="{@w:type}" ref="{@r:id}" />
+					</xsl:for-each>
+					<xsl:for-each select="w:footerReference">
+						<tei:footer type="{@w:type}" ref="{@r:id}" />
+					</xsl:for-each>
+					<xsl:if test="w:pgSz/@w:orient='landscape'">
+						<tei:orientation type="landscape" />
+					</xsl:if>
+					<xsl:if test="w:pgNumType">
+						<tei:pageNumbering>
+							<xsl:if test="w:pgNumType/@w:start">
+								<xsl:attribute name="start"
+									select="w:pgNumType/@w:start" />
+							</xsl:if>
+							<xsl:if test="w:pgNumType/@w:fmt">
+								<xsl:attribute name="type"
+									select="w:pgNumType/@w:fmt" />
+							</xsl:if>
+						</tei:pageNumbering>
+					</xsl:if>
+				</milestone>
+			</xsl:for-each>
+		</xsl:if>
+		<xsl:next-match />
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/test-toc-scenario.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/test-toc-scenario.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/test-toc-scenario.xml	(revision 2397)
@@ -1,14 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<x:description 
-    xmlns:x="http://www.jenitennison.com/xslt/xspec"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns="http://www.tei-c.org/ns/1.0"
-    
-    stylesheet="../toc.xsl">
-    <x:scenario label="test creating table of contents">
-        <x:call template="tocSection"/>
-        <x:expect label="a divGen element should be created">
-            <divGen type="toc"/>
-        </x:expect>
-    </x:scenario>
+<x:description
+	xmlns:x="http://www.jenitennison.com/xslt/xspec"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns="http://www.tei-c.org/ns/1.0" stylesheet="../toc.xsl">
+	<x:scenario label="test creating table of contents">
+		<x:call template="tocSection" />
+		<x:expect label="a divGen element should be created">
+			<divGen type="toc" />
+		</x:expect>
+	</x:scenario>
 </x:description>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.html
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.html	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.html	(revision 2397)
@@ -1,52 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?><html xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns="http://www.w3.org/1999/xhtml">
-   <head>
-      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-      <title>Test Report for Users/amittelbach/EDV Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl</title>
-      <link rel="stylesheet" type="text/css" href="file:/usr/local/bin/xspec-v0.1/test-report.css" />
-   </head>
-   <body>
-      <h1>Test Report</h1>
-      <p>Stylesheet:  <a href="file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl">Users/amittelbach/EDV Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl</a></p>
-      <p>Tested: 13 Oktober 2009 at 11:55</p>
-      <h2>Contents</h2>
-      <table class="xspec">
-         <col width="85%" />
-         <col width="15%" />
-         <thead>
-            <tr>
-               <th style="text-align: right; font-weight: normal; ">passed/pending/failed/total</th>
-               <th>1/0/0/1</th>
-            </tr>
-         </thead>
-         <tbody>
-            <tr class="successful">
-               <th><a href="#d3e4">test creating table of contents</a></th>
-               <th>1/0/0/1</th>
-            </tr>
-         </tbody>
-      </table>
-      <div id="d3e4">
-         <h2>test creating table of contents</h2>
-         <table class="xspec" id="d3e4">
-            <col width="85%" />
-            <col width="15%" />
-            <thead>
-               <tr>
-                  <th style="text-align: right; font-weight: normal; ">passed/pending/failed/total</th>
-                  <th>1/0/0/1</th>
-               </tr>
-            </thead>
-            <tbody>
-               <tr class="successful">
-                  <th>test creating table of contents</th>
-                  <th>1/0/0/1</th>
-               </tr>
-               <tr class="successful">
-                  <td>a divGen element should be created</td>
-                  <td>Success</td>
-               </tr>
-            </tbody>
-         </table>
-      </div>
-   </body>
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns:test="http://www.jenitennison.com/xslt/unit-test"
+	xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Test Report for Users/amittelbach/EDV
+	Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl</title>
+<link rel="stylesheet" type="text/css"
+	href="file:/usr/local/bin/xspec-v0.1/test-report.css" />
+</head>
+<body>
+	<h1>Test Report</h1>
+	<p>
+		Stylesheet: <a
+			href="file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl">Users/amittelbach/EDV
+			Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl</a>
+	</p>
+	<p>Tested: 13 Oktober 2009 at 11:55</p>
+	<h2>Contents</h2>
+	<table class="xspec">
+		<col width="85%" />
+		<col width="15%" />
+		<thead>
+			<tr>
+				<th style="text-align: right; font-weight: normal;">passed/pending/failed/total</th>
+				<th>1/0/0/1</th>
+			</tr>
+		</thead>
+		<tbody>
+			<tr class="successful">
+				<th><a href="#d3e4">test creating table of contents</a></th>
+				<th>1/0/0/1</th>
+			</tr>
+		</tbody>
+	</table>
+	<div id="d3e4">
+		<h2>test creating table of contents</h2>
+		<table class="xspec" id="d3e4">
+			<col width="85%" />
+			<col width="15%" />
+			<thead>
+				<tr>
+					<th style="text-align: right; font-weight: normal;">passed/pending/failed/total</th>
+					<th>1/0/0/1</th>
+				</tr>
+			</thead>
+			<tbody>
+				<tr class="successful">
+					<th>test creating table of contents</th>
+					<th>1/0/0/1</th>
+				</tr>
+				<tr class="successful">
+					<td>a divGen element should be created</td>
+					<td>Success</td>
+				</tr>
+			</tbody>
+		</table>
+	</div>
+</body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario.xsl	(revision 2397)
@@ -1,66 +1,88 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:test="http://www.jenitennison.com/xslt/unit-test"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:s="http://www.jenitennison.com/xslt/xspec"
-                xmlns:o="http://www.w3.org/1999/XSL/TransformAliasAlias"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:x="http://www.jenitennison.com/xslt/xspec"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0">
-   <xsl:import href="file:/usr/local/bin/xspec-v0.1/generate-tests-utils.xsl"/>
-   <xsl:import href="file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl"/>
-   <xsl:namespace-alias stylesheet-prefix="o" result-prefix="xsl"/>
-   <xsl:variable name="s:stylesheet-uri" as="xs:string"
-                 select="'file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl'"/>
-   <xsl:output method="xml" indent="yes"/>
-   <xsl:template name="s:main">
-      <xsl:message>
-         <xsl:text>Testing with </xsl:text>
-         <xsl:value-of select="system-property('xsl:product-name')"/>
-         <xsl:text> </xsl:text>
-         <xsl:value-of select="system-property('xsl:product-version')"/>
-      </xsl:message>
-      <xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="file:/usr/local/bin/xspec-v0.1/format-xspec-report.xsl"</xsl:processing-instruction>
-      <s:report stylesheet="{$s:stylesheet-uri}" date="{current-dateTime()}">
-         <xsl:call-template name="s:d4e1"/>
-      </s:report>
-   </xsl:template>
-   <xsl:template name="s:d4e1">
-      <xsl:message>test creating table of contents</xsl:message>
-      <s:scenario label="test creating table of contents">
-         <s:call template="tocSection"/>
-         <xsl:variable name="actual-result" as="item()*">
-            <xsl:call-template name="tocSection"/>
-         </xsl:variable>
-         <xsl:call-template name="test:report-value">
-            <xsl:with-param name="value" select="$actual-result"/>
-            <xsl:with-param name="wrapper-name" select="'s:result'"/>
-            <xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
-         </xsl:call-template>
-         <xsl:call-template name="s:d4e3">
-            <xsl:with-param name="actual-result" select="$actual-result"/>
-         </xsl:call-template>
-      </s:scenario>
-   </xsl:template>
-   <xsl:template name="s:d4e3">
-      <xsl:param name="actual-result" as="item()*" required="yes"/>
-      <xsl:message>    a divGen element should be created</xsl:message>
-      <xsl:variable name="expected-result-doc" as="document-node()">
-         <xsl:document>
-            <divGen type="toc"/>
-         </xsl:document>
-      </xsl:variable>
-      <xsl:variable name="expected-result" select="$expected-result-doc/node()"/>
-      <xsl:variable name="successful" as="xs:boolean"
-                    select="test:deep-equal($expected-result, $actual-result, 2)"/>
-      <xsl:if test="not($successful)">
-         <xsl:message>      FAILED</xsl:message>
-      </xsl:if>
-      <s:test label="a divGen element should be created" successful="{$successful}">
-         <s:expect>
-            <divGen type="toc"/>
-         </s:expect>
-      </s:test>
-   </xsl:template>
+<xsl:stylesheet
+	xmlns:test="http://www.jenitennison.com/xslt/unit-test"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:s="http://www.jenitennison.com/xslt/xspec"
+	xmlns:o="http://www.w3.org/1999/XSL/TransformAliasAlias"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:x="http://www.jenitennison.com/xslt/xspec"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0">
+	<xsl:import
+		href="file:/usr/local/bin/xspec-v0.1/generate-tests-utils.xsl" />
+	<xsl:import
+		href="file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl" />
+	<xsl:namespace-alias stylesheet-prefix="o"
+		result-prefix="xsl" />
+	<xsl:variable name="s:stylesheet-uri" as="xs:string"
+		select="'file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl'" />
+	<xsl:output method="xml" indent="yes" />
+	<xsl:template name="s:main">
+		<xsl:message>
+			<xsl:text>Testing with </xsl:text>
+			<xsl:value-of
+				select="system-property('xsl:product-name')" />
+			<xsl:text> </xsl:text>
+			<xsl:value-of
+				select="system-property('xsl:product-version')" />
+		</xsl:message>
+		<xsl:processing-instruction
+			name="xml-stylesheet">
+			type="text/xsl"
+			href="file:/usr/local/bin/xspec-v0.1/format-xspec-report.xsl"
+		</xsl:processing-instruction>
+		<s:report stylesheet="{$s:stylesheet-uri}"
+			date="{current-dateTime()}">
+			<xsl:call-template name="s:d4e1" />
+		</s:report>
+	</xsl:template>
+	<xsl:template name="s:d4e1">
+		<xsl:message>
+			test creating table of contents
+		</xsl:message>
+		<s:scenario label="test creating table of contents">
+			<s:call template="tocSection" />
+			<xsl:variable name="actual-result" as="item()*">
+				<xsl:call-template name="tocSection" />
+			</xsl:variable>
+			<xsl:call-template name="test:report-value">
+				<xsl:with-param name="value" select="$actual-result" />
+				<xsl:with-param name="wrapper-name"
+					select="'s:result'" />
+				<xsl:with-param name="wrapper-ns"
+					select="'http://www.jenitennison.com/xslt/xspec'" />
+			</xsl:call-template>
+			<xsl:call-template name="s:d4e3">
+				<xsl:with-param name="actual-result"
+					select="$actual-result" />
+			</xsl:call-template>
+		</s:scenario>
+	</xsl:template>
+	<xsl:template name="s:d4e3">
+		<xsl:param name="actual-result" as="item()*" required="yes" />
+		<xsl:message>
+			a divGen element should be created
+		</xsl:message>
+		<xsl:variable name="expected-result-doc"
+			as="document-node()">
+			<xsl:document>
+				<divGen type="toc" />
+			</xsl:document>
+		</xsl:variable>
+		<xsl:variable name="expected-result"
+			select="$expected-result-doc/node()" />
+		<xsl:variable name="successful" as="xs:boolean"
+			select="test:deep-equal($expected-result, $actual-result, 2)" />
+		<xsl:if test="not($successful)">
+			<xsl:message>
+				FAILED
+			</xsl:message>
+		</xsl:if>
+		<s:test label="a divGen element should be created"
+			successful="{$successful}">
+			<s:expect>
+				<divGen type="toc" />
+			</s:expect>
+		</s:test>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.xml	(revision 2397)
@@ -1,22 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet type="text/xsl" href="file:/usr/local/bin/xspec-v0.1/format-xspec-report.xsl"?><s:report xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-          xmlns:tei="http://www.tei-c.org/ns/1.0"
-          xmlns:xs="http://www.w3.org/2001/XMLSchema"
-          xmlns:test="http://www.jenitennison.com/xslt/unit-test"
-          xmlns="http://www.tei-c.org/ns/1.0"
-          xmlns:x="http://www.jenitennison.com/xslt/xspec"
-          xmlns:s="http://www.jenitennison.com/xslt/xspec"
-          stylesheet="file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl"
-          date="2009-10-13T11:55:35.44+02:00">
-   <s:scenario label="test creating table of contents">
-      <s:call template="tocSection"/>
-      <s:result>
-         <divGen type="toc"/>
-      </s:result>
-      <s:test label="a divGen element should be created" successful="true">
-         <s:expect>
-            <divGen type="toc"/>
-         </s:expect>
-      </s:test>
-   </s:scenario>
+<?xml-stylesheet type="text/xsl" href="file:/usr/local/bin/xspec-v0.1/format-xspec-report.xsl"?>
+<s:report xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:test="http://www.jenitennison.com/xslt/unit-test"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:x="http://www.jenitennison.com/xslt/xspec"
+	xmlns:s="http://www.jenitennison.com/xslt/xspec"
+	stylesheet="file:/Users/amittelbach/EDV%20Dienstleistungen/Kunden/OUCS/TEIISO/workspace/Stylesheets/docx/from/dynamic/toc.xsl"
+	date="2009-10-13T11:55:35.44+02:00">
+	<s:scenario label="test creating table of contents">
+		<s:call template="tocSection" />
+		<s:result>
+			<divGen type="toc" />
+		</s:result>
+		<s:test label="a divGen element should be created"
+			successful="true">
+			<s:expect>
+				<divGen type="toc" />
+			</s:expect>
+		</s:test>
+	</s:scenario>
 </s:report>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/toc.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/toc.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/toc.xsl	(revision 2397)
@@ -1,213 +1,200 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: toc.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc> Process a paragraph with a TOC style, which means parsing
-      the instrText field </desc>
-<!--
-        Handle TOC
-{ TOC [Switches ] }
+				All rights reserved.
 
-Builds a table of contents. The TOC field collects entries for a table of 
-contents using heading levels, specified styles (style: A combination of 
-formatting characteristics, such as font, font size, and indentation, that 
-you name and store as a set. When you apply a style, all of the formatting 
-instructions in that style are applied at one time.), or entries specified by 
-TC (Table of Contents Entry) fields. Microsoft Word inserts the TOC field 
-when you use the Index and Tables command from the Reference submenu on the 
-Insert menu.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-Note  If the table of contents created by the TOC field affects the 
-pagination of the document, you may have to update the field again to reflect 
-the correct page numbers.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-Switches
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-\a Identifier 
-Lists items captioned with the Caption command (Insert menu, Reference 
-submenu) but omits caption labels and numbers. The identifier corresponds to 
-the caption label. For example, although a caption on page 12 is "Figure 8: 
-Mercury", the field { TOC \a figures } displays entries as 
-"Mercury............12".
-Use the \c switch to build a table of captions with labels and numbers.
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: toc.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-\b BookmarkName 
-Collects entries only from the portion of the document marked by the 
-specified bookmark (bookmark: A location or selection of text in a file that 
-you name for reference purposes. Bookmarks identify a location within your 
-file that you can later refer or link to.). 
-\c "SEQIdentifier" 
-Lists figures, tables, charts, or other items that are numbered by a SEQ 
-(Sequence) field. Word uses SEQ fields to number items captioned with the 
-Caption command (Insert menu, Reference submenu). SEQIdentifier, which 
-corresponds to the caption label, must match the identifier in the SEQ field. 
-For example, { TOC \c "tables" } lists all numbered tables. 
-\f EntryIdentifier 
-Builds a table from TC fields. If EntryIdentifier is specified, the table is 
-built only from TC fields with the same identifier (typically a letter). For 
-example, { TOC \f t } builds a table of contents from TC fields such as { TC 
-"Entry Text" \f t }. 
-\h Hyperlinks 
-Inserts TOC entries as hyperlinks (hyperlink: Colored and underlined text or 
-a graphic that you click to go to a file, a location in a file, a Web page on 
-the World Wide Web, or a Web page on an intranet. Hyperlinks can also go to 
-newsgroups and to Gopher, Telnet, and FTP sites.). 
-\l Levels 
-Builds a table of contents from TC fields that assign entries to one of the 
-specified levels. For example, { TOC \l 1-4 } builds a table of contents from 
-TC fields that assign entries to levels 1-4. TC fields that assign entries to 
-lower levels are skipped. 
-\n Levels 
-Omits page numbers from the table of contents. Page numbers are omitted from 
-all levels unless a range of entry levels is specified. For example, { TOC \n 
-3-4 } omits page numbers from levels 3 and 4. Delete this switch to include 
-page numbers. 
-\o "Headings" 
-Builds a table of contents from paragraphs formatted with built-in heading 
-styles (heading style: Formatting applied to a heading. Microsoft Word has 
-nine different built-in styles: Heading 1 through Heading 9.). For example, { 
-TOC \o "1-3" } lists only headings formatted with the styles Heading 1 
-through Heading 3. If no heading range is specified, all heading levels used 
-in the document are listed. Enclose the range numbers in quotation marks. 
-\p "Separators" 
-Specifies the characters that separate an entry and its page number. For 
-example, the field { TOC \p "— " }, with an em dash, displays a result such 
-as "Selecting Text— 53." The default is a tab with leader dots. You can use 
-up to five characters, which must be enclosed in quotation marks. 
-\s Identifier 
-Includes a number such as a chapter number before the page number. The 
-chapter or other item must be numbered with a SEQ field. Identifier must 
-match the identifier in the SEQ field. For example, if you insert { SEQ 
-chapter } before each chapter heading, { TOC \o "1-3" \s chapter } displays 
-page numbers as 2-14, where "2" is the chapter number. 
-\d "Separator" 
-When used with the \s switch, specifies the number of characters that 
-separate the sequence numbers and page numbers. Enclose the characters in 
-quotation marks. Word uses a hyphen (-) if no \d switch is specified. In the 
-table of contents generated by { TOC \o "1-3" \s chapter \d ":" }, a colon 
-(:) separates chapter numbers and page numbers— for example, "2:14." 
-\t "Style,Level, Style,Level,..." 
-Builds a table of contents from paragraphs formatted with styles other than 
-the built-in heading styles. For example, { TOC \t "chaptertitle,1, 
-chapterhead,2" } builds a table of contents from paragraphs formatted with 
-the styles "chaptertitle" and "chapterhead." The number after each style name 
-indicates the table of contents entry level that corresponds to that style. 
-You can use both the \o switch and the \t switch to build a table of 
-contents from built-in heading styles and other styles.
 
-\u 
-Builds a table of contents by using the applied paragraph outline level 
-(outline level: Paragraph formatting you can use to assign a hierarchical 
-level (Level 1 through Level 9) to paragraphs in your document. For example, 
-after you assign outline levels, you can work with the document in outline 
-view or in the Document Map.). 
-\w 
-Preserves tab entries within table entries. 
-\x 
-Preserves newline characters within table entries. 
-\z 
-Hides tab leader and page numbers in Web layout view (Web layout view: A 
-view of a document as it will appear in a Web browser. For example, the 
-document appears as one long page (without page breaks) and text and tables 
-wrap to fit in the window.).
--->
-   </doc>
-    <xsl:template name="tocSection">
-        <divGen type="toc"/>
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc> Process a paragraph with a TOC style, which means parsing
+			the instrText field
+		</desc>
+		<!-- Handle TOC { TOC [Switches ] } Builds a table of contents. The TOC 
+			field collects entries for a table of contents using heading levels, specified 
+			styles (style: A combination of formatting characteristics, such as font, 
+			font size, and indentation, that you name and store as a set. When you apply 
+			a style, all of the formatting instructions in that style are applied at 
+			one time.), or entries specified by TC (Table of Contents Entry) fields. 
+			Microsoft Word inserts the TOC field when you use the Index and Tables command 
+			from the Reference submenu on the Insert menu. Note If the table of contents 
+			created by the TOC field affects the pagination of the document, you may 
+			have to update the field again to reflect the correct page numbers. Switches 
+			\a Identifier Lists items captioned with the Caption command (Insert menu, 
+			Reference submenu) but omits caption labels and numbers. The identifier corresponds 
+			to the caption label. For example, although a caption on page 12 is "Figure 
+			8: Mercury", the field { TOC \a figures } displays entries as "Mercury............12". 
+			Use the \c switch to build a table of captions with labels and numbers. \b 
+			BookmarkName Collects entries only from the portion of the document marked 
+			by the specified bookmark (bookmark: A location or selection of text in a 
+			file that you name for reference purposes. Bookmarks identify a location 
+			within your file that you can later refer or link to.). \c "SEQIdentifier" 
+			Lists figures, tables, charts, or other items that are numbered by a SEQ 
+			(Sequence) field. Word uses SEQ fields to number items captioned with the 
+			Caption command (Insert menu, Reference submenu). SEQIdentifier, which corresponds 
+			to the caption label, must match the identifier in the SEQ field. For example, 
+			{ TOC \c "tables" } lists all numbered tables. \f EntryIdentifier Builds 
+			a table from TC fields. If EntryIdentifier is specified, the table is built 
+			only from TC fields with the same identifier (typically a letter). For example, 
+			{ TOC \f t } builds a table of contents from TC fields such as { TC "Entry 
+			Text" \f t }. \h Hyperlinks Inserts TOC entries as hyperlinks (hyperlink: 
+			Colored and underlined text or a graphic that you click to go to a file, 
+			a location in a file, a Web page on the World Wide Web, or a Web page on 
+			an intranet. Hyperlinks can also go to newsgroups and to Gopher, Telnet, 
+			and FTP sites.). \l Levels Builds a table of contents from TC fields that 
+			assign entries to one of the specified levels. For example, { TOC \l 1-4 
+			} builds a table of contents from TC fields that assign entries to levels 
+			1-4. TC fields that assign entries to lower levels are skipped. \n Levels 
+			Omits page numbers from the table of contents. Page numbers are omitted from 
+			all levels unless a range of entry levels is specified. For example, { TOC 
+			\n 3-4 } omits page numbers from levels 3 and 4. Delete this switch to include 
+			page numbers. \o "Headings" Builds a table of contents from paragraphs formatted 
+			with built-in heading styles (heading style: Formatting applied to a heading. 
+			Microsoft Word has nine different built-in styles: Heading 1 through Heading 
+			9.). For example, { TOC \o "1-3" } lists only headings formatted with the 
+			styles Heading 1 through Heading 3. If no heading range is specified, all 
+			heading levels used in the document are listed. Enclose the range numbers 
+			in quotation marks. \p "Separators" Specifies the characters that separate 
+			an entry and its page number. For example, the field { TOC \p "— " }, with 
+			an em dash, displays a result such as "Selecting Text— 53." The default is 
+			a tab with leader dots. You can use up to five characters, which must be 
+			enclosed in quotation marks. \s Identifier Includes a number such as a chapter 
+			number before the page number. The chapter or other item must be numbered 
+			with a SEQ field. Identifier must match the identifier in the SEQ field. 
+			For example, if you insert { SEQ chapter } before each chapter heading, { 
+			TOC \o "1-3" \s chapter } displays page numbers as 2-14, where "2" is the 
+			chapter number. \d "Separator" When used with the \s switch, specifies the 
+			number of characters that separate the sequence numbers and page numbers. 
+			Enclose the characters in quotation marks. Word uses a hyphen (-) if no \d 
+			switch is specified. In the table of contents generated by { TOC \o "1-3" 
+			\s chapter \d ":" }, a colon (:) separates chapter numbers and page numbers— 
+			for example, "2:14." \t "Style,Level, Style,Level,..." Builds a table of 
+			contents from paragraphs formatted with styles other than the built-in heading 
+			styles. For example, { TOC \t "chaptertitle,1, chapterhead,2" } builds a 
+			table of contents from paragraphs formatted with the styles "chaptertitle" 
+			and "chapterhead." The number after each style name indicates the table of 
+			contents entry level that corresponds to that style. You can use both the 
+			\o switch and the \t switch to build a table of contents from built-in heading 
+			styles and other styles. \u Builds a table of contents by using the applied 
+			paragraph outline level (outline level: Paragraph formatting you can use 
+			to assign a hierarchical level (Level 1 through Level 9) to paragraphs in 
+			your document. For example, after you assign outline levels, you can work 
+			with the document in outline view or in the Document Map.). \w Preserves 
+			tab entries within table entries. \x Preserves newline characters within 
+			table entries. \z Hides tab leader and page numbers in Web layout view (Web 
+			layout view: A view of a document as it will appear in a Web browser. For 
+			example, the document appears as one long page (without page breaks) and 
+			text and tables wrap to fit in the window.). -->
+	</doc>
+	<xsl:template name="tocSection">
+		<divGen type="toc" />
+	</xsl:template>
 
-    <xsl:template name="_tocSection">
-      <xsl:variable name="typestring">
-	<xsl:value-of select="(.//w:instrText)[1]"/>
-      </xsl:variable>
-	<xsl:message>TOC: test [<xsl:value-of select="$typestring"/>]</xsl:message>
-    <xsl:analyze-string select='$typestring' regex='\s*([A-z]+)\s+(.*)\s+"([^,]+),(.*)"\s*'>
-      <xsl:matching-substring>
-	<xsl:message>TOC ok, found [<xsl:value-of select="regex-group(1)"/>][<xsl:value-of select="regex-group(2)"/>][<xsl:value-of select="regex-group(3)"/>]</xsl:message>
-      </xsl:matching-substring>
-      <xsl:non-matching-substring>
-	<xsl:message>TOC panic on <xsl:value-of select="."/></xsl:message>
-      </xsl:non-matching-substring>
-    </xsl:analyze-string>
-<!--
-        <w:instrText xml:space="preserve"> TOC \o "1-2" \h \z \t "ITLP H3,3" </w:instrText>
+	<xsl:template name="_tocSection">
+		<xsl:variable name="typestring">
+			<xsl:value-of select="(.//w:instrText)[1]" />
+		</xsl:variable>
+		<xsl:message>
+			TOC: test [
+			<xsl:value-of select="$typestring" />
+			]
+		</xsl:message>
+		<xsl:analyze-string select='$typestring'
+			regex='\s*([A-z]+)\s+(.*)\s+"([^,]+),(.*)"\s*'>
+			<xsl:matching-substring>
+				<xsl:message>
+					TOC ok, found [
+					<xsl:value-of select="regex-group(1)" />
+					][
+					<xsl:value-of select="regex-group(2)" />
+					][
+					<xsl:value-of select="regex-group(3)" />
+					]
+				</xsl:message>
+			</xsl:matching-substring>
+			<xsl:non-matching-substring>
+				<xsl:message>
+					TOC panic on
+					<xsl:value-of select="." />
+				</xsl:message>
+			</xsl:non-matching-substring>
+		</xsl:analyze-string>
+		<!-- <w:instrText xml:space="preserve"> TOC \o "1-2" \h \z \t "ITLP H3,3" 
+			</w:instrText> <w:instrText xml:space="preserve"> TOC \h \z \t "ITLP Ex Heading,2" 
+			</w:instrText> -->
+		<divGen type="toc" />
+	</xsl:template>
 
-        <w:instrText xml:space="preserve"> TOC \h \z \t "ITLP Ex Heading,2" </w:instrText>
--->
-        <divGen type="toc"/>
-    </xsl:template>
-    
-    
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/fields.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/fields.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/dynamic/fields.xsl	(revision 2397)
@@ -1,135 +1,160 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-        
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: fields.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Handle simple fields
-    </desc>
-   </doc>
-    <xsl:template match="w:fldSimple">
-      <xsl:variable name="rstyle">
-	<xsl:value-of select="w:r/w:rPr/w:rStyle/@w:val"/>
-      </xsl:variable>
-      <xsl:variable name="rends">
-	<r>fldSimple</r>
-	<xsl:if test="contains(@w:instr,'NOTEREF')"><r>noteref</r></xsl:if>
-	<xsl:if test="contains(@w:instr,'MERGEFORMAT')"><r>mergeformat</r></xsl:if>
-	<xsl:if test="contains(@w:instr,' \r')"><r>instr_r</r></xsl:if>
-	<xsl:if test="contains(@w:instr,' \f')"><r>instr_f</r></xsl:if>
-	<xsl:if test="contains(@w:instr,' \n')"><r>instr_n</r></xsl:if>
-      </xsl:variable>
-<!--      <xsl:message>rends=<xsl:copy-of select="$rends"/></xsl:message> -->
-      <xsl:choose>
-	<!-- cross ref -->
-	<!-- <w:fldSimple w:instr=" REF _Ref260736521 \r \h  \* MERGEFORMAT ">            -->
-	<xsl:when test="contains(@w:instr,'NOTEREF _Ref')">
-	  <xsl:variable name="ref">
-	    <xsl:value-of select="substring-before(substring-after(@w:instr,'_'),' ')"/>
-	  </xsl:variable>
-	  <ref>
-	    <xsl:attribute name="rend">
-	      <xsl:value-of select="string-join(($rends/tei:r),' ')"/>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: fields.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handle simple fields
+		</desc>
+	</doc>
+	<xsl:template match="w:fldSimple">
+		<xsl:variable name="rstyle">
+			<xsl:value-of select="w:r/w:rPr/w:rStyle/@w:val" />
+		</xsl:variable>
+		<xsl:variable name="rends">
+			<r>fldSimple</r>
+			<xsl:if test="contains(@w:instr,'NOTEREF')">
+				<r>noteref</r>
+			</xsl:if>
+			<xsl:if test="contains(@w:instr,'MERGEFORMAT')">
+				<r>mergeformat</r>
+			</xsl:if>
+			<xsl:if test="contains(@w:instr,' \r')">
+				<r>instr_r</r>
+			</xsl:if>
+			<xsl:if test="contains(@w:instr,' \f')">
+				<r>instr_f</r>
+			</xsl:if>
+			<xsl:if test="contains(@w:instr,' \n')">
+				<r>instr_n</r>
+			</xsl:if>
+		</xsl:variable>
+		<!-- <xsl:message>rends=<xsl:copy-of select="$rends"/></xsl:message> -->
+		<xsl:choose>
+			<!-- cross ref -->
+			<!-- <w:fldSimple w:instr=" REF _Ref260736521 \r \h \* MERGEFORMAT "> -->
+			<xsl:when test="contains(@w:instr,'NOTEREF _Ref')">
+				<xsl:variable name="ref">
+					<xsl:value-of
+						select="substring-before(substring-after(@w:instr,'_'),' ')" />
+				</xsl:variable>
+				<ref>
+					<xsl:attribute name="rend">
+	      <xsl:value-of
+						select="string-join(($rends/tei:r),' ')" />
 	    </xsl:attribute>
-	    <xsl:attribute name="target" select="concat('#',$ref)"/>
-	    <xsl:if test="$rstyle!=''">
-	      <xsl:attribute name="iso:class"><xsl:value-of select="$rstyle"/></xsl:attribute>
-	    </xsl:if>
-	    <xsl:apply-templates/>
-	  </ref>	    
-	</xsl:when>
-	<xsl:when test="contains(@w:instr,'REF _Ref')">
-	  <xsl:variable name="ref">
-	    <xsl:value-of select="substring-before(substring-after(@w:instr,'_'),' ')"/>
-	  </xsl:variable>
-	  <ref>
-	    <xsl:attribute name="rend">
-	      <xsl:value-of select="string-join(($rends/tei:r),' ')"/>
+					<xsl:attribute name="target"
+						select="concat('#',$ref)" />
+					<xsl:if test="$rstyle!=''">
+						<xsl:attribute name="iso:class"><xsl:value-of
+							select="$rstyle" /></xsl:attribute>
+					</xsl:if>
+					<xsl:apply-templates />
+				</ref>
+			</xsl:when>
+			<xsl:when test="contains(@w:instr,'REF _Ref')">
+				<xsl:variable name="ref">
+					<xsl:value-of
+						select="substring-before(substring-after(@w:instr,'_'),' ')" />
+				</xsl:variable>
+				<ref>
+					<xsl:attribute name="rend">
+	      <xsl:value-of
+						select="string-join(($rends/tei:r),' ')" />
 	    </xsl:attribute>
-	    <xsl:attribute name="target" select="concat('#',$ref)"/>
-	    <xsl:if test="$rstyle!=''">
-	      <xsl:attribute name="iso:class"><xsl:value-of select="$rstyle"/></xsl:attribute>
-	    </xsl:if>
-	    <xsl:apply-templates/>
-	  </ref>	    
-	</xsl:when>
-	<xsl:when test="contains(@w:instr,'PAGE')"><!-- Page number -->
-	  <tei:dynamicContent type="pagenumber"/>
-	</xsl:when>
-	<xsl:when test="contains(@w:instr,'SEQ')"/><!-- not sure -->
-	<xsl:otherwise>
-	  <xsl:message terminate="yes">fldSimple: unrecognized type <xsl:value-of select="@w:instr"/></xsl:message>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-    
+					<xsl:attribute name="target"
+						select="concat('#',$ref)" />
+					<xsl:if test="$rstyle!=''">
+						<xsl:attribute name="iso:class"><xsl:value-of
+							select="$rstyle" /></xsl:attribute>
+					</xsl:if>
+					<xsl:apply-templates />
+				</ref>
+			</xsl:when>
+			<xsl:when test="contains(@w:instr,'PAGE')"><!-- Page number -->
+				<tei:dynamicContent type="pagenumber" />
+			</xsl:when>
+			<xsl:when test="contains(@w:instr,'SEQ')" /><!-- not sure -->
+			<xsl:otherwise>
+				<xsl:message terminate="yes">
+					fldSimple: unrecognized type
+					<xsl:value-of select="@w:instr" />
+				</xsl:message>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/pass0/pass0.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/pass0/pass0.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/pass0/pass0.xsl	(revision 2397)
@@ -1,132 +1,145 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns="http://www.tei-c.org/ns/1.0"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-		xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="ve o r m v wp w10 w wne mml
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="ve o r m v wp w10 w wne mml
 					 tei tbx">
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI Utility stylesheet for making Word docx files from TEI XML (see tei-docx.xsl)</p>
-         <p>This software is dual-licensed:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI Utility stylesheet for making Word docx files from TEI XML
+				(see tei-docx.xsl)</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: pass0.xsl 10152 2012-03-12 22:58:02Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:key name="STYLES" match="w:style" use="@w:styleId"/>
-  <xsl:param name="word-directory">..</xsl:param>
-  <xsl:param name="debug">false</xsl:param>  
-  
-  <xsl:template match="@*|text()|comment()|processing-instruction()" mode="pass0">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="w:body" mode="pass0">
-    <xsl:copy>
-      <xsl:choose>
-	<xsl:when test="w:p[tei:is-firstlevel-heading(.)]"/>
-	<xsl:otherwise>
-	  <w:p>
-	    <w:pPr>
-	      <w:pStyle w:val="Heading 1"/>
-	    </w:pPr>
-	    <w:r>
-	      <w:rPr>
-		<w:sz w:val="36"/>
-	      </w:rPr>
-	      <w:t/>
-	    </w:r>
-	  </w:p>
-	</xsl:otherwise>
-      </xsl:choose>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass0"/>
-    </xsl:copy>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: pass0.xsl 10152 2012-03-12 22:58:02Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  
-  <xsl:template match="*" mode="pass0">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass0"/>
-      </xsl:copy>
-  </xsl:template>
+	<xsl:key name="STYLES" match="w:style" use="@w:styleId" />
+	<xsl:param name="word-directory">
+		..
+	</xsl:param>
+	<xsl:param name="debug">
+		false
+	</xsl:param>
 
-  <xsl:template match="w:pStyle/@w:val|w:rStyle/@w:val" mode="pass0">
-      <xsl:variable name="old" select="."/>
-      <xsl:variable name="new">
-	<xsl:for-each select="$styledoc">
-	  <xsl:value-of select="key('STYLES',$old)/w:name/@w:val"/>
-	</xsl:for-each>
-      </xsl:variable>
-      <xsl:attribute name="w:val">
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="pass0">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="w:body" mode="pass0">
+		<xsl:copy>
+			<xsl:choose>
+				<xsl:when test="w:p[tei:is-firstlevel-heading(.)]" />
+				<xsl:otherwise>
+					<w:p>
+						<w:pPr>
+							<w:pStyle w:val="Heading 1" />
+						</w:pPr>
+						<w:r>
+							<w:rPr>
+								<w:sz w:val="36" />
+							</w:rPr>
+							<w:t />
+						</w:r>
+					</w:p>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass0" />
+		</xsl:copy>
+	</xsl:template>
+
+
+	<xsl:template match="*" mode="pass0">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass0" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="w:pStyle/@w:val|w:rStyle/@w:val"
+		mode="pass0">
+		<xsl:variable name="old" select="." />
+		<xsl:variable name="new">
+			<xsl:for-each select="$styledoc">
+				<xsl:value-of select="key('STYLES',$old)/w:name/@w:val" />
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:attribute name="w:val">
          <xsl:choose>
 	   <xsl:when test="$new=''">
-	     <xsl:value-of select="$old"/>
+	     <xsl:value-of select="$old" />
 	     <xsl:if test="$debug='true'">
-	       <xsl:message>! style <xsl:value-of select="$old"/> ... NOT FOUND    </xsl:message>
+	       <xsl:message>! style <xsl:value-of select="$old" /> ... NOT FOUND    </xsl:message>
 	     </xsl:if>
 	   </xsl:when>
 	   <xsl:when test="not($new=$old)">
 	     <xsl:if test="$debug='true'">
-	       <xsl:message>! style <xsl:value-of select="$old"/> ... CHANGED ...  <xsl:value-of select="$new"/>
+	       <xsl:message>! style <xsl:value-of select="$old" /> ... CHANGED ...  <xsl:value-of
+			select="$new" />
 	       </xsl:message>
 	     </xsl:if>
-	     <xsl:value-of select="$new"/>
+	     <xsl:value-of select="$new" />
 	   </xsl:when>
 	   <xsl:otherwise>
-	     <xsl:value-of select="$old"/>
+	     <xsl:value-of select="$old" />
 	   </xsl:otherwise>
          </xsl:choose>
       </xsl:attribute>
-  </xsl:template>
-  
+	</xsl:template>
 
-  <xsl:template
-      match="w:r[w:instrText][normalize-space(w:instrText)='']" mode="pass0"/>
 
+	<xsl:template
+		match="w:r[w:instrText][normalize-space(w:instrText)='']" mode="pass0" />
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/docxtotei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/docxtotei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/docxtotei.xsl	(revision 2397)
@@ -1,496 +1,516 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-		xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop
 					  iso m mml mo mv o pic r rel   html    tbx tei teidocx v xs ve w10 w wne wp">
 
-	  <xsl:import href="../../common2/functions.xsl"/>
-	  <xsl:import href="../utils/maths/omml2mml.xsl"/>
-	  <xsl:import href="../utils/functions.xsl"/>
-	  <xsl:import href="../utils/variables.xsl"/>
-	  <xsl:import href="../utils/identity/identity.xsl"/>
+	<xsl:import href="../../common2/functions.xsl" />
+	<xsl:import href="../utils/maths/omml2mml.xsl" />
+	<xsl:import href="../utils/functions.xsl" />
+	<xsl:import href="../utils/variables.xsl" />
+	<xsl:import href="../utils/identity/identity.xsl" />
 
-	  <xsl:import href="parameters.xsl"/>
-	  <xsl:include href="pass0/pass0.xsl"/>
-	  <xsl:include href="pass2/pass2.xsl"/>
-	
-	  <xsl:include href="dynamic/fields.xsl"/>
-	  <xsl:include href="dynamic/toc.xsl"/>
-	  <xsl:include href="graphics/graphics.xsl"/>
-	  <xsl:include href="lists/lists.xsl"/>
-	  <xsl:include href="marginals/marginals.xsl"/>
-	  <xsl:include href="maths/maths.xsl"/>
-	  <xsl:include href="paragraphs/paragraphs.xsl"/>
-	  <xsl:include href="tables/tables.xsl"/>
-	  <xsl:include href="templates/tei-templates.xsl"/>
-	  <xsl:include href="textruns/textruns.xsl"/>
-	  <xsl:include href="utils/utility-templates.xsl"/>
-	  <xsl:include href="wordsections/wordsections.xsl"/>
-	
-	
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+	<xsl:import href="parameters.xsl" />
+	<xsl:include href="pass0/pass0.xsl" />
+	<xsl:include href="pass2/pass2.xsl" />
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:include href="dynamic/fields.xsl" />
+	<xsl:include href="dynamic/toc.xsl" />
+	<xsl:include href="graphics/graphics.xsl" />
+	<xsl:include href="lists/lists.xsl" />
+	<xsl:include href="marginals/marginals.xsl" />
+	<xsl:include href="maths/maths.xsl" />
+	<xsl:include href="paragraphs/paragraphs.xsl" />
+	<xsl:include href="tables/tables.xsl" />
+	<xsl:include href="templates/tei-templates.xsl" />
+	<xsl:include href="textruns/textruns.xsl" />
+	<xsl:include href="utils/utility-templates.xsl" />
+	<xsl:include href="wordsections/wordsections.xsl" />
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: docxtotei.xsl 10200 2012-03-30 15:45:18Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				All rights reserved.
 
-	  <xsl:variable name="processor">
-		    <xsl:value-of select="system-property('xsl:vendor')"/>
-	  </xsl:variable>
-	  <xsl:variable name="digits">1234567890</xsl:variable>
-	  <xsl:variable name="characters">~!@#$%^&amp;*()&lt;&gt;{}[]|:;,.?`'"=+-_</xsl:variable>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-	  <xsl:variable name="wordDirectory">
-	    <xsl:value-of
-		select="translate($word-directory,'\\','/')"/>
-	  </xsl:variable>
-	  <xsl:variable name="docProps" select="doc(concat($wordDirectory,'/docProps/core.xml'))"/>
-	  <xsl:variable name="styledoc" select="doc(concat($wordDirectory,'/word/styles.xml'))"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-	<xsl:strip-space elements="*"/>
-	  <xsl:preserve-space elements="w:t"/>
-	  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: docxtotei.xsl 10200 2012-03-30 15:45:18Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>The main template that starts the conversion from docx to TEI</p>
-	 <p><b>IMPORTING STYLESHEETS AND OVERRIDING MATCHED TEMPLATES:</b></p>
-		
-	<p>When importing a stylesheet (xsl:import) all the templates
-	in the imported stylesheet get a lower import-precedence than
-	the ones in the importing stylesheet. If the importing
-	stylesheet wants to override, let's say a general template to
-	match all &lt;w:p&gt; elements where no more specialized rule
-	applies it can't, since it will automatically override all
-	w:p[somepredicate] template in the imported stylesheet as
-	well.  In this case we have outsourced the processing of the
-	general template into a named template and all the imported
-	stylesheet does is to call the named template. Now, the
-	importing stylesheet can simply override the named template,
-	and everything works out fine.</p>
-		
-	<p>See templates: - w:p (mode: paragraph)</p>
-	
-	<p>Modes:</p>
-	<ul>
-	  <li>pass0: a normalization process for styles. Can also
-	  detect illegal styles.</li>
-	  
-	  <li>pass2: templates that apply in the second stage
-	  of the conversion, cleaning TEI elements created in the
-	  first ise."</li>
-	  
-	  <li>inSectionGroup: defines a template that works on a
-	  group of consecutive elements (w:p or w:tbl elements) that
-	  form a section (a normal section, not to be confused with
-	  w:sectPr).</li>
-	  
-	  <li>paragraph: defines that the template
-	  works on an individual element (usually
-	  starting with a w:p element).  </li>
-	  
-	  <li>iden: simply copies the content</li>
-	</ul>
-	
-      </desc>
-   </doc>
-   <xsl:template match="/">
-     <!-- Do an initial normalization and store everything in $pass0 -->
-     <xsl:variable name="pass0">
-       <xsl:apply-templates mode="pass0"/>
-     </xsl:variable>
-     
-     <!-- Do the main transformation and store everything in the variable pass1 -->
-     <xsl:variable name="pass1">
-       <xsl:for-each select="$pass0">
-	 <xsl:apply-templates/>
-       </xsl:for-each>
-     </xsl:variable>		  
-     <!-- debug
-	 <xsl:result-document href="/tmp/foo.xml">
-	 <xsl:copy-of select="$pass1"/>
-	 </xsl:result-document>
-     -->
-     <!-- Do the final parse and create valid TEI -->
+	<xsl:variable name="processor">
+		<xsl:value-of select="system-property('xsl:vendor')" />
+	</xsl:variable>
+	<xsl:variable name="digits">
+		1234567890
+	</xsl:variable>
+	<xsl:variable name="characters">
+		~!@#$%^&amp;*()&lt;&gt;{}[]|:;,.?`'"=+-_
+	</xsl:variable>
 
-     <xsl:apply-templates select="$pass1" mode="pass2"/>
-     
-     <xsl:call-template name="fromDocxFinalHook"/>
-   </xsl:template>
-   
-   <xsl:template name="fromDocxFinalHook"/>
-   
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-     <desc>
-		Main document template
-     </desc>
-   </doc>
-	  <xsl:template match="w:document">
-	    <TEI>
-	      <!-- create teiHeader -->
-	      <xsl:call-template name="create-tei-header"/>
-	      
-	      <!-- convert main and back matter -->
-	      <xsl:apply-templates select="w:body"/>
-	    </TEI>
-	  </xsl:template>
 
+	<xsl:variable name="wordDirectory">
+		<xsl:value-of
+			select="translate($word-directory,'\\','/')" />
+	</xsl:variable>
+	<xsl:variable name="docProps"
+		select="doc(concat($wordDirectory,'/docProps/core.xml'))" />
+	<xsl:variable name="styledoc"
+		select="doc(concat($wordDirectory,'/word/styles.xml'))" />
 
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-	    <desc>
-	      Create the basic text; worry later about dividing it up
-	    </desc>
-	  </doc>
-	  <xsl:template match="w:body">
-	    <text>
-	      <!-- Create forme work -->
-	      <xsl:call-template name="extract-forme-work"/>
-	      
-	      <!-- create TEI body -->
-	      <body>
-		<xsl:call-template name="mainProcess"/>
-	      </body>
-	    </text>
-	  </xsl:template>
+	<xsl:strip-space elements="*" />
+	<xsl:preserve-space elements="w:t" />
+	<xsl:output method="xml" version="1.0" encoding="UTF-8"
+		indent="yes" />
 
-	  
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-	    <desc>
-	      Process the text by high-level divisions
-	    </desc>
-	  </doc>
-	  <xsl:template name="mainProcess">
-	    <!-- 
-		 group all paragraphs that form a first level section.
-	    -->
-	    <xsl:for-each-group select="w:sdt|w:p|w:tbl"
-				group-starting-with="w:p[tei:is-firstlevel-heading(.)]">
-	      
-	      <xsl:choose>
-		
-		<!-- We are dealing with a first level section, we now have
-		     to further divide the section into subsections that we can then
-		     finally work on -->
-		
-		<xsl:when test="tei:is-heading(.)">
-		  <xsl:call-template name="group-by-section"/>
-		</xsl:when>
-		
-		<!-- We have found some loose paragraphs. These are most probably
-		     front matter paragraps. We can simply convert them without further
-		     trying to split them up into sub sections. -->
-		<xsl:otherwise>
-		  <xsl:apply-templates select="." mode="inSectionGroup"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:for-each-group>
-	    
-	    <!-- I have no idea why I need this, but I apparently do. 
-		 //TODO: find out what is going on-->
-	    <xsl:apply-templates select="w:sectPr" mode="paragraph"/>
-	  </xsl:template>
-	  
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-	    <desc>
-	      <p>Bookmarks in section mode</p>
-	      <p>
-		There are certain elements that we don't really care about, but that
-		force us to regroup everything from the next sibling on.
-		
-		@see grouping in construction of headline outline.
-	      </p>
-	    </desc>
-	  </doc>
-	  <xsl:template match="w:bookmarkStart|w:bookmarkEnd"
-			mode="inSectionGroup">
-	    <xsl:for-each-group select="current-group() except ." group-adjacent="1">
-	      <xsl:apply-templates select="." mode="inSectionGroup"/>
-	    </xsl:for-each-group>
-	  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>The main template that starts the conversion from docx to TEI</p>
+			<p>
+				<b>IMPORTING STYLESHEETS AND OVERRIDING MATCHED TEMPLATES:</b>
+			</p>
 
+			<p>When importing a stylesheet (xsl:import) all the templates
+				in the imported stylesheet get a lower import-precedence than
+				the ones in the importing stylesheet. If the importing
+				stylesheet wants to override, let's say a general template to
+				match all &lt;w:p&gt; elements where no more specialized rule
+				applies it can't, since it will automatically override all
+				w:p[somepredicate] template in the imported stylesheet as
+				well. In this case we have outsourced the processing of the
+				general template into a named template and all the imported
+				stylesheet does is to call the named template. Now, the
+				importing stylesheet can simply override the named template,
+				and everything works out fine.</p>
 
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-	    <desc>
-	      <p>Bookmarks in normal mode</p>
-	      <p>Copy bookmarks for processing in pass 2</p>
-	    </desc>
-	  </doc>
-	  <xsl:template match="w:bookmarkStart|w:bookmarkEnd" >
-	    <xsl:choose>
-	    <xsl:when test="starts-with(@w:name,'_Ref')">
-	      <xsl:copy-of select="."/>
-	    </xsl:when>
-	    <xsl:when test="self::w:bookmarkEnd"/>
-	    <xsl:otherwise>
-	      <ANCHOR>
-		<xsl:attribute name="xml:id" select="substring(@w:name,2)"/>
-	      </ANCHOR>
-	    </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:template>
-	  
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Grouping consecutive elements that belong together</p>
-         <p>
-		We are now working on a group of all elements inside some group bounded by
-		headings. These need to be further split up into smaller groups for figures,
-		list etc. and into individual groups for simple paragraphs...
-		</p>
-      </desc>
-	  </doc>
-	  <xsl:template match="w:tbl|w:p" mode="inSectionGroup">
-	    
-	    <!-- 
-		 We are looking for:
-		 - Lists -> 1
-		 - Table of Contents -> 2
-		 - Figures -> 3
-		 
-		 Anything else is assigned a number of position()+100. This should be
-		 sufficient even if we find lots more things to group.
-	    -->
-	    <xsl:for-each-group 
-		select="current-group()"
-		group-adjacent="if       (tei:is-list(.))  then 1
+			<p>See templates: - w:p (mode: paragraph)</p>
+
+			<p>Modes:</p>
+			<ul>
+				<li>pass0: a normalization process for styles. Can also
+					detect illegal styles.</li>
+
+				<li>pass2: templates that apply in the second stage
+					of the conversion, cleaning TEI elements created in the
+					first ise."</li>
+
+				<li>inSectionGroup: defines a template that works on a
+					group of consecutive elements (w:p or w:tbl elements) that
+					form a section (a normal section, not to be confused with
+					w:sectPr).</li>
+
+				<li>paragraph: defines that the template
+					works on an individual element (usually
+					starting with a w:p element).
+				</li>
+
+				<li>iden: simply copies the content</li>
+			</ul>
+
+		</desc>
+	</doc>
+	<xsl:template match="/">
+		<!-- Do an initial normalization and store everything in $pass0 -->
+		<xsl:variable name="pass0">
+			<xsl:apply-templates mode="pass0" />
+		</xsl:variable>
+
+		<!-- Do the main transformation and store everything in the variable pass1 -->
+		<xsl:variable name="pass1">
+			<xsl:for-each select="$pass0">
+				<xsl:apply-templates />
+			</xsl:for-each>
+		</xsl:variable>
+		<!-- debug <xsl:result-document href="/tmp/foo.xml"> <xsl:copy-of select="$pass1"/> 
+			</xsl:result-document> -->
+		<!-- Do the final parse and create valid TEI -->
+
+		<xsl:apply-templates select="$pass1" mode="pass2" />
+
+		<xsl:call-template name="fromDocxFinalHook" />
+	</xsl:template>
+
+	<xsl:template name="fromDocxFinalHook" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Main document template
+		</desc>
+	</doc>
+	<xsl:template match="w:document">
+		<TEI>
+			<!-- create teiHeader -->
+			<xsl:call-template name="create-tei-header" />
+
+			<!-- convert main and back matter -->
+			<xsl:apply-templates select="w:body" />
+		</TEI>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Create the basic text; worry later about dividing it up
+		</desc>
+	</doc>
+	<xsl:template match="w:body">
+		<text>
+			<!-- Create forme work -->
+			<xsl:call-template name="extract-forme-work" />
+
+			<!-- create TEI body -->
+			<body>
+				<xsl:call-template name="mainProcess" />
+			</body>
+		</text>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Process the text by high-level divisions
+		</desc>
+	</doc>
+	<xsl:template name="mainProcess">
+		<!-- group all paragraphs that form a first level section. -->
+		<xsl:for-each-group select="w:sdt|w:p|w:tbl"
+			group-starting-with="w:p[tei:is-firstlevel-heading(.)]">
+
+			<xsl:choose>
+
+				<!-- We are dealing with a first level section, we now have to further 
+					divide the section into subsections that we can then finally work on -->
+
+				<xsl:when test="tei:is-heading(.)">
+					<xsl:call-template name="group-by-section" />
+				</xsl:when>
+
+				<!-- We have found some loose paragraphs. These are most probably front 
+					matter paragraps. We can simply convert them without further trying to split 
+					them up into sub sections. -->
+				<xsl:otherwise>
+					<xsl:apply-templates select="."
+						mode="inSectionGroup" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+
+		<!-- I have no idea why I need this, but I apparently do. //TODO: find 
+			out what is going on -->
+		<xsl:apply-templates select="w:sectPr"
+			mode="paragraph" />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Bookmarks in section mode</p>
+			<p>
+				There are certain elements that we don't really care about, but that
+				force us to regroup everything from the next sibling on.
+
+				@see grouping in construction of headline outline.
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="w:bookmarkStart|w:bookmarkEnd"
+		mode="inSectionGroup">
+		<xsl:for-each-group
+			select="current-group() except ." group-adjacent="1">
+			<xsl:apply-templates select="."
+				mode="inSectionGroup" />
+		</xsl:for-each-group>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Bookmarks in normal mode</p>
+			<p>Copy bookmarks for processing in pass 2</p>
+		</desc>
+	</doc>
+	<xsl:template match="w:bookmarkStart|w:bookmarkEnd">
+		<xsl:choose>
+			<xsl:when test="starts-with(@w:name,'_Ref')">
+				<xsl:copy-of select="." />
+			</xsl:when>
+			<xsl:when test="self::w:bookmarkEnd" />
+			<xsl:otherwise>
+				<ANCHOR>
+					<xsl:attribute name="xml:id"
+						select="substring(@w:name,2)" />
+				</ANCHOR>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Grouping consecutive elements that belong together</p>
+			<p>
+				We are now working on a group of all elements inside some group
+				bounded by
+				headings. These need to be further split up into smaller groups for figures,
+				list etc. and into individual groups for simple paragraphs...
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="w:tbl|w:p" mode="inSectionGroup">
+
+		<!-- We are looking for: - Lists -> 1 - Table of Contents -> 2 - Figures 
+			-> 3 Anything else is assigned a number of position()+100. This should be 
+			sufficient even if we find lots more things to group. -->
+		<xsl:for-each-group select="current-group()"
+			group-adjacent="if       (tei:is-list(.))  then 1
 				else  if (tei:is-toc(.))   then 2
 				else  if (tei:is-figure(.)) then 3
 				else  if (tei:is-line(.)) then 4
 				else position() + 100">
-	      
-	      <!-- For each defined grouping call a specific template. If there is no
-		   grouping defined, apply templates with mode
-		   paragraph -->
-	      <xsl:choose>
-		<xsl:when test="current-grouping-key()=1">
-		  <xsl:call-template name="listSection"/>
-		</xsl:when>
-		<xsl:when test="current-grouping-key()=2">
-		  <xsl:call-template name="tocSection"/>
-		</xsl:when>
-		<xsl:when test="current-grouping-key()=3">
-		  <xsl:call-template name="figureSection"/>
-		</xsl:when>
-		<xsl:when test="current-grouping-key()=4">
-		  <xsl:call-template name="lineSection"/>
-		</xsl:when>
-		<!-- it is not a defined grouping .. apply templates -->
-		<xsl:otherwise>
-		  <xsl:apply-templates select="." mode="paragraph"/>
-		</xsl:otherwise>
-	      </xsl:choose>
-	    </xsl:for-each-group>
-	  </xsl:template>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-	Creating a group of a figure
-      </desc>
-   </doc>
-    <xsl:template name="figureSection">
-      <figure>
-	<xsl:for-each select="current-group()">
-	  <xsl:apply-templates select="." mode="paragraph"/>
-	</xsl:for-each>
-      </figure>
-    </xsl:template>
+			<!-- For each defined grouping call a specific template. If there is no 
+				grouping defined, apply templates with mode paragraph -->
+			<xsl:choose>
+				<xsl:when test="current-grouping-key()=1">
+					<xsl:call-template name="listSection" />
+				</xsl:when>
+				<xsl:when test="current-grouping-key()=2">
+					<xsl:call-template name="tocSection" />
+				</xsl:when>
+				<xsl:when test="current-grouping-key()=3">
+					<xsl:call-template name="figureSection" />
+				</xsl:when>
+				<xsl:when test="current-grouping-key()=4">
+					<xsl:call-template name="lineSection" />
+				</xsl:when>
+				<!-- it is not a defined grouping .. apply templates -->
+				<xsl:otherwise>
+					<xsl:apply-templates select="."
+						mode="paragraph" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+	</xsl:template>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-	Creating a gloss list
-      </desc>
-   </doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Creating a group of a figure
+		</desc>
+	</doc>
+	<xsl:template name="figureSection">
+		<figure>
+			<xsl:for-each select="current-group()">
+				<xsl:apply-templates select="." mode="paragraph" />
+			</xsl:for-each>
+		</figure>
+	</xsl:template>
 
-    <xsl:template name="glossListSection">
-      <list type="gloss">
-	<xsl:for-each select="current-group()">
-	  <xsl:apply-templates select="." mode="paragraph"/>
-	</xsl:for-each>
-      </list>
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Creating a gloss list
+		</desc>
+	</doc>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-	Creating a group of a figure
-      </desc>
-   </doc>
-    <xsl:template name="lineSection">
-      <lg>
-	<xsl:for-each select="current-group()">
-	  <xsl:apply-templates select="." mode="paragraph"/>
-	</xsl:for-each>
-      </lg>
-    </xsl:template>
+	<xsl:template name="glossListSection">
+		<list type="gloss">
+			<xsl:for-each select="current-group()">
+				<xsl:apply-templates select="." mode="paragraph" />
+			</xsl:for-each>
+		</list>
+	</xsl:template>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-	Groups the document by headings and thereby creating the document structure. 
-      </desc>
-   </doc>
-   <xsl:template name="group-by-section">
-     <xsl:variable name="Style" select="w:pPr/w:pStyle/@w:val"/>
-     <xsl:variable name="NextHeader" select="tei:get-nextlevel-header($Style)"/>
-     <div>
-       <!-- generate the head -->
-       <xsl:call-template name="generate-section-heading">
-	 <xsl:with-param name="Style" select="$Style"/>
-       </xsl:call-template>
-       <!-- Process sub-sections -->
-       <xsl:for-each-group select="current-group() except ."
-			   group-starting-with="w:p[w:pPr/w:pStyle/@w:val=$NextHeader]">
-	 <xsl:choose>
-	   <xsl:when test="tei:is-heading(.)">
-	     <xsl:call-template name="group-by-section"/>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:apply-templates select="." mode="inSectionGroup"/>
-	   </xsl:otherwise>
-	 </xsl:choose>
-       </xsl:for-each-group>
-     </div>
-   </xsl:template>
-   
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Creating a group of a figure
+		</desc>
+	</doc>
+	<xsl:template name="lineSection">
+		<lg>
+			<xsl:for-each select="current-group()">
+				<xsl:apply-templates select="." mode="paragraph" />
+			</xsl:for-each>
+		</lg>
+	</xsl:template>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-     <desc>
-       <p>Looks through the document to find forme work related sections.</p>
-       <p>
-	 Creates a &lt;fw&gt; element for each forme work related section. These include
-	 running headers and footers. The corresponding elements in OOXML are w:headerReference
-	 and w:footerReference. These elements only define a reference that to a header or
-	 footer definition file. The reference itself is resolved in the file word/_rels/document.xml.rels.
-       </p>
-     </desc>
-   </doc>
-	  <xsl:template name="extract-forme-work">
-	    <xsl:if test="preserveWordHeadersFooters='true'">
-		    <xsl:for-each-group select="//w:headerReference|//w:footerReference" group-by="@r:id">
-			      <fw>
-				        <xsl:attribute name="xml:id">
-					          <xsl:value-of select="@r:id"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Groups the document by headings and thereby creating the document
+			structure.
+		</desc>
+	</doc>
+	<xsl:template name="group-by-section">
+		<xsl:variable name="Style" select="w:pPr/w:pStyle/@w:val" />
+		<xsl:variable name="NextHeader"
+			select="tei:get-nextlevel-header($Style)" />
+		<div>
+			<!-- generate the head -->
+			<xsl:call-template name="generate-section-heading">
+				<xsl:with-param name="Style" select="$Style" />
+			</xsl:call-template>
+			<!-- Process sub-sections -->
+			<xsl:for-each-group
+				select="current-group() except ."
+				group-starting-with="w:p[w:pPr/w:pStyle/@w:val=$NextHeader]">
+				<xsl:choose>
+					<xsl:when test="tei:is-heading(.)">
+						<xsl:call-template name="group-by-section" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates select="."
+							mode="inSectionGroup" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each-group>
+		</div>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Looks through the document to find forme work related sections.</p>
+			<p>
+				Creates a &lt;fw&gt; element for each forme work related section. These
+				include
+				running headers and footers. The corresponding elements in OOXML are
+				w:headerReference
+				and w:footerReference. These elements only define a reference that to a
+				header or
+				footer definition file. The reference itself is resolved in the file
+				word/_rels/document.xml.rels.
+			</p>
+		</desc>
+	</doc>
+	<xsl:template name="extract-forme-work">
+		<xsl:if test="preserveWordHeadersFooters='true'">
+			<xsl:for-each-group
+				select="//w:headerReference|//w:footerReference" group-by="@r:id">
+				<fw>
+					<xsl:attribute name="xml:id">
+					          <xsl:value-of select="@r:id" />
 				        </xsl:attribute>
-				        <xsl:attribute name="type">
+					<xsl:attribute name="type">
 					          <xsl:choose>
 						            <xsl:when test="self::w:headerReference">header</xsl:when>
 						            <xsl:otherwise>footer</xsl:otherwise>
 					          </xsl:choose>
 				        </xsl:attribute>
 
-				        <xsl:variable name="rid" select="@r:id"/>
-				        <xsl:variable name="h-file">
-					          <xsl:value-of select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
-				        </xsl:variable>
+					<xsl:variable name="rid" select="@r:id" />
+					<xsl:variable name="h-file">
+						<xsl:value-of
+							select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
+					</xsl:variable>
 
-				        <!-- for the moment, just copy content -->
-				<xsl:if test="doc-available(concat($wordDirectory,'/word/', $h-file))">
-					          <xsl:for-each-group select="document(concat($wordDirectory,'/word/', $h-file))/*[1]/w:*"
-                                   group-adjacent="1">
-						            <xsl:apply-templates select="." mode="inSectionGroup"/>
-					          </xsl:for-each-group>
-				        </xsl:if>
+					<!-- for the moment, just copy content -->
+					<xsl:if
+						test="doc-available(concat($wordDirectory,'/word/', $h-file))">
+						<xsl:for-each-group
+							select="document(concat($wordDirectory,'/word/', $h-file))/*[1]/w:*"
+							group-adjacent="1">
+							<xsl:apply-templates select="."
+								mode="inSectionGroup" />
+						</xsl:for-each-group>
+					</xsl:if>
 
-			      </fw>
-		    </xsl:for-each-group>
-	    </xsl:if>
-	  </xsl:template>
+				</fw>
+			</xsl:for-each-group>
+		</xsl:if>
+	</xsl:template>
 
-   <xsl:template match="w:hyperlink">
-      <ref>
-	<xsl:variable name="rid" select="@r:id"/>
-	<xsl:attribute name="target">
+	<xsl:template match="w:hyperlink">
+		<ref>
+			<xsl:variable name="rid" select="@r:id" />
+			<xsl:attribute name="target">
 	  <xsl:choose>
 	    <xsl:when test="ancestor::w:endnote">
 	      <xsl:value-of
-		  select="document(concat($wordDirectory,'/word/_rels/endnotes.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
+				select="document(concat($wordDirectory,'/word/_rels/endnotes.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
 	    </xsl:when>
 	    <xsl:otherwise>
 	      <xsl:value-of
-		  select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
+				select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
 	    </xsl:otherwise>
 	  </xsl:choose>
 	</xsl:attribute>
-	<xsl:apply-templates/>
-      </ref>
-   </xsl:template>
+			<xsl:apply-templates />
+		</ref>
+	</xsl:template>
 
-   <xsl:template match="w:instrText">
-      <xsl:choose>
-         <xsl:when test="contains(.,'REF _')"></xsl:when>
-         <xsl:when test="starts-with(.,'HYPERLINK')"></xsl:when>
-         <xsl:when test="starts-with(.,' XE')"></xsl:when>
-         <xsl:when test="starts-with(.,'XE')"></xsl:when>
-         <xsl:otherwise>
-            <xsl:value-of select="."/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="w:instrText">
+		<xsl:choose>
+			<xsl:when test="contains(.,'REF _')"></xsl:when>
+			<xsl:when test="starts-with(.,'HYPERLINK')"></xsl:when>
+			<xsl:when test="starts-with(.,' XE')"></xsl:when>
+			<xsl:when test="starts-with(.,'XE')"></xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template match="@rend[.='Body_Text']" mode="pass2"/>
+	<xsl:template match="@rend[.='Body_Text']" mode="pass2" />
 
-    <xsl:template match="@rend[.='Normal (Web)']" mode="pass2"/>
+	<xsl:template match="@rend[.='Normal (Web)']" mode="pass2" />
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/paragraphs/paragraphs.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/paragraphs/paragraphs.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/paragraphs/paragraphs.xsl	(revision 2397)
@@ -1,291 +1,331 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: paragraphs.xsl 10152 2012-03-12 22:58:02Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-   <xsl:variable name="dblq">"</xsl:variable>
-   <xsl:variable name="dblqplusr">" \r "</xsl:variable>
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Calls the named template paragraph-wp that can be overriden.</p>
-         <p>
-            See comment at begin of document to understand why this template is calling
-            a named template.
-            
-            This stylesheet is handling simple paragraphs that we know nothing else
-            about.
-        </p>
-      </desc>
-   </doc>
-    <xsl:template match="w:p" mode="paragraph">
-      <xsl:variable name="style" select="w:pPr/w:pStyle/@w:val"/>
-      <xsl:choose>
-	<xsl:when test="$style='tei_lg'"/>
-	<xsl:when test="$style='GeneratedTitle'"/>
-	<xsl:when test="$style='GeneratedSubTitle'"/>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-	<xsl:when test="$style='tei_l'">
-	  <l>
-	    <xsl:apply-templates/>
-	  </l>
-	</xsl:when>
-	<xsl:when test="$style='Tabletitle'">
-	  <head>
-	    <xsl:apply-templates/>
-	  </head>
-	</xsl:when>
-	<xsl:when test="$style='dl'">
-	  <GLOSSITEM>
-	    <xsl:apply-templates/>
-	  </GLOSSITEM>
-	</xsl:when>
-	<xsl:when test="$style='tei_signed'">
-	  <signed>
-	    <xsl:apply-templates/>
-	  </signed>
-	</xsl:when>
-	<xsl:when test="$style='tei_speaker'">
-	  <speaker>
-	    <xsl:apply-templates/>
-	  </speaker>
-	</xsl:when>
-	<xsl:when test="$style='tei_speech'">
-	  <speech>
-	    <xsl:apply-templates/>
-	  </speech>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:call-template name="paragraph-wp">
-	    <xsl:with-param name="style" select="$style"/>
-	  </xsl:call-template>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Named template for handling w:p; we 
-       use the Word style (if provided) to make a TEI rend attribute,
-       and check for change records.
-    </desc>
-   </doc>
-   <xsl:template name="paragraph-wp">
-     <xsl:param name="style"/>
-     <xsl:element name="p">
-       <xsl:if test="$style and not($style='Default')">
-	 <xsl:attribute name="rend">
-	   <xsl:value-of select="$style"/>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: paragraphs.xsl 10152 2012-03-12 22:58:02Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:variable name="dblq">
+		"
+	</xsl:variable>
+	<xsl:variable name="dblqplusr">
+		" \r "
+	</xsl:variable>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Calls the named template paragraph-wp that can be overriden.</p>
+			<p>
+				See comment at begin of document to understand why this template is
+				calling
+				a named template.
+
+				This stylesheet is handling simple paragraphs that we know nothing else
+				about.
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="w:p" mode="paragraph">
+		<xsl:variable name="style" select="w:pPr/w:pStyle/@w:val" />
+		<xsl:choose>
+			<xsl:when test="$style='tei_lg'" />
+			<xsl:when test="$style='GeneratedTitle'" />
+			<xsl:when test="$style='GeneratedSubTitle'" />
+
+			<xsl:when test="$style='tei_l'">
+				<l>
+					<xsl:apply-templates />
+				</l>
+			</xsl:when>
+			<xsl:when test="$style='Tabletitle'">
+				<head>
+					<xsl:apply-templates />
+				</head>
+			</xsl:when>
+			<xsl:when test="$style='dl'">
+				<GLOSSITEM>
+					<xsl:apply-templates />
+				</GLOSSITEM>
+			</xsl:when>
+			<xsl:when test="$style='tei_signed'">
+				<signed>
+					<xsl:apply-templates />
+				</signed>
+			</xsl:when>
+			<xsl:when test="$style='tei_speaker'">
+				<speaker>
+					<xsl:apply-templates />
+				</speaker>
+			</xsl:when>
+			<xsl:when test="$style='tei_speech'">
+				<speech>
+					<xsl:apply-templates />
+				</speech>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="paragraph-wp">
+					<xsl:with-param name="style" select="$style" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Named template for handling w:p; we
+			use the Word style (if provided) to make a TEI rend attribute,
+			and check for change records.
+		</desc>
+	</doc>
+	<xsl:template name="paragraph-wp">
+		<xsl:param name="style" />
+		<xsl:element name="p">
+			<xsl:if test="$style and not($style='Default')">
+				<xsl:attribute name="rend">
+	   <xsl:value-of select="$style" />
 	 </xsl:attribute>
-       </xsl:if>
-       <xsl:if test="w:pPr/w:pStyle/w:rPr/w:rtl">
-	 <xsl:attribute name="dir"
-			xmlns="http://www.w3.org/2005/11/its">
+			</xsl:if>
+			<xsl:if test="w:pPr/w:pStyle/w:rPr/w:rtl">
+				<xsl:attribute name="dir"
+					xmlns="http://www.w3.org/2005/11/its">
 	   <xsl:text>rtl</xsl:text>
 	 </xsl:attribute>
-       </xsl:if>
-       <xsl:choose>
-	 <xsl:when test="w:pPr/w:rPr/w:ins">
-	   <add when="{w:pPr/w:rPr/w:ins/@w:date}" 
-		type="para">
-	     <xsl:call-template name="identifyChange">
-	       <xsl:with-param name="who"
-			       select="w:pPr/w:rPr/w:ins/@w:author"/>
-	     </xsl:call-template>
-	     <xsl:call-template name="process-checking-for-crossrefs"/>
-	   </add>
-	 </xsl:when>
-	 <xsl:otherwise>
-	   <xsl:call-template name="process-checking-for-crossrefs"/>
-	 </xsl:otherwise>
-       </xsl:choose>
-     </xsl:element>
-   </xsl:template>
-   
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-	Named template for handling processing any cross-references found.
-    </desc>
-    </doc>
-    <xsl:template name="process-checking-for-crossrefs">
-      <xsl:choose>
-	<xsl:when
-	    test="w:r/w:fldChar[@w:fldCharType='begin']">
-	  <xsl:for-each-group select="w:*|m:*"
-			      group-starting-with="w:r[w:fldChar/@w:fldCharType[matches(.,'begin|end')]]">
-	    <xsl:choose>
-	      <xsl:when test="self::w:r/w:fldChar[@w:fldCharType='begin']">
-		<xsl:variable name="rends">
-		  <!-- collect all the rends for concatenation later -->
-		  <xsl:choose>
-		    <xsl:when
-			test="contains(following-sibling::w:r[w:instrText][1],'NOTEREF')"><r>noteref</r></xsl:when>
-		    <xsl:when
-			test="contains(following-sibling::w:r[w:instrText][1],'SEQ')"><r>SEQ</r></xsl:when>
-		    <xsl:when test="contains(following-sibling::w:r[w:instrText][1],'XE')"><r>index</r></xsl:when>
-		    <xsl:when test="contains(following-sibling::w:r[w:instrText][1],'REF')"><r>ref</r></xsl:when>
-		  </xsl:choose>
-		  <xsl:if test="contains(following-sibling::w:r[w:instrText][1],'\r')"><r>instr_r</r></xsl:if>
-		  <xsl:if test="contains(following-sibling::w:r[w:instrText][1],'\f')"><r>instr_f</r></xsl:if>
-		  <xsl:if test="contains(following-sibling::w:r[w:instrText][1],'\n')"><r>instr_n</r></xsl:if>
-		  <xsl:if test="contains(following-sibling::w:r[w:instrText][1],'MERGEFORMAT')"><r>mergeformat</r></xsl:if>
-		</xsl:variable>
-		<xsl:choose>
-		  <xsl:when test="$rends/tei:r='index'">
-		    <index>
-		      <term>
-		      <xsl:for-each
-			  select="current-group()//w:instrText">
+			</xsl:if>
 			<xsl:choose>
-			  <xsl:when test=".='XE'"/>
-			  <xsl:when test="normalize-space(.)=$dblq"/>
-			  <xsl:when test="starts-with(normalize-space(.),$dblqplusr)"/>
-			  <xsl:otherwise>
-			    <xsl:apply-templates/>
-			  </xsl:otherwise>
+				<xsl:when test="w:pPr/w:rPr/w:ins">
+					<add when="{w:pPr/w:rPr/w:ins/@w:date}" type="para">
+						<xsl:call-template name="identifyChange">
+							<xsl:with-param name="who"
+								select="w:pPr/w:rPr/w:ins/@w:author" />
+						</xsl:call-template>
+						<xsl:call-template
+							name="process-checking-for-crossrefs" />
+					</add>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template
+						name="process-checking-for-crossrefs" />
+				</xsl:otherwise>
 			</xsl:choose>
-		      </xsl:for-each>
-		      </term>
-		    </index>
-		  </xsl:when>
-		  <xsl:when test="$rends/tei:r='SEQ'">
-		    <xsl:variable name="What"
-				  select="following-sibling::w:r/w:instrText[1]"/>
-		    <xsl:number level="any" count="w:r[w:fldChar/@w:fldCharType='begin'][following-sibling::w:r/w:instrText=$What]"/>
-		  </xsl:when>
-		  <xsl:otherwise>
-		    <ref>
-		      <xsl:if test="$rends/tei:r">
-			<xsl:attribute name="rend">
-			  <xsl:value-of select="string-join(($rends/tei:r),' ')"/>
+		</xsl:element>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Named template for handling processing any cross-references found.
+		</desc>
+	</doc>
+	<xsl:template name="process-checking-for-crossrefs">
+		<xsl:choose>
+			<xsl:when test="w:r/w:fldChar[@w:fldCharType='begin']">
+				<xsl:for-each-group select="w:*|m:*"
+					group-starting-with="w:r[w:fldChar/@w:fldCharType[matches(.,'begin|end')]]">
+					<xsl:choose>
+						<xsl:when
+							test="self::w:r/w:fldChar[@w:fldCharType='begin']">
+							<xsl:variable name="rends">
+								<!-- collect all the rends for concatenation later -->
+								<xsl:choose>
+									<xsl:when
+										test="contains(following-sibling::w:r[w:instrText][1],'NOTEREF')">
+										<r>noteref</r>
+									</xsl:when>
+									<xsl:when
+										test="contains(following-sibling::w:r[w:instrText][1],'SEQ')">
+										<r>SEQ</r>
+									</xsl:when>
+									<xsl:when
+										test="contains(following-sibling::w:r[w:instrText][1],'XE')">
+										<r>index</r>
+									</xsl:when>
+									<xsl:when
+										test="contains(following-sibling::w:r[w:instrText][1],'REF')">
+										<r>ref</r>
+									</xsl:when>
+								</xsl:choose>
+								<xsl:if
+									test="contains(following-sibling::w:r[w:instrText][1],'\r')">
+									<r>instr_r</r>
+								</xsl:if>
+								<xsl:if
+									test="contains(following-sibling::w:r[w:instrText][1],'\f')">
+									<r>instr_f</r>
+								</xsl:if>
+								<xsl:if
+									test="contains(following-sibling::w:r[w:instrText][1],'\n')">
+									<r>instr_n</r>
+								</xsl:if>
+								<xsl:if
+									test="contains(following-sibling::w:r[w:instrText][1],'MERGEFORMAT')">
+									<r>mergeformat</r>
+								</xsl:if>
+							</xsl:variable>
+							<xsl:choose>
+								<xsl:when test="$rends/tei:r='index'">
+									<index>
+										<term>
+											<xsl:for-each
+												select="current-group()//w:instrText">
+												<xsl:choose>
+													<xsl:when test=".='XE'" />
+													<xsl:when test="normalize-space(.)=$dblq" />
+													<xsl:when
+														test="starts-with(normalize-space(.),$dblqplusr)" />
+													<xsl:otherwise>
+														<xsl:apply-templates />
+													</xsl:otherwise>
+												</xsl:choose>
+											</xsl:for-each>
+										</term>
+									</index>
+								</xsl:when>
+								<xsl:when test="$rends/tei:r='SEQ'">
+									<xsl:variable name="What"
+										select="following-sibling::w:r/w:instrText[1]" />
+									<xsl:number level="any"
+										count="w:r[w:fldChar/@w:fldCharType='begin'][following-sibling::w:r/w:instrText=$What]" />
+								</xsl:when>
+								<xsl:otherwise>
+									<ref>
+										<xsl:if test="$rends/tei:r">
+											<xsl:attribute name="rend">
+			  <xsl:value-of
+												select="string-join(($rends/tei:r),' ')" />
 			</xsl:attribute>
-		      </xsl:if>
-		      <xsl:if test="following-sibling::w:r[w:rPr][1]/w:rStyle">
-			<xsl:attribute name="iso:class">
-			  <xsl:value-of select="following-sibling::w:r[w:rPr][1]/w:rStyle/w:rPr/w:rStyle/@w:val"/>
+										</xsl:if>
+										<xsl:if
+											test="following-sibling::w:r[w:rPr][1]/w:rStyle">
+											<xsl:attribute name="iso:class">
+			  <xsl:value-of
+												select="following-sibling::w:r[w:rPr][1]/w:rStyle/w:rPr/w:rStyle/@w:val" />
 			</xsl:attribute>
-		      </xsl:if> 
-		      <xsl:for-each select="current-group()">
-			<xsl:if test="self::w:r[w:instrText]">			    
-			  <xsl:variable name="ref">
-			    <xsl:choose>
-			      <xsl:when test="contains(w:instrText,'REF _')"> <!-- this will also catch NOTEREF _ -->
-				<xsl:text>#</xsl:text>
-				<xsl:value-of select="substring-before(substring-after(w:instrText,'_'),'&#32;')"/>
-			      </xsl:when>
-			      <xsl:when test="contains(w:instrText,'HYPERLINK')">
-				<xsl:value-of select="substring-before(substring-after(w:instrText,'&#x0022;'),'&#x0022;')"/>
-			      </xsl:when>
-			    </xsl:choose>
-			  </xsl:variable>
-			  <xsl:attribute name="target" select="$ref"/>
-			</xsl:if>
-		      </xsl:for-each>
-		      <xsl:for-each select="current-group()">
-			<xsl:choose>
-			  <xsl:when  test="self::w:bookmarkStart">
-			    <xsl:apply-templates select="."/>
-			  </xsl:when>
-			  <xsl:otherwise>
-			    <xsl:apply-templates select="."/>
-			  </xsl:otherwise>
-			</xsl:choose>
-		      </xsl:for-each>
-		    </ref>
-		  </xsl:otherwise>
+										</xsl:if>
+										<xsl:for-each select="current-group()">
+											<xsl:if test="self::w:r[w:instrText]">
+												<xsl:variable name="ref">
+													<xsl:choose>
+														<xsl:when test="contains(w:instrText,'REF _')"> <!-- this will also catch NOTEREF _ -->
+															<xsl:text>#</xsl:text>
+															<xsl:value-of
+																select="substring-before(substring-after(w:instrText,'_'),'&#32;')" />
+														</xsl:when>
+														<xsl:when
+															test="contains(w:instrText,'HYPERLINK')">
+															<xsl:value-of
+																select="substring-before(substring-after(w:instrText,'&#x0022;'),'&#x0022;')" />
+														</xsl:when>
+													</xsl:choose>
+												</xsl:variable>
+												<xsl:attribute name="target" select="$ref" />
+											</xsl:if>
+										</xsl:for-each>
+										<xsl:for-each select="current-group()">
+											<xsl:choose>
+												<xsl:when test="self::w:bookmarkStart">
+													<xsl:apply-templates select="." />
+												</xsl:when>
+												<xsl:otherwise>
+													<xsl:apply-templates select="." />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:for-each>
+									</ref>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:when>
+						<xsl:when
+							test="self::w:r[w:fldChar/@w:fldCharType[matches(.,'end')]]">
+							<xsl:for-each select="current-group()">
+								<xsl:choose>
+									<xsl:when
+										test="self::w:r[w:fldChar/@w:fldCharType[matches(.,'end')]]">
+									</xsl:when>
+									<xsl:otherwise>
+										<xsl:apply-templates select="." />
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:for-each>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:apply-templates select="current-group()" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each-group>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
 		</xsl:choose>
-	      </xsl:when>
-	      <xsl:when
-		  test="self::w:r[w:fldChar/@w:fldCharType[matches(.,'end')]]">
-		<xsl:for-each select="current-group()">
-		  <xsl:choose>
-		    <xsl:when
-			test="self::w:r[w:fldChar/@w:fldCharType[matches(.,'end')]]">
-		    </xsl:when>
-		    <xsl:otherwise>
-		      <xsl:apply-templates select="."/>
-		    </xsl:otherwise>
-		  </xsl:choose>
-		</xsl:for-each>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:apply-templates select="current-group()"/>
-	      </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:for-each-group>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:apply-templates/>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/parameters.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/parameters.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/parameters.xsl	(revision 2397)
@@ -1,96 +1,122 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: parameters.xsl 9999 2012-01-02 18:43:24Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <xsl:param name="convert-graphics">true</xsl:param>
-    
-    <xsl:param name="convert-headers">true</xsl:param>
-    
-    <xsl:param name="mathMethod">mml</xsl:param>
-    
-    <xsl:param name="termMethod">tei</xsl:param>
-    
-    <xsl:param name="tableMethod">tei</xsl:param>
-    
-    <xsl:param name="word-directory">.</xsl:param>
-    
-    <xsl:param name="preserveWordSections">false</xsl:param>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-    <xsl:param name="preserveWordHeadersFooters">false</xsl:param>    
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <xsl:param name="preserveEffects">false</xsl:param>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-    <xsl:param name="verbose">false</xsl:param>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: parameters.xsl 9999 2012-01-02 18:43:24Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-    <xsl:param name="pageWidth">0</xsl:param>
+	<xsl:param name="convert-graphics">
+		true
+	</xsl:param>
 
+	<xsl:param name="convert-headers">
+		true
+	</xsl:param>
+
+	<xsl:param name="mathMethod">
+		mml
+	</xsl:param>
+
+	<xsl:param name="termMethod">
+		tei
+	</xsl:param>
+
+	<xsl:param name="tableMethod">
+		tei
+	</xsl:param>
+
+	<xsl:param name="word-directory">
+		.
+	</xsl:param>
+
+	<xsl:param name="preserveWordSections">
+		false
+	</xsl:param>
+
+	<xsl:param name="preserveWordHeadersFooters">
+		false
+	</xsl:param>
+
+	<xsl:param name="preserveEffects">
+		false
+	</xsl:param>
+
+	<xsl:param name="verbose">
+		false
+	</xsl:param>
+
+	<xsl:param name="pageWidth">
+		0
+	</xsl:param>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/pass2/pass2.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/pass2/pass2.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/pass2/pass2.xsl	(revision 2397)
@@ -1,458 +1,497 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:cals="http://www.oasis-open.org/specs/tm9901"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-		xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop  html   iso m mml mo mv o pic r rel cals     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:cals="http://www.oasis-open.org/specs/tm9901"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop  html   iso m mml mo mv o pic r rel cals     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: pass2.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    <xsl:template match="@*|comment()|processing-instruction()" mode="pass2">
-        <xsl:copy-of select="."/>
-    </xsl:template>
-    
-    <xsl:template match="*" mode="pass2">
-        <xsl:copy>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-        </xsl:copy>
-    </xsl:template>
-    
-    
-    <xsl:template match="text()" mode="pass2">
-	  <xsl:value-of select="."/>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     Zap empty p and item </p>
-      </desc>
-    </doc>
- 
-   <xsl:template match="tei:p[not(*) and string-length(.)=0]"
-		 mode="pass2" priority="99"/>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     Inner lists in lists must be moved to inside items
-	 </p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:list/tei:list" mode="pass2"/>
-    <xsl:template match="tei:item" mode="pass2">
-      <xsl:choose>
-	<xsl:when test="not(*) and string-length(.)=0"/>
-	<xsl:otherwise>
-	  <item>
-	    <xsl:copy-of select="@*"/>
-	    <xsl:variable name="me" select="generate-id()"/>
-	    <xsl:apply-templates mode="pass2"/>
-	    <!-- find following sibling lists and notes -->
-	    <xsl:for-each select="following-sibling::tei:list[preceding-sibling::tei:item[1][generate-id()=$me]]">
-	      <list>
-		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-	      </list>
-	    </xsl:for-each>
-	  </item>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     Zap emdashes at start of head </p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:head/text()" mode="pass2">
-        <xsl:choose>
-            <xsl:when test="starts-with(.,'— ')">
-                <xsl:value-of select="substring(.,3)"/>
-            </xsl:when>
-            <xsl:when test="starts-with(.,'&#160;— ')">
-                <xsl:value-of select="substring(.,4)"/>
-            </xsl:when>
-            <xsl:when test="starts-with(.,' — ')">
-                <xsl:value-of select="substring(.,4)"/>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:value-of select="."/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     A &lt;seg&gt; which does nothing is not worth having </p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:seg[not(@*)]" mode="pass2">
-        <xsl:choose>
-            <xsl:when test="parent::tei:formula and normalize-space(.)=''"/>
-	    <xsl:when test=".=' ' and following-sibling::node()[1][self::tei:hi]/@rend=
-			    preceding-sibling::node()[1][self::tei:hi]/@rend"/>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-            <xsl:when test="parent::*/text()">
-                <xsl:value-of select="."/>
-            </xsl:when>
-	    <xsl:when test="parent::tei:hi[count(*)=1]">
-	      <xsl:value-of select="."/>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-	    </xsl:when>
-            <xsl:otherwise>
-                <xsl:copy-of select="."/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Look at the sections we have generated, and put
-        them in &lt;front&gt; or &lt;body&gt; as appropriate</p>
-      </desc>
-    </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-    <xsl:template match="tei:text" mode="pass2">
-        <text>
-            <xsl:for-each select="tei:fw">
-                <xsl:copy-of select="."/>
-            </xsl:for-each>
-            <body>
-                <xsl:for-each select="tei:body/tei:*">
-                    <xsl:apply-templates select="." mode="pass2"/>
-                </xsl:for-each>
-            </body>
-        </text>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     A &lt;p&gt; inside a listBibl is moved out</p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:listBibl/tei:p" mode="pass2"/>
-    
-    <xsl:template match="tei:listBibl" mode="pass2">
-        <xsl:for-each select="tei:p">
-            <p>
-                <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-            </p>
-        </xsl:for-each>
-        <listBibl>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-        </listBibl>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>  Gloss list from tei to docx</p>
-      </desc>
-    </doc>
-    <!-- <GLOSSITEM>
-	 <hi rend="bold">100</hi>
-	 <lb/>first item </GLOSSITEM>
-    -->
-    <xsl:template match="tei:GLOSSITEM" mode="pass2">
-      <label>
-	<xsl:for-each select="tei:hi">
-	  <xsl:apply-templates/>
-	</xsl:for-each>
-      </label>
-      <item>
-	<xsl:apply-templates mode="inglossitem"/>
-      </item>
-    </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: pass2.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-    <xsl:template match="*" mode="inglossitem">
-      <xsl:apply-templates select="." mode="pass2"/>
-    </xsl:template>
 
-    <xsl:template match="tei:lb" mode="inglossitem"/>
-    <xsl:template match="tei:hi[@rend='bold']" mode="inglossitem"/>
+	<xsl:template
+		match="@*|comment()|processing-instruction()" mode="pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     Top of a weird gloss list </p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:list[@type='gloss']/tei:label[.='where']" mode="pass2">
-        <head>
-            <xsl:apply-templates/>
-        </head>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     A tab in a &lt;bibl&gt;? no. </p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:bibl/tei:g[@ref='x:tab']" mode="pass2"/>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     A tab in a &lt;gloss&gt;? no. </p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:gloss//tei:g[@ref='x:tab']" mode="pass2"/>
-    
-    
-    <!-- removed 2010-03-15, seems to screw up formulae
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     A tab in a &lt;formula&gt;? no. </p>
-      </desc>
-    </doc>
+	<xsl:template match="*" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass2" />
+		</xsl:copy>
+	</xsl:template>
 
-    <xsl:template match="tei:formula//tei:g[@ref='x:tab']" mode="pass2"/>
-    -->
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     A tab in a &lt;head&gt;? no. </p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:head/tei:g[@ref='x:tab']" mode="pass2"/>
-    
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>     An empty item</p>
-      </desc>
-    </doc>
-    <xsl:template match="tei:item[not(*) and not(text())]" mode="pass2"/>
-    
+	<xsl:template match="text()" mode="pass2">
+		<xsl:value-of select="." />
+	</xsl:template>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"  >
-    <desc>Zap empty &lt;bibl&gt; </desc></doc>
-    
-    <xsl:template match="tei:bibl[not(*) and not(text())]" mode="pass2"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> Zap empty p and item </p>
+		</desc>
+	</doc>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"  >
-    <desc>Zap empty &lt;availability&gt; </desc></doc>
-   
-    <xsl:template match="tei:availability[not(*) and not(text())]"
-		  mode="pass2"/>
+	<xsl:template match="tei:p[not(*) and string-length(.)=0]"
+		mode="pass2" priority="99" />
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"  >
-    <desc>Zap empty &lt;note&gt; </desc></doc>
-   
-    <xsl:template match="tei:note[not(*) and not(text())]"
-		  mode="pass2">
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> Inner lists in lists must be moved to inside items
+			</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:list/tei:list" mode="pass2" />
+	<xsl:template match="tei:item" mode="pass2">
+		<xsl:choose>
+			<xsl:when test="not(*) and string-length(.)=0" />
+			<xsl:otherwise>
+				<item>
+					<xsl:copy-of select="@*" />
+					<xsl:variable name="me" select="generate-id()" />
+					<xsl:apply-templates mode="pass2" />
+					<!-- find following sibling lists and notes -->
+					<xsl:for-each
+						select="following-sibling::tei:list[preceding-sibling::tei:item[1][generate-id()=$me]]">
+						<list>
+							<xsl:apply-templates
+								select="*|@*|processing-instruction()|comment()|text()"
+								mode="pass2" />
+						</list>
+					</xsl:for-each>
+				</item>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template match="tei:list[@type='gloss']/tei:item/tei:g[@ref='x:tab']" mode="pass2"/>
-    
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> Zap emdashes at start of head </p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:head/text()" mode="pass2">
+		<xsl:choose>
+			<xsl:when test="starts-with(.,'— ')">
+				<xsl:value-of select="substring(.,3)" />
+			</xsl:when>
+			<xsl:when test="starts-with(.,'&#160;— ')">
+				<xsl:value-of select="substring(.,4)" />
+			</xsl:when>
+			<xsl:when test="starts-with(.,' — ')">
+				<xsl:value-of select="substring(.,4)" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template match="tei:hi[@rend='footnote_reference' and
-			 count(*)=1 and tei:note]" mode="pass2" priority="99">
-          <xsl:apply-templates mode="pass2"/>
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> A &lt;seg&gt; which does nothing is not worth having </p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:seg[not(@*)]" mode="pass2">
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:formula and normalize-space(.)=''" />
+			<xsl:when
+				test=".=' ' and following-sibling::node()[1][self::tei:hi]/@rend=
+			    preceding-sibling::node()[1][self::tei:hi]/@rend" />
 
-  <xsl:template match="tei:hi[not(@rend) and not(*) and string-length(.)=0]" mode="pass2">
-  </xsl:template>
+			<xsl:when test="parent::*/text()">
+				<xsl:value-of select="." />
+			</xsl:when>
+			<xsl:when test="parent::tei:hi[count(*)=1]">
+				<xsl:value-of select="." />
 
-  <xsl:template match="tei:hi[@rend='Endnote_anchor']" mode="pass2" priority="99">
-    <xsl:apply-templates mode="pass2"/>
-  </xsl:template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="tei:hi[@rend='EndnoteReference']" mode="pass2"  priority="99">
-    <xsl:apply-templates mode="pass2"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Look at the sections we have generated, and put
+				them in &lt;front&gt; or &lt;body&gt; as appropriate</p>
+		</desc>
+	</doc>
 
-  <xsl:template match="tei:hi[@rend='EndnoteCharacters']" mode="pass2"
-		 priority="99">
-    <xsl:apply-templates mode="pass2"/>
-  </xsl:template>
- 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Clean up <gi>hi</gi> by merging adjacent &lt;hi&gt;s </desc>
-  </doc>
+	<xsl:template match="tei:text" mode="pass2">
+		<text>
+			<xsl:for-each select="tei:fw">
+				<xsl:copy-of select="." />
+			</xsl:for-each>
+			<body>
+				<xsl:for-each select="tei:body/tei:*">
+					<xsl:apply-templates select="." mode="pass2" />
+				</xsl:for-each>
+			</body>
+		</text>
+	</xsl:template>
 
-  <xsl:template match="tei:hi[@rend]" mode="pass2">
-    <xsl:variable name="r" select="@rend"/>
-    <xsl:choose>
-      <xsl:when test="count(parent::tei:speaker/*)=1 and not
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> A &lt;p&gt; inside a listBibl is moved out</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:listBibl/tei:p" mode="pass2" />
+
+	<xsl:template match="tei:listBibl" mode="pass2">
+		<xsl:for-each select="tei:p">
+			<p>
+				<xsl:apply-templates
+					select="*|@*|processing-instruction()|comment()|text()"
+					mode="pass2" />
+			</p>
+		</xsl:for-each>
+		<listBibl>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass2" />
+		</listBibl>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> Gloss list from tei to docx</p>
+		</desc>
+	</doc>
+	<!-- <GLOSSITEM> <hi rend="bold">100</hi> <lb/>first item </GLOSSITEM> -->
+	<xsl:template match="tei:GLOSSITEM" mode="pass2">
+		<label>
+			<xsl:for-each select="tei:hi">
+				<xsl:apply-templates />
+			</xsl:for-each>
+		</label>
+		<item>
+			<xsl:apply-templates mode="inglossitem" />
+		</item>
+	</xsl:template>
+
+	<xsl:template match="*" mode="inglossitem">
+		<xsl:apply-templates select="." mode="pass2" />
+	</xsl:template>
+
+	<xsl:template match="tei:lb" mode="inglossitem" />
+	<xsl:template match="tei:hi[@rend='bold']"
+		mode="inglossitem" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> Top of a weird gloss list </p>
+		</desc>
+	</doc>
+	<xsl:template
+		match="tei:list[@type='gloss']/tei:label[.='where']" mode="pass2">
+		<head>
+			<xsl:apply-templates />
+		</head>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> A tab in a &lt;bibl&gt;? no. </p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:bibl/tei:g[@ref='x:tab']"
+		mode="pass2" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> A tab in a &lt;gloss&gt;? no. </p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:gloss//tei:g[@ref='x:tab']"
+		mode="pass2" />
+
+
+	<!-- removed 2010-03-15, seems to screw up formulae <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"> 
+		<desc> <p> A tab in a &lt;formula&gt;? no. </p> </desc> </doc> <xsl:template 
+		match="tei:formula//tei:g[@ref='x:tab']" mode="pass2"/> -->
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> A tab in a &lt;head&gt;? no. </p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:head/tei:g[@ref='x:tab']"
+		mode="pass2" />
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p> An empty item</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:item[not(*) and not(text())]"
+		mode="pass2" />
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Zap empty &lt;bibl&gt; </desc>
+	</doc>
+
+	<xsl:template match="tei:bibl[not(*) and not(text())]"
+		mode="pass2" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Zap empty &lt;availability&gt; </desc>
+	</doc>
+
+	<xsl:template
+		match="tei:availability[not(*) and not(text())]" mode="pass2" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Zap empty &lt;note&gt; </desc>
+	</doc>
+
+	<xsl:template match="tei:note[not(*) and not(text())]"
+		mode="pass2">
+	</xsl:template>
+
+	<xsl:template
+		match="tei:list[@type='gloss']/tei:item/tei:g[@ref='x:tab']"
+		mode="pass2" />
+
+
+	<xsl:template
+		match="tei:hi[@rend='footnote_reference' and
+			 count(*)=1 and tei:note]"
+		mode="pass2" priority="99">
+		<xsl:apply-templates mode="pass2" />
+	</xsl:template>
+
+	<xsl:template
+		match="tei:hi[not(@rend) and not(*) and string-length(.)=0]"
+		mode="pass2">
+	</xsl:template>
+
+	<xsl:template match="tei:hi[@rend='Endnote_anchor']"
+		mode="pass2" priority="99">
+		<xsl:apply-templates mode="pass2" />
+	</xsl:template>
+
+	<xsl:template match="tei:hi[@rend='EndnoteReference']"
+		mode="pass2" priority="99">
+		<xsl:apply-templates mode="pass2" />
+	</xsl:template>
+
+	<xsl:template match="tei:hi[@rend='EndnoteCharacters']"
+		mode="pass2" priority="99">
+		<xsl:apply-templates mode="pass2" />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Clean up
+			<gi>hi</gi>
+			by merging adjacent &lt;hi&gt;s
+		</desc>
+	</doc>
+
+	<xsl:template match="tei:hi[@rend]" mode="pass2">
+		<xsl:variable name="r" select="@rend" />
+		<xsl:choose>
+			<xsl:when
+				test="count(parent::tei:speaker/*)=1 and not
 		      (parent::tei:speaker/text())">
-	<xsl:apply-templates/>
-      </xsl:when>
-      <xsl:when test="parent::tei:head and .='&#160;'"/>
-      <xsl:when test ="not(*) and string-length(.)=0"/>
-      <xsl:when test="parent::tei:item/parent::tei:list[@type='gloss']
-		      and tei:g[@ref='x:tab']"/>
-      <xsl:when
-	  test="preceding-sibling::node()[1][self::tei:hi[@rend=$r]]">
-      </xsl:when>
-      <xsl:when
-	  test="preceding-sibling::node()[1][self::tei:seg and .=' ']
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="parent::tei:head and .='&#160;'" />
+			<xsl:when test="not(*) and string-length(.)=0" />
+			<xsl:when
+				test="parent::tei:item/parent::tei:list[@type='gloss']
+		      and tei:g[@ref='x:tab']" />
+			<xsl:when
+				test="preceding-sibling::node()[1][self::tei:hi[@rend=$r]]">
+			</xsl:when>
+			<xsl:when
+				test="preceding-sibling::node()[1][self::tei:seg and .=' ']
 		and
 		preceding-sibling::node()[2][self::tei:hi[@rend=$r]]">
-      </xsl:when>
-      <xsl:when test="@rend='bold' and .=' '">
-	<xsl:text> </xsl:text>
-      </xsl:when>
-      <xsl:when test="@rend='italic' and .=' '">
-	<xsl:text> </xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:variable name="ename">
-	  <xsl:choose>
-	    <xsl:when test="@rend='italic' and
-			    ancestor::tei:bibl">title</xsl:when>
-	    <xsl:otherwise>hi</xsl:otherwise>
-	  </xsl:choose>
-	</xsl:variable>
-	<xsl:element name="{$ename}">
-	  <xsl:copy-of select="@*"/>
-	  <xsl:apply-templates mode="pass2"/>
-	  <xsl:call-template name="nextHi">
-	    <xsl:with-param name="r" select="$r"/>
-	  </xsl:call-template>
-	</xsl:element>
-      </xsl:otherwise>
-    </xsl:choose>
-   </xsl:template>
+			</xsl:when>
+			<xsl:when test="@rend='bold' and .=' '">
+				<xsl:text> </xsl:text>
+			</xsl:when>
+			<xsl:when test="@rend='italic' and .=' '">
+				<xsl:text> </xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="ename">
+					<xsl:choose>
+						<xsl:when
+							test="@rend='italic' and
+			    ancestor::tei:bibl">
+							title
+						</xsl:when>
+						<xsl:otherwise>
+							hi
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:element name="{$ename}">
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates mode="pass2" />
+					<xsl:call-template name="nextHi">
+						<xsl:with-param name="r" select="$r" />
+					</xsl:call-template>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template name="nextHi">
-      <xsl:param name="r"/>
-      <xsl:for-each select="following-sibling::node()[1]">
-         <xsl:choose>
-	   <xsl:when test="self::tei:hi[@rend=$r]">
-            <xsl:apply-templates mode="pass2"/>
-            <xsl:call-template name="nextHi">
-	              <xsl:with-param name="r" select="$r"/>
-            </xsl:call-template>
-	   </xsl:when>
-	   <xsl:when test="self::tei:seg and .=' ' and
+	<xsl:template name="nextHi">
+		<xsl:param name="r" />
+		<xsl:for-each select="following-sibling::node()[1]">
+			<xsl:choose>
+				<xsl:when test="self::tei:hi[@rend=$r]">
+					<xsl:apply-templates mode="pass2" />
+					<xsl:call-template name="nextHi">
+						<xsl:with-param name="r" select="$r" />
+					</xsl:call-template>
+				</xsl:when>
+				<xsl:when
+					test="self::tei:seg and .=' ' and
 			   following-sibling::node()[1][self::tei:hi[@rend=$r]]">
-            <xsl:apply-templates mode="pass2"/>
-            <xsl:call-template name="nextHi">
-	              <xsl:with-param name="r" select="$r"/>
-	    </xsl:call-template>
-	   </xsl:when>
-	 </xsl:choose>
-      </xsl:for-each>
-   </xsl:template>
+					<xsl:apply-templates mode="pass2" />
+					<xsl:call-template name="nextHi">
+						<xsl:with-param name="r" select="$r" />
+					</xsl:call-template>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 
-   <xsl:template match="tei:div[tei:head/tei:ANCHOR]" mode="pass2">
-     <xsl:copy>
-       <xsl:attribute name="xml:id"
-		      select="tei:head/tei:ANCHOR[1]/@xml:id"/>
-       <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-     </xsl:copy>
-   </xsl:template>
+	<xsl:template match="tei:div[tei:head/tei:ANCHOR]"
+		mode="pass2">
+		<xsl:copy>
+			<xsl:attribute name="xml:id"
+				select="tei:head/tei:ANCHOR[1]/@xml:id" />
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass2" />
+		</xsl:copy>
+	</xsl:template>
 
-   <xsl:template match="tei:ANCHOR" mode="pass2"/>
+	<xsl:template match="tei:ANCHOR" mode="pass2" />
 
-   <xsl:template match="w:bookmarkStart" mode="pass2">
-       <anchor>
-        <xsl:attribute name="xml:id">
-            <xsl:value-of select="substring(@w:name,2)"/>
+	<xsl:template match="w:bookmarkStart" mode="pass2">
+		<anchor>
+			<xsl:attribute name="xml:id">
+            <xsl:value-of select="substring(@w:name,2)" />
         </xsl:attribute>
-	</anchor>
-   </xsl:template>
+		</anchor>
+	</xsl:template>
 
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"  >
-    <desc>Paragraphs in cells not allowed</desc></doc>
-   
-    <xsl:template match="tei:cell/tei:p" mode="pass2">
-      <xsl:if test="preceding-sibling::tei:p">
-	<lb/>
-      </xsl:if>
-      <xsl:apply-templates mode="pass2"/>
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Paragraphs in cells not allowed</desc>
+	</doc>
 
-    <xsl:template match="tei:speech" mode="pass2"/>
-    <xsl:template match="tei:speech" mode="keep">
-      <p>
-	<xsl:apply-templates mode="pass2"/>
-      </p>
-    </xsl:template>
+	<xsl:template match="tei:cell/tei:p" mode="pass2">
+		<xsl:if test="preceding-sibling::tei:p">
+			<lb />
+		</xsl:if>
+		<xsl:apply-templates mode="pass2" />
+	</xsl:template>
 
-    <xsl:template match="tei:speaker" mode="pass2">
-      <sp>
-	<speaker>
-	  <xsl:choose>	
-	    <xsl:when test="count(*)=1 and not(text()) and tei:hi[@rend]">
-	      <xsl:attribute name="rend" select="tei:hi/@rend"/>
-	      <xsl:for-each select="tei:hi">
-	      <xsl:apply-templates mode="pass2"/>
-	      </xsl:for-each>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:apply-templates mode="pass2"/>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</speaker>
-	<xsl:apply-templates
-	    select="following-sibling::tei:speech[1]" mode="keep"/>
-      </sp>
-    </xsl:template>
+	<xsl:template match="tei:speech" mode="pass2" />
+	<xsl:template match="tei:speech" mode="keep">
+		<p>
+			<xsl:apply-templates mode="pass2" />
+		</p>
+	</xsl:template>
 
+	<xsl:template match="tei:speaker" mode="pass2">
+		<sp>
+			<speaker>
+				<xsl:choose>
+					<xsl:when
+						test="count(*)=1 and not(text()) and tei:hi[@rend]">
+						<xsl:attribute name="rend" select="tei:hi/@rend" />
+						<xsl:for-each select="tei:hi">
+							<xsl:apply-templates mode="pass2" />
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates mode="pass2" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</speaker>
+			<xsl:apply-templates
+				select="following-sibling::tei:speech[1]" mode="keep" />
+		</sp>
+	</xsl:template>
 
 
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/tables/tables.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/tables/tables.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/tables/tables.xsl	(revision 2397)
@@ -1,170 +1,197 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns:html="http://www.w3.org/1999/xhtml"                
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:html="http://www.w3.org/1999/xhtml"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tables.xsl 9719 2011-11-09 18:18:03Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
+				All rights reserved.
 
-   <xsl:template name="getTableBorderStyles">
-     <xsl:param name="tblBorders"/>
-     <xsl:if test="$tblBorders//w:left[@w:sz!='']">
-       <xsl:text>border-left: </xsl:text><xsl:value-of select="$tblBorders//w:left[1]/@w:sz"/><xsl:text>; </xsl:text>
-     </xsl:if>
-     <xsl:if test="$tblBorders//w:left[@w:val='nil']">
-       <xsl:text>border-left: 0; </xsl:text>
-     </xsl:if>
-     <xsl:if test="$tblBorders//w:bottom[@w:sz!='']">
-       <xsl:text>border-bottom: </xsl:text><xsl:value-of select="$tblBorders//w:bottom[1]/@w:sz"/><xsl:text>; </xsl:text>
-     </xsl:if>
-     <xsl:if test="$tblBorders//w:bottom[@w:val='nil']">
-       <xsl:text>border-bottom: 0; </xsl:text>
-     </xsl:if>
-     <xsl:if test="$tblBorders//w:right[@w:sz!='']">
-       <xsl:text>border-right: </xsl:text><xsl:value-of select="$tblBorders//w:right[1]/@w:sz"/><xsl:text>; </xsl:text>
-     </xsl:if>
-     <xsl:if test="$tblBorders//w:right[@w:val='nil']">
-       <xsl:text>border-right: 0; </xsl:text>
-     </xsl:if>
-     <xsl:if test="$tblBorders//w:top[@w:sz!='']">
-       <xsl:text>border-top: </xsl:text><xsl:value-of select="$tblBorders//w:top[1]/@w:sz"/><xsl:text>; </xsl:text>
-     </xsl:if>
-     <xsl:if test="$tblBorders//w:top[@w:val='nil']">
-       <xsl:text>border-top: 0; </xsl:text>
-     </xsl:if>
-   </xsl:template>
-    
-    	<xsl:template match="w:tbl" mode="paragraph">
-	     <xsl:choose>
-	        <xsl:when test="$tableMethod='word'">
-	           <xsl:copy>
-		             <xsl:copy-of select="@*"/>
-		             <xsl:apply-templates/>
-	           </xsl:copy>
-	        </xsl:when>
-	        <xsl:when test="$tableMethod='cals'">
-	      <!-- preprocess the table to expand colspans, add row numbers, and
-		   simplify vertical merge info -->
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-	      <xsl:variable name="TABLE">
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-	      <xsl:variable name="tableBorders">
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tables.xsl 9719 2011-11-09 18:18:03Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<xsl:template name="getTableBorderStyles">
+		<xsl:param name="tblBorders" />
+		<xsl:if test="$tblBorders//w:left[@w:sz!='']">
+			<xsl:text>border-left: </xsl:text>
+			<xsl:value-of select="$tblBorders//w:left[1]/@w:sz" />
+			<xsl:text>; </xsl:text>
+		</xsl:if>
+		<xsl:if test="$tblBorders//w:left[@w:val='nil']">
+			<xsl:text>border-left: 0; </xsl:text>
+		</xsl:if>
+		<xsl:if test="$tblBorders//w:bottom[@w:sz!='']">
+			<xsl:text>border-bottom: </xsl:text>
+			<xsl:value-of select="$tblBorders//w:bottom[1]/@w:sz" />
+			<xsl:text>; </xsl:text>
+		</xsl:if>
+		<xsl:if test="$tblBorders//w:bottom[@w:val='nil']">
+			<xsl:text>border-bottom: 0; </xsl:text>
+		</xsl:if>
+		<xsl:if test="$tblBorders//w:right[@w:sz!='']">
+			<xsl:text>border-right: </xsl:text>
+			<xsl:value-of select="$tblBorders//w:right[1]/@w:sz" />
+			<xsl:text>; </xsl:text>
+		</xsl:if>
+		<xsl:if test="$tblBorders//w:right[@w:val='nil']">
+			<xsl:text>border-right: 0; </xsl:text>
+		</xsl:if>
+		<xsl:if test="$tblBorders//w:top[@w:sz!='']">
+			<xsl:text>border-top: </xsl:text>
+			<xsl:value-of select="$tblBorders//w:top[1]/@w:sz" />
+			<xsl:text>; </xsl:text>
+		</xsl:if>
+		<xsl:if test="$tblBorders//w:top[@w:val='nil']">
+			<xsl:text>border-top: 0; </xsl:text>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="w:tbl" mode="paragraph">
 		<xsl:choose>
-		  <xsl:when test="w:tblPr/w:tblBorders/w:top[@w:val='single']">
-		    <xsl:copy-of select="w:tblPr/w:tblBorders/w:top"/>
-		  </xsl:when>
-		  <xsl:when test=".//w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val='single']">
-		    <xsl:copy-of select=".//w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top"/>
-		  </xsl:when>
-		</xsl:choose>
-		<xsl:choose>
-		  <xsl:when test="w:tblPr/w:tblBorders/w:left[@w:val='single']">
-		    <xsl:copy-of select="w:tblPr/w:tblBorders/w:left"/>
-		  </xsl:when>
-		  <xsl:when test=".//w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:left[@w:val='single']">
-		    <xsl:copy-of select=".//w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:left"/>
-		  </xsl:when>
-		</xsl:choose>
-		<xsl:choose>
-		  <xsl:when test="w:tblPr/w:tblBorders/w:bottom[@w:val='single']">
-		    <xsl:copy-of select="w:tblPr/w:tblBorders/w:bottom"/>
-		  </xsl:when>
-		  <xsl:when test=".//w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:bottom[@w:val='single']">
-		    <xsl:copy-of select=".//w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:bottom"/>
-		  </xsl:when>
-		</xsl:choose>
-		<xsl:choose>
-		  <xsl:when test="w:tblPr/w:tblBorders/w:right[@w:val='single']">
-		    <xsl:copy-of select="w:tblPr/w:tblBorders/w:right"/>
-		  </xsl:when>
-		  <xsl:when test=".//w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:right[@w:val='single']">
-		    <xsl:copy-of select=".//w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:right"/>
-		  </xsl:when>
-		</xsl:choose>		
-	      </xsl:variable>
-	      <xsl:variable name="tableBorderStyles">
-		<xsl:call-template name="getTableBorderStyles">
-		  <xsl:with-param name="tblBorders" select="$tableBorders"/>
-		</xsl:call-template>
-	      </xsl:variable>
-		             <table xmlns="http://www.oasis-open.org/specs/tm9901">
-			       <xsl:if test="normalize-space($tableBorderStyles)!=''">
-				 <xsl:attribute name="iso:style">
-				   <xsl:value-of select="normalize-space($tableBorderStyles)"/>
+			<xsl:when test="$tableMethod='word'">
+				<xsl:copy>
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates />
+				</xsl:copy>
+			</xsl:when>
+			<xsl:when test="$tableMethod='cals'">
+				<!-- preprocess the table to expand colspans, add row numbers, and simplify 
+					vertical merge info -->
+
+				<xsl:variable name="TABLE">
+
+					<xsl:variable name="tableBorders">
+						<xsl:choose>
+							<xsl:when
+								test="w:tblPr/w:tblBorders/w:top[@w:val='single']">
+								<xsl:copy-of select="w:tblPr/w:tblBorders/w:top" />
+							</xsl:when>
+							<xsl:when
+								test=".//w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val='single']">
+								<xsl:copy-of
+									select=".//w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top" />
+							</xsl:when>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when
+								test="w:tblPr/w:tblBorders/w:left[@w:val='single']">
+								<xsl:copy-of select="w:tblPr/w:tblBorders/w:left" />
+							</xsl:when>
+							<xsl:when
+								test=".//w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:left[@w:val='single']">
+								<xsl:copy-of
+									select=".//w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:left" />
+							</xsl:when>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when
+								test="w:tblPr/w:tblBorders/w:bottom[@w:val='single']">
+								<xsl:copy-of select="w:tblPr/w:tblBorders/w:bottom" />
+							</xsl:when>
+							<xsl:when
+								test=".//w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:bottom[@w:val='single']">
+								<xsl:copy-of
+									select=".//w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:bottom" />
+							</xsl:when>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when
+								test="w:tblPr/w:tblBorders/w:right[@w:val='single']">
+								<xsl:copy-of select="w:tblPr/w:tblBorders/w:right" />
+							</xsl:when>
+							<xsl:when
+								test=".//w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:right[@w:val='single']">
+								<xsl:copy-of
+									select=".//w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:right" />
+							</xsl:when>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="tableBorderStyles">
+						<xsl:call-template name="getTableBorderStyles">
+							<xsl:with-param name="tblBorders"
+								select="$tableBorders" />
+						</xsl:call-template>
+					</xsl:variable>
+					<table xmlns="http://www.oasis-open.org/specs/tm9901">
+						<xsl:if test="normalize-space($tableBorderStyles)!=''">
+							<xsl:attribute name="iso:style">
+				   <xsl:value-of
+								select="normalize-space($tableBorderStyles)" />
 				 </xsl:attribute>
-			       </xsl:if>
-			       <xsl:attribute name="frame">
+						</xsl:if>
+						<xsl:attribute name="frame">
 		                   <xsl:choose>
 		      <!-- lets face it, most tables do have
 			   borders, especially in ISO; but not in footers! -->
-		      <xsl:when test="not(w:tblPr/w:tblBorders) and
+		      <xsl:when
+							test="not(w:tblPr/w:tblBorders) and
 				      parent::w:ftr">
 			                        <xsl:text>none</xsl:text>
 		                      </xsl:when>
@@ -176,23 +203,28 @@
 		                      <xsl:otherwise>
 					<xsl:for-each select="$tableBorders">
 					  <xsl:choose>
-					    <xsl:when test="    w:top/@w:val='single'
+					    <xsl:when
+							test="    w:top/@w:val='single'
 							    and w:bottom/@w:val='single'
 							    and w:right/@w:val='single'        
 							    and w:left/@w:val='single'">all</xsl:when>
-					    <xsl:when test="    w:top/@w:val='single' 
+					    <xsl:when
+							test="    w:top/@w:val='single' 
 							    and w:bottom/@w:val='single'
 							    and not(w:right/@w:val='single') 
 							    and not(w:left/@w:val='single')">topbot</xsl:when>
-					    <xsl:when test="    w:top/@w:val='single' 
+					    <xsl:when
+							test="    w:top/@w:val='single' 
 							    and not(w:bottom/@w:val='single') 
 							    and not(w:right/@w:val='single') 
 							    and not(w:left/@w:val='single')">top</xsl:when>
-					    <xsl:when test="    not(w:top/@w:val='single') 
+					    <xsl:when
+							test="    not(w:top/@w:val='single') 
 							    and w:bottom/@w:val='single' 
 							    and not(w:right/@w:val='single') 
 							    and not(w:left/@w:val='single')">bottom</xsl:when>
-					    <xsl:when test="    not(w:top/@w:val='single') 
+					    <xsl:when
+							test="    not(w:top/@w:val='single') 
 							    and not(w:bottom/@w:val='single') 
 							    and w:right/@w:val='single' 
 							    and w:left/@w:val='single'">sides</xsl:when>
@@ -200,7 +232,8 @@
 					      <!-- start guessing -->
 					      <xsl:variable name="sideBorders">
 						<xsl:choose>
-						  <xsl:when test="w:left/@w:val='single' 
+						  <xsl:when
+							test="w:left/@w:val='single' 
 								  or w:right/@w:val='single'
 								  or ../../w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:left[@w:val='single']
 								  or ../../w:tr[last()]/w:tc[last()]/w:tcPr/w:tcBorders/w:right[@w:val='single']">true</xsl:when> 
@@ -208,7 +241,8 @@
 						</xsl:choose>
 					      </xsl:variable>
 					      <xsl:choose>
-						<xsl:when test="$sideBorders='true'
+						<xsl:when
+							test="$sideBorders='true'
 								and(w:bottom/@w:val='single' or w:top/@w:val='single')">all</xsl:when>
 						<xsl:otherwise>
 						  <xsl:text>none</xsl:text>
@@ -220,89 +254,101 @@
 		                      </xsl:otherwise>
 		                   </xsl:choose>
 		                </xsl:attribute>
-		                <xsl:attribute name="colsep">
+						<xsl:attribute name="colsep">
 		                   <xsl:choose>
-		                      <xsl:when test="w:tblPr/w:tblBorders/w:insideV/@w:val='single'">1</xsl:when>
+		                      <xsl:when
+							test="w:tblPr/w:tblBorders/w:insideV/@w:val='single'">1</xsl:when>
 		                      <xsl:otherwise>0</xsl:otherwise>
 		                   </xsl:choose>
 		                </xsl:attribute>
-		                <xsl:attribute name="rowsep">
+						<xsl:attribute name="rowsep">
 		                   <xsl:choose>
-		                      <xsl:when test="w:tblPr/w:tblBorders/w:insideH/@w:val='single'">1</xsl:when>
+		                      <xsl:when
+							test="w:tblPr/w:tblBorders/w:insideH/@w:val='single'">1</xsl:when>
 		                      <xsl:otherwise>0</xsl:otherwise>
 		                   </xsl:choose>
 		                </xsl:attribute>
-		                <xsl:call-template name="cals-table-header"/>
-		                <tgroup>
-		                   <xsl:for-each select="w:tblGrid/w:gridCol">
-		                      <colspec colnum="{position()}" colname="c{position()}">
-			                        <xsl:attribute name="colwidth" select="concat(number(@w:w) div 20,'pt')"/>
-		                      </colspec>
-		                   </xsl:for-each>
-		                   <tbody>
-		                      <xsl:for-each select="w:tr">
-			                        <xsl:copy>
-			                           <xsl:variable name="ROWPOS">
-			                              <xsl:number/>
-			                           </xsl:variable>
-			                           <xsl:for-each select="w:tc">
-						     <xsl:variable name="cellBorderStyles">
-						       <xsl:choose>
-							 <xsl:when test="w:tcBorders">
-							   <xsl:call-template name="getTableBorderStyles">
-							     <xsl:with-param name="tblBorders" select="w:tcBorders"/>
-							   </xsl:call-template>
-							 </xsl:when>
-							 <xsl:when test="w:tcPr/w:tcBorders">
-							   <xsl:call-template name="getTableBorderStyles">
-							     <xsl:with-param name="tblBorders" select="w:tcPr/w:tcBorders"/>
-							   </xsl:call-template>
-							 </xsl:when>
-						       </xsl:choose>
-						     </xsl:variable>
-			                              <xsl:variable name="VMERGE">
-			                                 <xsl:choose>
-				                                   <xsl:when test="w:tcPr/w:vMerge/@w:val='restart'">
-				                                      <xsl:text>start</xsl:text>
-				                                   </xsl:when>
-				                                   <xsl:when test="w:tcPr[not(w:vMerge)]">
-				                                      <xsl:text>start</xsl:text>
-				                                   </xsl:when>
-				                                   <xsl:otherwise>
-				                                      <xsl:text>continue</xsl:text>
-				                                   </xsl:otherwise>
-			                                 </xsl:choose>
-			                              </xsl:variable>
-			                              <xsl:variable name="innards">
-			                                 <xsl:copy-of select="w:tcPr"/>
-			                              </xsl:variable>
-			                              <xsl:copy>
-			                                 <xsl:variable
-							     name="N"
-							     select="position()"/>
-							 <xsl:if test="normalize-space($cellBorderStyles)!=''">
-							   <xsl:attribute name="iso:style">
-							     <xsl:value-of select="normalize-space($cellBorderStyles)"/>
+						<xsl:call-template name="cals-table-header" />
+						<tgroup>
+							<xsl:for-each select="w:tblGrid/w:gridCol">
+								<colspec colnum="{position()}" colname="c{position()}">
+									<xsl:attribute name="colwidth"
+										select="concat(number(@w:w) div 20,'pt')" />
+								</colspec>
+							</xsl:for-each>
+							<tbody>
+								<xsl:for-each select="w:tr">
+									<xsl:copy>
+										<xsl:variable name="ROWPOS">
+											<xsl:number />
+										</xsl:variable>
+										<xsl:for-each select="w:tc">
+											<xsl:variable name="cellBorderStyles">
+												<xsl:choose>
+													<xsl:when test="w:tcBorders">
+														<xsl:call-template
+															name="getTableBorderStyles">
+															<xsl:with-param name="tblBorders"
+																select="w:tcBorders" />
+														</xsl:call-template>
+													</xsl:when>
+													<xsl:when test="w:tcPr/w:tcBorders">
+														<xsl:call-template
+															name="getTableBorderStyles">
+															<xsl:with-param name="tblBorders"
+																select="w:tcPr/w:tcBorders" />
+														</xsl:call-template>
+													</xsl:when>
+												</xsl:choose>
+											</xsl:variable>
+											<xsl:variable name="VMERGE">
+												<xsl:choose>
+													<xsl:when test="w:tcPr/w:vMerge/@w:val='restart'">
+														<xsl:text>start</xsl:text>
+													</xsl:when>
+													<xsl:when test="w:tcPr[not(w:vMerge)]">
+														<xsl:text>start</xsl:text>
+													</xsl:when>
+													<xsl:otherwise>
+														<xsl:text>continue</xsl:text>
+													</xsl:otherwise>
+												</xsl:choose>
+											</xsl:variable>
+											<xsl:variable name="innards">
+												<xsl:copy-of select="w:tcPr" />
+											</xsl:variable>
+											<xsl:copy>
+												<xsl:variable name="N" select="position()" />
+												<xsl:if test="normalize-space($cellBorderStyles)!=''">
+													<xsl:attribute name="iso:style">
+							     <xsl:value-of
+														select="normalize-space($cellBorderStyles)" />
 							   </xsl:attribute>
-							 </xsl:if>
-			                                 <xsl:attribute name="rowsep">
+												</xsl:if>
+												<xsl:attribute name="rowsep">
 				                                   <xsl:choose>
-				                                      <xsl:when test="w:tcPr/w:tcBorders/w:bottom[@w:sz=0 or @w:val='nil']">
+				                                      <xsl:when
+													test="w:tcPr/w:tcBorders/w:bottom[@w:sz=0 or @w:val='nil']">
 				                                         <xsl:text>0</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="w:tcPr/w:tcBorders/w:bottom[@w:sz&gt;0]">
+				                                      <xsl:when
+													test="w:tcPr/w:tcBorders/w:bottom[@w:sz&gt;0]">
 				                                         <xsl:text>1</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="parent::w:tr/following-sibling::w:tr[1]/w:tc[$N]/w:tcPr/w:tcBorders/w:top[@w:sz&gt;0]">
+				                                      <xsl:when
+													test="parent::w:tr/following-sibling::w:tr[1]/w:tc[$N]/w:tcPr/w:tcBorders/w:top[@w:sz&gt;0]">
 				                                         <xsl:text>1</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="ancestor::w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:sz=0          or @w:val='nil']">
+				                                      <xsl:when
+													test="ancestor::w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:sz=0          or @w:val='nil']">
 				                                         <xsl:text>0</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="ancestor::w:tbl/w:tblPr/w:tblBorders/w:insideH">
+				                                      <xsl:when
+													test="ancestor::w:tbl/w:tblPr/w:tblBorders/w:insideH">
 				                                         <xsl:text>1</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="not(parent::w:tr/following-sibling::w:tr)          and not(ancestor::w:ftr)">
+				                                      <xsl:when
+													test="not(parent::w:tr/following-sibling::w:tr)          and not(ancestor::w:ftr)">
 				                                         <xsl:text>1</xsl:text>
 				                                      </xsl:when>
 				                                      <xsl:otherwise>
@@ -310,21 +356,26 @@
 				                                      </xsl:otherwise>
 				                                   </xsl:choose>
 			                                 </xsl:attribute>
-			                                 <xsl:attribute name="colsep">
+												<xsl:attribute name="colsep">
 				                                   <xsl:choose>
-				                                      <xsl:when test="following-sibling::w:tc[1]/w:tcPr/w:tcBorders/w:left[@w:sz&gt;0]">
+				                                      <xsl:when
+													test="following-sibling::w:tc[1]/w:tcPr/w:tcBorders/w:left[@w:sz&gt;0]">
 				                                         <xsl:text>1</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="w:tcPr/w:tcBorders/w:right[@w:sz=0 or @w:val='nil']">
+				                                      <xsl:when
+													test="w:tcPr/w:tcBorders/w:right[@w:sz=0 or @w:val='nil']">
 				                                         <xsl:text>0</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="w:tcPr/w:tcBorders/w:right[@w:sz&gt;0]">
+				                                      <xsl:when
+													test="w:tcPr/w:tcBorders/w:right[@w:sz&gt;0]">
 				                                         <xsl:text>1</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="ancestor::w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:sz=0          or @w:val='nil']">
+				                                      <xsl:when
+													test="ancestor::w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:sz=0          or @w:val='nil']">
 				                                         <xsl:text>0</xsl:text>
 				                                      </xsl:when>
-				                                      <xsl:when test="not(ancestor::w:tbl/w:tblPr/w:tblBorders)          and ancestor::w:ftr">
+				                                      <xsl:when
+													test="not(ancestor::w:tbl/w:tblPr/w:tblBorders)          and ancestor::w:ftr">
 				                                         <xsl:text>0</xsl:text>
 				                                      </xsl:when>
 				                                      <xsl:otherwise>
@@ -332,254 +383,262 @@
 				                                      </xsl:otherwise>
 				                                   </xsl:choose>
 			                                 </xsl:attribute>
-			                                 <xsl:attribute name="ROWPOS" select="$ROWPOS"/>
-			                                 <xsl:attribute name="VMERGE" select="$VMERGE"/>
-			                                 <xsl:copy-of select="@*"/>
-			                                 <xsl:copy-of select="*"/>
-			                              </xsl:copy>
-			                              <xsl:if test="w:tcPr/w:gridSpan/@w:val">
-			                                 <xsl:variable name="N" select="number(w:tcPr/w:gridSpan/@w:val)           cast as xs:integer"/>
-			                                 <xsl:for-each select="2 to $N">
-				                                   <w:tc DUMMY="yes">
-								     <xsl:copy-of select="$innards"/>
-				                                   </w:tc>
-			                                 </xsl:for-each>
-			                              </xsl:if>
-			                           </xsl:for-each>
-			                        </xsl:copy>
-		                      </xsl:for-each>
-		                   </tbody>
-		                </tgroup>
-		             </table>
-		             <!--
-		    <xsl:comment>START</xsl:comment>
-		    <TABLE>
-		    <xsl:copy-of select="$TABLE"/>
-		    </TABLE>
-		    <xsl:comment>END</xsl:comment>
-		-->
-	      </xsl:variable>
-	      <xsl:variable name="n">
-		<xsl:number level="any"/>
-	      </xsl:variable>
-	      <xsl:for-each select="$TABLE">
-		<xsl:apply-templates mode="insideCalsTable">
-		  <xsl:with-param name="n" select="$n" tunnel="yes"/>
-		</xsl:apply-templates>
-	      </xsl:for-each>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <table rend="rules">
-		<xsl:call-template name="table-header"/>
-		<xsl:for-each select="w:tr">
-		  <row>
-		    <xsl:for-each select="w:tc">
-		      <cell>
-			<xsl:if test="preserveEffects='true'">
-			  <xsl:attribute name="tei:align">
+												<xsl:attribute name="ROWPOS" select="$ROWPOS" />
+												<xsl:attribute name="VMERGE" select="$VMERGE" />
+												<xsl:copy-of select="@*" />
+												<xsl:copy-of select="*" />
+											</xsl:copy>
+											<xsl:if test="w:tcPr/w:gridSpan/@w:val">
+												<xsl:variable name="N"
+													select="number(w:tcPr/w:gridSpan/@w:val)           cast as xs:integer" />
+												<xsl:for-each select="2 to $N">
+													<w:tc DUMMY="yes">
+														<xsl:copy-of select="$innards" />
+													</w:tc>
+												</xsl:for-each>
+											</xsl:if>
+										</xsl:for-each>
+									</xsl:copy>
+								</xsl:for-each>
+							</tbody>
+						</tgroup>
+					</table>
+					<!-- <xsl:comment>START</xsl:comment> <TABLE> <xsl:copy-of select="$TABLE"/> 
+						</TABLE> <xsl:comment>END</xsl:comment> -->
+				</xsl:variable>
+				<xsl:variable name="n">
+					<xsl:number level="any" />
+				</xsl:variable>
+				<xsl:for-each select="$TABLE">
+					<xsl:apply-templates mode="insideCalsTable">
+						<xsl:with-param name="n" select="$n" tunnel="yes" />
+					</xsl:apply-templates>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<table rend="rules">
+					<xsl:call-template name="table-header" />
+					<xsl:for-each select="w:tr">
+						<row>
+							<xsl:for-each select="w:tc">
+								<cell>
+									<xsl:if test="preserveEffects='true'">
+										<xsl:attribute name="tei:align">
 			    <xsl:choose>
 			      <xsl:when test="w:p/w:pPr/w:jc">
-				<xsl:value-of
-				  select="w:p[1]/w:pPr/w:jc/@w:val"/>
+				<xsl:value-of select="w:p[1]/w:pPr/w:jc/@w:val" />
 			      </xsl:when>
 			      <xsl:otherwise>
 				<xsl:text>left</xsl:text>
 			      </xsl:otherwise>
 			    </xsl:choose>
 			  </xsl:attribute>
-			</xsl:if>
-			<xsl:if test="w:tcPr/w:gridSpan">
-			  <xsl:attribute name="cols" select="w:tcPr/w:gridSpan/@w:val"/>
-			</xsl:if>
-			<xsl:variable name="val" select="w:p[1]/w:pPr/w:pStyle/@w:val"/>
-			<xsl:choose>
-			  <xsl:when test="$val='[No Paragraph Style]'"/>
-			  <xsl:when test="$val='Table text (9)'"/>
-			  <xsl:when test="$val='Table Contents'"/>
-			  <xsl:when test="string-length($val)=0"/>
-			  <xsl:otherwise>
-			    <xsl:attribute name="rend">
-			      <xsl:value-of select="replace($val,' ','_')"/>
-			      <xsl:if test="w:tcPr/w:shd/@w:fill and not(w:tcPr/w:shd/@w:fill='auto')">
+									</xsl:if>
+									<xsl:if test="w:tcPr/w:gridSpan">
+										<xsl:attribute name="cols"
+											select="w:tcPr/w:gridSpan/@w:val" />
+									</xsl:if>
+									<xsl:variable name="val"
+										select="w:p[1]/w:pPr/w:pStyle/@w:val" />
+									<xsl:choose>
+										<xsl:when test="$val='[No Paragraph Style]'" />
+										<xsl:when test="$val='Table text (9)'" />
+										<xsl:when test="$val='Table Contents'" />
+										<xsl:when test="string-length($val)=0" />
+										<xsl:otherwise>
+											<xsl:attribute name="rend">
+			      <xsl:value-of select="replace($val,' ','_')" />
+			      <xsl:if
+												test="w:tcPr/w:shd/@w:fill and not(w:tcPr/w:shd/@w:fill='auto')">
 				<xsl:text> background-color(</xsl:text>
-				<xsl:value-of select="w:tcPr/w:shd/@w:fill"/>
+				<xsl:value-of select="w:tcPr/w:shd/@w:fill" />
 				<xsl:text>)</xsl:text>
 			      </xsl:if>
 			    </xsl:attribute>
-			  </xsl:otherwise>
-			  </xsl:choose>
-			  <xsl:if test="w:tcPr/w:gridSpan">
-			    <xsl:attribute name="cols">
-			      <xsl:value-of select="w:tcPr/w:gridSpan/@w:val"/>
+										</xsl:otherwise>
+									</xsl:choose>
+									<xsl:if test="w:tcPr/w:gridSpan">
+										<xsl:attribute name="cols">
+			      <xsl:value-of select="w:tcPr/w:gridSpan/@w:val" />
 			    </xsl:attribute>
-			  </xsl:if>
-			  <xsl:call-template name="mainProcess"/>
-		      </cell>
-		    </xsl:for-each>
-		  </row>
-		</xsl:for-each>
-	      </table>
-	    </xsl:otherwise>
-	  </xsl:choose>
+									</xsl:if>
+									<xsl:call-template name="mainProcess" />
+								</cell>
+							</xsl:for-each>
+						</row>
+					</xsl:for-each>
+				</table>
+			</xsl:otherwise>
+		</xsl:choose>
 	</xsl:template>
-	
-	  <xsl:template match="*" mode="insideCalsTable">
-	     <xsl:copy>
-	        <xsl:copy-of select="@*"/>
-	        <xsl:apply-templates mode="insideCalsTable"/>	    
-	     </xsl:copy>
-	  </xsl:template>
 
-	  <xsl:template match="w:tr" mode="insideCalsTable">
-	     <row xmlns="http://www.oasis-open.org/specs/tm9901">
-	        <xsl:for-each select="w:tc[not(@DUMMY='yes')]">
-		  <xsl:variable name="cellBorderStyles">
-		    <xsl:call-template name="getTableBorderStyles">
-		      <xsl:with-param name="tblBorders" select="w:tcPr/w:tcBorders"/>
-		    </xsl:call-template>
-		  </xsl:variable>
-	           <xsl:choose>
-		             <xsl:when test="w:tcPr/w:vMerge[not(@w:val='restart')]"/>
-		             <xsl:otherwise>
-		                <entry>
-		                   <xsl:variable name="ROWPOS" select="@ROWPOS"/>
-		                   <xsl:variable name="COLPOS">
-		                      <xsl:number/>
-		                   </xsl:variable>
-		                   <xsl:copy-of select="@rowsep"/>
-		                   <xsl:copy-of select="@colsep"/>
-		                   <xsl:attribute name="colname">
+	<xsl:template match="*" mode="insideCalsTable">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates mode="insideCalsTable" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="w:tr" mode="insideCalsTable">
+		<row xmlns="http://www.oasis-open.org/specs/tm9901">
+			<xsl:for-each select="w:tc[not(@DUMMY='yes')]">
+				<xsl:variable name="cellBorderStyles">
+					<xsl:call-template name="getTableBorderStyles">
+						<xsl:with-param name="tblBorders"
+							select="w:tcPr/w:tcBorders" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="w:tcPr/w:vMerge[not(@w:val='restart')]" />
+					<xsl:otherwise>
+						<entry>
+							<xsl:variable name="ROWPOS" select="@ROWPOS" />
+							<xsl:variable name="COLPOS">
+								<xsl:number />
+							</xsl:variable>
+							<xsl:copy-of select="@rowsep" />
+							<xsl:copy-of select="@colsep" />
+							<xsl:attribute name="colname">
 		                      <xsl:text>c</xsl:text>
-		                      <xsl:value-of select="$COLPOS"/>
+		                      <xsl:value-of select="$COLPOS" />
 		                   </xsl:attribute>
-				   <xsl:if test="normalize-space($cellBorderStyles)!=''">
-				     <xsl:attribute
-					 name="iso:style">
-				       <xsl:value-of select="normalize-space($cellBorderStyles)"/>
+							<xsl:if test="normalize-space($cellBorderStyles)!=''">
+								<xsl:attribute name="iso:style">
+				       <xsl:value-of
+									select="normalize-space($cellBorderStyles)" />
 				     </xsl:attribute>
-				   </xsl:if>
-		                   <xsl:if test="w:p/w:pPr/w:jc">
-		                      <xsl:attribute name="align">
-			                        <xsl:value-of select="w:p[w:pPr/w:jc/@w:val][1]/w:pPr/w:jc/@w:val"/>
+							</xsl:if>
+							<xsl:if test="w:p/w:pPr/w:jc">
+								<xsl:attribute name="align">
+			                        <xsl:value-of
+									select="w:p[w:pPr/w:jc/@w:val][1]/w:pPr/w:jc/@w:val" />
 		                      </xsl:attribute>
-		                   </xsl:if>
-		                   <xsl:if test="w:tcPr/w:gridSpan">
-		                      <xsl:attribute name="namest">
+							</xsl:if>
+							<xsl:if test="w:tcPr/w:gridSpan">
+								<xsl:attribute name="namest">
 			                        <xsl:text>c</xsl:text>
-			                        <xsl:value-of select="$COLPOS"/>
+			                        <xsl:value-of select="$COLPOS" />
 		                      </xsl:attribute>
-		                      <xsl:attribute name="nameend">
+								<xsl:attribute name="nameend">
 			                        <xsl:text>c</xsl:text>
-			                        <xsl:value-of select="$COLPOS+number(w:tcPr/w:gridSpan/@w:val)-1"/>
+			                        <xsl:value-of
+									select="$COLPOS+number(w:tcPr/w:gridSpan/@w:val)-1" />
 		                      </xsl:attribute>
-		                   </xsl:if>
-		                   <xsl:if test="w:tcPr/w:vAlign">
-		                      <xsl:attribute name="valign">
+							</xsl:if>
+							<xsl:if test="w:tcPr/w:vAlign">
+								<xsl:attribute name="valign">
 			                        <xsl:choose>
-			                           <xsl:when test="w:tcPr/w:vAlign/@w:val='center'">middle</xsl:when>
+			                           <xsl:when
+									test="w:tcPr/w:vAlign/@w:val='center'">middle</xsl:when>
 			                           <xsl:otherwise>
-			                              <xsl:value-of select="w:tcPr/w:vAlign/@w:val"/>
+			                              <xsl:value-of
+									select="w:tcPr/w:vAlign/@w:val" />
 			                           </xsl:otherwise>
 			                        </xsl:choose>
 		                      </xsl:attribute>
-		                   </xsl:if>
-		                   <xsl:if test="w:tcPr/w:textDirection[@w:val='btLr']">
-		                      <xsl:attribute name="rotate">
+							</xsl:if>
+							<xsl:if test="w:tcPr/w:textDirection[@w:val='btLr']">
+								<xsl:attribute name="rotate">
 			                        <xsl:text>1</xsl:text>
 		                      </xsl:attribute>
-		                   </xsl:if>
-		                   <xsl:if test="w:tcPr/w:vMerge/@w:val='restart'">
-		                      <xsl:variable name="MOREROWS">
-			                        <xsl:choose>
-			                           <xsl:when test="parent::w:tr/following-sibling::w:tr/w:tc[position()=$COLPOS][@VMERGE='start']">
-			                              <xsl:for-each select="(parent::w:tr/following-sibling::w:tr/w:tc[position()=$COLPOS][@VMERGE='start'])[1]">
-			                                 <xsl:value-of select="@ROWPOS"/>
-			                              </xsl:for-each>
-			                           </xsl:when>
-			                           <xsl:otherwise>
-			                              <xsl:value-of select="parent::w:tr/following-sibling::w:tr[last()]/w:tc/@ROWPOS"/>
-			                           </xsl:otherwise>
-			                        </xsl:choose>
-		                      </xsl:variable>
-		                      <!--
-			  <xsl:message>start a merged cell at <xsl:value-of
-			  select="$ROWPOS"/>/<xsl:value-of select="$COLPOS"/>
-			  <xsl:text>: </xsl:text>
-			  <xsl:value-of select="$MOREROWS"/>-<xsl:value-of
-			  select="$ROWPOS"/> =<xsl:value-of select="."/>
-			  </xsl:message>
-		      -->
-		      <xsl:attribute name="morerows">
-			<xsl:value-of select="number($MOREROWS) -            number($ROWPOS) -1"/>
+							</xsl:if>
+							<xsl:if test="w:tcPr/w:vMerge/@w:val='restart'">
+								<xsl:variable name="MOREROWS">
+									<xsl:choose>
+										<xsl:when
+											test="parent::w:tr/following-sibling::w:tr/w:tc[position()=$COLPOS][@VMERGE='start']">
+											<xsl:for-each
+												select="(parent::w:tr/following-sibling::w:tr/w:tc[position()=$COLPOS][@VMERGE='start'])[1]">
+												<xsl:value-of select="@ROWPOS" />
+											</xsl:for-each>
+										</xsl:when>
+										<xsl:otherwise>
+											<xsl:value-of
+												select="parent::w:tr/following-sibling::w:tr[last()]/w:tc/@ROWPOS" />
+										</xsl:otherwise>
+									</xsl:choose>
+								</xsl:variable>
+								<!-- <xsl:message>start a merged cell at <xsl:value-of select="$ROWPOS"/>/<xsl:value-of 
+									select="$COLPOS"/> <xsl:text>: </xsl:text> <xsl:value-of select="$MOREROWS"/>-<xsl:value-of 
+									select="$ROWPOS"/> =<xsl:value-of select="."/> </xsl:message> -->
+								<xsl:attribute name="morerows">
+			<xsl:value-of
+									select="number($MOREROWS) -            number($ROWPOS) -1" />
 		      </xsl:attribute>
-				   </xsl:if>
-				   <xsl:choose>
-				     <xsl:when test="count(w:p)&gt;1
+							</xsl:if>
+							<xsl:choose>
+								<xsl:when
+									test="count(w:p)&gt;1
 						     or w:p/w:pPr/w:pStyle">
-					<xsl:call-template name="cellContents"/>
-		                      </xsl:when>
-		                      <xsl:otherwise>
-			                        <xsl:apply-templates/>
-		                      </xsl:otherwise>
-		                   </xsl:choose>
-		                </entry>
-		             </xsl:otherwise>
-	           </xsl:choose>
-	        </xsl:for-each>
-	     </row>
+									<xsl:call-template name="cellContents" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:apply-templates />
+								</xsl:otherwise>
+							</xsl:choose>
+						</entry>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</row>
 
-	  </xsl:template>
+	</xsl:template>
 
-	  <xsl:template name="cellContents">
-	     <xsl:apply-templates select="w:p" mode="inTable"/> 
-	  </xsl:template>
+	<xsl:template name="cellContents">
+		<xsl:apply-templates select="w:p" mode="inTable" />
+	</xsl:template>
 
-	  <xsl:template match="w:p" mode="inTable">
-	     <p rend="{w:pPr/w:pStyle/@w:val}">
-	        <xsl:apply-templates/>
-	     </p>
-	  </xsl:template>
+	<xsl:template match="w:p" mode="inTable">
+		<p rend="{w:pPr/w:pStyle/@w:val}">
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
 
-	  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-	    getting the basic table structure
-    </desc>
-   </doc>
-	  <xsl:template match="w:gridCol|w:tblBorders|w:tblCellMar|w:tblGrid|w:tblLayout|w:tblLook|w:tblPr|w:tblW|w:tc|w:tcBorders|w:tcPr|w:tcW|w:tr|w:trPr|w:vAlign|w:top|w:left|w:bottom|w:right|w:insideH|w:insideV">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			getting the basic table structure
+		</desc>
+	</doc>
+	<xsl:template
+		match="w:gridCol|w:tblBorders|w:tblCellMar|w:tblGrid|w:tblLayout|w:tblLook|w:tblPr|w:tblW|w:tc|w:tcBorders|w:tcPr|w:tcW|w:tr|w:trPr|w:vAlign|w:top|w:left|w:bottom|w:right|w:insideH|w:insideV">
 
-		    <xsl:choose>
-			      <xsl:when test="$tableMethod='word'">
-				        <xsl:copy>
-					          <xsl:copy-of select="@*"/>
-					          <xsl:apply-templates/>
-				        </xsl:copy>
-			      </xsl:when>
-			      <xsl:otherwise>
-				        <xsl:apply-templates/>
-			      </xsl:otherwise>
-		    </xsl:choose>
-	  </xsl:template>
+		<xsl:choose>
+			<xsl:when test="$tableMethod='word'">
+				<xsl:copy>
+					<xsl:copy-of select="@*" />
+					<xsl:apply-templates />
+				</xsl:copy>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
 
-    <xsl:template name="table-header">
-        <xsl:variable name="precedingTableTitle"
-                    select="preceding-sibling::w:p[w:pPr/w:pStyle/@w:val='TableTitle'             or w:pPr/w:pStyle/@w:val=$Tabletitle][1]"/>
-        <xsl:if test="$precedingTableTitle and $precedingTableTitle/following-sibling::w:tbl[1] and generate-id()=generate-id($precedingTableTitle/following-sibling::w:tbl[1])">
-            <head>
-                <xsl:apply-templates select="$precedingTableTitle"/>
-            </head>
-        </xsl:if>
-    </xsl:template>
-    
-    <xsl:template name="cals-table-header">
-        <xsl:variable name="precedingTableTitle"
-                    select="preceding-sibling::w:p[w:pPr/w:pStyle/@w:val='TableTitle'             or w:pPr/w:pStyle/@w:val=$Tabletitle][1]"/>
-        <xsl:if test="$precedingTableTitle and $precedingTableTitle/following-sibling::w:tbl[1] and generate-id()=generate-id($precedingTableTitle/following-sibling::w:tbl[1])">
-            <title xmlns="http://www.oasis-open.org/specs/tm9901">
-                <xsl:apply-templates select="$precedingTableTitle"/>
-            </title>
-        </xsl:if>
-    </xsl:template>
-    
+	<xsl:template name="table-header">
+		<xsl:variable name="precedingTableTitle"
+			select="preceding-sibling::w:p[w:pPr/w:pStyle/@w:val='TableTitle'             or w:pPr/w:pStyle/@w:val=$Tabletitle][1]" />
+		<xsl:if
+			test="$precedingTableTitle and $precedingTableTitle/following-sibling::w:tbl[1] and generate-id()=generate-id($precedingTableTitle/following-sibling::w:tbl[1])">
+			<head>
+				<xsl:apply-templates
+					select="$precedingTableTitle" />
+			</head>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template name="cals-table-header">
+		<xsl:variable name="precedingTableTitle"
+			select="preceding-sibling::w:p[w:pPr/w:pStyle/@w:val='TableTitle'             or w:pPr/w:pStyle/@w:val=$Tabletitle][1]" />
+		<xsl:if
+			test="$precedingTableTitle and $precedingTableTitle/following-sibling::w:tbl[1] and generate-id()=generate-id($precedingTableTitle/following-sibling::w:tbl[1])">
+			<title xmlns="http://www.oasis-open.org/specs/tm9901">
+				<xsl:apply-templates
+					select="$precedingTableTitle" />
+			</title>
+		</xsl:if>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/maths/maths.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/maths/maths.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/maths/maths.xsl	(revision 2397)
@@ -1,198 +1,208 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: maths.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Handles a single paragraph that contains a math object</desc>
-   </doc>
-    <xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Formula']" mode="paragraph">
-        <xsl:call-template name="paragraph-formula"/>
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        
-            //TODO: figure out why there is a priority=-1
-        
-    </desc>
-   </doc>
-    <xsl:template match="w:p[m:oMathPara]" mode="paragraph" priority="-1">
-        <p>
-            <formula>
-                <xsl:apply-templates select="m:oMathPara/m:oMath"/>
-            </formula>
-        </p>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        
-            //TODO: figure out why there is a priority=-1
-        
-    </desc>
-   </doc>
-    <xsl:template match="w:p[m:oMath]" mode="paragraph" priority="-1">
-        <p>
-            <formula>
-                <xsl:apply-templates select="m:oMath"/>
-            </formula>
-        </p>
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>named template for w:p[w:pPr/w:pStyle/@w:val='Formula'</desc>
-   </doc>
-    <xsl:template name="paragraph-formula">
-        <p>
-            <formula>
-                <xsl:if test="w:r/w:rPr/w:rStyle/@w:val='FormulaReference'">
-                    <xsl:attribute name="n">
-                        <xsl:value-of select="w:r[w:rPr/w:rStyle/@w:val='FormulaReference']/w:t"/>
+				All rights reserved.
+
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: maths.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Handles a single paragraph that contains a math object</desc>
+	</doc>
+	<xsl:template match="w:p[w:pPr/w:pStyle/@w:val='Formula']"
+		mode="paragraph">
+		<xsl:call-template name="paragraph-formula" />
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			//TODO: figure out why there is a priority=-1
+
+		</desc>
+	</doc>
+	<xsl:template match="w:p[m:oMathPara]" mode="paragraph"
+		priority="-1">
+		<p>
+			<formula>
+				<xsl:apply-templates
+					select="m:oMathPara/m:oMath" />
+			</formula>
+		</p>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+
+			//TODO: figure out why there is a priority=-1
+
+		</desc>
+	</doc>
+	<xsl:template match="w:p[m:oMath]" mode="paragraph"
+		priority="-1">
+		<p>
+			<formula>
+				<xsl:apply-templates select="m:oMath" />
+			</formula>
+		</p>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>named template for w:p[w:pPr/w:pStyle/@w:val='Formula'</desc>
+	</doc>
+	<xsl:template name="paragraph-formula">
+		<p>
+			<formula>
+				<xsl:if test="w:r/w:rPr/w:rStyle/@w:val='FormulaReference'">
+					<xsl:attribute name="n">
+                        <xsl:value-of
+						select="w:r[w:rPr/w:rStyle/@w:val='FormulaReference']/w:t" />
                     </xsl:attribute>
-                </xsl:if>
-                <xsl:apply-templates/>
-            </formula>
-        </p>
-    </xsl:template>
+				</xsl:if>
+				<xsl:apply-templates />
+			</formula>
+		</p>
+	</xsl:template>
 
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Depending on the math mode, omml is either converted to mathML or an identity transformation is started
-    </desc>
-   </doc>
-    <xsl:template match="m:oMath">
-        <xsl:choose>
-            <xsl:when test="$mathMethod='omml'">
-                <xsl:apply-templates select="." mode="iden"/>
-            </xsl:when>
-            <xsl:otherwise>
-                <mml:math>
-                    <xsl:apply-templates/>
-                </mml:math>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
 
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Handles a w:object by copying it</p>
-      </desc>
-   </doc>
-    <xsl:template match="w:object">
-      <xsl:copy>
-	<xsl:apply-templates mode="iden"/>
-      </xsl:copy>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Guides the identity transformation of imagedata in math
-    </desc>
-   </doc>
-    <xsl:template match="v:imagedata" mode="iden">
-            <xsl:variable name="rid" select="@r:id"/>
-            <xsl:variable name="file">
-                <xsl:value-of
-		    select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
-	    </xsl:variable>
-	    <v:imagedata r:id="{$file}"/>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Guides the identity transformation of ole in maths
-    </desc>
-   </doc>
-    <xsl:template match="o:OLEObject" mode="iden">
-        <o:OLEObject>
-            <xsl:copy-of select="@*"/>
-            <xsl:variable name="rid" select="@r:id"/>
-            <xsl:variable name="file">
-                <xsl:value-of
-		    select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target"/>
-	    </xsl:variable>
-            <xsl:attribute name="r:id">
-                <xsl:value-of select="$file"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Depending on the math mode, omml is either converted to mathML or an identity
+			transformation is started
+		</desc>
+	</doc>
+	<xsl:template match="m:oMath">
+		<xsl:choose>
+			<xsl:when test="$mathMethod='omml'">
+				<xsl:apply-templates select="." mode="iden" />
+			</xsl:when>
+			<xsl:otherwise>
+				<mml:math>
+					<xsl:apply-templates />
+				</mml:math>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Handles a w:object by copying it</p>
+		</desc>
+	</doc>
+	<xsl:template match="w:object">
+		<xsl:copy>
+			<xsl:apply-templates mode="iden" />
+		</xsl:copy>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Guides the identity transformation of imagedata in math
+		</desc>
+	</doc>
+	<xsl:template match="v:imagedata" mode="iden">
+		<xsl:variable name="rid" select="@r:id" />
+		<xsl:variable name="file">
+			<xsl:value-of
+				select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
+		</xsl:variable>
+		<v:imagedata r:id="{$file}" />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Guides the identity transformation of ole in maths
+		</desc>
+	</doc>
+	<xsl:template match="o:OLEObject" mode="iden">
+		<o:OLEObject>
+			<xsl:copy-of select="@*" />
+			<xsl:variable name="rid" select="@r:id" />
+			<xsl:variable name="file">
+				<xsl:value-of
+					select="document(concat($wordDirectory,'/word/_rels/document.xml.rels'))//rel:Relationship[@Id=$rid]/@Target" />
+			</xsl:variable>
+			<xsl:attribute name="r:id">
+                <xsl:value-of select="$file" />
             </xsl:attribute>
-        </o:OLEObject>
-    </xsl:template>
-    
+		</o:OLEObject>
+	</xsl:template>
 
-    
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/textruns/textruns.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/textruns/textruns.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/textruns/textruns.xsl	(revision 2397)
@@ -1,643 +1,1044 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-		xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop    html iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop    html iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: textruns.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Processing an inline run of text with its styling</desc>
-   </doc>
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-    <xsl:template match="w:commentReference">
-      <xsl:variable name="commentN" select="@w:id"/>
-      <xsl:for-each
-	  select="document(concat($wordDirectory,'/word/comments.xml'))/w:comments/w:comment[@w:id=$commentN]">
-	<note place="comment" resp="{translate(@w:author,' ','_')}">
-	  <date when="{@w:date}"/>
-	  <xsl:apply-templates/>
-	</note>
-      </xsl:for-each>
-    </xsl:template>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-    <xsl:template match="w:r">
-      <xsl:call-template name="processTextrun"/>
-    </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: textruns.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-   <xsl:template name="processTextrun">
-     <xsl:variable name="style">
-       <xsl:value-of select="w:rPr/w:rStyle/@w:val"/>
-     </xsl:variable>
-     <xsl:choose>
-       <xsl:when test="$style='CommentReference'">
-	   <xsl:apply-templates/>
-       </xsl:when>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Processing an inline run of text with its styling</desc>
+	</doc>
 
-       <xsl:when test="$style='mentioned'">
-	 <mentioned>
-	   <xsl:apply-templates/>
-	 </mentioned>
-       </xsl:when>
+	<xsl:template match="w:commentReference">
+		<xsl:variable name="commentN" select="@w:id" />
+		<xsl:for-each
+			select="document(concat($wordDirectory,'/word/comments.xml'))/w:comments/w:comment[@w:id=$commentN]">
+			<note place="comment" resp="{translate(@w:author,' ','_')}">
+				<date when="{@w:date}" />
+				<xsl:apply-templates />
+			</note>
+		</xsl:for-each>
+	</xsl:template>
 
-       <xsl:when test="$style='Hyperlink' and ancestor::w:hyperlink">
-	 <xsl:call-template name="basicStyles"/>
-       </xsl:when>
+	<xsl:template match="w:r">
+		<xsl:call-template name="processTextrun" />
+	</xsl:template>
 
-       <xsl:when test="$style='Hyperlink' and ancestor::w:fldSimple">
-	 <xsl:call-template name="basicStyles"/>
-       </xsl:when>
-       
-       <xsl:when test="$style='Hyperlink' and preceding-sibling::w:r[w:instrText][1]/w:instrText">
-	 <ref>
-	   <xsl:attribute name="target">
+
+	<xsl:template name="processTextrun">
+		<xsl:variable name="style">
+			<xsl:value-of select="w:rPr/w:rStyle/@w:val" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$style='CommentReference'">
+				<xsl:apply-templates />
+			</xsl:when>
+
+			<xsl:when test="$style='mentioned'">
+				<mentioned>
+					<xsl:apply-templates />
+				</mentioned>
+			</xsl:when>
+
+			<xsl:when
+				test="$style='Hyperlink' and ancestor::w:hyperlink">
+				<xsl:call-template name="basicStyles" />
+			</xsl:when>
+
+			<xsl:when
+				test="$style='Hyperlink' and ancestor::w:fldSimple">
+				<xsl:call-template name="basicStyles" />
+			</xsl:when>
+
+			<xsl:when
+				test="$style='Hyperlink' and preceding-sibling::w:r[w:instrText][1]/w:instrText">
+				<ref>
+					<xsl:attribute name="target">
 	     <xsl:for-each
-		 select="preceding-sibling::w:r[w:instrText][1]/w:instrText">
-	       <xsl:value-of select="substring-before(substring-after(.,'&#x0022;'),'&#x0022;')"/>
+						select="preceding-sibling::w:r[w:instrText][1]/w:instrText">
+	       <xsl:value-of
+						select="substring-before(substring-after(.,'&#x0022;'),'&#x0022;')" />
 	     </xsl:for-each>
 	   </xsl:attribute>
-	   <xsl:call-template name="basicStyles"/>
-	 </ref>
-       </xsl:when>
-       
-       <xsl:when test="$style='ref'">
-	 <ref>
-	   <xsl:apply-templates/>
-	 </ref>
-       </xsl:when>
-       
-       <xsl:when test="$style='date'">
-	 <date>
-	   <xsl:apply-templates/>
-	 </date>
-       </xsl:when>
-       
-       <xsl:when test="$style='orgName'">
-	 <orgName>
-	   <xsl:apply-templates/>
-	 </orgName>
-       </xsl:when>
-       
-       <xsl:when test="not($style='')">
-	 <hi rend="{replace($style,' ','_')}">
-	   <xsl:apply-templates/>
-	 </hi>
-       </xsl:when>
-       
-       <xsl:otherwise>
-	 <xsl:call-template name="basicStyles"/>
-       </xsl:otherwise>
-       
-     </xsl:choose>
-        
-   </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>If there is no special style defined, look at the Word
-      underlying basic formatting. We can ignore the run's font change if 
-      a) it's not a special para AND the font is the ISO default, OR 
-      b) the font for the run is the same as its parent paragraph.
-      </desc>
-   </doc>
-    <xsl:template name="basicStyles">
+					<xsl:call-template name="basicStyles" />
+				</ref>
+			</xsl:when>
 
-      <xsl:variable name="styles">
-	<xsl:if test="w:rPr/w:rFonts//@w:ascii">
-	  <xsl:if test="(not(matches(parent::w:p/w:pPr/w:pStyle/@w:val,'Special')) and not(matches(w:rPr/w:rFonts/@w:ascii,'Calibri'))) or
+			<xsl:when test="$style='ref'">
+				<ref>
+					<xsl:apply-templates />
+				</ref>
+			</xsl:when>
+
+			<xsl:when test="$style='date'">
+				<date>
+					<xsl:apply-templates />
+				</date>
+			</xsl:when>
+
+			<xsl:when test="$style='orgName'">
+				<orgName>
+					<xsl:apply-templates />
+				</orgName>
+			</xsl:when>
+
+			<xsl:when test="not($style='')">
+				<hi rend="{replace($style,' ','_')}">
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+
+			<xsl:otherwise>
+				<xsl:call-template name="basicStyles" />
+			</xsl:otherwise>
+
+		</xsl:choose>
+
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>If there is no special style defined, look at the Word
+			underlying basic formatting. We can ignore the run's font change if
+			a) it's not a special para AND the font is the ISO default, OR
+			b) the font for the run is the same as its parent paragraph.
+		</desc>
+	</doc>
+	<xsl:template name="basicStyles">
+
+		<xsl:variable name="styles">
+			<xsl:if test="w:rPr/w:rFonts//@w:ascii">
+				<xsl:if
+					test="(not(matches(parent::w:p/w:pPr/w:pStyle/@w:val,'Special')) and not(matches(w:rPr/w:rFonts/@w:ascii,'Calibri'))) or
 			not(w:rPr/w:rFonts/@w:ascii = parent::w:p/w:pPr/w:rPr/w:rFonts/@w:ascii)">
-	    <xsl:if test="$preserveEffects='true'">
-	      <s n="font-family">
-		<xsl:value-of select="w:rPr/w:rFonts/@w:ascii"/>
-	      </s>
-	    </xsl:if>
-	    <!-- w:ascii="Courier New" w:hAnsi="Courier New" w:cs="Courier New" -->
-	    <!-- what do we want to do about cs (Complex Scripts), hAnsi (high ANSI), eastAsia etc? -->
-	  </xsl:if>
-	</xsl:if>
-	<xsl:if test="w:rPr/w:sz">
-	  <s n="font-size">
-	    <xsl:value-of select="number(w:rPr/w:sz/@w:val) div 2"/>
-	    <xsl:text>pt</xsl:text>
-	  </s>
-	</xsl:if>
-	<xsl:if test="w:rPr/w:position/@w:val and not(w:rPr/w:position/@w:val='0')">
-	  <s n="position">
-	    <xsl:value-of select="w:rPr/w:position/@w:val"/>
-	  </s>
-	</xsl:if>
-      </xsl:variable>
+					<xsl:if test="$preserveEffects='true'">
+						<s n="font-family">
+							<xsl:value-of select="w:rPr/w:rFonts/@w:ascii" />
+						</s>
+					</xsl:if>
+					<!-- w:ascii="Courier New" w:hAnsi="Courier New" w:cs="Courier New" -->
+					<!-- what do we want to do about cs (Complex Scripts), hAnsi (high ANSI), 
+						eastAsia etc? -->
+				</xsl:if>
+			</xsl:if>
+			<xsl:if test="w:rPr/w:sz">
+				<s n="font-size">
+					<xsl:value-of select="number(w:rPr/w:sz/@w:val) div 2" />
+					<xsl:text>pt</xsl:text>
+				</s>
+			</xsl:if>
+			<xsl:if
+				test="w:rPr/w:position/@w:val and not(w:rPr/w:position/@w:val='0')">
+				<s n="position">
+					<xsl:value-of select="w:rPr/w:position/@w:val" />
+				</s>
+			</xsl:if>
+		</xsl:variable>
 
-      <xsl:variable name="dir">
-	<!-- right-to-left text -->
-	<xsl:if test="w:rPr/w:rtl or parent::w:p/w:pPr/w:rPr/w:rtl">
-	  <xsl:text>rtl</xsl:text>
-	</xsl:if>
-      </xsl:variable>
-     
-      <xsl:variable name="effects">
-	<xsl:if test="w:rPr/w:position[number(@w:val)&lt;-2]">
-	  <n>subscript</n>
-	</xsl:if>
-	
-	<xsl:if test="w:rPr/w:i">
-	  <n>italic</n>
-	</xsl:if>
+		<xsl:variable name="dir">
+			<!-- right-to-left text -->
+			<xsl:if test="w:rPr/w:rtl or parent::w:p/w:pPr/w:rPr/w:rtl">
+				<xsl:text>rtl</xsl:text>
+			</xsl:if>
+		</xsl:variable>
 
-	<xsl:choose>
-	  <xsl:when test="w:rPr/w:b/@w:val='0'">
-	    <n>normalweight</n>
-	  </xsl:when>
-	  <xsl:when test="w:rPr/w:b">
-	    <n>bold</n>
-	  </xsl:when>
-	</xsl:choose>
+		<xsl:variable name="effects">
+			<xsl:if test="w:rPr/w:position[number(@w:val)&lt;-2]">
+				<n>subscript</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:position[number(@w:val)&gt;2]">
-	  <n>superscript</n>
-	</xsl:if>
+			<xsl:if test="w:rPr/w:i">
+				<n>italic</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:vertAlign">
-	  <n>
-	    <xsl:value-of select="w:rPr/w:vertAlign/@w:val"/>
-	  </n>
-	</xsl:if>
+			<xsl:choose>
+				<xsl:when test="w:rPr/w:b/@w:val='0'">
+					<n>normalweight</n>
+				</xsl:when>
+				<xsl:when test="w:rPr/w:b">
+					<n>bold</n>
+				</xsl:when>
+			</xsl:choose>
 
-	<xsl:if test="w:rPr/w:strike">
-	  <n>strikethrough</n>
-	</xsl:if>
+			<xsl:if test="w:rPr/w:position[number(@w:val)&gt;2]">
+				<n>superscript</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:dstrike">
-	  <n>strikedoublethrough</n>
-	</xsl:if>
+			<xsl:if test="w:rPr/w:vertAlign">
+				<n>
+					<xsl:value-of select="w:rPr/w:vertAlign/@w:val" />
+				</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:u[@w:val='single']">
-	  <n>underline</n>
-	</xsl:if>
+			<xsl:if test="w:rPr/w:strike">
+				<n>strikethrough</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:u[@w:val='wave']">
-	  <n>underwavyline</n>
-	</xsl:if>
+			<xsl:if test="w:rPr/w:dstrike">
+				<n>strikedoublethrough</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:u[@w:val='double']">
-	  <n>underdoubleline</n>
-	</xsl:if>
+			<xsl:if test="w:rPr/w:u[@w:val='single']">
+				<n>underline</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:smallCaps">
-	  <n>smallcaps</n>
-	</xsl:if>
+			<xsl:if test="w:rPr/w:u[@w:val='wave']">
+				<n>underwavyline</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:caps">
-	  <n>capsall</n>
-	</xsl:if>
+			<xsl:if test="w:rPr/w:u[@w:val='double']">
+				<n>underdoubleline</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:color and
+			<xsl:if test="w:rPr/w:smallCaps">
+				<n>smallcaps</n>
+			</xsl:if>
+
+			<xsl:if test="w:rPr/w:caps">
+				<n>capsall</n>
+			</xsl:if>
+
+			<xsl:if
+				test="w:rPr/w:color and
 		      not(w:rPr/w:color/@w:val='000000' or w:rPr/w:color/@w:val='auto')">
-	  <n>
-	    <xsl:text>color(</xsl:text>
-	    <xsl:value-of select="w:rPr/w:color/@w:val"/>
-	    <xsl:text>)</xsl:text>
-	  </n>
-	</xsl:if>
+				<n>
+					<xsl:text>color(</xsl:text>
+					<xsl:value-of select="w:rPr/w:color/@w:val" />
+					<xsl:text>)</xsl:text>
+				</n>
+			</xsl:if>
 
-	<xsl:if test="w:rPr/w:highlight">
-	  <n>
-	    <xsl:text>background(</xsl:text>
-	    <xsl:value-of select="w:rPr/w:highlight/@w:val"/>
-	    <xsl:text>)</xsl:text>
-	  </n>
-	</xsl:if>
-		
-      </xsl:variable>
+			<xsl:if test="w:rPr/w:highlight">
+				<n>
+					<xsl:text>background(</xsl:text>
+					<xsl:value-of select="w:rPr/w:highlight/@w:val" />
+					<xsl:text>)</xsl:text>
+				</n>
+			</xsl:if>
 
-	<xsl:choose>
-	<xsl:when test="$effects/* or ($styles/* and $preserveEffects='true')">
-	  <hi>
-	    <xsl:if test="$dir!='' and $preserveEffects='true'">
-	      <xsl:attribute name="dir"
-			     xmlns="http://www.w3.org/2005/11/its"
-			     select="$dir"/>
-	    </xsl:if>
-	    <xsl:choose>
-	      <xsl:when test="$effects/*">
-		<xsl:attribute name="rend">
+		</xsl:variable>
+
+		<xsl:choose>
+			<xsl:when
+				test="$effects/* or ($styles/* and $preserveEffects='true')">
+				<hi>
+					<xsl:if test="$dir!='' and $preserveEffects='true'">
+						<xsl:attribute name="dir"
+							xmlns="http://www.w3.org/2005/11/its" select="$dir" />
+					</xsl:if>
+					<xsl:choose>
+						<xsl:when test="$effects/*">
+							<xsl:attribute name="rend">
 		  <xsl:for-each select="$effects/*">
-		    <xsl:value-of select="."/>
+		    <xsl:value-of select="." />
 		    <xsl:if test="following-sibling::*">
 		      <xsl:text> </xsl:text>
 		    </xsl:if>
 		  </xsl:for-each>
 		</xsl:attribute>
-	      </xsl:when>
-	      <xsl:when test="$preserveEffects='true'">
-		<xsl:attribute name="rend">
+						</xsl:when>
+						<xsl:when test="$preserveEffects='true'">
+							<xsl:attribute name="rend">
 		  <xsl:text>isoStyle</xsl:text>
 		</xsl:attribute>
-	      </xsl:when>
-	    </xsl:choose>
-	    <xsl:if test="$styles/* and $preserveEffects='true'">
-	      <xsl:attribute name="html:style">
+						</xsl:when>
+					</xsl:choose>
+					<xsl:if test="$styles/* and $preserveEffects='true'">
+						<xsl:attribute name="html:style">
 		<xsl:for-each select="$styles/*">
-		  <xsl:value-of select="@n"/>
+		  <xsl:value-of select="@n" />
 		  <xsl:text>:</xsl:text>
-		  <xsl:value-of select="."/>
+		  <xsl:value-of select="." />
 		  <xsl:text>;</xsl:text>
 		</xsl:for-each>
 	      </xsl:attribute>
-	    </xsl:if>
-	    <xsl:apply-templates/>
-	  </hi>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:apply-templates/>
-	</xsl:otherwise> 
-      </xsl:choose>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Handle Text, Comments, Tabs, Symbols etc. 
-    </desc>
-   </doc>
-    <xsl:template match="w:t">
-        <xsl:variable name="t">
-            <xsl:choose>
-                <xsl:when test="@xml:space='preserve' and string-length(normalize-space(.))=0">
-                    <seg><xsl:text> </xsl:text></seg>
-                </xsl:when>
-                <xsl:when test="@xml:space='preserve'">
-                    <xsl:value-of select="."/>
-                </xsl:when>
-                <xsl:otherwise>
-                    <xsl:value-of select="normalize-space(.)"/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
-        <xsl:choose>
-            <xsl:when test="parent::w:r/w:rPr/w:rFonts[starts-with(@w:ascii,'ISO')]">
-                <seg html:style="font-family:{parent::w:r/w:rPr/w:rFonts/@w:ascii};">
-                    <xsl:value-of select="$t"/>
-                </seg>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:copy-of select="$t"/>
-            </xsl:otherwise>
-            
-        </xsl:choose>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Convert special characters (w:syms) into Unicode characters or
-	<gi>g</gi> elements. Symbol to Unicode mapping from http://unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt
-    </desc>
-   </doc>
-    <xsl:template match="w:sym">
-      <xsl:choose>
-	<xsl:when test="@w:font='Symbol' or @w:font='MT Symbol'">
-	  <xsl:choose>
-<xsl:when test="@w:char='F022'">&#x2200;</xsl:when><!--	# FOR ALL # universal -->
-<xsl:when test="@w:char='F024'">&#x2203;</xsl:when><!--	# THERE EXISTS # existential -->
-<xsl:when test="@w:char='F025'">&#x0025;</xsl:when><!--	# PERCENT SIGN # percent -->
-<xsl:when test="@w:char='F026'">&#x0026;</xsl:when><!--	# AMPERSAND # ampersand -->
-<xsl:when test="@w:char='F027'">&#x220B;</xsl:when><!--	# CONTAINS AS MEMBER	# suchthat -->
-<xsl:when test="@w:char='F028'">&#x0028;</xsl:when><!--	# LEFT PARENTHESIS	# parenleft -->
-<xsl:when test="@w:char='F029'">&#x0029;</xsl:when><!--	# RIGHT PARENTHESIS	# parenright -->
-<xsl:when test="@w:char='F02A'">&#x2217;</xsl:when><!--	# ASTERISK OPERATOR	# asteriskmath -->
-<xsl:when test="@w:char='F02B'">&#x002B;</xsl:when><!--	# PLUS SIGN # plus -->
-<xsl:when test="@w:char='F02C'">&#x002C;</xsl:when><!--	# COMMA	# comma -->
-<xsl:when test="@w:char='F02D'">&#x2212;</xsl:when><!--	# MINUS SIGN # minus -->
-<xsl:when test="@w:char='F02E'">&#x002E;</xsl:when><!--	# FULL STOP # period -->
-<xsl:when test="@w:char='F02F'">&#x002F;</xsl:when><!--	# SOLIDUS # slash -->
-<xsl:when test="@w:char='F030'">&#x0030;</xsl:when>
-<xsl:when test="@w:char='F031'">&#x0031;</xsl:when><!--	# DIGIT ONE # one -->
-<xsl:when test="@w:char='F032'">&#x0032;</xsl:when><!--	# DIGIT TWO # two -->
-<xsl:when test="@w:char='F033'">&#x0033;</xsl:when><!--	# DIGIT THREE # three -->
-<xsl:when test="@w:char='F034'">&#x0034;</xsl:when><!--	# DIGIT FOUR # four -->
-<xsl:when test="@w:char='F035'">&#x0035;</xsl:when><!--	# DIGIT FIVE # five -->
-<xsl:when test="@w:char='F036'">&#x0036;</xsl:when><!--	# DIGIT SIX # six -->
-<xsl:when test="@w:char='F037'">&#x0037;</xsl:when><!--	# DIGIT SEVEN # seven -->
-<xsl:when test="@w:char='F038'">&#x0038;</xsl:when>
-<xsl:when test="@w:char='F039'">&#x0039;</xsl:when><!--	# DIGIT NINE # nine -->
-<xsl:when test="@w:char='F03A'">&#x003A;</xsl:when><!--	# COLON	# colon -->
-<xsl:when test="@w:char='F03B'">&#x003B;</xsl:when><!--	# SEMICOLON # semicolon -->
-<xsl:when test="@w:char='F03C'">&#x003C;</xsl:when><!--	# LESS-THAN SIGN	# less -->
-<xsl:when test="@w:char='F03D'">&#x003D;</xsl:when><!--	# EQUALS SIGN # equal -->
-<xsl:when test="@w:char='F03E'">&#x003E;</xsl:when><!--	# GREATER-THAN SIGN	# greater -->
-<xsl:when test="@w:char='F03F'">&#x003F;</xsl:when><!--	# QUESTION MARK	# question -->
-<xsl:when test="@w:char='F040'">&#x2245;</xsl:when><!--	# APPROXIMATELY EQUAL TO	# congruent -->
-<xsl:when test="@w:char='F041'">&#x0391;</xsl:when><!--	# GREEK CAPITAL LETTER ALPHA	# Alpha -->
-<xsl:when test="@w:char='F042'">&#x0392;</xsl:when><!--	# GREEK CAPITAL LETTER BETA	# Beta -->
-<xsl:when test="@w:char='F043'">&#x03A7;</xsl:when><!--	# GREEK CAPITAL LETTER CHI	# Chi -->
-<xsl:when test="@w:char='F044'">&#x0394;</xsl:when><!--	# GREEK CAPITAL LETTER DELTA	# Delta -->
-<xsl:when test="@w:char='F044'">&#x2206;</xsl:when><!--	# INCREMENT # Delta -->
-<xsl:when test="@w:char='F045'">&#x0395;</xsl:when><!--	# GREEK CAPITAL LETTER EPSILON	# Epsilon -->
-<xsl:when test="@w:char='F046'">&#x03A6;</xsl:when><!--	# GREEK CAPITAL LETTER PHI	# Phi -->
-<xsl:when test="@w:char='F047'">&#x0393;</xsl:when><!--	# GREEK CAPITAL LETTER GAMMA	# Gamma -->
-<xsl:when test="@w:char='F048'">&#x0397;</xsl:when><!--	# GREEK CAPITAL LETTER ETA	# Eta -->
-<xsl:when test="@w:char='F049'">&#x0399;</xsl:when><!--	# GREEK CAPITAL LETTER IOTA	# Iota -->
-<xsl:when test="@w:char='F04A'">&#x03D1;</xsl:when><!--	# GREEK THETA SYMBOL	# theta1 -->
-<xsl:when test="@w:char='F04B'">&#x039A;</xsl:when><!--	# GREEK CAPITAL LETTER KAPPA	# Kappa -->
-<xsl:when test="@w:char='F04C'">&#x039B;</xsl:when><!--	# GREEK CAPITAL LETTER LAMDA	# Lambda -->
-<xsl:when test="@w:char='F04D'">&#x039C;</xsl:when><!--	# GREEK CAPITAL LETTER MU	# Mu -->
-<xsl:when test="@w:char='F04E'">&#x039D;</xsl:when><!--	# GREEK CAPITAL LETTER NU	# Nu -->
-<xsl:when test="@w:char='F04F'">&#x039F;</xsl:when><!--	# GREEK CAPITAL LETTER OMICRON	# Omicron -->
-<xsl:when test="@w:char='F050'">&#x03A0;</xsl:when><!--	# GREEK CAPITAL LETTER PI	# Pi -->
-<xsl:when test="@w:char='F051'">&#x0398;</xsl:when><!--	# GREEK CAPITAL LETTER THETA	# Theta -->
-<xsl:when test="@w:char='F052'">&#x03A1;</xsl:when><!--	# GREEK CAPITAL LETTER RHO	# Rho -->
-<xsl:when test="@w:char='F053'">&#x03A3;</xsl:when><!--	# GREEK CAPITAL LETTER SIGMA	# Sigma -->
-<xsl:when test="@w:char='F054'">&#x03A4;</xsl:when><!--	# GREEK CAPITAL LETTER TAU	# Tau -->
-<xsl:when test="@w:char='F055'">&#x03A5;</xsl:when><!--	# GREEK CAPITAL LETTER UPSILON	# Upsilon -->
-<xsl:when test="@w:char='F056'">&#x03C2;</xsl:when>
-<xsl:when test="@w:char='F057'">&#x03A9;</xsl:when><!--	# GREEK CAPITAL LETTER OMEGA	# Omega -->
-<xsl:when test="@w:char='F057'">&#x2126;</xsl:when><!--	# OHM SIGN # Omega -->
-<xsl:when test="@w:char='F058'">&#x039E;</xsl:when><!--	# GREEK CAPITAL LETTER XI	# Xi -->
-<xsl:when test="@w:char='F059'">&#x03A8;</xsl:when><!--	# GREEK CAPITAL LETTER PSI	# Psi -->
-<xsl:when test="@w:char='F05A'">&#x0396;</xsl:when><!--	# GREEK CAPITAL LETTER ZETA	# Zeta -->
-<xsl:when test="@w:char='F05B'">&#x005B;</xsl:when><!--	# LEFT SQUARE BRACKET	# bracketleft -->
-<xsl:when test="@w:char='F05C'">&#x2234;</xsl:when><!--	# THEREFORE # therefore -->
-<xsl:when test="@w:char='F05D'">&#x005D;</xsl:when><!--	# RIGHT SQUARE BRACKET	# bracketright -->
-<xsl:when test="@w:char='F05E'">&#x22A5;</xsl:when><!--	# UP TACK # perpendicular -->
-<xsl:when test="@w:char='F05F'">&#x005F;</xsl:when><!--	# LOW LINE # underscore -->
-<xsl:when test="@w:char='F060'">&#xF8E5;</xsl:when><!--	# RADICAL EXTENDER	# radicalex (CUS) -->
-<xsl:when test="@w:char='F061'">&#x03B1;</xsl:when><!--	# GREEK SMALL LETTER ALPHA	# alpha -->
-<xsl:when test="@w:char='F062'">&#x03B2;</xsl:when><!--	# GREEK SMALL LETTER BETA	# beta -->
-<xsl:when test="@w:char='F063'">&#x03C7;</xsl:when><!--	# GREEK SMALL LETTER CHI	# chi -->
-<xsl:when test="@w:char='F064'">&#x03B4;</xsl:when><!--	# GREEK SMALL LETTER DELTA	# delta -->
-<xsl:when test="@w:char='F065'">&#x03B5;</xsl:when><!--	# GREEK SMALL LETTER EPSILON	# epsilon -->
-<xsl:when test="@w:char='F066'">&#x03C6;</xsl:when><!--	# GREEK SMALL LETTER PHI	# phi -->
-<xsl:when test="@w:char='F067'">&#x03B3;</xsl:when><!--	# GREEK SMALL LETTER GAMMA	# gamma -->
-<xsl:when test="@w:char='F068'">&#x03B7;</xsl:when><!--	# GREEK SMALL LETTER ETA	# eta -->
-<xsl:when test="@w:char='F069'">&#x03B9;</xsl:when><!--	# GREEK SMALL LETTER IOTA	# iota -->
-<xsl:when test="@w:char='F06A'">&#x03D5;</xsl:when><!--	# GREEK PHI SYMBOL	# phi1 -->
-<xsl:when test="@w:char='F06B'">&#x03BA;</xsl:when><!--	# GREEK SMALL LETTER KAPPA	# kappa -->
-<xsl:when test="@w:char='F06C'">&#x03BB;</xsl:when><!--	# GREEK SMALL LETTER LAMDA	# lambda -->
-<xsl:when test="@w:char='F06D'">&#x00B5;</xsl:when><!--	# MICRO SIGN # mu -->
-<xsl:when test="@w:char='F06D'">&#x03BC;</xsl:when><!--	# GREEK SMALL LETTER MU	# mu -->
-<xsl:when test="@w:char='F06E'">&#x03BD;</xsl:when><!--	# GREEK SMALL LETTER NU	# nu -->
-<xsl:when test="@w:char='F06F'">&#x03BF;</xsl:when><!--	# GREEK SMALL LETTER OMICRON	# omicron -->
-<xsl:when test="@w:char='F070'">&#x03C0;</xsl:when><!--	# GREEK SMALL LETTER PI	# pi -->
-<xsl:when test="@w:char='F071'">&#x03B8;</xsl:when>
-<xsl:when test="@w:char='F072'">&#x03C1;</xsl:when><!--	# GREEK SMALL LETTER RHO	# rho -->
-<xsl:when test="@w:char='F073'">&#x03C3;</xsl:when><!--	# GREEK SMALL LETTER SIGMA	# sigma -->
-<xsl:when test="@w:char='F074'">&#x03C4;</xsl:when><!--	# GREEK SMALL LETTER TAU	# tau -->
-<xsl:when test="@w:char='F075'">&#x03C5;</xsl:when><!--	# GREEK SMALL LETTER UPSILON	# upsilon -->
-<xsl:when test="@w:char='F076'">&#x03D6;</xsl:when><!--	# GREEK PI SYMBOL	# omega1 -->
-<xsl:when test="@w:char='F077'">&#x03C9;</xsl:when><!--	# GREEK SMALL LETTER OMEGA	# omega -->
-<xsl:when test="@w:char='F078'">&#x03BE;</xsl:when><!--	# GREEK SMALL LETTER XI	# xi -->
-<xsl:when test="@w:char='F079'">&#x03C8;</xsl:when><!--	# GREEK SMALL LETTER PSI	# psi -->
-<xsl:when test="@w:char='F07A'">&#x03B6;</xsl:when><!--	# GREEK SMALL LETTER ZETA	# zeta -->
-<xsl:when test="@w:char='F07B'">&#x007B;</xsl:when><!--	# LEFT CURLY BRACKET	# braceleft -->
-<xsl:when test="@w:char='F07C'">&#x007C;</xsl:when><!--	# VERTICAL LINE	# bar -->
-<xsl:when test="@w:char='F07D'">&#x007D;</xsl:when><!--	# RIGHT CURLY BRACKET	# braceright -->
-<xsl:when test="@w:char='F07E'">&#x223C;</xsl:when><!--	# TILDE OPERATOR	# similar -->
-<xsl:when test="@w:char='F0A0'">&#x20AC;</xsl:when><!--	# EURO SIGN # Euro -->
-<xsl:when test="@w:char='F0A1'">&#x03D2;</xsl:when><!--	# GREEK UPSILON WITH HOOK SYMBOL	# Upsilon1 -->
-<xsl:when test="@w:char='F0A2'">&#x2032;</xsl:when><!--	# PRIME	# minute -->
-<xsl:when test="@w:char='F0A3'">&#x2264;</xsl:when><!--	# LESS-THAN OR EQUAL TO	# lessequal -->
-<xsl:when test="@w:char='F0A4'">&#x2044;</xsl:when><!--	# FRACTION SLASH	# fraction -->
-<xsl:when test="@w:char='F0A4'">&#x2215;</xsl:when><!--	# DIVISION SLASH	# fraction -->
-<xsl:when test="@w:char='F0A5'">&#x221E;</xsl:when><!--	# INFINITY # infinity -->
-<xsl:when test="@w:char='F0A6'">&#x0192;</xsl:when><!--	# LATIN SMALL LETTER F WITH HOOK	# florin -->
-<xsl:when test="@w:char='F0A7'">&#x2663;</xsl:when><!--	# BLACK CLUB SUIT	# club -->
-<xsl:when test="@w:char='F0A8'">&#x2666;</xsl:when><!--	# BLACK DIAMOND SUIT	# diamond -->
-<xsl:when test="@w:char='F0A9'">&#x2665;</xsl:when><!--	# BLACK HEART SUIT	# heart -->
-<xsl:when test="@w:char='F0AA'">&#x2660;</xsl:when><!--	# BLACK SPADE SUIT	# spade -->
-<xsl:when test="@w:char='F0AB'">&#x2194;</xsl:when><!--	# LEFT RIGHT ARROW	# arrowboth -->
-<xsl:when test="@w:char='F0AC'">&#x2190;</xsl:when><!--	# LEFTWARDS ARROW	# arrowleft -->
-<xsl:when test="@w:char='F0AD'">&#x2191;</xsl:when><!--	# UPWARDS ARROW	# arrowup -->
-<xsl:when test="@w:char='F0AE'">&#x2192;</xsl:when><!--	# RIGHTWARDS ARROW	# arrowright -->
-<xsl:when test="@w:char='F0AF'">&#x2193;</xsl:when><!--	# DOWNWARDS ARROW	# arrowdown -->
-<xsl:when test="@w:char='F0B0'">&#x00B0;</xsl:when><!--	# DEGREE SIGN # degree -->
-<xsl:when test="@w:char='F0B1'">&#x00B1;</xsl:when><!--	# PLUS-MINUS SIGN	# plusminus -->
-<xsl:when test="@w:char='F0B2'">&#x2033;</xsl:when><!--	# DOUBLE PRIME # second -->
-<xsl:when test="@w:char='F0B3'">&#x2265;</xsl:when><!--	# GREATER-THAN OR EQUAL TO	# greaterequal -->
-<xsl:when test="@w:char='F0B4'">&#x00D7;</xsl:when><!--	# MULTIPLICATION SIGN	# multiply -->
-<xsl:when test="@w:char='F0B5'">&#x221D;</xsl:when><!--	# PROPORTIONAL TO	# proportional -->
-<xsl:when test="@w:char='F0B6'">&#x2202;</xsl:when><!--	# PARTIAL DIFFERENTIAL	# partialdiff -->
-<xsl:when test="@w:char='F0B7'">&#x2022;</xsl:when><!--	# BULLET # bullet -->
-<xsl:when test="@w:char='F0B8'">&#x00F7;</xsl:when><!--	# DIVISION SIGN	# divide -->
-<xsl:when test="@w:char='F0B9'">&#x2260;</xsl:when><!--	# NOT EQUAL TO # notequal -->
-<xsl:when test="@w:char='F0BA'">&#x2261;</xsl:when><!--	# IDENTICAL TO # equivalence -->
-<xsl:when test="@w:char='F0BB'">&#x2248;</xsl:when><!--	# ALMOST EQUAL TO	# approxequal -->
-<xsl:when test="@w:char='F0BC'">&#x2026;</xsl:when><!--	# HORIZONTAL ELLIPSIS	# ellipsis -->
-<xsl:when test="@w:char='F0BD'">&#xF8E6;</xsl:when><!--	# VERTICAL ARROW EXTENDER	# arrowvertex (CUS) -->
-<xsl:when test="@w:char='F0BE'">&#xF8E7;</xsl:when><!--	# HORIZONTAL ARROW EXTENDER	# arrowhorizex (CUS) -->
-<xsl:when test="@w:char='F0BF'">&#x21B5;</xsl:when><!--	# DOWNWARDS ARROW WITH CORNER LEFTWARDS	# carriagereturn -->
-<xsl:when test="@w:char='F0C0'">&#x2135;</xsl:when><!--	# ALEF SYMBOL # aleph -->
-<xsl:when test="@w:char='F0C1'">&#x2111;</xsl:when><!--	# BLACK-LETTER CAPITAL I	# Ifraktur -->
-<xsl:when test="@w:char='F0C2'">&#x211C;</xsl:when><!--	# BLACK-LETTER CAPITAL R	# Rfraktur -->
-<xsl:when test="@w:char='F0C3'">&#x2118;</xsl:when><!--	# SCRIPT CAPITAL P	# weierstrass -->
-<xsl:when test="@w:char='F0C4'">&#x2297;</xsl:when><!--	# CIRCLED TIMES	# circlemultiply -->
-<xsl:when test="@w:char='F0C5'">&#x2295;</xsl:when><!--	# CIRCLED PLUS # circleplus -->
-<xsl:when test="@w:char='F0C6'">&#x2205;</xsl:when><!--	# EMPTY SET # emptyset -->
-<xsl:when test="@w:char='F0C7'">&#x2229;</xsl:when><!--	# INTERSECTION # intersection -->
-<xsl:when test="@w:char='F0C8'">&#x222A;</xsl:when><!--	# UNION	# union -->
-<xsl:when test="@w:char='F0C9'">&#x2283;</xsl:when><!--	# SUPERSET OF # propersuperset -->
-<xsl:when test="@w:char='F0CA'">&#x2287;</xsl:when><!--	# SUPERSET OF OR EQUAL TO	# reflexsuperset -->
-<xsl:when test="@w:char='F0CB'">&#x2284;</xsl:when><!--	# NOT A SUBSET OF	# notsubset -->
-<xsl:when test="@w:char='F0CC'">&#x2282;</xsl:when><!--	# SUBSET OF # propersubset -->
-<xsl:when test="@w:char='F0CD'">&#x2286;</xsl:when><!--	# SUBSET OF OR EQUAL TO	# reflexsubset -->
-<xsl:when test="@w:char='F0CE'">&#x2208;</xsl:when><!--	# ELEMENT OF # element -->
-<xsl:when test="@w:char='F0CF'">&#x2209;</xsl:when><!--	# NOT AN ELEMENT OF	# notelement -->
-<xsl:when test="@w:char='F0D0'">&#x2220;</xsl:when><!--	# ANGLE	# angle -->
-<xsl:when test="@w:char='F0D1'">&#x2207;</xsl:when><!--	# NABLA	# gradient -->
-<xsl:when test="@w:char='F0D2'">&#xF6DA;</xsl:when><!--	# REGISTERED SIGN SERIF	# registerserif (CUS) -->
-<xsl:when test="@w:char='F0D3'">&#xF6D9;</xsl:when><!--	# COPYRIGHT SIGN SERIF	# copyrightserif (CUS) -->
-<xsl:when test="@w:char='F0D4'">&#xF6DB;</xsl:when><!--	# TRADE MARK SIGN SERIF	# trademarkserif (CUS) -->
-<xsl:when test="@w:char='F0D5'">&#x220F;</xsl:when><!--	# N-ARY PRODUCT	# product -->
-<xsl:when test="@w:char='F0D6'">&#x221A;</xsl:when><!--	# SQUARE ROOT # radical -->
-<xsl:when test="@w:char='F0D7'">&#x22C5;</xsl:when><!--	# DOT OPERATOR # dotmath -->
-<xsl:when test="@w:char='F0D8'">&#x00AC;</xsl:when><!--	# NOT SIGN # logicalnot -->
-<xsl:when test="@w:char='F0D9'">&#x2227;</xsl:when><!--	# LOGICAL AND # logicaland -->
-<xsl:when test="@w:char='F0DA'">&#x2228;</xsl:when><!--	# LOGICAL OR # logicalor -->
-<xsl:when test="@w:char='F0DB'">&#x21D4;</xsl:when><!--	# LEFT RIGHT DOUBLE ARROW	# arrowdblboth -->
-<xsl:when test="@w:char='F0DC'">&#x21D0;</xsl:when><!--	# LEFTWARDS DOUBLE ARROW	# arrowdblleft -->
-<xsl:when test="@w:char='F0DD'">&#x21D1;</xsl:when><!--	# UPWARDS DOUBLE ARROW	# arrowdblup -->
-<xsl:when test="@w:char='F0DE'">&#x21D2;</xsl:when><!--	# RIGHTWARDS DOUBLE ARROW	# arrowdblright -->
-<xsl:when test="@w:char='F0DF'">&#x21D3;</xsl:when><!--	# DOWNWARDS DOUBLE ARROW	# arrowdbldown -->
-<xsl:when test="@w:char='F0E0'">&#x25CA;</xsl:when><!--	# LOZENGE # lozenge -->
-<xsl:when test="@w:char='F0E1'">&#x2329;</xsl:when><!--	# LEFT-POINTING ANGLE BRACKET	# angleleft -->
-<xsl:when test="@w:char='F0E2'">&#xF8E8;</xsl:when><!--	# REGISTERED SIGN SANS SERIF	# registersans (CUS) -->
-<xsl:when test="@w:char='F0E3'">&#xF8E9;</xsl:when><!--	# COPYRIGHT SIGN SANS SERIF	# copyrightsans (CUS) -->
-<xsl:when test="@w:char='F0E4'">&#xF8EA;</xsl:when><!--	# TRADE MARK SIGN SANS SERIF	# trademarksans (CUS) -->
-<xsl:when test="@w:char='F0E5'">&#x2211;</xsl:when><!--	# N-ARY SUMMATION	# summation -->
-<xsl:when test="@w:char='F0E6'">&#xF8EB;</xsl:when><!--	# LEFT PAREN TOP	# parenlefttp (CUS) -->
-<xsl:when test="@w:char='F0E7'">&#xF8EC;</xsl:when><!--	# LEFT PAREN EXTENDER	# parenleftex (CUS) -->
-<xsl:when test="@w:char='F0E8'">&#xF8ED;</xsl:when><!--	# LEFT PAREN BOTTOM	# parenleftbt (CUS) -->
-<xsl:when test="@w:char='F0E9'">&#xF8EE;</xsl:when><!--	# LEFT SQUARE BRACKET TOP	# bracketlefttp (CUS) -->
-<xsl:when test="@w:char='F0EA'">&#xF8EF;</xsl:when><!--	# LEFT SQUARE BRACKET EXTENDER	# bracketleftex (CUS) -->
-<xsl:when test="@w:char='F0EB'">&#xF8F0;</xsl:when><!--	# LEFT SQUARE BRACKET BOTTOM	# bracketleftbt (CUS) -->
-<xsl:when test="@w:char='F0EC'">&#xF8F1;</xsl:when><!--	# LEFT CURLY BRACKET TOP	# bracelefttp (CUS) -->
-<xsl:when test="@w:char='F0ED'">&#xF8F2;</xsl:when><!--	# LEFT CURLY BRACKET MID	# braceleftmid (CUS) -->
-<xsl:when test="@w:char='F0EE'">&#xF8F3;</xsl:when><!--	# LEFT CURLY BRACKET BOTTOM	# braceleftbt (CUS) -->
-<xsl:when test="@w:char='F0EF'">&#xF8F4;</xsl:when><!--	# CURLY BRACKET EXTENDER	# braceex (CUS) -->
-<xsl:when test="@w:char='F0F1'">&#x232A;</xsl:when><!--	# RIGHT-POINTING ANGLE BRACKET	# angleright -->
-<xsl:when test="@w:char='F0F2'">&#x222B;</xsl:when><!--	# INTEGRAL # integral -->
-<xsl:when test="@w:char='F0F3'">&#x2320;</xsl:when><!--	# TOP HALF INTEGRAL	# integraltp -->
-<xsl:when test="@w:char='F0F4'">&#xF8F5;</xsl:when><!--	# INTEGRAL EXTENDER	# integralex (CUS) -->
-<xsl:when test="@w:char='F0F5'">&#x2321;</xsl:when><!--	# BOTTOM HALF INTEGRAL	# integralbt -->
-<xsl:when test="@w:char='F0F6'">&#xF8F6;</xsl:when><!--	# RIGHT PAREN TOP	# parenrighttp (CUS) -->
-<xsl:when test="@w:char='F0F7'">&#xF8F7;</xsl:when><!--	# RIGHT PAREN EXTENDER	# parenrightex (CUS) -->
-<xsl:when test="@w:char='F0F8'">&#xF8F8;</xsl:when><!--	# RIGHT PAREN BOTTOM	# parenrightbt (CUS) -->
-<xsl:when test="@w:char='F0F9'">&#xF8F9;</xsl:when><!--	# RIGHT SQUAREBRACKET TOP	# bracketrighttp (CUS) -->
-<xsl:when test="@w:char='F0FA'">&#xF8FA;</xsl:when><!--	# RIGHT SQUARE BRACKET EXTENDER	# bracketrightex (CUS) -->
-<xsl:when test="@w:char='F0FB'">&#xF8FB;</xsl:when><!--	# RIGHT SQUARE BRACKET BOTTOM	# bracketrightbt (CUS) -->
-<xsl:when test="@w:char='F0FC'">&#xF8FC;</xsl:when><!--	# RIGHT CURLY BRACKET TOP	# bracerighttp (CUS) -->
-<xsl:when test="@w:char='F0FD'">&#xF8FD;</xsl:when><!--	# RIGHT CURLY BRACKET MID	# bracerightmid (CUS) -->
-<xsl:when test="@w:char='F0FE'">&#xF8FE;</xsl:when><!--	# RIGHT CURLY BRACKET BOTTOM	# bracerightbt (CUS) -->
-	<xsl:otherwise> 	  
-	  <g html:style="font-family:{@w:font};" n="{@w:char}"/>
-	</xsl:otherwise>       
-      </xsl:choose> 	
-    </xsl:when>
-    <xsl:when test="@w:font='Wingdings 2' and @w:char='F050'">&#x2713;</xsl:when><!-- tick mark-->
-	<xsl:otherwise> 	  
-	  <g html:style="font-family:{@w:font};" n="{@w:char}"/>
-	</xsl:otherwise>       
-      </xsl:choose>
-    </xsl:template>     
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        handle tabs
-    </desc>
-   </doc>
-    <xsl:template match="w:r/w:tab">
-      <xsl:text>	</xsl:text>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        handle ptabs (absolute position tab character)
-    </desc>
-   </doc>
-    <xsl:template match="w:r/w:ptab">
-        <c rend="ptab" type="{@w:alignment}">
-            <xsl:text>	</xsl:text>
-        </c>
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        capture line breaks
-    </desc>
-   </doc>
-    <xsl:template match="w:br">
-        <xsl:choose>
-            <xsl:when test="@w:type='page'">
-                <pb/>
-            </xsl:when>
-            <xsl:otherwise>
-                <lb/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Contains text that has been tracked as a revision. 
-    </desc>
-   </doc>
+					</xsl:if>
+					<xsl:apply-templates />
+				</hi>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template match="w:del">
-      <del when="{@w:date}">
-	<xsl:call-template name="identifyChange">
-	  <xsl:with-param name="who" select="@w:author"/>
-	</xsl:call-template>
-	<xsl:apply-templates/>
-      </del>
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handle Text, Comments, Tabs, Symbols etc.
+		</desc>
+	</doc>
+	<xsl:template match="w:t">
+		<xsl:variable name="t">
+			<xsl:choose>
+				<xsl:when
+					test="@xml:space='preserve' and string-length(normalize-space(.))=0">
+					<seg>
+						<xsl:text> </xsl:text>
+					</seg>
+				</xsl:when>
+				<xsl:when test="@xml:space='preserve'">
+					<xsl:value-of select="." />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="normalize-space(.)" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when
+				test="parent::w:r/w:rPr/w:rFonts[starts-with(@w:ascii,'ISO')]">
+				<seg
+					html:style="font-family:{parent::w:r/w:rPr/w:rFonts/@w:ascii};">
+					<xsl:value-of select="$t" />
+				</seg>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="$t" />
+			</xsl:otherwise>
 
-    <xsl:template match="w:rPr/w:del"/>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template match="w:delText">
-      <xsl:apply-templates/>
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Convert special characters (w:syms) into Unicode characters or
+			<gi>g</gi>
+			elements. Symbol to Unicode mapping from
+			http://unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt
+		</desc>
+	</doc>
+	<xsl:template match="w:sym">
+		<xsl:choose>
+			<xsl:when test="@w:font='Symbol' or @w:font='MT Symbol'">
+				<xsl:choose>
+					<xsl:when test="@w:char='F022'">
+						&#x2200;
+					</xsl:when><!-- # FOR ALL # universal -->
+					<xsl:when test="@w:char='F024'">
+						&#x2203;
+					</xsl:when><!-- # THERE EXISTS # existential -->
+					<xsl:when test="@w:char='F025'">
+						&#x0025;
+					</xsl:when><!-- # PERCENT SIGN # percent -->
+					<xsl:when test="@w:char='F026'">
+						&#x0026;
+					</xsl:when><!-- # AMPERSAND # ampersand -->
+					<xsl:when test="@w:char='F027'">
+						&#x220B;
+					</xsl:when><!-- # CONTAINS AS MEMBER # suchthat -->
+					<xsl:when test="@w:char='F028'">
+						&#x0028;
+					</xsl:when><!-- # LEFT PARENTHESIS # parenleft -->
+					<xsl:when test="@w:char='F029'">
+						&#x0029;
+					</xsl:when><!-- # RIGHT PARENTHESIS # parenright -->
+					<xsl:when test="@w:char='F02A'">
+						&#x2217;
+					</xsl:when><!-- # ASTERISK OPERATOR # asteriskmath -->
+					<xsl:when test="@w:char='F02B'">
+						&#x002B;
+					</xsl:when><!-- # PLUS SIGN # plus -->
+					<xsl:when test="@w:char='F02C'">
+						&#x002C;
+					</xsl:when><!-- # COMMA # comma -->
+					<xsl:when test="@w:char='F02D'">
+						&#x2212;
+					</xsl:when><!-- # MINUS SIGN # minus -->
+					<xsl:when test="@w:char='F02E'">
+						&#x002E;
+					</xsl:when><!-- # FULL STOP # period -->
+					<xsl:when test="@w:char='F02F'">
+						&#x002F;
+					</xsl:when><!-- # SOLIDUS # slash -->
+					<xsl:when test="@w:char='F030'">
+						&#x0030;
+					</xsl:when>
+					<xsl:when test="@w:char='F031'">
+						&#x0031;
+					</xsl:when><!-- # DIGIT ONE # one -->
+					<xsl:when test="@w:char='F032'">
+						&#x0032;
+					</xsl:when><!-- # DIGIT TWO # two -->
+					<xsl:when test="@w:char='F033'">
+						&#x0033;
+					</xsl:when><!-- # DIGIT THREE # three -->
+					<xsl:when test="@w:char='F034'">
+						&#x0034;
+					</xsl:when><!-- # DIGIT FOUR # four -->
+					<xsl:when test="@w:char='F035'">
+						&#x0035;
+					</xsl:when><!-- # DIGIT FIVE # five -->
+					<xsl:when test="@w:char='F036'">
+						&#x0036;
+					</xsl:when><!-- # DIGIT SIX # six -->
+					<xsl:when test="@w:char='F037'">
+						&#x0037;
+					</xsl:when><!-- # DIGIT SEVEN # seven -->
+					<xsl:when test="@w:char='F038'">
+						&#x0038;
+					</xsl:when>
+					<xsl:when test="@w:char='F039'">
+						&#x0039;
+					</xsl:when><!-- # DIGIT NINE # nine -->
+					<xsl:when test="@w:char='F03A'">
+						&#x003A;
+					</xsl:when><!-- # COLON # colon -->
+					<xsl:when test="@w:char='F03B'">
+						&#x003B;
+					</xsl:when><!-- # SEMICOLON # semicolon -->
+					<xsl:when test="@w:char='F03C'">
+						&#x003C;
+					</xsl:when><!-- # LESS-THAN SIGN # less -->
+					<xsl:when test="@w:char='F03D'">
+						&#x003D;
+					</xsl:when><!-- # EQUALS SIGN # equal -->
+					<xsl:when test="@w:char='F03E'">
+						&#x003E;
+					</xsl:when><!-- # GREATER-THAN SIGN # greater -->
+					<xsl:when test="@w:char='F03F'">
+						&#x003F;
+					</xsl:when><!-- # QUESTION MARK # question -->
+					<xsl:when test="@w:char='F040'">
+						&#x2245;
+					</xsl:when><!-- # APPROXIMATELY EQUAL TO # congruent -->
+					<xsl:when test="@w:char='F041'">
+						&#x0391;
+					</xsl:when><!-- # GREEK CAPITAL LETTER ALPHA # Alpha -->
+					<xsl:when test="@w:char='F042'">
+						&#x0392;
+					</xsl:when><!-- # GREEK CAPITAL LETTER BETA # Beta -->
+					<xsl:when test="@w:char='F043'">
+						&#x03A7;
+					</xsl:when><!-- # GREEK CAPITAL LETTER CHI # Chi -->
+					<xsl:when test="@w:char='F044'">
+						&#x0394;
+					</xsl:when><!-- # GREEK CAPITAL LETTER DELTA # Delta -->
+					<xsl:when test="@w:char='F044'">
+						&#x2206;
+					</xsl:when><!-- # INCREMENT # Delta -->
+					<xsl:when test="@w:char='F045'">
+						&#x0395;
+					</xsl:when><!-- # GREEK CAPITAL LETTER EPSILON # Epsilon -->
+					<xsl:when test="@w:char='F046'">
+						&#x03A6;
+					</xsl:when><!-- # GREEK CAPITAL LETTER PHI # Phi -->
+					<xsl:when test="@w:char='F047'">
+						&#x0393;
+					</xsl:when><!-- # GREEK CAPITAL LETTER GAMMA # Gamma -->
+					<xsl:when test="@w:char='F048'">
+						&#x0397;
+					</xsl:when><!-- # GREEK CAPITAL LETTER ETA # Eta -->
+					<xsl:when test="@w:char='F049'">
+						&#x0399;
+					</xsl:when><!-- # GREEK CAPITAL LETTER IOTA # Iota -->
+					<xsl:when test="@w:char='F04A'">
+						&#x03D1;
+					</xsl:when><!-- # GREEK THETA SYMBOL # theta1 -->
+					<xsl:when test="@w:char='F04B'">
+						&#x039A;
+					</xsl:when><!-- # GREEK CAPITAL LETTER KAPPA # Kappa -->
+					<xsl:when test="@w:char='F04C'">
+						&#x039B;
+					</xsl:when><!-- # GREEK CAPITAL LETTER LAMDA # Lambda -->
+					<xsl:when test="@w:char='F04D'">
+						&#x039C;
+					</xsl:when><!-- # GREEK CAPITAL LETTER MU # Mu -->
+					<xsl:when test="@w:char='F04E'">
+						&#x039D;
+					</xsl:when><!-- # GREEK CAPITAL LETTER NU # Nu -->
+					<xsl:when test="@w:char='F04F'">
+						&#x039F;
+					</xsl:when><!-- # GREEK CAPITAL LETTER OMICRON # Omicron -->
+					<xsl:when test="@w:char='F050'">
+						&#x03A0;
+					</xsl:when><!-- # GREEK CAPITAL LETTER PI # Pi -->
+					<xsl:when test="@w:char='F051'">
+						&#x0398;
+					</xsl:when><!-- # GREEK CAPITAL LETTER THETA # Theta -->
+					<xsl:when test="@w:char='F052'">
+						&#x03A1;
+					</xsl:when><!-- # GREEK CAPITAL LETTER RHO # Rho -->
+					<xsl:when test="@w:char='F053'">
+						&#x03A3;
+					</xsl:when><!-- # GREEK CAPITAL LETTER SIGMA # Sigma -->
+					<xsl:when test="@w:char='F054'">
+						&#x03A4;
+					</xsl:when><!-- # GREEK CAPITAL LETTER TAU # Tau -->
+					<xsl:when test="@w:char='F055'">
+						&#x03A5;
+					</xsl:when><!-- # GREEK CAPITAL LETTER UPSILON # Upsilon -->
+					<xsl:when test="@w:char='F056'">
+						&#x03C2;
+					</xsl:when>
+					<xsl:when test="@w:char='F057'">
+						&#x03A9;
+					</xsl:when><!-- # GREEK CAPITAL LETTER OMEGA # Omega -->
+					<xsl:when test="@w:char='F057'">
+						&#x2126;
+					</xsl:when><!-- # OHM SIGN # Omega -->
+					<xsl:when test="@w:char='F058'">
+						&#x039E;
+					</xsl:when><!-- # GREEK CAPITAL LETTER XI # Xi -->
+					<xsl:when test="@w:char='F059'">
+						&#x03A8;
+					</xsl:when><!-- # GREEK CAPITAL LETTER PSI # Psi -->
+					<xsl:when test="@w:char='F05A'">
+						&#x0396;
+					</xsl:when><!-- # GREEK CAPITAL LETTER ZETA # Zeta -->
+					<xsl:when test="@w:char='F05B'">
+						&#x005B;
+					</xsl:when><!-- # LEFT SQUARE BRACKET # bracketleft -->
+					<xsl:when test="@w:char='F05C'">
+						&#x2234;
+					</xsl:when><!-- # THEREFORE # therefore -->
+					<xsl:when test="@w:char='F05D'">
+						&#x005D;
+					</xsl:when><!-- # RIGHT SQUARE BRACKET # bracketright -->
+					<xsl:when test="@w:char='F05E'">
+						&#x22A5;
+					</xsl:when><!-- # UP TACK # perpendicular -->
+					<xsl:when test="@w:char='F05F'">
+						&#x005F;
+					</xsl:when><!-- # LOW LINE # underscore -->
+					<xsl:when test="@w:char='F060'">
+						&#xF8E5;
+					</xsl:when><!-- # RADICAL EXTENDER # radicalex (CUS) -->
+					<xsl:when test="@w:char='F061'">
+						&#x03B1;
+					</xsl:when><!-- # GREEK SMALL LETTER ALPHA # alpha -->
+					<xsl:when test="@w:char='F062'">
+						&#x03B2;
+					</xsl:when><!-- # GREEK SMALL LETTER BETA # beta -->
+					<xsl:when test="@w:char='F063'">
+						&#x03C7;
+					</xsl:when><!-- # GREEK SMALL LETTER CHI # chi -->
+					<xsl:when test="@w:char='F064'">
+						&#x03B4;
+					</xsl:when><!-- # GREEK SMALL LETTER DELTA # delta -->
+					<xsl:when test="@w:char='F065'">
+						&#x03B5;
+					</xsl:when><!-- # GREEK SMALL LETTER EPSILON # epsilon -->
+					<xsl:when test="@w:char='F066'">
+						&#x03C6;
+					</xsl:when><!-- # GREEK SMALL LETTER PHI # phi -->
+					<xsl:when test="@w:char='F067'">
+						&#x03B3;
+					</xsl:when><!-- # GREEK SMALL LETTER GAMMA # gamma -->
+					<xsl:when test="@w:char='F068'">
+						&#x03B7;
+					</xsl:when><!-- # GREEK SMALL LETTER ETA # eta -->
+					<xsl:when test="@w:char='F069'">
+						&#x03B9;
+					</xsl:when><!-- # GREEK SMALL LETTER IOTA # iota -->
+					<xsl:when test="@w:char='F06A'">
+						&#x03D5;
+					</xsl:when><!-- # GREEK PHI SYMBOL # phi1 -->
+					<xsl:when test="@w:char='F06B'">
+						&#x03BA;
+					</xsl:when><!-- # GREEK SMALL LETTER KAPPA # kappa -->
+					<xsl:when test="@w:char='F06C'">
+						&#x03BB;
+					</xsl:when><!-- # GREEK SMALL LETTER LAMDA # lambda -->
+					<xsl:when test="@w:char='F06D'">
+						&#x00B5;
+					</xsl:when><!-- # MICRO SIGN # mu -->
+					<xsl:when test="@w:char='F06D'">
+						&#x03BC;
+					</xsl:when><!-- # GREEK SMALL LETTER MU # mu -->
+					<xsl:when test="@w:char='F06E'">
+						&#x03BD;
+					</xsl:when><!-- # GREEK SMALL LETTER NU # nu -->
+					<xsl:when test="@w:char='F06F'">
+						&#x03BF;
+					</xsl:when><!-- # GREEK SMALL LETTER OMICRON # omicron -->
+					<xsl:when test="@w:char='F070'">
+						&#x03C0;
+					</xsl:when><!-- # GREEK SMALL LETTER PI # pi -->
+					<xsl:when test="@w:char='F071'">
+						&#x03B8;
+					</xsl:when>
+					<xsl:when test="@w:char='F072'">
+						&#x03C1;
+					</xsl:when><!-- # GREEK SMALL LETTER RHO # rho -->
+					<xsl:when test="@w:char='F073'">
+						&#x03C3;
+					</xsl:when><!-- # GREEK SMALL LETTER SIGMA # sigma -->
+					<xsl:when test="@w:char='F074'">
+						&#x03C4;
+					</xsl:when><!-- # GREEK SMALL LETTER TAU # tau -->
+					<xsl:when test="@w:char='F075'">
+						&#x03C5;
+					</xsl:when><!-- # GREEK SMALL LETTER UPSILON # upsilon -->
+					<xsl:when test="@w:char='F076'">
+						&#x03D6;
+					</xsl:when><!-- # GREEK PI SYMBOL # omega1 -->
+					<xsl:when test="@w:char='F077'">
+						&#x03C9;
+					</xsl:when><!-- # GREEK SMALL LETTER OMEGA # omega -->
+					<xsl:when test="@w:char='F078'">
+						&#x03BE;
+					</xsl:when><!-- # GREEK SMALL LETTER XI # xi -->
+					<xsl:when test="@w:char='F079'">
+						&#x03C8;
+					</xsl:when><!-- # GREEK SMALL LETTER PSI # psi -->
+					<xsl:when test="@w:char='F07A'">
+						&#x03B6;
+					</xsl:when><!-- # GREEK SMALL LETTER ZETA # zeta -->
+					<xsl:when test="@w:char='F07B'">
+						&#x007B;
+					</xsl:when><!-- # LEFT CURLY BRACKET # braceleft -->
+					<xsl:when test="@w:char='F07C'">
+						&#x007C;
+					</xsl:when><!-- # VERTICAL LINE # bar -->
+					<xsl:when test="@w:char='F07D'">
+						&#x007D;
+					</xsl:when><!-- # RIGHT CURLY BRACKET # braceright -->
+					<xsl:when test="@w:char='F07E'">
+						&#x223C;
+					</xsl:when><!-- # TILDE OPERATOR # similar -->
+					<xsl:when test="@w:char='F0A0'">
+						&#x20AC;
+					</xsl:when><!-- # EURO SIGN # Euro -->
+					<xsl:when test="@w:char='F0A1'">
+						&#x03D2;
+					</xsl:when><!-- # GREEK UPSILON WITH HOOK SYMBOL # Upsilon1 -->
+					<xsl:when test="@w:char='F0A2'">
+						&#x2032;
+					</xsl:when><!-- # PRIME # minute -->
+					<xsl:when test="@w:char='F0A3'">
+						&#x2264;
+					</xsl:when><!-- # LESS-THAN OR EQUAL TO # lessequal -->
+					<xsl:when test="@w:char='F0A4'">
+						&#x2044;
+					</xsl:when><!-- # FRACTION SLASH # fraction -->
+					<xsl:when test="@w:char='F0A4'">
+						&#x2215;
+					</xsl:when><!-- # DIVISION SLASH # fraction -->
+					<xsl:when test="@w:char='F0A5'">
+						&#x221E;
+					</xsl:when><!-- # INFINITY # infinity -->
+					<xsl:when test="@w:char='F0A6'">
+						&#x0192;
+					</xsl:when><!-- # LATIN SMALL LETTER F WITH HOOK # florin -->
+					<xsl:when test="@w:char='F0A7'">
+						&#x2663;
+					</xsl:when><!-- # BLACK CLUB SUIT # club -->
+					<xsl:when test="@w:char='F0A8'">
+						&#x2666;
+					</xsl:when><!-- # BLACK DIAMOND SUIT # diamond -->
+					<xsl:when test="@w:char='F0A9'">
+						&#x2665;
+					</xsl:when><!-- # BLACK HEART SUIT # heart -->
+					<xsl:when test="@w:char='F0AA'">
+						&#x2660;
+					</xsl:when><!-- # BLACK SPADE SUIT # spade -->
+					<xsl:when test="@w:char='F0AB'">
+						&#x2194;
+					</xsl:when><!-- # LEFT RIGHT ARROW # arrowboth -->
+					<xsl:when test="@w:char='F0AC'">
+						&#x2190;
+					</xsl:when><!-- # LEFTWARDS ARROW # arrowleft -->
+					<xsl:when test="@w:char='F0AD'">
+						&#x2191;
+					</xsl:when><!-- # UPWARDS ARROW # arrowup -->
+					<xsl:when test="@w:char='F0AE'">
+						&#x2192;
+					</xsl:when><!-- # RIGHTWARDS ARROW # arrowright -->
+					<xsl:when test="@w:char='F0AF'">
+						&#x2193;
+					</xsl:when><!-- # DOWNWARDS ARROW # arrowdown -->
+					<xsl:when test="@w:char='F0B0'">
+						&#x00B0;
+					</xsl:when><!-- # DEGREE SIGN # degree -->
+					<xsl:when test="@w:char='F0B1'">
+						&#x00B1;
+					</xsl:when><!-- # PLUS-MINUS SIGN # plusminus -->
+					<xsl:when test="@w:char='F0B2'">
+						&#x2033;
+					</xsl:when><!-- # DOUBLE PRIME # second -->
+					<xsl:when test="@w:char='F0B3'">
+						&#x2265;
+					</xsl:when><!-- # GREATER-THAN OR EQUAL TO # greaterequal -->
+					<xsl:when test="@w:char='F0B4'">
+						&#x00D7;
+					</xsl:when><!-- # MULTIPLICATION SIGN # multiply -->
+					<xsl:when test="@w:char='F0B5'">
+						&#x221D;
+					</xsl:when><!-- # PROPORTIONAL TO # proportional -->
+					<xsl:when test="@w:char='F0B6'">
+						&#x2202;
+					</xsl:when><!-- # PARTIAL DIFFERENTIAL # partialdiff -->
+					<xsl:when test="@w:char='F0B7'">
+						&#x2022;
+					</xsl:when><!-- # BULLET # bullet -->
+					<xsl:when test="@w:char='F0B8'">
+						&#x00F7;
+					</xsl:when><!-- # DIVISION SIGN # divide -->
+					<xsl:when test="@w:char='F0B9'">
+						&#x2260;
+					</xsl:when><!-- # NOT EQUAL TO # notequal -->
+					<xsl:when test="@w:char='F0BA'">
+						&#x2261;
+					</xsl:when><!-- # IDENTICAL TO # equivalence -->
+					<xsl:when test="@w:char='F0BB'">
+						&#x2248;
+					</xsl:when><!-- # ALMOST EQUAL TO # approxequal -->
+					<xsl:when test="@w:char='F0BC'">
+						&#x2026;
+					</xsl:when><!-- # HORIZONTAL ELLIPSIS # ellipsis -->
+					<xsl:when test="@w:char='F0BD'">
+						&#xF8E6;
+					</xsl:when><!-- # VERTICAL ARROW EXTENDER # arrowvertex (CUS) -->
+					<xsl:when test="@w:char='F0BE'">
+						&#xF8E7;
+					</xsl:when><!-- # HORIZONTAL ARROW EXTENDER # arrowhorizex (CUS) -->
+					<xsl:when test="@w:char='F0BF'">
+						&#x21B5;
+					</xsl:when><!-- # DOWNWARDS ARROW WITH CORNER LEFTWARDS # carriagereturn -->
+					<xsl:when test="@w:char='F0C0'">
+						&#x2135;
+					</xsl:when><!-- # ALEF SYMBOL # aleph -->
+					<xsl:when test="@w:char='F0C1'">
+						&#x2111;
+					</xsl:when><!-- # BLACK-LETTER CAPITAL I # Ifraktur -->
+					<xsl:when test="@w:char='F0C2'">
+						&#x211C;
+					</xsl:when><!-- # BLACK-LETTER CAPITAL R # Rfraktur -->
+					<xsl:when test="@w:char='F0C3'">
+						&#x2118;
+					</xsl:when><!-- # SCRIPT CAPITAL P # weierstrass -->
+					<xsl:when test="@w:char='F0C4'">
+						&#x2297;
+					</xsl:when><!-- # CIRCLED TIMES # circlemultiply -->
+					<xsl:when test="@w:char='F0C5'">
+						&#x2295;
+					</xsl:when><!-- # CIRCLED PLUS # circleplus -->
+					<xsl:when test="@w:char='F0C6'">
+						&#x2205;
+					</xsl:when><!-- # EMPTY SET # emptyset -->
+					<xsl:when test="@w:char='F0C7'">
+						&#x2229;
+					</xsl:when><!-- # INTERSECTION # intersection -->
+					<xsl:when test="@w:char='F0C8'">
+						&#x222A;
+					</xsl:when><!-- # UNION # union -->
+					<xsl:when test="@w:char='F0C9'">
+						&#x2283;
+					</xsl:when><!-- # SUPERSET OF # propersuperset -->
+					<xsl:when test="@w:char='F0CA'">
+						&#x2287;
+					</xsl:when><!-- # SUPERSET OF OR EQUAL TO # reflexsuperset -->
+					<xsl:when test="@w:char='F0CB'">
+						&#x2284;
+					</xsl:when><!-- # NOT A SUBSET OF # notsubset -->
+					<xsl:when test="@w:char='F0CC'">
+						&#x2282;
+					</xsl:when><!-- # SUBSET OF # propersubset -->
+					<xsl:when test="@w:char='F0CD'">
+						&#x2286;
+					</xsl:when><!-- # SUBSET OF OR EQUAL TO # reflexsubset -->
+					<xsl:when test="@w:char='F0CE'">
+						&#x2208;
+					</xsl:when><!-- # ELEMENT OF # element -->
+					<xsl:when test="@w:char='F0CF'">
+						&#x2209;
+					</xsl:when><!-- # NOT AN ELEMENT OF # notelement -->
+					<xsl:when test="@w:char='F0D0'">
+						&#x2220;
+					</xsl:when><!-- # ANGLE # angle -->
+					<xsl:when test="@w:char='F0D1'">
+						&#x2207;
+					</xsl:when><!-- # NABLA # gradient -->
+					<xsl:when test="@w:char='F0D2'">
+						&#xF6DA;
+					</xsl:when><!-- # REGISTERED SIGN SERIF # registerserif (CUS) -->
+					<xsl:when test="@w:char='F0D3'">
+						&#xF6D9;
+					</xsl:when><!-- # COPYRIGHT SIGN SERIF # copyrightserif (CUS) -->
+					<xsl:when test="@w:char='F0D4'">
+						&#xF6DB;
+					</xsl:when><!-- # TRADE MARK SIGN SERIF # trademarkserif (CUS) -->
+					<xsl:when test="@w:char='F0D5'">
+						&#x220F;
+					</xsl:when><!-- # N-ARY PRODUCT # product -->
+					<xsl:when test="@w:char='F0D6'">
+						&#x221A;
+					</xsl:when><!-- # SQUARE ROOT # radical -->
+					<xsl:when test="@w:char='F0D7'">
+						&#x22C5;
+					</xsl:when><!-- # DOT OPERATOR # dotmath -->
+					<xsl:when test="@w:char='F0D8'">
+						&#x00AC;
+					</xsl:when><!-- # NOT SIGN # logicalnot -->
+					<xsl:when test="@w:char='F0D9'">
+						&#x2227;
+					</xsl:when><!-- # LOGICAL AND # logicaland -->
+					<xsl:when test="@w:char='F0DA'">
+						&#x2228;
+					</xsl:when><!-- # LOGICAL OR # logicalor -->
+					<xsl:when test="@w:char='F0DB'">
+						&#x21D4;
+					</xsl:when><!-- # LEFT RIGHT DOUBLE ARROW # arrowdblboth -->
+					<xsl:when test="@w:char='F0DC'">
+						&#x21D0;
+					</xsl:when><!-- # LEFTWARDS DOUBLE ARROW # arrowdblleft -->
+					<xsl:when test="@w:char='F0DD'">
+						&#x21D1;
+					</xsl:when><!-- # UPWARDS DOUBLE ARROW # arrowdblup -->
+					<xsl:when test="@w:char='F0DE'">
+						&#x21D2;
+					</xsl:when><!-- # RIGHTWARDS DOUBLE ARROW # arrowdblright -->
+					<xsl:when test="@w:char='F0DF'">
+						&#x21D3;
+					</xsl:when><!-- # DOWNWARDS DOUBLE ARROW # arrowdbldown -->
+					<xsl:when test="@w:char='F0E0'">
+						&#x25CA;
+					</xsl:when><!-- # LOZENGE # lozenge -->
+					<xsl:when test="@w:char='F0E1'">
+						&#x2329;
+					</xsl:when><!-- # LEFT-POINTING ANGLE BRACKET # angleleft -->
+					<xsl:when test="@w:char='F0E2'">
+						&#xF8E8;
+					</xsl:when><!-- # REGISTERED SIGN SANS SERIF # registersans (CUS) -->
+					<xsl:when test="@w:char='F0E3'">
+						&#xF8E9;
+					</xsl:when><!-- # COPYRIGHT SIGN SANS SERIF # copyrightsans (CUS) -->
+					<xsl:when test="@w:char='F0E4'">
+						&#xF8EA;
+					</xsl:when><!-- # TRADE MARK SIGN SANS SERIF # trademarksans (CUS) -->
+					<xsl:when test="@w:char='F0E5'">
+						&#x2211;
+					</xsl:when><!-- # N-ARY SUMMATION # summation -->
+					<xsl:when test="@w:char='F0E6'">
+						&#xF8EB;
+					</xsl:when><!-- # LEFT PAREN TOP # parenlefttp (CUS) -->
+					<xsl:when test="@w:char='F0E7'">
+						&#xF8EC;
+					</xsl:when><!-- # LEFT PAREN EXTENDER # parenleftex (CUS) -->
+					<xsl:when test="@w:char='F0E8'">
+						&#xF8ED;
+					</xsl:when><!-- # LEFT PAREN BOTTOM # parenleftbt (CUS) -->
+					<xsl:when test="@w:char='F0E9'">
+						&#xF8EE;
+					</xsl:when><!-- # LEFT SQUARE BRACKET TOP # bracketlefttp (CUS) -->
+					<xsl:when test="@w:char='F0EA'">
+						&#xF8EF;
+					</xsl:when><!-- # LEFT SQUARE BRACKET EXTENDER # bracketleftex (CUS) -->
+					<xsl:when test="@w:char='F0EB'">
+						&#xF8F0;
+					</xsl:when><!-- # LEFT SQUARE BRACKET BOTTOM # bracketleftbt (CUS) -->
+					<xsl:when test="@w:char='F0EC'">
+						&#xF8F1;
+					</xsl:when><!-- # LEFT CURLY BRACKET TOP # bracelefttp (CUS) -->
+					<xsl:when test="@w:char='F0ED'">
+						&#xF8F2;
+					</xsl:when><!-- # LEFT CURLY BRACKET MID # braceleftmid (CUS) -->
+					<xsl:when test="@w:char='F0EE'">
+						&#xF8F3;
+					</xsl:when><!-- # LEFT CURLY BRACKET BOTTOM # braceleftbt (CUS) -->
+					<xsl:when test="@w:char='F0EF'">
+						&#xF8F4;
+					</xsl:when><!-- # CURLY BRACKET EXTENDER # braceex (CUS) -->
+					<xsl:when test="@w:char='F0F1'">
+						&#x232A;
+					</xsl:when><!-- # RIGHT-POINTING ANGLE BRACKET # angleright -->
+					<xsl:when test="@w:char='F0F2'">
+						&#x222B;
+					</xsl:when><!-- # INTEGRAL # integral -->
+					<xsl:when test="@w:char='F0F3'">
+						&#x2320;
+					</xsl:when><!-- # TOP HALF INTEGRAL # integraltp -->
+					<xsl:when test="@w:char='F0F4'">
+						&#xF8F5;
+					</xsl:when><!-- # INTEGRAL EXTENDER # integralex (CUS) -->
+					<xsl:when test="@w:char='F0F5'">
+						&#x2321;
+					</xsl:when><!-- # BOTTOM HALF INTEGRAL # integralbt -->
+					<xsl:when test="@w:char='F0F6'">
+						&#xF8F6;
+					</xsl:when><!-- # RIGHT PAREN TOP # parenrighttp (CUS) -->
+					<xsl:when test="@w:char='F0F7'">
+						&#xF8F7;
+					</xsl:when><!-- # RIGHT PAREN EXTENDER # parenrightex (CUS) -->
+					<xsl:when test="@w:char='F0F8'">
+						&#xF8F8;
+					</xsl:when><!-- # RIGHT PAREN BOTTOM # parenrightbt (CUS) -->
+					<xsl:when test="@w:char='F0F9'">
+						&#xF8F9;
+					</xsl:when><!-- # RIGHT SQUAREBRACKET TOP # bracketrighttp (CUS) -->
+					<xsl:when test="@w:char='F0FA'">
+						&#xF8FA;
+					</xsl:when><!-- # RIGHT SQUARE BRACKET EXTENDER # bracketrightex (CUS) -->
+					<xsl:when test="@w:char='F0FB'">
+						&#xF8FB;
+					</xsl:when><!-- # RIGHT SQUARE BRACKET BOTTOM # bracketrightbt (CUS) -->
+					<xsl:when test="@w:char='F0FC'">
+						&#xF8FC;
+					</xsl:when><!-- # RIGHT CURLY BRACKET TOP # bracerighttp (CUS) -->
+					<xsl:when test="@w:char='F0FD'">
+						&#xF8FD;
+					</xsl:when><!-- # RIGHT CURLY BRACKET MID # bracerightmid (CUS) -->
+					<xsl:when test="@w:char='F0FE'">
+						&#xF8FE;
+					</xsl:when><!-- # RIGHT CURLY BRACKET BOTTOM # bracerightbt (CUS) -->
+					<xsl:otherwise>
+						<g html:style="font-family:{@w:font};" n="{@w:char}" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="@w:font='Wingdings 2' and @w:char='F050'">
+				&#x2713;
+			</xsl:when><!-- tick mark -->
+			<xsl:otherwise>
+				<g html:style="font-family:{@w:font};" n="{@w:char}" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template match="w:ins">
-      <add when="{@w:date}">
-	<xsl:call-template name="identifyChange">
-	   <xsl:with-param name="who" select="@w:author"/>
-	</xsl:call-template>
-	<xsl:call-template name="processTextrun"/>
-      </add>
-    </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			handle tabs
+		</desc>
+	</doc>
+	<xsl:template match="w:r/w:tab">
+		<xsl:text>	</xsl:text>
+	</xsl:template>
 
-    <xsl:template match="w:rPr/w:ins"/>
- 
-    
-  <xsl:template match="w:noBreakHyphen">
-    <xsl:text>&#x2011;</xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			handle ptabs (absolute position tab character)
+		</desc>
+	</doc>
+	<xsl:template match="w:r/w:ptab">
+		<c rend="ptab" type="{@w:alignment}">
+			<xsl:text>	</xsl:text>
+		</c>
+	</xsl:template>
 
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			capture line breaks
+		</desc>
+	</doc>
+	<xsl:template match="w:br">
+		<xsl:choose>
+			<xsl:when test="@w:type='page'">
+				<pb />
+			</xsl:when>
+			<xsl:otherwise>
+				<lb />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Contains text that has been tracked as a revision.
+		</desc>
+	</doc>
+
+	<xsl:template match="w:del">
+		<del when="{@w:date}">
+			<xsl:call-template name="identifyChange">
+				<xsl:with-param name="who" select="@w:author" />
+			</xsl:call-template>
+			<xsl:apply-templates />
+		</del>
+	</xsl:template>
+
+	<xsl:template match="w:rPr/w:del" />
+
+	<xsl:template match="w:delText">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="w:ins">
+		<add when="{@w:date}">
+			<xsl:call-template name="identifyChange">
+				<xsl:with-param name="who" select="@w:author" />
+			</xsl:call-template>
+			<xsl:call-template name="processTextrun" />
+		</add>
+	</xsl:template>
+
+	<xsl:template match="w:rPr/w:ins" />
+
+
+	<xsl:template match="w:noBreakHyphen">
+		<xsl:text>&#x2011;</xsl:text>
+	</xsl:template>
+
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/marginals/marginals.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/marginals/marginals.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/marginals/marginals.xsl	(revision 2397)
@@ -1,107 +1,113 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-		xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop  html   iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop  html   iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: marginals.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Handle footnotes
-    </desc>
-   </doc>
-    <xsl:template match="w:footnoteReference">
-        <note place="foot">
-            <xsl:variable name="referenced-id" select="@w:id"/>
-            <xsl:for-each select="document(concat($wordDirectory,'/word/footnotes.xml'))//w:footnote[@w:id=$referenced-id]">
-                <xsl:apply-templates mode="paragraph"/>
-            </xsl:for-each>
-        </note>
-    </xsl:template>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-        Handle endnotes
-    </desc>
-   </doc>
-    <xsl:template match="w:endnoteReference">
-        <note place="end">
-            <xsl:variable name="referenced-id" select="@w:id"/>
-            <xsl:for-each select="document(concat($wordDirectory,'/word/endnotes.xml'))//w:endnote[@w:id=$referenced-id]">
-                <xsl:apply-templates mode="paragraph"/>
-            </xsl:for-each>
-        </note>
-    </xsl:template>
-    
+				All rights reserved.
+
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: marginals.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handle footnotes
+		</desc>
+	</doc>
+	<xsl:template match="w:footnoteReference">
+		<note place="foot">
+			<xsl:variable name="referenced-id" select="@w:id" />
+			<xsl:for-each
+				select="document(concat($wordDirectory,'/word/footnotes.xml'))//w:footnote[@w:id=$referenced-id]">
+				<xsl:apply-templates mode="paragraph" />
+			</xsl:for-each>
+		</note>
+	</xsl:template>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			Handle endnotes
+		</desc>
+	</doc>
+	<xsl:template match="w:endnoteReference">
+		<note place="end">
+			<xsl:variable name="referenced-id" select="@w:id" />
+			<xsl:for-each
+				select="document(concat($wordDirectory,'/word/endnotes.xml'))//w:endnote[@w:id=$referenced-id]">
+				<xsl:apply-templates mode="paragraph" />
+			</xsl:for-each>
+		</note>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/lists/lists.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/lists/lists.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/lists/lists.xsl	(revision 2397)
@@ -1,133 +1,135 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: lists.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    <!-- 
-        This template handles lists and takes care of nested lists.
-    -->
-    <xsl:template name="listSection">
-        <xsl:variable name="level">
-            <xsl:value-of select="w:pPr/w:pStyle/@w:val"/>
-        </xsl:variable>
-        <list>
-	  <xsl:call-template name="listType"/>
-	  
-	  <!-- ISO Notes are be handled by a specific handler -->
-	  <xsl:for-each-group select="current-group()"
-			      group-adjacent="if(w:pPr/w:pStyle/@w:val=$level)  then 0 
+				All rights reserved.
+
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: lists.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+	<!-- This template handles lists and takes care of nested lists. -->
+	<xsl:template name="listSection">
+		<xsl:variable name="level">
+			<xsl:value-of select="w:pPr/w:pStyle/@w:val" />
+		</xsl:variable>
+		<list>
+			<xsl:call-template name="listType" />
+
+			<!-- ISO Notes are be handled by a specific handler -->
+			<xsl:for-each-group select="current-group()"
+				group-adjacent="if(w:pPr/w:pStyle/@w:val=$level)  then 0 
 					      else if(w:pPr/w:pStyle/@w:val='Note') then 0                 
 					      else if(w:pPr/w:pStyle/@w:val='dl') then 1                
 					      else 1">
-	    <xsl:choose>
-	      <!-- we are still on the same level -->
-	      <xsl:when test="current-grouping-key()=0">
-		<xsl:for-each select="current-group()">
-		  <!-- put items and notes as siblings  for now -->
-		  <xsl:choose>
-		    <xsl:when test="tei:is-list(.)">
-		      <item>
-			<xsl:apply-templates/>
-		      </item>
-		    </xsl:when>
-		    <xsl:otherwise>
-		      <xsl:apply-templates select="." mode="paragraph"/>
-		    </xsl:otherwise>
-		  </xsl:choose>
-		</xsl:for-each>
-	      </xsl:when>
-	      <xsl:otherwise>
-		<xsl:call-template name="listSection"/>
-	      </xsl:otherwise>
-	    </xsl:choose>
-	    
-	  </xsl:for-each-group>
-        </list>
-    </xsl:template>
-    
-    <!--
-        Trying to figure out the style of a list.
-    -->
-    <xsl:template name="listType">
-        <xsl:variable name="style">
-            <xsl:value-of select="w:pPr/w:pStyle/@w:val"/>
-        </xsl:variable>
-        <xsl:variable name="type" select="tei:get-listtype($style)"/>
-        
-        <xsl:attribute name="type">
+				<xsl:choose>
+					<!-- we are still on the same level -->
+					<xsl:when test="current-grouping-key()=0">
+						<xsl:for-each select="current-group()">
+							<!-- put items and notes as siblings for now -->
+							<xsl:choose>
+								<xsl:when test="tei:is-list(.)">
+									<item>
+										<xsl:apply-templates />
+									</item>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:apply-templates select="."
+										mode="paragraph" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="listSection" />
+					</xsl:otherwise>
+				</xsl:choose>
+
+			</xsl:for-each-group>
+		</list>
+	</xsl:template>
+
+	<!-- Trying to figure out the style of a list. -->
+	<xsl:template name="listType">
+		<xsl:variable name="style">
+			<xsl:value-of select="w:pPr/w:pStyle/@w:val" />
+		</xsl:variable>
+		<xsl:variable name="type"
+			select="tei:get-listtype($style)" />
+
+		<xsl:attribute name="type">
             <xsl:choose>
                 <xsl:when test="string-length($type) &gt; 0">
-                    <xsl:value-of select="$type"/>
+                    <xsl:value-of select="$type" />
                 </xsl:when>
                 
                 <!-- try to figure it out by looking at the corresponding numbering file -->
@@ -136,12 +138,15 @@
                     <!-- look up the numbering definition .. either in document.xml or in styles.xml  -->
                     <xsl:variable name="numbering-def">
                         <xsl:choose>
-                            <xsl:when test="w:pPr/w:numPr/w:numId/@w:val">
-                                <xsl:value-of select="w:pPr/w:numPr/w:numId/@w:val"/>
+                            <xsl:when
+			test="w:pPr/w:numPr/w:numId/@w:val">
+                                <xsl:value-of
+			select="w:pPr/w:numPr/w:numId/@w:val" />
                             </xsl:when>
                             <xsl:otherwise>
                                 <!-- we might want to follow the basedOn reference, but not at the moment -->
-                                <xsl:value-of select="document(concat($wordDirectory,'/word/styles.xml'))//w:style[w:name/@w:val=$style]/w:pPr/w:numPr/w:numId/@w:val"/>
+                                <xsl:value-of
+			select="document(concat($wordDirectory,'/word/styles.xml'))//w:style[w:name/@w:val=$style]/w:pPr/w:numPr/w:numId/@w:val" />
                             </xsl:otherwise>
                         </xsl:choose>
                     </xsl:variable>
@@ -149,35 +154,40 @@
                     <!-- look up the level .. either in document.xml or in styles.xml  -->
                     <xsl:variable name="numbering-level">
                         <xsl:choose>
-                            <xsl:when test="w:pPr/w:numPr/w:ilvl/@w:val">
-                                <xsl:value-of select="w:pPr/w:numPr/w:ilvl/@w:val"/>
+                            <xsl:when
+			test="w:pPr/w:numPr/w:ilvl/@w:val">
+                                <xsl:value-of
+			select="w:pPr/w:numPr/w:ilvl/@w:val" />
                             </xsl:when>
                             <xsl:otherwise>
                                 <!-- we might want to follow the basedOn reference, but not at the moment -->
-                                <xsl:value-of select="document(concat($wordDirectory,'/word/styles.xml'))//w:style[w:name/@w:val=$style]/w:pPr/w:numPr/w:ilvl/@w:val"/>
+                                <xsl:value-of
+			select="document(concat($wordDirectory,'/word/styles.xml'))//w:style[w:name/@w:val=$style]/w:pPr/w:numPr/w:ilvl/@w:val" />
                             </xsl:otherwise>
                         </xsl:choose>
                     </xsl:variable>
                     
                     <!-- find the abstract numbering definition and then the corresponding numfmt -->
                     <xsl:variable name="abstract-def"
-                             select="document(concat($wordDirectory,'/word/numbering.xml'))//w:num[@w:numId=$numbering-def]/w:abstractNumId/@w:val"/>
+			select="document(concat($wordDirectory,'/word/numbering.xml'))//w:num[@w:numId=$numbering-def]/w:abstractNumId/@w:val" />
                     <xsl:variable name="numfmt">
-                        <xsl:value-of select="document(concat($wordDirectory,'/word/numbering.xml'))//w:abstractNum[@w:abstractNumId=$abstract-def]/w:lvl[@w:ilvl=$numbering-level]/w:numFmt/@w:val"/>
+                        <xsl:value-of
+			select="document(concat($wordDirectory,'/word/numbering.xml'))//w:abstractNum[@w:abstractNumId=$abstract-def]/w:lvl[@w:ilvl=$numbering-level]/w:numFmt/@w:val" />
                     </xsl:variable>
                     
                     
                     <!-- figure out what numbering scheme to use -->
                     <xsl:choose>
 		        <xsl:when test="$style='dl'">gloss</xsl:when>
-                        <xsl:when test="string-length($numfmt)=0">unordered</xsl:when>
+                        <xsl:when
+			test="string-length($numfmt)=0">unordered</xsl:when>
                         <xsl:when test="$numfmt='bullet'">unordered</xsl:when>
                         <xsl:otherwise>ordered</xsl:otherwise>
                     </xsl:choose>
                 </xsl:otherwise>
             </xsl:choose>
         </xsl:attribute>
-    </xsl:template>
-    
-    
+	</xsl:template>
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/templates/tei-templates.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/templates/tei-templates.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/from/templates/tei-templates.xsl	(revision 2397)
@@ -1,138 +1,142 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
-                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                
-                xmlns="http://www.tei-c.org/ns/1.0"
-                version="2.0"
-                exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet for converting Word docx files to TEI </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
+	xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns="http://www.tei-c.org/ns/1.0" version="2.0"
+	exclude-result-prefixes="a cp dc dcterms dcmitype prop     iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for converting Word docx files to TEI </p>
+			<p>This software is dual-licensed:
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				All rights reserved.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei-templates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-    
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    	simple teiHeader. For a more sophisticated header, think about overriding
-        this template
-    </desc>
-   </doc>
-    <xsl:template name="create-tei-header">
-        <teiHeader>
-            <fileDesc>
-                <titleStmt>
-                    <title>
-                        <xsl:call-template name="getDocTitle"/>
-                    </title>
-                    <author>
-                        <xsl:call-template name="getDocAuthor"/>
-                    </author>
-                </titleStmt>
-                <editionStmt>
-                    <edition>
-                        <date>
-                            <xsl:call-template name="getDocDate"/>
-                        </date>
-                    </edition>
-                </editionStmt>
-                <publicationStmt>
-                    <p>unknown</p>
-                </publicationStmt>
-                <sourceDesc>
-                    <p>Converted from a Word document </p>
-                </sourceDesc>
-            </fileDesc>
-	        <encodingDesc>
-	           <xsl:call-template name="generateAppInfo"/>
-	        </encodingDesc>
-            <revisionDesc>
-	           <change>
-		             <date>
-		                <xsl:text>$LastChangedDate: </xsl:text>
-		                <xsl:value-of select="tei:whatsTheDate()"/>
-		                <xsl:text>$</xsl:text>
-		             </date>
-			     <name>
-			       <xsl:call-template name="getDocAuthor"/>
-			     </name>
-	           </change>
-            </revisionDesc>
-        </teiHeader>
-    </xsl:template>
-    
-    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-     generates a section heading. If you need something specific, feel free
-        to overwrite this template
-    </desc>
-   </doc>
-    <xsl:template name="generate-section-heading">
-        <xsl:param name="Style"/>
-        <head>
-            <xsl:apply-templates/>
-        </head>
-    </xsl:template>
-    
-    
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
+
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-templates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			simple teiHeader. For a more sophisticated header, think about overriding
+			this template
+		</desc>
+	</doc>
+	<xsl:template name="create-tei-header">
+		<teiHeader>
+			<fileDesc>
+				<titleStmt>
+					<title>
+						<xsl:call-template name="getDocTitle" />
+					</title>
+					<author>
+						<xsl:call-template name="getDocAuthor" />
+					</author>
+				</titleStmt>
+				<editionStmt>
+					<edition>
+						<date>
+							<xsl:call-template name="getDocDate" />
+						</date>
+					</edition>
+				</editionStmt>
+				<publicationStmt>
+					<p>unknown</p>
+				</publicationStmt>
+				<sourceDesc>
+					<p>Converted from a Word document </p>
+				</sourceDesc>
+			</fileDesc>
+			<encodingDesc>
+				<xsl:call-template name="generateAppInfo" />
+			</encodingDesc>
+			<revisionDesc>
+				<change>
+					<date>
+						<xsl:text>$LastChangedDate: </xsl:text>
+						<xsl:value-of select="tei:whatsTheDate()" />
+						<xsl:text>$</xsl:text>
+					</date>
+					<name>
+						<xsl:call-template name="getDocAuthor" />
+					</name>
+				</change>
+			</revisionDesc>
+		</teiHeader>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			generates a section heading. If you need something specific, feel free
+			to overwrite this template
+		</desc>
+	</doc>
+	<xsl:template name="generate-section-heading">
+		<xsl:param name="Style" />
+		<head>
+			<xsl:apply-templates />
+		</head>
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/misc/checkword.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/misc/checkword.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/misc/checkword.xsl	(revision 2397)
@@ -1,74 +1,94 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns="http://www.tei-c.org/ns/1.0"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                version="2.0"
-                exclude-result-prefixes="ve o r m v wp w10 w wne mml tbx">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	version="2.0" exclude-result-prefixes="ve o r m v wp w10 w wne mml tbx">
 
-  <xsl:key name="RIDS" match="*[@r:id]" use="1"/>
-  <xsl:key name="RIDS" match="*[@r:embed]" use="1"/>
-  <xsl:key name="STYLES" match="w:rStyle" use="1"/>
-  <xsl:key name="STYLES" match="w:pStyle" use="1"/>
-  <xsl:key name="STYLELIST" match="w:pStyle" use="@w:val"/>
-  <xsl:key name="STYLELIST" match="w:rStyle" use="@w:val"/>
-  <xsl:key name="R" match="rel:Relationship" use="@Id"/>
-  <xsl:key name="S" match="w:style" use="@w:styleId"/>
-  <xsl:output indent="yes"/>
-  <xsl:template match="/">
-      <xsl:message>Check whether styles used match styles defined: </xsl:message>
-      <xsl:for-each select="key('STYLES',1)">
-         <xsl:if test="generate-id() =generate-id(key('STYLELIST',@w:val)[1])">
-	           <xsl:variable name="v" select="@w:val"/>
-	           <xsl:message>Examine style <xsl:value-of select="$v"/>
-            </xsl:message>
-	           <xsl:for-each select="document('styles.xml',/)">
-	              <xsl:choose>
-	                 <xsl:when test="count(key('S',$v))=0">
-	                    <xsl:message>ERROR: no entry for <xsl:value-of select="$v"/>
-                     </xsl:message>
-	                 </xsl:when>
-	                 <xsl:otherwise>
-	                    <xsl:for-each select="key('S',$v)">
-		                      <xsl:message> .... <xsl:value-of select="$v"/>: <xsl:value-of select="w:name/@w:val"/>
-		                      </xsl:message>
-	                    </xsl:for-each>
-	                 </xsl:otherwise>
-	              </xsl:choose>
-	           </xsl:for-each>
-         </xsl:if>
-      </xsl:for-each>
+	<xsl:key name="RIDS" match="*[@r:id]" use="1" />
+	<xsl:key name="RIDS" match="*[@r:embed]" use="1" />
+	<xsl:key name="STYLES" match="w:rStyle" use="1" />
+	<xsl:key name="STYLES" match="w:pStyle" use="1" />
+	<xsl:key name="STYLELIST" match="w:pStyle" use="@w:val" />
+	<xsl:key name="STYLELIST" match="w:rStyle" use="@w:val" />
+	<xsl:key name="R" match="rel:Relationship" use="@Id" />
+	<xsl:key name="S" match="w:style" use="@w:styleId" />
+	<xsl:output indent="yes" />
+	<xsl:template match="/">
+		<xsl:message>
+			Check whether styles used match styles defined:
+		</xsl:message>
+		<xsl:for-each select="key('STYLES',1)">
+			<xsl:if
+				test="generate-id() =generate-id(key('STYLELIST',@w:val)[1])">
+				<xsl:variable name="v" select="@w:val" />
+				<xsl:message>
+					Examine style
+					<xsl:value-of select="$v" />
+				</xsl:message>
+				<xsl:for-each select="document('styles.xml',/)">
+					<xsl:choose>
+						<xsl:when test="count(key('S',$v))=0">
+							<xsl:message>
+								ERROR: no entry for
+								<xsl:value-of select="$v" />
+							</xsl:message>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:for-each select="key('S',$v)">
+								<xsl:message>
+									....
+									<xsl:value-of select="$v" />
+									:
+									<xsl:value-of select="w:name/@w:val" />
+								</xsl:message>
+							</xsl:for-each>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</xsl:if>
+		</xsl:for-each>
 
-      <xsl:message>Check whether rIds are listed in document rels: </xsl:message>
-      <xsl:for-each select="key('RIDS',1)">
-         <xsl:variable name="i">
-	   <xsl:value-of select="@r:id|@r:embed"/>
-	 </xsl:variable>
-	 <xsl:for-each select="document('_rels/document.xml.rels',/)">
-	   <xsl:choose>
-	     <xsl:when test="count(key('R',$i))=0">
-	       <xsl:message>ERROR: no entry for <xsl:value-of select="$i"/>
-	       </xsl:message>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <xsl:for-each select="key('R',$i)">
-		 <xsl:message> .... <xsl:value-of select="$i"/>: <xsl:value-of select="@Target"/>
-		 </xsl:message>
-	       </xsl:for-each>
-	     </xsl:otherwise>
-	   </xsl:choose>
-         </xsl:for-each>
-      </xsl:for-each>
-  </xsl:template>
+		<xsl:message>
+			Check whether rIds are listed in document rels:
+		</xsl:message>
+		<xsl:for-each select="key('RIDS',1)">
+			<xsl:variable name="i">
+				<xsl:value-of select="@r:id|@r:embed" />
+			</xsl:variable>
+			<xsl:for-each
+				select="document('_rels/document.xml.rels',/)">
+				<xsl:choose>
+					<xsl:when test="count(key('R',$i))=0">
+						<xsl:message>
+							ERROR: no entry for
+							<xsl:value-of select="$i" />
+						</xsl:message>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:for-each select="key('R',$i)">
+							<xsl:message>
+								....
+								<xsl:value-of select="$i" />
+								:
+								<xsl:value-of select="@Target" />
+							</xsl:message>
+						</xsl:for-each>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/misc/check-docx-and-annotate.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/misc/check-docx-and-annotate.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/misc/check-docx-and-annotate.xsl	(revision 2397)
@@ -1,286 +1,340 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:dc="http://purl.org/dc/elements/1.1/"
-                xmlns:dcterms="http://purl.org/dc/terms/"
-                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
-                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:iso="http://www.iso.org/ns/1.0"
-                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
-                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
-                xmlns:w10="urn:schemas-microsoft-com:office:word"
-                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
-                xmlns:mml="http://www.w3.org/1998/Math/MathML"
-                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-                xmlns:con="http://schemas.openxmlformats.org/package/2006/content-types"
-                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
-                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
-                version="2.0"
-                exclude-result-prefixes="cp con ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn xsi dc dcterms dcmitype">
-    
-    <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
-    
-    <xsl:param name="word-directory">..</xsl:param>
-    <xsl:param name="styleDoc">
-        <xsl:value-of select="concat($wordDirectory, '/word/styles.xml')"/>
-    </xsl:param>
-    
-    <xsl:key name="Styles" match="w:style/w:name" use="@w:val"/>
-    
-    <xsl:template match="/">
-        <xsl:variable name="comments">
-            <xsl:apply-templates mode="comments"/>
-        </xsl:variable>
-        <xsl:variable name="relations">
-            <xsl:apply-templates select="doc(concat($wordDirectory,'/word/_rels/document.xml.rels'))"
-                              mode="relations"/>
-        </xsl:variable>
-        <xsl:variable name="content-types">
-            <xsl:apply-templates mode="content-types" select="doc(concat($wordDirectory,'/Content_Types.xml'))"/>
-        </xsl:variable>
-        
-        <xsl:message>produce actual document</xsl:message>
-        <xsl:apply-templates mode="document"/>    
-        
-        <xsl:message>write out relations</xsl:message>
-        <xsl:call-template name="write-out-relations">
-            <xsl:with-param name="relations" select="$relations"/>
-        </xsl:call-template>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:dcterms="http://purl.org/dc/terms/"
+	xmlns:dcmitype="http://purl.org/dc/dcmitype/"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:iso="http://www.iso.org/ns/1.0"
+	xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+	xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
+	xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
+	xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
+	xmlns:w10="urn:schemas-microsoft-com:office:word"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
+	xmlns:mml="http://www.w3.org/1998/Math/MathML"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	xmlns:con="http://schemas.openxmlformats.org/package/2006/content-types"
+	xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
+	xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0" version="2.0"
+	exclude-result-prefixes="cp con ve o r m v wp w10 w wne mml tbx iso tei a xs pic fn xsi dc dcterms dcmitype">
 
-        <xsl:message>write out content types</xsl:message>
-        <xsl:call-template name="write-out-content-types">
-            <xsl:with-param name="types" select="$content-types"/>
-        </xsl:call-template>
-        
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" />
 
-        <xsl:message>write out comments</xsl:message>
-        <xsl:call-template name="write-out-comments">
-            <xsl:with-param name="comments" select="$comments"/>
-        </xsl:call-template>
-        
-        <xsl:message>lock down document</xsl:message>
-        <xsl:call-template name="lock-down-document"/>
-    </xsl:template>
-    
-    <!-- identity transform  document-->
-    <xsl:template match="@*|text()|comment()|processing-instruction()" mode="document">
-        <xsl:copy-of select="."/>
-    </xsl:template>
-    
-    <xsl:template match="*" mode="document">
-        <xsl:copy>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="document"/>
-        </xsl:copy>
-    </xsl:template>
-    
-    <!-- identity transform relations -->
-    <xsl:template match="@*|text()|comment()|processing-instruction()" mode="relations">
-        <xsl:copy-of select="."/>
-    </xsl:template>
-    
-    <xsl:template match="*" mode="relations">
-        <xsl:copy>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="document"/>
-        </xsl:copy>
-    </xsl:template>
-    
-    <!-- copy nothing for comments -->
-    <xsl:template match="@*|text()|comment()|processing-instruction()" mode="comments"/>
-        
-    
-    <xsl:template match="*" mode="comments">
-        <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="comments"/>
-    </xsl:template>
-    
-    <!-- identity transform content types -->
-    <xsl:template match="@*|text()|comment()|processing-instruction()" mode="content-types">
-        <xsl:copy-of select="."/>
-    </xsl:template>
-    
-    <xsl:template match="*" mode="content-types">
-        <xsl:copy>
-            <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="content-types"/>
-        </xsl:copy>
-    </xsl:template>    
+	<xsl:param name="word-directory">
+		..
+	</xsl:param>
+	<xsl:param name="styleDoc">
+		<xsl:value-of
+			select="concat($wordDirectory, '/word/styles.xml')" />
+	</xsl:param>
 
-    <!-- comment helper -->
-    <xsl:template name="create-comment">
-        <xsl:param name="id"/>
-        <xsl:param name="text"/>
-        <w:comment w:id="{$id}" w:author="TEIISO" w:date="2008-09-28T14:17:00Z" w:initials="SPQR">
-            <w:p>
-                <w:pPr>
-                    <w:pStyle w:val="CommentText"/>
-                </w:pPr>
-                <w:r>
-                    <w:annotationRef/>
-		</w:r>
-		<xsl:apply-templates select="$text"/>
-            </w:p>
-        </w:comment>
-    </xsl:template>
-    
-    <!-- put back correct styles -->
-    <xsl:template match="w:pStyle" mode="document">
-        <w:pStyle>
-            <xsl:attribute name="w:val">
-                <xsl:call-template name="getStyleName">
-                    <xsl:with-param name="in" select="@w:val"/>
+	<xsl:key name="Styles" match="w:style/w:name" use="@w:val" />
+
+	<xsl:template match="/">
+		<xsl:variable name="comments">
+			<xsl:apply-templates mode="comments" />
+		</xsl:variable>
+		<xsl:variable name="relations">
+			<xsl:apply-templates
+				select="doc(concat($wordDirectory,'/word/_rels/document.xml.rels'))"
+				mode="relations" />
+		</xsl:variable>
+		<xsl:variable name="content-types">
+			<xsl:apply-templates mode="content-types"
+				select="doc(concat($wordDirectory,'/Content_Types.xml'))" />
+		</xsl:variable>
+
+		<xsl:message>
+			produce actual document
+		</xsl:message>
+		<xsl:apply-templates mode="document" />
+
+		<xsl:message>
+			write out relations
+		</xsl:message>
+		<xsl:call-template name="write-out-relations">
+			<xsl:with-param name="relations" select="$relations" />
+		</xsl:call-template>
+
+		<xsl:message>
+			write out content types
+		</xsl:message>
+		<xsl:call-template name="write-out-content-types">
+			<xsl:with-param name="types" select="$content-types" />
+		</xsl:call-template>
+
+
+		<xsl:message>
+			write out comments
+		</xsl:message>
+		<xsl:call-template name="write-out-comments">
+			<xsl:with-param name="comments" select="$comments" />
+		</xsl:call-template>
+
+		<xsl:message>
+			lock down document
+		</xsl:message>
+		<xsl:call-template name="lock-down-document" />
+	</xsl:template>
+
+	<!-- identity transform document -->
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="document">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*" mode="document">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()"
+				mode="document" />
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- identity transform relations -->
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="relations">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*" mode="relations">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()"
+				mode="document" />
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- copy nothing for comments -->
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="comments" />
+
+
+	<xsl:template match="*" mode="comments">
+		<xsl:apply-templates
+			select="*|@*|processing-instruction()|comment()|text()"
+			mode="comments" />
+	</xsl:template>
+
+	<!-- identity transform content types -->
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()"
+		mode="content-types">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*" mode="content-types">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()"
+				mode="content-types" />
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- comment helper -->
+	<xsl:template name="create-comment">
+		<xsl:param name="id" />
+		<xsl:param name="text" />
+		<w:comment w:id="{$id}" w:author="TEIISO"
+			w:date="2008-09-28T14:17:00Z" w:initials="SPQR">
+			<w:p>
+				<w:pPr>
+					<w:pStyle w:val="CommentText" />
+				</w:pPr>
+				<w:r>
+					<w:annotationRef />
+				</w:r>
+				<xsl:apply-templates select="$text" />
+			</w:p>
+		</w:comment>
+	</xsl:template>
+
+	<!-- put back correct styles -->
+	<xsl:template match="w:pStyle" mode="document">
+		<w:pStyle>
+			<xsl:attribute name="w:val">
+                <xsl:call-template
+				name="getStyleName">
+                    <xsl:with-param name="in"
+				select="@w:val" />
                 </xsl:call-template>
             </xsl:attribute>
-        </w:pStyle>
-    </xsl:template>
-    
-    <xsl:template match="w:rStyle" mode="document">
-        <w:rStyle>
-            <xsl:attribute name="w:val">
-                <xsl:call-template name="getStyleName">
-                    <xsl:with-param name="in" select="@w:val"/>
+		</w:pStyle>
+	</xsl:template>
+
+	<xsl:template match="w:rStyle" mode="document">
+		<w:rStyle>
+			<xsl:attribute name="w:val">
+                <xsl:call-template
+				name="getStyleName">
+                    <xsl:with-param name="in"
+				select="@w:val" />
                 </xsl:call-template>
             </xsl:attribute>
-        </w:rStyle>
-    </xsl:template>
-    
+		</w:rStyle>
+	</xsl:template>
 
-    <xsl:template name="getStyleName">
-        <xsl:param name="in"/>
-        <xsl:for-each select="document($styleDoc,/)">
-            <xsl:for-each select="key('Styles',$in)">
-                <xsl:value-of select="parent::w:style/@w:styleId"/>
-            </xsl:for-each>
-        </xsl:for-each>
-    </xsl:template>
-    
-    
-    <!-- content types -->
-    <xsl:template match="con:Override[@PartName='/word/comments.xml']"/>
-    <!-- write out content-types -->
-    <xsl:template name="write-out-content-types">
-        <xsl:param name="types"/>
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/Content_Types_new.xml')"/>
-         </xsl:message>
-	     </xsl:if>
-        <xsl:result-document href="{concat($wordDirectory,'/Content_Types_new.xml')}" standalone="yes">
-            <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
-                <xsl:for-each select="$types/child::node()/*">
-                    <xsl:copy-of select="."/>
-                </xsl:for-each>
-                <Override PartName="/word/comments.xml"
-                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"/>
-            </Types>
-        </xsl:result-document>
-    </xsl:template>
-    
-    
-    <!-- write out relations -->
-    <xsl:template name="write-out-relations">
-        <xsl:param name="relations"/>
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'word/_rels/document_new.xml.rels')"/>
-         </xsl:message>
-	     </xsl:if>
-        <xsl:result-document href="{concat($wordDirectory,'/word/_rels/document_new.xml.rels')}"
-                           standalone="yes">
-            <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
-                <xsl:for-each select="$relations/child::node()/*">
-                    <xsl:copy-of select="."/>
-                </xsl:for-each>
-                <Relationship Id="rId9999"
-                          Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
-                          Target="comments.xml"/>
-            </Relationships>
-        </xsl:result-document>
-    </xsl:template>
-    
-    <!-- write out comments -->
-    <xsl:template name="write-out-comments">
-        <xsl:param name="comments"/>
-	     <xsl:if test="$debug='true'">
-	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'word/_rels/comments.xml')"/>
-         </xsl:message>
-	     </xsl:if>
-        <xsl:result-document href="{concat($wordDirectory,'/word/comments.xml')}" standalone="yes">
-            <w:comments xmlns:mv="urn:schemas-microsoft-com:mac:vml"
-                     xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main">
-                <xsl:copy-of select="$comments"/>
-            </w:comments>
-        </xsl:result-document>
-    </xsl:template>
-    
-    <!-- writes settings.xml and app.xml to lock down the document -->
-    <xsl:template name="lock-down-document">
-        <xsl:result-document href="{concat($wordDirectory,'/docProps/app.xml')}" standalone="yes">
-            <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
-                     xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
-                <Template>STD_3_0_0.dotx</Template>
-                <Application>TEIISO tei-docx.xsl</Application>
-                <DocSecurity>8</DocSecurity>
-                <SharedDoc>true</SharedDoc>
-                <AppVersion>1.0</AppVersion>
-            </Properties>
-        </xsl:result-document>
-        
-        <xsl:result-document href="{concat($wordDirectory,'/word/settings.xml')}" standalone="yes">
-            <w:settings xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">
-                <w:zoom w:percent="100"/>
-                <w:attachedTemplate r:id="rId1"/>
-                <w:linkStyles/>
-                <w:doNotTrackMoves/>
-                <w:documentProtection w:edit="readOnly" w:enforcement="1"/>
-                <w:defaultTabStop w:val="720"/>
-                <w:hyphenationZone w:val="425"/>
-                <w:evenAndOddHeaders/>
-                <w:drawingGridHorizontalSpacing w:val="110"/>
-                <w:displayHorizontalDrawingGridEvery w:val="2"/>
-                <w:characterSpacingControl w:val="doNotCompress"/>
-                <w:hdrShapeDefaults>
-                    <o:shapedefaults v:ext="edit" spidmax="2050"/>
-                </w:hdrShapeDefaults>
-                <w:compat/>
-                <w:rsids/>
-                <m:mathPr>
-                    <m:mathFont m:val="MT Symbol"/>
-                    <m:brkBin m:val="before"/>
-                    <m:brkBinSub m:val="--"/>
-                    <m:smallFrac m:val="off"/>
-                    <m:dispDef/>
-                    <m:lMargin m:val="0"/>
-                    <m:rMargin m:val="0"/>
-                    <m:defJc m:val="centerGroup"/>
-                    <m:wrapIndent m:val="1440"/>
-                    <m:intLim m:val="subSup"/>
-                    <m:naryLim m:val="undOvr"/>
-                </m:mathPr>
-                <w:attachedSchema w:val="ActionsPane3"/>
-                <w:themeFontLang w:val="en-GB"/>
-                <w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1"
-                                w:accent2="accent2"
-                                w:accent3="accent3"
-                                w:accent4="accent4"
-                                w:accent5="accent5"
-                                w:accent6="accent6"
-                                w:hyperlink="hyperlink"
-                                w:followedHyperlink="followedHyperlink"/>
-                <w:shapeDefaults>
-                    <o:shapedefaults v:ext="edit" spidmax="2050"/>
-                    <o:shapelayout v:ext="edit">
-                        <o:idmap v:ext="edit" data="1"/>
-                    </o:shapelayout>
-                </w:shapeDefaults>
-                <w:decimalSymbol w:val="."/>
-                <w:listSeparator w:val=","/>
-            </w:settings>
-            
-        </xsl:result-document>
-    </xsl:template>
+
+	<xsl:template name="getStyleName">
+		<xsl:param name="in" />
+		<xsl:for-each select="document($styleDoc,/)">
+			<xsl:for-each select="key('Styles',$in)">
+				<xsl:value-of select="parent::w:style/@w:styleId" />
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+
+
+	<!-- content types -->
+	<xsl:template
+		match="con:Override[@PartName='/word/comments.xml']" />
+	<!-- write out content-types -->
+	<xsl:template name="write-out-content-types">
+		<xsl:param name="types" />
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'/Content_Types_new.xml')" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			href="{concat($wordDirectory,'/Content_Types_new.xml')}"
+			standalone="yes">
+			<Types
+				xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
+				<xsl:for-each select="$types/child::node()/*">
+					<xsl:copy-of select="." />
+				</xsl:for-each>
+				<Override PartName="/word/comments.xml"
+					ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" />
+			</Types>
+		</xsl:result-document>
+	</xsl:template>
+
+
+	<!-- write out relations -->
+	<xsl:template name="write-out-relations">
+		<xsl:param name="relations" />
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'word/_rels/document_new.xml.rels')" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			href="{concat($wordDirectory,'/word/_rels/document_new.xml.rels')}"
+			standalone="yes">
+			<Relationships
+				xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
+				<xsl:for-each select="$relations/child::node()/*">
+					<xsl:copy-of select="." />
+				</xsl:for-each>
+				<Relationship Id="rId9999"
+					Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
+					Target="comments.xml" />
+			</Relationships>
+		</xsl:result-document>
+	</xsl:template>
+
+	<!-- write out comments -->
+	<xsl:template name="write-out-comments">
+		<xsl:param name="comments" />
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Writing out
+				<xsl:value-of
+					select="concat($wordDirectory,'word/_rels/comments.xml')" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:result-document
+			href="{concat($wordDirectory,'/word/comments.xml')}" standalone="yes">
+			<w:comments xmlns:mv="urn:schemas-microsoft-com:mac:vml"
+				xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main">
+				<xsl:copy-of select="$comments" />
+			</w:comments>
+		</xsl:result-document>
+	</xsl:template>
+
+	<!-- writes settings.xml and app.xml to lock down the document -->
+	<xsl:template name="lock-down-document">
+		<xsl:result-document
+			href="{concat($wordDirectory,'/docProps/app.xml')}" standalone="yes">
+			<Properties
+				xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
+				xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
+				<Template>STD_3_0_0.dotx</Template>
+				<Application>TEIISO tei-docx.xsl</Application>
+				<DocSecurity>8</DocSecurity>
+				<SharedDoc>true</SharedDoc>
+				<AppVersion>1.0</AppVersion>
+			</Properties>
+		</xsl:result-document>
+
+		<xsl:result-document
+			href="{concat($wordDirectory,'/word/settings.xml')}" standalone="yes">
+			<w:settings
+				xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">
+				<w:zoom w:percent="100" />
+				<w:attachedTemplate r:id="rId1" />
+				<w:linkStyles />
+				<w:doNotTrackMoves />
+				<w:documentProtection w:edit="readOnly"
+					w:enforcement="1" />
+				<w:defaultTabStop w:val="720" />
+				<w:hyphenationZone w:val="425" />
+				<w:evenAndOddHeaders />
+				<w:drawingGridHorizontalSpacing
+					w:val="110" />
+				<w:displayHorizontalDrawingGridEvery
+					w:val="2" />
+				<w:characterSpacingControl
+					w:val="doNotCompress" />
+				<w:hdrShapeDefaults>
+					<o:shapedefaults v:ext="edit" spidmax="2050" />
+				</w:hdrShapeDefaults>
+				<w:compat />
+				<w:rsids />
+				<m:mathPr>
+					<m:mathFont m:val="MT Symbol" />
+					<m:brkBin m:val="before" />
+					<m:brkBinSub m:val="--" />
+					<m:smallFrac m:val="off" />
+					<m:dispDef />
+					<m:lMargin m:val="0" />
+					<m:rMargin m:val="0" />
+					<m:defJc m:val="centerGroup" />
+					<m:wrapIndent m:val="1440" />
+					<m:intLim m:val="subSup" />
+					<m:naryLim m:val="undOvr" />
+				</m:mathPr>
+				<w:attachedSchema w:val="ActionsPane3" />
+				<w:themeFontLang w:val="en-GB" />
+				<w:clrSchemeMapping w:bg1="light1" w:t1="dark1"
+					w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2"
+					w:accent3="accent3" w:accent4="accent4" w:accent5="accent5"
+					w:accent6="accent6" w:hyperlink="hyperlink"
+					w:followedHyperlink="followedHyperlink" />
+				<w:shapeDefaults>
+					<o:shapedefaults v:ext="edit" spidmax="2050" />
+					<o:shapelayout v:ext="edit">
+						<o:idmap v:ext="edit" data="1" />
+					</o:shapelayout>
+				</w:shapeDefaults>
+				<w:decimalSymbol w:val="." />
+				<w:listSeparator w:val="," />
+			</w:settings>
+
+		</xsl:result-document>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/build-to.xml	(revision 2397)
@@ -1,147 +1,158 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teidocx">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9875 2011-12-04 18:27:43Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into docx files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output docx file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile directory-->
-  <property name="profileDir" value="../profiles"/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- which language -->
-  <property name="lang" value="en"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="teitoDocx"       value="${profileDir}/${profile}/docx/to.xsl"/>
-  <property name="listgraphics"    value="../tools/makegraphicsanttask.xsl"/>
-  <dirname property="xslDir"       file="${teitoDocx}"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir"    file="${outputFile}"/>
-  <property name="outputTempDir"   value="${outputDir}/temp-dir-for-ant"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9875 2011-12-04 18:27:43Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into docx files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output docx file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile directory -->
+	<property name="profileDir" value="../profiles" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- which language -->
+	<property name="lang" value="en" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="teitoDocx"
+		value="${profileDir}/${profile}/docx/to.xsl" />
+	<property name="listgraphics"
+		value="../tools/makegraphicsanttask.xsl" />
+	<dirname property="xslDir" file="${teitoDocx}" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
 
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
 
-  <condition property="makecoverpages">
-    <available file="${profileDir}/${profile}/docx/makecoverpages.xsl"/>
-  </condition>
-  <import file="../odds2/build-to.xml"/>
-  <target name="setup">
-    <!-- Recreate temporary output directory -->
-    <taskdef name="images" classname="ImageTask" classpath="../tools/ImageInfo/ImageInfo.jar"/>
-    <delete dir="${outputTempDir}"/>
-    <mkdir  dir="${outputTempDir}"/>
-  </target>
+	<condition property="makecoverpages">
+		<available
+			file="${profileDir}/${profile}/docx/makecoverpages.xsl" />
+	</condition>
+	<import file="../odds2/build-to.xml" />
+	<target name="setup">
+		<!-- Recreate temporary output directory -->
+		<taskdef name="images" classname="ImageTask"
+			classpath="../tools/ImageInfo/ImageInfo.jar" />
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
 
-  <target name="nocoverpages" unless="makecoverpages">
-    <move file="${outputTempDir}/newdocument.xml" tofile="${outputTempDir}/word/document.xml" overwrite="true"/>
-  </target>
+	<target name="nocoverpages" unless="makecoverpages">
+		<move file="${outputTempDir}/newdocument.xml"
+			tofile="${outputTempDir}/word/document.xml" overwrite="true" />
+	</target>
 
-  <target name="coverpages" if="makecoverpages">
-    <echo>Make cover pages</echo>
-    <xslt
-	  style="${profileDir}/${profile}/docx/makecoverpages.xsl" 
-	  in="${outputTempDir}/word/document.xml" 
-	  out="${outputTempDir}/tmp3.xml" 
-	  classpath="classpath">
-      <xmlcatalog>
-	<catalogpath>
-	  <pathelement location="../../../../catalog.xml"/>
-	  <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-	</catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9he.jar"/>
-      <param name="headerFile"   expression="file:///${outputTempDir}/tmp2.xml"/>
-      <param name="documentFile" expression="file:///${outputTempDir}/newdocument.xml"/>
-    </xslt>
-    <move file="${outputTempDir}/tmp3.xml" tofile="${outputTempDir}/word/document.xml" overwrite="true"/>
-    <delete file="${outputTempDir}/newdocument.xml"/>
-  </target>
+	<target name="coverpages" if="makecoverpages">
+		<echo>Make cover pages</echo>
+		<xslt style="${profileDir}/${profile}/docx/makecoverpages.xsl"
+			in="${outputTempDir}/word/document.xml"
+			out="${outputTempDir}/tmp3.xml" classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9he.jar" />
+			<param name="headerFile"
+				expression="file:///${outputTempDir}/tmp2.xml" />
+			<param name="documentFile"
+				expression="file:///${outputTempDir}/newdocument.xml" />
+		</xslt>
+		<move file="${outputTempDir}/tmp3.xml"
+			tofile="${outputTempDir}/word/document.xml" overwrite="true" />
+		<delete file="${outputTempDir}/newdocument.xml" />
+	</target>
 
 
 
-  <target name="transform">
-    <!-- The transformation for DOCX output. -->
-    <echo level="info">unzip Word template</echo>
-    <unzip src="${xslDir}/template.docx" dest="${outputTempDir}"/>
-    <echo level="info">Get names of graphics files and write an ant task</echo>
-    <xslt force="yes" style="${listgraphics}" classpath="classpath" in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/copy.xml">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="inputDir" expression="${inputFileDir}"/>
-      <param name="mediaDir" expression="word/media"/>
-    </xslt>
-    <echo level="info">Copy image files by running ant task</echo>
-    <ant antfile="${outputTempDir}/copy.xml"/>
-    <echo level="info">Read dimensions of image files and write info file</echo>
-    <images outputFile="${outputTempDir}/image-size-info.xml">
-      <fileset dir="${outputTempDir}/word" includes="media/*.*"/>
-    </images>
-    <echo level="info">XSLT generate files for docx </echo>
-    <xslt force="yes" style="${teitoDocx}" in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/newdocument.xml" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="word-directory" expression="file:///${outputTempDir}"/>
-      <param name="inputDir" expression="${inputFileDir}"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-    <move file="${outputTempDir}/docProps/newcore.xml" tofile="${outputTempDir}/docProps/core.xml" overwrite="true"/>
-    <move file="${outputTempDir}/docProps/newcustom.xml" tofile="${outputTempDir}/docProps/custom.xml" overwrite="true"/>
-  </target>
+	<target name="transform">
+		<!-- The transformation for DOCX output. -->
+		<echo level="info">unzip Word template</echo>
+		<unzip src="${xslDir}/template.docx" dest="${outputTempDir}" />
+		<echo level="info">Get names of graphics files and write an ant task</echo>
+		<xslt force="yes" style="${listgraphics}" classpath="classpath"
+			in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/copy.xml">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="inputDir" expression="${inputFileDir}" />
+			<param name="mediaDir" expression="word/media" />
+		</xslt>
+		<echo level="info">Copy image files by running ant task</echo>
+		<ant antfile="${outputTempDir}/copy.xml" />
+		<echo level="info">Read dimensions of image files and write info file</echo>
+		<images outputFile="${outputTempDir}/image-size-info.xml">
+			<fileset dir="${outputTempDir}/word" includes="media/*.*" />
+		</images>
+		<echo level="info">XSLT generate files for docx </echo>
+		<xslt force="yes" style="${teitoDocx}"
+			in="${outputTempDir}/tmp2.xml" out="${outputTempDir}/newdocument.xml"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="word-directory"
+				expression="file:///${outputTempDir}" />
+			<param name="inputDir" expression="${inputFileDir}" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+		<move file="${outputTempDir}/docProps/newcore.xml"
+			tofile="${outputTempDir}/docProps/core.xml" overwrite="true" />
+		<move file="${outputTempDir}/docProps/newcustom.xml"
+			tofile="${outputTempDir}/docProps/custom.xml" overwrite="true" />
+	</target>
 
-  <target name="zip">
-    <echo level="info">ZIP: put files from ${outputTempDir} together into ${outputFile}</echo>
-    <zip destfile="${outputDir}/temp-for-ant.zip" basedir="${outputTempDir}" compress="true" excludes="tmp1.xml,tmp2.xml,image-size-info.xml,copy.xml"/>
-    <move file="${outputDir}/temp-for-ant.zip" tofile="${outputFile}" overwrite="true"/>
-  </target>
+	<target name="zip">
+		<echo level="info">ZIP: put files from ${outputTempDir} together into
+			${outputFile}</echo>
+		<zip destfile="${outputDir}/temp-for-ant.zip"
+			basedir="${outputTempDir}" compress="true"
+			excludes="tmp1.xml,tmp2.xml,image-size-info.xml,copy.xml" />
+		<move file="${outputDir}/temp-for-ant.zip" tofile="${outputFile}"
+			overwrite="true" />
+	</target>
 
-  <target name="cleanup" unless="debug">
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 
-  <target name="dist"
-	  depends="setup,odd,notodd,transform,nocoverpages,coverpages,zip,cleanup"/>
+	<target name="dist"
+		depends="setup,odd,notodd,transform,nocoverpages,coverpages,zip,cleanup" />
 
 
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/build-from.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/build-from.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/docx/build-from.xml	(revision 2397)
@@ -1,87 +1,84 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="docxtei">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-from.xml 9316 2011-09-13 08:06:05Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert docx files to TEI documents.
- -->
-  <!-- Path to docx file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output TEI file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- which language -->
-  <property name="lang" value="en"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="docxtoTEI"  value="../profiles/${profile}/docx/from.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir"    file="${outputFile}"/>
-  <property name="outputTempDir"   value="${outputDir}/temp-dir-for-ant"/>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-from.xml 9316 2011-09-13 08:06:05Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert docx files to TEI documents. -->
+	<!-- Path to docx file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output TEI file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- which language -->
+	<property name="lang" value="en" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="docxtoTEI"
+		value="../profiles/${profile}/docx/from.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
 
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
 
-  <target name="setup">
-    <!-- Recreate temporary output directory -->
-    <delete dir="${outputTempDir}"/>
-    <mkdir  dir="${outputTempDir}"/>
-  </target>
+	<target name="setup">
+		<!-- Recreate temporary output directory -->
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
 
-  <target name="dist" depends="convert,mediadir.check,picturecopy,cleanup"/>
+	<target name="dist"
+		depends="convert,mediadir.check,picturecopy,cleanup" />
 
-  <target name="convert" depends="setup">
-    <echo>Convert using ${docxtoTEI}</echo>
-    <unzip src="${inputFile}" dest="${outputTempDir}"/>
-    <xslt force="yes" style="${docxtoTEI}" classpath="classpath" in="${outputTempDir}/word/document.xml" out="${outputFile}">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="word-directory" expression="file:///${outputTempDir}"/>
-      <param name="inputDir" expression="${inputFileDir}"/>
-      <param name="mediaDir" expression="word/media"/>
-    </xslt>
-  </target>
+	<target name="convert" depends="setup">
+		<echo>Convert using ${docxtoTEI}</echo>
+		<unzip src="${inputFile}" dest="${outputTempDir}" />
+		<xslt force="yes" style="${docxtoTEI}" classpath="classpath"
+			in="${outputTempDir}/word/document.xml" out="${outputFile}">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="word-directory"
+				expression="file:///${outputTempDir}" />
+			<param name="inputDir" expression="${inputFileDir}" />
+			<param name="mediaDir" expression="word/media" />
+		</xslt>
+	</target>
 
-  <target name="mediadir.check">
-    <condition property="mediadir.exists">
-      <available file="${outputTempDir}/word/media" type="dir"/>
-    </condition>
-  </target>
+	<target name="mediadir.check">
+		<condition property="mediadir.exists">
+			<available file="${outputTempDir}/word/media" type="dir" />
+		</condition>
+	</target>
 
-  <target name="picturecopy" if="${mediadir.exists}">
-    <mkdir dir="${outputDir}/media"/>
-    <move todir="${outputDir}/media"  overwrite="true">
-      <fileset dir="${outputTempDir}/word/media"/>
-    </move>
-  </target>
+	<target name="picturecopy" if="${mediadir.exists}">
+		<mkdir dir="${outputDir}/media" />
+		<move todir="${outputDir}/media" overwrite="true">
+			<fileset dir="${outputTempDir}/word/media" />
+		</move>
+	</target>
 
-  <target name="cleanup" unless="debug">
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
 
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/odd.css
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/odd.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/odd.css	(revision 2397)
@@ -1,382 +1,461 @@
 /* tables for reference display */
 table.wovenodd {
-    width: 100%;
-    clear: both;
+	width: 100%;
+	clear: both;
 }
+
 td.wovenodd-col1 {
-    width:15%;
-    vertical-align: top;
+	width: 15%;
+	vertical-align: top;
 }
+
 td.wovenodd-col2 {
-    width:85%;
+	width: 85%;
 }
+
 table.wovenodd tr td {
-    border: 1px solid #555;
-    padding:1%;
+	border: 1px solid #555;
+	padding: 1%;
 }
+
 table.wovenodd {
-    border-spacing:0px;
-    border-collapse:collapse;
+	border-spacing: 0px;
+	border-collapse: collapse;
 }
+
 table.wovenodd tr td {
-    border-spacing:0px;
+	border-spacing: 0px;
 }
+
 table.wovenodd tr {
-    border-spacing:0px;
-    border-collapse:collapse;
+	border-spacing: 0px;
+	border-collapse: collapse;
 }
+
 table.wovenodd tr td table.attList {
-    border-spacing:0px;
-    border:none;
+	border-spacing: 0px;
+	border: none;
 }
+
 table.wovenodd tr td table.attList tr {
-    border-spacing:0px;
-    border:none;
+	border-spacing: 0px;
+	border: none;
 }
+
 table.wovenodd tr td table.attList tr td {
-    border-spacing:0px;
-    border:none;
+	border-spacing: 0px;
+	border: none;
 }
+
 table.attList {
-    table-layout: fixed;
-    width: 100%;
-    margin: 0pt;
-    padding: 0pt;
+	table-layout: fixed;
+	width: 100%;
+	margin: 0pt;
+	padding: 0pt;
 }
+
 td.odd_label {
-    vertical-align: top;
-    width: 10%;
-    font-weight: bold;
+	vertical-align: top;
+	width: 10%;
+	font-weight: bold;
 }
+
 td.odd_value {
-    vertical-align: top;
-    width: 90%;
+	vertical-align: top;
+	width: 90%;
 }
+
 table.attDef {
-    table-layout: fixed;
-    width: 100%;
+	table-layout: fixed;
+	width: 100%;
 }
+
 table.attDef td.odd_label {
-    width: 10%;
-    vertical-align: top;
-    font-weight: normal;
+	width: 10%;
+	vertical-align: top;
+	font-weight: normal;
 }
+
 table.attDef td.odd_value {
-    vertical-align: top;
-    width: 90%;
+	vertical-align: top;
+	width: 90%;
 }
+
 table.attList  td.odd_label:before {
-    content: "@";
+	content: "@";
 }
+
 table.attDef  td.odd_label:before {
-    content: "";
+	content: "";
 }
+
 table.valList  td.odd_label:before {
-    content: "";
+	content: "";
 }
+
 table.valList {
-    table-layout: fixed;
-    width: 100%;
+	table-layout: fixed;
+	width: 100%;
 }
+
 table.valList td.odd_label {
-    width: 10%;
-    vertical-align: top;
-    font-style: normal;
-    font-weight: normal;
+	width: 10%;
+	vertical-align: top;
+	font-style: normal;
+	font-weight: normal;
 }
+
 table.valList td.odd_value {
-    vertical-align: top;
-    width: 90%;
+	vertical-align: top;
+	width: 90%;
 }
+
 table.specDesc td.Attribute {
-    font-weight: bold;
-    vertical-align: top;
+	font-weight: bold;
+	vertical-align: top;
 }
+
 table.specDesc {
-    margin-left: 1em;
+	margin-left: 1em;
 }
+
 td p {
-    margin-top: 0pt;
-    margin-bottom: 2pt;
+	margin-top: 0pt;
+	margin-bottom: 2pt;
 }
 
 div.cdata {
-    white-space: pre;
-    clear:both;
+	white-space: pre;
+	clear: both;
 }
 
 span.tag:before {
-     
+	
 }
+
 span.tag:after {
-     
+	
 }
-span.gi,span.tag {
+
+span.gi, span.tag {
+	
 }
+
 span.att {
-     
+	
 }
+
 span.att:before {
-    content: "@";
+	content: "@";
 }
-span.ident, 
-span.ident-class, span.ident-datatype, span.ident-frag,
-span.ident-ge,    span.ident-macro,    span.ident-module,
-span.ident-pe,    span.ident-rng,      span.ident-schema  {
-    font-weight: bold;
+
+span.ident, span.ident-class, span.ident-datatype, span.ident-frag, span.ident-ge,
+	span.ident-macro, span.ident-module, span.ident-pe, span.ident-rng,
+	span.ident-schema {
+	font-weight: bold;
 }
 
 span.ident-file, span.ident-ns {
-    font-style: italic;
+	font-style: italic;
 }
 
 button.displayRelaxButton {
-    margin-right: 2px;
-    margin-top: 2px;
-    font-size: 70%;
-    float: right;
-    cursor: pointer;
+	margin-right: 2px;
+	margin-top: 2px;
+	font-size: 70%;
+	float: right;
+	cursor: pointer;
 }
+
 pre.RNG_XML {
-	    display: none;
-	    }
+	display: none;
+}
 
 span.RNG_XML {
-	    display: none;
-	    }
+	display: none;
+}
 
 /* pretty printing of XML */
 td.classSpec, td.macroSpec {
-    font-weight: bold;
+	font-weight: bold;
 }
-a.link_odd_element:link,a.link_odd_element:visited {		   
-    /*     color: #006400; */
+
+a.link_odd_element:link, a.link_odd_element:visited {
+	/*     color: #006400; */
+	
 }
-a.link_odd_macro:link,a.link_odd_macro:visited {
 
+a.link_odd_macro:link, a.link_odd_macro:visited {
+	
 }
-a.link_odd_class:link,a.link_odd_class:visited {
 
+a.link_odd_class:link, a.link_odd_class:visited {
+	
 }
+
 span.element {
-    font-weight: bold;
-    color: black;
+	font-weight: bold;
+	color: black;
 }
-td.elementSpec,span.elementname {
-    font-weight: bold;
-    color: #222288;
+
+td.elementSpec, span.elementname {
+	font-weight: bold;
+	color: #222288;
 }
+
 span.highlightelementname {
-    color: red;
+	color: red;
 }
 
 span.attribute {
-    color: #222288;
+	color: #222288;
 }
+
 span.attributevalue {
-    color: black;
+	color: black;
 }
+
 span.comment {
-    color: black;
-    font-style:italic;
+	color: black;
+	font-style: italic;
 }
+
 span.namespace {
-    color: #222288;
+	color: #222288;
 }
 /* pretty print rnc */
 span.rnc_nc {
-    color: #006400;
+	color: #006400;
 }
+
 span.rnc_decl {
-    color: green;
+	color: green;
 }
+
 span.rnc_prefix {
-    color: blue;
+	color: blue;
 }
+
 span.rnc_param {
-    color: gray;
+	color: gray;
 }
+
 span.rnc_atom {
-    color: yellow;
+	color: yellow;
 }
+
 span.rnc_annot {
-    color: #FF8040;
+	color: #FF8040;
 }
+
 span.rnc_comment {
-    color: #FF00FF;
+	color: #FF00FF;
 }
+
 span.rnc_annot {
-    color: #00FFFF;
+	color: #00FFFF;
 }
+
 span.rnc_type {
-    color: purple;
+	color: purple;
 }
+
 span.rnc_keyword {
-    color: teal;
+	color: teal;
 }
+
 span.defaultVal {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.required {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 div.moduleSpec {
-    padding: 1px;
-    margin: 1px;
-    background-color: #C0C0C0;
-    color:inherit;
-    clear:right;
+	padding: 1px;
+	margin: 1px;
+	background-color: #C0C0C0;
+	color: inherit;
+	clear: right;
 }
+
 span.moduleSpecHead {
-    font-style: italic;
+	font-style: italic;
 }
+
 ul.specList li {
-    list-style: none;
+	list-style: none;
 }
+
 span.specList-macroSpec {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.specList-elementSpec {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.specList-elementSpec:before {
-    content: "<";
-     
+	content: "<";
 }
+
 span.specList-elementSpec:after {
-    content: ">";
-     
+	content: ">";
 }
+
 span.specList-classSpec {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 span.specName {
-    color: #223377;
-    font-weight: bold;
+	color: #223377;
+	font-weight: bold;
 }
 /* A -Z Styles From http://www.smileycat.com/miaow/archives/000211.php -styling the a to z */
 #azindex {
-    background-color: #ddd;
-    color:inherit;
-    display: block;
-    margin: 0px;
-    float: left;
-    padding: 5px;
-    width: 75%;
-    border: 1px solid #999;
+	background-color: #ddd;
+	color: inherit;
+	display: block;
+	margin: 0px;
+	float: left;
+	padding: 5px;
+	width: 75%;
+	border: 1px solid #999;
 }
+
 #azindex p {
-    color: #fff;
-    background-color: #000060;
-    padding: 4px;
-    display: block;
-    margin: 0;
-    border-bottom: 1px solid #333;
-    font-size: 0.95em;
+	color: #fff;
+	background-color: #000060;
+	padding: 4px;
+	display: block;
+	margin: 0;
+	border-bottom: 1px solid #333;
+	font-size: 0.95em;
 }
+
 .index {
-    font: bold 100% Verdana, Helvetica, sans-serif;
-    margin: 0;
-    padding: 0;
+	font: bold 100% Verdana, Helvetica, sans-serif;
+	margin: 0;
+	padding: 0;
 }
+
 .index li {
-    float: left;
-    height: 1.5em;
-    list-style-type: none;
-    margin: 0.35em 0.15em;
-    padding: 0;
-    width: 1.5em;
+	float: left;
+	height: 1.5em;
+	list-style-type: none;
+	margin: 0.35em 0.15em;
+	padding: 0;
+	width: 1.5em;
 }
+
 .index a:link, .index a:visited {
-    background: #fff;
-    color: navy;
-    display: block;
-    height: 1.5em;
-    padding: 0.37em 0 0 0;
-    text-align: center;
-    text-decoration: none;
-    width: 1.5em;
-    border: 1px solid #999;
+	background: #fff;
+	color: navy;
+	display: block;
+	height: 1.5em;
+	padding: 0.37em 0 0 0;
+	text-align: center;
+	text-decoration: none;
+	width: 1.5em;
+	border: 1px solid #999;
 }
-li.showall, li.showall a:visited,li.showall a:link {
-    width: 10em;
+
+li.showall, li.showall a:visited, li.showall a:link {
+	width: 10em;
 }
+
 * html .index li {
-    margin: 0.2em 0.2em;
+	margin: 0.2em 0.2em;
 }
+
 ul.index li a:hover {
-    background-color: #93D1E4;
-    color: #fff;
-    text-decoration: underline;
+	background-color: #93D1E4;
+	color: #fff;
+	text-decoration: underline;
 }
+
 div.atozwrapper {
-   float: left;
-   width: 70%;
+	float: left;
+	width: 70%;
 }
-div.atoz {    
-   clear: left;
-   float: left;
-}    
+
+div.atoz {
+	clear: left;
+	float: left;
+}
+
 #byMod {
-   margin-top: 12px;
-   clear: left;
+	margin-top: 12px;
+	clear: left;
 }
+
 ul.atoz {
-    list-style: none;
-    text-align:left;
-    margin: 2px;
-    padding: 2px;
-    background-color: #eef;
-    color:inherit;
+	list-style: none;
+	text-align: left;
+	margin: 2px;
+	padding: 2px;
+	background-color: #eef;
+	color: inherit;
 }
+
 .atoz li {
-    padding: 0px;
-    display: inline;
+	padding: 0px;
+	display: inline;
 }
+
 span.listhead {
-    margin-top: 0em;
-    margin-right: 1em;
-    padding-left: 3px;
-    padding-right: 3px;
-    color: #000066;
-    font-weight: bold;
-    font-size: large;
+	margin-top: 0em;
+	margin-right: 1em;
+	padding-left: 3px;
+	padding-right: 3px;
+	color: #000066;
+	font-weight: bold;
+	font-size: large;
 }
 /* End of A - Z styles */
 div.specChildren {
-    margin: 0em;
-    padding: 0em;
+	margin: 0em;
+	padding: 0em;
 }
+
 span.specChildModule {
-    font-weight: bold;
+	font-weight: bold;
 }
+
 div.specChild {
-    margin-bottom: 4pt;
-    margin-left: 25px;
-    text-indent: -30px;
+	margin-bottom: 4pt;
+	margin-left: 25px;
+	text-indent: -30px;
 }
+
 span.emptySlash:after {
-    content: "/";
+	content: "/";
 }
 /* status notation */
 .status_deprecated:after {
-    content: " (deprecated)";
-    color: red;
+	content: " (deprecated)";
+	color: red;
 }
+
 .status_changed:after {
-    content: " (changed)";
-    color: blue;
+	content: " (changed)";
+	color: blue;
 }
+
 .status_unstable:after {
-    content: " (unstable)";
-    color: orange;
+	content: " (unstable)";
+	color: orange;
 }
+
 .status_deprecated {
-    border: solid red 1pt;
+	border: solid red 1pt;
 }
+
 .status_changed {
-    border: solid blue 1pt;
+	border: solid blue 1pt;
 }
+
 .status_unstable {
-    border: solid orange 1pt;
+	border: solid orange 1pt;
 }
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tbx/teitotbx.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tbx/teitotbx.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tbx/teitotbx.xsl	(revision 2397)
@@ -1,94 +1,103 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
-    exclude-result-prefixes="tei tbx">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-    <desc>
-      <p> TEI stylesheet for simplifying TEI ODD markup </p>
-      <p>This software is dual-licensed:
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
+	exclude-result-prefixes="tei tbx">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet for simplifying TEI ODD markup </p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-      <p>Author: See AUTHORS</p>
-      <p>Id: $Id: teitotbx.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-      <p>Copyright: 2008, TEI Consortium</p>
-    </desc>
-  </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-<xsl:key name="T" match="tbx:termEntry" use="1"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: teitotbx.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
 
-<xsl:output method="xml" indent="yes" encoding="utf-8"/>
+	<xsl:key name="T" match="tbx:termEntry" use="1" />
 
-<xsl:template match="/">
-  <martif type="TBX" xml:lang="en">
-    <martifHeader>
-        <fileDesc>
-            <sourceDesc>
-                <p>from an ISO standard</p>
-            </sourceDesc>
-        </fileDesc>
-        <encodingDesc>
-            <p type="XCSURI">http://www.lisa.org/fileadmin/standards/tbx/TBXXCSV02.XCS</p>
-        </encodingDesc>
-    </martifHeader>
-    <text>
-      <body>
-	<xsl:for-each select="key('T',1)">
-	  <xsl:copy>
-	    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-	  </xsl:copy>
-	</xsl:for-each>
-      </body>
-    </text>
-  </martif>
-</xsl:template>
+	<xsl:output method="xml" indent="yes" encoding="utf-8" />
 
+	<xsl:template match="/">
+		<martif type="TBX" xml:lang="en">
+			<martifHeader>
+				<fileDesc>
+					<sourceDesc>
+						<p>from an ISO standard</p>
+					</sourceDesc>
+				</fileDesc>
+				<encodingDesc>
+					<p type="XCSURI">http://www.lisa.org/fileadmin/standards/tbx/TBXXCSV02.XCS</p>
+				</encodingDesc>
+			</martifHeader>
+			<text>
+				<body>
+					<xsl:for-each select="key('T',1)">
+						<xsl:copy>
+							<xsl:apply-templates
+								select="*|@*|processing-instruction()|comment()|text()" />
+						</xsl:copy>
+					</xsl:for-each>
+				</body>
+			</text>
+		</martif>
+	</xsl:template>
 
-   <xsl:template match="@*|text()|comment()|processing-instruction()">
-      <xsl:copy-of select="."/>
-   </xsl:template>
 
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-   <xsl:template match="*">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-   </xsl:template>
 
-   <xsl:template match="tei:*">
-         <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-   </xsl:template>
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
+	<xsl:template match="tei:*">
+		<xsl:apply-templates
+			select="*|processing-instruction()|comment()|text()" />
+	</xsl:template>
 
+
 </xsl:stylesheet>
 
 
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/core.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/core.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/core.xsl	(revision 2397)
@@ -1,866 +1,1017 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the core module, making
-      LaTeX output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the core module, making
+				LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: core.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element ab</desc>
-   </doc>
-  <xsl:template match="tei:ab">
-      <xsl:apply-templates/>
-      <xsl:if test="following-sibling::tei:ab">\par </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element bibl</desc>
-   </doc>
-  <xsl:template match="tei:bibl" mode="cite">
-      <xsl:apply-templates select="text()[1]"/>
-  </xsl:template>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template match="tei:cit">
-    <xsl:choose>
-      <xsl:when test="@rend='display' or tei:q/tei:p or
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: core.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element ab</desc>
+	</doc>
+	<xsl:template match="tei:ab">
+		<xsl:apply-templates />
+		<xsl:if test="following-sibling::tei:ab">
+			\par
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element bibl</desc>
+	</doc>
+	<xsl:template match="tei:bibl" mode="cite">
+		<xsl:apply-templates select="text()[1]" />
+	</xsl:template>
+
+
+	<xsl:template match="tei:cit">
+		<xsl:choose>
+			<xsl:when
+				test="@rend='display' or tei:q/tei:p or
 		      tei:quote/tei:l or tei:quote/tei:p">
-        <xsl:text>&#10;\begin{quote}&#10;</xsl:text>
-            <xsl:if test="@n">
-              <xsl:text>(</xsl:text>
-              <xsl:value-of select="@n"/>
-              <xsl:text>) </xsl:text>
-            </xsl:if>
-            <xsl:apply-templates select="tei:q|tei:quote"/>
-	    <xsl:text>\par&#10;</xsl:text>
-            <xsl:apply-templates select="tei:bibl"/>
-        <xsl:text>&#10;\end{quote}&#10;</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:value-of select="$preQuote"/>
-	<xsl:if test="@n">
-	  <xsl:text>(</xsl:text>
-	  <xsl:value-of select="@n"/>
-	  <xsl:text>) </xsl:text>
-	</xsl:if>
-	<xsl:apply-templates/>
-	<xsl:value-of select="$postQuote"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+				<xsl:text>&#10;\begin{quote}&#10;</xsl:text>
+				<xsl:if test="@n">
+					<xsl:text>(</xsl:text>
+					<xsl:value-of select="@n" />
+					<xsl:text>) </xsl:text>
+				</xsl:if>
+				<xsl:apply-templates select="tei:q|tei:quote" />
+				<xsl:text>\par&#10;</xsl:text>
+				<xsl:apply-templates select="tei:bibl" />
+				<xsl:text>&#10;\end{quote}&#10;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$preQuote" />
+				<xsl:if test="@n">
+					<xsl:text>(</xsl:text>
+					<xsl:value-of select="@n" />
+					<xsl:text>) </xsl:text>
+				</xsl:if>
+				<xsl:apply-templates />
+				<xsl:value-of select="$postQuote" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element code</desc>
-   </doc>
-  <xsl:template match="tei:code">\texttt{<xsl:apply-templates/>}</xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process &lt;corr&gt;</desc></doc>
-  <xsl:template match="tei:corr">
-      <xsl:apply-templates/>
-      <xsl:choose>
-         <xsl:when test="@sic">
-            <xsl:text>\footnote{</xsl:text>
-                <xsl:call-template name="i18n">
-                <xsl:with-param name="word">appearsintheoriginalas</xsl:with-param>
-                </xsl:call-template>
-                <xsl:text> \emph{</xsl:text>
-                <xsl:value-of select="./@sic"/>
-            <xsl:text>}.}</xsl:text>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process &lt;supplied&gt;</desc></doc>
-  <xsl:template match="tei:supplied">
-      <xsl:text>[</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>]</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@reason">
-            <xsl:text>\footnote{</xsl:text>
-            <xsl:value-of select="./@reason"/>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-            <desc>Process &lt;sic&gt;</desc></doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element code</desc>
+	</doc>
+	<xsl:template match="tei:code">
+		\texttt{
+		<xsl:apply-templates />
+		}
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process &lt;corr&gt;</desc>
+	</doc>
+	<xsl:template match="tei:corr">
+		<xsl:apply-templates />
+		<xsl:choose>
+			<xsl:when test="@sic">
+				<xsl:text>\footnote{</xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						appearsintheoriginalas
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text> \emph{</xsl:text>
+				<xsl:value-of select="./@sic" />
+				<xsl:text>}.}</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process &lt;supplied&gt;</desc>
+	</doc>
+	<xsl:template match="tei:supplied">
+		<xsl:text>[</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>]</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@reason">
+				<xsl:text>\footnote{</xsl:text>
+				<xsl:value-of select="./@reason" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process &lt;sic&gt;</desc>
+	</doc>
 
-  <xsl:template match="tei:sic">
-      <xsl:apply-templates/>
-      <xsl:text> (sic)</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@corr">
-            <xsl:text>\footnote{</xsl:text>
-                <xsl:call-template name="i18n">
-                <xsl:with-param name="word">shouldbereadas</xsl:with-param>
-                </xsl:call-template>
-                <xsl:text> \emph{</xsl:text>
-                <xsl:value-of select="./@corr"/>
-            <xsl:text>}.}</xsl:text>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element eg|tei:q[@rend='eg']</desc>
-   </doc>
-  <xsl:template match="tei:seg[@rend='pre']|tei:eg|tei:q[@rend='eg']">
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:cell and count(*)=1 and string-length(.)&lt;60">
-	           <xsl:variable name="stuff">
-	              <xsl:apply-templates mode="eg"/>
-	           </xsl:variable>
-	           <xsl:text>\fbox{\ttfamily </xsl:text>
-	           <xsl:value-of select="tei:escapeCharsVerbatim($stuff)"/>
-	           <xsl:text>} </xsl:text>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:cell and not(*)  and string-length(.)&lt;60">
-	           <xsl:variable name="stuff">
-	              <xsl:apply-templates mode="eg"/>
-	           </xsl:variable>
-	           <xsl:text>\fbox{\ttfamily </xsl:text>
-	           <xsl:value-of select="tei:escapeCharsVerbatim($stuff)"/>
-	           <xsl:text>} </xsl:text>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:cell or @rend='pre'">
-	           <xsl:text>\mbox{}\hfill\\[-10pt]\begin{Verbatim}[fontsize=\small]
+	<xsl:template match="tei:sic">
+		<xsl:apply-templates />
+		<xsl:text> (sic)</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@corr">
+				<xsl:text>\footnote{</xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						shouldbereadas
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text> \emph{</xsl:text>
+				<xsl:value-of select="./@corr" />
+				<xsl:text>}.}</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element eg|tei:q[@rend='eg']</desc>
+	</doc>
+	<xsl:template
+		match="tei:seg[@rend='pre']|tei:eg|tei:q[@rend='eg']">
+		<xsl:choose>
+			<xsl:when
+				test="ancestor::tei:cell and count(*)=1 and string-length(.)&lt;60">
+				<xsl:variable name="stuff">
+					<xsl:apply-templates mode="eg" />
+				</xsl:variable>
+				<xsl:text>\fbox{\ttfamily </xsl:text>
+				<xsl:value-of select="tei:escapeCharsVerbatim($stuff)" />
+				<xsl:text>} </xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="ancestor::tei:cell and not(*)  and string-length(.)&lt;60">
+				<xsl:variable name="stuff">
+					<xsl:apply-templates mode="eg" />
+				</xsl:variable>
+				<xsl:text>\fbox{\ttfamily </xsl:text>
+				<xsl:value-of select="tei:escapeCharsVerbatim($stuff)" />
+				<xsl:text>} </xsl:text>
+			</xsl:when>
+			<xsl:when test="ancestor::tei:cell or @rend='pre'">
+				<xsl:text>\mbox{}\hfill\\[-10pt]\begin{Verbatim}[fontsize=\small]
 </xsl:text>
-	           <xsl:apply-templates mode="eg"/>
-	           <xsl:text>
+				<xsl:apply-templates mode="eg" />
+				<xsl:text>
 \end{Verbatim}
 </xsl:text>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:list[@type='gloss']">
-	           <xsl:text>\hspace{1em}\hfill\linebreak</xsl:text>
-	           <xsl:text>\bgroup</xsl:text>
-	           <xsl:call-template name="exampleFontSet"/>
-	           <xsl:text>\vskip 10pt\begin{shaded}
+			</xsl:when>
+			<xsl:when test="ancestor::tei:list[@type='gloss']">
+				<xsl:text>\hspace{1em}\hfill\linebreak</xsl:text>
+				<xsl:text>\bgroup</xsl:text>
+				<xsl:call-template name="exampleFontSet" />
+				<xsl:text>\vskip 10pt\begin{shaded}
 \noindent\obeylines\obeyspaces </xsl:text>
-	           <xsl:apply-templates mode="eg"/>
-	           <xsl:text>\end{shaded}
+				<xsl:apply-templates mode="eg" />
+				<xsl:text>\end{shaded}
 \egroup 
 
 </xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-	           <xsl:text>\par\bgroup</xsl:text>
-	           <xsl:call-template name="exampleFontSet"/>
-	           <xsl:text>\vskip 10pt\begin{shaded}
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\par\bgroup</xsl:text>
+				<xsl:call-template name="exampleFontSet" />
+				<xsl:text>\vskip 10pt\begin{shaded}
 \obeylines\obeyspaces </xsl:text>
-	           <xsl:apply-templates mode="eg"/>
-	           <xsl:text>\end{shaded}
+				<xsl:apply-templates mode="eg" />
+				<xsl:text>\end{shaded}
 \par\egroup 
 
 </xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-      <!--
-    <xsl:choose>
-      <xsl:when test="@n">
-	<xsl:text>&#10;\begin{Verbatim}[fontsize=\scriptsize,numbers=left,label={</xsl:text>
-	<xsl:value-of select="@n"/>
-      <xsl:text>}]&#10;</xsl:text>
-      <xsl:apply-templates mode="eg"/> 
-      <xsl:text>&#10;\end{Verbatim}&#10;</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:text>&#10;\begin{Verbatim}[fontsize=\scriptsize,frame=single]&#10;</xsl:text>
-	<xsl:apply-templates mode="eg"/>
-	<xsl:text>&#10;\end{Verbatim}&#10;</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
--->
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element emph</desc>
-   </doc>
-  <xsl:template match="tei:emph">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element foreign</desc>
-   </doc>
-  <xsl:template match="tei:foreign">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element head</desc>
-   </doc>
-  <xsl:template match="tei:head">
-      <xsl:choose>
-         <xsl:when test="parent::tei:castList"/>
-         <xsl:when test="parent::tei:figure"/>
-         <xsl:when test="parent::tei:list"/>
-         <xsl:when test="parent::tei:lg"> \subsection*{<xsl:apply-templates/>} </xsl:when>
-         <xsl:when test="parent::tei:table"/>
-         <xsl:otherwise>
-            <xsl:variable name="depth">
-               <xsl:apply-templates mode="depth" select=".."/>
-            </xsl:variable>
-            <xsl:text>&#10;\Div</xsl:text>
-            <xsl:choose>
-               <xsl:when test="$depth=0">I</xsl:when>
-               <xsl:when test="$depth=1">II</xsl:when>
-               <xsl:when test="$depth=2">III</xsl:when>
-               <xsl:when test="$depth=3">IV</xsl:when>
-               <xsl:when test="$depth=4">V</xsl:when>
-	       <xsl:otherwise>I</xsl:otherwise>
-            </xsl:choose>
-            <xsl:choose>
-               <xsl:when test="ancestor::tei:floatingText">Star</xsl:when>
-               <xsl:when test="parent::tei:div/@rend='nonumber'">Star</xsl:when>
-               <xsl:when test="ancestor::tei:back and not($numberBackHeadings='true')">Star</xsl:when>
-	       <xsl:when test="not($numberHeadings='true') and ancestor::tei:body">Star</xsl:when>
-               <xsl:when test="ancestor::tei:front and not($numberFrontHeadings='true')">Star</xsl:when>
-            </xsl:choose>
-	    <xsl:text>[</xsl:text>
-	    <xsl:value-of select="normalize-space(.)"/>
-	    <xsl:text>]</xsl:text>
-	    <xsl:text>{</xsl:text>
-	    <xsl:apply-templates/>
-	    <xsl:text>}</xsl:text>
-	    <xsl:if test="../@xml:id">
-	      <xsl:text>\label{</xsl:text>
-	      <xsl:value-of select="../@xml:id"/>
-	      <xsl:text>}</xsl:text>
-	    </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+			</xsl:otherwise>
+		</xsl:choose>
+		<!-- <xsl:choose> <xsl:when test="@n"> <xsl:text>&#10;\begin{Verbatim}[fontsize=\scriptsize,numbers=left,label={</xsl:text> 
+			<xsl:value-of select="@n"/> <xsl:text>}]&#10;</xsl:text> <xsl:apply-templates 
+			mode="eg"/> <xsl:text>&#10;\end{Verbatim}&#10;</xsl:text> </xsl:when> <xsl:otherwise> 
+			<xsl:text>&#10;\begin{Verbatim}[fontsize=\scriptsize,frame=single]&#10;</xsl:text> 
+			<xsl:apply-templates mode="eg"/> <xsl:text>&#10;\end{Verbatim}&#10;</xsl:text> 
+			</xsl:otherwise> </xsl:choose> -->
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element emph</desc>
+	</doc>
+	<xsl:template match="tei:emph">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element foreign</desc>
+	</doc>
+	<xsl:template match="tei:foreign">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element head</desc>
+	</doc>
+	<xsl:template match="tei:head">
+		<xsl:choose>
+			<xsl:when test="parent::tei:castList" />
+			<xsl:when test="parent::tei:figure" />
+			<xsl:when test="parent::tei:list" />
+			<xsl:when test="parent::tei:lg">
+				\subsection*{
+				<xsl:apply-templates />
+				}
+			</xsl:when>
+			<xsl:when test="parent::tei:table" />
+			<xsl:otherwise>
+				<xsl:variable name="depth">
+					<xsl:apply-templates mode="depth" select=".." />
+				</xsl:variable>
+				<xsl:text>&#10;\Div</xsl:text>
+				<xsl:choose>
+					<xsl:when test="$depth=0">
+						I
+					</xsl:when>
+					<xsl:when test="$depth=1">
+						II
+					</xsl:when>
+					<xsl:when test="$depth=2">
+						III
+					</xsl:when>
+					<xsl:when test="$depth=3">
+						IV
+					</xsl:when>
+					<xsl:when test="$depth=4">
+						V
+					</xsl:when>
+					<xsl:otherwise>
+						I
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:choose>
+					<xsl:when test="ancestor::tei:floatingText">
+						Star
+					</xsl:when>
+					<xsl:when test="parent::tei:div/@rend='nonumber'">
+						Star
+					</xsl:when>
+					<xsl:when
+						test="ancestor::tei:back and not($numberBackHeadings='true')">
+						Star
+					</xsl:when>
+					<xsl:when
+						test="not($numberHeadings='true') and ancestor::tei:body">
+						Star
+					</xsl:when>
+					<xsl:when
+						test="ancestor::tei:front and not($numberFrontHeadings='true')">
+						Star
+					</xsl:when>
+				</xsl:choose>
+				<xsl:text>[</xsl:text>
+				<xsl:value-of select="normalize-space(.)" />
+				<xsl:text>]</xsl:text>
+				<xsl:text>{</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+				<xsl:if test="../@xml:id">
+					<xsl:text>\label{</xsl:text>
+					<xsl:value-of select="../@xml:id" />
+					<xsl:text>}</xsl:text>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element head in heading mode</desc>
-   </doc>
-  <xsl:template match="tei:head" mode="makeheading">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element head in heading mode</desc>
+	</doc>
+	<xsl:template match="tei:head" mode="makeheading">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-            <desc>Process &lt;gloss&gt;</desc></doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process &lt;gloss&gt;</desc>
+	</doc>
 
-  <xsl:template match="tei:gloss">
-      <xsl:text> \textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element hi</desc>
-   </doc>
-  <xsl:template match="tei:hi">
-      <xsl:call-template name="rendering"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Rendering rules, turning @rend into LaTeX commands</desc>
-   </doc>
-  <xsl:template name="rendering">
-      <xsl:variable name="cmd">
-         <xsl:choose>
-            <xsl:when test="not(@rend)">\textbf</xsl:when>
-            <xsl:when test="starts-with(@rend,'color')">\textcolor</xsl:when>
-            <xsl:when test="@rend='bold'">\textbf</xsl:when>
-            <xsl:when test="@rend='calligraphic'">\textcal</xsl:when>
-            <xsl:when test="@rend='capsall'">\uppercase</xsl:when>
-            <xsl:when test="@rend='center'">\centerline</xsl:when>
-            <xsl:when test="@rend='code'">\texttt</xsl:when>
-            <xsl:when test="@rend='expanded'">\textsc</xsl:when>
-            <xsl:when test="@rend='gothic'">\textgothic</xsl:when>
-            <xsl:when test="@rend='i'">\textit</xsl:when>
-            <xsl:when test="@rend='important'">\textbf</xsl:when>
-            <xsl:when test="@rend='it'">\textit</xsl:when>
-            <xsl:when test="@rend='ital'">\textit</xsl:when>
-            <xsl:when test="@rend='italic'">\textit</xsl:when>
-            <xsl:when test="@rend='italics'">\textit</xsl:when>
-            <xsl:when test="@rend='large'">\textlarge</xsl:when>
-            <xsl:when test="@rend='larger'">\textlarger</xsl:when>
-            <xsl:when test="@rend='noindex'">\textrm</xsl:when>
-            <xsl:when test="@rend='overbar'">\textoverbar</xsl:when>
-            <xsl:when test="@rend='plain'">\textrm</xsl:when>
-            <xsl:when test="@rend='quoted'">\textquoted</xsl:when>
-            <xsl:when test="@rend='sc'">\textsc</xsl:when>
-            <xsl:when test="@rend='small'">\textsmall</xsl:when>
-            <xsl:when test="@rend='smallcaps'">\textsc</xsl:when>
-            <xsl:when test="@rend='smaller'">\textsmaller</xsl:when>
-            <xsl:when test="@rend='strikethrough'">\sout</xsl:when>
-            <xsl:when test="@rend='sub'">\textsubscript</xsl:when>
-            <xsl:when test="@rend='subscript'">\textsubscript</xsl:when>
-            <xsl:when test="@rend='sup'">\textsuperscript</xsl:when>
-            <xsl:when test="@rend='superscript'">\textsuperscript</xsl:when>
-            <xsl:when test="@rend='typewriter'">\texttt</xsl:when>
-            <xsl:when test="@rend='ul'">\uline</xsl:when>
-            <xsl:when test="@rend='underwavyline'">\uwave</xsl:when>
-            <xsl:when test="@rend='underdoubleline'">\uuline</xsl:when>
-            <xsl:when test="@rend='underline'">\uline</xsl:when>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:value-of select="$cmd"/>
-      <xsl:choose>
-	<xsl:when test="starts-with(@rend,'color(')">
-	        <xsl:text>{</xsl:text>
-	        <xsl:value-of select="substring-before(substring-after(@rend,'color('),')')"/>
-	        <xsl:text>}</xsl:text>
-	</xsl:when>
-	<xsl:when test="starts-with(@rend,'color')">
-	        <xsl:text>{</xsl:text>
-	        <xsl:value-of select="substring-after(@rend,'color')"/>
-	        <xsl:text>}</xsl:text>
-	</xsl:when>
-      </xsl:choose>
-      <xsl:text>{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element hr</desc>
-   </doc>
-  <xsl:template match="tei:hr"> \hline </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element ident</desc>
-   </doc>
-  <xsl:template match="tei:ident">
-      <xsl:text>\textsf{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
+	<xsl:template match="tei:gloss">
+		<xsl:text> \textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element hi</desc>
+	</doc>
+	<xsl:template match="tei:hi">
+		<xsl:call-template name="rendering" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Rendering rules, turning @rend into LaTeX commands</desc>
+	</doc>
+	<xsl:template name="rendering">
+		<xsl:variable name="cmd">
+			<xsl:choose>
+				<xsl:when test="not(@rend)">
+					\textbf
+				</xsl:when>
+				<xsl:when test="starts-with(@rend,'color')">
+					\textcolor
+				</xsl:when>
+				<xsl:when test="@rend='bold'">
+					\textbf
+				</xsl:when>
+				<xsl:when test="@rend='calligraphic'">
+					\textcal
+				</xsl:when>
+				<xsl:when test="@rend='capsall'">
+					\uppercase
+				</xsl:when>
+				<xsl:when test="@rend='center'">
+					\centerline
+				</xsl:when>
+				<xsl:when test="@rend='code'">
+					\texttt
+				</xsl:when>
+				<xsl:when test="@rend='expanded'">
+					\textsc
+				</xsl:when>
+				<xsl:when test="@rend='gothic'">
+					\textgothic
+				</xsl:when>
+				<xsl:when test="@rend='i'">
+					\textit
+				</xsl:when>
+				<xsl:when test="@rend='important'">
+					\textbf
+				</xsl:when>
+				<xsl:when test="@rend='it'">
+					\textit
+				</xsl:when>
+				<xsl:when test="@rend='ital'">
+					\textit
+				</xsl:when>
+				<xsl:when test="@rend='italic'">
+					\textit
+				</xsl:when>
+				<xsl:when test="@rend='italics'">
+					\textit
+				</xsl:when>
+				<xsl:when test="@rend='large'">
+					\textlarge
+				</xsl:when>
+				<xsl:when test="@rend='larger'">
+					\textlarger
+				</xsl:when>
+				<xsl:when test="@rend='noindex'">
+					\textrm
+				</xsl:when>
+				<xsl:when test="@rend='overbar'">
+					\textoverbar
+				</xsl:when>
+				<xsl:when test="@rend='plain'">
+					\textrm
+				</xsl:when>
+				<xsl:when test="@rend='quoted'">
+					\textquoted
+				</xsl:when>
+				<xsl:when test="@rend='sc'">
+					\textsc
+				</xsl:when>
+				<xsl:when test="@rend='small'">
+					\textsmall
+				</xsl:when>
+				<xsl:when test="@rend='smallcaps'">
+					\textsc
+				</xsl:when>
+				<xsl:when test="@rend='smaller'">
+					\textsmaller
+				</xsl:when>
+				<xsl:when test="@rend='strikethrough'">
+					\sout
+				</xsl:when>
+				<xsl:when test="@rend='sub'">
+					\textsubscript
+				</xsl:when>
+				<xsl:when test="@rend='subscript'">
+					\textsubscript
+				</xsl:when>
+				<xsl:when test="@rend='sup'">
+					\textsuperscript
+				</xsl:when>
+				<xsl:when test="@rend='superscript'">
+					\textsuperscript
+				</xsl:when>
+				<xsl:when test="@rend='typewriter'">
+					\texttt
+				</xsl:when>
+				<xsl:when test="@rend='ul'">
+					\uline
+				</xsl:when>
+				<xsl:when test="@rend='underwavyline'">
+					\uwave
+				</xsl:when>
+				<xsl:when test="@rend='underdoubleline'">
+					\uuline
+				</xsl:when>
+				<xsl:when test="@rend='underline'">
+					\uline
+				</xsl:when>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:value-of select="$cmd" />
+		<xsl:choose>
+			<xsl:when test="starts-with(@rend,'color(')">
+				<xsl:text>{</xsl:text>
+				<xsl:value-of
+					select="substring-before(substring-after(@rend,'color('),')')" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="starts-with(@rend,'color')">
+				<xsl:text>{</xsl:text>
+				<xsl:value-of select="substring-after(@rend,'color')" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element hr</desc>
+	</doc>
+	<xsl:template match="tei:hr">
+		\hline
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element ident</desc>
+	</doc>
+	<xsl:template match="tei:ident">
+		<xsl:text>\textsf{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element item</desc>
-   </doc>
-  <xsl:template match="tei:item"> 
-      <xsl:text>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item</desc>
+	</doc>
+	<xsl:template match="tei:item">
+		<xsl:text>
 \item</xsl:text>
-      <xsl:if test="@n">[<xsl:value-of select="@n"/>]</xsl:if>
-      <xsl:text> </xsl:text>
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element item</desc>
-   </doc>
-  <xsl:template match="tei:item" mode="gloss"> 
-      <xsl:text>
+		<xsl:if test="@n">
+			[
+			<xsl:value-of select="@n" />
+			]
+		</xsl:if>
+		<xsl:text> </xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element item</desc>
+	</doc>
+	<xsl:template match="tei:item" mode="gloss">
+		<xsl:text>
 \item[</xsl:text>
-      <xsl:apply-templates select="preceding-sibling::tei:label[1]" mode="gloss"/>
-      <xsl:text>]</xsl:text>
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element label in normal mode</desc>
-   </doc>
-  <xsl:template match="tei:label"/>
+		<xsl:apply-templates
+			select="preceding-sibling::tei:label[1]" mode="gloss" />
+		<xsl:text>]</xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element label in normal mode</desc>
+	</doc>
+	<xsl:template match="tei:label" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element label in normal mode, inside an item</desc>
-   </doc>
-  <xsl:template match="tei:item/tei:label">
-      <xsl:text>\textbf{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element label in normal mode, inside an item</desc>
+	</doc>
+	<xsl:template match="tei:item/tei:label">
+		<xsl:text>\textbf{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element label in gloss mode</desc>
-   </doc>
-  <xsl:template match="tei:label" mode="gloss">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element lb</desc>
-   </doc>
-  <xsl:template match="tei:lb">
-      <xsl:text>{\hskip1pt}\newline </xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element list</desc>
-   </doc>
-  <xsl:template match="tei:list">
-      <xsl:if test="tei:head"> 
-	<xsl:text>\leftline{\textbf{</xsl:text>
-	<xsl:for-each select="tei:head">
-            <xsl:apply-templates/>
-         </xsl:for-each>
-	 <xsl:text>}} </xsl:text>
-      </xsl:if>
-      <xsl:if test="@xml:id">
-	        <xsl:text>\label{</xsl:text>
-	        <xsl:value-of select="@xml:id"/>
-	        <xsl:text>}</xsl:text>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="not(tei:item)"/>
-         <xsl:when test="@type='gloss' or tei:label"> 
-	   <xsl:text>\begin{description}&#10;</xsl:text>
-	   <xsl:apply-templates mode="gloss" select="tei:item"/>
-	   <xsl:text>&#10;\end{description} </xsl:text>
-	 </xsl:when>
-         <xsl:when test="@type='unordered'">
-	   <xsl:text>\begin{itemize}&#10;</xsl:text>
-	   <xsl:apply-templates/>
-	   <xsl:text>&#10;\end{itemize} </xsl:text>
-	 </xsl:when>
-         <xsl:when test="@type='ordered'">
-	   <xsl:text>\begin{enumerate}&#10;</xsl:text>
-	   <xsl:apply-templates/>
-	   <xsl:text>&#10;\end{enumerate}</xsl:text>
-	 </xsl:when>
-         <xsl:when test="@type='runin' or @rend='runon'">
-            <xsl:apply-templates mode="runin" select="tei:item"/>
-         </xsl:when>
-         <xsl:otherwise> 
-	   <xsl:text>\begin{itemize}&#10;</xsl:text>
-	   <xsl:apply-templates/> 
-	   <xsl:text>&#10;\end{itemize} </xsl:text>
-      </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element label in gloss mode</desc>
+	</doc>
+	<xsl:template match="tei:label" mode="gloss">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element lb</desc>
+	</doc>
+	<xsl:template match="tei:lb">
+		<xsl:text>{\hskip1pt}\newline </xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element list</desc>
+	</doc>
+	<xsl:template match="tei:list">
+		<xsl:if test="tei:head">
+			<xsl:text>\leftline{\textbf{</xsl:text>
+			<xsl:for-each select="tei:head">
+				<xsl:apply-templates />
+			</xsl:for-each>
+			<xsl:text>}} </xsl:text>
+		</xsl:if>
+		<xsl:if test="@xml:id">
+			<xsl:text>\label{</xsl:text>
+			<xsl:value-of select="@xml:id" />
+			<xsl:text>}</xsl:text>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="not(tei:item)" />
+			<xsl:when test="@type='gloss' or tei:label">
+				<xsl:text>\begin{description}&#10;</xsl:text>
+				<xsl:apply-templates mode="gloss"
+					select="tei:item" />
+				<xsl:text>&#10;\end{description} </xsl:text>
+			</xsl:when>
+			<xsl:when test="@type='unordered'">
+				<xsl:text>\begin{itemize}&#10;</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>&#10;\end{itemize} </xsl:text>
+			</xsl:when>
+			<xsl:when test="@type='ordered'">
+				<xsl:text>\begin{enumerate}&#10;</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>&#10;\end{enumerate}</xsl:text>
+			</xsl:when>
+			<xsl:when test="@type='runin' or @rend='runon'">
+				<xsl:apply-templates mode="runin"
+					select="tei:item" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\begin{itemize}&#10;</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>&#10;\end{itemize} </xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element listBibl</desc>
-   </doc>
-   <xsl:template match="tei:listBibl">
-     <xsl:choose>
-       <xsl:when test="tei:biblStruct">
-	 <xsl:text>\begin{bibitemlist}{1}&#10;</xsl:text>
-	 <xsl:for-each select="tei:biblStruct">
-	   <xsl:sort select="lower-case(string(tei:*[1]/tei:author/tei:surname or  tei:*[1]/tei:author/tei:orgName or  tei:*[1]/tei:author/tei:name or  tei:*[1]/tei:editor/tei:surname or  tei:*[1]/tei:editor/tei:name or  tei:*[1]/tei:title))"/>
-	   <xsl:sort select="tei:monogr/tei:imprint/tei:date"/>
-	   <xsl:text>\bibitem[</xsl:text>
-	   <xsl:apply-templates select="." mode="xref"/>
-	   <xsl:text>]{</xsl:text>
-	   <xsl:value-of select="@xml:id"/>
-	   <xsl:text>}\hypertarget{</xsl:text>
-	   <xsl:value-of select="@xml:id"/>
-	   <xsl:text>}{}</xsl:text>
-	   <xsl:apply-templates select="."/>
-	 </xsl:for-each>
-	 <xsl:text>&#10;\end{bibitemlist}&#10;</xsl:text>
-       </xsl:when>
-       <xsl:otherwise>
-	 <xsl:text>\begin{bibitemlist}{1}&#10;</xsl:text>
-	 <xsl:apply-templates/> 
-	 <xsl:text>&#10;\end{bibitemlist}&#10;</xsl:text>
-       </xsl:otherwise>
-     </xsl:choose>
-   </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element listBibl</desc>
+	</doc>
+	<xsl:template match="tei:listBibl">
+		<xsl:choose>
+			<xsl:when test="tei:biblStruct">
+				<xsl:text>\begin{bibitemlist}{1}&#10;</xsl:text>
+				<xsl:for-each select="tei:biblStruct">
+					<xsl:sort
+						select="lower-case(string(tei:*[1]/tei:author/tei:surname or  tei:*[1]/tei:author/tei:orgName or  tei:*[1]/tei:author/tei:name or  tei:*[1]/tei:editor/tei:surname or  tei:*[1]/tei:editor/tei:name or  tei:*[1]/tei:title))" />
+					<xsl:sort select="tei:monogr/tei:imprint/tei:date" />
+					<xsl:text>\bibitem[</xsl:text>
+					<xsl:apply-templates select="." mode="xref" />
+					<xsl:text>]{</xsl:text>
+					<xsl:value-of select="@xml:id" />
+					<xsl:text>}\hypertarget{</xsl:text>
+					<xsl:value-of select="@xml:id" />
+					<xsl:text>}{}</xsl:text>
+					<xsl:apply-templates select="." />
+				</xsl:for-each>
+				<xsl:text>&#10;\end{bibitemlist}&#10;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\begin{bibitemlist}{1}&#10;</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>&#10;\end{bibitemlist}&#10;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element tei:bibl</desc>
-   </doc>
-   <xsl:template match="tei:bibl">
-     <xsl:choose>
-       <xsl:when test="parent::tei:div|tei:listBibl">
-	 <xsl:text>\par \bgroup\itshape&#10;</xsl:text>
-	 <xsl:apply-templates/> 
-	 <xsl:text>\egroup\vskip6pt\par&#10;</xsl:text>
-       </xsl:when>
-       <xsl:when test="parent::tei:cit">
-	 <xsl:apply-templates/>
-       </xsl:when>
-       <xsl:otherwise>
-	 <xsl:text>\bgroup\itshape </xsl:text>
-	 <xsl:apply-templates/>
-	 <xsl:text>\egroup </xsl:text>
-       </xsl:otherwise>
-     </xsl:choose>
-   </xsl:template>
-   
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element listBibl/tei:bibl</desc>
-   </doc>
-  <xsl:template match="tei:listBibl/tei:bibl"> \bibitem {<xsl:choose>
-         <xsl:when test="@xml:id">
-	           <xsl:value-of select="@xml:id"/>
-         </xsl:when>
-         <xsl:otherwise>bibitem-<xsl:number level="any"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>}</xsl:text>
-      <xsl:choose>
-         <xsl:when test="parent::tei:listBibl/@xml:lang='zh-TW' or @xml:lang='zh-TW'">
-	           <xsl:text>{\textChinese </xsl:text>
-	           <xsl:apply-templates/>
-	           <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:when test="parent::tei:listBibl/@xml:lang='ja' or @xml:lang='ja'">
-	           <xsl:text>{\textJapanese </xsl:text>
-	           <xsl:apply-templates/>
-	           <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>&#10;</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element mentioned</desc>
-   </doc>
-  <xsl:template match="tei:mentioned">
-      <xsl:text>\emph{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element note</desc>
-   </doc>
-  <xsl:template match="tei:note">
-    <xsl:if test="@xml:id">
-      <xsl:text>\hypertarget{</xsl:text>
-      <xsl:value-of select="@xml:id"/>
-      <xsl:text>}{}</xsl:text>
-    </xsl:if>
-    <xsl:choose>
-	<xsl:when test="@place='inline' or ancestor::tei:bibl or ancestor::tei:biblStruct"> 
-	  <xsl:text>(</xsl:text>
-	  <xsl:apply-templates/>
-	  <xsl:text>) </xsl:text>
-	</xsl:when>
-	<xsl:when test="@place='end'">
-	  <xsl:text>\endnote{</xsl:text>
-	  <xsl:if test="@xml:id">
-	    <xsl:text>\label{</xsl:text>
-	    <xsl:value-of select="@xml:id"/>
-	    <xsl:text>}</xsl:text>
-	  </xsl:if>
-	  <xsl:apply-templates/>
-	  <xsl:text>}</xsl:text>
-	</xsl:when>
-	<xsl:when test="@target">
-	  <xsl:text>\footnotetext{</xsl:text>
-	  <xsl:apply-templates/>
-	  <xsl:text>}</xsl:text>
-	</xsl:when>
-	<xsl:when test="count(key('APP',1))&gt;0">
-	  <xsl:text>\footnote{</xsl:text>
-	  <xsl:apply-templates/>
-	  <xsl:text>}</xsl:text>
-	</xsl:when>
-      <xsl:otherwise>
-	  <xsl:text>\footnote{</xsl:text>
-	  <xsl:if test="@xml:id">
-	    <xsl:text>\label{</xsl:text>
-	    <xsl:value-of select="@xml:id"/>
-	    <xsl:text>}</xsl:text>
-	  </xsl:if>
-	  <xsl:apply-templates/>
-	  <xsl:text>}</xsl:text>
-	</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element tei:bibl</desc>
+	</doc>
+	<xsl:template match="tei:bibl">
+		<xsl:choose>
+			<xsl:when test="parent::tei:div|tei:listBibl">
+				<xsl:text>\par \bgroup\itshape&#10;</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>\egroup\vskip6pt\par&#10;</xsl:text>
+			</xsl:when>
+			<xsl:when test="parent::tei:cit">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\bgroup\itshape </xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>\egroup </xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Process element &lt;p&gt;</desc>
-   </doc>
-  <xsl:template match="tei:p">
-    <xsl:choose>
-      <xsl:when test="parent::tei:note and not(preceding-sibling::tei:p)">
-      </xsl:when>
-      <xsl:when test="count(key('APP',1))&gt;0">
-	<xsl:text>\pstart&#10;</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:text>\par&#10;</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:if test="$numberParagraphs='true'">
-      <xsl:call-template name="numberParagraph"/>
-    </xsl:if>
-    <xsl:apply-templates/>
-    <xsl:if test="count(key('APP',1))&gt;0">
-	<xsl:text>&#10;\pend&#10;</xsl:text>
-    </xsl:if>
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>How to number a paragraph</desc>
-   </doc>
-  <xsl:template name="numberParagraph">
-      <xsl:text>\textit{\footnotesize[</xsl:text>
-      <xsl:number/>
-      <xsl:text>]} </xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element listBibl/tei:bibl</desc>
+	</doc>
+	<xsl:template match="tei:listBibl/tei:bibl">
+		\bibitem {
+		<xsl:choose>
+			<xsl:when test="@xml:id">
+				<xsl:value-of select="@xml:id" />
+			</xsl:when>
+			<xsl:otherwise>
+				bibitem-
+				<xsl:number level="any" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>}</xsl:text>
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:listBibl/@xml:lang='zh-TW' or @xml:lang='zh-TW'">
+				<xsl:text>{\textChinese </xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="parent::tei:listBibl/@xml:lang='ja' or @xml:lang='ja'">
+				<xsl:text>{\textJapanese </xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element mentioned</desc>
+	</doc>
+	<xsl:template match="tei:mentioned">
+		<xsl:text>\emph{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element note</desc>
+	</doc>
+	<xsl:template match="tei:note">
+		<xsl:if test="@xml:id">
+			<xsl:text>\hypertarget{</xsl:text>
+			<xsl:value-of select="@xml:id" />
+			<xsl:text>}{}</xsl:text>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when
+				test="@place='inline' or ancestor::tei:bibl or ancestor::tei:biblStruct">
+				<xsl:text>(</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>) </xsl:text>
+			</xsl:when>
+			<xsl:when test="@place='end'">
+				<xsl:text>\endnote{</xsl:text>
+				<xsl:if test="@xml:id">
+					<xsl:text>\label{</xsl:text>
+					<xsl:value-of select="@xml:id" />
+					<xsl:text>}</xsl:text>
+				</xsl:if>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="@target">
+				<xsl:text>\footnotetext{</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="count(key('APP',1))&gt;0">
+				<xsl:text>\footnote{</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\footnote{</xsl:text>
+				<xsl:if test="@xml:id">
+					<xsl:text>\label{</xsl:text>
+					<xsl:value-of select="@xml:id" />
+					<xsl:text>}</xsl:text>
+				</xsl:if>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process element pb</p>
-         <p>Indication of a page break. We make it an anchor if it has an
-    ID.</p>
-      </desc>
-   </doc>
-  
-   <xsl:template match="tei:pb">
-   <!-- string " Page " is now managed through the i18n file -->
-    <xsl:choose>
-         <xsl:when test="$pagebreakStyle='active'">
-            <xsl:text>\clearpage </xsl:text>
-         </xsl:when>
-         <xsl:when test="$pagebreakStyle='visible'">
-            <xsl:text>✁[</xsl:text>
-            <xsl:value-of select="@unit"/>
-            <xsl:text> </xsl:text>
-            <xsl:call-template name="i18n">
-               <xsl:with-param name="word">page</xsl:with-param>
-            </xsl:call-template>
-            <xsl:text> </xsl:text>
-            <xsl:value-of select="@n"/>
-            <xsl:text>]✁</xsl:text>
-         </xsl:when>
-         <xsl:when test="$pagebreakStyle='bracketsonly'"> <!-- To avoid trouble with the scisssors character "✁" -->
-        <xsl:text>[</xsl:text>
-            <xsl:value-of select="@unit"/>
-            <xsl:text> </xsl:text>
-            <xsl:call-template name="i18n">
-               <xsl:with-param name="word">page</xsl:with-param>
-            </xsl:call-template>
-            <xsl:text> </xsl:text>
-            <xsl:value-of select="@n"/>
-            <xsl:text>]</xsl:text>
-         </xsl:when>
-         <xsl:otherwise> </xsl:otherwise>
-      </xsl:choose>
-      <xsl:if test="@xml:id">
-         <xsl:text>\hypertarget{</xsl:text>
-         <xsl:value-of select="@xml:id"/>
-         <xsl:text>}{}</xsl:text>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elementq</desc>
-   </doc>
-  <xsl:template match="tei:q">
-      <xsl:choose>
-         <xsl:when test="tei:p"> \begin{quote}<xsl:apply-templates/> \end{quote} </xsl:when>
-         <xsl:when test="tei:text">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="tei:lg"> \begin{quote}<xsl:apply-templates/> \end{quote} </xsl:when>
-         <xsl:otherwise>
-	   <xsl:call-template name="makeQuote"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element &lt;p&gt;</desc>
+	</doc>
+	<xsl:template match="tei:p">
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:note and not(preceding-sibling::tei:p)">
+			</xsl:when>
+			<xsl:when test="count(key('APP',1))&gt;0">
+				<xsl:text>\pstart&#10;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\par&#10;</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if test="$numberParagraphs='true'">
+			<xsl:call-template name="numberParagraph" />
+		</xsl:if>
+		<xsl:apply-templates />
+		<xsl:if test="count(key('APP',1))&gt;0">
+			<xsl:text>&#10;\pend&#10;</xsl:text>
+		</xsl:if>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element quote</desc>
-   </doc>
-  <xsl:template match="tei:quote">
-      <xsl:choose>
-	<xsl:when test="parent::tei:cit">
-	  <xsl:apply-templates/>
-	</xsl:when>
-	<xsl:when test="@rend='inline'">
-	  <xsl:value-of select="$preQuote"/>
-	  <xsl:apply-templates/>
-	  <xsl:value-of select="$postQuote"/>
-	</xsl:when>
-	<xsl:when test="@rend='display' or tei:p or tei:l or string-length(.)&gt;150">
-	  <xsl:text>\begin{quote}</xsl:text>
-	  <xsl:apply-templates/>
-	  <xsl:text>\end{quote}</xsl:text>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:value-of select="$preQuote"/>
-	  <xsl:apply-templates/>
-	  <xsl:value-of select="$postQuote"/>
-	</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>How to number a paragraph</desc>
+	</doc>
+	<xsl:template name="numberParagraph">
+		<xsl:text>\textit{\footnotesize[</xsl:text>
+		<xsl:number />
+		<xsl:text>]} </xsl:text>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element pb</p>
+			<p>Indication of a page break. We make it an anchor if it has an
+				ID.</p>
+		</desc>
+	</doc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element p with @rend='display'</desc>
-   </doc>
-  <xsl:template match="tei:p[@rend='display']"> \begin{quote}
-      <xsl:text>&#10;\begin{quote}&#10;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>\end{quote}&#10;</xsl:text>
-  </xsl:template>
+	<xsl:template match="tei:pb">
+		<!-- string " Page " is now managed through the i18n file -->
+		<xsl:choose>
+			<xsl:when test="$pagebreakStyle='active'">
+				<xsl:text>\clearpage </xsl:text>
+			</xsl:when>
+			<xsl:when test="$pagebreakStyle='visible'">
+				<xsl:text>✁[</xsl:text>
+				<xsl:value-of select="@unit" />
+				<xsl:text> </xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						page
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text> </xsl:text>
+				<xsl:value-of select="@n" />
+				<xsl:text>]✁</xsl:text>
+			</xsl:when>
+			<xsl:when test="$pagebreakStyle='bracketsonly'"> <!-- To avoid trouble with the scisssors character "✁" -->
+				<xsl:text>[</xsl:text>
+				<xsl:value-of select="@unit" />
+				<xsl:text> </xsl:text>
+				<xsl:call-template name="i18n">
+					<xsl:with-param name="word">
+						page
+					</xsl:with-param>
+				</xsl:call-template>
+				<xsl:text> </xsl:text>
+				<xsl:value-of select="@n" />
+				<xsl:text>]</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if test="@xml:id">
+			<xsl:text>\hypertarget{</xsl:text>
+			<xsl:value-of select="@xml:id" />
+			<xsl:text>}{}</xsl:text>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elementq</desc>
+	</doc>
+	<xsl:template match="tei:q">
+		<xsl:choose>
+			<xsl:when test="tei:p">
+				\begin{quote}
+				<xsl:apply-templates />
+				\end{quote}
+			</xsl:when>
+			<xsl:when test="tei:text">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="tei:lg">
+				\begin{quote}
+				<xsl:apply-templates />
+				\end{quote}
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="makeQuote" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element q with @rend='display'</desc>
-   </doc>
-  <xsl:template match="tei:q[@rend='display']"> 
-      <xsl:text>&#10;\begin{quote}&#10;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>\end{quote}&#10;</xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element quote</desc>
+	</doc>
+	<xsl:template match="tei:quote">
+		<xsl:choose>
+			<xsl:when test="parent::tei:cit">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@rend='inline'">
+				<xsl:value-of select="$preQuote" />
+				<xsl:apply-templates />
+				<xsl:value-of select="$postQuote" />
+			</xsl:when>
+			<xsl:when
+				test="@rend='display' or tei:p or tei:l or string-length(.)&gt;150">
+				<xsl:text>\begin{quote}</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>\end{quote}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="$preQuote" />
+				<xsl:apply-templates />
+				<xsl:value-of select="$postQuote" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element ref[@type='cite']</desc>
-   </doc>
-  <xsl:template match="tei:ref[@type='cite']">
-      <xsl:apply-templates/>
-  </xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element p with @rend='display'</desc>
+	</doc>
+	<xsl:template match="tei:p[@rend='display']">
+		\begin{quote}
+		<xsl:text>&#10;\begin{quote}&#10;</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>\end{quote}&#10;</xsl:text>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element signed</desc>
-   </doc>
-  <xsl:template match="tei:signed">
-      <xsl:text>&#10;\begin{quote}&#10;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>\end{quote}&#10;</xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element q with @rend='display'</desc>
+	</doc>
+	<xsl:template match="tei:q[@rend='display']">
+		<xsl:text>&#10;\begin{quote}&#10;</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>\end{quote}&#10;</xsl:text>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element soCalled</desc>
-   </doc>
-  <xsl:template match="tei:soCalled">    
-      <xsl:value-of select="$preQuote"/>
-      <xsl:apply-templates/>
-      <xsl:value-of select="$postQuote"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element ref[@type='cite']</desc>
+	</doc>
+	<xsl:template match="tei:ref[@type='cite']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element unclear</desc>
-   </doc>
-  <xsl:template match="tei:unclear">
-    <xsl:text>\textbf{</xsl:text>
-    <xsl:apply-templates/>
-    <xsl:text>}</xsl:text>
-    </xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element space</desc>
-   </doc>
-  <xsl:template match="tei:space">
-    <xsl:variable name="unit">
-      <xsl:choose>
-	<xsl:when test="@unit">
-	  <xsl:value-of select="@unit"/>
-	</xsl:when>
-	<xsl:otherwise>em</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="quantity">
-      <xsl:choose>
-	<xsl:when test="@quantity">
-	  <xsl:value-of select="@quantity"/>
-	</xsl:when>
-	<xsl:otherwise>1</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:text>\hspace{</xsl:text>
-    <xsl:value-of select="$quantity"/>
-    <xsl:value-of select="$unit"/>
-    <xsl:text>}</xsl:text>
-    </xsl:template>
-    
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element signed</desc>
+	</doc>
+	<xsl:template match="tei:signed">
+		<xsl:text>&#10;\begin{quote}&#10;</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>\end{quote}&#10;</xsl:text>
+	</xsl:template>
 
-   <xsl:template name="emphasize">
-      <xsl:param name="class"/>
-      <xsl:param name="content"/>
-      <xsl:choose>
-         <xsl:when test="$class='titlem'">
-            <xsl:text>\textit{</xsl:text>
-            <xsl:copy-of select="$content"/>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:when test="$class='titlej'">
-            <xsl:text>\textit{</xsl:text>
-            <xsl:copy-of select="$content"/>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:when test="$class='titlea'">
-            <xsl:text>‘</xsl:text>
-	           <xsl:copy-of select="$content"/>
-            <xsl:text>’</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:copy-of select="$content"/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element soCalled</desc>
+	</doc>
+	<xsl:template match="tei:soCalled">
+		<xsl:value-of select="$preQuote" />
+		<xsl:apply-templates />
+		<xsl:value-of select="$postQuote" />
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element unclear</desc>
+	</doc>
+	<xsl:template match="tei:unclear">
+		<xsl:text>\textbf{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-  <xsl:template name="Text">
-      <xsl:param name="words"/>
-      <xsl:value-of select="tei:escapeChars($words)"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element space</desc>
+	</doc>
+	<xsl:template match="tei:space">
+		<xsl:variable name="unit">
+			<xsl:choose>
+				<xsl:when test="@unit">
+					<xsl:value-of select="@unit" />
+				</xsl:when>
+				<xsl:otherwise>
+					em
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="quantity">
+			<xsl:choose>
+				<xsl:when test="@quantity">
+					<xsl:value-of select="@quantity" />
+				</xsl:when>
+				<xsl:otherwise>
+					1
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:text>\hspace{</xsl:text>
+		<xsl:value-of select="$quantity" />
+		<xsl:value-of select="$unit" />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-  <xsl:template name="applyRendition"/>
 
-  <xsl:template name="makeSpan">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template name="emphasize">
+		<xsl:param name="class" />
+		<xsl:param name="content" />
+		<xsl:choose>
+			<xsl:when test="$class='titlem'">
+				<xsl:text>\textit{</xsl:text>
+				<xsl:copy-of select="$content" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="$class='titlej'">
+				<xsl:text>\textit{</xsl:text>
+				<xsl:copy-of select="$content" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="$class='titlea'">
+				<xsl:text>‘</xsl:text>
+				<xsl:copy-of select="$content" />
+				<xsl:text>’</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="$content" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process text(), escaping the LaTeX command characters.</p>
-      </desc>
-   </doc>
-  <xsl:template match="text()"> 
-      <xsl:value-of select="tei:escapeChars(.)"/>
-  </xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process attributes in text mode, escaping the LaTeX
-    command characters.</p>
-         <p>as with text()</p>
-      </desc>
-   </doc>
-  <xsl:template match="@*" mode="attributetext">
-      <xsl:value-of select="tei:escapeChars(.)"/>
-  </xsl:template>
+	<xsl:template name="Text">
+		<xsl:param name="words" />
+		<xsl:value-of select="tei:escapeChars($words)" />
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process text (in example mode)</desc>
-   </doc>
-  <xsl:template match="text()" mode="eg">
-      <xsl:choose>
-         <xsl:when test="starts-with(.,'&#xA;')">
-            <xsl:value-of select="substring-after(tei:escapeCharsVerbatim(.),'&#xA;')"/>
-         </xsl:when>
-         <xsl:otherwise>
-	   <xsl:value-of select="tei:escapeCharsVerbatim(.)"/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<xsl:template name="applyRendition" />
 
+	<xsl:template name="makeSpan">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process text(), escaping the LaTeX command characters.</p>
+		</desc>
+	</doc>
+	<xsl:template match="text()">
+		<xsl:value-of select="tei:escapeChars(.)" />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process attributes in text mode, escaping the LaTeX
+				command characters.</p>
+			<p>as with text()</p>
+		</desc>
+	</doc>
+	<xsl:template match="@*" mode="attributetext">
+		<xsl:value-of select="tei:escapeChars(.)" />
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process text (in example mode)</desc>
+	</doc>
+	<xsl:template match="text()" mode="eg">
+		<xsl:choose>
+			<xsl:when test="starts-with(.,'&#xA;')">
+				<xsl:value-of
+					select="substring-after(tei:escapeCharsVerbatim(.),'&#xA;')" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="tei:escapeCharsVerbatim(.)" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/header.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/header.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/header.xsl	(revision 2397)
@@ -1,87 +1,103 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the header module,
-      making LaTeX output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the header module,
+				making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: header.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element docAuthor</desc>
-   </doc>
-  <xsl:template match="tei:docAuthor"> 
-      <xsl:if test="not(preceding-sibling::tei:docAuthor)">
-         <xsl:text>\author{</xsl:text>
-      </xsl:if>
-      <xsl:apply-templates/>
-      <xsl:choose>
-         <xsl:when test="count(following-sibling::tei:docAuthor)=1"> and </xsl:when>
-         <xsl:when test="following-sibling::tei:docAuthor">, </xsl:when>
-      </xsl:choose>
-      <xsl:if test="not(following-sibling::tei:docAuthor)">
-         <xsl:text>}</xsl:text>
-      </xsl:if>
-  </xsl:template>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <xsl:template match="tei:docAuthor" mode="author">
-      <xsl:apply-templates/>
-      <xsl:choose>
-         <xsl:when test="count(following-sibling::tei:docAuthor)=1"> and </xsl:when>
-         <xsl:when test="following-sibling::tei:docAuthor">, </xsl:when>
-      </xsl:choose>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element docDate</desc>
-   </doc>
-  <xsl:template match="tei:docDate">
-  \date{<xsl:apply-templates/>}</xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: header.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element docAuthor</desc>
+	</doc>
+	<xsl:template match="tei:docAuthor">
+		<xsl:if test="not(preceding-sibling::tei:docAuthor)">
+			<xsl:text>\author{</xsl:text>
+		</xsl:if>
+		<xsl:apply-templates />
+		<xsl:choose>
+			<xsl:when test="count(following-sibling::tei:docAuthor)=1">
+				and
+			</xsl:when>
+			<xsl:when test="following-sibling::tei:docAuthor">
+				,
+			</xsl:when>
+		</xsl:choose>
+		<xsl:if test="not(following-sibling::tei:docAuthor)">
+			<xsl:text>}</xsl:text>
+		</xsl:if>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element docImprint</desc>
-   </doc>
-  <xsl:template match="tei:docImprint">
-  </xsl:template>
+	<xsl:template match="tei:docAuthor" mode="author">
+		<xsl:apply-templates />
+		<xsl:choose>
+			<xsl:when test="count(following-sibling::tei:docAuthor)=1">
+				and
+			</xsl:when>
+			<xsl:when test="following-sibling::tei:docAuthor">
+				,
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element docDate</desc>
+	</doc>
+	<xsl:template match="tei:docDate">
+		\date{
+		<xsl:apply-templates />
+		}
+	</xsl:template>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element docImprint</desc>
+	</doc>
+	<xsl:template match="tei:docImprint">
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/corpus.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/corpus.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/corpus.xsl	(revision 2397)
@@ -1,51 +1,56 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the corpus module,
-      making LaTeX output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the corpus module,
+				making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: corpus.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: corpus.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/linking.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/linking.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/linking.xsl	(revision 2397)
@@ -1,191 +1,204 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-		xmlns:xs="http://www.w3.org/2001/XMLSchema"                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix xs"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the linking module,
-      making LaTeX output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix xs" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the linking module,
+				making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: linking.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element anchor</desc>
-   </doc>
-  <xsl:template match="tei:anchor">
-      <xsl:text>\hypertarget{</xsl:text>
-      <xsl:value-of select="@xml:id"/>
-      <xsl:text>}{}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] <param name="where">where</param>
-      </desc>
-   </doc>
-  <xsl:template name="generateEndLink">
-      <xsl:param name="where"/>
-      <xsl:value-of select="$where"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] <param name="ptr">ptr</param>
-         <param name="dest">dest</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeExternalLink">
-      <xsl:param name="ptr" as="xs:boolean"  select="false()"/>
-      <xsl:param name="dest"/>
-      <xsl:choose>
-         <xsl:when test="$ptr">
-            <xsl:text>\url{</xsl:text>
-            <xsl:value-of select="$dest"/>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>\xref{</xsl:text>
-            <xsl:value-of select="$dest"/>
-            <xsl:text>}{</xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>}</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] <param name="target">target</param>
-         <param name="ptr">ptr</param>
-         <param name="dest">dest</param>
-         <param name="body">body</param>
-      </desc>
-   </doc>
-  <xsl:template name="makeInternalLink">
-      <xsl:param name="target"/>
-      <xsl:param name="class"/>
-      <xsl:param name="ptr" as="xs:boolean"  select="false()"/>
-      <xsl:param name="dest"/>
-      <xsl:param name="body"/>
-      <xsl:choose>
-         <xsl:when test="id($dest)">
-            <xsl:choose>
-               <xsl:when test="not($body='')">
-		 <xsl:text>\hyperlink{</xsl:text>
-		 <xsl:value-of select="$dest"/>
-		 <xsl:text>}{</xsl:text>
-		 <xsl:value-of select="$body"/>
-		 <xsl:text>}</xsl:text>
-               </xsl:when>
-               <xsl:when test="$ptr">
-		 <xsl:for-each select="id($dest)">
-		   <xsl:choose>
-		     <xsl:when test="$class='pageref'">
-		       <xsl:text>\pageref{</xsl:text>
-		       <xsl:value-of select="@xml:id"/>
-		       <xsl:text>}</xsl:text>
-		     </xsl:when>
-		     <xsl:when test="self::tei:note[@xml:id]">
-		       <xsl:text>\ref{</xsl:text>
-		       <xsl:value-of select="@xml:id"/>
-		       <xsl:text>}</xsl:text>
-		     </xsl:when>
-		     <xsl:when test="self::tei:figure[tei:head and @xml:id]">
-		       <xsl:text>\ref{</xsl:text>
-		       <xsl:value-of select="@xml:id"/>
-		       <xsl:text>}</xsl:text>
-		     </xsl:when>
-		     <xsl:when test="self::tei:table[tei:head and @xml:id]">
-		       <xsl:text>\ref{</xsl:text>
-		       <xsl:value-of select="@xml:id"/>
-		       <xsl:text>}</xsl:text>
-		     </xsl:when>
-		     <xsl:when test="starts-with(local-name(.),'div')">
-		       <xsl:text>\textit{\hyperref[</xsl:text>
-		       <xsl:value-of select="$dest"/>
-		       <xsl:text>]{</xsl:text>
-		       <xsl:apply-templates mode="xref" select=".">
-			 <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-		       </xsl:apply-templates>
-		       <xsl:text>}}</xsl:text>
-		     </xsl:when>
-		     <xsl:otherwise>
-		       <xsl:text>\hyperlink{</xsl:text>
-		       <xsl:value-of select="$dest"/>
-		       <xsl:text>}{</xsl:text>
-		       <xsl:value-of select="$body"/>
-		       <xsl:apply-templates mode="xref" select=".">
-			 <xsl:with-param name="minimal" select="$minimalCrossRef"/>
-		       </xsl:apply-templates>
-		       <xsl:text>}</xsl:text>
-		     </xsl:otherwise>
-		   </xsl:choose>
-		 </xsl:for-each>
-               </xsl:when>
-               <xsl:otherwise>
-		 <xsl:text>\hyperlink{</xsl:text>
-		 <xsl:value-of select="$dest"/>
-		 <xsl:text>}{</xsl:text>
-		 <xsl:value-of select="$body"/>
-		 <xsl:apply-templates/>
-		 <xsl:text>}</xsl:text>
-	       </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>
-	   <xsl:choose>
-	     <xsl:when test="not($body='')">
-	       <xsl:value-of select="$body"/>
-	     </xsl:when>
-	     <xsl:when test="$ptr">
-	       <xsl:value-of select="$dest"/>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <xsl:apply-templates/>
-	     </xsl:otherwise>
-	   </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process cross-ref to note</desc>
-   </doc>
-  <xsl:template match="tei:note" mode="xref">
-    <xsl:number level="any"/>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: linking.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element anchor</desc>
+	</doc>
+	<xsl:template match="tei:anchor">
+		<xsl:text>\hypertarget{</xsl:text>
+		<xsl:value-of select="@xml:id" />
+		<xsl:text>}{}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[latex]
+			<param name="where">where</param>
+		</desc>
+	</doc>
+	<xsl:template name="generateEndLink">
+		<xsl:param name="where" />
+		<xsl:value-of select="$where" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[latex]
+			<param name="ptr">ptr</param>
+			<param name="dest">dest</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeExternalLink">
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="dest" />
+		<xsl:choose>
+			<xsl:when test="$ptr">
+				<xsl:text>\url{</xsl:text>
+				<xsl:value-of select="$dest" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\xref{</xsl:text>
+				<xsl:value-of select="$dest" />
+				<xsl:text>}{</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			[latex]
+			<param name="target">target</param>
+			<param name="ptr">ptr</param>
+			<param name="dest">dest</param>
+			<param name="body">body</param>
+		</desc>
+	</doc>
+	<xsl:template name="makeInternalLink">
+		<xsl:param name="target" />
+		<xsl:param name="class" />
+		<xsl:param name="ptr" as="xs:boolean" select="false()" />
+		<xsl:param name="dest" />
+		<xsl:param name="body" />
+		<xsl:choose>
+			<xsl:when test="id($dest)">
+				<xsl:choose>
+					<xsl:when test="not($body='')">
+						<xsl:text>\hyperlink{</xsl:text>
+						<xsl:value-of select="$dest" />
+						<xsl:text>}{</xsl:text>
+						<xsl:value-of select="$body" />
+						<xsl:text>}</xsl:text>
+					</xsl:when>
+					<xsl:when test="$ptr">
+						<xsl:for-each select="id($dest)">
+							<xsl:choose>
+								<xsl:when test="$class='pageref'">
+									<xsl:text>\pageref{</xsl:text>
+									<xsl:value-of select="@xml:id" />
+									<xsl:text>}</xsl:text>
+								</xsl:when>
+								<xsl:when test="self::tei:note[@xml:id]">
+									<xsl:text>\ref{</xsl:text>
+									<xsl:value-of select="@xml:id" />
+									<xsl:text>}</xsl:text>
+								</xsl:when>
+								<xsl:when test="self::tei:figure[tei:head and @xml:id]">
+									<xsl:text>\ref{</xsl:text>
+									<xsl:value-of select="@xml:id" />
+									<xsl:text>}</xsl:text>
+								</xsl:when>
+								<xsl:when test="self::tei:table[tei:head and @xml:id]">
+									<xsl:text>\ref{</xsl:text>
+									<xsl:value-of select="@xml:id" />
+									<xsl:text>}</xsl:text>
+								</xsl:when>
+								<xsl:when test="starts-with(local-name(.),'div')">
+									<xsl:text>\textit{\hyperref[</xsl:text>
+									<xsl:value-of select="$dest" />
+									<xsl:text>]{</xsl:text>
+									<xsl:apply-templates mode="xref" select=".">
+										<xsl:with-param name="minimal"
+											select="$minimalCrossRef" />
+									</xsl:apply-templates>
+									<xsl:text>}}</xsl:text>
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:text>\hyperlink{</xsl:text>
+									<xsl:value-of select="$dest" />
+									<xsl:text>}{</xsl:text>
+									<xsl:value-of select="$body" />
+									<xsl:apply-templates mode="xref" select=".">
+										<xsl:with-param name="minimal"
+											select="$minimalCrossRef" />
+									</xsl:apply-templates>
+									<xsl:text>}</xsl:text>
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>\hyperlink{</xsl:text>
+						<xsl:value-of select="$dest" />
+						<xsl:text>}{</xsl:text>
+						<xsl:value-of select="$body" />
+						<xsl:apply-templates />
+						<xsl:text>}</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="not($body='')">
+						<xsl:value-of select="$body" />
+					</xsl:when>
+					<xsl:when test="$ptr">
+						<xsl:value-of select="$dest" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process cross-ref to note</desc>
+	</doc>
+	<xsl:template match="tei:note" mode="xref">
+		<xsl:number level="any" />
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/transcr.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/transcr.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/transcr.xsl	(revision 2397)
@@ -1,58 +1,61 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-    transcr module, making LaTeX output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				transcr module, making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: transcr.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template match="tei:facsimile"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: transcr.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
+	<xsl:template match="tei:facsimile" />
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tei-param.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tei-param.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tei-param.xsl	(revision 2397)
@@ -1,138 +1,156 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:s="http://www.ascc.net/xml/schematron"
-                
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="s a rng tei teix"
-                version="2.0">
+<xsl:stylesheet
+	xmlns:s="http://www.ascc.net/xml/schematron"
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>TEI stylesheet customization module for LaTeX output.</p>
-         <p>This software is dual-licensed:
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="s a rng tei teix" version="2.0">
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>TEI stylesheet customization module for LaTeX output.</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei-param.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:key name="FOOTNOTES" match="tei:note[not(@place)]" use="1"/>
-  <xsl:key name="FOOTNOTES" match="tei:note[@place='foot']" use="1"/>
-  <xsl:key name="FOOTNOTES" match="tei:note[@place='bottom']" use="1"/>
-  <xsl:key name="ENDNOTES" match="tei:note[@place='end']" use="1"/>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei-param.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[latex] Hook where LaTeX commands can be inserted after 
-the beginning of the document</desc>
-   </doc>
-   <xsl:template name="beginDocumentHook"/>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[latex] Hook where LaTeX commands can be at start of setup</desc>
-   </doc>
-   <xsl:template name="latexSetupHook"/>
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
-      <desc>[latex] Hook where LaTeX commands can be inserted in the
-    preamble before the beginning of the document</desc>
-   </doc>
-   <xsl:template name="latexPreambleHook"/>
+	<xsl:key name="FOOTNOTES" match="tei:note[not(@place)]" use="1" />
+	<xsl:key name="FOOTNOTES" match="tei:note[@place='foot']"
+		use="1" />
+	<xsl:key name="FOOTNOTES" match="tei:note[@place='bottom']"
+		use="1" />
+	<xsl:key name="ENDNOTES" match="tei:note[@place='end']" use="1" />
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Optional parameters for documentclass
-</desc>
-   </doc>
-   <xsl:param name="classParameters">11pt,twoside</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[latex] Hook where LaTeX commands can be inserted after
+			the beginning of the document</desc>
+	</doc>
+	<xsl:template name="beginDocumentHook" />
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-Logo graphics file
-</desc>
-   </doc>
-   <xsl:param name="latexLogo"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[latex] Hook where LaTeX commands can be at start of setup</desc>
+	</doc>
+	<xsl:template name="latexSetupHook" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="hook">
+		<desc>[latex] Hook where LaTeX commands can be inserted in the
+			preamble before the beginning of the document</desc>
+	</doc>
+	<xsl:template name="latexPreambleHook" />
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="string">
-      <desc>
-URL root where referenced documents are located
-</desc>
-   </doc>
-   <xsl:param name="baseURL"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Optional parameters for documentclass
+		</desc>
+	</doc>
+	<xsl:param name="classParameters">
+		11pt,twoside
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="boolean">
-      <desc>
-Whether or not to load LaTeX packages which attempt to
-process the UTF-8 characters. Set to "false" if you are
-using XeTeX or similar.
-</desc>
-   </doc>
-   <xsl:param name="reencode">true</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			Logo graphics file
+		</desc>
+	</doc>
+	<xsl:param name="latexLogo" />
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="userpackage" type="string">
-      <desc>
-The name of a LaTeX style package which should be loaded
-</desc>
-   </doc>
-   <xsl:param name="userpackage"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="string">
+		<desc>
+			URL root where referenced documents are located
+		</desc>
+	</doc>
+	<xsl:param name="baseURL" />
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output" type="boolean">
-      <desc>
-Use real name of graphics files rather than pointers
-</desc>
-   </doc>
-   <xsl:param name="realFigures">true</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="boolean">
+		<desc>
+			Whether or not to load LaTeX packages which attempt to
+			process the UTF-8 characters. Set to "false" if you are
+			using XeTeX or similar.
+		</desc>
+	</doc>
+	<xsl:param name="reencode">
+		true
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>
-         <p>LaTeX package setup</p>
-         <p>Declaration of the LaTeX packages needed to implement
-    this markup</p>
-      </desc>
-   </doc>
-   <xsl:template name="latexPackages">
-      <xsl:text>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="userpackage" type="string">
+		<desc>
+			The name of a LaTeX style package which should be loaded
+		</desc>
+	</doc>
+	<xsl:param name="userpackage" />
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="output"
+		type="boolean">
+		<desc>
+			Use real name of graphics files rather than pointers
+		</desc>
+	</doc>
+	<xsl:param name="realFigures">
+		true
+	</xsl:param>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			<p>LaTeX package setup</p>
+			<p>Declaration of the LaTeX packages needed to implement
+				this markup</p>
+		</desc>
+	</doc>
+	<xsl:template name="latexPackages">
+		<xsl:text>
 \usepackage[</xsl:text>
-      <xsl:value-of select="$latexPaperSize"/>
-      <xsl:text>,</xsl:text>
-      <xsl:value-of select="$latexGeometryOptions"/>
-      <xsl:text>]{geometry}
+		<xsl:value-of select="$latexPaperSize" />
+		<xsl:text>,</xsl:text>
+		<xsl:value-of select="$latexGeometryOptions" />
+		<xsl:text>]{geometry}
 \usepackage{framed}
 </xsl:text>
-<xsl:text>
+		<xsl:text>
 \definecolor{shadecolor}{gray}{0.95}
 \usepackage{longtable}
 \usepackage[normalem]{ulem}
@@ -140,196 +158,238 @@
 \usepackage{fancyhdr}
 \usepackage{graphicx}
 </xsl:text>
-<xsl:if test="key('ENDNOTES',1)">
-  \usepackage{endnotes}
-  <xsl:choose>
-    <xsl:when test="key('FOOTNOTES',1)">
-      \def\theendnote{\@alph\c@endnote}
-    </xsl:when>
-    <xsl:otherwise>
-      \def\theendnote{\@arabic\c@endnote}
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:if>
-<xsl:text>
+		<xsl:if test="key('ENDNOTES',1)">
+			\usepackage{endnotes}
+			<xsl:choose>
+				<xsl:when test="key('FOOTNOTES',1)">
+					\def\theendnote{\@alph\c@endnote}
+				</xsl:when>
+				<xsl:otherwise>
+					\def\theendnote{\@arabic\c@endnote}
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+		<xsl:text>
 \def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}
 </xsl:text>
-<xsl:choose>
-      <xsl:when test="$reencode='true'">
-         <xsl:text>
+		<xsl:choose>
+			<xsl:when test="$reencode='true'">
+				<xsl:text>
 \IfFileExists{tipa.sty}{\usepackage{tipa}}{}
 \usepackage{times}
 </xsl:text>
-      </xsl:when>
-</xsl:choose>
-      <xsl:if test="not($userpackage='')">
-  \usepackage{<xsl:value-of select="$userpackage"/>}
-</xsl:if>
-      <xsl:text>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:if test="not($userpackage='')">
+			\usepackage{
+			<xsl:value-of select="$userpackage" />
+			}
+		</xsl:if>
+		<xsl:text>
   \pagestyle{fancy} 
 </xsl:text>
-\usepackage[pdftitle={<xsl:call-template name="generateSimpleTitle"/>},
- pdfauthor={<xsl:call-template name="generateAuthor"/>}]{hyperref}
-\hyperbaseurl{<xsl:value-of select="$baseURL"/>}
-<xsl:if test="count(key('APP',1))&gt;0">
-\usepackage{ledmac}
-<xsl:call-template name="ledmacOptions"/>
-</xsl:if>
+		\usepackage[pdftitle={
+		<xsl:call-template name="generateSimpleTitle" />
+		},
+		pdfauthor={
+		<xsl:call-template name="generateAuthor" />
+		}]{hyperref}
+		\hyperbaseurl{
+		<xsl:value-of select="$baseURL" />
+		}
+		<xsl:if test="count(key('APP',1))&gt;0">
+			\usepackage{ledmac}
+			<xsl:call-template name="ledmacOptions" />
+		</xsl:if>
 
-   </xsl:template>
+	</xsl:template>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="float">
-      <desc>
-When processing a "pb" element, decide what to generate: "active" generates a page break; "visible" genrates a bracketed number (with scissors), and "bracketsonly" generates a bracketed number (without scissors).
-</desc>
-   </doc>
-   <xsl:param name="pagebreakStyle"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="float">
+		<desc>
+			When processing a "pb" element, decide what to generate: "active"
+			generates a page break; "visible" genrates a bracketed number (with
+			scissors), and "bracketsonly" generates a bracketed number (without
+			scissors).
+		</desc>
+	</doc>
+	<xsl:param name="pagebreakStyle" />
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="float">
-      <desc>
-When making a table, what width must be constrained to fit,
-as a proportion of the page width.
-</desc>
-   </doc>
-   <xsl:param name="tableMaxWidth">0.8.05</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="float">
+		<desc>
+			When making a table, what width must be constrained to fit,
+			as a proportion of the page width.
+		</desc>
+	</doc>
+	<xsl:param name="tableMaxWidth">
+		0.8.05
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="boolean">
-      <desc>
-Whether to number lines of poetry
-</desc>
-   </doc>
-   <xsl:param name="verseNumbering">false</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="boolean">
+		<desc>
+			Whether to number lines of poetry
+		</desc>
+	</doc>
+	<xsl:param name="verseNumbering">
+		false
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="integer">
-      <desc>
-When numbering poetry, how often to put in a line number
-</desc>
-   </doc>
-   <xsl:param name="everyHowManyLines">5</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="integer">
+		<desc>
+			When numbering poetry, how often to put in a line number
+		</desc>
+	</doc>
+	<xsl:param name="everyHowManyLines">
+		5
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout" type="string">
-      <desc>
-When numbering poetry, when to restart the sequence;
-this must be the name of a TEI element
-</desc>
-   </doc>
-   <xsl:param name="resetVerseLineNumbering">div1</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout"
+		type="string">
+		<desc>
+			When numbering poetry, when to restart the sequence;
+			this must be the name of a TEI element
+		</desc>
+	</doc>
+	<xsl:param name="resetVerseLineNumbering">
+		div1
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="userpackage" type="string">
-      <desc>
-Options to pass to the geometry package to set margins etc
-</desc>
-   </doc>
-   <xsl:param name="latexGeometryOptions">twoside,lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="userpackage" type="string">
+		<desc>
+			Options to pass to the geometry package to set margins etc
+		</desc>
+	</doc>
+	<xsl:param name="latexGeometryOptions">
+		twoside,lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="userpackage" type="string">
-      <desc>
-Depth of nesting of reference documentation when processing ODD
-</desc>
-   </doc>
-   <xsl:param name="specLinkDepth">2</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl"
+		class="userpackage" type="string">
+		<desc>
+			Depth of nesting of reference documentation when processing ODD
+		</desc>
+	</doc>
+	<xsl:param name="specLinkDepth">
+		2
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>
-         <p>LaTeX setup</p>
-         <p>The basic LaTeX setup which you should not 
-really tinker with unless you really understand  why and how. Note
-that we need to set up a mapping here for Unicode 8421, 10100 and
-10100 to glyphs for backslash and the two curly brackets, to provide literal
-characters. The normal characters remain active for LaTeX commands.
-Note that if $reencode is set to false, no input or output encoding
-packages are loaded, since it is assumed you are using a TeX variant
-capable of dealing with UTF-8 directly.
-</p>
-      </desc>
-   </doc>
-   <xsl:template name="latexSetup">
-   <xsl:call-template name="latexSetupHook"/>
-\IfFileExists{xcolor.sty}%
-  {\RequirePackage{xcolor}}%
-  {\RequirePackage{color}}
-\usepackage{colortbl}
-      <xsl:choose>
-         <xsl:when test="$reencode='true'">
-\IfFileExists{utf8x.def}%
- {\usepackage[utf8x]{inputenc}}%
- {\usepackage[utf8]{inputenc}}
-\PrerenderUnicode{–}
-<xsl:call-template name="latexBabel"/>
-\usepackage[T1]{fontenc}
-\usepackage{float}
-\usepackage[]{ucs}
-\uc@dclc{8421}{default}{\textbackslash }
-\uc@dclc{10100}{default}{\{}
-\uc@dclc{10101}{default}{\}}
-\uc@dclc{8491}{default}{\AA{}}
-\uc@dclc{8239}{default}{\,}
-\uc@dclc{20154}{default}{ }
-\def\textschwa{\rotatebox{-90}{e}}
-\def\textJapanese{}
-\def\textChinese{}
-</xsl:when>
-         <xsl:otherwise>
-\usepackage{fontspec}
-\usepackage{xunicode}
-\catcode`⃥=\active \def⃥{\textbackslash}
-\catcode`❴=\active \def❴{\{}
-\catcode`❵=\active \def❵{\}}
-\def\textJapanese{\fontspec{Kochi Mincho}}
-\def\textChinese{\fontspec{HAN NOM A}\XeTeXlinebreaklocale "zh"\XeTeXlinebreakskip = 0pt plus 1pt }
-\def\textKorean{\fontspec{Baekmuk Gulim} }
-\setmonofont{<xsl:value-of select="$typewriterFont"/>}
-<xsl:if test="not($sansFont='')">
-  \setsansfont{<xsl:value-of select="$sansFont"/>}
-</xsl:if>
-<xsl:if test="not($romanFont='')">
-  \setromanfont{<xsl:value-of select="$romanFont"/>}
-</xsl:if>
-</xsl:otherwise>
-      </xsl:choose>
-\DeclareTextSymbol{\textpi}{OML}{25}
-\usepackage{relsize}
-\def\textsubscript#1{%
-  \@textsubscript{\selectfont#1}}
-\def\@textsubscript#1{%
-  {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
-\def\textquoted#1{‘#1’}
-\def\textsmall#1{{\small #1}}
-\def\textlarge#1{{\large #1}}
-\def\textoverbar#1{\ensuremath{\overline{#1}}}
-\def\textgothic#1{{\fontspec{<xsl:value-of select="$gothicFont"/>}#1}}
-\def\textcal#1{{\fontspec{<xsl:value-of select="$calligraphicFont"/>}#1}}
-\RequirePackage{array}
-\def\@testpach{\@chclass
- \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
-  \ifnum \@lastchclass=7 5 \else
-   \ifnum \@lastchclass=8 \tw@ \else
-    \ifnum \@lastchclass=9 \thr@@
-   \else \z@
-   \ifnum \@lastchclass = 10 \else
-   \edef\@nextchar{\expandafter\string\@nextchar}%
-   \@chnum
-   \if \@nextchar c\z@ \else
-    \if \@nextchar l\@ne \else
-     \if \@nextchar r\tw@ \else
-   \z@ \@chclass
-   \if\@nextchar |\@ne \else
-    \if \@nextchar !6 \else
-     \if \@nextchar @7 \else
-      \if \@nextchar (8 \else
-       \if \@nextchar )9 \else
-  10
-  \@chnum
-  \if \@nextchar m\thr@@\else
-   \if \@nextchar p4 \else
-    \if \@nextchar b5 \else
-   \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
-   \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			<p>LaTeX setup</p>
+			<p>The basic LaTeX setup which you should not
+				really tinker with unless you really understand why and how. Note
+				that we need to set up a mapping here for Unicode 8421, 10100 and
+				10100 to glyphs for backslash and the two curly brackets, to provide
+				literal
+				characters. The normal characters remain active for LaTeX commands.
+				Note that if $reencode is set to false, no input or output encoding
+				packages are loaded, since it is assumed you are using a TeX variant
+				capable of dealing with UTF-8 directly.
+			</p>
+		</desc>
+	</doc>
+	<xsl:template name="latexSetup">
+		<xsl:call-template name="latexSetupHook" />
+		\IfFileExists{xcolor.sty}%
+		{\RequirePackage{xcolor}}%
+		{\RequirePackage{color}}
+		\usepackage{colortbl}
+		<xsl:choose>
+			<xsl:when test="$reencode='true'">
+				\IfFileExists{utf8x.def}%
+				{\usepackage[utf8x]{inputenc}}%
+				{\usepackage[utf8]{inputenc}}
+				\PrerenderUnicode{–}
+				<xsl:call-template name="latexBabel" />
+				\usepackage[T1]{fontenc}
+				\usepackage{float}
+				\usepackage[]{ucs}
+				\uc@dclc{8421}{default}{\textbackslash }
+				\uc@dclc{10100}{default}{\{}
+				\uc@dclc{10101}{default}{\}}
+				\uc@dclc{8491}{default}{\AA{}}
+				\uc@dclc{8239}{default}{\,}
+				\uc@dclc{20154}{default}{ }
+				\def\textschwa{\rotatebox{-90}{e}}
+				\def\textJapanese{}
+				\def\textChinese{}
+			</xsl:when>
+			<xsl:otherwise>
+				\usepackage{fontspec}
+				\usepackage{xunicode}
+				\catcode`⃥=\active \def⃥{\textbackslash}
+				\catcode`❴=\active \def❴{\{}
+				\catcode`❵=\active \def❵{\}}
+				\def\textJapanese{\fontspec{Kochi Mincho}}
+				\def\textChinese{\fontspec{HAN NOM A}\XeTeXlinebreaklocale "zh"\XeTeXlinebreakskip = 0pt plus 1pt
+				}
+				\def\textKorean{\fontspec{Baekmuk Gulim} }
+				\setmonofont{
+				<xsl:value-of select="$typewriterFont" />
+				}
+				<xsl:if test="not($sansFont='')">
+					\setsansfont{
+					<xsl:value-of select="$sansFont" />
+					}
+				</xsl:if>
+				<xsl:if test="not($romanFont='')">
+					\setromanfont{
+					<xsl:value-of select="$romanFont" />
+					}
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+		\DeclareTextSymbol{\textpi}{OML}{25}
+		\usepackage{relsize}
+		\def\textsubscript#1{%
+		\@textsubscript{\selectfont#1}}
+		\def\@textsubscript#1{%
+		{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
+		\def\textquoted#1{‘#1’}
+		\def\textsmall#1{{\small #1}}
+		\def\textlarge#1{{\large #1}}
+		\def\textoverbar#1{\ensuremath{\overline{#1}}}
+		\def\textgothic#1{{\fontspec{
+		<xsl:value-of select="$gothicFont" />
+		}#1}}
+		\def\textcal#1{{\fontspec{
+		<xsl:value-of select="$calligraphicFont" />
+		}#1}}
+		\RequirePackage{array}
+		\def\@testpach{\@chclass
+		\ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
+		\ifnum \@lastchclass=7 5 \else
+		\ifnum \@lastchclass=8 \tw@ \else
+		\ifnum \@lastchclass=9 \thr@@
+		\else \z@
+		\ifnum \@lastchclass = 10 \else
+		\edef\@nextchar{\expandafter\string\@nextchar}%
+		\@chnum
+		\if \@nextchar c\z@ \else
+		\if \@nextchar l\@ne \else
+		\if \@nextchar r\tw@ \else
+		\z@ \@chclass
+		\if\@nextchar |\@ne \else
+		\if \@nextchar !6 \else
+		\if \@nextchar @7 \else
+		\if \@nextchar (8 \else
+		\if \@nextchar )9 \else
+		10
+		\@chnum
+		\if \@nextchar m\thr@@\else
+		\if \@nextchar p4 \else
+		\if \@nextchar b5 \else
+		\z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
+		\fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi}
 
-\gdef\arraybackslash{\let\\=\@arraycr}
-\def\textxi{\ensuremath{\xi}}
-\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
-<xsl:text disable-output-escaping="yes">
+		\gdef\arraybackslash{\let\\=\@arraycr}
+		\def\textxi{\ensuremath{\xi}}
+		\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
+		<xsl:text disable-output-escaping="yes">
 \newcolumntype{L}[1]{){\raggedright\arraybackslash}p{#1}}
 \newcolumntype{C}[1]{){\centering\arraybackslash}p{#1}}
 \newcolumntype{R}[1]{){\raggedleft\arraybackslash}p{#1}}
@@ -347,242 +407,269 @@
 \mathcode`\_=\string"8000
 \catcode`\_=12\relax
 </xsl:text>
-   </xsl:template>
+	</xsl:template>
 
-   <xsl:template name="exampleFontSet">
-      <xsl:choose>
-         <xsl:when test="$reencode='true'">
-            <xsl:text>\ttfamily\small\selectfont </xsl:text>
-         </xsl:when>
-         <xsl:when test="../@xml:lang='zh-TW' or       @xml:lang='zh-TW'">
-            <xsl:text>\fontspec{Arial Unicode MS}\small\selectfont </xsl:text>
-         </xsl:when>
-         <xsl:when test="../@xml:lang='ja' or       @xml:lang='ja'">
-            <xsl:text>\fontspec{Arial Unicode MS}\small\selectfont </xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>\ttfamily\small\selectfont </xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template name="exampleFontSet">
+		<xsl:choose>
+			<xsl:when test="$reencode='true'">
+				<xsl:text>\ttfamily\small\selectfont </xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="../@xml:lang='zh-TW' or       @xml:lang='zh-TW'">
+				<xsl:text>\fontspec{Arial Unicode MS}\small\selectfont </xsl:text>
+			</xsl:when>
+			<xsl:when test="../@xml:lang='ja' or       @xml:lang='ja'">
+				<xsl:text>\fontspec{Arial Unicode MS}\small\selectfont </xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\ttfamily\small\selectfont </xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>
-         <p>LaTeX babel setup</p>
-         <p>LaTeX loading of babel with options</p>
-      </desc>
-   </doc>
-   <xsl:template name="latexBabel">
-\usepackage[english]{babel}
-</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			<p>LaTeX babel setup</p>
+			<p>LaTeX loading of babel with options</p>
+		</desc>
+	</doc>
+	<xsl:template name="latexBabel">
+		\usepackage[english]{babel}
+	</xsl:template>
 
 
 
-<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-  <desc>
-    <p>LaTeX paper size</p>
-  </desc>
-</doc>
-<xsl:param name="latexPaperSize">a4paper</xsl:param>
-     
-<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string"><desc>Font for literal code</desc>   </doc>
-<xsl:param name="typewriterFont">DejaVu Sans Mono</xsl:param>
-<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string"><desc>Font for sans-serif</desc>   </doc>
-<xsl:param name="sansFont"></xsl:param>
-<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string"><desc>Font for serif</desc>   </doc>
-<xsl:param name="romanFont"></xsl:param>
-<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string"><desc>Font for gothic</desc>   </doc>
-<xsl:param name="gothicFont">Lucida Blackletter</xsl:param>
-<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style" type="string"><desc>Font for calligraphic</desc>   </doc>
-<xsl:param name="calligraphicFont">Lucida Calligraphy</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			<p>LaTeX paper size</p>
+		</desc>
+	</doc>
+	<xsl:param name="latexPaperSize">
+		a4paper
+	</xsl:param>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>
-         <p>LaTeX layout preamble</p>
-         <p>All the LaTeX setup which affects page layout</p>
-      </desc>
-   </doc>
-   <xsl:template name="latexLayout">
-     <xsl:choose>
-       <xsl:when test="$latexPaperSize='a3paper'">
-	 \paperwidth297mm
-	 \paperheight420mm
-       </xsl:when>
-       <xsl:when test="$latexPaperSize='a5paper'">	
-	 \paperwidth148mm
-	 \paperheight210mm
-       </xsl:when>
-       <xsl:when test="$latexPaperSize='a4paper'">
-	 \paperwidth210mm
-	 \paperheight297mm
-       </xsl:when>
-       <xsl:when test="$latexPaperSize='letterpaper'">
-	 \paperwidth216mm
-	 \paperheight279mm
-       </xsl:when>
-	 <xsl:otherwise>
-	 </xsl:otherwise>
-       </xsl:choose>       
-\def\@pnumwidth{1.55em}
-\def\@tocrmarg {2.55em}
-\def\@dotsep{4.5}
-\setcounter{tocdepth}{3}
-\clubpenalty=8000
-\emergencystretch 3em
-\hbadness=4000
-\hyphenpenalty=400
-\pretolerance=750
-\tolerance=2000
-\vbadness=4000
-\widowpenalty=10000
-<xsl:if test="not($docClass='letter')">
-\renewcommand\section{\@startsection {section}{1}{\z@}%
-     {-1.75ex \@plus -0.5ex \@minus -.2ex}%
-     {0.5ex \@plus .2ex}%
-     {\reset@font\Large\bfseries\sffamily}}
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
-     {-1.75ex\@plus -0.5ex \@minus- .2ex}%
-     {0.5ex \@plus .2ex}%
-     {\reset@font\Large\sffamily}}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
-     {-1.5ex\@plus -0.35ex \@minus -.2ex}%
-     {0.5ex \@plus .2ex}%
-     {\reset@font\large\sffamily}}
-\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
-     {-1ex \@plus-0.35ex \@minus -0.2ex}%
-     {0.5ex \@plus .2ex}%
-     {\reset@font\normalsize\sffamily}}
-\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
-     {1.5ex \@plus1ex \@minus .2ex}%
-     {-1em}%
-     {\reset@font\normalsize\bfseries}}
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>Font for literal code</desc>
+	</doc>
+	<xsl:param name="typewriterFont">
+		DejaVu Sans Mono
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>Font for sans-serif</desc>
+	</doc>
+	<xsl:param name="sansFont"></xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>Font for serif</desc>
+	</doc>
+	<xsl:param name="romanFont"></xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>Font for gothic</desc>
+	</doc>
+	<xsl:param name="gothicFont">
+		Lucida Blackletter
+	</xsl:param>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="style"
+		type="string">
+		<desc>Font for calligraphic</desc>
+	</doc>
+	<xsl:param name="calligraphicFont">
+		Lucida Calligraphy
+	</xsl:param>
 
-</xsl:if>
-\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt}
- \@tempdima 1.5em \begingroup
- \parindent \z@ \rightskip \@pnumwidth 
- \parfillskip -\@pnumwidth 
- \bfseries \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
- \endgroup}
-\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
-\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
-\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
-\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
-\@ifundefined{c@section}{\newcounter{section}}{}
-\@ifundefined{c@chapter}{\newcounter{chapter}}{}
-\newif\if@mainmatter 
-\@mainmattertrue
-\def\chaptername{Chapter}
-\def\frontmatter{%
-  \pagenumbering{roman}
-  \def\thechapter{\@roman\c@chapter}
-  \def\theHchapter{\alph{chapter}}
-  \def\@chapapp{}%
-}
-\def\mainmatter{%
-  \cleardoublepage
-  \def\thechapter{\@arabic\c@chapter}
-  \setcounter{chapter}{0}
-  \setcounter{section}{0}
-  \pagenumbering{arabic}
-  \setcounter{secnumdepth}{6}
-  \def\@chapapp{\chaptername}%
-  \def\theHchapter{\arabic{chapter}}
-}
-\def\backmatter{%
-  \cleardoublepage
-  \setcounter{chapter}{0}
-  \setcounter{section}{0}
-  \setcounter{secnumdepth}{0}
-  \def\@chapapp{\appendixname}%
-  \def\thechapter{\@Alph\c@chapter}
-  \def\theHchapter{\Alph{chapter}}
-  \appendix
-}
-\newenvironment{bibitemlist}[1]{%
-   \list{\@biblabel{\@arabic\c@enumiv}}%
-       {\settowidth\labelwidth{\@biblabel{#1}}%
-        \leftmargin\labelwidth
-        \advance\leftmargin\labelsep
-        \@openbib@code
-        \usecounter{enumiv}%
-        \let\p@enumiv\@empty
-        \renewcommand\theenumiv{\@arabic\c@enumiv}%
-	}%
-  \sloppy
-  \clubpenalty4000
-  \@clubpenalty \clubpenalty
-  \widowpenalty4000%
-  \sfcode`\.\@m}%
-  {\def\@noitemerr
-    {\@latex@warning{Empty `bibitemlist' environment}}%
-    \endlist}
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			<p>LaTeX layout preamble</p>
+			<p>All the LaTeX setup which affects page layout</p>
+		</desc>
+	</doc>
+	<xsl:template name="latexLayout">
+		<xsl:choose>
+			<xsl:when test="$latexPaperSize='a3paper'">
+				\paperwidth297mm
+				\paperheight420mm
+			</xsl:when>
+			<xsl:when test="$latexPaperSize='a5paper'">
+				\paperwidth148mm
+				\paperheight210mm
+			</xsl:when>
+			<xsl:when test="$latexPaperSize='a4paper'">
+				\paperwidth210mm
+				\paperheight297mm
+			</xsl:when>
+			<xsl:when test="$latexPaperSize='letterpaper'">
+				\paperwidth216mm
+				\paperheight279mm
+			</xsl:when>
+			<xsl:otherwise>
+			</xsl:otherwise>
+		</xsl:choose>
+		\def\@pnumwidth{1.55em}
+		\def\@tocrmarg {2.55em}
+		\def\@dotsep{4.5}
+		\setcounter{tocdepth}{3}
+		\clubpenalty=8000
+		\emergencystretch 3em
+		\hbadness=4000
+		\hyphenpenalty=400
+		\pretolerance=750
+		\tolerance=2000
+		\vbadness=4000
+		\widowpenalty=10000
+		<xsl:if test="not($docClass='letter')">
+			\renewcommand\section{\@startsection {section}{1}{\z@}%
+			{-1.75ex \@plus -0.5ex \@minus -.2ex}%
+			{0.5ex \@plus .2ex}%
+			{\reset@font\Large\bfseries\sffamily}}
+			\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
+			{-1.75ex\@plus -0.5ex \@minus- .2ex}%
+			{0.5ex \@plus .2ex}%
+			{\reset@font\Large\sffamily}}
+			\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+			{-1.5ex\@plus -0.35ex \@minus -.2ex}%
+			{0.5ex \@plus .2ex}%
+			{\reset@font\large\sffamily}}
+			\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
+			{-1ex \@plus-0.35ex \@minus -0.2ex}%
+			{0.5ex \@plus .2ex}%
+			{\reset@font\normalsize\sffamily}}
+			\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
+			{1.5ex \@plus1ex \@minus .2ex}%
+			{-1em}%
+			{\reset@font\normalsize\bfseries}}
 
-\def\tableofcontents{\section*{\contentsname}\@starttoc{toc}}
-\parskip<xsl:value-of select="$parSkip"/>
-\parindent<xsl:value-of select="$parIndent"/>
-\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
-\newenvironment{reflist}{%
-  \begin{raggedright}\begin{list}{}
-  {%
-   \setlength{\topsep}{0pt}%
-   \setlength{\rightmargin}{0.25in}%
-   \setlength{\itemsep}{0pt}%
-   \setlength{\itemindent}{0pt}%
-   \setlength{\parskip}{0pt}%
-   \setlength{\parsep}{2pt}%
-   \def\makelabel##1{\itshape ##1}}%
-  }
-  {\end{list}\end{raggedright}}
-\newenvironment{sansreflist}{%
-  \begin{raggedright}\begin{list}{}
-  {%
-   \setlength{\topsep}{0pt}%
-   \setlength{\rightmargin}{0.25in}%
-   \setlength{\itemindent}{0pt}%
-   \setlength{\parskip}{0pt}%
-   \setlength{\itemsep}{0pt}%
-   \setlength{\parsep}{2pt}%
-   \def\makelabel##1{\upshape\sffamily ##1}}%
-  }
-  {\end{list}\end{raggedright}}
-\newenvironment{specHead}[2]%
- {\vspace{20pt}\hrule\vspace{10pt}%
-  \hypertarget{#1}{}%
-  \markright{#2}%
-<xsl:text>
+		</xsl:if>
+		\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus
+		1pt}
+		\@tempdima 1.5em \begingroup
+		\parindent \z@ \rightskip \@pnumwidth
+		\parfillskip -\@pnumwidth
+		\bfseries \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
+		\endgroup}
+		\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+		\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
+		\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
+		\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
+		\@ifundefined{c@section}{\newcounter{section}}{}
+		\@ifundefined{c@chapter}{\newcounter{chapter}}{}
+		\newif\if@mainmatter
+		\@mainmattertrue
+		\def\chaptername{Chapter}
+		\def\frontmatter{%
+		\pagenumbering{roman}
+		\def\thechapter{\@roman\c@chapter}
+		\def\theHchapter{\alph{chapter}}
+		\def\@chapapp{}%
+		}
+		\def\mainmatter{%
+		\cleardoublepage
+		\def\thechapter{\@arabic\c@chapter}
+		\setcounter{chapter}{0}
+		\setcounter{section}{0}
+		\pagenumbering{arabic}
+		\setcounter{secnumdepth}{6}
+		\def\@chapapp{\chaptername}%
+		\def\theHchapter{\arabic{chapter}}
+		}
+		\def\backmatter{%
+		\cleardoublepage
+		\setcounter{chapter}{0}
+		\setcounter{section}{0}
+		\setcounter{secnumdepth}{0}
+		\def\@chapapp{\appendixname}%
+		\def\thechapter{\@Alph\c@chapter}
+		\def\theHchapter{\Alph{chapter}}
+		\appendix
+		}
+		\newenvironment{bibitemlist}[1]{%
+		\list{\@biblabel{\@arabic\c@enumiv}}%
+		{\settowidth\labelwidth{\@biblabel{#1}}%
+		\leftmargin\labelwidth
+		\advance\leftmargin\labelsep
+		\@openbib@code
+		\usecounter{enumiv}%
+		\let\p@enumiv\@empty
+		\renewcommand\theenumiv{\@arabic\c@enumiv}%
+		}%
+		\sloppy
+		\clubpenalty4000
+		\@clubpenalty \clubpenalty
+		\widowpenalty4000%
+		\sfcode`\.\@m}%
+		{\def\@noitemerr
+		{\@latex@warning{Empty `bibitemlist' environment}}%
+		\endlist}
+
+		\def\tableofcontents{\section*{\contentsname}\@starttoc{toc}}
+		\parskip
+		<xsl:value-of select="$parSkip" />
+		\parindent
+		<xsl:value-of select="$parIndent" />
+		\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
+		\newenvironment{reflist}{%
+		\begin{raggedright}\begin{list}{}
+		{%
+		\setlength{\topsep}{0pt}%
+		\setlength{\rightmargin}{0.25in}%
+		\setlength{\itemsep}{0pt}%
+		\setlength{\itemindent}{0pt}%
+		\setlength{\parskip}{0pt}%
+		\setlength{\parsep}{2pt}%
+		\def\makelabel##1{\itshape ##1}}%
+		}
+		{\end{list}\end{raggedright}}
+		\newenvironment{sansreflist}{%
+		\begin{raggedright}\begin{list}{}
+		{%
+		\setlength{\topsep}{0pt}%
+		\setlength{\rightmargin}{0.25in}%
+		\setlength{\itemindent}{0pt}%
+		\setlength{\parskip}{0pt}%
+		\setlength{\itemsep}{0pt}%
+		\setlength{\parsep}{2pt}%
+		\def\makelabel##1{\upshape\sffamily ##1}}%
+		}
+		{\end{list}\end{raggedright}}
+		\newenvironment{specHead}[2]%
+		{\vspace{20pt}\hrule\vspace{10pt}%
+		\hypertarget{#1}{}%
+		\markright{#2}%
+		<xsl:text>
   \pdfbookmark[</xsl:text>
-      <xsl:value-of select="$specLinkDepth"/>
-      <xsl:text>]{#2}{#1}%
+		<xsl:value-of select="$specLinkDepth" />
+		<xsl:text>]{#2}{#1}%
   \hspace{-0.75in}{\bfseries\fontsize{16pt}{18pt}\selectfont#2}%
   }{}
-      </xsl:text>   
-      <xsl:call-template name="latexPreambleHook"/>
-   </xsl:template>
+      </xsl:text>
+		<xsl:call-template name="latexPreambleHook" />
+	</xsl:template>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>
-         <p>LaTeX setup commands for ledmac package</p>
-      </desc>
-   </doc>
-<xsl:template name="ledmacOptions">
-\renewcommand{\notenumfont}{\bfseries}
-\lineation{page}
-\linenummargin{inner}
-\footthreecol{A}
-\foottwocol{B}
-</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			<p>LaTeX setup commands for ledmac package</p>
+		</desc>
+	</doc>
+	<xsl:template name="ledmacOptions">
+		\renewcommand{\notenumfont}{\bfseries}
+		\lineation{page}
+		\linenummargin{inner}
+		\footthreecol{A}
+		\foottwocol{B}
+	</xsl:template>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>
-         <p>LaTeX setup before start of document</p>
-         <p>All the LaTeX setup which are executed before the start of
-    the document</p>
-      </desc>
-   </doc>
-   <xsl:template name="latexBegin">
-      <xsl:text>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			<p>LaTeX setup before start of document</p>
+			<p>All the LaTeX setup which are executed before the start of
+				the document</p>
+		</desc>
+	</doc>
+	<xsl:template name="latexBegin">
+		<xsl:text>
 \makeatletter
 \thispagestyle{empty}
 \markright{\@title}\markboth{\@title}{\@author}
@@ -609,30 +696,31 @@
 \fancyfoot[RE]{\TheID}
 \hypersetup{linkbordercolor=0.75 0.75 0.75,urlbordercolor=0.75 0.75 0.75,bookmarksnumbered=true}
 \fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}</xsl:text>
-   </xsl:template>
+	</xsl:template>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
-      <desc>
-         <p>LaTeX setup at end of document</p>
-         <p>All the LaTeX setup which are executed at the end of
-    the document</p>
-      </desc>
-   </doc>
-   <xsl:template name="latexEnd">
-</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" class="layout">
+		<desc>
+			<p>LaTeX setup at end of document</p>
+			<p>All the LaTeX setup which are executed at the end of
+				the document</p>
+		</desc>
+	</doc>
+	<xsl:template name="latexEnd">
+	</xsl:template>
 
-   <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] Title banner </desc>
-   </doc>
-   <xsl:template name="printTitleAndLogo">
-\makeatletter
-\noindent\parbox[b]{.75\textwidth}{\fontsize{14pt}{16pt}\bfseries\raggedright\sffamily\selectfont \@title}
-\vskip20pt
-\par\noindent{\fontsize{11pt}{13pt}\sffamily\itshape\raggedright\selectfont\@author\hfill\TheDate}
-\vspace{18pt}
-\makeatother
-</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[latex] Title banner </desc>
+	</doc>
+	<xsl:template name="printTitleAndLogo">
+		\makeatletter
+		\noindent\parbox[b]{.75\textwidth}{\fontsize{14pt}{16pt}\bfseries\raggedright\sffamily\selectfont
+		\@title}
+		\vskip20pt
+		\par\noindent{\fontsize{11pt}{13pt}\sffamily\itshape\raggedright\selectfont\@author\hfill\TheDate}
+		\vspace{18pt}
+		\makeatother
+	</xsl:template>
 
-  
 
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tei.xsl	(revision 2397)
@@ -1,172 +1,211 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:s="http://www.ascc.net/xml/schematron"
-		xmlns:xs="http://www.w3.org/2001/XMLSchema"                
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="s xs tei"
-                version="2.0">
-  <xsl:import href="../common2/tei.xsl"/>
-  <xsl:import href="tei-param.xsl"/>
-  <xsl:import href="../common2/verbatim.xsl"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet for making LaTeX output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="s xs tei" version="2.0">
+	<xsl:import href="../common2/tei.xsl" />
+	<xsl:import href="tei-param.xsl" />
+	<xsl:import href="../common2/verbatim.xsl" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet for making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tei.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:output method="text" encoding="utf8"/>
-  <xsl:strip-space elements="*"/>
-  <xsl:preserve-space elements="tei:hi tei:emph tei:foreign tei:p"/>
-  <xsl:include href="core.xsl"/>
-  <xsl:include href="corpus.xsl"/>
-  <xsl:include href="drama.xsl"/>
-  <xsl:include href="figures.xsl"/>
-  <xsl:include href="header.xsl"/>
-  <xsl:include href="linking.xsl"/>
-  <xsl:include href="namesdates.xsl"/>
-  <xsl:include href="tagdocs.xsl"/>
-  <xsl:include href="textstructure.xsl"/>
-  <xsl:include href="transcr.xsl"/>
-  <xsl:include href="verse.xsl"/>
-  <xsl:include href="textcrit.xsl"/>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:param name="startNamespace">\color{red}</xsl:param>
-  <xsl:param name="startElement">{</xsl:param>
-  <xsl:param name="highlightStartElementName">\textcolor{red}{</xsl:param>
-  <xsl:param name="highlightEndElementName">}</xsl:param>
-  <xsl:param name="startElementName">\textbf{</xsl:param>
-  <xsl:param name="startAttribute">{</xsl:param>
-  <xsl:param name="startAttributeValue">{</xsl:param>
-  <xsl:param name="startComment">\begin{it}</xsl:param>
-  <xsl:param name="endElement">}</xsl:param>
-  <xsl:param name="endElementName">}</xsl:param>
-  <xsl:param name="endComment">\end{it}</xsl:param>
-  <xsl:param name="endAttribute">}</xsl:param>
-  <xsl:param name="endAttributeValue">}</xsl:param>
-  <xsl:param name="endNamespace"/>
-  <xsl:param name="spaceCharacter">\hspace*{6pt}</xsl:param>
-  <xsl:variable name="docClass">
-      <xsl:choose>
-         <xsl:when test="/tei:TEI[@rend='letter']">
-            <xsl:text>letter</xsl:text>
-         </xsl:when>
-         <xsl:when test="/tei:TEI[@rend='book']">
-            <xsl:text>book</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>article</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:variable>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements  processing-instruction()[name(.)='tex']</desc>
-   </doc>
-  <xsl:template match="processing-instruction()[name(.)='tex']">
-      <xsl:value-of select="."/>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tei.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:output method="text" encoding="utf8" />
+	<xsl:strip-space elements="*" />
+	<xsl:preserve-space
+		elements="tei:hi tei:emph tei:foreign tei:p" />
+	<xsl:include href="core.xsl" />
+	<xsl:include href="corpus.xsl" />
+	<xsl:include href="drama.xsl" />
+	<xsl:include href="figures.xsl" />
+	<xsl:include href="header.xsl" />
+	<xsl:include href="linking.xsl" />
+	<xsl:include href="namesdates.xsl" />
+	<xsl:include href="tagdocs.xsl" />
+	<xsl:include href="textstructure.xsl" />
+	<xsl:include href="transcr.xsl" />
+	<xsl:include href="verse.xsl" />
+	<xsl:include href="textcrit.xsl" />
 
-  <xsl:template name="verbatim-lineBreak">
-      <xsl:param name="id"/>
-      <xsl:text>\mbox{}\newline 
+	<xsl:param name="startNamespace">
+		\color{red}
+	</xsl:param>
+	<xsl:param name="startElement">
+		{
+	</xsl:param>
+	<xsl:param name="highlightStartElementName">
+		\textcolor{red}{
+	</xsl:param>
+	<xsl:param name="highlightEndElementName">
+		}
+	</xsl:param>
+	<xsl:param name="startElementName">
+		\textbf{
+	</xsl:param>
+	<xsl:param name="startAttribute">
+		{
+	</xsl:param>
+	<xsl:param name="startAttributeValue">
+		{
+	</xsl:param>
+	<xsl:param name="startComment">
+		\begin{it}
+	</xsl:param>
+	<xsl:param name="endElement">
+		}
+	</xsl:param>
+	<xsl:param name="endElementName">
+		}
+	</xsl:param>
+	<xsl:param name="endComment">
+		\end{it}
+	</xsl:param>
+	<xsl:param name="endAttribute">
+		}
+	</xsl:param>
+	<xsl:param name="endAttributeValue">
+		}
+	</xsl:param>
+	<xsl:param name="endNamespace" />
+	<xsl:param name="spaceCharacter">
+		\hspace*{6pt}
+	</xsl:param>
+	<xsl:variable name="docClass">
+		<xsl:choose>
+			<xsl:when test="/tei:TEI[@rend='letter']">
+				<xsl:text>letter</xsl:text>
+			</xsl:when>
+			<xsl:when test="/tei:TEI[@rend='book']">
+				<xsl:text>book</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>article</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements processing-instruction()[name(.)='tex']</desc>
+	</doc>
+	<xsl:template
+		match="processing-instruction()[name(.)='tex']">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template name="verbatim-lineBreak">
+		<xsl:param name="id" />
+		<xsl:text>\mbox{}\newline 
 </xsl:text>
-  </xsl:template>
+	</xsl:template>
 
-  <xsl:template name="verbatim-createElement">
-      <xsl:param name="name"/>
-      <xsl:param name="special"/>
-      <xsl:text>\textbf{</xsl:text>
-      <xsl:value-of select="$name"/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
+	<xsl:template name="verbatim-createElement">
+		<xsl:param name="name" />
+		<xsl:param name="special" />
+		<xsl:text>\textbf{</xsl:text>
+		<xsl:value-of select="$name" />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-  <xsl:template name="verbatim-newLine"/>
+	<xsl:template name="verbatim-newLine" />
 
-  <xsl:template name="verbatim-createAttribute">
-      <xsl:param name="name"/>
-      <xsl:value-of select="$name"/>
-  </xsl:template>
+	<xsl:template name="verbatim-createAttribute">
+		<xsl:param name="name" />
+		<xsl:value-of select="$name" />
+	</xsl:template>
 
-  <xsl:template name="verbatim-Text">
-      <xsl:param name="words"/>
-      <xsl:choose>
-         <xsl:when test="parent::*/@xml:lang='zh-TW'">
-	           <xsl:text>{\textChinese </xsl:text>
-		   <xsl:value-of select="tei:escapeCharsVerbatim($words)"/>
-	           <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:when test="parent::*/@xml:lang='ja'">
-	           <xsl:text>{\textJapanese </xsl:text>
-		   <xsl:value-of select="tei:escapeCharsVerbatim($words)"/>
-	           <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:when test="parent::*/@xml:lang='kr'">
-	           <xsl:text>{\textKorean </xsl:text>
-		   <xsl:value-of select="tei:escapeCharsVerbatim($words)"/>
-	           <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-	   <xsl:value-of select="tei:escapeCharsVerbatim($words)"/>
-         </xsl:otherwise>
-      </xsl:choose>
+	<xsl:template name="verbatim-Text">
+		<xsl:param name="words" />
+		<xsl:choose>
+			<xsl:when test="parent::*/@xml:lang='zh-TW'">
+				<xsl:text>{\textChinese </xsl:text>
+				<xsl:value-of select="tei:escapeCharsVerbatim($words)" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="parent::*/@xml:lang='ja'">
+				<xsl:text>{\textJapanese </xsl:text>
+				<xsl:value-of select="tei:escapeCharsVerbatim($words)" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="parent::*/@xml:lang='kr'">
+				<xsl:text>{\textKorean </xsl:text>
+				<xsl:value-of select="tei:escapeCharsVerbatim($words)" />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="tei:escapeCharsVerbatim($words)" />
+			</xsl:otherwise>
+		</xsl:choose>
 
-  </xsl:template>
+	</xsl:template>
 
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc><p>We need the backslash and two curly braces to insert LaTeX
-      commands into the output, so these characters need to replaced when they
-      are found in running text. </p></desc>
-  </doc>
-  <xsl:function name="tei:escapeCharsVerbatim" as="xs:string">
-    <xsl:param name="letters"/>
-    <xsl:value-of select="translate($letters, '\{}','⃥❴❵')"/>
-  </xsl:function>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>We need the backslash and two curly braces to insert LaTeX
+				commands into the output, so these characters need to replaced when
+				they
+				are found in running text.
+			</p>
+		</desc>
+	</doc>
+	<xsl:function name="tei:escapeCharsVerbatim"
+		as="xs:string">
+		<xsl:param name="letters" />
+		<xsl:value-of select="translate($letters, '\{}','⃥❴❵')" />
+	</xsl:function>
 
-  <xsl:function name="tei:escapeChars" as="xs:string">
-    <xsl:param name="letters"/>
-      <xsl:value-of
-	  select="replace(replace(replace(replace(translate($letters,'&#10;',' '), 
+	<xsl:function name="tei:escapeChars" as="xs:string">
+		<xsl:param name="letters" />
+		<xsl:value-of
+			select="replace(replace(replace(replace(translate($letters,'&#10;',' '), 
 		  '\\','\\textbackslash '),
 		  '\{','\\{'),
 		  '\}','\\}'),
-		  '~','\\textasciitilde ')"/>
-  </xsl:function>
+		  '~','\\textasciitilde ')" />
+	</xsl:function>
 
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/drama.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/drama.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/drama.xsl	(revision 2397)
@@ -1,193 +1,203 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the drama module,
-      making LaTeX output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the drama module,
+				making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element actor</desc>
-   </doc>
-  <xsl:template match="tei:actor">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element camera</desc>
-   </doc>
-  <xsl:template match="tei:camera">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element caption</desc>
-   </doc>
-  <xsl:template match="tei:caption">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element castGroup</desc>
-   </doc>
-  <xsl:template match="tei:castGroup"> 
-      <xsl:text>\begin{itemize} </xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>&#10;\end{itemize}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element castItem</desc>
-   </doc>
-  <xsl:template match="tei:castItem">
-    <xsl:text>&#10;\item </xsl:text>
-    <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element castList</desc>
-   </doc>
-  <xsl:template match="tei:castList">
-      <xsl:if test="tei:head">
-         <xsl:text> \par\textit{</xsl:text>
-         <xsl:for-each select="tei:head">
-            <xsl:apply-templates/>
-         </xsl:for-each>
-         <xsl:text>}&#10;</xsl:text>
-      </xsl:if> 
-      <xsl:text>\begin{itemize} </xsl:text>
-      <xsl:apply-templates/> 
-      <xsl:text>\end{itemize} </xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elementp/tei:stage</desc>
-   </doc>
-  <xsl:template match="tei:p/tei:stage">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element role</desc>
-   </doc>
-  <xsl:template match="tei:role">
-      <xsl:text>\textbf{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element roleDesc</desc>
-   </doc>
-  <xsl:template match="tei:roleDesc">
-      <xsl:text>\begin{quote}</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>\end{quote}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element set</desc>
-   </doc>
-  <xsl:template match="tei:set">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element sound</desc>
-   </doc>
-  <xsl:template match="tei:sound">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element sp</desc>
-   </doc>
-  <xsl:template match="tei:sp"> \begin{description} \item[<xsl:apply-templates select="tei:speaker"/>] <xsl:apply-templates select="tei:p | tei:l | tei:lg | tei:seg |      tei:ab | tei:stage"/>
-      <xsl:text>\end{description}
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
+
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element actor</desc>
+	</doc>
+	<xsl:template match="tei:actor">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element camera</desc>
+	</doc>
+	<xsl:template match="tei:camera">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element caption</desc>
+	</doc>
+	<xsl:template match="tei:caption">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element castGroup</desc>
+	</doc>
+	<xsl:template match="tei:castGroup">
+		<xsl:text>\begin{itemize} </xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>&#10;\end{itemize}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element castItem</desc>
+	</doc>
+	<xsl:template match="tei:castItem">
+		<xsl:text>&#10;\item </xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element castList</desc>
+	</doc>
+	<xsl:template match="tei:castList">
+		<xsl:if test="tei:head">
+			<xsl:text> \par\textit{</xsl:text>
+			<xsl:for-each select="tei:head">
+				<xsl:apply-templates />
+			</xsl:for-each>
+			<xsl:text>}&#10;</xsl:text>
+		</xsl:if>
+		<xsl:text>\begin{itemize} </xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>\end{itemize} </xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elementp/tei:stage</desc>
+	</doc>
+	<xsl:template match="tei:p/tei:stage">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element role</desc>
+	</doc>
+	<xsl:template match="tei:role">
+		<xsl:text>\textbf{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element roleDesc</desc>
+	</doc>
+	<xsl:template match="tei:roleDesc">
+		<xsl:text>\begin{quote}</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>\end{quote}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element set</desc>
+	</doc>
+	<xsl:template match="tei:set">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element sound</desc>
+	</doc>
+	<xsl:template match="tei:sound">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element sp</desc>
+	</doc>
+	<xsl:template match="tei:sp">
+		\begin{description} \item[
+		<xsl:apply-templates select="tei:speaker" />
+		]
+		<xsl:apply-templates
+			select="tei:p | tei:l | tei:lg | tei:seg |      tei:ab | tei:stage" />
+		<xsl:text>\end{description}
 </xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element sp/tei:p</desc>
-   </doc>
-  <xsl:template match="tei:sp/tei:p">
-    <xsl:text>&#10;&#10;</xsl:text>
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element stage</desc>
-   </doc>
-  <xsl:template match="tei:stage">
-      <xsl:text>&#10;\par&#10;</xsl:text>
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}\par </xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element sp/tei:stage</desc>
-   </doc>
-  <xsl:template match="tei:sp/tei:stage">
-      <xsl:text/>
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>} </xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element tech</desc>
-   </doc>
-  <xsl:template match="tei:tech">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element view</desc>
-   </doc>
-  <xsl:template match="tei:view">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element sp/tei:p</desc>
+	</doc>
+	<xsl:template match="tei:sp/tei:p">
+		<xsl:text>&#10;&#10;</xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element stage</desc>
+	</doc>
+	<xsl:template match="tei:stage">
+		<xsl:text>&#10;\par&#10;</xsl:text>
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}\par </xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element sp/tei:stage</desc>
+	</doc>
+	<xsl:template match="tei:sp/tei:stage">
+		<xsl:text />
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>} </xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element tech</desc>
+	</doc>
+	<xsl:template match="tei:tech">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element view</desc>
+	</doc>
+	<xsl:template match="tei:view">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/figures.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/figures.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/figures.xsl	(revision 2397)
@@ -1,412 +1,499 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the figures module,
-      making LaTeX output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the figures module,
+				making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: figures.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element cell</desc>
-   </doc>
-  <xsl:template match="tei:cell">
-      <xsl:if test="preceding-sibling::tei:cell">\tabcellsep </xsl:if>
-      <xsl:choose>
-         <xsl:when test="@role='label'">
-            <xsl:text>\Panel{</xsl:text>
-            <xsl:if test="starts-with(normalize-space(.),'[')">
-               <xsl:text>{}</xsl:text>
-            </xsl:if>
-            <xsl:apply-templates/>
-            <xsl:text>}{label}{</xsl:text>
-            <xsl:choose>
-               <xsl:when test="@cols">
-                  <xsl:value-of select="@cols"/>
-               </xsl:when>
-               <xsl:otherwise>1</xsl:otherwise>
-            </xsl:choose>
-            <xsl:text>}{</xsl:text>
-            <xsl:choose>
-               <xsl:when test="@align='right'">r</xsl:when>
-               <xsl:when test="@align='centre'">c</xsl:when>
-               <xsl:when test="@align='center'">c</xsl:when>
-               <xsl:when test="@align='left'">l</xsl:when>
-               <xsl:otherwise>l</xsl:otherwise>
-            </xsl:choose>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:when test="@cols &gt; 1">
-            <xsl:text>\multicolumn{</xsl:text>
-            <xsl:value-of select="@cols"/>
-            <xsl:text>}{</xsl:text>
-	    <xsl:if test="@role='label' or
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: figures.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element cell</desc>
+	</doc>
+	<xsl:template match="tei:cell">
+		<xsl:if test="preceding-sibling::tei:cell">
+			\tabcellsep
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@role='label'">
+				<xsl:text>\Panel{</xsl:text>
+				<xsl:if test="starts-with(normalize-space(.),'[')">
+					<xsl:text>{}</xsl:text>
+				</xsl:if>
+				<xsl:apply-templates />
+				<xsl:text>}{label}{</xsl:text>
+				<xsl:choose>
+					<xsl:when test="@cols">
+						<xsl:value-of select="@cols" />
+					</xsl:when>
+					<xsl:otherwise>
+						1
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:text>}{</xsl:text>
+				<xsl:choose>
+					<xsl:when test="@align='right'">
+						r
+					</xsl:when>
+					<xsl:when test="@align='centre'">
+						c
+					</xsl:when>
+					<xsl:when test="@align='center'">
+						c
+					</xsl:when>
+					<xsl:when test="@align='left'">
+						l
+					</xsl:when>
+					<xsl:otherwise>
+						l
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="@cols &gt; 1">
+				<xsl:text>\multicolumn{</xsl:text>
+				<xsl:value-of select="@cols" />
+				<xsl:text>}{</xsl:text>
+				<xsl:if
+					test="@role='label' or
 			  parent::tei:row/@role='label'">
-	      <xsl:text>){\columncolor{label}}</xsl:text>
-	    </xsl:if>
-            <xsl:choose>
-               <xsl:when test="@align='right'">r</xsl:when>
-               <xsl:when test="@align='centre'">c</xsl:when>
-               <xsl:when test="@align='center'">c</xsl:when>
-               <xsl:when test="@align='left'">l</xsl:when>
-               <xsl:otherwise>l</xsl:otherwise>
-            </xsl:choose>
-	    <xsl:text>}{</xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-	 <xsl:when test="@align">
-            <xsl:text>\multicolumn{1}{</xsl:text>
-	    <xsl:if test="@role='label' or
+					<xsl:text>){\columncolor{label}}</xsl:text>
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="@align='right'">
+						r
+					</xsl:when>
+					<xsl:when test="@align='centre'">
+						c
+					</xsl:when>
+					<xsl:when test="@align='center'">
+						c
+					</xsl:when>
+					<xsl:when test="@align='left'">
+						l
+					</xsl:when>
+					<xsl:otherwise>
+						l
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:text>}{</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="@align">
+				<xsl:text>\multicolumn{1}{</xsl:text>
+				<xsl:if
+					test="@role='label' or
 			  parent::tei:row/@role='label'">
-	      <xsl:text>){\columncolor{label}}</xsl:text>
-	    </xsl:if>
-            <xsl:choose>
-               <xsl:when test="@align='right'">r</xsl:when>
-               <xsl:when test="@align='centre'">c</xsl:when>
-               <xsl:when test="@align='center'">c</xsl:when>
-               <xsl:when test="@align='left'">l</xsl:when>
-               <xsl:otherwise>l</xsl:otherwise>
-            </xsl:choose>
-	    <xsl:text>}{</xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>}</xsl:text>
-	 </xsl:when>
-         <xsl:otherwise>
-            <xsl:if test="starts-with(normalize-space(.),'[')">
-               <xsl:text>{}</xsl:text>
-            </xsl:if>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element figDesc</desc>
-   </doc>
-  <xsl:template match="tei:figDesc"/>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element figure</desc>
-   </doc>
-  <xsl:template match="tei:figure">
-      <xsl:call-template name="makeFigureStart"/>
-      <xsl:apply-templates/>
-      <xsl:call-template name="makeFigureEnd"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element graphic</desc>
-   </doc>
-  <xsl:template match="tei:graphic">
-      <xsl:call-template name="makePic"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element row</desc>
-   </doc>
-  <xsl:template match="tei:row">
-      <xsl:if test="@role='label'">\rowcolor{label}</xsl:if>
-      <xsl:apply-templates/>
-      <xsl:if test="following-sibling::tei:row">
-         <xsl:text>\\</xsl:text>
-         <xsl:if test="@role='label' or parent::tei:table/@rend='rules'">\hline </xsl:if>
-         <xsl:text>&#10;</xsl:text>
-      </xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element table</desc>
-   </doc>
-  <xsl:template match="tei:table" mode="xref">
-      <xsl:text>the table on p. \pageref{</xsl:text>
-      <xsl:value-of select="@xml:id"/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element table</desc>
-   </doc>
-  <xsl:template match="tei:table">
-      <xsl:if test="@xml:id">
-         <xsl:text>\label{</xsl:text>
-         <xsl:value-of select="@xml:id"/>
-         <xsl:text>}</xsl:text>
-      </xsl:if>
-      <xsl:text> \par </xsl:text>
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:table"> 
-	           <xsl:text>\begin{tabular}</xsl:text>
-	           <xsl:call-template name="makeTable"/> 
-	           <xsl:text>\end{tabular}</xsl:text>
-         </xsl:when>
-         <xsl:otherwise> 
-	           <xsl:text>&#10;\begin{longtable}</xsl:text>
-	           <xsl:call-template name="makeTable"/>
-	           <xsl:text>\end{longtable} \par&#10; </xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element table[@rend='display']</desc>
-   </doc>
-  <xsl:template match="tei:table[@rend='display']" mode="xref">
-      <xsl:text>Table </xsl:text>
-      <xsl:number count="tei:table[@rend='display']" level="any"/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element table[@rend='display']</desc>
-   </doc>
-  <xsl:template match="tei:table[@rend='display']">
-      <xsl:text>\begin{table}</xsl:text>
-      <xsl:text>\begin{center} \begin{small} \begin{tabular}</xsl:text>
-      <xsl:call-template name="makeTable"/> 
-     <xsl:text>\end{tabular} 
+					<xsl:text>){\columncolor{label}}</xsl:text>
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="@align='right'">
+						r
+					</xsl:when>
+					<xsl:when test="@align='centre'">
+						c
+					</xsl:when>
+					<xsl:when test="@align='center'">
+						c
+					</xsl:when>
+					<xsl:when test="@align='left'">
+						l
+					</xsl:when>
+					<xsl:otherwise>
+						l
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:text>}{</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="starts-with(normalize-space(.),'[')">
+					<xsl:text>{}</xsl:text>
+				</xsl:if>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element figDesc</desc>
+	</doc>
+	<xsl:template match="tei:figDesc" />
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element figure</desc>
+	</doc>
+	<xsl:template match="tei:figure">
+		<xsl:call-template name="makeFigureStart" />
+		<xsl:apply-templates />
+		<xsl:call-template name="makeFigureEnd" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element graphic</desc>
+	</doc>
+	<xsl:template match="tei:graphic">
+		<xsl:call-template name="makePic" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element row</desc>
+	</doc>
+	<xsl:template match="tei:row">
+		<xsl:if test="@role='label'">
+			\rowcolor{label}
+		</xsl:if>
+		<xsl:apply-templates />
+		<xsl:if test="following-sibling::tei:row">
+			<xsl:text>\\</xsl:text>
+			<xsl:if
+				test="@role='label' or parent::tei:table/@rend='rules'">
+				\hline
+			</xsl:if>
+			<xsl:text>&#10;</xsl:text>
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element table</desc>
+	</doc>
+	<xsl:template match="tei:table" mode="xref">
+		<xsl:text>the table on p. \pageref{</xsl:text>
+		<xsl:value-of select="@xml:id" />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element table</desc>
+	</doc>
+	<xsl:template match="tei:table">
+		<xsl:if test="@xml:id">
+			<xsl:text>\label{</xsl:text>
+			<xsl:value-of select="@xml:id" />
+			<xsl:text>}</xsl:text>
+		</xsl:if>
+		<xsl:text> \par </xsl:text>
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:table">
+				<xsl:text>\begin{tabular}</xsl:text>
+				<xsl:call-template name="makeTable" />
+				<xsl:text>\end{tabular}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>&#10;\begin{longtable}</xsl:text>
+				<xsl:call-template name="makeTable" />
+				<xsl:text>\end{longtable} \par&#10; </xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element table[@rend='display']</desc>
+	</doc>
+	<xsl:template match="tei:table[@rend='display']"
+		mode="xref">
+		<xsl:text>Table </xsl:text>
+		<xsl:number count="tei:table[@rend='display']" level="any" />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element table[@rend='display']</desc>
+	</doc>
+	<xsl:template match="tei:table[@rend='display']">
+		<xsl:text>\begin{table}</xsl:text>
+		<xsl:text>\begin{center} \begin{small} \begin{tabular}</xsl:text>
+		<xsl:call-template name="makeTable" />
+		<xsl:text>\end{tabular} 
       \caption{</xsl:text>
-      <xsl:if test="@xml:id">\label{<xsl:value-of select="@xml:id"/>}</xsl:if>
-      <xsl:apply-templates mode="ok" select="tei:head"/>
-      <xsl:text>}
+		<xsl:if test="@xml:id">
+			\label{
+			<xsl:value-of select="@xml:id" />
+			}
+		</xsl:if>
+		<xsl:apply-templates mode="ok" select="tei:head" />
+		<xsl:text>}
      \end{small} 
      \end{center}
      \end{table}</xsl:text>
-     </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] Make figure (start)</desc>
-   </doc>
-  <xsl:template name="makeFigureStart">
-      <xsl:choose>
-	<xsl:when test="@place='inline' and tei:head">
-            <xsl:text>\begin{figure}[H]&#10;</xsl:text>
-	</xsl:when>
-	<xsl:when test="@rend='display' or not(@place='inline') or tei:head or tei:p">
-	  <xsl:text>\begin{figure}[htbp]&#10;</xsl:text>
-	</xsl:when>
-      </xsl:choose>
-      <xsl:choose>
-	<xsl:when test="@rend='center'">
-	  <xsl:text>\begin{center}</xsl:text>
-	</xsl:when>
-	<xsl:otherwise>\noindent</xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] Make figure (end)</desc>
-   </doc>
-  <xsl:template name="makeFigureEnd">
-      <xsl:choose>
-         <xsl:when test="tei:head or tei:p">
-            <xsl:text>&#10;\caption{</xsl:text>
-            <xsl:if test="@xml:id">\label{<xsl:value-of select="@xml:id"/>}</xsl:if>
-            <xsl:for-each select="tei:head">
-	      <xsl:apply-templates/>
-	    </xsl:for-each>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-      </xsl:choose>
-      <xsl:if test="@rend='center'">
-            <xsl:text>\end{center}</xsl:text>
-      </xsl:if>
-      <xsl:choose>
-	<xsl:when test="@place='inline' and tei:head">
-            <xsl:text>\end{figure}&#10;</xsl:text>
-	</xsl:when>
-         <xsl:when test="@rend='display' or not(@place='inline')">
-	   <xsl:text>\end{figure}&#10;</xsl:text>
-         </xsl:when>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] Make picture</desc>
-   </doc>
-  <xsl:template name="makePic">
-      <xsl:if test="@xml:id">\hypertarget{<xsl:value-of
-      select="@xml:id"/>}{}</xsl:if>
-      <xsl:choose>
-	<xsl:when test="@rend='noindent'">
-	  <xsl:text>\noindent</xsl:text>
-	</xsl:when>
-	<xsl:when test="not(preceding-sibling::*)">
-	  <xsl:text>\noindent</xsl:text>
-	</xsl:when>
-      </xsl:choose>
-      <xsl:text>\includegraphics[</xsl:text>
-      <xsl:call-template name="graphicsAttributes">
-         <xsl:with-param name="mode">latex</xsl:with-param>
-      </xsl:call-template>
-      <xsl:text>]{</xsl:text>
-      <xsl:choose>
-         <xsl:when test="$realFigures='true'">
-            <xsl:choose>
-               <xsl:when test="@url">
-                  <xsl:value-of select="@url"/>
-               </xsl:when>
-               <xsl:when test="@entity">
-                  <xsl:value-of select="unparsed-entity-uri(@entity)"/>
-               </xsl:when>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="c">
-               <xsl:for-each select="ancestor-or-self::tei:figure[1]">
-                  <xsl:number level="any"/>
-               </xsl:for-each>
-            </xsl:variable>
-            <xsl:text>FIG</xsl:text>
-            <xsl:value-of select="$c+1000"/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] </desc>
-   </doc>
-  <xsl:template name="makeTable">
-      <xsl:variable name="r">
-         <xsl:value-of select="@rend"/>
-      </xsl:variable>
-      <xsl:text>{</xsl:text>
-      <xsl:if test="contains($r,'rules')">|</xsl:if>
-      <xsl:choose>
-         <xsl:when test="@preamble">
-            <xsl:value-of select="@preamble"/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:call-template name="makePreamble-complex">
-               <xsl:with-param name="r" select="$r"/>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>}&#10;</xsl:text>
-      <xsl:if test="contains($r,'rules') or tei:head">
-	<xsl:call-template name="tableHline"/>
-      </xsl:if>
-      <xsl:choose>
-         <xsl:when test="tei:head and not(@rend='display')">
-            <xsl:if test="not(ancestor::tei:table)">
-               <xsl:text>\endfirsthead </xsl:text>
-               <xsl:text>\multicolumn{</xsl:text>
-               <xsl:value-of select="count(tei:row[1]/tei:cell)"/>
-               <xsl:text>}{c}{</xsl:text>
-               <xsl:apply-templates mode="ok" select="tei:head"/>
-               <xsl:text>(cont.)}\\\hline \endhead </xsl:text>
-            </xsl:if>
-            <xsl:text>\caption{</xsl:text>
-            <xsl:apply-templates mode="ok" select="tei:head"/>
-            <xsl:text>}\\ </xsl:text>
-         </xsl:when>
-         <xsl:otherwise> </xsl:otherwise>
-      </xsl:choose>
-      <xsl:if test="contains($r,'rules') or tei:row[1][@role='label']">\hline </xsl:if>
-      <xsl:apply-templates/>
-      <xsl:if test="contains($r,'rules')">
-         <xsl:text>\\ \hline </xsl:text>
-      </xsl:if>
-  </xsl:template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[latex] Make figure (start)</desc>
+	</doc>
+	<xsl:template name="makeFigureStart">
+		<xsl:choose>
+			<xsl:when test="@place='inline' and tei:head">
+				<xsl:text>\begin{figure}[H]&#10;</xsl:text>
+			</xsl:when>
+			<xsl:when
+				test="@rend='display' or not(@place='inline') or tei:head or tei:p">
+				<xsl:text>\begin{figure}[htbp]&#10;</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:choose>
+			<xsl:when test="@rend='center'">
+				<xsl:text>\begin{center}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				\noindent
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[latex] Make figure (end)</desc>
+	</doc>
+	<xsl:template name="makeFigureEnd">
+		<xsl:choose>
+			<xsl:when test="tei:head or tei:p">
+				<xsl:text>&#10;\caption{</xsl:text>
+				<xsl:if test="@xml:id">
+					\label{
+					<xsl:value-of select="@xml:id" />
+					}
+				</xsl:if>
+				<xsl:for-each select="tei:head">
+					<xsl:apply-templates />
+				</xsl:for-each>
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:if test="@rend='center'">
+			<xsl:text>\end{center}</xsl:text>
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@place='inline' and tei:head">
+				<xsl:text>\end{figure}&#10;</xsl:text>
+			</xsl:when>
+			<xsl:when test="@rend='display' or not(@place='inline')">
+				<xsl:text>\end{figure}&#10;</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[latex] Make picture</desc>
+	</doc>
+	<xsl:template name="makePic">
+		<xsl:if test="@xml:id">
+			\hypertarget{
+			<xsl:value-of select="@xml:id" />
+			}{}
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@rend='noindent'">
+				<xsl:text>\noindent</xsl:text>
+			</xsl:when>
+			<xsl:when test="not(preceding-sibling::*)">
+				<xsl:text>\noindent</xsl:text>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:text>\includegraphics[</xsl:text>
+		<xsl:call-template name="graphicsAttributes">
+			<xsl:with-param name="mode">
+				latex
+			</xsl:with-param>
+		</xsl:call-template>
+		<xsl:text>]{</xsl:text>
+		<xsl:choose>
+			<xsl:when test="$realFigures='true'">
+				<xsl:choose>
+					<xsl:when test="@url">
+						<xsl:value-of select="@url" />
+					</xsl:when>
+					<xsl:when test="@entity">
+						<xsl:value-of select="unparsed-entity-uri(@entity)" />
+					</xsl:when>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="c">
+					<xsl:for-each select="ancestor-or-self::tei:figure[1]">
+						<xsl:number level="any" />
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:text>FIG</xsl:text>
+				<xsl:value-of select="$c+1000" />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>}</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[latex] </desc>
+	</doc>
+	<xsl:template name="makeTable">
+		<xsl:variable name="r">
+			<xsl:value-of select="@rend" />
+		</xsl:variable>
+		<xsl:text>{</xsl:text>
+		<xsl:if test="contains($r,'rules')">
+			|
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="@preamble">
+				<xsl:value-of select="@preamble" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="makePreamble-complex">
+					<xsl:with-param name="r" select="$r" />
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>}&#10;</xsl:text>
+		<xsl:if test="contains($r,'rules') or tei:head">
+			<xsl:call-template name="tableHline" />
+		</xsl:if>
+		<xsl:choose>
+			<xsl:when test="tei:head and not(@rend='display')">
+				<xsl:if test="not(ancestor::tei:table)">
+					<xsl:text>\endfirsthead </xsl:text>
+					<xsl:text>\multicolumn{</xsl:text>
+					<xsl:value-of select="count(tei:row[1]/tei:cell)" />
+					<xsl:text>}{c}{</xsl:text>
+					<xsl:apply-templates mode="ok"
+						select="tei:head" />
+					<xsl:text>(cont.)}\\\hline \endhead </xsl:text>
+				</xsl:if>
+				<xsl:text>\caption{</xsl:text>
+				<xsl:apply-templates mode="ok" select="tei:head" />
+				<xsl:text>}\\ </xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if
+			test="contains($r,'rules') or tei:row[1][@role='label']">
+			\hline
+		</xsl:if>
+		<xsl:apply-templates />
+		<xsl:if test="contains($r,'rules')">
+			<xsl:text>\\ \hline </xsl:text>
+		</xsl:if>
+	</xsl:template>
 
-   <xsl:template name="tableHline">
-      <xsl:choose>
-         <xsl:when test="ancestor::tei:table or @rend='display'"> \hline </xsl:when>
-         <xsl:otherwise> \hline\endfoot\hline\endlastfoot </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template name="tableHline">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:table or @rend='display'">
+				\hline
+			</xsl:when>
+			<xsl:otherwise>
+				\hline\endfoot\hline\endlastfoot
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] </desc>
-   </doc>
-  <xsl:template name="makePreamble-complex">
-      <xsl:param name="r"/>
-      <xsl:variable name="valign">
-         <xsl:choose>
-	   <xsl:when test="contains($r,'bottomAlign')">B</xsl:when>
-	   <xsl:when test="contains($r,'midAlign')">M</xsl:when>
-	   <xsl:otherwise>P</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="tds">
-	<xsl:for-each select="tei:row">
-	  <xsl:variable name="row">
-	    <xsl:for-each select="tei:cell">
-	      <xsl:variable name="stuff">
-		<xsl:apply-templates/>
-	      </xsl:variable>
-	      <cell>
-		<xsl:value-of select="string-length($stuff)"/>
-	      </cell>
-	      <xsl:if test="@cols">
-		<xsl:variable name="c" select="xs:integer(@cols) - 1 "/>
-		<xsl:for-each select="1 to $c">
-		  <cell>0</cell>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[latex] </desc>
+	</doc>
+	<xsl:template name="makePreamble-complex">
+		<xsl:param name="r" />
+		<xsl:variable name="valign">
+			<xsl:choose>
+				<xsl:when test="contains($r,'bottomAlign')">
+					B
+				</xsl:when>
+				<xsl:when test="contains($r,'midAlign')">
+					M
+				</xsl:when>
+				<xsl:otherwise>
+					P
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="tds">
+			<xsl:for-each select="tei:row">
+				<xsl:variable name="row">
+					<xsl:for-each select="tei:cell">
+						<xsl:variable name="stuff">
+							<xsl:apply-templates />
+						</xsl:variable>
+						<cell>
+							<xsl:value-of select="string-length($stuff)" />
+						</cell>
+						<xsl:if test="@cols">
+							<xsl:variable name="c"
+								select="xs:integer(@cols) - 1 " />
+							<xsl:for-each select="1 to $c">
+								<cell>0</cell>
+							</xsl:for-each>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:for-each select="$row/cell">
+					<cell col="{position()}">
+						<xsl:value-of select="." />
+					</cell>
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:variable>
+		<xsl:variable name="total">
+			<xsl:value-of select="sum($tds/cell)" />
+		</xsl:variable>
+		<xsl:for-each select="$tds/cell">
+			<xsl:variable name="c" select="@col" />
+			<xsl:if test="not(preceding-sibling::cell[$c=@col])">
+				<xsl:variable name="len">
+					<xsl:value-of
+						select="sum(following-sibling::cell[$c=@col]) + current()" />
+				</xsl:variable>
+				<xsl:value-of select="$valign" />
+				<xsl:text>{</xsl:text>
+				<xsl:value-of
+					select="($len div $total) * $tableMaxWidth" />
+				<xsl:text>\textwidth}</xsl:text>
+				<xsl:if test="contains($r,'rules')">
+					|
+				</xsl:if>
+			</xsl:if>
 		</xsl:for-each>
-	      </xsl:if>
-	    </xsl:for-each>
-	  </xsl:variable>
-	  <xsl:for-each select="$row/cell">
-	    <cell col="{position()}">
-	      <xsl:value-of select="."/>
-	    </cell>
-	  </xsl:for-each>
-	</xsl:for-each>
-      </xsl:variable>
-      <xsl:variable name="total">
-	<xsl:value-of select="sum($tds/cell)"/>
-      </xsl:variable>
-      <xsl:for-each select="$tds/cell">
-	<xsl:variable name="c" select="@col"/>
-	<xsl:if test="not(preceding-sibling::cell[$c=@col])">
-	  <xsl:variable name="len">
-	    <xsl:value-of select="sum(following-sibling::cell[$c=@col]) + current()"/>
-	  </xsl:variable>
-	  <xsl:value-of select="$valign"/>
-	  <xsl:text>{</xsl:text>
-	  <xsl:value-of select="($len div $total) * $tableMaxWidth"/>
-	  <xsl:text>\textwidth}</xsl:text>
-	  <xsl:if test="contains($r,'rules')">|</xsl:if>
-	</xsl:if>
-      </xsl:for-each>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] </desc>
-   </doc>
-  <xsl:template name="makePreamble-simple">
-      <xsl:param name="r"/>
-      <xsl:for-each select="tei:row[1]/tei:cell">
-         <xsl:text>l</xsl:text>
-         <xsl:if test="contains($r,'rules')">|</xsl:if>
-      </xsl:for-each>
-  </xsl:template>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[latex] </desc>
+	</doc>
+	<xsl:template name="makePreamble-simple">
+		<xsl:param name="r" />
+		<xsl:for-each select="tei:row[1]/tei:cell">
+			<xsl:text>l</xsl:text>
+			<xsl:if test="contains($r,'rules')">
+				|
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/namesdates.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/namesdates.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/namesdates.xsl	(revision 2397)
@@ -1,65 +1,71 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the namesdates module,
-      making LaTeX output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the namesdates module,
+				making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: namesdates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:listPerson">
-    \begin{enumerate}
-      <xsl:apply-templates/>
-      \end{enumerate}
-  </xsl:template>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <xsl:template match="tei:person">
-    \item <xsl:apply-templates/>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <xsl:template match="tei:affiliation">
-      <xsl:text>\mbox{}\\ </xsl:text>
-      <xsl:apply-templates/>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: namesdates.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:listPerson">
+		\begin{enumerate}
+		<xsl:apply-templates />
+		\end{enumerate}
+	</xsl:template>
+
+	<xsl:template match="tei:person">
+		\item
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="tei:affiliation">
+		<xsl:text>\mbox{}\\ </xsl:text>
+		<xsl:apply-templates />
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tagdocs.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tagdocs.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/tagdocs.xsl	(revision 2397)
@@ -1,360 +1,384 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:s="http://www.ascc.net/xml/schematron"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="s a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet dealing with elements from the tagdocs module,
-      making LaTeX output. </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="s a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet dealing with elements from the tagdocs module,
+				making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				All rights reserved.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: tagdocs.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element gi</desc>
-   </doc>
-  <xsl:template match="tei:gi">
-      <xsl:text>\texttt{&lt;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>&gt;}</xsl:text>
-  </xsl:template>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element val</desc>
-   </doc>
-  <xsl:template match="tei:val">
-      <xsl:value-of select="$preQuote"/>
-      <xsl:apply-templates/>
-      <xsl:value-of select="$postQuote"/>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: tagdocs.xsl 10197 2012-03-28 21:44:10Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process element att</desc>
-   </doc>
-  <xsl:template match="tei:att">
-      <xsl:text>\textbf{@</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element gi</desc>
+	</doc>
+	<xsl:template match="tei:gi">
+		<xsl:text>\texttt{&lt;</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>&gt;}</xsl:text>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Example element</desc>
-   </doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element val</desc>
+	</doc>
+	<xsl:template match="tei:val">
+		<xsl:value-of select="$preQuote" />
+		<xsl:apply-templates />
+		<xsl:value-of select="$postQuote" />
+	</xsl:template>
 
-  <xsl:template match="teix:egXML">
-      <xsl:param name="simple">false</xsl:param>
-      <xsl:param name="highlight"/>
-      <xsl:choose>
-         <xsl:when test="parent::tei:cell">
-	           <xsl:text>\leavevmode\bgroup</xsl:text>
-	           <xsl:call-template name="egXMLStartHook"/>
-	           <xsl:call-template name="exampleFontSet"/>
-	           <xsl:text>\begin{shaded}</xsl:text>
-	           <xsl:apply-templates mode="verbatim">
-	              <xsl:with-param name="highlight">
-	                 <xsl:value-of select="$highlight"/>
-	              </xsl:with-param>
-	           </xsl:apply-templates>
-	           <xsl:text>\end{shaded}</xsl:text>
-	           <xsl:call-template name="egXMLEndHook"/>
-	           <xsl:text>\egroup &#10;&#10;</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-	           <xsl:text>\par\bgroup</xsl:text>
-	           <xsl:call-template name="egXMLStartHook"/>
-	           <xsl:call-template name="exampleFontSet"/>
-	           <xsl:text>\begin{shaded}\noindent\mbox{}</xsl:text>
-	           <xsl:apply-templates mode="verbatim">
-	              <xsl:with-param name="highlight">
-	                 <xsl:value-of select="$highlight"/>
-	              </xsl:with-param>
-	           </xsl:apply-templates>
-	           <xsl:text>\end{shaded}</xsl:text>
-	           <xsl:call-template name="egXMLEndHook"/>
-	           <xsl:text>\egroup\par </xsl:text>
-	           <xsl:if test="parent::tei:p and following-sibling::node()">\noindent </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process element att</desc>
+	</doc>
+	<xsl:template match="tei:att">
+		<xsl:text>\textbf{@</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Example element</desc>
+	</doc>
 
-   <xsl:template name="egXMLStartHook"/>
-   <xsl:template name="egXMLEndHook"/>
+	<xsl:template match="teix:egXML">
+		<xsl:param name="simple">
+			false
+		</xsl:param>
+		<xsl:param name="highlight" />
+		<xsl:choose>
+			<xsl:when test="parent::tei:cell">
+				<xsl:text>\leavevmode\bgroup</xsl:text>
+				<xsl:call-template name="egXMLStartHook" />
+				<xsl:call-template name="exampleFontSet" />
+				<xsl:text>\begin{shaded}</xsl:text>
+				<xsl:apply-templates mode="verbatim">
+					<xsl:with-param name="highlight">
+						<xsl:value-of select="$highlight" />
+					</xsl:with-param>
+				</xsl:apply-templates>
+				<xsl:text>\end{shaded}</xsl:text>
+				<xsl:call-template name="egXMLEndHook" />
+				<xsl:text>\egroup &#10;&#10;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\par\bgroup</xsl:text>
+				<xsl:call-template name="egXMLStartHook" />
+				<xsl:call-template name="exampleFontSet" />
+				<xsl:text>\begin{shaded}\noindent\mbox{}</xsl:text>
+				<xsl:apply-templates mode="verbatim">
+					<xsl:with-param name="highlight">
+						<xsl:value-of select="$highlight" />
+					</xsl:with-param>
+				</xsl:apply-templates>
+				<xsl:text>\end{shaded}</xsl:text>
+				<xsl:call-template name="egXMLEndHook" />
+				<xsl:text>\egroup\par </xsl:text>
+				<xsl:if test="parent::tei:p and following-sibling::node()">
+					\noindent
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:seg[@rend='specChildren']">
-      <xsl:choose>
-         <xsl:when test=".//tei:seg[@rend='specChildModule']">
-            <xsl:text>\hfil\\[-10pt]\begin{sansreflist}</xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>\end{sansreflist}</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
 
-   <!--
-<xsl:template match="tei:seg[@rend='specChildren']">
-<xsl:text>\mbox{ }\\ \begin{description}</xsl:text>
-<xsl:apply-templates/>
-<xsl:text>\end{description}</xsl:text>
-</xsl:template>
--->
-<xsl:template match="tei:term">
-      <xsl:text>\emph{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-   </xsl:template>
+	<xsl:template name="egXMLStartHook" />
+	<xsl:template name="egXMLEndHook" />
 
-   <xsl:template match="tei:seg[@xml:lang]">
-      <xsl:choose>
-         <xsl:when test="@xml:lang='zh-TW'">
-            <xsl:text>{\textChinese </xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:when test="@xml:lang='ja'">
-            <xsl:text>{\textJapanese </xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>}</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="tei:seg[@rend='specChildren']">
+		<xsl:choose>
+			<xsl:when test=".//tei:seg[@rend='specChildModule']">
+				<xsl:text>\hfil\\[-10pt]\begin{sansreflist}</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>\end{sansreflist}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:seg[@rend='specChild']">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<!-- <xsl:template match="tei:seg[@rend='specChildren']"> <xsl:text>\mbox{ 
+		}\\ \begin{description}</xsl:text> <xsl:apply-templates/> <xsl:text>\end{description}</xsl:text> 
+		</xsl:template> -->
+	<xsl:template match="tei:term">
+		<xsl:text>\emph{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-   <xsl:template match="tei:seg[@rend='specChildModule']">
-    \item[<xsl:apply-templates/>]
-   </xsl:template>
+	<xsl:template match="tei:seg[@xml:lang]">
+		<xsl:choose>
+			<xsl:when test="@xml:lang='zh-TW'">
+				<xsl:text>{\textChinese </xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:when test="@xml:lang='ja'">
+				<xsl:text>{\textJapanese </xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:seg[@rend='specChildElements']">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:seg[@rend='specChild']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:seg[@rend='parent']">
-      <xsl:choose>
-         <xsl:when test="*">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>—</xsl:text>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="tei:seg[@rend='specChildModule']">
+		\item[
+		<xsl:apply-templates />
+		]
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='parent']">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:seg[@rend='specChildElements']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='showmembers1']">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:seg[@rend='parent']">
+		<xsl:choose>
+			<xsl:when test="*">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>—</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='showmembers2']">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:hi[@rend='parent']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='showmembers3']">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:hi[@rend='showmembers1']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='showmembers4']">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:hi[@rend='showmembers2']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:table[@rend='wovenodd' or @rend='attDef']">
-      <xsl:text>
+	<xsl:template match="tei:hi[@rend='showmembers3']">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="tei:hi[@rend='showmembers4']">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template
+		match="tei:table[@rend='wovenodd' or @rend='attDef']">
+		<xsl:text>
 \begin{reflist}</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>
 \end{reflist}  </xsl:text>
-   </xsl:template>
+	</xsl:template>
 
-   <xsl:template match="tei:table[@rend='valList'       or @rend='attList'       or @rend='specDesc']">
-      <xsl:text>\hfil\\[-10pt]\begin{sansreflist}</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>
+	<xsl:template
+		match="tei:table[@rend='valList'       or @rend='attList'       or @rend='specDesc']">
+		<xsl:text>\hfil\\[-10pt]\begin{sansreflist}</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>
 \end{sansreflist}  </xsl:text>
-   </xsl:template>
+	</xsl:template>
 
-   <xsl:template match="tei:table[@rend='wovenodd'      or @rend='attList'      or @rend='valList'      or @rend='attDef'      or @rend='specDesc']/tei:row">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template
+		match="tei:table[@rend='wovenodd'      or @rend='attList'      or @rend='valList'      or @rend='attDef'      or @rend='specDesc']/tei:row">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:table[@rend='wovenodd'       or @rend='attList'       or @rend='specDesc'       or @rend='valList'       or @rend='attDef']/tei:row/tei:cell[1]">
-      <xsl:choose>
-         <xsl:when test="parent::tei:row/parent::tei:table[@rend='attList']">
-    \item[@<xsl:apply-templates/>]
-  </xsl:when>
-         <xsl:when test="ancestor::tei:table[@rend='valList']">
-    \item[<xsl:apply-templates/>]
-  </xsl:when>
-         <xsl:when test="ancestor::tei:table[@rend='specDesc']">
-    \item[@<xsl:apply-templates/>]
-  </xsl:when>
-         <xsl:when test="@cols='2' and not(parent::tei:row/preceding-sibling::tei:row)">
-            <xsl:text>
+	<xsl:template
+		match="tei:table[@rend='wovenodd'       or @rend='attList'       or @rend='specDesc'       or @rend='valList'       or @rend='attDef']/tei:row/tei:cell[1]">
+		<xsl:choose>
+			<xsl:when
+				test="parent::tei:row/parent::tei:table[@rend='attList']">
+				\item[@
+				<xsl:apply-templates />
+				]
+			</xsl:when>
+			<xsl:when test="ancestor::tei:table[@rend='valList']">
+				\item[
+				<xsl:apply-templates />
+				]
+			</xsl:when>
+			<xsl:when test="ancestor::tei:table[@rend='specDesc']">
+				\item[@
+				<xsl:apply-templates />
+				]
+			</xsl:when>
+			<xsl:when
+				test="@cols='2' and not(parent::tei:row/preceding-sibling::tei:row)">
+				<xsl:text>
 \item[]\begin{specHead}{</xsl:text>
-            <xsl:value-of select="ancestor::tei:div[1]/@xml:id"/>
-            <xsl:text>}</xsl:text>
-            <xsl:apply-templates/>
-            <xsl:text>\end{specHead} </xsl:text>
-         </xsl:when>
-         <xsl:when test="@cols='2'">
-    \item[]<xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-    \item[<xsl:apply-templates/>]
-  </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+				<xsl:value-of select="ancestor::tei:div[1]/@xml:id" />
+				<xsl:text>}</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>\end{specHead} </xsl:text>
+			</xsl:when>
+			<xsl:when test="@cols='2'">
+				\item[]
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				\item[
+				<xsl:apply-templates />
+				]
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="tei:div[@type='refdoc']/tei:head"/>
+	<xsl:template match="tei:div[@type='refdoc']/tei:head" />
 
-   <xsl:template match="tei:div[@type='refdoc']">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="tei:div[@type='refdoc']">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="tei:table[@rend='wovenodd'        or @rend='attList'        or @rend='valList'        or @rend='specDesc'        or @rend='attDef']/tei:row/tei:cell[2]">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template
+		match="tei:table[@rend='wovenodd'        or @rend='attList'        or @rend='valList'        or @rend='specDesc'        or @rend='attDef']/tei:row/tei:cell[2]">
+		<xsl:apply-templates />
+	</xsl:template>
 
 
-   <xsl:template match="tei:list[@rend='specList']">
-\begin{sansreflist}
-  <xsl:apply-templates/>
-\end{sansreflist}
-</xsl:template>
+	<xsl:template match="tei:list[@rend='specList']">
+		\begin{sansreflist}
+		<xsl:apply-templates />
+		\end{sansreflist}
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='specList-elementSpec']">
-      <xsl:text>[\textbf{&lt;</xsl:text>
-      <xsl:value-of select="."/>
-      <xsl:text>&gt;}]</xsl:text>
-   </xsl:template>
+	<xsl:template match="tei:hi[@rend='specList-elementSpec']">
+		<xsl:text>[\textbf{&lt;</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>&gt;}]</xsl:text>
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='specList-macroSpec']">
-      <xsl:text>[\textbf{</xsl:text>
-      <xsl:value-of select="."/>
-      <xsl:text>}]</xsl:text>
-   </xsl:template>
+	<xsl:template match="tei:hi[@rend='specList-macroSpec']">
+		<xsl:text>[\textbf{</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>}]</xsl:text>
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='specList-classSpec']">
-      <xsl:text>[\textbf{</xsl:text>
-      <xsl:value-of select="."/>
-      <xsl:text>}]</xsl:text>
-   </xsl:template>
+	<xsl:template match="tei:hi[@rend='specList-classSpec']">
+		<xsl:text>[\textbf{</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>}]</xsl:text>
+	</xsl:template>
 
-   <xsl:template match="tei:hi[@rend='label'  or @rend='defaultVal']">
-      <xsl:text>{</xsl:text>
-      <xsl:choose>
-         <xsl:when test="@xml:lang='zh-TW'">
-            <xsl:text>\textChinese </xsl:text>
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="@xml:lang='ja'">
-            <xsl:text>\textJapanese </xsl:text>
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:apply-templates/>
-         </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>}</xsl:text>
-   </xsl:template>
+	<xsl:template
+		match="tei:hi[@rend='label'  or @rend='defaultVal']">
+		<xsl:text>{</xsl:text>
+		<xsl:choose>
+			<xsl:when test="@xml:lang='zh-TW'">
+				<xsl:text>\textChinese </xsl:text>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="@xml:lang='ja'">
+				<xsl:text>\textJapanese </xsl:text>
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
 
-   <xsl:template match="tei:hi[@rend='attribute']">
-      <xsl:text>\textit{</xsl:text>
-      <xsl:value-of select="."/>
-      <xsl:text>}</xsl:text>
-   </xsl:template>
+	<xsl:template match="tei:hi[@rend='attribute']">
+		<xsl:text>\textit{</xsl:text>
+		<xsl:value-of select="." />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
-   <xsl:template name="specHook">
-      <xsl:param name="name"/>
-   </xsl:template>
+	<xsl:template name="specHook">
+		<xsl:param name="name" />
+	</xsl:template>
 
 
-   <xsl:template match="tei:index[@indexName='ODDS']">
-      <xsl:for-each select="tei:term">
-         <xsl:text>\index{</xsl:text>
-         <xsl:choose>
-            <xsl:when test="@sortKey">
-	              <xsl:value-of select="@sortKey"/>
-	              <xsl:text>=</xsl:text>
-	              <xsl:value-of select="."/>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:value-of select="."/>
-            </xsl:otherwise>
-         </xsl:choose>
-         <xsl:text>|oddindex</xsl:text>
-         <xsl:text>}</xsl:text>
-      </xsl:for-each>
-      <xsl:for-each select="tei:index/tei:term">
-         <xsl:text>\index{</xsl:text>
-         <xsl:choose>
-            <xsl:when test="@sortKey">
-	              <xsl:value-of select="@sortKey"/>
-	              <xsl:text>=</xsl:text>
-	              <xsl:value-of select="."/>
-            </xsl:when>
-            <xsl:otherwise>
-	              <xsl:value-of select="."/>
-            </xsl:otherwise>
-         </xsl:choose>
-         <xsl:text>!</xsl:text>
-         <xsl:value-of select="../../tei:term"/>
-         <xsl:text>|oddindex</xsl:text>
-         <xsl:text>}</xsl:text>
-      </xsl:for-each>
+	<xsl:template match="tei:index[@indexName='ODDS']">
+		<xsl:for-each select="tei:term">
+			<xsl:text>\index{</xsl:text>
+			<xsl:choose>
+				<xsl:when test="@sortKey">
+					<xsl:value-of select="@sortKey" />
+					<xsl:text>=</xsl:text>
+					<xsl:value-of select="." />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>|oddindex</xsl:text>
+			<xsl:text>}</xsl:text>
+		</xsl:for-each>
+		<xsl:for-each select="tei:index/tei:term">
+			<xsl:text>\index{</xsl:text>
+			<xsl:choose>
+				<xsl:when test="@sortKey">
+					<xsl:value-of select="@sortKey" />
+					<xsl:text>=</xsl:text>
+					<xsl:value-of select="." />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="." />
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>!</xsl:text>
+			<xsl:value-of select="../../tei:term" />
+			<xsl:text>|oddindex</xsl:text>
+			<xsl:text>}</xsl:text>
+		</xsl:for-each>
 
-   </xsl:template>
+	</xsl:template>
 
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/verse.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/verse.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/verse.xsl	(revision 2397)
@@ -1,67 +1,70 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing  with elements from the
-      verse module, making LaTeX output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				verse module, making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: verse.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process element caesura</p>
-         <p>Caesurae are rendered as a LaTeX \quad{}.</p>
-      </desc>
-   </doc>
-  <xsl:template match="tei:caesura">
-      <xsl:text>\quad{}</xsl:text>
-  </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: verse.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
 
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element caesura</p>
+			<p>Caesurae are rendered as a LaTeX \quad{}.</p>
+		</desc>
+	</doc>
+	<xsl:template match="tei:caesura">
+		<xsl:text>\quad{}</xsl:text>
+	</xsl:template>
 
 
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/textstructure.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/textstructure.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/textstructure.xsl	(revision 2397)
@@ -1,120 +1,123 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet dealing  with elements from the
-    textstructure module, making LaTeX output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet dealing with elements from the
+				textstructure module, making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: textstructure.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process elements  * in inner mode</desc>
-   </doc>
-  <xsl:template match="*" mode="innertext">
-      <xsl:apply-templates select="."/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: textstructure.xsl 10057 2012-01-21 16:57:14Z rahtz $</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process elements * in inner mode</desc>
+	</doc>
+	<xsl:template match="*" mode="innertext">
+		<xsl:apply-templates select="." />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
 
-  <xsl:template match="tei:TEI">
-      <xsl:call-template name="mainDocument"/>
-  </xsl:template>
 
-  <xsl:template name="mainDocument">
-      <xsl:if test="not($realFigures='true')">
-         <xsl:text>%BEGINFIGMAP</xsl:text>
-         <xsl:if test="not($latexLogo='')">
-	   <xsl:text>&#10;%FIGMAP </xsl:text>
-	   <xsl:value-of select="$latexLogo"/>
-	   <xsl:text> FIG0 </xsl:text>
-         </xsl:if>
-         <xsl:for-each select="//tei:figure">
-	   <xsl:variable name="c">
-	     <xsl:number level="any"/>
-	   </xsl:variable>
-	   <xsl:text>&#10;%FIGMAP </xsl:text>
-	   <xsl:variable name="f">
-	     <xsl:choose>
-	       <xsl:when test="@url">
-		 <xsl:value-of select="@url"/>
-	       </xsl:when>
-	       <xsl:when test="@entity">
-		 <xsl:value-of select="unparsed-entity-uri(@entity)"/>
-	       </xsl:when>
-	       <xsl:when test="tei:graphic">
-		 <xsl:value-of select="tei:graphic/@url"/>
-	       </xsl:when>
-	     </xsl:choose>
-	   </xsl:variable>
-	   <xsl:choose>
-	     <xsl:when test="contains($f,'.')">
-	       <xsl:value-of select="$f"/>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <xsl:value-of select="concat($f,'.png')"/>
-	     </xsl:otherwise>
-	   </xsl:choose>
-	   <xsl:text> FIG</xsl:text>
-	   <xsl:value-of select="$c + 1000"/>
-	   <xsl:text>&#10;</xsl:text>
-         </xsl:for-each>
-         <xsl:text>&#10;%ENDFIGMAP&#10;</xsl:text>
-      </xsl:if>
-      <xsl:text>\documentclass[</xsl:text>
-      <xsl:value-of select="$classParameters"/>
-      <xsl:text>]{</xsl:text>
-      <xsl:value-of select="$docClass"/>
-      <xsl:text>}</xsl:text>
-      <xsl:text>\makeatletter&#10;</xsl:text>
-      <xsl:call-template name="latexSetup"/>
-      <xsl:call-template name="latexPackages"/>
-      <xsl:call-template name="latexLayout"/>
-      <xsl:text>&#10;\@ifundefined{chapter}{%
+	<xsl:template match="tei:TEI">
+		<xsl:call-template name="mainDocument" />
+	</xsl:template>
+
+	<xsl:template name="mainDocument">
+		<xsl:if test="not($realFigures='true')">
+			<xsl:text>%BEGINFIGMAP</xsl:text>
+			<xsl:if test="not($latexLogo='')">
+				<xsl:text>&#10;%FIGMAP </xsl:text>
+				<xsl:value-of select="$latexLogo" />
+				<xsl:text> FIG0 </xsl:text>
+			</xsl:if>
+			<xsl:for-each select="//tei:figure">
+				<xsl:variable name="c">
+					<xsl:number level="any" />
+				</xsl:variable>
+				<xsl:text>&#10;%FIGMAP </xsl:text>
+				<xsl:variable name="f">
+					<xsl:choose>
+						<xsl:when test="@url">
+							<xsl:value-of select="@url" />
+						</xsl:when>
+						<xsl:when test="@entity">
+							<xsl:value-of select="unparsed-entity-uri(@entity)" />
+						</xsl:when>
+						<xsl:when test="tei:graphic">
+							<xsl:value-of select="tei:graphic/@url" />
+						</xsl:when>
+					</xsl:choose>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="contains($f,'.')">
+						<xsl:value-of select="$f" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="concat($f,'.png')" />
+					</xsl:otherwise>
+				</xsl:choose>
+				<xsl:text> FIG</xsl:text>
+				<xsl:value-of select="$c + 1000" />
+				<xsl:text>&#10;</xsl:text>
+			</xsl:for-each>
+			<xsl:text>&#10;%ENDFIGMAP&#10;</xsl:text>
+		</xsl:if>
+		<xsl:text>\documentclass[</xsl:text>
+		<xsl:value-of select="$classParameters" />
+		<xsl:text>]{</xsl:text>
+		<xsl:value-of select="$docClass" />
+		<xsl:text>}</xsl:text>
+		<xsl:text>\makeatletter&#10;</xsl:text>
+		<xsl:call-template name="latexSetup" />
+		<xsl:call-template name="latexPackages" />
+		<xsl:call-template name="latexLayout" />
+		<xsl:text>&#10;\@ifundefined{chapter}{%
     \def\DivI{\section}
     \def\DivII{\subsection}
     \def\DivIII{\subsubsection}
@@ -138,256 +141,272 @@
     \def\DivVStar[#1]#2{\paragraph*{#2}}
 }
 \def\TheFullDate{</xsl:text>
-      <xsl:call-template name="generateDate"/>
-      <xsl:variable name="revdate">
-         <xsl:call-template name="generateRevDate"/>
-      </xsl:variable>
-      <xsl:if test="not($revdate='')">
-         <xsl:text> (</xsl:text>
-         <xsl:call-template name="i18n">
-            <xsl:with-param name="word">revisedWord</xsl:with-param>
-         </xsl:call-template>
-	 <xsl:text>: </xsl:text>
-	 <xsl:value-of select="$revdate"/>
-         <xsl:text>)</xsl:text>
-      </xsl:if>
-      <xsl:text>}&#10;\def\TheID{</xsl:text>
-      <xsl:choose>
-         <xsl:when test="not($REQUEST='')">
-            <xsl:value-of select="not($REQUEST='')"/>
-         </xsl:when>
-         <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno">
-            <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno[1]"/>
-         </xsl:when>
-      </xsl:choose>
-      <xsl:text>\makeatother </xsl:text>
-      <xsl:text>}&#10;\def\TheDate{</xsl:text>
-      <xsl:call-template name="generateDate"/>
-      <xsl:text>}&#10;\title{</xsl:text>
-      <xsl:call-template name="generateTitle"/>
-      <xsl:text>}&#10;\author{</xsl:text>
-      <xsl:call-template name="generateAuthor"/>
-      <xsl:text>}</xsl:text>
-      <xsl:text disable-output-escaping="yes">\let\tabcellsep&amp;
+		<xsl:call-template name="generateDate" />
+		<xsl:variable name="revdate">
+			<xsl:call-template name="generateRevDate" />
+		</xsl:variable>
+		<xsl:if test="not($revdate='')">
+			<xsl:text> (</xsl:text>
+			<xsl:call-template name="i18n">
+				<xsl:with-param name="word">
+					revisedWord
+				</xsl:with-param>
+			</xsl:call-template>
+			<xsl:text>: </xsl:text>
+			<xsl:value-of select="$revdate" />
+			<xsl:text>)</xsl:text>
+		</xsl:if>
+		<xsl:text>}&#10;\def\TheID{</xsl:text>
+		<xsl:choose>
+			<xsl:when test="not($REQUEST='')">
+				<xsl:value-of select="not($REQUEST='')" />
+			</xsl:when>
+			<xsl:when
+				test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno">
+				<xsl:value-of
+					select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno[1]" />
+			</xsl:when>
+		</xsl:choose>
+		<xsl:text>\makeatother </xsl:text>
+		<xsl:text>}&#10;\def\TheDate{</xsl:text>
+		<xsl:call-template name="generateDate" />
+		<xsl:text>}&#10;\title{</xsl:text>
+		<xsl:call-template name="generateTitle" />
+		<xsl:text>}&#10;\author{</xsl:text>
+		<xsl:call-template name="generateAuthor" />
+		<xsl:text>}</xsl:text>
+		<xsl:text disable-output-escaping="yes">\let\tabcellsep&amp;
       \catcode`\&amp;=12\relax </xsl:text>
-      <xsl:text>\makeatletter </xsl:text>
-      <xsl:call-template name="latexBegin"/>
-      <xsl:text>\makeatother </xsl:text>
-      <xsl:text>&#10;\begin{document}&#10;</xsl:text>
-      <xsl:if test="not(tei:text/tei:front/tei:titlePage)">
-         <xsl:call-template name="printTitleAndLogo"/>
-      </xsl:if>
-      <xsl:call-template name="beginDocumentHook"/>
-      <!-- certainly don't touch the next few lines -->
-      <xsl:text>&#10;\catcode`\$=12\relax&#10;</xsl:text>
-      <xsl:text>\catcode`\^=12\relax&#10;</xsl:text>
-      <xsl:text>\catcode`\#=12\relax&#10;</xsl:text>
-      <xsl:text>\catcode`\%=12\relax&#10;</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:call-template name="latexEnd"/>
-      <xsl:if test="key('ENDNOTES',1)">
-	<xsl:text>&#10;\theendnotes</xsl:text>
-      </xsl:if>
-      <xsl:text>&#10;\end{document}&#10;</xsl:text>
-   </xsl:template>
+		<xsl:text>\makeatletter </xsl:text>
+		<xsl:call-template name="latexBegin" />
+		<xsl:text>\makeatother </xsl:text>
+		<xsl:text>&#10;\begin{document}&#10;</xsl:text>
+		<xsl:if test="not(tei:text/tei:front/tei:titlePage)">
+			<xsl:call-template name="printTitleAndLogo" />
+		</xsl:if>
+		<xsl:call-template name="beginDocumentHook" />
+		<!-- certainly don't touch the next few lines -->
+		<xsl:text>&#10;\catcode`\$=12\relax&#10;</xsl:text>
+		<xsl:text>\catcode`\^=12\relax&#10;</xsl:text>
+		<xsl:text>\catcode`\#=12\relax&#10;</xsl:text>
+		<xsl:text>\catcode`\%=12\relax&#10;</xsl:text>
+		<xsl:apply-templates />
+		<xsl:call-template name="latexEnd" />
+		<xsl:if test="key('ENDNOTES',1)">
+			<xsl:text>&#10;\theendnotes</xsl:text>
+		</xsl:if>
+		<xsl:text>&#10;\end{document}&#10;</xsl:text>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Processing teiHeader elements</desc>
-   </doc>
-   <xsl:template match="tei:teiHeader"/>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Processing teiHeader elements</desc>
+	</doc>
+	<xsl:template match="tei:teiHeader" />
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:back">
-      <xsl:if test="not(preceding::tei:back)">
-         <xsl:text>\backmatter </xsl:text>
-      </xsl:if>
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:body">
-      <xsl:if test="not(ancestor::tei:floatingText) and not(preceding::tei:body) and preceding::tei:front">
-         <xsl:text>\mainmatter </xsl:text>
-      </xsl:if>
-      <xsl:if test="count(key('APP',1))&gt;0">
-\beginnumbering
-</xsl:if>
-      <xsl:apply-templates/>
-      <xsl:if test="count(key('APP',1))&gt;0">
-\endnumbering
-</xsl:if>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:body|tei:back|tei:front" mode="innertext">
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:closer">
-    <xsl:text>&#10;\begin{quote}</xsl:text>
-    <xsl:apply-templates/>
-    <xsl:text>\end{quote}&#10;</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:dateline">
-    <xsl:text>\rightline{</xsl:text>
-    <xsl:apply-templates/>
-    <xsl:text>}&#10;</xsl:text>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Process the tei:div elements</desc>
-   </doc>
-  <xsl:template match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
-    <xsl:apply-templates/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:back">
+		<xsl:if test="not(preceding::tei:back)">
+			<xsl:text>\backmatter </xsl:text>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:body">
+		<xsl:if
+			test="not(ancestor::tei:floatingText) and not(preceding::tei:body) and preceding::tei:front">
+			<xsl:text>\mainmatter </xsl:text>
+		</xsl:if>
+		<xsl:if test="count(key('APP',1))&gt;0">
+			\beginnumbering
+		</xsl:if>
+		<xsl:apply-templates />
+		<xsl:if test="count(key('APP',1))&gt;0">
+			\endnumbering
+		</xsl:if>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:body|tei:back|tei:front"
+		mode="innertext">
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:closer">
+		<xsl:text>&#10;\begin{quote}</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>\end{quote}&#10;</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:dateline">
+		<xsl:text>\rightline{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}&#10;</xsl:text>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Process the tei:div elements</desc>
+	</doc>
+	<xsl:template
+		match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>Table of contents</desc>
-   </doc>
-   <xsl:template match="tei:divGen[@type='toc']">
-     \tableofcontents
-   </xsl:template>
-   
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-    <desc>Bibliography</desc>
-  </doc>
-  <xsl:template match="tei:divGen[@type='bibliography']">
-    <xsl:text>&#10;\begin{thebibliography}{1}&#10;</xsl:text>
-    <xsl:call-template name="bibliography"/>
-    <xsl:text>&#10;\end{thebibliography}&#10;</xsl:text>    
-  </xsl:template>
-  
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:front">
-      <xsl:if test="not(preceding::tei:front)">
-         <xsl:text>\frontmatter </xsl:text>
-      </xsl:if>
-      <xsl:apply-templates/>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:opener">
- \begin{quote}<xsl:apply-templates/>\end{quote}
-</xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-    If verseNumbering is requested,
- counts all the verse lines since the last container (<gi xmlns="">div1</gi> by
- default) and labels every fifth verse using a LaTeX box 3 ems wide.
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Table of contents</desc>
+	</doc>
+	<xsl:template match="tei:divGen[@type='toc']">
+		\tableofcontents
+	</xsl:template>
 
-  </desc>
-   </doc>
-  <xsl:template match="tei:l">
-      <xsl:choose>
-         <xsl:when test="$verseNumbering='true'">
-            <xsl:variable name="id" select="generate-id()"/>
-            <xsl:variable name="pos">
-               <xsl:for-each select="ancestor::*[name()=$resetVerseLineNumbering]//l">
-                  <xsl:if test="generate-id()=$id">
-                     <xsl:value-of select="position()"/>
-                  </xsl:if>
-               </xsl:for-each>
-            </xsl:variable>
-            <xsl:choose>
-               <xsl:when test="$pos mod $everyHowManyLines = 0">
-                  <xsl:text>\leftline{\makebox[3em][r]{</xsl:text>
-                  <xsl:value-of select="$pos"/>
-                  <xsl:text>}\quad{}</xsl:text>
-                  <xsl:apply-templates/>
-                  <xsl:text>}</xsl:text> 
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:text>\leftline{\makebox[3em][r]{}\quad{}</xsl:text>
-                  <xsl:apply-templates/>
-                  <xsl:text>}</xsl:text> 
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:when test="ancestor::tei:quote and following-sibling::tei:l">
-            <xsl:apply-templates/>\\
-	 </xsl:when>
-	 <xsl:when test="parent::tei:sp">
-	   <xsl:apply-templates/>
-	   <xsl:text>\hfill\\</xsl:text>
-	 </xsl:when>
-	 <xsl:otherwise>
-	   <xsl:text>\leftline{</xsl:text>
-	   <xsl:apply-templates/>
-	   <xsl:text>}</xsl:text>
-	 </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
-  <xsl:template match="tei:text">
-      <xsl:choose>
-         <xsl:when test="parent::tei:TEI">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:when test="parent::tei:group">
-            <xsl:apply-templates/>
-         </xsl:when>
-         <xsl:otherwise>
-	\par
-	\hrule
-	\begin{quote}
-	\begin{small}
-	<xsl:apply-templates mode="innertext"/>
-	\end{small}
-	\end{quote}
-	\hrule
-	\par
-      </xsl:otherwise>
-      </xsl:choose>
-  </xsl:template>
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc/>
-   </doc>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>Bibliography</desc>
+	</doc>
+	<xsl:template match="tei:divGen[@type='bibliography']">
+		<xsl:text>&#10;\begin{thebibliography}{1}&#10;</xsl:text>
+		<xsl:call-template name="bibliography" />
+		<xsl:text>&#10;\end{thebibliography}&#10;</xsl:text>
+	</xsl:template>
 
-  <xsl:template match="tei:titlePage/tei:docTitle">
-      <xsl:text>\title{</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>}</xsl:text>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:front">
+		<xsl:if test="not(preceding::tei:front)">
+			<xsl:text>\frontmatter </xsl:text>
+		</xsl:if>
+		<xsl:apply-templates />
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:opener">
+		\begin{quote}
+		<xsl:apply-templates />
+		\end{quote}
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			If verseNumbering is requested,
+			counts all the verse lines since the last container (
+			<gi xmlns="">div1</gi>
+			by
+			default) and labels every fifth verse using a LaTeX box 3 ems wide.
 
-  <xsl:template match="tei:titlePage">
-  \begin{titlepage}
-  <xsl:apply-templates select="tei:docTitle|tei:docAuthor"/>
-  \maketitle
-  <xsl:apply-templates select="*[not(self::tei:docTitle) and not(self::tei:docAuthor)]"/>
-  \end{titlepage}
-  \cleardoublepage
-</xsl:template>
+		</desc>
+	</doc>
+	<xsl:template match="tei:l">
+		<xsl:choose>
+			<xsl:when test="$verseNumbering='true'">
+				<xsl:variable name="id" select="generate-id()" />
+				<xsl:variable name="pos">
+					<xsl:for-each
+						select="ancestor::*[name()=$resetVerseLineNumbering]//l">
+						<xsl:if test="generate-id()=$id">
+							<xsl:value-of select="position()" />
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:variable>
+				<xsl:choose>
+					<xsl:when test="$pos mod $everyHowManyLines = 0">
+						<xsl:text>\leftline{\makebox[3em][r]{</xsl:text>
+						<xsl:value-of select="$pos" />
+						<xsl:text>}\quad{}</xsl:text>
+						<xsl:apply-templates />
+						<xsl:text>}</xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text>\leftline{\makebox[3em][r]{}\quad{}</xsl:text>
+						<xsl:apply-templates />
+						<xsl:text>}</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when
+				test="ancestor::tei:quote and following-sibling::tei:l">
+				<xsl:apply-templates />
+				\\
+			</xsl:when>
+			<xsl:when test="parent::tei:sp">
+				<xsl:apply-templates />
+				<xsl:text>\hfill\\</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>\leftline{</xsl:text>
+				<xsl:apply-templates />
+				<xsl:text>}</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
+	<xsl:template match="tei:text">
+		<xsl:choose>
+			<xsl:when test="parent::tei:TEI">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:when test="parent::tei:group">
+				<xsl:apply-templates />
+			</xsl:when>
+			<xsl:otherwise>
+				\par
+				\hrule
+				\begin{quote}
+				\begin{small}
+				<xsl:apply-templates mode="innertext" />
+				\end{small}
+				\end{quote}
+				\hrule
+				\par
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc />
+	</doc>
 
-  <xsl:template match="tei:trailer">
-      <xsl:text>
+	<xsl:template match="tei:titlePage/tei:docTitle">
+		<xsl:text>\title{</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>}</xsl:text>
+	</xsl:template>
 
+	<xsl:template match="tei:titlePage">
+		\begin{titlepage}
+		<xsl:apply-templates
+			select="tei:docTitle|tei:docAuthor" />
+		\maketitle
+		<xsl:apply-templates
+			select="*[not(self::tei:docTitle) and not(self::tei:docAuthor)]" />
+		\end{titlepage}
+		\cleardoublepage
+	</xsl:template>
+
+	<xsl:template match="tei:trailer">
+		<xsl:text>
+
 \begin{raggedleft}</xsl:text>
-      <xsl:apply-templates/>
-      <xsl:text>\end{raggedleft}
+		<xsl:apply-templates />
+		<xsl:text>\end{raggedleft}
 
 </xsl:text>
-   </xsl:template>
+	</xsl:template>
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>[latex] make a bibliography</desc>
-   </doc>
-  <xsl:template name="bibliography">
-      <xsl:apply-templates mode="biblio"
-                           select="//tei:ref[@type='cite'] | //tei:ptr[@type='cite']"/>
-  </xsl:template>
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>[latex] make a bibliography</desc>
+	</doc>
+	<xsl:template name="bibliography">
+		<xsl:apply-templates mode="biblio"
+			select="//tei:ref[@type='cite'] | //tei:ptr[@type='cite']" />
+	</xsl:template>
 
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/textcrit.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/textcrit.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/latex2/textcrit.xsl	(revision 2397)
@@ -1,72 +1,77 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                exclude-result-prefixes="a rng tei teix"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p>
-    TEI stylesheet
-    dealing with elements from the
-      textcrit module, making LaTeX output.
-      </p>
-         <p>This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	exclude-result-prefixes="a rng tei teix" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p>
+				TEI stylesheet
+				dealing with elements from the
+				textcrit module, making LaTeX output.
+			</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Copyright: 2011, TEI Consortium</p>
-      </desc>
-   </doc>
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
 
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
-      <desc>
-         <p>Process element app</p>
-         <p>Process tei:lem and tei:rdg within tei:app; first, first, rudimentary attempt. Sends lots of information
-    to a footnote. If a tei:lem is not found, the first tei:rdg is used as the base text. Witness sigils in attribute
-    wit are assumed all to start with # (this should be parametrized).</p>
-      </desc>
-   </doc>
-   <xsl:template name="appReading">
-     <xsl:param name="lemma"/>
-     <xsl:param name="lemmawitness"/>
-     <xsl:param name="readings"/>
-     <xsl:text>\edtext{</xsl:text>
-     <xsl:value-of select="$lemma"/>
-     <xsl:text>}{\Afootnote{</xsl:text>
-     <xsl:copy-of select="$readings"/>
-     <xsl:text>}}</xsl:text>
-   </xsl:template>
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Copyright: 2011, TEI Consortium</p>
+		</desc>
+	</doc>
+
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+		<desc>
+			<p>Process element app</p>
+			<p>Process tei:lem and tei:rdg within tei:app; first, first,
+				rudimentary attempt. Sends lots of information
+				to a footnote. If a tei:lem is not found, the first tei:rdg is used as
+				the base text. Witness sigils in attribute
+				wit are assumed all to start with # (this should be parametrized).</p>
+		</desc>
+	</doc>
+	<xsl:template name="appReading">
+		<xsl:param name="lemma" />
+		<xsl:param name="lemmawitness" />
+		<xsl:param name="readings" />
+		<xsl:text>\edtext{</xsl:text>
+		<xsl:value-of select="$lemma" />
+		<xsl:text>}{\Afootnote{</xsl:text>
+		<xsl:copy-of select="$readings" />
+		<xsl:text>}}</xsl:text>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/analyze.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/analyze.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/analyze.xsl	(revision 2397)
@@ -1,18 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:XSL="http://www.w3.org/1999/XSL/Transform"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0">
-   <xsl:output indent="yes" omit-xml-declaration="yes" encoding="utf-8"/>
-   <xsl:param name="file"/>
-   <xsl:template match="XSL:stylesheet">
-      <params>
-         <xsl:for-each select="XSL:param">
-            <param file="{$file}" name="{@name}">
-               <xsl:apply-templates/>
-            </param>
-         </xsl:for-each>
-      </params>
-   </xsl:template>
+<xsl:stylesheet
+	xmlns:XSL="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+	<xsl:output indent="yes" omit-xml-declaration="yes"
+		encoding="utf-8" />
+	<xsl:param name="file" />
+	<xsl:template match="XSL:stylesheet">
+		<params>
+			<xsl:for-each select="XSL:param">
+				<param file="{$file}" name="{@name}">
+					<xsl:apply-templates />
+				</param>
+			</xsl:for-each>
+		</params>
+	</xsl:template>
 
 
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checkodd.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checkodd.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checkodd.xsl	(revision 2397)
@@ -1,56 +1,40 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                exclude-result-prefixes="tei xsl rng"
-                version="2.0">
-<!--
-This software is dual-licensed:
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	exclude-result-prefixes="tei xsl rng" version="2.0">
+	<!-- This software is dual-licensed: 1. Distributed under a Creative Commons 
+		Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+		2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution 
+		and use in source and binary forms, with or without modification, are permitted 
+		provided that the following conditions are met: * Redistributions of source 
+		code must retain the above copyright notice, this list of conditions and 
+		the following disclaimer. * Redistributions in binary form must reproduce 
+		the above copyright notice, this list of conditions and the following disclaimer 
+		in the documentation and/or other materials provided with the distribution. 
+		This software is provided by the copyright holders and contributors "as is" 
+		and any express or implied warranties, including, but not limited to, the 
+		implied warranties of merchantability and fitness for a particular purpose 
+		are disclaimed. In no event shall the copyright holder or contributors be 
+		liable for any direct, indirect, incidental, special, exemplary, or consequential 
+		damages (including, but not limited to, procurement of substitute goods or 
+		services; loss of use, data, or profits; or business interruption) however 
+		caused and on any theory of liability, whether in contract, strict liability, 
+		or tort (including negligence or otherwise) arising in any way out of the 
+		use of this software, even if advised of the possibility of such damage. 
+		$Id: checkodd.xsl 9646 2011-11-05 23:39:08Z rahtz $ 2008, TEI Consortium -->
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:output method="text" />
+	<xsl:key name="SPECS" match="tei:*[@ident]" use="@ident" />
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-
-$Id: checkodd.xsl 9646 2011-11-05 23:39:08Z rahtz $
-
-2008, TEI Consortium
--->
-
-<xsl:output method="text"/>
-   <xsl:key name="SPECS" match="tei:*[@ident]" use="@ident"/>
-
-   <xsl:template match="/">
-      <xsl:for-each select="//rng:ref">
-         <xsl:if test="not(key('SPECS',@name))">
-            <xsl:message>No *Spec defined for <xsl:value-of select="@name"/>
-            </xsl:message>
-         </xsl:if>
-      </xsl:for-each>
-   </xsl:template>
+	<xsl:template match="/">
+		<xsl:for-each select="//rng:ref">
+			<xsl:if test="not(key('SPECS',@name))">
+				<xsl:message>
+					No *Spec defined for
+					<xsl:value-of select="@name" />
+				</xsl:message>
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checkxsl.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checkxsl.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checkxsl.xsl	(revision 2397)
@@ -1,67 +1,54 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		version="2.0">
-<!--This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	<!--This software is dual-licensed: 1. Distributed under a Creative Commons 
+		Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+		2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution 
+		and use in source and binary forms, with or without modification, are permitted 
+		provided that the following conditions are met: * Redistributions of source 
+		code must retain the above copyright notice, this list of conditions and 
+		the following disclaimer. * Redistributions in binary form must reproduce 
+		the above copyright notice, this list of conditions and the following disclaimer 
+		in the documentation and/or other materials provided with the distribution. 
+		This software is provided by the copyright holders and contributors "as is" 
+		and any express or implied warranties, including, but not limited to, the 
+		implied warranties of merchantability and fitness for a particular purpose 
+		are disclaimed. In no event shall the copyright holder or contributors be 
+		liable for any direct, indirect, incidental, special, exemplary, or consequential 
+		damages (including, but not limited to, procurement of substitute goods or 
+		services; loss of use, data, or profits; or business interruption) however 
+		caused and on any theory of liability, whether in contract, strict liability, 
+		or tort (including negligence or otherwise) arising in any way out of the 
+		use of this software, even if advised of the possibility of such damage. 
+		$Id: checkxsl.xsl 9646 2011-11-05 23:39:08Z rahtz $ 2008, TEI Consortium -->
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:output method="text" />
+	<xsl:key name="TEMPLATES" match="xsl:template[@name]" use="1" />
+	<xsl:key name="CALLED_TEMPLATES"
+		match="xsl:call-template[@name]" use="@name" />
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<xsl:template match="xsl:stylesheet">
+		<xsl:variable name="all">
+			<xsl:copy-of select="xsl:template" />
+			<xsl:call-template name="inclusions" />
+		</xsl:variable>
+		<xsl:for-each select="$all">
+			<xsl:for-each select="key('TEMPLATES',1)">
+				<xsl:if test="count(key('CALLED_TEMPLATES',@name))=0">
+					Template
+					<xsl:value-of select="@name" />
+					is not used
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-
-$Id: checkxsl.xsl 9646 2011-11-05 23:39:08Z rahtz $
-
-2008, TEI Consortium
--->
-
-<xsl:output method="text"/>
-   <xsl:key name="TEMPLATES" match="xsl:template[@name]" use="1"/>
-   <xsl:key name="CALLED_TEMPLATES" match="xsl:call-template[@name]" use="@name"/>
-
-   <xsl:template match="xsl:stylesheet">
-      <xsl:variable name="all">
-         <xsl:copy-of select="xsl:template"/>
-         <xsl:call-template name="inclusions"/>
-      </xsl:variable>
-      <xsl:for-each select="$all">
-         <xsl:for-each select="key('TEMPLATES',1)">
-            <xsl:if test="count(key('CALLED_TEMPLATES',@name))=0">
-	Template <xsl:value-of select="@name"/> is not used
-      </xsl:if>
-         </xsl:for-each>
-      </xsl:for-each>
-   </xsl:template>
-
-   <xsl:template name="inclusions">
-      <xsl:for-each select="xsl:import|xsl:include">
-         <xsl:for-each select="document(@href)/xsl:stylesheet">
-            <xsl:copy-of select="xsl:template"/>
-            <xsl:call-template name="inclusions"/>
-         </xsl:for-each>
-      </xsl:for-each>
-   </xsl:template>
+	<xsl:template name="inclusions">
+		<xsl:for-each select="xsl:import|xsl:include">
+			<xsl:for-each select="document(@href)/xsl:stylesheet">
+				<xsl:copy-of select="xsl:template" />
+				<xsl:call-template name="inclusions" />
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixdotrels.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixdotrels.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixdotrels.xsl	(revision 2397)
@@ -1,25 +1,25 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet 
-    version="2.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:r="http://schemas.openxmlformats.org/package/2006/relationships"
-    exclude-result-prefixes="r">
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:r="http://schemas.openxmlformats.org/package/2006/relationships"
+	exclude-result-prefixes="r">
 
-  <xsl:output  encoding="UTF-8" standalone="yes" method="xml"/>
+	<xsl:output encoding="UTF-8" standalone="yes" method="xml" />
 
-  <!-- identity transform -->
-  
-  <xsl:template match="@*|text()|comment()|processing-instruction()" >
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="*" >
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" 
-			   />
-    </xsl:copy>
-  </xsl:template>
+	<!-- identity transform -->
 
-  <!-- do not copy custom xml rel -->
-  <xsl:template match="*[@Target='docProps/custom.xml']"/>
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<!-- do not copy custom xml rel -->
+	<xsl:template match="*[@Target='docProps/custom.xml']" />
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixstyle.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixstyle.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixstyle.xsl	(revision 2397)
@@ -1,208 +1,212 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet 
-    version="2.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-    exclude-result-prefixes="w">
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	exclude-result-prefixes="w">
 
-  <xsl:output  encoding="UTF-8" standalone="yes" method="xml"/>
+	<xsl:output encoding="UTF-8" standalone="yes" method="xml" />
 
-  <xsl:template match="/w:styles">
-    <w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-      xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
-      
-      <!-- copy all existing elements -->
-      <xsl:apply-templates/>
-      
-      <!-- create some new styles -->
-      <xsl:call-template name="create-egXML"/>
-      
-    </w:styles>
-  </xsl:template>
+	<xsl:template match="/w:styles">
+		<w:styles
+			xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+			xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
 
-  <!-- identity transform -->
-  
-  <xsl:template match="@*|text()|comment()|processing-instruction()" >
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="*" >
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" 
-			   />
-    </xsl:copy>
-  </xsl:template>
+			<!-- copy all existing elements -->
+			<xsl:apply-templates />
 
-  <xsl:template match="w:style[@w:styleId='Tabletitle']//w:numId">
-    <w:numId w:val="5"/>
-  </xsl:template>
-  
-  <xsl:template match="w:style[@w:styleId='Bibliography']//w:numId">
-    <w:numId w:val="6"/>
-  </xsl:template>
+			<!-- create some new styles -->
+			<xsl:call-template name="create-egXML" />
 
-  <xsl:template match="w:style[@w:styleId='Figuretitle']//w:numId">
-    <w:numId w:val="7"/>
-  </xsl:template>
-  
-  <xsl:template match="w:spacing">
-    <xsl:choose>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading1']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading2']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading3']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading4']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading5']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading6']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading7']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading8']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading9']"/>
-      
-      <xsl:when test="ancestor::w:style[@w:styleId='ANNEX']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='a2']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='a3']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='a4']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='a5']"/>
-      <xsl:when test="ancestor::w:style[@w:styleId='a6']"/>
-      
-      <xsl:otherwise>
-        <w:spacing>
-          <xsl:apply-templates
-              select="*|@*|processing-instruction()|comment()|text()"
-          />
-        </w:spacing>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template match="w:numPr">
-    <xsl:choose>
-      <xsl:when test="ancestor::w:style[@w:styleId='Heading1']">
-        <w:numPr>
-          <w:numId w:val="1"/>
-        </w:numPr>
-      </xsl:when>
-      
-      <xsl:when test="ancestor::w:style[@w:styleId='ANNEX']">
-        <w:numPr>
-          <w:numId w:val="3"/>
-        </w:numPr>
-      </xsl:when>
-      <xsl:when test="ancestor::w:style[@w:styleId='a2']">
-        <w:numPr>
-          <w:ilvl w:val="1"/>
-          <w:numId w:val="3"/>
-        </w:numPr>
-      </xsl:when>
-      <xsl:when test="ancestor::w:style[@w:styleId='a3']">
-        <w:numPr>
-          <w:ilvl w:val="2"/>
-          <w:numId w:val="3"/>
-        </w:numPr>
-      </xsl:when>
-      <xsl:when test="ancestor::w:style[@w:styleId='a4']">
-        <w:numPr>
-          <w:ilvl w:val="3"/>
-          <w:numId w:val="3"/>
-        </w:numPr>
-      </xsl:when>
-      <xsl:when test="ancestor::w:style[@w:styleId='a5']">
-        <w:numPr>
-          <w:ilvl w:val="4"/>
-          <w:numId w:val="3"/>
-        </w:numPr>
-      </xsl:when>
-      <xsl:when test="ancestor::w:style[@w:styleId='a6']">
-        <w:numPr>
-          <w:ilvl w:val="5"/>
-          <w:numId w:val="3"/>
-        </w:numPr>
-      </xsl:when>
-      
-      <xsl:when test="ancestor::w:style[@w:styleId='ListNumber']">
-        <w:numPr>
-          <w:numId w:val="8"/>
-        </w:numPr>
-      </xsl:when>
+		</w:styles>
+	</xsl:template>
 
-      <xsl:when test="ancestor::w:style[@w:styleId='ListNumber1']">
-        <w:numPr>
-          <w:ilvl w:val="1"/>
-          <w:numId w:val="8"/>
-        </w:numPr>
-      </xsl:when>
-      
-      <xsl:when test="ancestor::w:style[@w:styleId='ListNumber2']">
-        <w:numPr>
-          <w:ilvl w:val="2"/>
-          <w:numId w:val="8"/>
-        </w:numPr>
-      </xsl:when>
-      
-      <xsl:when test="ancestor::w:style[@w:styleId='ListNumber3']">
-        <w:numPr>
-          <w:ilvl w:val="3"/>
-          <w:numId w:val="8"/>
-        </w:numPr>
-      </xsl:when>
-      
-      <xsl:when test="ancestor::w:style[@w:styleId='ListNumber4']">
-        <w:numPr>
-          <w:ilvl w:val="4"/>
-          <w:numId w:val="8"/>
-        </w:numPr>
-      </xsl:when>
-      
-      <xsl:when test="ancestor::w:style[@w:styleId='ListNumber5']">
-        <w:numPr>
-          <w:ilvl w:val="5"/>
-          <w:numId w:val="8"/>
-        </w:numPr>
-      </xsl:when>
-      
-      <xsl:when test="ancestor::w:style[@w:styleId='ListBullet']">
-        <w:numPr>
-          <w:numId w:val="9"/>
-        </w:numPr>
-      </xsl:when>
-      
-      
+	<!-- identity transform -->
 
-      <xsl:otherwise>
-      	<w:numPr>
-      	  <xsl:apply-templates
-      	      select="*|@*|processing-instruction()|comment()|text()"
-      	      />
-      	</w:numPr>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <!-- new styles -->
-  <xsl:template name="create-egXML">
-    <w:style w:type="paragraph" w:customStyle="1" w:styleId="egXML">
-      <w:name w:val="egXML"/>
-      <w:basedOn w:val="Normal"/>
-      <w:qFormat/>
-      <w:pPr>
-	<w:jc w:val="left"/>
-      </w:pPr>
-      <w:rPr>
-        <w:rFonts w:ascii="Courier" w:hAnsi="Courier"/>
-        <w:sz w:val="20"/>
-      </w:rPr>
-    </w:style>
-    <w:style w:type="paragraph" w:customStyle="1" w:styleId="egXMLTable">
-      <w:name w:val="egXMLTable"/>
-      <w:basedOn w:val="Normal"/>
-      <w:qFormat/>
-      <w:pPr>
-	<w:spacing w:before="80" w:after="0"/>
-	<w:jc w:val="left"/>
-      </w:pPr>
-      <w:rPr>
-        <w:rFonts w:ascii="Courier" w:hAnsi="Courier"/>
-        <w:sz w:val="18"/>
-      </w:rPr>
-    </w:style>
-  </xsl:template>
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template
+		match="w:style[@w:styleId='Tabletitle']//w:numId">
+		<w:numId w:val="5" />
+	</xsl:template>
+
+	<xsl:template
+		match="w:style[@w:styleId='Bibliography']//w:numId">
+		<w:numId w:val="6" />
+	</xsl:template>
+
+	<xsl:template
+		match="w:style[@w:styleId='Figuretitle']//w:numId">
+		<w:numId w:val="7" />
+	</xsl:template>
+
+	<xsl:template match="w:spacing">
+		<xsl:choose>
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading1']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading2']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading3']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading4']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading5']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading6']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading7']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading8']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading9']" />
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ANNEX']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='a2']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='a3']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='a4']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='a5']" />
+			<xsl:when test="ancestor::w:style[@w:styleId='a6']" />
+
+			<xsl:otherwise>
+				<w:spacing>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</w:spacing>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="w:numPr">
+		<xsl:choose>
+			<xsl:when test="ancestor::w:style[@w:styleId='Heading1']">
+				<w:numPr>
+					<w:numId w:val="1" />
+				</w:numPr>
+			</xsl:when>
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ANNEX']">
+				<w:numPr>
+					<w:numId w:val="3" />
+				</w:numPr>
+			</xsl:when>
+			<xsl:when test="ancestor::w:style[@w:styleId='a2']">
+				<w:numPr>
+					<w:ilvl w:val="1" />
+					<w:numId w:val="3" />
+				</w:numPr>
+			</xsl:when>
+			<xsl:when test="ancestor::w:style[@w:styleId='a3']">
+				<w:numPr>
+					<w:ilvl w:val="2" />
+					<w:numId w:val="3" />
+				</w:numPr>
+			</xsl:when>
+			<xsl:when test="ancestor::w:style[@w:styleId='a4']">
+				<w:numPr>
+					<w:ilvl w:val="3" />
+					<w:numId w:val="3" />
+				</w:numPr>
+			</xsl:when>
+			<xsl:when test="ancestor::w:style[@w:styleId='a5']">
+				<w:numPr>
+					<w:ilvl w:val="4" />
+					<w:numId w:val="3" />
+				</w:numPr>
+			</xsl:when>
+			<xsl:when test="ancestor::w:style[@w:styleId='a6']">
+				<w:numPr>
+					<w:ilvl w:val="5" />
+					<w:numId w:val="3" />
+				</w:numPr>
+			</xsl:when>
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ListNumber']">
+				<w:numPr>
+					<w:numId w:val="8" />
+				</w:numPr>
+			</xsl:when>
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ListNumber1']">
+				<w:numPr>
+					<w:ilvl w:val="1" />
+					<w:numId w:val="8" />
+				</w:numPr>
+			</xsl:when>
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ListNumber2']">
+				<w:numPr>
+					<w:ilvl w:val="2" />
+					<w:numId w:val="8" />
+				</w:numPr>
+			</xsl:when>
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ListNumber3']">
+				<w:numPr>
+					<w:ilvl w:val="3" />
+					<w:numId w:val="8" />
+				</w:numPr>
+			</xsl:when>
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ListNumber4']">
+				<w:numPr>
+					<w:ilvl w:val="4" />
+					<w:numId w:val="8" />
+				</w:numPr>
+			</xsl:when>
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ListNumber5']">
+				<w:numPr>
+					<w:ilvl w:val="5" />
+					<w:numId w:val="8" />
+				</w:numPr>
+			</xsl:when>
+
+			<xsl:when test="ancestor::w:style[@w:styleId='ListBullet']">
+				<w:numPr>
+					<w:numId w:val="9" />
+				</w:numPr>
+			</xsl:when>
+
+
+
+			<xsl:otherwise>
+				<w:numPr>
+					<xsl:apply-templates
+						select="*|@*|processing-instruction()|comment()|text()" />
+				</w:numPr>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<!-- new styles -->
+	<xsl:template name="create-egXML">
+		<w:style w:type="paragraph" w:customStyle="1"
+			w:styleId="egXML">
+			<w:name w:val="egXML" />
+			<w:basedOn w:val="Normal" />
+			<w:qFormat />
+			<w:pPr>
+				<w:jc w:val="left" />
+			</w:pPr>
+			<w:rPr>
+				<w:rFonts w:ascii="Courier" w:hAnsi="Courier" />
+				<w:sz w:val="20" />
+			</w:rPr>
+		</w:style>
+		<w:style w:type="paragraph" w:customStyle="1"
+			w:styleId="egXMLTable">
+			<w:name w:val="egXMLTable" />
+			<w:basedOn w:val="Normal" />
+			<w:qFormat />
+			<w:pPr>
+				<w:spacing w:before="80" w:after="0" />
+				<w:jc w:val="left" />
+			</w:pPr>
+			<w:rPr>
+				<w:rFonts w:ascii="Courier" w:hAnsi="Courier" />
+				<w:sz w:val="18" />
+			</w:rPr>
+		</w:style>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/build.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/build.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/build.xml	(revision 2397)
@@ -1,18 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." name="fix template styles">
 	<!-- ANT script to prepare and clean up a template for the DOCX transformation 
-		to be used for creating a DOCX target file tranformed from a TEI XML document.
-	-->
-  
-  <!-- define the the saxon transformer or place it in the ant lib directory -->
-  <property name = "saxon.jar" value=".../saxon9he.jar"/>
-  
+		to be used for creating a DOCX target file tranformed from a TEI XML document. -->
+
+	<!-- define the the saxon transformer or place it in the ant lib directory -->
+	<property name="saxon.jar" value=".../saxon9he.jar" />
+
 	<!-- modfiy basedir, if necessary: -Dbasedir=... -->
-	<echo>     basedir: ${basedir}</echo>
-	
+	<echo> basedir: ${basedir}</echo>
+
 	<!-- profile, may be overwritten by external property: -Dprofile=default -->
-	<property name="profile" value="default"/>
-    
+	<property name="profile" value="default" />
+
 	<!-- the profiles directory, may be overwritten by: -DprofilesDir=... -->
 	<property name="profilesDir">../../profiles/</property>
 	<echo> profilesDir: ${profilesDir}</echo>
@@ -22,23 +21,24 @@
 
 	<!-- the source file, may be overwritten by: -DsourceFile=... -->
 	<property name="sourceFile">${sourceDir}template_original.docx</property>
-	<echo>  sourceFile: ${sourceFile}</echo>
-  
-	<!-- the target directory, may be overwritten by: -DtargetDir=... 
-			The target directory is also used as a base for a temporary workind directory. -->
+	<echo> sourceFile: ${sourceFile}</echo>
+
+	<!-- the target directory, may be overwritten by: -DtargetDir=... The target 
+		directory is also used as a base for a temporary workind directory. -->
 	<property name="targetDir">${profilesDir}${profile}/docx/</property>
-  
+
 	<!-- the target file, may be overwritten by: -DtargetFile=... -->
 	<property name="targetFile">${targetDir}template.docx</property>
-	<echo>  targetFile: ${targetFile}</echo>
-	
+	<echo> targetFile: ${targetFile}</echo>
+
 	<!-- remove the target file -->
 	<delete file="${targetFile}" />
-	
+
 	<!-- create the working directory and unzip the source file -->
 	<property name="temp">${targetDir}temp/</property>
-	<mkdir dir="${temp}"/>
-	<unzip src="${sourceFile}" dest="${temp}" failOnEmptyArchive="true" />
+	<mkdir dir="${temp}" />
+	<unzip src="${sourceFile}" dest="${temp}"
+		failOnEmptyArchive="true" />
 
 	<!-- remove custom document properties -->
 	<delete includeEmptyDirs="true" verbose="true">
@@ -57,19 +57,23 @@
 	</delete>
 
 	<!-- fix .rels -->
-	<xslt style="fixdotrels.xsl"  in="${temp}_rels/.rels"  out="${temp}__rels/.rels" >
-		<factory name="net.sf.saxon.TransformerFactoryImpl"/>
-		<classpath location="${saxon.jar}"/>
+	<xslt style="fixdotrels.xsl" in="${temp}_rels/.rels"
+		out="${temp}__rels/.rels">
+		<factory name="net.sf.saxon.TransformerFactoryImpl" />
+		<classpath location="${saxon.jar}" />
 	</xslt>
-	<move file="${temp}__rels/.rels" tofile="${temp}_rels/.rels" verbose="true" />
+	<move file="${temp}__rels/.rels" tofile="${temp}_rels/.rels"
+		verbose="true" />
 
 
 	<!-- fix styles -->
-	<xslt style="fixstyle.xsl"  in="${temp}word/styles.xml"  out="${temp}word/_styles.xml" >
-		<factory name="net.sf.saxon.TransformerFactoryImpl"/>
-		<classpath location="${saxon.jar}"/>
+	<xslt style="fixstyle.xsl" in="${temp}word/styles.xml"
+		out="${temp}word/_styles.xml">
+		<factory name="net.sf.saxon.TransformerFactoryImpl" />
+		<classpath location="${saxon.jar}" />
 	</xslt>
-	<move file="${temp}word/_styles.xml" tofile="${temp}word/styles.xml" verbose="true" />
+	<move file="${temp}word/_styles.xml"
+		tofile="${temp}word/styles.xml" verbose="true" />
 
 	<!-- zip back together -->
 	<zip destfile="${targetFile}" basedir="${temp}" />
@@ -77,9 +81,9 @@
 	<!-- delete the working directory whith all its content -->
 	<echo>remove working directory</echo>
 	<delete includeEmptyDirs="true" verbose="true">
-		<fileset dir="${temp}"/>
+		<fileset dir="${temp}" />
 	</delete>
 
-	<echo>  target template stored in ${targetFile}</echo>
+	<echo> target template stored in ${targetFile}</echo>
 
 </project>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixdocprop.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixdocprop.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/docx-templates-twiddling/fixdocprop.xsl	(revision 2397)
@@ -1,38 +1,39 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet 
-    version="2.0"
-    xmlns:p="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" 
-    xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"    
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
-    exclude-result-prefixes="w vt p">
+<xsl:stylesheet version="2.0"
+	xmlns:p="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
+	xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+	exclude-result-prefixes="w vt p">
 
-  <xsl:output  encoding="UTF-8" standalone="yes" method="xml"/>
+	<xsl:output encoding="UTF-8" standalone="yes" method="xml" />
 
-  <xsl:param name="template"/>
-  <!-- identity transform -->
-  
-  <xsl:template match="@*|text()|comment()|processing-instruction()" >
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="*" >
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" />
-    </xsl:copy>
-  </xsl:template>
+	<xsl:param name="template" />
+	<!-- identity transform -->
 
-  <xsl:template match="p:Properties">
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <property pid="1" name="Template">
-	<xsl:attribute name="fmtid">
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="p:Properties">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<property pid="1" name="Template">
+				<xsl:attribute name="fmtid">
 	  <xsl:text>{D5CDD505-2E9C-101B-9397-08002B2CF9AE}</xsl:text>
 	</xsl:attribute>
-	<vt:lpwstr>
-	  <xsl:value-of select="$template"/>
-	</vt:lpwstr>
-      </property>
-    </xsl:copy>
-  </xsl:template>
+				<vt:lpwstr>
+					<xsl:value-of select="$template" />
+				</vt:lpwstr>
+			</property>
+		</xsl:copy>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/tangle.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/tangle.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/tangle.xsl	(revision 2397)
@@ -1,27 +1,29 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:fotex="http://www.tug.org/fotex"
-                xmlns:edate="http://exslt.org/dates-and-times"
-                xmlns:estr="http://exslt.org/strings"
-                xmlns:exsl="http://exslt.org/common"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:teix="http://www.tei-c.org/ns/Examples"
-                xmlns:html="http://www.w3.org/1999/xhtml"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
-                
-                xmlns:XSL="http://www.w3.org/1999/XSL/Transform"
-                extension-element-prefixes="exsl estr edate"
-                exclude-result-prefixes="exsl edate a fo rng tei teix fotex m html"
-                version="1.0">
-   <xsl:output indent="yes" encoding="utf-8"/>
+<xsl:stylesheet
+	xmlns:m="http://www.w3.org/1998/Math/MathML"
+	xmlns:fotex="http://www.tug.org/fotex"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:estr="http://exslt.org/strings"
+	xmlns:exsl="http://exslt.org/common"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:html="http://www.w3.org/1999/xhtml"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
 
-   <xsl:template match="XSL:stylesheet">
-      <xsl:copy>
-         <xsl:copy-of select="@*"/>
-         <xsl:copy-of select="XSL:*"/>
-      </xsl:copy>
-   </xsl:template>
+	xmlns:XSL="http://www.w3.org/1999/XSL/Transform"
+	extension-element-prefixes="exsl estr edate"
+	exclude-result-prefixes="exsl edate a fo rng tei teix fotex m html"
+	version="1.0">
+	<xsl:output indent="yes" encoding="utf-8" />
 
+	<xsl:template match="XSL:stylesheet">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:copy-of select="XSL:*" />
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checki18n.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checki18n.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/checki18n.xsl	(revision 2397)
@@ -1,23 +1,25 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:rng="http://relaxng.org/ns/structure/1.0"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="1.0"
-                exclude-result-prefixes="rng tei">
-   <xsl:output method="xml" encoding="utf-8" indent="yes"/>
-   <xsl:param name="lang">ja</xsl:param>
+<xsl:stylesheet
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+	exclude-result-prefixes="rng tei">
+	<xsl:output method="xml" encoding="utf-8" indent="yes" />
+	<xsl:param name="lang">
+		ja
+	</xsl:param>
 
-   <xsl:template match="/i18n">
-      <i18n>
-         <xsl:for-each select="entry">
-            <xsl:if test="not(text[@xml:lang=$lang])">
-	              <entry>
-	                 <xsl:copy-of select="key"/>
-	                 <xsl:copy-of select="text[@xml:lang='en']"/>
-	                 <text xml:lang="{$lang}"/>
-	              </entry>
-            </xsl:if>
-         </xsl:for-each>
-      </i18n>
-   </xsl:template>
+	<xsl:template match="/i18n">
+		<i18n>
+			<xsl:for-each select="entry">
+				<xsl:if test="not(text[@xml:lang=$lang])">
+					<entry>
+						<xsl:copy-of select="key" />
+						<xsl:copy-of select="text[@xml:lang='en']" />
+						<text xml:lang="{$lang}" />
+					</entry>
+				</xsl:if>
+			</xsl:for-each>
+		</i18n>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/oddbyexample.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/oddbyexample.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/oddbyexample.xsl	(revision 2397)
@@ -1,412 +1,476 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		xmlns:n="www.example.com"
-		xmlns:rng="http://relaxng.org/ns/structure/1.0"
-		xmlns:tei="http://www.tei-c.org/ns/1.0"
-		xmlns="http://www.tei-c.org/ns/1.0"
-		exclude-result-prefixes="rng tei n"
-		xpath-default-namespace="http://www.tei-c.org/ns/1.0"
-		version="2.0"><!--
-This software is dual-licensed:
-
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
-
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-
-$Id: oddbyexample.xsl 10028 2012-01-11 22:45:07Z rahtz $
-
-2008, TEI Consortium
--->
-  <!-- typical usage:
-   saxon -it:main -o:myodd /usr/share/xml/tei/stylesheet/tools2/oddbyexample.xsl   corpus=`pwd`/
-
--->
-  <xsl:import href="getfiles.xsl"/>
-  <!-- 
-read a corpus of TEI P5 documents and construct
-an ODD customization file which expresses the subset
-of the TEI you need to validate that corpus
--->
-  <xsl:output indent="yes"/>
-  <!-- name of odd -->
-  <xsl:param name="schema">oddbyexample</xsl:param>
-  <!-- whether to do all the global attributes -->
-  <xsl:param name="keepGlobals">false</xsl:param>
-  <!-- the document corpus -->
-  <xsl:param name="corpus">./</xsl:param>
-  <!-- the source of the TEI (just needs *Spec)-->
-  <xsl:param name="tei">http://www.tei-c.org/Vault/P5/current/xml/tei/odd/p5subset.xml</xsl:param>
-  <!-- should we make valList for @rend -->
-  <xsl:param name="enumerateRend">false</xsl:param>
-  <xsl:param name="enumerateType">false</xsl:param>
-  <!-- should we deal with non-TEI namespaces -->
-  <xsl:param name="processNonTEI">false</xsl:param>
-  <!-- which attributes should be make valLists for, regardless -->
-  <xsl:param name="attributeList"/>
-  <xsl:variable name="checkAtts">
-    <xsl:text>,</xsl:text>
-    <xsl:value-of select="$attributeList"/>
-    <xsl:text>,</xsl:text>
-  </xsl:variable>
-  <xsl:key name="Atts" match="@*" use="local-name(parent::*)"/>
-  <xsl:key name="attVals" match="@*" use="concat(local-name(parent::*),local-name())"/>
-  <xsl:key name="ELEMENTS" use="1" match="elementSpec"/>
-  <xsl:key name="CLASSES" use="1" match="classSpec[@type='atts']"/>
-  <xsl:key name="IDENTS" use="@ident" match="*[@ident]"/>
-  <xsl:key name="MEMBERS" use="@key" match="elementSpec/classes/memberOf"/>
-  <xsl:key name="CLASSMEMBERS" use="@key" match="classSpec/classes/memberOf"/>
-  <xsl:key name="Used" use="@ident" match="docs/elementSpec"/>
-  <xsl:key name="UsedAtt" use="concat(../@ident,@ident)" match="docs/elementSpec/attDef"/>
-  <!--
-1) start a variable and copy in all of the TEI 
-2) read the corpus and get a list of all the elements and their
-attributes that it uses, put that in the same variable
-3) process the variable and read the TEI section. if an element or
- attribute is not present in the corpus section, put out a delete
- customization
-4) for every attribute which is of type "enumerated", construct a
-valList
-
--->
-  <xsl:template name="processAll">
-    <xsl:variable name="count">
-      <xsl:value-of select="count(/n:ROOT/*)"/>
-    </xsl:variable>
-    <!-- assemble together all the TEI elements and attributes, 
-     followed by all the
-     elements and attributes used in the corpus -->
-    <xsl:variable name="stage1">
-      <stage1>
-        <tei>
-          <xsl:for-each select="document($tei)">
-            <xsl:for-each select="key('CLASSES',1)">
-              <classSpec>
-                <xsl:copy-of select="@ident"/>
-                <xsl:copy-of select="@module"/>
-                <xsl:for-each select=".//attDef">
-                  <attDef>
-                    <xsl:copy-of select="@ident"/>
-                    <xsl:call-template name="checktype"/>
-                  </attDef>
-                </xsl:for-each>
-                <xsl:call-template name="classmembers"/>
-              </classSpec>
-            </xsl:for-each>
-            <xsl:for-each select="key('ELEMENTS',1)">
-              <elementSpec>
-                <xsl:copy-of select="@ident"/>
-                <xsl:copy-of select="@module"/>
-                <xsl:for-each select=".//tei:attDef">
-                  <attDef>
-                    <xsl:copy-of select="@ident"/>
-                    <xsl:call-template name="checktype"/>
-                  </attDef>
-                </xsl:for-each>
-                <xsl:call-template name="classatts"/>
-              </elementSpec>
-            </xsl:for-each>
-          </xsl:for-each>
-        </tei>
-        <docs>
-          <xsl:for-each-group select="key('AllTEI',1)" group-by="local-name()">
-            <xsl:sort select="current-grouping-key()"/>
-            <xsl:variable name="ident" select="current-grouping-key()"/>
-            <elementSpec>
-              <xsl:attribute name="ident">
-                <xsl:copy-of select="current-grouping-key()"/>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:n="www.example.com"
+	xmlns:rng="http://relaxng.org/ns/structure/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="rng tei n"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0"><!-- This 
+		software is dual-licensed: 1. Distributed under a Creative Commons Attribution-ShareAlike 
+		3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 2. http://www.opensource.org/licenses/BSD-2-Clause 
+		All rights reserved. Redistribution and use in source and binary forms, with 
+		or without modification, are permitted provided that the following conditions 
+		are met: * Redistributions of source code must retain the above copyright 
+		notice, this list of conditions and the following disclaimer. * Redistributions 
+		in binary form must reproduce the above copyright notice, this list of conditions 
+		and the following disclaimer in the documentation and/or other materials 
+		provided with the distribution. This software is provided by the copyright 
+		holders and contributors "as is" and any express or implied warranties, including, 
+		but not limited to, the implied warranties of merchantability and fitness 
+		for a particular purpose are disclaimed. In no event shall the copyright 
+		holder or contributors be liable for any direct, indirect, incidental, special, 
+		exemplary, or consequential damages (including, but not limited to, procurement 
+		of substitute goods or services; loss of use, data, or profits; or business 
+		interruption) however caused and on any theory of liability, whether in contract, 
+		strict liability, or tort (including negligence or otherwise) arising in 
+		any way out of the use of this software, even if advised of the possibility 
+		of such damage. $Id: oddbyexample.xsl 10028 2012-01-11 22:45:07Z rahtz $ 
+		2008, TEI Consortium -->
+	<!-- typical usage: saxon -it:main -o:myodd /usr/share/xml/tei/stylesheet/tools2/oddbyexample.xsl 
+		corpus=`pwd`/ -->
+	<xsl:import href="getfiles.xsl" />
+	<!-- read a corpus of TEI P5 documents and construct an ODD customization 
+		file which expresses the subset of the TEI you need to validate that corpus -->
+	<xsl:output indent="yes" />
+	<!-- name of odd -->
+	<xsl:param name="schema">
+		oddbyexample
+	</xsl:param>
+	<!-- whether to do all the global attributes -->
+	<xsl:param name="keepGlobals">
+		false
+	</xsl:param>
+	<!-- the document corpus -->
+	<xsl:param name="corpus">
+		./
+	</xsl:param>
+	<!-- the source of the TEI (just needs *Spec) -->
+	<xsl:param name="tei">
+		http://www.tei-c.org/Vault/P5/current/xml/tei/odd/p5subset.xml
+	</xsl:param>
+	<!-- should we make valList for @rend -->
+	<xsl:param name="enumerateRend">
+		false
+	</xsl:param>
+	<xsl:param name="enumerateType">
+		false
+	</xsl:param>
+	<!-- should we deal with non-TEI namespaces -->
+	<xsl:param name="processNonTEI">
+		false
+	</xsl:param>
+	<!-- which attributes should be make valLists for, regardless -->
+	<xsl:param name="attributeList" />
+	<xsl:variable name="checkAtts">
+		<xsl:text>,</xsl:text>
+		<xsl:value-of select="$attributeList" />
+		<xsl:text>,</xsl:text>
+	</xsl:variable>
+	<xsl:key name="Atts" match="@*" use="local-name(parent::*)" />
+	<xsl:key name="attVals" match="@*"
+		use="concat(local-name(parent::*),local-name())" />
+	<xsl:key name="ELEMENTS" use="1" match="elementSpec" />
+	<xsl:key name="CLASSES" use="1" match="classSpec[@type='atts']" />
+	<xsl:key name="IDENTS" use="@ident" match="*[@ident]" />
+	<xsl:key name="MEMBERS" use="@key"
+		match="elementSpec/classes/memberOf" />
+	<xsl:key name="CLASSMEMBERS" use="@key"
+		match="classSpec/classes/memberOf" />
+	<xsl:key name="Used" use="@ident" match="docs/elementSpec" />
+	<xsl:key name="UsedAtt" use="concat(../@ident,@ident)"
+		match="docs/elementSpec/attDef" />
+	<!-- 1) start a variable and copy in all of the TEI 2) read the corpus and 
+		get a list of all the elements and their attributes that it uses, put that 
+		in the same variable 3) process the variable and read the TEI section. if 
+		an element or attribute is not present in the corpus section, put out a delete 
+		customization 4) for every attribute which is of type "enumerated", construct 
+		a valList -->
+	<xsl:template name="processAll">
+		<xsl:variable name="count">
+			<xsl:value-of select="count(/n:ROOT/*)" />
+		</xsl:variable>
+		<!-- assemble together all the TEI elements and attributes, followed by 
+			all the elements and attributes used in the corpus -->
+		<xsl:variable name="stage1">
+			<stage1>
+				<tei>
+					<xsl:for-each select="document($tei)">
+						<xsl:for-each select="key('CLASSES',1)">
+							<classSpec>
+								<xsl:copy-of select="@ident" />
+								<xsl:copy-of select="@module" />
+								<xsl:for-each select=".//attDef">
+									<attDef>
+										<xsl:copy-of select="@ident" />
+										<xsl:call-template name="checktype" />
+									</attDef>
+								</xsl:for-each>
+								<xsl:call-template name="classmembers" />
+							</classSpec>
+						</xsl:for-each>
+						<xsl:for-each select="key('ELEMENTS',1)">
+							<elementSpec>
+								<xsl:copy-of select="@ident" />
+								<xsl:copy-of select="@module" />
+								<xsl:for-each select=".//tei:attDef">
+									<attDef>
+										<xsl:copy-of select="@ident" />
+										<xsl:call-template name="checktype" />
+									</attDef>
+								</xsl:for-each>
+								<xsl:call-template name="classatts" />
+							</elementSpec>
+						</xsl:for-each>
+					</xsl:for-each>
+				</tei>
+				<docs>
+					<xsl:for-each-group select="key('AllTEI',1)"
+						group-by="local-name()">
+						<xsl:sort select="current-grouping-key()" />
+						<xsl:variable name="ident"
+							select="current-grouping-key()" />
+						<elementSpec>
+							<xsl:attribute name="ident">
+                <xsl:copy-of
+								select="current-grouping-key()" />
               </xsl:attribute>
-              <xsl:for-each-group select="key('Atts',$ident)" group-by="local-name()">
-                <attDef ident="{name()}">
-                  <valList type="closed">
-                    <xsl:for-each-group select="key('attVals',concat($ident,local-name()))" group-by=".">
-                      <xsl:sort select="."/>
-                      <xsl:choose>
-                        <xsl:when test="contains(current-grouping-key(),' ')">
-                          <xsl:for-each select="tokenize(current-grouping-key(),' ')">
-                            <valItem ident="{.}"/>
-                          </xsl:for-each>
-                        </xsl:when>
-                        <xsl:otherwise>
-                          <valItem ident="{current-grouping-key()}"/>
-                        </xsl:otherwise>
-                      </xsl:choose>
-                    </xsl:for-each-group>
-                  </valList>
-                </attDef>
-              </xsl:for-each-group>
-            </elementSpec>
-          </xsl:for-each-group>
-        </docs>
-      </stage1>
-    </xsl:variable>
-    <xsl:variable name="stage2">
-      <stage2>
-        <!-- for every attribute class, see if its members should be
-     deleted, by seeing if they are used anywhere-->
-        <xsl:for-each select="$stage1/stage1/tei/classSpec">
-          <classSpec ident="{@ident}" module="{@module}" type="atts" mode="change">
-            <attList>
-              <xsl:for-each select="attDef">
-                <xsl:variable name="this" select="@ident"/>
-                <xsl:variable name="used">
-                  <xsl:for-each select="../member">
-                    <!--		 <xsl:message>check for <xsl:value-of select="concat(@ident,$this)"/></xsl:message>-->
-                    <xsl:if test="key('UsedAtt',concat(@ident,$this))">true</xsl:if>
-                  </xsl:for-each>
-                </xsl:variable>
-                <xsl:choose>
-                  <xsl:when test="$keepGlobals='true' and $this='n'"/>
-                  <xsl:when test="$keepGlobals='true' and $this='rendition'"/>
-                  <xsl:when test="$keepGlobals='true' and $this='xml:id'"/>
-                  <xsl:when test="$keepGlobals='true' and $this='xml:base'"/>
-                  <xsl:when test="$keepGlobals='true' and $this='xml:space'"/>
-                  <xsl:when test="$keepGlobals='true' and $this='xml:lang'"/>
-                  <xsl:when test="$keepGlobals='true' and $this='rend'"/>
-                  <xsl:when test="$used=''">
-                    <attDef ident="{$this}" mode="delete"/>
-                  </xsl:when>
-                </xsl:choose>
-              </xsl:for-each>
-            </attList>
-          </classSpec>
-        </xsl:for-each>
-        <!-- for every TEI element, say if it is actually used or is to be deleted -->
-        <xsl:for-each select="$stage1/stage1/tei/elementSpec">
-          <xsl:choose>
-            <xsl:when test="key('Used',@ident)">
-              <elementSpec ident="{@ident}" module="{@module}" mode="keep">
-                <xsl:copy-of select="attDef"/>
-              </elementSpec>
-            </xsl:when>
-            <xsl:otherwise>
-              <elementSpec ident="{@ident}" module="{@module}" mode="delete"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each>
-        <xsl:if test="$processNonTEI='true'">
-          <xsl:for-each-group select="key('All',1)" group-by="local-name()">
-            <xsl:sort/>
-            <xsl:choose>
-              <xsl:when test="self::n:ROOT"/>
-              <xsl:when test="namespace-uri()='http://www.tei-c.org/ns/1.0'"/>
-              <xsl:otherwise>
-                <!-- build new 'add' elementSpec -->
-                <elementSpec ident="{current-grouping-key()}" mode="add" ns="{namespace-uri()}">
-                  <xsl:text>&#10;</xsl:text>
-                  <xsl:comment>add an &lt;equiv/&gt; to point to an named  template
-in an XSLT file which will transform this to pure TEI</xsl:comment>
-                  <xsl:text>&#10;</xsl:text>
-                  <equiv filter="somefile.xsl" mimeType="text/xsl" name="{current-grouping-key()}"/>
-                  <desc>
-                    <xsl:text>&#10;</xsl:text>
-                    <xsl:comment> Describe the <xsl:value-of select="current-grouping-key()"/> element  here</xsl:comment>
-                    <xsl:text>&#10;</xsl:text>
-                  </desc>
-                  <classes>
-                    <xsl:text>&#10;</xsl:text>
-                    <xsl:comment> Add a 'memberOf key="model.className"' stanza for whatever classes it belongs to  here</xsl:comment>
-                    <xsl:text>&#10;</xsl:text>
-                  </classes>
-                  <content>
-                    <xsl:text>&#10;</xsl:text>
-                    <xsl:comment>Add RNG content model here</xsl:comment>
-                    <xsl:text>&#10;</xsl:text>
-                  </content>
-                  <xsl:if test="key('Atts',local-name())">
-                    <attList>
-                      <xsl:comment>Add attDefs:</xsl:comment>
-                      <xsl:text>&#10;</xsl:text>
-                      <xsl:for-each-group select="key('Atts',local-name())" group-by="local-name()">
-                        <xsl:sort/>
-                        <attDef ident="{local-name()}" mode="add"/>
-                      </xsl:for-each-group>
-                    </attList>
-                  </xsl:if>
-                </elementSpec>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:for-each-group>
-        </xsl:if>
-      </stage2>
-    </xsl:variable>
-    <!-- start writing the final ODD document -->
-    <TEI xml:lang="en">
-      <teiHeader>
-        <fileDesc>
-          <titleStmt>
-            <title>ODD by Example customization</title>
-          </titleStmt>
-          <editionStmt>
-            <edition>generated on     
-	   <date><xsl:value-of select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')"/></date>
-	                 </edition>
-          </editionStmt>
-          <publicationStmt>
-            <p> </p>
-          </publicationStmt>
-          <sourceDesc>
-            <p>generated by oddbyexample.xsl, based on analyzing 
-	    <xsl:value-of select="$count"/> files from
-	    <xsl:value-of select="$corpus"/>
-                  </p>
-          </sourceDesc>
-        </fileDesc>
-      </teiHeader>
-      <text>
-        <body>
-          <!--<xsl:copy-of select="$stage1"/>-->
-          <schemaSpec ident="{$schema}">
-            <xsl:attribute name="start">
-              <xsl:if test="$stage2/stage2/elementSpec[@mode='keep' and     @ident='TEI']">TEI</xsl:if>
+							<xsl:for-each-group
+								select="key('Atts',$ident)" group-by="local-name()">
+								<attDef ident="{name()}">
+									<valList type="closed">
+										<xsl:for-each-group
+											select="key('attVals',concat($ident,local-name()))"
+											group-by=".">
+											<xsl:sort select="." />
+											<xsl:choose>
+												<xsl:when
+													test="contains(current-grouping-key(),' ')">
+													<xsl:for-each
+														select="tokenize(current-grouping-key(),' ')">
+														<valItem ident="{.}" />
+													</xsl:for-each>
+												</xsl:when>
+												<xsl:otherwise>
+													<valItem ident="{current-grouping-key()}" />
+												</xsl:otherwise>
+											</xsl:choose>
+										</xsl:for-each-group>
+									</valList>
+								</attDef>
+							</xsl:for-each-group>
+						</elementSpec>
+					</xsl:for-each-group>
+				</docs>
+			</stage1>
+		</xsl:variable>
+		<xsl:variable name="stage2">
+			<stage2>
+				<!-- for every attribute class, see if its members should be deleted, 
+					by seeing if they are used anywhere -->
+				<xsl:for-each select="$stage1/stage1/tei/classSpec">
+					<classSpec ident="{@ident}" module="{@module}"
+						type="atts" mode="change">
+						<attList>
+							<xsl:for-each select="attDef">
+								<xsl:variable name="this" select="@ident" />
+								<xsl:variable name="used">
+									<xsl:for-each select="../member">
+										<!-- <xsl:message>check for <xsl:value-of select="concat(@ident,$this)"/></xsl:message> -->
+										<xsl:if test="key('UsedAtt',concat(@ident,$this))">
+											true
+										</xsl:if>
+									</xsl:for-each>
+								</xsl:variable>
+								<xsl:choose>
+									<xsl:when test="$keepGlobals='true' and $this='n'" />
+									<xsl:when
+										test="$keepGlobals='true' and $this='rendition'" />
+									<xsl:when
+										test="$keepGlobals='true' and $this='xml:id'" />
+									<xsl:when
+										test="$keepGlobals='true' and $this='xml:base'" />
+									<xsl:when
+										test="$keepGlobals='true' and $this='xml:space'" />
+									<xsl:when
+										test="$keepGlobals='true' and $this='xml:lang'" />
+									<xsl:when test="$keepGlobals='true' and $this='rend'" />
+									<xsl:when test="$used=''">
+										<attDef ident="{$this}" mode="delete" />
+									</xsl:when>
+								</xsl:choose>
+							</xsl:for-each>
+						</attList>
+					</classSpec>
+				</xsl:for-each>
+				<!-- for every TEI element, say if it is actually used or is to be deleted -->
+				<xsl:for-each select="$stage1/stage1/tei/elementSpec">
+					<xsl:choose>
+						<xsl:when test="key('Used',@ident)">
+							<elementSpec ident="{@ident}" module="{@module}"
+								mode="keep">
+								<xsl:copy-of select="attDef" />
+							</elementSpec>
+						</xsl:when>
+						<xsl:otherwise>
+							<elementSpec ident="{@ident}" module="{@module}"
+								mode="delete" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+				<xsl:if test="$processNonTEI='true'">
+					<xsl:for-each-group select="key('All',1)"
+						group-by="local-name()">
+						<xsl:sort />
+						<xsl:choose>
+							<xsl:when test="self::n:ROOT" />
+							<xsl:when
+								test="namespace-uri()='http://www.tei-c.org/ns/1.0'" />
+							<xsl:otherwise>
+								<!-- build new 'add' elementSpec -->
+								<elementSpec ident="{current-grouping-key()}"
+									mode="add" ns="{namespace-uri()}">
+									<xsl:text>&#10;</xsl:text>
+									<xsl:comment>add
+										an &lt;equiv/&gt; to point to an named template
+										in an XSLT file which will transform this to pure TEI
+									</xsl:comment>
+									<xsl:text>&#10;</xsl:text>
+									<equiv filter="somefile.xsl" mimeType="text/xsl"
+										name="{current-grouping-key()}" />
+									<desc>
+										<xsl:text>&#10;</xsl:text>
+										<xsl:comment>
+											Describe the
+											<xsl:value-of select="current-grouping-key()" />
+											element here
+										</xsl:comment>
+										<xsl:text>&#10;</xsl:text>
+									</desc>
+									<classes>
+										<xsl:text>&#10;</xsl:text>
+										<xsl:comment>
+											Add a 'memberOf key="model.className"' stanza for whatever
+											classes it belongs to here
+										</xsl:comment>
+										<xsl:text>&#10;</xsl:text>
+									</classes>
+									<content>
+										<xsl:text>&#10;</xsl:text>
+										<xsl:comment>
+											Add RNG content model here
+										</xsl:comment>
+										<xsl:text>&#10;</xsl:text>
+									</content>
+									<xsl:if test="key('Atts',local-name())">
+										<attList>
+											<xsl:comment>
+												Add attDefs:
+											</xsl:comment>
+											<xsl:text>&#10;</xsl:text>
+											<xsl:for-each-group
+												select="key('Atts',local-name())" group-by="local-name()">
+												<xsl:sort />
+												<attDef ident="{local-name()}" mode="add" />
+											</xsl:for-each-group>
+										</attList>
+									</xsl:if>
+								</elementSpec>
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each-group>
+				</xsl:if>
+			</stage2>
+		</xsl:variable>
+		<!-- start writing the final ODD document -->
+		<TEI xml:lang="en">
+			<teiHeader>
+				<fileDesc>
+					<titleStmt>
+						<title>ODD by Example customization</title>
+					</titleStmt>
+					<editionStmt>
+						<edition>
+							generated on
+							<date>
+								<xsl:value-of
+									select="format-dateTime(current-dateTime(),'[Y]-[M02]-[D02]T[H02]:[m02]:[s02]Z')" />
+							</date>
+						</edition>
+					</editionStmt>
+					<publicationStmt>
+						<p>
+						</p>
+					</publicationStmt>
+					<sourceDesc>
+						<p>
+							generated by oddbyexample.xsl, based on analyzing
+							<xsl:value-of select="$count" />
+							files from
+							<xsl:value-of select="$corpus" />
+						</p>
+					</sourceDesc>
+				</fileDesc>
+			</teiHeader>
+			<text>
+				<body>
+					<!--<xsl:copy-of select="$stage1"/> -->
+					<schemaSpec ident="{$schema}">
+						<xsl:attribute name="start">
+              <xsl:if
+							test="$stage2/stage2/elementSpec[@mode='keep' and     @ident='TEI']">TEI</xsl:if>
               <xsl:text> </xsl:text>
-              <xsl:if test="$stage2/stage2/elementSpec[@mode='keep' and @ident='teiCorpus']">teiCorpus</xsl:if>
+              <xsl:if
+							test="$stage2/stage2/elementSpec[@mode='keep' and @ident='teiCorpus']">teiCorpus</xsl:if>
             </xsl:attribute>
-            <moduleRef key="tei"/>
-            <xsl:apply-templates select="$stage2/stage2/classSpec[@module='tei']"/>
-            <moduleRef key="core"/>
-            <!-- we need to list only modules from which elements have been used -->
-            <xsl:for-each-group select="$stage2/stage2/elementSpec[@mode='keep']" group-by="@module">
-              <xsl:sort select="current-grouping-key()"/>
-              <xsl:choose>
-                <xsl:when test="@module='core'"/>
-                <xsl:otherwise>
-                  <moduleRef key="{@module}"/>
-                </xsl:otherwise>
-              </xsl:choose>
-              <xsl:for-each select="current-group()">
-                <xsl:variable name="e" select="@ident"/>
-                <!-- for every attribute, if its a class attribute, see if
-	       its already deleted. if its a local attribute, see if its used. -->
-                <xsl:variable name="a">
-                  <attList>
-                    <xsl:for-each select="attDef">
-                      <xsl:variable name="class" select="@class"/>
-                      <xsl:variable name="ident" select="@ident"/>
-                      <xsl:variable name="enumerated" select="@enumerated"/>
-                      <xsl:for-each select="$stage1">
-                        <xsl:choose>
-                          <xsl:when test="not($class='')      and      $stage2/stage2/classSpec[@ident=$class]/attList/attDef[@ident=$ident]">
-			 
-		       </xsl:when>
-		       <xsl:when test="$keepGlobals='true' and $ident='xml:id'"/>
-		       <xsl:when test="$keepGlobals='true' and $ident='xml:base'"/>
-		       <xsl:when test="$keepGlobals='true' and $ident='xml:space'"/>
-		       <xsl:when test="$keepGlobals='true' and $ident='xml:lang'"/>
-		       <xsl:when test="$keepGlobals='true' and $ident='n'"/>
-		       <xsl:when test="$keepGlobals='true' and $ident='rendition'"/>
-		       <xsl:when test="$keepGlobals='true' and
-				       $ident='rend'"/>
-		       <xsl:when test="$keepGlobals='true' and $ident='facs'"/>
-		       <xsl:when test="not(key('UsedAtt',concat($e,$ident)))">
-			 <attDef ident="{$ident}" mode="delete"/>
-		       </xsl:when>
-		       <xsl:when test="$enumerated='true'">
-			 <attDef ident="{$ident}" mode="change">
-			   <xsl:apply-templates select="key('UsedAtt',concat($e,$ident))/valList"/>
-			 </attDef>
-		       </xsl:when>
-			</xsl:choose>
-		      </xsl:for-each>
-		    </xsl:for-each>
-		  </attList>
-		</xsl:variable>
-                <xsl:for-each select="$a">
-                  <xsl:if test="attList/attDef">
-                    <elementSpec ident="{$e}" mode="change">
-                      <xsl:copy-of select="attList"/>
-                    </elementSpec>
-                  </xsl:if>
-                </xsl:for-each>
-              </xsl:for-each>
-              <xsl:copy-of select="$stage2/stage2/elementSpec[@mode='delete'          and @module=current-grouping-key()]"/>
-              <xsl:apply-templates select="$stage2/stage2/classSpec[@module=current-grouping-key()]"/>
-            </xsl:for-each-group>
-            <xsl:for-each select="$stage2/stage2/elementSpec[@mode='add']">
-              <xsl:text>
+						<moduleRef key="tei" />
+						<xsl:apply-templates
+							select="$stage2/stage2/classSpec[@module='tei']" />
+						<moduleRef key="core" />
+						<!-- we need to list only modules from which elements have been used -->
+						<xsl:for-each-group
+							select="$stage2/stage2/elementSpec[@mode='keep']"
+							group-by="@module">
+							<xsl:sort select="current-grouping-key()" />
+							<xsl:choose>
+								<xsl:when test="@module='core'" />
+								<xsl:otherwise>
+									<moduleRef key="{@module}" />
+								</xsl:otherwise>
+							</xsl:choose>
+							<xsl:for-each select="current-group()">
+								<xsl:variable name="e" select="@ident" />
+								<!-- for every attribute, if its a class attribute, see if its already 
+									deleted. if its a local attribute, see if its used. -->
+								<xsl:variable name="a">
+									<attList>
+										<xsl:for-each select="attDef">
+											<xsl:variable name="class" select="@class" />
+											<xsl:variable name="ident" select="@ident" />
+											<xsl:variable name="enumerated"
+												select="@enumerated" />
+											<xsl:for-each select="$stage1">
+												<xsl:choose>
+													<xsl:when
+														test="not($class='')      and      $stage2/stage2/classSpec[@ident=$class]/attList/attDef[@ident=$ident]">
 
+													</xsl:when>
+													<xsl:when
+														test="$keepGlobals='true' and $ident='xml:id'" />
+													<xsl:when
+														test="$keepGlobals='true' and $ident='xml:base'" />
+													<xsl:when
+														test="$keepGlobals='true' and $ident='xml:space'" />
+													<xsl:when
+														test="$keepGlobals='true' and $ident='xml:lang'" />
+													<xsl:when
+														test="$keepGlobals='true' and $ident='n'" />
+													<xsl:when
+														test="$keepGlobals='true' and $ident='rendition'" />
+													<xsl:when
+														test="$keepGlobals='true' and
+				       $ident='rend'" />
+													<xsl:when
+														test="$keepGlobals='true' and $ident='facs'" />
+													<xsl:when
+														test="not(key('UsedAtt',concat($e,$ident)))">
+														<attDef ident="{$ident}" mode="delete" />
+													</xsl:when>
+													<xsl:when test="$enumerated='true'">
+														<attDef ident="{$ident}" mode="change">
+															<xsl:apply-templates
+																select="key('UsedAtt',concat($e,$ident))/valList" />
+														</attDef>
+													</xsl:when>
+												</xsl:choose>
+											</xsl:for-each>
+										</xsl:for-each>
+									</attList>
+								</xsl:variable>
+								<xsl:for-each select="$a">
+									<xsl:if test="attList/attDef">
+										<elementSpec ident="{$e}" mode="change">
+											<xsl:copy-of select="attList" />
+										</elementSpec>
+									</xsl:if>
+								</xsl:for-each>
+							</xsl:for-each>
+							<xsl:copy-of
+								select="$stage2/stage2/elementSpec[@mode='delete'          and @module=current-grouping-key()]" />
+							<xsl:apply-templates
+								select="$stage2/stage2/classSpec[@module=current-grouping-key()]" />
+						</xsl:for-each-group>
+						<xsl:for-each
+							select="$stage2/stage2/elementSpec[@mode='add']">
+							<xsl:text>
 
+
 </xsl:text>
-              <xsl:comment>You've added an element '<xsl:value-of select="@ident"/>'
-	   which does not seem to be a proper TEI element. This will make your TEI
-	   documents non-conformant, but if you really want to do this you should
-	   add an elementSpec for it if you want your document to validate. It
-	   would be better to use a separate namespace. </xsl:comment>
-              <xsl:text>
+							<xsl:comment>
+								You've added an element '
+								<xsl:value-of select="@ident" />
+								'
+								which does not seem to be a proper TEI element. This will make your
+								TEI
+								documents non-conformant, but if you really want to do this you should
+								add an elementSpec for it if you want your document to validate.
+								It
+								would be better to use a separate namespace.
+							</xsl:comment>
+							<xsl:text>
 
 </xsl:text>
-              <xsl:copy-of select="."/>
-            </xsl:for-each>
-          </schemaSpec>
-        </body>
-      </text>
-    </TEI>
-  </xsl:template>
-  <xsl:template name="classmembers">
-    <xsl:choose>
-      <xsl:when test="@ident='att.global'">
-        <xsl:for-each select="key('ELEMENTS',1)">
-          <xsl:sort select="@ident"/>
-          <member ident="{@ident}"/>
-        </xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:for-each select="key('MEMBERS',@ident)">
-          <member ident="{ancestor::elementSpec/@ident}"/>
-        </xsl:for-each>
-        <xsl:for-each select="key('CLASSMEMBERS',@ident)/ancestor::classSpec">
-          <xsl:call-template name="classmembers"/>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  <xsl:template name="classatts">
-    <xsl:for-each select="classes/memberOf">
-      <xsl:for-each select="key('IDENTS',@key)">
-        <xsl:for-each select=".//tei:attDef">
-          <attDef class="{ancestor::classSpec/@ident}">
-            <xsl:copy-of select="@ident"/>
-            <xsl:call-template name="checktype"/>
-          </attDef>
-        </xsl:for-each>
-        <xsl:call-template name="classatts"/>
-      </xsl:for-each>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template name="checktype">
-    <xsl:attribute name="enumerated">
+							<xsl:copy-of select="." />
+						</xsl:for-each>
+					</schemaSpec>
+				</body>
+			</text>
+		</TEI>
+	</xsl:template>
+	<xsl:template name="classmembers">
+		<xsl:choose>
+			<xsl:when test="@ident='att.global'">
+				<xsl:for-each select="key('ELEMENTS',1)">
+					<xsl:sort select="@ident" />
+					<member ident="{@ident}" />
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:for-each select="key('MEMBERS',@ident)">
+					<member ident="{ancestor::elementSpec/@ident}" />
+				</xsl:for-each>
+				<xsl:for-each
+					select="key('CLASSMEMBERS',@ident)/ancestor::classSpec">
+					<xsl:call-template name="classmembers" />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<xsl:template name="classatts">
+		<xsl:for-each select="classes/memberOf">
+			<xsl:for-each select="key('IDENTS',@key)">
+				<xsl:for-each select=".//tei:attDef">
+					<attDef class="{ancestor::classSpec/@ident}">
+						<xsl:copy-of select="@ident" />
+						<xsl:call-template name="checktype" />
+					</attDef>
+				</xsl:for-each>
+				<xsl:call-template name="classatts" />
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+	<xsl:template name="checktype">
+		<xsl:attribute name="enumerated">
       <xsl:choose>
-        <xsl:when test="contains($checkAtts,concat(',',@ident,','))">true</xsl:when>
+        <xsl:when
+			test="contains($checkAtts,concat(',',@ident,','))">true</xsl:when>
         <xsl:when test="@ident='n'">false</xsl:when>
-        <xsl:when test="@ident='rend' and $enumerateRend='true'">true</xsl:when>
-        <xsl:when test="@ident='type' and $enumerateType='true'">true</xsl:when>
+        <xsl:when
+			test="@ident='rend' and $enumerateRend='true'">true</xsl:when>
+        <xsl:when
+			test="@ident='type' and $enumerateType='true'">true</xsl:when>
         <xsl:when test="valList[@type='closed']">true</xsl:when>
-        <xsl:when test="datatype/rng:ref[@name='data.enumerated']">true</xsl:when>
+        <xsl:when
+			test="datatype/rng:ref[@name='data.enumerated']">true</xsl:when>
         <!--
       <xsl:when
 	  test="datatype/rng:ref[@name='data.word']">true</xsl:when>
@@ -414,21 +478,22 @@
         <xsl:otherwise>false</xsl:otherwise>
       </xsl:choose>
     </xsl:attribute>
-  </xsl:template>
-  <xsl:template match="valList">
-    <valList mode="add" type="closed">
-      <xsl:for-each-group select="valItem" group-by="@ident">
-        <xsl:sort select="@ident"/>
-        <valItem ident="{current-grouping-key()}"/>
-      </xsl:for-each-group>
-    </valList>
-  </xsl:template>
-  <xsl:template match="classSpec">
-    <xsl:if test="attList/attDef">
-      <xsl:copy-of select="."/>
-    </xsl:if>
-  </xsl:template>
+	</xsl:template>
+	<xsl:template match="valList">
+		<valList mode="add" type="closed">
+			<xsl:for-each-group select="valItem"
+				group-by="@ident">
+				<xsl:sort select="@ident" />
+				<valItem ident="{current-grouping-key()}" />
+			</xsl:for-each-group>
+		</valList>
+	</xsl:template>
+	<xsl:template match="classSpec">
+		<xsl:if test="attList/attDef">
+			<xsl:copy-of select="." />
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:template match="text()" mode="copy"/>
+	<xsl:template match="text()" mode="copy" />
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/iden.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/iden.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/iden.xsl	(revision 2397)
@@ -1,57 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		version="2.0">
-This software is dual-licensed:
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+	Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+	Redistribution and use in source and binary forms, with or without
+	modification, are permitted provided that the following conditions are
+	met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+	* Redistributions of source code must retain the above copyright
+	notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
+	* Redistributions in binary form must reproduce the above copyright
+	notice, this list of conditions and the following disclaimer in the
+	documentation and/or other materials provided with the distribution.
 
-$Id: iden.xsl 9646 2011-11-05 23:39:08Z rahtz $
+	This software is provided by the copyright holders and contributors
+	"as is" and any express or implied warranties, including, but not
+	limited to, the implied warranties of merchantability and fitness for
+	a particular purpose are disclaimed. In no event shall the copyright
+	holder or contributors be liable for any direct, indirect, incidental,
+	special, exemplary, or consequential damages (including, but not
+	limited to, procurement of substitute goods or services; loss of use,
+	data, or profits; or business interruption) however caused and on any
+	theory of liability, whether in contract, strict liability, or tort
+	(including negligence or otherwise) arising in any way out of the use
+	of this software, even if advised of the possibility of such damage.
 
-2008, TEI Consortium
--->
+	$Id: iden.xsl 9646 2011-11-05 23:39:08Z rahtz $
 
+	2008, TEI Consortium
+	-->
 
-<!-- identity transform -->
-<xsl:output method="xml" indent="yes" encoding="utf-8"/>
 
-   <xsl:template match="@*|text()|comment()|processing-instruction()">
-      <xsl:copy-of select="."/>
-   </xsl:template>
+	<!-- identity transform -->
+	<xsl:output method="xml" indent="yes" encoding="utf-8" />
 
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-   <xsl:template match="*">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-   </xsl:template>
 
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/xhtml2tei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/xhtml2tei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/xhtml2tei.xsl	(revision 2397)
@@ -1,483 +1,499 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:v="urn:schemas-microsoft-com:vml"
-                xmlns:o="urn:schemas-microsoft-com:office:office"
-                xmlns:w="urn:schemas-microsoft-com:office:word"
-                xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
-                xmlns:h="http://www.w3.org/1999/xhtml"
-                exclude-result-prefixes="h v o w dt"
-                version="1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:v="urn:schemas-microsoft-com:vml"
+	xmlns:o="urn:schemas-microsoft-com:office:office"
+	xmlns:w="urn:schemas-microsoft-com:office:word"
+	xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
+	xmlns:h="http://www.w3.org/1999/xhtml"
+	exclude-result-prefixes="h v o w dt" version="1.0">
 
-   <xsl:output method="xml" indent="yes"/>
+	<xsl:output method="xml" indent="yes" />
 
-   <xsl:param name="filename"/>
+	<xsl:param name="filename" />
 
-   <xsl:key name="H" match="h:h1" use="1"/>
-   <xsl:key name="H" match="h:h2" use="1"/>
-   <xsl:key name="H" match="h:h3" use="1"/>
-   <xsl:key name="H" match="h:h4" use="1"/>
+	<xsl:key name="H" match="h:h1" use="1" />
+	<xsl:key name="H" match="h:h2" use="1" />
+	<xsl:key name="H" match="h:h3" use="1" />
+	<xsl:key name="H" match="h:h4" use="1" />
 
-   <xsl:template match="h:html">
-      <xsl:variable name="author">
-         <xsl:choose>
-            <xsl:when test="h:head/h:meta[@name='Author']">
-               <xsl:value-of select="h:head/h:meta[@name='Author']/@content"/>
-            </xsl:when>
-            <xsl:when test="h:body/h:address">
-               <xsl:variable name="add">
-                  <xsl:value-of select="h:body/h:address"/>
-               </xsl:variable>
-               <xsl:choose>
-                  <xsl:when test="contains($add,'Author: ')">
-                     <xsl:value-of select="substring-after($add,'Author: ')"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$add"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>OUCS</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:variable name="date">
-         <xsl:choose>
-            <xsl:when test="h:body/h:address">
-               <xsl:variable name="add">
-                  <xsl:value-of select="h:body/h:address"/>
-               </xsl:variable>
-               <xsl:choose>
-                  <xsl:when test="contains($add,'Date: ')">
-                     <xsl:value-of select="substring-after($add,'Date: ')"/>
-                  </xsl:when>
-                  <xsl:when test="contains($add,'Last updated: ')">
-                     <xsl:value-of select="substring-after($add,'Last updated: ')"/>
-                  </xsl:when>
-                  <xsl:when test="contains($add,'Last Updated: ')">
-                     <xsl:value-of select="substring-after($add,'Last Updated: ')"/>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:value-of select="$add"/>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:when>
-            <xsl:otherwise>OUCS</xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <TEI.2>
-         <teiHeader>
-            <fileDesc>
-               <titleStmt>
-                  <title>
-                     <xsl:apply-templates select="h:head/h:title"/>
-                  </title>
-                  <author>
-                     <xsl:value-of select="$author"/>
-                  </author>
-               </titleStmt>
-               <editionStmt>
-                  <edition>
-  	                  <date>
-                        <xsl:value-of select="$date"/>
-                     </date>
-                  </edition>
-               </editionStmt>
-               <publicationStmt>
-                  <authority>OUCS</authority>
-	                 <address>
-                     <email>advisory@oucs.ox.ac.uk</email>
-                  </address>
-               </publicationStmt>
-               <sourceDesc>
-                  <p>This is the master version of an original document,
-created by converting an HTML file to TEI XML on TODAYSDATE.</p>
-               </sourceDesc>
-            </fileDesc>
-            <revisionDesc>
-               <change>
-	                 <date>$Date: 2011-10-17 09:55:51 +0100 (Mon, 17 Oct 2011) $</date>
-                  <respStmt>
-                     <name>$Author: rahtz $</name>
-                  </respStmt>
-	                 <item>$Revision: 9513 $</item>
-               </change>
-            </revisionDesc>
-         </teiHeader>
-         <text>
-            <xsl:apply-templates/>
-         </text>
-      </TEI.2>
-      <xsl:text>&#10;</xsl:text>
-   </xsl:template>
+	<xsl:template match="h:html">
+		<xsl:variable name="author">
+			<xsl:choose>
+				<xsl:when test="h:head/h:meta[@name='Author']">
+					<xsl:value-of
+						select="h:head/h:meta[@name='Author']/@content" />
+				</xsl:when>
+				<xsl:when test="h:body/h:address">
+					<xsl:variable name="add">
+						<xsl:value-of select="h:body/h:address" />
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="contains($add,'Author: ')">
+							<xsl:value-of
+								select="substring-after($add,'Author: ')" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$add" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					OUCS
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="date">
+			<xsl:choose>
+				<xsl:when test="h:body/h:address">
+					<xsl:variable name="add">
+						<xsl:value-of select="h:body/h:address" />
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="contains($add,'Date: ')">
+							<xsl:value-of
+								select="substring-after($add,'Date: ')" />
+						</xsl:when>
+						<xsl:when test="contains($add,'Last updated: ')">
+							<xsl:value-of
+								select="substring-after($add,'Last updated: ')" />
+						</xsl:when>
+						<xsl:when test="contains($add,'Last Updated: ')">
+							<xsl:value-of
+								select="substring-after($add,'Last Updated: ')" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:value-of select="$add" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:when>
+				<xsl:otherwise>
+					OUCS
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<TEI.2>
+			<teiHeader>
+				<fileDesc>
+					<titleStmt>
+						<title>
+							<xsl:apply-templates select="h:head/h:title" />
+						</title>
+						<author>
+							<xsl:value-of select="$author" />
+						</author>
+					</titleStmt>
+					<editionStmt>
+						<edition>
+							<date>
+								<xsl:value-of select="$date" />
+							</date>
+						</edition>
+					</editionStmt>
+					<publicationStmt>
+						<authority>OUCS</authority>
+						<address>
+							<email>advisory@oucs.ox.ac.uk</email>
+						</address>
+					</publicationStmt>
+					<sourceDesc>
+						<p>This is the master version of an original document,
+							created by converting an HTML file to TEI XML on TODAYSDATE.</p>
+					</sourceDesc>
+				</fileDesc>
+				<revisionDesc>
+					<change>
+						<date>$Date: 2011-10-17 09:55:51 +0100 (Mon, 17 Oct 2011) $</date>
+						<respStmt>
+							<name>$Author: rahtz $</name>
+						</respStmt>
+						<item>$Revision: 9513 $</item>
+					</change>
+				</revisionDesc>
+			</teiHeader>
+			<text>
+				<xsl:apply-templates />
+			</text>
+		</TEI.2>
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
 
-   <xsl:template match="h:head"/>
+	<xsl:template match="h:head" />
 
-   <xsl:template match="h:body">
-      <body>
-         <xsl:apply-templates/>
-         <!--This code is intended to balance the div tags created by headers with -->
-  <!--     the correct number of /divs. At the moment it fails if there are -->
-  <!-- Hn tags inside td's, which we are intending to make cell labels -->
-   <xsl:variable name="starter">    
-            <xsl:value-of select="substring(name(key('H',1)[1]),2)"/>
-         </xsl:variable>
-         <xsl:variable name="ender">
-            <xsl:value-of select="substring(name(key('H',1)[last()]),2)"/>
-         </xsl:variable>
-         <xsl:variable name="difference">
-            <xsl:value-of select="$starter - $ender"/>
-         </xsl:variable>
-         <xsl:comment>
-     Started with a <xsl:value-of select="$starter"/>, ended with a <xsl:value-of select="$ender"/>
-   diff=<xsl:value-of select="$difference"/>
-         </xsl:comment>
-         <!-- test call of for loop to handle closure of divs
-got to find a way to set a trigger for closing div if no headers -->
- <xsl:call-template name="for-loop">
-            <xsl:with-param name="i" select="$ender"/>
-            <xsl:with-param name="stepsize" select="1"/>
-            <xsl:with-param name="until" select="$starter"/>
-            <xsl:with-param name="insert" select="'/div'"/>
-         </xsl:call-template> 
-         <!-- old div closing code was here-->
+	<xsl:template match="h:body">
+		<body>
+			<xsl:apply-templates />
+			<!--This code is intended to balance the div tags created by headers with -->
+			<!-- the correct number of /divs. At the moment it fails if there are -->
+			<!-- Hn tags inside td's, which we are intending to make cell labels -->
+			<xsl:variable name="starter">
+				<xsl:value-of select="substring(name(key('H',1)[1]),2)" />
+			</xsl:variable>
+			<xsl:variable name="ender">
+				<xsl:value-of
+					select="substring(name(key('H',1)[last()]),2)" />
+			</xsl:variable>
+			<xsl:variable name="difference">
+				<xsl:value-of select="$starter - $ender" />
+			</xsl:variable>
+			<xsl:comment>
+				Started with a
+				<xsl:value-of select="$starter" />
+				, ended with a
+				<xsl:value-of select="$ender" />
+				diff=
+				<xsl:value-of select="$difference" />
+			</xsl:comment>
+			<!-- test call of for loop to handle closure of divs got to find a way 
+				to set a trigger for closing div if no headers -->
+			<xsl:call-template name="for-loop">
+				<xsl:with-param name="i" select="$ender" />
+				<xsl:with-param name="stepsize" select="1" />
+				<xsl:with-param name="until" select="$starter" />
+				<xsl:with-param name="insert" select="'/div'" />
+			</xsl:call-template>
+			<!-- old div closing code was here -->
 
-  </body>
-   </xsl:template>
+		</body>
+	</xsl:template>
 
 
-   <xsl:template match="h:h1|h:h2|h:h3|h:h4">
-  <!--headers inside td's are labels-->
-  <xsl:choose>
-         <xsl:when test="parent::h:td">
-            <emph>
-               <xsl:value-of select="."/>
-            </emph>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:if test="preceding::h:h1 or preceding::h:h2 or preceding::h:h3 or preceding::h:h4">
-               <xsl:variable name="previous">
-                  <xsl:value-of select="substring(name(preceding::*[name()='h1' or name()='h2' or name()='h3' or name()='h4'][1]),2)"/>
-               </xsl:variable>
-               <xsl:variable name="me">
-                  <xsl:value-of select="substring(name(.),2)"/>
-               </xsl:variable>
-               <xsl:variable name="difference">
-                  <xsl:value-of select="$me - $previous"/>
-               </xsl:variable>
-               <!--
-   <xsl:message>
- I am a <xsl:value-of select="$me"/>, previous is <xsl:value-of select="$previous"/>, difference is <xsl:value-of select="$difference"/>
+	<xsl:template match="h:h1|h:h2|h:h3|h:h4">
+		<!--headers inside td's are labels -->
+		<xsl:choose>
+			<xsl:when test="parent::h:td">
+				<emph>
+					<xsl:value-of select="." />
+				</emph>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if
+					test="preceding::h:h1 or preceding::h:h2 or preceding::h:h3 or preceding::h:h4">
+					<xsl:variable name="previous">
+						<xsl:value-of
+							select="substring(name(preceding::*[name()='h1' or name()='h2' or name()='h3' or name()='h4'][1]),2)" />
+					</xsl:variable>
+					<xsl:variable name="me">
+						<xsl:value-of select="substring(name(.),2)" />
+					</xsl:variable>
+					<xsl:variable name="difference">
+						<xsl:value-of select="$me - $previous" />
+					</xsl:variable>
+					<!-- <xsl:message> I am a <xsl:value-of select="$me"/>, previous is 
+						<xsl:value-of select="$previous"/>, difference is <xsl:value-of select="$difference"/> 
+						</xsl:message> -->
+					<!-- test call of for loop to handle this ... -->
+					<xsl:if test="$difference &lt; 1">
+						<xsl:call-template name="for-loop">
+							<xsl:with-param name="i" select="$previous" />
+							<xsl:with-param name="stepsize" select="1" />
+							<xsl:with-param name="until" select="$me" />
+							<xsl:with-param name="insert" select="'/div'" />
+						</xsl:call-template>
+					</xsl:if>
+					<xsl:if test="$difference &gt; 1">
+						<xsl:call-template name="for-loop">
+							<xsl:with-param name="i" select="$previous" />
+							<xsl:with-param name="stepsize" select="1" />
+							<xsl:with-param name="until" select="$me - 2" />
+							<xsl:with-param name="insert" select="'div'" />
+						</xsl:call-template>
+					</xsl:if>
+				</xsl:if>
+				<xsl:choose>
+					<xsl:when test="h:a[@name]">
+						<xsl:text disable-output-escaping="yes">&lt;div id="</xsl:text>
+						<xsl:value-of select="h:a[@name]/@name" />
+						<xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
+					</xsl:when>
+					<xsl:when test="preceding::h:a[1][@name]">
+						<xsl:text disable-output-escaping="yes">&lt;div id="</xsl:text>
+						<xsl:value-of select="preceding::h:a[1][@name]/@name" />
+						<xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:text disable-output-escaping="yes">&lt;div&gt;</xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+				<head>
+					<xsl:apply-templates mode="head" />
+				</head>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   </xsl:message>
--->
-<!-- test call of for loop to handle this ... -->
-<xsl:if test="$difference &lt; 1">
-                  <xsl:call-template name="for-loop">
-                     <xsl:with-param name="i" select="$previous"/>
-                     <xsl:with-param name="stepsize" select="1"/>
-                     <xsl:with-param name="until" select="$me"/>
-                     <xsl:with-param name="insert" select="'/div'"/>
-                  </xsl:call-template>
-               </xsl:if>
-               <xsl:if test="$difference &gt; 1">
-                  <xsl:call-template name="for-loop">
-                     <xsl:with-param name="i" select="$previous"/>
-                     <xsl:with-param name="stepsize" select="1"/>
-                     <xsl:with-param name="until" select="$me - 2"/>
-                     <xsl:with-param name="insert" select="'div'"/>
-                  </xsl:call-template> 
-               </xsl:if>
-            </xsl:if>
-            <xsl:choose>
-               <xsl:when test="h:a[@name]">
-                  <xsl:text disable-output-escaping="yes">&lt;div id="</xsl:text>
-                  <xsl:value-of select="h:a[@name]/@name"/>
-                  <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
-               </xsl:when>
-               <xsl:when test="preceding::h:a[1][@name]">
-                  <xsl:text disable-output-escaping="yes">&lt;div id="</xsl:text>
-                  <xsl:value-of select="preceding::h:a[1][@name]/@name"/>
-                  <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
-               </xsl:when>   
-               <xsl:otherwise>
-                  <xsl:text disable-output-escaping="yes">&lt;div&gt;</xsl:text>
-               </xsl:otherwise>
-            </xsl:choose>
-            <head>
-               <xsl:apply-templates mode="head"/>
-            </head>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<!-- low-level markup -->
+	<xsl:template match="h:td/h:p">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <!-- low-level markup -->
-<xsl:template match="h:td/h:p">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="h:p">
+		<p>
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
 
-   <xsl:template match="h:p">
-      <p>
-         <xsl:apply-templates/>
-      </p>
-   </xsl:template>
+	<xsl:template match="h:strong|h:b|h:em|h:i" mode="head">
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="h:strong|h:b|h:em|h:i" mode="head">
-      <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="h:strong|h:b">
+		<hi>
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-   <xsl:template match="h:strong|h:b">
-      <hi>
-         <xsl:apply-templates/>
-      </hi>
-   </xsl:template>
+	<xsl:template match="h:tt|h:var|h:kbd|h:samp|h:code">
+		<code>
+			<xsl:apply-templates />
+		</code>
+	</xsl:template>
 
-   <xsl:template match="h:tt|h:var|h:kbd|h:samp|h:code">
-      <code>
-         <xsl:apply-templates/>
-      </code>
-   </xsl:template>
+	<xsl:template match="h:em|h:i">
+		<emph>
+			<xsl:apply-templates />
+		</emph>
+	</xsl:template>
 
-   <xsl:template match="h:em|h:i">
-      <emph>
-         <xsl:apply-templates/>
-      </emph>
-   </xsl:template>
+	<xsl:template match="h:font"><!-- just continue -->
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="h:font"><!-- just continue -->
-  <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="h:big|h:small|h:center"><!-- just continue -->
+		<xsl:apply-templates />
+	</xsl:template>
 
-   <xsl:template match="h:big|h:small|h:center"><!-- just continue -->
-  <xsl:apply-templates/>
-   </xsl:template>
+	<xsl:template match="h:span"><!-- just continue -->
+		<xsl:apply-templates />
+	</xsl:template>
+	<xsl:template match="h:span[@class]"><!-- just continue -->
+		<hi rend="{@class}">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
+	<!-- links -->
 
-   <xsl:template match="h:span"><!-- just continue -->
-  <xsl:apply-templates/>
-   </xsl:template>
-   <xsl:template match="h:span[@class]"><!-- just continue -->
-     <hi rend="{@class}">
-       <xsl:apply-templates/>
-     </hi>
-   </xsl:template>
-   <!-- links -->
+	<xsl:template match="h:a[@href]">
+		<xsl:variable name="content"
+			select="descendant-or-self::text()" />
+		<xsl:choose>
+			<xsl:when test="@href = $content">
+				<xsl:choose>
+					<xsl:when test="starts-with(@href,'#')">
+						<ptr target="{substring(@href,2)}" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xptr url="{@href}" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="starts-with(@href,'#')">
+						<ref target="{substring(@href,2)}">
+							<xsl:value-of select="$content" />
+						</ref>
+					</xsl:when>
+					<xsl:otherwise>
+						<xref url="{@href}">
+							<xsl:value-of select="$content" />
+						</xref>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template match="h:a[@href]">
-      <xsl:variable name="content" select="descendant-or-self::text()"/>
-      <xsl:choose>
-         <xsl:when test="@href = $content">
-            <xsl:choose>
-               <xsl:when test="starts-with(@href,'#')">
-                  <ptr target="{substring(@href,2)}"/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xptr url="{@href}"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="starts-with(@href,'#')">
-                  <ref target="{substring(@href,2)}">
-                     <xsl:value-of select="$content"/>
-                  </ref>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xref url="{@href}">
-                     <xsl:value-of select="$content"/>
-                  </xref>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<!-- ====== quotes, verbatim ====== -->
+	<xsl:template match="h:blockquote">
+		<p>
+			<q rend="display">
+				<xsl:apply-templates />
+			</q>
+		</p>
+	</xsl:template>
 
-   <!-- ====== quotes, verbatim ====== -->
-<xsl:template match="h:blockquote">
-      <p>
-         <q rend="display">
-            <xsl:apply-templates/>
-         </q>
-      </p>
-   </xsl:template>
+	<xsl:template match="h:pre">
+		<eg>
+			<xsl:apply-templates />
+		</eg>
+	</xsl:template>
 
-   <xsl:template match="h:pre">
-      <eg>
-         <xsl:apply-templates/>
-      </eg>
-   </xsl:template>
+	<!-- ============ Lists ============== -->
+	<xsl:template match="h:dl">
+		<list type="gloss">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
 
-   <!-- ============ Lists ============== -->
-<xsl:template match="h:dl">
-      <list type="gloss">
-         <xsl:apply-templates/>
-      </list>
-   </xsl:template>
+	<xsl:template match="h:dt">
+		<label>
+			<xsl:apply-templates />
+		</label>
+	</xsl:template>
 
-   <xsl:template match="h:dt">
-      <label>
-         <xsl:apply-templates/>
-      </label>
-   </xsl:template>
+	<xsl:template match="h:dd">
+		<item>
+			<xsl:apply-templates />
+		</item>
+	</xsl:template>
 
-   <xsl:template match="h:dd">
-      <item>
-         <xsl:apply-templates/>
-      </item>
-   </xsl:template>
+	<xsl:template match="h:ol">
+		<list type="ordered">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
 
-   <xsl:template match="h:ol">
-      <list type="ordered">
-         <xsl:apply-templates/>
-      </list>
-   </xsl:template>
+	<xsl:template match="h:ul">
+		<list type="unordered">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
 
-   <xsl:template match="h:ul">
-      <list type="unordered">
-         <xsl:apply-templates/>
-      </list>
-   </xsl:template>
+	<xsl:template match="h:li">
+		<item>
+			<xsl:apply-templates />
+		</item>
+	</xsl:template>
 
-   <xsl:template match="h:li">
-      <item>
-         <xsl:apply-templates/>
-      </item>
-   </xsl:template>
+	<!-- ===== sub, sup -->
+	<xsl:template match="h:sub">
+		<hi rend="sub">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
+	<xsl:template match="h:sup">
+		<hi rend="sup">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-   <!-- ===== sub, sup -->
-<xsl:template match="h:sub">
-      <hi rend="sub">
-         <xsl:apply-templates/>
-      </hi>
-   </xsl:template>
-   <xsl:template match="h:sup">
-      <hi rend="sup">
-         <xsl:apply-templates/>
-      </hi>
-   </xsl:template>
 
 
+	<!-- tables -->
+	<xsl:template match="h:tr">
+		<row>
+			<xsl:apply-templates />
+		</row>
+	</xsl:template>
 
-   <!-- tables -->
-<xsl:template match="h:tr">
-      <row>
-         <xsl:apply-templates/>
-      </row>
-   </xsl:template>
+	<xsl:template match="h:p/h:table[@border]">
+		<table border="{@border}">
+			<xsl:apply-templates />
+		</table>
+	</xsl:template>
 
-   <xsl:template match="h:p/h:table[@border]">
-      <table border="{@border}">
-         <xsl:apply-templates/>
-      </table>
-   </xsl:template>
+	<xsl:template match="h:table[@border]">
+		<p>
+			<table border="{@border}">
+				<xsl:apply-templates />
+			</table>
+		</p>
+	</xsl:template>
 
-   <xsl:template match="h:table[@border]">
-      <p>
-         <table border="{@border}">
-            <xsl:apply-templates/>
-         </table>
-      </p>
-   </xsl:template>
-
-   <xsl:template match="h:td">
-      <cell>
-         <xsl:if test="@valign">
-            <xsl:attribute name="valign">
-               <xsl:value-of select="@valign"/>
+	<xsl:template match="h:td">
+		<cell>
+			<xsl:if test="@valign">
+				<xsl:attribute name="valign">
+               <xsl:value-of select="@valign" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:if test="h:p[@align]">
-            <xsl:attribute name="align">
-               <xsl:value-of select="child::h:p/@align"/>
+			</xsl:if>
+			<xsl:if test="h:p[@align]">
+				<xsl:attribute name="align">
+               <xsl:value-of select="child::h:p/@align" />
             </xsl:attribute>
-         </xsl:if>
-         <xsl:apply-templates/>
-      </cell>
-   </xsl:template>
-   <xsl:template match="h:address"/>
+			</xsl:if>
+			<xsl:apply-templates />
+		</cell>
+	</xsl:template>
+	<xsl:template match="h:address" />
 
 
 
-   <xsl:template match="text()">
-      <xsl:variable name="N">
-         <xsl:value-of select="name(preceding-sibling::*[1])"/>
-      </xsl:variable>
-      <xsl:choose>
-         <xsl:when test="$N='h1' or $N='h3' or $N='h3' or $N='h4'">
-            <p>
-               <xsl:value-of select="normalize-space(.)"/>
-            </p>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:choose>
-               <xsl:when test="parent::h:td">
-                  <xsl:value-of select="."/>
-               </xsl:when>
-               <xsl:otherwise>
-                  <xsl:value-of select="translate(.,'&#160;',' ')"/>      
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="text()">
+		<xsl:variable name="N">
+			<xsl:value-of select="name(preceding-sibling::*[1])" />
+		</xsl:variable>
+		<xsl:choose>
+			<xsl:when test="$N='h1' or $N='h3' or $N='h3' or $N='h4'">
+				<p>
+					<xsl:value-of select="normalize-space(.)" />
+				</p>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="parent::h:td">
+						<xsl:value-of select="." />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="translate(.,'&#160;',' ')" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="h:img">
-      <figure file="{@src}">
-         <xsl:if test="@alt">
-            <figDesc>
-               <xsl:value-of select="@alt"/>
-            </figDesc>
-         </xsl:if>
-      </figure>
-   </xsl:template>
+	<xsl:template match="h:img">
+		<figure file="{@src}">
+			<xsl:if test="@alt">
+				<figDesc>
+					<xsl:value-of select="@alt" />
+				</figDesc>
+			</xsl:if>
+		</figure>
+	</xsl:template>
 
-   <xsl:template match="h:form|h:input|h:textarea|h:option|h:select">
-      <xsl:copy>
-         <xsl:copy-of select="@*"/>
-         <xsl:apply-templates/>
-      </xsl:copy>
-   </xsl:template>
-   <xsl:template name="for-loop">
-<!-- simplified from tidwell p86. only does step up or down until -->
-    <xsl:param name="i" select="1"/>
-      <xsl:param name="stepsize" select="1"/>
-      <xsl:param name="until" select="1"/>
-      <xsl:param name="iteration" select="1"/>
-      <xsl:param name="insert" select="''"/>
+	<xsl:template
+		match="h:form|h:input|h:textarea|h:option|h:select">
+		<xsl:copy>
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+	<xsl:template name="for-loop">
+		<!-- simplified from tidwell p86. only does step up or down until -->
+		<xsl:param name="i" select="1" />
+		<xsl:param name="stepsize" select="1" />
+		<xsl:param name="until" select="1" />
+		<xsl:param name="iteration" select="1" />
+		<xsl:param name="insert" select="''" />
 
-      <xsl:variable name="step">
-  
-         <xsl:choose>
-            <xsl:when test="$until &lt; $i">
-               <xsl:text>-</xsl:text>
-               <xsl:value-of select="$stepsize"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="$stepsize"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>  
-    
-      <xsl:text disable-output-escaping="yes">&lt;</xsl:text>      
-      <xsl:value-of select="$insert"/>
-      <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
-      <xsl:variable name="testpassed">
-         <xsl:choose>
-            <xsl:when test="$i != $until">
-               <xsl:text>true</xsl:text>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:text>false</xsl:text>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:if test="$testpassed = 'true'">    
+		<xsl:variable name="step">
 
-         <xsl:call-template name="for-loop">
-            <xsl:with-param name="i" select="$i + $step"/>
-            <xsl:with-param name="stepsize" select="$stepsize"/>
-            <xsl:with-param name="until" select="$until"/>
-            <xsl:with-param name="iteration" select="$iteration + 1"/>
-            <xsl:with-param name="insert" select="$insert"/>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+			<xsl:choose>
+				<xsl:when test="$until &lt; $i">
+					<xsl:text>-</xsl:text>
+					<xsl:value-of select="$stepsize" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$stepsize" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+
+		<xsl:text disable-output-escaping="yes">&lt;</xsl:text>
+		<xsl:value-of select="$insert" />
+		<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+		<xsl:variable name="testpassed">
+			<xsl:choose>
+				<xsl:when test="$i != $until">
+					<xsl:text>true</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>false</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:if test="$testpassed = 'true'">
+
+			<xsl:call-template name="for-loop">
+				<xsl:with-param name="i" select="$i + $step" />
+				<xsl:with-param name="stepsize" select="$stepsize" />
+				<xsl:with-param name="until" select="$until" />
+				<xsl:with-param name="iteration"
+					select="$iteration + 1" />
+				<xsl:with-param name="insert" select="$insert" />
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/odd2nuodd.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/odd2nuodd.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/odd2nuodd.xsl	(revision 2397)
@@ -1,200 +1,208 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet version="2.0" 
+<xsl:stylesheet version="2.0"
 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 	xpath-default-namespace="http://www.tei-c.org/ns/1.0"
-	xmlns="http://www.tei-c.org/ns/1.0"
->
+	xmlns="http://www.tei-c.org/ns/1.0">
 
-  <!--
-      
-      $Id: odd2nuodd.xsl 9297 2011-09-07 21:37:09Z rahtz $
-      Sebastian Rahtz 2011/03/26
-      
-      Read an ODD with <elementSpec mode="delete"> statements and rewrite it
-      as <moduleRef include="* * *" or except="* * *">
-      
-  -->
-  <!-- where is a copy of P5? -->
-  <xsl:param name="P5">http://www.tei-c.org/Vault/P5/current/xml/tei/odd/p5subset.xml</xsl:param>
-  
-  <!-- do you want moduleRef generated with @include or @except? -->
-  <xsl:param name="method">include</xsl:param>
+	<!-- $Id: odd2nuodd.xsl 9297 2011-09-07 21:37:09Z rahtz $ Sebastian Rahtz 
+		2011/03/26 Read an ODD with <elementSpec mode="delete"> statements and rewrite 
+		it as <moduleRef include="* * *" or except="* * *"> -->
+	<!-- where is a copy of P5? -->
+	<xsl:param name="P5">
+		http://www.tei-c.org/Vault/P5/current/xml/tei/odd/p5subset.xml
+	</xsl:param>
 
+	<!-- do you want moduleRef generated with @include or @except? -->
+	<xsl:param name="method">
+		include
+	</xsl:param>
 
 
-  <xsl:key name="EbyM" match="elementSpec" use="@module"/>
 
-  <xsl:key name="deletedE" match="elementSpec[@mode='delete']" use="@ident"/>
-  <xsl:key name="changedE" match="elementSpec[@mode='change']" use="@ident"/>
-  <xsl:key name="changedE" match="elementSpec[@mode='replace']" use="@ident"/>
+	<xsl:key name="EbyM" match="elementSpec" use="@module" />
 
-  <xsl:variable name="orig" select="/"/>
+	<xsl:key name="deletedE" match="elementSpec[@mode='delete']"
+		use="@ident" />
+	<xsl:key name="changedE" match="elementSpec[@mode='change']"
+		use="@ident" />
+	<xsl:key name="changedE" match="elementSpec[@mode='replace']"
+		use="@ident" />
 
-  <!-- identifty transforms -->
-  <xsl:template match="@*|text()|comment()|processing-instruction()">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:variable name="orig" select="/" />
 
-  <xsl:template match="@*|text()|comment()|processing-instruction()" mode="stage2">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<!-- identifty transforms -->
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="*">
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="stage2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="*" mode="stage2">
-    <xsl:copy>
-      <xsl:apply-templates
-	  select="*|@*|processing-instruction()|comment()|text()" mode="stage2"/>
-    </xsl:copy>
-  </xsl:template>
-  
-  
-  <!-- work in two phases, so we can zap empty specGrp on pass 2-->
-  <xsl:template match="/">
-    <xsl:variable name="stage1">
-      <xsl:apply-templates/>
-    </xsl:variable>
-    <xsl:for-each select="$stage1">
-      <xsl:apply-templates mode="stage2"/>
-    </xsl:for-each>
-  </xsl:template>
-  
-  <!-- ignore elementSpec @mode='delete' -->
-  <xsl:template match="elementSpec[@mode='delete']"/>
-  
-  <xsl:template match="moduleRef/@include"/>
-  <xsl:template match="moduleRef/@except"/>
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-  <!-- for any moduleRef, look up all the members of it in P5;
-       if they are not deleted by this odd, add them to a list to be
-       included -->
-  <xsl:template match="moduleRef[@key]">
-    <xsl:variable name="here" select="."/>
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:variable name="module" select="@key"/>
-      <xsl:choose>
-	<xsl:when test="$method='include' and @include">
-	  <xsl:copy-of select="@include"/>
-	</xsl:when>	
-	<xsl:when test="$method='except' and @except">
-	  <xsl:copy-of select="@except"/>
-	</xsl:when>	
-	<xsl:when test="$method='include' and @except">
-	  <xsl:variable name="not">
-	    <xsl:for-each select="tokenize($here/@except,' ')">
-	      <not ident="{.}"/>
-	    </xsl:for-each>
-	  </xsl:variable>
-	  <xsl:variable name="includelist">
-	    <xsl:for-each select="document($P5)">
-	      <xsl:for-each select="key('EbyM',$module)">
-		<xsl:sort select="@ident"/>
-		<xsl:variable name="e" select="@ident"/>
-		<xsl:if test="not($not/not[@ident=$e])">
-		  <xsl:value-of select="$e"/>
-		    <xsl:text> </xsl:text>
-		</xsl:if>
-	      </xsl:for-each>
-	    </xsl:for-each>
-	  </xsl:variable>
-	  <xsl:if test="not($includelist='')">
-	    <xsl:attribute name="include" select="normalize-space($includelist)"/>
-	  </xsl:if>
-	</xsl:when>
-	<xsl:when test="$method='include'">
-	  <xsl:variable name="includelist">
-	    <xsl:for-each select="document($P5)">
-	      <xsl:for-each select="key('EbyM',$module)">
-		<xsl:sort select="@ident"/>
-		<xsl:variable name="e" select="@ident"/>
-		<xsl:for-each select="$orig">
-		  <xsl:choose>
-		  <xsl:when test="key('deletedE',$e)"/>
-		  <xsl:otherwise>
-		    <xsl:value-of select="$e"/>
-		    <xsl:text> </xsl:text>
-		  </xsl:otherwise>
-		  </xsl:choose>
+	<xsl:template match="*" mode="stage2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()"
+				mode="stage2" />
+		</xsl:copy>
+	</xsl:template>
+
+
+	<!-- work in two phases, so we can zap empty specGrp on pass 2 -->
+	<xsl:template match="/">
+		<xsl:variable name="stage1">
+			<xsl:apply-templates />
+		</xsl:variable>
+		<xsl:for-each select="$stage1">
+			<xsl:apply-templates mode="stage2" />
 		</xsl:for-each>
-	      </xsl:for-each>
-	    </xsl:for-each>
-	  </xsl:variable>
-	  <xsl:if test="not($includelist='')">
-	    <xsl:attribute name="include"
-			   select="normalize-space($includelist)"/>
-	  </xsl:if>
-	</xsl:when>
-	<xsl:when test="$method='except' and @include">
-	  <xsl:variable name="yes">
-	    <xsl:for-each select="tokenize($here/@include,' ')">
-	      <yes ident="{.}"/>
-	    </xsl:for-each>
-	  </xsl:variable>
-	  <xsl:variable name="exceptlist">
-	    <xsl:for-each select="document($P5)">
-	      <xsl:for-each select="key('EbyM',$module)">
-		<xsl:sort select="@ident"/>
-		<xsl:variable name="e" select="@ident"/>
-		<xsl:for-each select="$orig">
-		  <xsl:if test="not($yes/yes[@ident=$e])">
-		    <xsl:value-of select="$e"/>
-		    <xsl:text> </xsl:text>
-		  </xsl:if>
-		</xsl:for-each>
-	      </xsl:for-each>
-	    </xsl:for-each>
-	  </xsl:variable>
-	  <xsl:if test="not($exceptlist='')">
-	    <xsl:attribute name="except"  select="normalize-space($exceptlist)"/>
-	  </xsl:if>
-	</xsl:when>
-	<xsl:when test="$method='except'">
-	  <xsl:variable name="exceptlist">
-	    <xsl:for-each select="document($P5)">
-	      <xsl:for-each select="key('EbyM',$module)">
-		<xsl:sort select="@ident"/>
-		<xsl:variable name="e" select="@ident"/>
-		<xsl:for-each select="$orig">
-		  <xsl:if test="key('deletedE',$e)">
-		    <xsl:value-of select="$e"/>
-		    <xsl:text> </xsl:text>
-		  </xsl:if>
-		</xsl:for-each>
-	      </xsl:for-each>
-	    </xsl:for-each>
-	  </xsl:variable>
-	  <xsl:if test="not($exceptlist='')">
-	    <xsl:attribute name="except" select="normalize-space($exceptlist)"/>
-	  </xsl:if>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:message terminate="yes">Method <xsl:value-of
-	  select="$method"/> not supported</xsl:message>
-	</xsl:otherwise>
-      </xsl:choose>
-	</xsl:copy>
-      </xsl:template>
+	</xsl:template>
 
-  <xsl:template mode="stage2" match="specGrp[not(*)]"/>
+	<!-- ignore elementSpec @mode='delete' -->
+	<xsl:template match="elementSpec[@mode='delete']" />
 
-  <xsl:template mode="stage2" match="specGrpRef">
-    <xsl:choose>
-      <xsl:when test="starts-with(@target,'#')">
-	<xsl:for-each
-	    select="id(substring(@target,2))">
-	  <xsl:if test="*">
-	    <specGrpRef target="#{@xml:id}"/>
-	  </xsl:if>
-	</xsl:for-each>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:copy-of select="."/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="moduleRef/@include" />
+	<xsl:template match="moduleRef/@except" />
+
+	<!-- for any moduleRef, look up all the members of it in P5; if they are 
+		not deleted by this odd, add them to a list to be included -->
+	<xsl:template match="moduleRef[@key]">
+		<xsl:variable name="here" select="." />
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:variable name="module" select="@key" />
+			<xsl:choose>
+				<xsl:when test="$method='include' and @include">
+					<xsl:copy-of select="@include" />
+				</xsl:when>
+				<xsl:when test="$method='except' and @except">
+					<xsl:copy-of select="@except" />
+				</xsl:when>
+				<xsl:when test="$method='include' and @except">
+					<xsl:variable name="not">
+						<xsl:for-each select="tokenize($here/@except,' ')">
+							<not ident="{.}" />
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:variable name="includelist">
+						<xsl:for-each select="document($P5)">
+							<xsl:for-each select="key('EbyM',$module)">
+								<xsl:sort select="@ident" />
+								<xsl:variable name="e" select="@ident" />
+								<xsl:if test="not($not/not[@ident=$e])">
+									<xsl:value-of select="$e" />
+									<xsl:text> </xsl:text>
+								</xsl:if>
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:if test="not($includelist='')">
+						<xsl:attribute name="include"
+							select="normalize-space($includelist)" />
+					</xsl:if>
+				</xsl:when>
+				<xsl:when test="$method='include'">
+					<xsl:variable name="includelist">
+						<xsl:for-each select="document($P5)">
+							<xsl:for-each select="key('EbyM',$module)">
+								<xsl:sort select="@ident" />
+								<xsl:variable name="e" select="@ident" />
+								<xsl:for-each select="$orig">
+									<xsl:choose>
+										<xsl:when test="key('deletedE',$e)" />
+										<xsl:otherwise>
+											<xsl:value-of select="$e" />
+											<xsl:text> </xsl:text>
+										</xsl:otherwise>
+									</xsl:choose>
+								</xsl:for-each>
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:if test="not($includelist='')">
+						<xsl:attribute name="include"
+							select="normalize-space($includelist)" />
+					</xsl:if>
+				</xsl:when>
+				<xsl:when test="$method='except' and @include">
+					<xsl:variable name="yes">
+						<xsl:for-each select="tokenize($here/@include,' ')">
+							<yes ident="{.}" />
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:variable name="exceptlist">
+						<xsl:for-each select="document($P5)">
+							<xsl:for-each select="key('EbyM',$module)">
+								<xsl:sort select="@ident" />
+								<xsl:variable name="e" select="@ident" />
+								<xsl:for-each select="$orig">
+									<xsl:if test="not($yes/yes[@ident=$e])">
+										<xsl:value-of select="$e" />
+										<xsl:text> </xsl:text>
+									</xsl:if>
+								</xsl:for-each>
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:if test="not($exceptlist='')">
+						<xsl:attribute name="except"
+							select="normalize-space($exceptlist)" />
+					</xsl:if>
+				</xsl:when>
+				<xsl:when test="$method='except'">
+					<xsl:variable name="exceptlist">
+						<xsl:for-each select="document($P5)">
+							<xsl:for-each select="key('EbyM',$module)">
+								<xsl:sort select="@ident" />
+								<xsl:variable name="e" select="@ident" />
+								<xsl:for-each select="$orig">
+									<xsl:if test="key('deletedE',$e)">
+										<xsl:value-of select="$e" />
+										<xsl:text> </xsl:text>
+									</xsl:if>
+								</xsl:for-each>
+							</xsl:for-each>
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:if test="not($exceptlist='')">
+						<xsl:attribute name="except"
+							select="normalize-space($exceptlist)" />
+					</xsl:if>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:message terminate="yes">
+						Method
+						<xsl:value-of select="$method" />
+						not supported
+					</xsl:message>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template mode="stage2" match="specGrp[not(*)]" />
+
+	<xsl:template mode="stage2" match="specGrpRef">
+		<xsl:choose>
+			<xsl:when test="starts-with(@target,'#')">
+				<xsl:for-each select="id(substring(@target,2))">
+					<xsl:if test="*">
+						<specGrpRef target="#{@xml:id}" />
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:copy-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/makegraphicsanttask.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/makegraphicsanttask.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/makegraphicsanttask.xsl	(revision 2397)
@@ -1,141 +1,155 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.0"
-		xmlns:teix="http://www.tei-c.org/ns/Examples"
-		xmlns:smil="http://www.w3.org/ns/SMIL"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0">
-  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
-      <desc>
-         <p> TEI stylesheet to get list of graphics files and make an
-	 ant task to copy them</p>
-         <p>This software is dual-licensed:
+	xmlns:teix="http://www.tei-c.org/ns/Examples"
+	xmlns:smil="http://www.w3.org/ns/SMIL"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+	<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet"
+		type="stylesheet">
+		<desc>
+			<p> TEI stylesheet to get list of graphics files and make an
+				ant task to copy them</p>
+			<p>This software is dual-licensed:
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+				1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+				Unported License http://creativecommons.org/licenses/by-sa/3.0/
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+				2. http://www.opensource.org/licenses/BSD-2-Clause
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+				All rights reserved.
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+				Redistribution and use in source and binary forms, with or without
+				modification, are permitted provided that the following conditions are
+				met:
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+				* Redistributions of source code must retain the above copyright
+				notice, this list of conditions and the following disclaimer.
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
-</p>
-         <p>Author: See AUTHORS</p>
-         <p>Id: $Id: makegraphicsanttask.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
-         <p>Copyright: 2008, TEI Consortium</p>
-      </desc>
-   </doc>
-   <xsl:key name="G" match="tei:graphic[not(ancestor::teix:egXML)]"  use="1"/>
-   <xsl:key name="PB" match="tei:pb[@facs and not(@rend='none')]" use="1"/>
-   <xsl:key name="Timeline" match="tei:timeline" use="1"/>
-   <xsl:param name="mediaoverlay">false</xsl:param>
-   <xsl:param name="filePerPage">false</xsl:param>
-   <xsl:param name="inputDir">.</xsl:param>
-   <xsl:param name="mediaDir">word/media</xsl:param>
-   <xsl:template match="/">
-     <project xmlns="" basedir="." default="dist" name="imagecopy">
-       <target name="dist">
-	 <xsl:if test="key('PB',1) or key('G',1)">
-	   <mkdir>
-	     <xsl:attribute name="dir">
+				* Redistributions in binary form must reproduce the above copyright
+				notice, this list of conditions and the following disclaimer in the
+				documentation and/or other materials provided with the distribution.
+
+				This software is provided by the copyright holders and contributors
+				"as is" and any express or implied warranties, including, but not
+				limited to, the implied warranties of merchantability and fitness
+				for
+				a particular purpose are disclaimed. In no event shall the copyright
+				holder or contributors be liable for any direct, indirect,
+				incidental,
+				special, exemplary, or consequential damages (including, but not
+				limited to, procurement of substitute goods or services; loss of use,
+				data, or profits; or business interruption) however caused and on any
+				theory of liability, whether in contract, strict liability, or tort
+				(including negligence or otherwise) arising in any way out of the
+				use
+				of this software, even if advised of the possibility of such damage.
+			</p>
+			<p>Author: See AUTHORS</p>
+			<p>Id: $Id: makegraphicsanttask.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
+			<p>Copyright: 2008, TEI Consortium</p>
+		</desc>
+	</doc>
+	<xsl:key name="G"
+		match="tei:graphic[not(ancestor::teix:egXML)]" use="1" />
+	<xsl:key name="PB" match="tei:pb[@facs and not(@rend='none')]"
+		use="1" />
+	<xsl:key name="Timeline" match="tei:timeline" use="1" />
+	<xsl:param name="mediaoverlay">
+		false
+	</xsl:param>
+	<xsl:param name="filePerPage">
+		false
+	</xsl:param>
+	<xsl:param name="inputDir">
+		.
+	</xsl:param>
+	<xsl:param name="mediaDir">
+		word/media
+	</xsl:param>
+	<xsl:template match="/">
+		<project xmlns="" basedir="." default="dist" name="imagecopy">
+			<target name="dist">
+				<xsl:if test="key('PB',1) or key('G',1)">
+					<mkdir>
+						<xsl:attribute name="dir">
 	       <xsl:text>${outputTempDir}/</xsl:text>
-	       <xsl:value-of select="$mediaDir"/>
+	       <xsl:value-of select="$mediaDir" />
 	     </xsl:attribute>
-	   </mkdir>
-	 </xsl:if>
-	 <xsl:if test="$mediaoverlay='true' and key('Timeline',1)">
-	   <xsl:for-each select="key('Timeline',1)">
-	     <xsl:variable name="target">
-	       <xsl:text>${outputTempDir}/</xsl:text>
-	       <xsl:value-of select="$mediaDir"/>
-	       <xsl:text>/audio</xsl:text>
-	       <xsl:number level="any"/>
-	       <xsl:text>.</xsl:text>
-	       <xsl:value-of select="tokenize(@corresp,'\.')[last()]"/>
-	     </xsl:variable>
-	     <copy toFile="{$target}" file="{$inputDir}/{@corresp}"/>
-	   </xsl:for-each>
-	 </xsl:if>
-	 <xsl:for-each select="key('PB',1)">
-	   <xsl:variable name="F">
-	     <xsl:choose>
-	       <xsl:when test="starts-with(@facs,'#')">
-		 <xsl:for-each select="id(substring(@facs,2))">
-		   <xsl:value-of select="tei:graphic[1]/@url"/>
-		 </xsl:for-each>
-	       </xsl:when>
-	       <xsl:otherwise>
-		 <xsl:value-of select="@facs"/>
-	       </xsl:otherwise>
-	     </xsl:choose>
-	   </xsl:variable>
-	   <xsl:variable name="target">
-	     <xsl:text>${outputTempDir}/</xsl:text>
-	     <xsl:value-of select="$mediaDir"/>
-	     <xsl:text>/pageimage</xsl:text>
-	     <xsl:number level="any"/>
-	     <xsl:text>.</xsl:text>
-	     <xsl:value-of select="tokenize($F,'\.')[last()]"/>
-	   </xsl:variable>
-	   <xsl:choose>
-	     <xsl:when test="starts-with($F,'http')">
-	       <get src="{@url}" dest="{$target}"/>
-	     </xsl:when>
-	     <xsl:when test="starts-with($F,'/')">
-	       <copy toFile="{$target}" file="{@url}"/>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <copy toFile="{$target}" file="{$inputDir}/{$F}"/>
-	     </xsl:otherwise>
-	   </xsl:choose>
-	 </xsl:for-each>
+					</mkdir>
+				</xsl:if>
+				<xsl:if test="$mediaoverlay='true' and key('Timeline',1)">
+					<xsl:for-each select="key('Timeline',1)">
+						<xsl:variable name="target">
+							<xsl:text>${outputTempDir}/</xsl:text>
+							<xsl:value-of select="$mediaDir" />
+							<xsl:text>/audio</xsl:text>
+							<xsl:number level="any" />
+							<xsl:text>.</xsl:text>
+							<xsl:value-of
+								select="tokenize(@corresp,'\.')[last()]" />
+						</xsl:variable>
+						<copy toFile="{$target}" file="{$inputDir}/{@corresp}" />
+					</xsl:for-each>
+				</xsl:if>
+				<xsl:for-each select="key('PB',1)">
+					<xsl:variable name="F">
+						<xsl:choose>
+							<xsl:when test="starts-with(@facs,'#')">
+								<xsl:for-each select="id(substring(@facs,2))">
+									<xsl:value-of select="tei:graphic[1]/@url" />
+								</xsl:for-each>
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="@facs" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="target">
+						<xsl:text>${outputTempDir}/</xsl:text>
+						<xsl:value-of select="$mediaDir" />
+						<xsl:text>/pageimage</xsl:text>
+						<xsl:number level="any" />
+						<xsl:text>.</xsl:text>
+						<xsl:value-of select="tokenize($F,'\.')[last()]" />
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="starts-with($F,'http')">
+							<get src="{@url}" dest="{$target}" />
+						</xsl:when>
+						<xsl:when test="starts-with($F,'/')">
+							<copy toFile="{$target}" file="{@url}" />
+						</xsl:when>
+						<xsl:otherwise>
+							<copy toFile="{$target}" file="{$inputDir}/{$F}" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
 
-	 <xsl:for-each select="key('G',1)">
-	   <xsl:variable name="F">
-	     <xsl:value-of select="@url"/>
-	   </xsl:variable>
-	   <xsl:variable name="target">
-	     <xsl:text>${outputTempDir}/</xsl:text>
-	     <xsl:value-of select="$mediaDir"/>
-	     <xsl:text>/resource</xsl:text>
-	     <xsl:number level="any"/>
-	     <xsl:text>.</xsl:text>
-	     <xsl:value-of select="tokenize($F,'\.')[last()]"/>
-	   </xsl:variable>
-	   <xsl:choose>
-	     <xsl:when test="starts-with($F,'http')">
-	       <get src="{@url}" dest="{$target}"/>
-	     </xsl:when>
-	     <xsl:when test="starts-with($F,'/')">
-	       <copy toFile="{$target}" file="{@url}"/>
-	     </xsl:when>
-	     <xsl:otherwise>
-	       <copy toFile="{$target}" file="{$inputDir}/{@url}"/>
-	     </xsl:otherwise>
-	   </xsl:choose>
-	 </xsl:for-each>
-       </target>
-     </project>
- </xsl:template>
-   
- </xsl:stylesheet>
\ No newline at end of file
+				<xsl:for-each select="key('G',1)">
+					<xsl:variable name="F">
+						<xsl:value-of select="@url" />
+					</xsl:variable>
+					<xsl:variable name="target">
+						<xsl:text>${outputTempDir}/</xsl:text>
+						<xsl:value-of select="$mediaDir" />
+						<xsl:text>/resource</xsl:text>
+						<xsl:number level="any" />
+						<xsl:text>.</xsl:text>
+						<xsl:value-of select="tokenize($F,'\.')[last()]" />
+					</xsl:variable>
+					<xsl:choose>
+						<xsl:when test="starts-with($F,'http')">
+							<get src="{@url}" dest="{$target}" />
+						</xsl:when>
+						<xsl:when test="starts-with($F,'/')">
+							<copy toFile="{$target}" file="{@url}" />
+						</xsl:when>
+						<xsl:otherwise>
+							<copy toFile="{$target}" file="{$inputDir}/{@url}" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each>
+			</target>
+		</project>
+	</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/html2tei.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/html2tei.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/html2tei.xsl	(revision 2397)
@@ -1,377 +1,390 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet 
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    exclude-result-prefixes="tei xs"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    xmlns="http://www.tei-c.org/ns/1.0" 
-    xmlns:tei="http://www.tei-c.org/ns/1.0" 
-    version="2.0" 
-    xpath-default-namespace="http://www.w3.org/1999/xhtml">
+<xsl:stylesheet
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	exclude-result-prefixes="tei xs"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns="http://www.tei-c.org/ns/1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" version="2.0"
+	xpath-default-namespace="http://www.w3.org/1999/xhtml">
 
-  <xsl:output method="xml" indent="yes"/>
+	<xsl:output method="xml" indent="yes" />
 
-  <xsl:template match="html">
-    <TEI>
-      <xsl:apply-templates/>
-    </TEI>
-  </xsl:template>
+	<xsl:template match="html">
+		<TEI>
+			<xsl:apply-templates />
+		</TEI>
+	</xsl:template>
 
-  <xsl:template match="head">
-    <teiHeader>
-      <fileDesc>
-        <titleStmt>
-          <title>
-            <xsl:value-of select="title"/>
-          </title>
-          <author>
-            <xsl:value-of select="meta[@name='dc.Creator']/@content"/>
-          </author>
-        </titleStmt>
-        <publicationStmt>
-	  <p></p>
-        </publicationStmt>
-      </fileDesc>
-    </teiHeader>
-  </xsl:template>
+	<xsl:template match="head">
+		<teiHeader>
+			<fileDesc>
+				<titleStmt>
+					<title>
+						<xsl:value-of select="title" />
+					</title>
+					<author>
+						<xsl:value-of
+							select="meta[@name='dc.Creator']/@content" />
+					</author>
+				</titleStmt>
+				<publicationStmt>
+					<p></p>
+				</publicationStmt>
+			</fileDesc>
+		</teiHeader>
+	</xsl:template>
 
-  <xsl:template match="body">
-    <text>
-      <body>
-      <xsl:variable name="Body">
-	<HEAD level="1" magic="true">Start</HEAD>
-        <xsl:apply-templates/>
-      </xsl:variable>
+	<xsl:template match="body">
+		<text>
+			<body>
+				<xsl:variable name="Body">
+					<HEAD level="1" magic="true">Start</HEAD>
+					<xsl:apply-templates />
+				</xsl:variable>
 
-      <xsl:variable name="Body2">
-	<xsl:for-each select="$Body">
-	  <xsl:apply-templates mode="pass1"/>
-	</xsl:for-each>
-      </xsl:variable>
+				<xsl:variable name="Body2">
+					<xsl:for-each select="$Body">
+						<xsl:apply-templates mode="pass1" />
+					</xsl:for-each>
+				</xsl:variable>
 
-      <xsl:for-each select="$Body2">
-        <xsl:for-each-group select="tei:*" group-starting-with="tei:HEAD[@level='1']">
-          <xsl:choose>
-            <xsl:when test="self::tei:HEAD[@level='1']">
-	      <xsl:call-template name="group-by-section"/>
-            </xsl:when>
-            <xsl:otherwise>
-	      <xsl:call-template name="inSection"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:for-each-group>
-      </xsl:for-each>
-    </body>
-    </text>
-  </xsl:template>
+				<xsl:for-each select="$Body2">
+					<xsl:for-each-group select="tei:*"
+						group-starting-with="tei:HEAD[@level='1']">
+						<xsl:choose>
+							<xsl:when test="self::tei:HEAD[@level='1']">
+								<xsl:call-template name="group-by-section" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template name="inSection" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each-group>
+				</xsl:for-each>
+			</body>
+		</text>
+	</xsl:template>
 
 
-  <xsl:template name="group-by-section">
-    <xsl:variable name="ThisHeader" select="number(@level)"/>
-    <xsl:variable name="NextHeader" select="number(@level)+1"/>
-    <xsl:choose>
-      <xsl:when test="@magic">
-	  <xsl:for-each-group select="current-group() except ."
-			      group-starting-with="tei:HEAD[number(@level)=$NextHeader]">
-	    <xsl:choose>
-	      <xsl:when test="self::tei:HEAD">
-		<xsl:call-template name="group-by-section"/>
-	      </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:call-template name="inSection"/>
-	    </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:for-each-group>
-      </xsl:when>
-      <xsl:otherwise>
-	<div>
-	  <xsl:if test="@style">
-	    <xsl:attribute name="rend" select="@style"/>
-	  </xsl:if>
-	  <xsl:if test="not(@interpolated='true')">
-	    <head>
-	      <xsl:apply-templates mode="pass1"/>
-	    </head>
-	  </xsl:if>
-	  <xsl:for-each-group select="current-group() except ."
-			      group-starting-with="tei:HEAD[number(@level)=$NextHeader]">
-	    <xsl:choose>
-	      <xsl:when test="self::tei:HEAD">
-		<xsl:call-template name="group-by-section"/>
-	      </xsl:when>
-	    <xsl:otherwise>
-		<xsl:call-template name="inSection"/>
-	    </xsl:otherwise>
-	    </xsl:choose>
-	  </xsl:for-each-group>
-	</div>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template name="group-by-section">
+		<xsl:variable name="ThisHeader" select="number(@level)" />
+		<xsl:variable name="NextHeader" select="number(@level)+1" />
+		<xsl:choose>
+			<xsl:when test="@magic">
+				<xsl:for-each-group
+					select="current-group() except ."
+					group-starting-with="tei:HEAD[number(@level)=$NextHeader]">
+					<xsl:choose>
+						<xsl:when test="self::tei:HEAD">
+							<xsl:call-template name="group-by-section" />
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:call-template name="inSection" />
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:for-each-group>
+			</xsl:when>
+			<xsl:otherwise>
+				<div>
+					<xsl:if test="@style">
+						<xsl:attribute name="rend" select="@style" />
+					</xsl:if>
+					<xsl:if test="not(@interpolated='true')">
+						<head>
+							<xsl:apply-templates mode="pass1" />
+						</head>
+					</xsl:if>
+					<xsl:for-each-group
+						select="current-group() except ."
+						group-starting-with="tei:HEAD[number(@level)=$NextHeader]">
+						<xsl:choose>
+							<xsl:when test="self::tei:HEAD">
+								<xsl:call-template name="group-by-section" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:call-template name="inSection" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:for-each-group>
+				</div>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-  <xsl:template name="inSection">
-    <xsl:for-each-group select="current-group()"
+	<xsl:template name="inSection">
+		<xsl:for-each-group select="current-group()"
 			group-adjacent="if (self::tei:GLOSS)
 					then 1
-					else 2">      
-      <xsl:choose>
-	<xsl:when test="current-grouping-key()=1">
-	  <list type="gloss">
-	    <xsl:for-each select="current-group()">
-	      <xsl:element name="{@n}">
-		<xsl:apply-templates mode="pass2"/>
-	      </xsl:element>
-	    </xsl:for-each>
-	  </list>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:for-each select="current-group()">
-	    <xsl:apply-templates select="." mode="pass2"/>
-	  </xsl:for-each>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each-group>
-  </xsl:template>
+					else 2">
+			<xsl:choose>
+				<xsl:when test="current-grouping-key()=1">
+					<list type="gloss">
+						<xsl:for-each select="current-group()">
+							<xsl:element name="{@n}">
+								<xsl:apply-templates mode="pass2" />
+							</xsl:element>
+						</xsl:for-each>
+					</list>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:for-each select="current-group()">
+						<xsl:apply-templates select="." mode="pass2" />
+					</xsl:for-each>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+	</xsl:template>
 
-  <xsl:template match="h1|h2|h3|h4|h5|h6|h7">
-    <HEAD level="{substring(local-name(),2,1)}">
-      <xsl:apply-templates select="@*"/>
-      <xsl:apply-templates/>
-    </HEAD>
-  </xsl:template>
-		
-  <xsl:template match="@*|text()|comment()|processing-instruction()" mode="pass1">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="h1|h2|h3|h4|h5|h6|h7">
+		<HEAD level="{substring(local-name(),2,1)}">
+			<xsl:apply-templates select="@*" />
+			<xsl:apply-templates />
+		</HEAD>
+	</xsl:template>
 
-  <xsl:template match="tei:p[not(node())]"
-		mode="pass1"/>
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="pass1">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="tei:HEAD" mode="pass1">
-    <xsl:if test="preceding-sibling::tei:HEAD">
-      <xsl:variable name="prev"
-		    select="xs:integer(number(preceding-sibling::tei:HEAD[1]/@level))"/>
-      <xsl:variable name="current"
-		    select="xs:integer(number(@level))"/>
-	<xsl:if test="($current - $prev) &gt;1 ">
-	  <!--<xsl:message>Walk from <xsl:value-of select="$prev"/> to <xsl:value-of select="$current"/></xsl:message>-->
-	  <xsl:for-each
-	      select="$prev + 1   to $current - 1 ">
-	    <HEAD interpolated='true' level="{.}"/>
-	  </xsl:for-each>
-	</xsl:if>
-    </xsl:if>
-    <xsl:copy>
-    <xsl:apply-templates
-	select="*|@*|processing-instruction()|comment()|text()"
-	mode="pass1"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="tei:p[not(node())]" mode="pass1" />
 
-  <xsl:template match="*" mode="pass1">
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass1"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="tei:HEAD" mode="pass1">
+		<xsl:if test="preceding-sibling::tei:HEAD">
+			<xsl:variable name="prev"
+				select="xs:integer(number(preceding-sibling::tei:HEAD[1]/@level))" />
+			<xsl:variable name="current"
+				select="xs:integer(number(@level))" />
+			<xsl:if test="($current - $prev) &gt;1 ">
+				<!--<xsl:message>Walk from <xsl:value-of select="$prev"/> to <xsl:value-of 
+					select="$current"/></xsl:message> -->
+				<xsl:for-each select="$prev + 1   to $current - 1 ">
+					<HEAD interpolated='true' level="{.}" />
+				</xsl:for-each>
+			</xsl:if>
+		</xsl:if>
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass1" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="@*|text()|comment()|processing-instruction()" mode="pass2">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="*" mode="pass1">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass1" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="tei:p[not(*) and normalize-space(.)='']" mode="pass2"/>
+	<xsl:template
+		match="@*|text()|comment()|processing-instruction()" mode="pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="*" mode="pass2">
-    <xsl:copy>
-      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template
+		match="tei:p[not(*) and normalize-space(.)='']" mode="pass2" />
 
-  <xsl:template match="br">
-    <lb/>
-  </xsl:template>
+	<xsl:template match="*" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" mode="pass2" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="a">
-    <xsl:choose>
-      <xsl:when test="@href">
-        <ref target="{@href}">
-          <xsl:apply-templates/>
-        </ref>
-      </xsl:when>
-      <xsl:when test="@name">
-        <anchor>
-          <xsl:attribute name="xml:id" select="@name"/>
-        </anchor>
-        <xsl:apply-templates/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:template>
+	<xsl:template match="br">
+		<lb />
+	</xsl:template>
 
-  <xsl:template match="li">
-    <item>
-      <xsl:apply-templates/>
-    </item>
-  </xsl:template>
+	<xsl:template match="a">
+		<xsl:choose>
+			<xsl:when test="@href">
+				<ref target="{@href}">
+					<xsl:apply-templates />
+				</ref>
+			</xsl:when>
+			<xsl:when test="@name">
+				<anchor>
+					<xsl:attribute name="xml:id" select="@name" />
+				</anchor>
+				<xsl:apply-templates />
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="div">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="li">
+		<item>
+			<xsl:apply-templates />
+		</item>
+	</xsl:template>
 
-  <xsl:template match="link">
-</xsl:template>
+	<xsl:template match="div">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="meta">
-</xsl:template>
+	<xsl:template match="link">
+	</xsl:template>
 
-  <xsl:template match="p">
-    <p>
-      <xsl:apply-templates select="*|@*|text()|comment()"/>
-    </p>
-  </xsl:template>
-  <xsl:template match="p[@class='note']">
-    <note>
-      <xsl:apply-templates select="*|@*|text()|comment()"/>
-    </note>
-  </xsl:template>
-  <xsl:template match="title">
-</xsl:template>
-  <xsl:template match="ul">
-    <list type="unordered">
-      <xsl:apply-templates/>
-    </list>
-  </xsl:template>
-  <xsl:template match="ol">
-    <list type="ordered">
-      <xsl:apply-templates/>
-    </list>
-  </xsl:template>
-  <xsl:template match="em">
-    <hi rend="italic">
-      <xsl:apply-templates/>
-    </hi>
-  </xsl:template>
-  <xsl:template match="img">
-    <graphic url="{@src}">
-      <xsl:for-each select="@width">
-        <xsl:attribute name="width">
-          <xsl:value-of select="."/>
-          <xsl:analyze-string select="." regex="^[0-9]+$">
+	<xsl:template match="meta">
+	</xsl:template>
+
+	<xsl:template match="p">
+		<p>
+			<xsl:apply-templates
+				select="*|@*|text()|comment()" />
+		</p>
+	</xsl:template>
+	<xsl:template match="p[@class='note']">
+		<note>
+			<xsl:apply-templates
+				select="*|@*|text()|comment()" />
+		</note>
+	</xsl:template>
+	<xsl:template match="title">
+	</xsl:template>
+	<xsl:template match="ul">
+		<list type="unordered">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
+	<xsl:template match="ol">
+		<list type="ordered">
+			<xsl:apply-templates />
+		</list>
+	</xsl:template>
+	<xsl:template match="em">
+		<hi rend="italic">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
+	<xsl:template match="img">
+		<graphic url="{@src}">
+			<xsl:for-each select="@width">
+				<xsl:attribute name="width">
+          <xsl:value-of select="." />
+          <xsl:analyze-string select="."
+					regex="^[0-9]+$">
             <xsl:matching-substring>
               <xsl:text>px</xsl:text>
             </xsl:matching-substring>
           </xsl:analyze-string>
         </xsl:attribute>
-      </xsl:for-each>
-      <xsl:for-each select="@height">
-        <xsl:attribute name="height">
-          <xsl:value-of select="."/>
-          <xsl:analyze-string select="." regex="^[0-9]+$">
+			</xsl:for-each>
+			<xsl:for-each select="@height">
+				<xsl:attribute name="height">
+          <xsl:value-of select="." />
+          <xsl:analyze-string select="."
+					regex="^[0-9]+$">
             <xsl:matching-substring>
               <xsl:text>px</xsl:text>
             </xsl:matching-substring>
           </xsl:analyze-string>
         </xsl:attribute>
-      </xsl:for-each>
-    </graphic>
-  </xsl:template>
+			</xsl:for-each>
+		</graphic>
+	</xsl:template>
 
-  <xsl:template match="pre">
-    <eg>
-      <xsl:apply-templates/>
-    </eg>
-  </xsl:template>
+	<xsl:template match="pre">
+		<eg>
+			<xsl:apply-templates />
+		</eg>
+	</xsl:template>
 
-  <xsl:template match="strong">
-    <hi rend="bold">
-      <xsl:apply-templates/>
-    </hi>
-  </xsl:template>
+	<xsl:template match="strong">
+		<hi rend="bold">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-  <xsl:template match="sup">
-    <hi rend="sup">
-      <xsl:apply-templates/>
-    </hi>
-  </xsl:template>
+	<xsl:template match="sup">
+		<hi rend="sup">
+			<xsl:apply-templates />
+		</hi>
+	</xsl:template>
 
-  <xsl:template match="@class">
-    <xsl:attribute name="rend" select="."/>
-  </xsl:template>
+	<xsl:template match="@class">
+		<xsl:attribute name="rend" select="." />
+	</xsl:template>
 
-  <xsl:template match="@id">
-    <xsl:attribute name="xml:id" select="."/>
-  </xsl:template>
+	<xsl:template match="@id">
+		<xsl:attribute name="xml:id" select="." />
+	</xsl:template>
 
-  <xsl:template match="@title"/>
+	<xsl:template match="@title" />
 
-  <xsl:template match="@*|comment()|text()">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="@*|comment()|text()">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="span">
-    <hi>
-      <xsl:if test="@class">
-	<xsl:attribute name="rend" select="@class"/>
-      </xsl:if>
-      <xsl:apply-templates select="@*|*|text()"/>
-    </hi>
-  </xsl:template>
+	<xsl:template match="span">
+		<hi>
+			<xsl:if test="@class">
+				<xsl:attribute name="rend" select="@class" />
+			</xsl:if>
+			<xsl:apply-templates select="@*|*|text()" />
+		</hi>
+	</xsl:template>
 
-  <xsl:template match="b">
-    <hi rend="bold">
-      <xsl:apply-templates select="@*|*|text()"/>
-    </hi>
-  </xsl:template>
+	<xsl:template match="b">
+		<hi rend="bold">
+			<xsl:apply-templates select="@*|*|text()" />
+		</hi>
+	</xsl:template>
 
-  <xsl:template match="i">
-    <hi rend="italic">
-      <xsl:apply-templates select="@*|*|text()"/>
-    </hi>
-  </xsl:template>
+	<xsl:template match="i">
+		<hi rend="italic">
+			<xsl:apply-templates select="@*|*|text()" />
+		</hi>
+	</xsl:template>
 
-  <xsl:template match="font">
-      <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="font">
+		<xsl:apply-templates />
+	</xsl:template>
 
-  <xsl:template match="blockquote">
-    <quote>
-      <xsl:apply-templates select="@*|*|text()"/>
-    </quote>
-  </xsl:template>
+	<xsl:template match="blockquote">
+		<quote>
+			<xsl:apply-templates select="@*|*|text()" />
+		</quote>
+	</xsl:template>
 
-  <xsl:template match="tt">
-    <code>
-      <xsl:apply-templates select="@*|*|text()"/>
-    </code>
-  </xsl:template>
+	<xsl:template match="tt">
+		<code>
+			<xsl:apply-templates select="@*|*|text()" />
+		</code>
+	</xsl:template>
 
-  <xsl:template match="code">
-    <eg>
-      <xsl:apply-templates select="@*|*|text()"/>
-    </eg>
-  </xsl:template>
+	<xsl:template match="code">
+		<eg>
+			<xsl:apply-templates select="@*|*|text()" />
+		</eg>
+	</xsl:template>
 
-  <xsl:template match="table">
-    <table>
-      <xsl:apply-templates select="@*|*|text()"/>
-    </table>
-  </xsl:template>
+	<xsl:template match="table">
+		<table>
+			<xsl:apply-templates select="@*|*|text()" />
+		</table>
+	</xsl:template>
 
-  <xsl:template match="td">
-    <cell>
-      <xsl:apply-templates select="@*|*|text()"/>
-    </cell>
-  </xsl:template>
+	<xsl:template match="td">
+		<cell>
+			<xsl:apply-templates select="@*|*|text()" />
+		</cell>
+	</xsl:template>
 
-  <xsl:template match="tr">
-    <row>
-      <xsl:apply-templates select="@*|*|text()"/>
-    </row>
-  </xsl:template>
+	<xsl:template match="tr">
+		<row>
+			<xsl:apply-templates select="@*|*|text()" />
+		</row>
+	</xsl:template>
 
-  <xsl:template match="hr"/>
+	<xsl:template match="hr" />
 
-  <xsl:template match="*">
-    <xsl:message>UNKNOWN TAG <xsl:value-of select="name()"/></xsl:message>
-    <xsl:apply-templates/>
-  </xsl:template>
+	<xsl:template match="*">
+		<xsl:message>
+			UNKNOWN TAG
+			<xsl:value-of select="name()" />
+		</xsl:message>
+		<xsl:apply-templates />
+	</xsl:template>
 
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/ImageInfo/antlib.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/ImageInfo/antlib.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/ImageInfo/antlib.xml	(revision 2397)
@@ -1,4 +1,5 @@
 <?xml version="1.0"?>
 <antlib>
-	<taskdef name="generate-image-size-report" classname="ImageTask" />
+	<taskdef name="generate-image-size-report"
+		classname="ImageTask" />
 </antlib>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/addlang.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/addlang.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/addlang.xsl	(revision 2397)
@@ -1,48 +1,56 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
-   <xsl:output encoding="utf-8" method="xml" indent="yes"/>
+	<xsl:output encoding="utf-8" method="xml" indent="yes" />
 
-   <xsl:param name="newfile"/>
-   <xsl:param name="newlang"/>
-   <xsl:param name="overwrite">true</xsl:param>
+	<xsl:param name="newfile" />
+	<xsl:param name="newlang" />
+	<xsl:param name="overwrite">
+		true
+	</xsl:param>
 
-   <xsl:key name="K" match="entry" use="key"/>
+	<xsl:key name="K" match="entry" use="key" />
 
-   <xsl:template match="@*|processing-instruction()|comment()|text()">
-      <xsl:copy/>
-   </xsl:template>
+	<xsl:template
+		match="@*|processing-instruction()|comment()|text()">
+		<xsl:copy />
+	</xsl:template>
 
-   <xsl:template match="text">
-      <xsl:choose>
-         <xsl:when test="not(@xml:lang) or not(@xml:lang=$newlang)">
-            <xsl:copy-of select="."/>
-         </xsl:when>
-         <xsl:when test="$overwrite='false' and @xml:lang=$newlang">
-            <xsl:copy-of select="."/>
-         </xsl:when>
-      </xsl:choose>
+	<xsl:template match="text">
+		<xsl:choose>
+			<xsl:when test="not(@xml:lang) or not(@xml:lang=$newlang)">
+				<xsl:copy-of select="." />
+			</xsl:when>
+			<xsl:when test="$overwrite='false' and @xml:lang=$newlang">
+				<xsl:copy-of select="." />
+			</xsl:when>
+		</xsl:choose>
 
-   </xsl:template>
+	</xsl:template>
 
-   <xsl:template match="*">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-   </xsl:template>
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-   <xsl:template match="entry">
-      <xsl:variable name="k" select="key"/>
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
-         <xsl:for-each select="document($newfile)/i18n">
-            <xsl:for-each select="key('K',$k)">
-               <xsl:message>Go <xsl:value-of select="$k"/>
-               </xsl:message>
-	              <xsl:copy-of select="text[@xml:lang=$newlang]"/>
-            </xsl:for-each>
-         </xsl:for-each>
-      </xsl:copy>
+	<xsl:template match="entry">
+		<xsl:variable name="k" select="key" />
+		<xsl:copy>
+			<xsl:apply-templates
+				select="*|@*|processing-instruction()|comment()|text()" />
+			<xsl:for-each select="document($newfile)/i18n">
+				<xsl:for-each select="key('K',$k)">
+					<xsl:message>
+						Go
+						<xsl:value-of select="$k" />
+					</xsl:message>
+					<xsl:copy-of select="text[@xml:lang=$newlang]" />
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:copy>
 
-   </xsl:template>
+	</xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/extract-xsl-from-sch.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/extract-xsl-from-sch.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/extract-xsl-from-sch.xsl	(revision 2397)
@@ -1,78 +1,77 @@
 <xsl:stylesheet
-    xmlns:s="http://www.ascc.net/xml/schematron"
-    xmlns:tei="http://www.tei-c.org/ns/1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    xmlns:i="http://www.iso.org/ns/1.0"
-    xmlns:XSL="http://www.w3.org/1999/XSL/TransformAlias" 
-    exclude-result-prefixes="xsl s" 
-    version="2.0"
->
+	xmlns:s="http://www.ascc.net/xml/schematron"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:i="http://www.iso.org/ns/1.0"
+	xmlns:XSL="http://www.w3.org/1999/XSL/TransformAlias"
+	exclude-result-prefixes="xsl s" version="2.0">
 
-<xsl:namespace-alias stylesheet-prefix="XSL" result-prefix="xsl"/>
+	<xsl:namespace-alias stylesheet-prefix="XSL"
+		result-prefix="xsl" />
 
-<xsl:key name="CONTEXTS" use="." match="@context"/>
-<xsl:key name="ALLCONTEXTS" use="1" match="@context"/>
-<xsl:output method="xml" indent="yes" encoding="utf-8"/>
+	<xsl:key name="CONTEXTS" use="." match="@context" />
+	<xsl:key name="ALLCONTEXTS" use="1" match="@context" />
+	<xsl:output method="xml" indent="yes" encoding="utf-8" />
 
 
-<xsl:template match="/">
-  <XSL:stylesheet
-      xmlns:i="http://www.iso.org/ns/1.0"
-      xmlns:tei="http://www.tei-c.org/ns/1.0"
-      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-      version="2.0"
-      >
-   
-   <xsl:for-each select="key('ALLCONTEXTS',1)">
-     <xsl:if test="generate-id(.)=generate-id(key('CONTEXTS',.)[1])">
-       <XSL:template match="{.}" mode="checkSchematron">
-	 <xsl:for-each select="key('CONTEXTS',.)">
-	   <xsl:for-each select="parent::s:rule">
-	     <xsl:for-each select="s:assert|s:report">
-	       <xsl:choose>
-		 <xsl:when test="self::s:assert">
-		   <XSL:if test="not({@test})">
-		     <XSL:call-template name="generateError">
-		       <XSL:with-param name="message">
-			 <xsl:value-of select="text()"/>
-		       </XSL:with-param>
-		     </XSL:call-template>
-		   </XSL:if>
-		 </xsl:when>
-		 <xsl:when test="self::s:report">
-		   <XSL:if test="{@test}">
-		     <XSL:call-template name="generateError">
-		       <XSL:with-param name="message">
-			 <xsl:value-of select="text()"/>
-		       </XSL:with-param>
-		     </XSL:call-template>
-		   </XSL:if>
-		 </xsl:when>
-	       </xsl:choose>
-	     </xsl:for-each>
-	   </xsl:for-each>
-	 </xsl:for-each>
-	 <XSL:call-template name="copyIt"/>
-       </XSL:template>
-     </xsl:if>
-  </xsl:for-each>
+	<xsl:template match="/">
+		<XSL:stylesheet xmlns:i="http://www.iso.org/ns/1.0"
+			xmlns:tei="http://www.tei-c.org/ns/1.0"
+			xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
 
-  <XSL:template match="processing-instruction()" mode="checkSchematron">
-    <XSL:call-template name="copyMe"/>
-  </XSL:template>
-  
-  <XSL:template match="@*|text()|comment()" mode="checkSchematron">
-    <XSL:call-template name="copyMe"/>
-  </XSL:template>
-  
-  <XSL:template match="*" mode="checkSchematron">
-    <XSL:call-template name="copyIt"/>
-  </XSL:template>
+			<xsl:for-each select="key('ALLCONTEXTS',1)">
+				<xsl:if
+					test="generate-id(.)=generate-id(key('CONTEXTS',.)[1])">
+					<XSL:template match="{.}" mode="checkSchematron">
+						<xsl:for-each select="key('CONTEXTS',.)">
+							<xsl:for-each select="parent::s:rule">
+								<xsl:for-each select="s:assert|s:report">
+									<xsl:choose>
+										<xsl:when test="self::s:assert">
+											<XSL:if test="not({@test})">
+												<XSL:call-template name="generateError">
+													<XSL:with-param name="message">
+														<xsl:value-of select="text()" />
+													</XSL:with-param>
+												</XSL:call-template>
+											</XSL:if>
+										</xsl:when>
+										<xsl:when test="self::s:report">
+											<XSL:if test="{@test}">
+												<XSL:call-template name="generateError">
+													<XSL:with-param name="message">
+														<xsl:value-of select="text()" />
+													</XSL:with-param>
+												</XSL:call-template>
+											</XSL:if>
+										</xsl:when>
+									</xsl:choose>
+								</xsl:for-each>
+							</xsl:for-each>
+						</xsl:for-each>
+						<XSL:call-template name="copyIt" />
+					</XSL:template>
+				</xsl:if>
+			</xsl:for-each>
 
+			<XSL:template match="processing-instruction()"
+				mode="checkSchematron">
+				<XSL:call-template name="copyMe" />
+			</XSL:template>
 
-</XSL:stylesheet>
+			<XSL:template match="@*|text()|comment()"
+				mode="checkSchematron">
+				<XSL:call-template name="copyMe" />
+			</XSL:template>
 
+			<XSL:template match="*" mode="checkSchematron">
+				<XSL:call-template name="copyIt" />
+			</XSL:template>
 
-</xsl:template>
 
+		</XSL:stylesheet>
+
+
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/folint.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/folint.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/folint.xsl	(revision 2397)
@@ -1,3224 +1,4422 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- ===================================================================
+<!-- =================================================================== 
+	This stylesheet is meant as a replacement to a DTD for XSL Formatting objects. 
+	It checks structural validity of an XSL FO document, issuing messages at 
+	inconsistencies found. As compared to DTD, stylesheet validation offers the 
+	following advantages: 1. More flexibility in controlling the document structure. 
+	For example, the stylesheet can control the following aspects of the document 
+	structure that a DTD cannot handle: - check for block-level content through 
+	intermediate fo:wrapper elements; - exclude contents of fo:instream-foreign-object 
+	from validation; - check mutual exclusion of @internal-destination and @external-destination; 
+	- check fo:marker/fo:initial-property-set position in a mixed content model; 
+	- check that fo:marker is a descendant of fo:flow; - check that a footnote 
+	may not contain other footnotes or floats; - etc. 2. Improved readability 
+	of validation error messages. Frequent errors can get a separate message 
+	that explains the problem and eventually offers a hint to fix it. (In many 
+	respects, this is still a TODO :-)). 3. Namespace awareness. The namespace 
+	prefix need not be fixed anymore (as it was the case with DTD validation). 
+	4. Smart handling of attribute values - "partial" validation. This stylesheet 
+	catches misprints in predefined attribute values but passes expressions through. 
+	************************************************************************* 
+	IMPLEMENTATION NOTES 1. Stylesheet structure and techniques. The structure 
+	of this stylesheet is trivial: we apply templates to each elements and attributes, 
+	and issue an error message each time there is something suspicious about 
+	the document structure. There is a dozen of named templates that assist us 
+	in performing common tasks. 1.1. Validating element names and content models 
+	Each element described in XSL 1.0 has a matching template, and all incorrectly 
+	named or missplaced elements are catched by a default rule (redefined to 
+	complain about invalid elements). Inside each template, there is a number 
+	of checks for obligatory attributes and content model. The document-node 
+	template checks namespace correctness and presence of fo:root as the top 
+	node. 1.2. Validating attribute occurrency By design of XSL, almost every 
+	property may be in principle specified anywhere. Attribute occurrence can 
+	be reliably limited only in the following places: - fo:layout-master-set 
+	and its descendants; - terminal inline elements - fo:character, fo:page-number, 
+	fo:page-number-citation, fo:initial-property-set; - graphics - fo:external-graphics, 
+	fo:instream-foreign-object. I used the following approach to achieve this: 
+	the default rule for @* complains about incorrect attribute. However, the 
+	priority for this default rule differs across the element tree: * -2 for 
+	fo:root, fo:page-sequence and all descendants of fo:page-sequence; * 2 for 
+	fo:simple-page-master and its descendants; * 4 for fo:layout-master-set and 
+	its descendants other than fo:simple-master/fo:region-*. For each correct 
+	attribute, the stylesheet contains an enabling template. Attributes that 
+	can occur only inside fo:page-sequence get enabling templates with default 
+	priority; attributes permitted on region descriptors get priority="3"; attributes 
+	of other fo:layout-master-set children will have priority="5". To limit attribute 
+	occurrence on atomic inlines and graphics, there are two disabling named 
+	templates defined. They are added inside enabling templates. 1.3. Validating 
+	attribute values. Validation of attribute values is hard in XSL FO because 
+	of expressions: even properties with a closed list of possible values can 
+	be specified as expressions. This stylesheet validates attributes "partially": 
+	- attributes that can get only fixed values are validated only if their value 
+	does not contain a pair of parentheses (because any expression inside them 
+	should inevitably contain a function call); - attributes that can get numeric 
+	values are validated if their value does not contain any of the following: 
+	* parentheses; * math operators; * digits. This gives a reliable method of 
+	catching mistyped values of attributes. There are three cases where additional 
+	processing is necessary: A. Validation of URIs. Attributes that may get URI 
+	values are checked to be of the form 'url(...)'. B. Validation of 'content-type' 
+	attribute. It is checked to start with either 'content-type:' or 'namespace:'. 
+	C. Validation of 'text-align' attribute. This attribute may have an arbitrary 
+	string as its value; therefore, its correct validation is impossible - a 
+	mistype in any of the fixed values turns it into a 'string'. Because 'string' 
+	alignment is rare, and fixed values for text-align are ubiquitous, I felt 
+	necessary to introduce some heuristics to distinguish between table-alignment 
+	strings and mistyped predefined tokens. The heuristics is as follows: if 
+	a value contains only alphabetic characters, it's a keyword and should match 
+	one of the predefined tokens. Otherwise, it's a string and should not be 
+	spellchecked. (Frankly speaking, a 'string' value of "left" cannot be distinguished 
+	from a token 'left'. The property is really poorly designed.) 2. This stylesheet 
+	also contains checks for some RenderX extensions to XSL FO. They are placed 
+	into a separate namespace, and should not interfere with the correct validation 
+	of conformant XSL FO documents. ==================================================================== -->
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:rx="http://www.renderx.com/XSL/Extensions" version="1.0"
+	exclude-result-prefixes="fo rx">
 
-This stylesheet is meant as a replacement to a DTD for XSL Formatting
-objects. It checks structural validity of an XSL FO document, issuing
-messages at inconsistencies found. As compared to DTD, stylesheet
-validation offers the following advantages:
+	<xsl:output method="xml" omit-xml-declaration="yes" />
 
-1. More flexibility in controlling the document structure. For example,
-the stylesheet can control the following aspects of the document
-structure that a DTD cannot handle:
+	<!-- Strictness level. Currently used levels: 0 (loose), 1 (normal), 2 (pedantic) -->
+	<xsl:param name="strictness">
+		1
+	</xsl:param>
 
-  - check for block-level content through intermediate fo:wrapper elements;
-  - exclude contents of fo:instream-foreign-object from validation;
-  - check mutual exclusion of @internal-destination and @external-destination;
-  - check fo:marker/fo:initial-property-set position in a mixed content model;
-  - check that fo:marker is a descendant of fo:flow;
-  - check that a footnote may not contain other footnotes or floats;
-  - etc.
+	<!-- =================================== -->
+	<!-- Match topmost node - must be <root> -->
 
-2. Improved readability of validation error messages. Frequent errors can get
-a separate message that explains the problem and eventually offers a hint
-to fix it. (In many respects, this is still a TODO :-)).
+	<xsl:template match="/">
+		<xsl:if test="not(fo:root)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					<xsl:choose>
+						<xsl:when test="local-name(*[1]) = 'root'">
+							<xsl:text>Incorrect namespace at top element - should be 'http://www.w3.org/1999/XSL/Format'</xsl:text>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:text>Incorrect top element - should be 'root'</xsl:text>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-3. Namespace awareness. The namespace prefix need not be fixed anymore
-(as it was the case with DTD validation).
+		<xsl:apply-templates select="fo:root" />
+	</xsl:template>
 
-4. Smart handling of attribute values - "partial" validation. This stylesheet
-catches misprints in predefined attribute values but passes expressions through.
 
-*************************************************************************
+	<!-- =================================== -->
+	<!-- Root -->
 
-IMPLEMENTATION NOTES
+	<xsl:template match="fo:root">
+		<xsl:if test="@*[.='inherit']">
+			<xsl:call-template name="print-warning">
+				<xsl:with-param name="msg">
+					Attributes with value of 'inherit' are meaningless on '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-1. Stylesheet structure and techniques.
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-The structure of this stylesheet is trivial: we apply templates to each elements
-and attributes, and issue an error message each time there is something suspicious
-about the document structure. There is a dozen of named templates that assist us
-in performing common tasks.
+		<xsl:apply-templates
+			select="*[not(self::rx:meta-info                                   or self::fo:layout-master-set                                   or self::fo:declarations                                   or self::rx:outline                                   or self::fo:page-sequence)]"
+			mode="report-intrusive-elements" />
 
-1.1. Validating element names and content models
+		<xsl:if test="not(fo:layout-master-set)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'layout-master-set' is required as a child of '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-Each element described in XSL 1.0 has a matching template, and all
-incorrectly named or missplaced elements are catched by a default rule
-(redefined to complain about invalid elements). Inside each template,
-there is a number of checks for obligatory attributes and content model.
-The document-node template checks namespace correctness and presence
-of fo:root as the top node.
+		<xsl:if test="count(fo:layout-master-set) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:layout-master-set[1])" />
+					' element as a child of '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-1.2. Validating attribute occurrency
+		<xsl:if test="count(fo:declarations) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:declarations[1])" />
+					' element as a child of '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-By design of XSL, almost every property may be in principle specified
-anywhere. Attribute occurrence can be reliably limited only in the
-following places:
+		<xsl:if test="not(fo:page-sequence)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There should be at least one 'page-sequence' element as a child of
+					'
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-  - fo:layout-master-set and its descendants;
-  - terminal inline elements - fo:character, fo:page-number,
-    fo:page-number-citation, fo:initial-property-set;
-  - graphics - fo:external-graphics, fo:instream-foreign-object.
+		<xsl:if
+			test="fo:layout-master-set[preceding-sibling::fo:declarations]">
+			<xsl:call-template name="print-warning">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:layout-master-set[1])" />
+					' shall precede '
+					<xsl:value-of select="name(fo:declarations[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-I used the following approach to achieve this: the default rule
-for @* complains about incorrect attribute. However, the priority
-for this default rule differs across the element tree:
+		<xsl:if
+			test="fo:declarations[preceding-sibling::fo:page-sequence]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:declarations[1])" />
+					' shall be placed before the first '
+					<xsl:value-of select="name(fo:page-sequence[1])" />
+					' element.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
- * -2 for fo:root, fo:page-sequence and all descendants
-   of fo:page-sequence;
+		<xsl:if
+			test="fo:layout-master-set[preceding-sibling::fo:page-sequence]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:layout-master-set[1])" />
+					' shall be placed before the first '
+					<xsl:value-of select="name(fo:page-sequence[1])" />
+					' element.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
- *  2 for fo:simple-page-master and its descendants;
+		<!-- Tests of RenderX extension elements -->
+		<xsl:if test="count(rx:meta-info) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(rx:meta-info[1])" />
+					' element as a child of '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
- *  4 for fo:layout-master-set and its descendants other than
-      fo:simple-master/fo:region-*.
+		<xsl:if test="count(rx:outline) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(rx:outline[1])" />
+					' element as a child of '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-For each correct attribute, the stylesheet contains an enabling template.
-Attributes that can occur only inside fo:page-sequence get enabling
-templates with default priority; attributes permitted on region
-descriptors get priority="3"; attributes of other fo:layout-master-set
-children will have priority="5".
+		<xsl:if test="rx:meta-info[preceding-sibling::*]">
+			<xsl:call-template name="print-warning">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(rx:meta-info[1])" />
+					' should be the first child of '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-To limit attribute occurrence on atomic inlines and graphics, there are
-two disabling named templates defined. They are added inside enabling
-templates.
+		<xsl:if test="rx:outline[preceding-sibling::fo:page-sequence]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(rx:outline[1])" />
+					' shall be placed before the first '
+					<xsl:value-of select="name(fo:page-sequence[1])" />
+					' element.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-1.3. Validating attribute values.
+		<xsl:apply-templates select="*" />
 
-Validation of attribute values is hard in XSL FO because of expressions:
-even properties with a closed list of possible values can be specified
-as expressions. This stylesheet validates attributes "partially":
+	</xsl:template>
 
- - attributes that can get only fixed values are validated only if their value
-   does not contain a pair of parentheses (because any expression inside them
-   should inevitably contain a function call);
 
- - attributes that can get numeric values are validated if their value
-   does not contain any of the following:
+	<!-- =================================== -->
+	<!-- Layout-master-set -->
 
-     * parentheses;
-     * math operators;
-     * digits.
+	<xsl:template match="fo:layout-master-set">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-This gives a reliable method of catching mistyped values of attributes.
+		<xsl:apply-templates
+			select="*[not(self::fo:simple-page-master                                   or self::fo:page-sequence-master)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'simple-page-master' and 'page-sequence-master' elements are
+				permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-There are three cases where additional processing is necessary:
+		<xsl:if test="not(fo:simple-page-master)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There should be at least one 'simple-page-master' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-  A. Validation of URIs. Attributes that may get URI values are checked
-     to be of the form 'url(...)'.
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-  B. Validation of 'content-type' attribute. It is checked to start
-     with either 'content-type:' or 'namespace:'.
 
-  C. Validation of 'text-align' attribute. This attribute may have an
-     arbitrary string as its value; therefore, its correct validation
-     is impossible - a mistype in any of the fixed values turns it
-     into a 'string'. Because 'string' alignment is rare, and fixed
-     values for text-align are ubiquitous, I felt necessary to introduce
-     some heuristics to distinguish between table-alignment strings
-     and mistyped predefined tokens. The heuristics is as follows:
-     if a value contains only alphabetic characters, it's a keyword 
-     and should match one of the predefined tokens. Otherwise, it's 
-     a string and should not be spellchecked.
+	<!-- =================================== -->
+	<!-- Simple-page-master -->
 
-     (Frankly speaking, a 'string' value of "left" cannot be distinguished
-     from a token 'left'. The property is really poorly designed.)
+	<xsl:template match="fo:simple-page-master">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-2. This stylesheet also contains checks for some RenderX extensions to XSL FO.
-They are placed into a separate namespace, and should not interfere
-with the correct validation of conformant XSL FO documents.
+		<xsl:apply-templates
+			select="*[not(self::fo:region-body                                   or self::fo:region-before                                   or self::fo:region-after                                   or self::fo:region-start                                   or self::fo:region-end)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only region descriptors are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-==================================================================== --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:fo="http://www.w3.org/1999/XSL/Format"
-                xmlns:rx="http://www.renderx.com/XSL/Extensions"
-                version="1.0"
-                exclude-result-prefixes="fo rx">
+		<xsl:if test="not(@master-name)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'master-name' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <xsl:output method="xml" omit-xml-declaration="yes"/>
+		<xsl:variable name="master-name" select="@master-name" />
+		<xsl:if
+			test="ancestor::fo:layout-master-set             and (following-sibling::*[@master-name = $master-name]               or preceding-sibling::*[@master-name = $master-name])">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Duplicate identifier: master-name="
+					<xsl:value-of select="$master-name" />
+					".
+					Property 'master-name' should be unique within '
+					<xsl:value-of
+						select="name(ancestor::fo:layout-master-set[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- Strictness level. Currently used levels: 0 (loose), 1 (normal), 2 (pedantic) -->
-<xsl:param name="strictness">1</xsl:param>
+		<xsl:if test="not(fo:region-body)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'region-body' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Match topmost node - must be <root> -->
+		<xsl:if test="count(fo:region-body) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:region-body[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="/">
-      <xsl:if test="not(fo:root)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">
-               <xsl:choose>
-                  <xsl:when test="local-name(*[1]) = 'root'">
-                     <xsl:text>Incorrect namespace at top element - should be 'http://www.w3.org/1999/XSL/Format'</xsl:text>
-                  </xsl:when>
-                  <xsl:otherwise>
-                     <xsl:text>Incorrect top element - should be 'root'</xsl:text>
-                  </xsl:otherwise>
-               </xsl:choose>
-            </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="count(fo:region-before) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:region-before[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="fo:root"/>
-   </xsl:template>
+		<xsl:if test="count(fo:region-after) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:region-after[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:if test="count(fo:region-start) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:region-start[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Root                                -->
+		<xsl:if test="count(fo:region-end) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:region-end[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:root">
-      <xsl:if test="@*[.='inherit']">
-         <xsl:call-template name="print-warning">
-            <xsl:with-param name="msg">Attributes with value of 'inherit' are meaningless on '<xsl:value-of select="name()"/>'.</xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<!-- I didn't want to control the ordering of regions; -->
+		<!-- but they convinced me... -->
 
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:if test="$strictness &gt; 0">
+			<xsl:if
+				test="fo:region-body/preceding-sibling::*[self::fo:region-before                                                    or self::fo:region-after                                                    or self::fo:region-start                                                    or self::fo:region-end]                or fo:region-before/preceding-sibling::*[self::fo:region-after                                                    or self::fo:region-start                                                    or self::fo:region-end]                or fo:region-after/preceding-sibling::*[self::fo:region-start                                                    or self::fo:region-end]                or fo:region-start/preceding-sibling::fo:region-end">
+				<xsl:call-template name="print-warning">
+					<xsl:with-param name="msg">
+						Incorrect order of region descriptors inside '
+						<xsl:value-of select="name()" />
+						'. Regions shall be ordered according to the following content
+						model: fo:region-body, fo:region-before?, fo:region-after?,
+						fo:region-start?, fo:region-end?
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:if>
+		</xsl:if>
 
-      <xsl:apply-templates select="*[not(self::rx:meta-info                                   or self::fo:layout-master-set                                   or self::fo:declarations                                   or self::rx:outline                                   or self::fo:page-sequence)]"
-                           mode="report-intrusive-elements"/>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="not(fo:layout-master-set)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'layout-master-set' is required as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Regions -->
 
-      <xsl:if test="count(fo:layout-master-set) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:layout-master-set[1])"/>' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template
+		match="fo:region-body                    | fo:region-before                    | fo:region-after                    | fo:region-start                    | fo:region-end">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
+		<xsl:if test="not(@extent) and not (self::fo:region-body)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'extent' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="count(fo:declarations) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:declarations[1])"/>' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:variable name="region-name">
+			<xsl:choose>
+				<xsl:when test="@region-name">
+					<xsl:value-of select="@region-name" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="concat('xsl-', local-name())" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
 
-      <xsl:if test="not(fo:page-sequence)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There should be at least one 'page-sequence' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if
+			test="ancestor::fo:simple-page-master              and (preceding-sibling::*[@region-name = $region-name]                or following-sibling::*[@region-name = $region-name])">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Duplicate identifier: region-name="
+					<xsl:value-of select="$region-name" />
+					".
+					Property 'region-name' shall be unique within '
+					<xsl:value-of
+						select="name(ancestor::fo:simple-page-master[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="fo:layout-master-set[preceding-sibling::fo:declarations]">
-         <xsl:call-template name="print-warning">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:layout-master-set[1])"/>' shall precede '<xsl:value-of select="name(fo:declarations[1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="$strictness &gt; 1">
+			<xsl:if
+				test="@*[starts-with(local-name(), 'padding')]                     [normalize-space(.) != '0'                   and normalize-space(.) != '0pt'                  and normalize-space(.) != '0px'                  and normalize-space(.) != '0mm'                  and normalize-space(.) != '0em'                  and normalize-space(.) != '0cm'                  and normalize-space(.) != '0pc'                  and normalize-space(.) != '0in']">
+				<xsl:call-template name="print-warning">
+					<xsl:with-param name="msg">
+						Padding on '
+						<xsl:value-of select="name()" />
+						' is a RenderX extension.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:if>
 
-      <xsl:if test="fo:declarations[preceding-sibling::fo:page-sequence]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:declarations[1])"/>' shall be placed before the first '<xsl:value-of select="name(fo:page-sequence[1])"/>' element. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+			<xsl:if test="@*[starts-with(local-name(), 'border')]">
+				<xsl:call-template name="print-warning">
+					<xsl:with-param name="msg">
+						Border on '
+						<xsl:value-of select="name()" />
+						' is a RenderX extension.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:if>
+		</xsl:if>
 
-      <xsl:if test="fo:layout-master-set[preceding-sibling::fo:page-sequence]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:layout-master-set[1])"/>' shall be placed before the first '<xsl:value-of select="name(fo:page-sequence[1])"/>' element. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	</xsl:template>
 
-      <!-- Tests of RenderX extension elements -->
-  <xsl:if test="count(rx:meta-info) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(rx:meta-info[1])"/>' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="count(rx:outline) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(rx:outline[1])"/>' element as a child of '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Page-sequence-master -->
 
-      <xsl:if test="rx:meta-info[preceding-sibling::*]">
-         <xsl:call-template name="print-warning">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(rx:meta-info[1])"/>' should be the first child of '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:page-sequence-master">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-      <xsl:if test="rx:outline[preceding-sibling::fo:page-sequence]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(rx:outline[1])"/>' shall be placed before the first '<xsl:value-of select="name(fo:page-sequence[1])"/>' element. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(@master-name)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'master-name' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
+		<xsl:variable name="master-name" select="@master-name" />
+		<xsl:if
+			test="ancestor::fo:layout-master-set             and (following-sibling::*[@master-name = $master-name]               or preceding-sibling::*[@master-name = $master-name])">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Duplicate identifier: master-name="
+					<xsl:value-of select="$master-name" />
+					".
+					Property 'master-name' should be unique within '
+					<xsl:value-of
+						select="name(ancestor::fo:layout-master-set[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   </xsl:template>
+		<xsl:apply-templates
+			select="*[not(self::fo:single-page-master-reference                                   or self::fo:repeatable-page-master-reference                                   or self::fo:repeatable-page-master-alternatives)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only page sequence specifiers are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
+		<xsl:if
+			test="not (fo:single-page-master-reference                   or fo:repeatable-page-master-reference                   or fo:repeatable-page-master-alternatives)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					At least one page sequence specifier is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Layout-master-set                   -->
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-<xsl:template match="fo:layout-master-set">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
 
-      <xsl:apply-templates select="*[not(self::fo:simple-page-master                                   or self::fo:page-sequence-master)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'simple-page-master' and 'page-sequence-master' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+	<!-- =================================== -->
+	<!-- Page master references -->
 
-      <xsl:if test="not(fo:simple-page-master)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There should be at least one 'simple-page-master' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template
+		match="fo:single-page-master-reference                    | fo:repeatable-page-master-reference                    | fo:conditional-page-master-reference">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
+		<xsl:if test="not(@master-reference)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'master-reference' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
 
+	<!-- =================================== -->
+	<!-- Repeatable-page-master-alternatives -->
 
-   <!-- =================================== -->
-<!-- Simple-page-master                  -->
+	<xsl:template
+		match="fo:repeatable-page-master-alternatives">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-<xsl:template match="fo:simple-page-master">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:apply-templates
+			select="*[not(self::fo:conditional-page-master-reference)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'conditional-page-master-reference' elements are permitted in
+				this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:apply-templates select="*[not(self::fo:region-body                                   or self::fo:region-before                                   or self::fo:region-after                                   or self::fo:region-start                                   or self::fo:region-end)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only region descriptors are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+		<xsl:if test="not(fo:conditional-page-master-reference)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					At least one 'conditional-page-master-reference' element should be
+					present inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(@master-name)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'master-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:variable name="master-name" select="@master-name"/>
-      <xsl:if test="ancestor::fo:layout-master-set             and (following-sibling::*[@master-name = $master-name]               or preceding-sibling::*[@master-name = $master-name])">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">
-        Duplicate identifier: master-name="<xsl:value-of select="$master-name"/>".
-        Property 'master-name' should be unique within '<xsl:value-of select="name(ancestor::fo:layout-master-set[1])"/>'.
-      </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Rx:meta-info -->
 
-      <xsl:if test="not(fo:region-body)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'region-body' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="rx:meta-info">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-      <xsl:if test="count(fo:region-body) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-body[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:apply-templates
+			select="*[not(self::rx:meta-field)]" mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'meta-field' elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:if test="count(fo:region-before) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-before[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not (rx:meta-field)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					At least one 'meta-field' element should be present inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="count(fo:region-after) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-after[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="count(fo:region-start) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-start[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="count(fo:region-end) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:region-end[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Rx:meta-field -->
 
-      <!-- I didn't want to control the ordering of regions; -->
-  <!-- but they convinced me...                          -->
+	<xsl:template match="rx:meta-field">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
+		<xsl:if test="not(@name)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'name' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:if test="not(@value)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'value' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-  <xsl:if test="$strictness &gt; 0">
-         <xsl:if test="fo:region-body/preceding-sibling::*[self::fo:region-before                                                    or self::fo:region-after                                                    or self::fo:region-start                                                    or self::fo:region-end]                or fo:region-before/preceding-sibling::*[self::fo:region-after                                                    or self::fo:region-start                                                    or self::fo:region-end]                or fo:region-after/preceding-sibling::*[self::fo:region-start                                                    or self::fo:region-end]                or fo:region-start/preceding-sibling::fo:region-end">
-            <xsl:call-template name="print-warning">
-               <xsl:with-param name="msg">Incorrect order of region descriptors inside '<xsl:value-of select="name()"/>'. Regions shall be ordered according to the following content model: fo:region-body, fo:region-before?, fo:region-after?, fo:region-start?, fo:region-end?</xsl:with-param>
-            </xsl:call-template>
-         </xsl:if>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Rx:page-device -->
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<xsl:template match="rx:page-device"
+		mode="report-intrusive-elements">
+		<xsl:call-template name="print-error">
+			<xsl:with-param name="msg">Element
+				'page-device' is obsolete; use &lt;?xep-postscript-* ?&gt;
+				processing instructions instead.
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Regions                             -->
 
-<xsl:template match="fo:region-body                    | fo:region-before                    | fo:region-after                    | fo:region-start                    | fo:region-end">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
-      <xsl:if test="not(@extent) and not (self::fo:region-body)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'extent' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Declarations -->
 
-      <xsl:variable name="region-name">
-         <xsl:choose>
-            <xsl:when test="@region-name">
-               <xsl:value-of select="@region-name"/>
-            </xsl:when>
-            <xsl:otherwise>
-               <xsl:value-of select="concat('xsl-', local-name())"/>
-            </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
+	<xsl:template match="fo:declarations">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-      <xsl:if test="ancestor::fo:simple-page-master              and (preceding-sibling::*[@region-name = $region-name]                or following-sibling::*[@region-name = $region-name])">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">
-        Duplicate identifier: region-name="<xsl:value-of select="$region-name"/>".
-        Property 'region-name' shall be unique within '<xsl:value-of select="name(ancestor::fo:simple-page-master[1])"/>'.
-      </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-  
-      <xsl:if test="$strictness &gt; 1">
-         <xsl:if test="@*[starts-with(local-name(), 'padding')]                     [normalize-space(.) != '0'                   and normalize-space(.) != '0pt'                  and normalize-space(.) != '0px'                  and normalize-space(.) != '0mm'                  and normalize-space(.) != '0em'                  and normalize-space(.) != '0cm'                  and normalize-space(.) != '0pc'                  and normalize-space(.) != '0in']">
-            <xsl:call-template name="print-warning">
-               <xsl:with-param name="msg">
-          Padding on '<xsl:value-of select="name()"/>' is a RenderX extension.
-        </xsl:with-param>
-            </xsl:call-template>
-         </xsl:if>
+		<xsl:apply-templates
+			select="*[not(self::fo:color-profile)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'color-profile' elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-         <xsl:if test="@*[starts-with(local-name(), 'border')]">
-            <xsl:call-template name="print-warning">
-               <xsl:with-param name="msg">
-          Border on '<xsl:value-of select="name()"/>' is a RenderX extension.
-       </xsl:with-param>
-            </xsl:call-template>
-         </xsl:if>
-      </xsl:if>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-   </xsl:template>
 
+	<!-- =================================== -->
+	<!-- Color-profile -->
 
-   <!-- =================================== -->
-<!-- Page-sequence-master                -->
+	<xsl:template match="fo:color-profile">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
+		<xsl:if test="not(@color-profile-name)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'color-profile-name' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:if test="not(@src)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'src' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-<xsl:template match="fo:page-sequence-master">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
 
-      <xsl:if test="not(@master-name)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'master-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Rx:outline -->
 
-      <xsl:variable name="master-name" select="@master-name"/>
-      <xsl:if test="ancestor::fo:layout-master-set             and (following-sibling::*[@master-name = $master-name]               or preceding-sibling::*[@master-name = $master-name])">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">
-        Duplicate identifier: master-name="<xsl:value-of select="$master-name"/>".
-        Property 'master-name' should be unique within '<xsl:value-of select="name(ancestor::fo:layout-master-set[1])"/>'.
-      </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="rx:outline">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-      <xsl:apply-templates select="*[not(self::fo:single-page-master-reference                                   or self::fo:repeatable-page-master-reference                                   or self::fo:repeatable-page-master-alternatives)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only page sequence specifiers are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+		<xsl:apply-templates
+			select="*[not(self::rx:bookmark)]" mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'bookmark' elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:if test="not (fo:single-page-master-reference                   or fo:repeatable-page-master-reference                   or fo:repeatable-page-master-alternatives)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">At least one page sequence specifier is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not (rx:bookmark)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					At least one 'bookmark' element should be present inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Page master references              -->
+	<!-- =================================== -->
+	<!-- Rx:bookmark -->
 
-<xsl:template match="fo:single-page-master-reference                    | fo:repeatable-page-master-reference                    | fo:conditional-page-master-reference">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
-      <xsl:if test="not(@master-reference)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'master-reference' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template match="rx:bookmark">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
+		<xsl:if
+			test="not(@internal-destination or @external-destination)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Either 'internal-destination' or 'external-destination' attribute
+					must be present on '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Repeatable-page-master-alternatives -->
+		<xsl:if test="@internal-destination and @external-destination">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Only one of 'internal-destination' or 'external-destination'
+					attributes can be present on '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:repeatable-page-master-alternatives">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:apply-templates
+			select="*[not(self::rx:bookmark                                   or self::rx:bookmark-label)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'bookmark-label' and/or nested 'boormark' elements are
+				permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:apply-templates select="*[not(self::fo:conditional-page-master-reference)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'conditional-page-master-reference' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+		<xsl:if test="not (rx:bookmark-label)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'bookmark-label' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(fo:conditional-page-master-reference)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">At least one 'conditional-page-master-reference' element should be present inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="count (rx:bookmark-label) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There should be exactly one '
+					<xsl:value-of select="name(rx:bookmark-label[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="rx:bookmark-label[preceding-sibling::*]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(rx:bookmark-label[1])" />
+					' should be the first child of '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Rx:meta-info                        -->
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-<xsl:template match="rx:meta-info">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
 
-      <xsl:apply-templates select="*[not(self::rx:meta-field)]" mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'meta-field' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+	<!-- =================================== -->
+	<!-- Rx:bookmark-label -->
 
-      <xsl:if test="not (rx:meta-field)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">At least one 'meta-field' element should be present inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="rx:bookmark-label">
+		<xsl:apply-templates select="@*" />
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:apply-templates select="*"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only plain text is permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Rx:meta-field                       -->
+	<!-- =================================== -->
+	<!-- Page-sequence -->
 
-<xsl:template match="rx:meta-field">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
-      <xsl:if test="not(@name)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-      <xsl:if test="not(@value)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'value' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template match="fo:page-sequence">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-   <!-- =================================== -->
-<!-- Rx:page-device                      -->
+		<xsl:if test="not(@master-reference)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'master-reference' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="rx:page-device" mode="report-intrusive-elements">
-      <xsl:call-template name="print-error">
-         <xsl:with-param name="msg">Element 'page-device' is obsolete;  use &lt;?xep-postscript-* ?&gt; processing instructions instead.</xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+		<xsl:apply-templates
+			select="*[not(self::fo:title                                   or self::fo:static-content                                   or self::fo:flow)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'flow', 'static-content', and 'title' elements are permitted in
+				this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
+		<xsl:if test="not(fo:flow)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'flow' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Declarations                        -->
+		<xsl:if test="count(fo:flow) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:flow[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:declarations">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:if test="count(fo:title) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be at most one '
+					<xsl:value-of select="name(fo:title[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*[not(self::fo:color-profile)]" mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'color-profile' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+		<xsl:if test="fo:title[preceding-sibling::*]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:title[1])" />
+					' should be the first child of its parent '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="fo:flow[following-sibling::*]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:flow[1])" />
+					' should be the last child of its parent '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Color-profile                       -->
 
-<xsl:template match="fo:color-profile">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
-      <xsl:if test="not(@color-profile-name)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'color-profile-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-      <xsl:if test="not(@src)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'src' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Title -->
 
+	<xsl:template match="fo:title">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="inline-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Rx:outline                        -->
 
-<xsl:template match="rx:outline">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+	<!-- =================================== -->
+	<!-- Flow and static-content -->
 
-      <xsl:apply-templates select="*[not(self::rx:bookmark)]" mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'bookmark' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+	<xsl:template match="fo:flow | fo:static-content">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="block-level" />
 
-      <xsl:if test="not (rx:bookmark)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">At least one 'bookmark' element should be present inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(@flow-name)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'flow-name' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:variable name="flow-name" select="@flow-name" />
+		<xsl:if
+			test="ancestor::fo:page-sequence             and (following-sibling::*[self::fo:flow or self::fo:static-content][@flow-name = $flow-name]               or preceding-sibling::*[self::fo:flow or self::fo:static-content][@flow-name = $flow-name])">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Duplicate identifier: flow-name="
+					<xsl:value-of select="$flow-name" />
+					".
+					Property 'flow-name' should be unique within '
+					<xsl:value-of
+						select="name(ancestor::fo:page-sequence[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Rx:bookmark                         -->
 
-<xsl:template match="rx:bookmark">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+	<!-- =================================== -->
+	<!-- Rx:flow-section -->
 
-      <xsl:if test="not(@internal-destination or @external-destination)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Either 'internal-destination' or 'external-destination' attribute must be present on '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="rx:flow-section">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="block-level" />
 
-      <xsl:if test="@internal-destination and @external-destination">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Only one of 'internal-destination' or 'external-destination' attributes can be present on '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(parent::fo:flow)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' must be a direct descendant of 'flow'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*[not(self::rx:bookmark                                   or self::rx:bookmark-label)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'bookmark-label' and/or nested 'boormark' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="not (rx:bookmark-label)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'bookmark-label' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="count (rx:bookmark-label) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There should be exactly one '<xsl:value-of select="name(rx:bookmark-label[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Block -->
 
-      <xsl:if test="rx:bookmark-label[preceding-sibling::*]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(rx:bookmark-label[1])"/>' should be the first child of '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:block">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="mixed-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
 
+	<!-- =================================== -->
+	<!-- Containers -->
 
-   <!-- =================================== -->
-<!-- Rx:bookmark-label                   -->
+	<xsl:template
+		match="fo:block-container | fo:inline-container">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="block-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-<xsl:template match="rx:bookmark-label">
-      <xsl:apply-templates select="@*"/>
 
-      <xsl:apply-templates select="*" mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only plain text is permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Bidi-override -->
 
+	<xsl:template match="fo:bidi-override">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="inline-level" />
 
-   <!-- =================================== -->
-<!-- Page-sequence                       -->
+		<xsl:if test="not(@direction)">
+			<xsl:call-template name="print-warning">
+				<xsl:with-param name="msg">
+					Attribute 'direction' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:page-sequence">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="not(@master-reference)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'master-reference' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:apply-templates select="*[not(self::fo:title                                   or self::fo:static-content                                   or self::fo:flow)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'flow', 'static-content', and 'title' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+	<!-- =================================== -->
+	<!-- Character -->
 
-      <xsl:if test="not(fo:flow)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'flow' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:character">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-      <xsl:if test="count(fo:flow) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:flow[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(@character)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'character' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-      <xsl:if test="count(fo:title) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be at most one '<xsl:value-of select="name(fo:title[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="fo:title[preceding-sibling::*]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:title[1])"/>' should be the first child of its parent '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Initial-property-set -->
 
-      <xsl:if test="fo:flow[following-sibling::*]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:flow[1])"/>' should be the last child of its parent '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:initial-property-set">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:choose>
+			<xsl:when test="parent::fo:block">
+				<xsl:if test="preceding-sibling::*">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Element '
+							<xsl:value-of select="name()" />
+							' should be the first child of '
+							<xsl:value-of select="name(parent::fo:block)" />
+							'.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
 
+				<xsl:if
+					test="preceding-sibling::text()[normalize-space() != '']">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Element '
+							<xsl:value-of select="name()" />
+							' cannot be preceded by non-space characters in '
+							<xsl:value-of select="name(parent::fo:block)" />
+							'.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
 
-   <!-- =================================== -->
-<!-- Title                               -->
+				<xsl:if test="preceding-sibling::fo:initial-property-set">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Only one '
+							<xsl:value-of select="name()" />'
+							element is permitted in 'xsl:value-of
+							select="name(parent::fo:block)"/&gt;'.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:when>
 
-<xsl:template match="fo:title">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="inline-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+			<xsl:otherwise>
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Element '
+						<xsl:value-of select="name()" />
+						' can only occur inside 'block'.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Flow and static-content             -->
+	<!-- =================================== -->
+	<!-- Line-numerator -->
 
-<xsl:template match="fo:flow | fo:static-content">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="block-level"/>
+	<xsl:template match="rx:ruler">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-      <xsl:if test="not(@flow-name)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'flow-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:choose>
+			<xsl:when test="parent::fo:block-container">
+				<xsl:if test="preceding-sibling::*">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Element '
+							<xsl:value-of select="name()" />
+							' should be the first child of '
+							<xsl:value-of
+								select="name(parent::fo:block-container)" />
+							'.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
 
-      <xsl:variable name="flow-name" select="@flow-name"/>
-      <xsl:if test="ancestor::fo:page-sequence             and (following-sibling::*[self::fo:flow or self::fo:static-content][@flow-name = $flow-name]               or preceding-sibling::*[self::fo:flow or self::fo:static-content][@flow-name = $flow-name])">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">
-        Duplicate identifier: flow-name="<xsl:value-of select="$flow-name"/>".
-        Property 'flow-name' should be unique within '<xsl:value-of select="name(ancestor::fo:page-sequence[1])"/>'.
-      </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+				<xsl:if
+					test="preceding-sibling::text()[normalize-space() != '']">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Element '
+							<xsl:value-of select="name()" />
+							' cannot be preceded by non-space characters in '
+							<xsl:value-of
+								select="name(parent::fo:block-container)" />
+							'.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+				<xsl:if test="preceding-sibling::rx:ruler">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Only one '
+							<xsl:value-of select="name()" />'
+							element is permitted in 'xsl:value-of
+							select="name(parent::fo:block-container)"/&gt;'.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:when>
 
+			<xsl:otherwise>
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Element '
+						<xsl:value-of select="name()" />
+						' can only occur inside 'block-container'.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Rx:flow-section                     -->
 
-<xsl:template match="rx:flow-section">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="block-level"/>
+	<!-- =================================== -->
+	<!-- External-graphic -->
 
-      <xsl:if test="not(parent::fo:flow)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' must be a direct descendant of 'flow'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:external-graphic">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="not(@src)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'src' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Block                               -->
+	<!-- =================================== -->
+	<!-- Instream-foreign-object -->
 
-<xsl:template match="fo:block">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="mixed-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<xsl:template match="fo:instream-foreign-object">
+		<xsl:apply-templates select="@*" />
+		<!-- only the attributes are checked -->
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Containers                          -->
+	<!-- =================================== -->
+	<!-- Inline -->
 
-<xsl:template match="fo:block-container | fo:inline-container">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="block-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<xsl:template match="fo:inline">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="mixed-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Bidi-override                       -->
+	<!-- =================================== -->
+	<!-- Leader -->
 
-<xsl:template match="fo:bidi-override">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="inline-level"/>
+	<xsl:template match="fo:leader">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="inline-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="not(@direction)">
-         <xsl:call-template name="print-warning">
-            <xsl:with-param name="msg">Attribute 'direction' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Page-number -->
 
+	<xsl:template match="fo:page-number">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Character                           -->
 
-<xsl:template match="fo:character">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+	<!-- =================================== -->
+	<!-- Page-number-citation -->
 
-      <xsl:if test="not(@character)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'character' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template match="fo:page-number-citation">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
+		<xsl:if test="not(@ref-id)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'ref-id' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Initial-property-set                -->
+	<!-- ========================================================== -->
+	<!-- Rx:page-number-citation-last (actually an XSL 1.1 element) -->
 
-<xsl:template match="fo:initial-property-set">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+	<xsl:template match="rx:page-number-citation-last">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-      <xsl:choose>
-         <xsl:when test="parent::fo:block">
-            <xsl:if test="preceding-sibling::*">
-               <xsl:call-template name="print-error">
-                  <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be the first child of '<xsl:value-of select="name(parent::fo:block)"/>'. </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
+		<xsl:if test="not(@ref-id)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'ref-id' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-            <xsl:if test="preceding-sibling::text()[normalize-space() != '']">
-               <xsl:call-template name="print-error">
-                  <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be preceded by non-space characters in '<xsl:value-of select="name(parent::fo:block)"/>'. </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
 
-            <xsl:if test="preceding-sibling::fo:initial-property-set">
-               <xsl:call-template name="print-error">
-                  <xsl:with-param name="msg">Only one '<xsl:value-of select="name()"/>' element is permitted in 'xsl:value-of select="name(parent::fo:block)"/&gt;'. </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:when>
+	<!-- =================================== -->
+	<!-- Rx:pinpoint -->
 
-         <xsl:otherwise>
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' can only occur inside 'block'. </xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template match="rx:pinpoint">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
+		<xsl:if test="not(@value)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'value' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Line-numerator                      -->
 
-<xsl:template match="rx:ruler">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+	<!-- =================================== -->
+	<!-- Rx:page-index -->
 
-      <xsl:choose>
-         <xsl:when test="parent::fo:block-container">
-            <xsl:if test="preceding-sibling::*">
-               <xsl:call-template name="print-error">
-                  <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be the first child of '<xsl:value-of select="name(parent::fo:block-container)"/>'. </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
+	<xsl:template match="rx:page-index">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-            <xsl:if test="preceding-sibling::text()[normalize-space() != '']">
-               <xsl:call-template name="print-error">
-                  <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be preceded by non-space characters in '<xsl:value-of select="name(parent::fo:block-container)"/>'. </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
+		<xsl:apply-templates
+			select="*[not(self::rx:index-item)]" mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'rx:index-item' elements are permitted in this context
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-            <xsl:if test="preceding-sibling::rx:ruler">
-               <xsl:call-template name="print-error">
-                  <xsl:with-param name="msg">Only one '<xsl:value-of select="name()"/>' element is permitted in 'xsl:value-of select="name(parent::fo:block-container)"/&gt;'. </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:when>
+		<xsl:if test="not(@ref-key) and not (rx:index-item)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' must have either 'ref-key' attribute, or 'rx:index-item'
+					descendant elements.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:if test="@ref-key and rx:index-item">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' can have either 'ref-key' attribute or '
+					<xsl:value-of select="name(rx:index-item[1])" />
+					' descendant elements, but not both.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-         <xsl:otherwise>
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' can only occur inside 'block-container'. </xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Rx:index-item -->
 
+	<xsl:template match="rx:index-item">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-   <!-- =================================== -->
-<!-- External-graphic                    -->
+		<xsl:if test="not(@ref-key)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'ref-key' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-<xsl:template match="fo:external-graphic">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
 
-      <xsl:if test="not(@src)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'src' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Rx:begin-index-range -->
 
+	<xsl:template match="rx:begin-index-range">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-   <!-- =================================== -->
-<!-- Instream-foreign-object             -->
+		<xsl:if test="not(@rx:key)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'rx:key' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:instream-foreign-object">
-      <xsl:apply-templates select="@*"/>
-      <!-- only the attributes are checked -->
-</xsl:template>
+		<xsl:choose>
+			<xsl:when test="not(@id)">
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Attribute 'id' is required for '
+						<xsl:value-of select="name()" />
+						'.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="id" select="@id" />
 
+				<xsl:if
+					test="count(preceding::rx:begin-index-range[@id=$id]) = 1">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Two or more '
+							<xsl:value-of select="name()" />
+							' elements with id='
+							<xsl:value-of select="@id" />
+							'; 'id' should be unique within the document.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
 
-   <!-- =================================== -->
-<!-- Inline                              -->
+				<xsl:choose>
+					<xsl:when
+						test="following::rx:end-index-range[@ref-id=$id]" />
+					<xsl:when
+						test="preceding::rx:end-index-range[@ref-id=$id]" />
+					<xsl:otherwise>
+						<xsl:call-template name="print-error">
+							<xsl:with-param name="msg">
+								Unmatched '
+								<xsl:value-of select="name()" />
+								' element with id='
+								<xsl:value-of select="@id" />
+								': no correspondent 'rx:end-index-range' found.
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-<xsl:template match="fo:inline">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="mixed-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Rx:end-index-range -->
 
+	<xsl:template match="rx:end-index-range">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-   <!-- =================================== -->
-<!-- Leader                              -->
+		<xsl:choose>
+			<xsl:when test="not(@ref-id)">
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Attribute 'ref-id' is required for '
+						<xsl:value-of select="name()" />
+						'.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="refid" select="@ref-id" />
 
-<xsl:template match="fo:leader">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="inline-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+				<xsl:if
+					test="count(preceding::rx:end-index-range[@ref-id=$refid]) = 1">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Two or more '
+							<xsl:value-of select="name()" />
+							' elements with ref-id='
+							<xsl:value-of select="@ref-id" />
+							'.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
 
+				<xsl:choose>
+					<xsl:when
+						test="following::rx:begin-index-range[@id=$refid]">
+						<xsl:call-template name="print-warning">
+							<xsl:with-param name="msg">
+								Element '
+								<xsl:value-of select="name()" />
+								' with ref-id='
+								<xsl:value-of select="@ref-id" />
+								' precedes its matching '
+								<xsl:value-of
+									select="name(following::rx:begin-index-range[@id=$refid][1])" />
+								'.
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:when
+						test="preceding::rx:begin-index-range[@id=$refid]" />
+					<xsl:otherwise>
+						<xsl:call-template name="print-error">
+							<xsl:with-param name="msg">
+								Unmatched '
+								<xsl:value-of select="name()" />
+								' element with ref-id='
+								<xsl:value-of select="@ref-id" />
+								': no correspondent 'rx:begin-index-range' found.
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Page-number                         -->
 
-<xsl:template match="fo:page-number">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Table-and-caption -->
 
+	<xsl:template match="fo:table-and-caption">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-   <!-- =================================== -->
-<!-- Page-number-citation                -->
+		<xsl:apply-templates
+			select="*[not(self::fo:table-caption                                   or self::fo:table                                   or self::fo:marker)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'table-caption' and 'table' elements are permitted in this
+				context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-<xsl:template match="fo:page-number-citation">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+		<xsl:if test="not(fo:table)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'table' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(@ref-id)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'ref-id' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+		<xsl:if test="count(fo:table) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:table[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- ========================================================== -->
-<!-- Rx:page-number-citation-last (actually an XSL 1.1 element) -->
+		<xsl:if test="count(fo:table-caption) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:table-caption[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="rx:page-number-citation-last">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+		<xsl:if test="fo:table-caption[preceding-sibling::fo:table]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:table-caption[1])" />
+					' must precede '
+					<xsl:value-of select="name(fo:table[1])" />
+					' inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(@ref-id)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'ref-id' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Rx:pinpoint                        -->
+	<!-- =================================== -->
+	<!-- Table-caption -->
 
-<xsl:template match="rx:pinpoint">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+	<xsl:template match="fo:table-caption">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="block-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="not(@value)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'value' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
 
+	<!-- =================================== -->
+	<!-- Table -->
 
-   <!-- =================================== -->
-<!-- Rx:page-index                       -->
+	<xsl:template match="fo:table">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-<xsl:template match="rx:page-index">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:apply-templates
+			select="*[not(self::fo:table-column                                   or self::fo:table-header                                   or self::fo:table-footer                                   or self::fo:table-body                                   or self::fo:marker)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'table-column' elements, row group elements, and markers are
+				permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:apply-templates select="*[not(self::rx:index-item)]" mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'rx:index-item' elements are permitted in this context</xsl:with-param>
-      </xsl:apply-templates>
+		<xsl:if test="not(fo:table-body)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					At least one 'table-body' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(@ref-key) and not (rx:index-item)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' must have either 'ref-key' attribute, or 'rx:index-item' descendant elements.</xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-      <xsl:if test="@ref-key and rx:index-item">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' can have either 'ref-key' attribute or '<xsl:value-of select="name(rx:index-item[1])"/>' descendant elements, but not both.</xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="count(fo:table-header) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:table-header[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Rx:index-item                       -->
+		<xsl:if test="count(fo:table-footer) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:table-footer[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="rx:index-item">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+		<xsl:if
+			test="fo:table-column[preceding-sibling::*[not(self::fo:table-column or self::fo:marker)]]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					'
+					<xsl:value-of select="name(fo:table-column[1])" />
+					' elements should be located before any other element in '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(@ref-key)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'ref-key' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+		<xsl:if
+			test="fo:table-header[preceding-sibling::fo:table-footer]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:table-header[1])" />
+					' should be located before '
+					<xsl:value-of select="name(fo:table-footer[1])" />
+					' in '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:if
+			test="fo:table-header[preceding-sibling::fo:table-body]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:table-header[1])" />
+					' should be located before '
+					<xsl:value-of select="name(fo:table-body[1])" />
+					' in '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Rx:begin-index-range                -->
+		<xsl:if
+			test="fo:table-body[following-sibling::*[not(self::fo:table-body)]]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					'
+					<xsl:value-of select="name(fo:table-body[1])" />
+					' elements should be located last in '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="rx:begin-index-range">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="not(@rx:key)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'rx:key' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-  
-      <xsl:choose>
-         <xsl:when test="not(@id)">
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Attribute 'id' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="id" select="@id"/>
-      
-            <xsl:if test="count(preceding::rx:begin-index-range[@id=$id]) = 1">
-	              <xsl:call-template name="print-error">
-	                 <xsl:with-param name="msg">Two or more '<xsl:value-of select="name()"/>' elements with id='<xsl:value-of select="@id"/>';  'id' should be unique within the document.</xsl:with-param>
-	              </xsl:call-template>
-            </xsl:if>
-      
-            <xsl:choose> 
-               <xsl:when test="following::rx:end-index-range[@ref-id=$id]"/>
-               <xsl:when test="preceding::rx:end-index-range[@ref-id=$id]"/>
-               <xsl:otherwise>
-                  <xsl:call-template name="print-error">
-                     <xsl:with-param name="msg">Unmatched '<xsl:value-of select="name()"/>' element with id='<xsl:value-of select="@id"/>': no correspondent 'rx:end-index-range' found. </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:otherwise>
-            </xsl:choose> 
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
 
-   <!-- =================================== -->
-<!-- Rx:end-index-range                  -->
+	<!-- =================================== -->
+	<!-- Row group elements -->
 
-<xsl:template match="rx:end-index-range">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+	<xsl:template
+		match="fo:table-body | fo:table-header | fo:table-footer">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-      <xsl:choose>
-         <xsl:when test="not(@ref-id)">
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Attribute 'ref-id' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="refid" select="@ref-id"/>
+		<xsl:apply-templates
+			select="*[not(self::fo:table-row                                   or self::fo:table-cell                                   or self::fo:marker)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'table-row', 'table-cell', or 'marker' elements are permitted
+				in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-            <xsl:if test="count(preceding::rx:end-index-range[@ref-id=$refid]) = 1">
-               <xsl:call-template name="print-error">
-                  <xsl:with-param name="msg">Two or more '<xsl:value-of select="name()"/>' elements with ref-id='<xsl:value-of select="@ref-id"/>'.</xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
+		<xsl:if test="$strictness &gt; 0">
+			<xsl:if test="not (*)">
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Empty '
+						<xsl:value-of select="name()" />
+						'.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:if>
+		</xsl:if>
 
-            <xsl:choose> 
-               <xsl:when test="following::rx:begin-index-range[@id=$refid]">
-                  <xsl:call-template name="print-warning">
-                     <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' with ref-id='<xsl:value-of select="@ref-id"/>' precedes its matching '<xsl:value-of select="name(following::rx:begin-index-range[@id=$refid][1])"/>'. </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:when>
-               <xsl:when test="preceding::rx:begin-index-range[@id=$refid]"/>
-               <xsl:otherwise>
-                  <xsl:call-template name="print-error">
-                     <xsl:with-param name="msg">Unmatched '<xsl:value-of select="name()"/>' element with ref-id='<xsl:value-of select="@ref-id"/>': no correspondent 'rx:begin-index-range' found. </xsl:with-param>
-                  </xsl:call-template>
-               </xsl:otherwise>
-            </xsl:choose> 
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+		<xsl:if test="fo:table-row and fo:table-cell">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					'
+					<xsl:value-of select="name(fo:table-row[1])" />
+					' and '
+					<xsl:value-of select="name(fo:table-cell[1])" />
+					' elements should not be mixed inside '
+					<xsl:value-of select="name()" />
+					' element.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Table-and-caption                   -->
 
-<xsl:template match="fo:table-and-caption">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+	<!-- =================================== -->
+	<!-- Table-row -->
 
-      <xsl:apply-templates select="*[not(self::fo:table-caption                                   or self::fo:table                                   or self::fo:marker)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'table-caption' and 'table' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+	<xsl:template match="fo:table-row">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-      <xsl:if test="not(fo:table)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'table' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:apply-templates
+			select="*[not(self::fo:table-cell)]" mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'table-cell' elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:if test="count(fo:table) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:table[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if
+			test="not(parent::fo:table-body or parent::fo:table-header or parent::fo:table-footer)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' should be wrapped in 'table-body', 'table-header', or
+					'table-footer'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="count(fo:table-caption) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:table-caption[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="fo:table-caption[preceding-sibling::fo:table]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:table-caption[1])"/>' must precede '<xsl:value-of select="name(fo:table[1])"/>' inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Table-cell -->
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<xsl:template match="fo:table-cell">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="block-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Table-caption                       -->
+	<!-- =================================== -->
+	<!-- List-block -->
 
-<xsl:template match="fo:table-caption">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="block-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<xsl:template match="fo:list-block">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
+		<xsl:apply-templates
+			select="*[not(self::fo:list-item or self::fo:marker)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'list-item' or 'marker' elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-   <!-- =================================== -->
-<!-- Table                               -->
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-<xsl:template match="fo:table">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
 
-      <xsl:apply-templates select="*[not(self::fo:table-column                                   or self::fo:table-header                                   or self::fo:table-footer                                   or self::fo:table-body                                   or self::fo:marker)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'table-column' elements, row group elements, and markers are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+	<!-- =================================== -->
+	<!-- List-item -->
 
-      <xsl:if test="not(fo:table-body)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">At least one 'table-body' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:list-item">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-      <xsl:if test="count(fo:table-header) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:table-header[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:apply-templates
+			select="*[not(self::fo:list-item-label                                   or self::fo:list-item-body                                   or self::fo:marker)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Element '
+				<xsl:value-of select="name()" />
+				' shall consist of one 'list-item-label' and one 'list-item-body'.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:if test="count(fo:table-footer) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:table-footer[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(parent::fo:list-block)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' should be a child of 'list-block'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="fo:table-column[preceding-sibling::*[not(self::fo:table-column or self::fo:marker)]]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">'<xsl:value-of select="name(fo:table-column[1])"/>' elements should be located before any other element in '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(fo:list-item-label)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'list-item-label' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="fo:table-header[preceding-sibling::fo:table-footer]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:table-header[1])"/>' should be located before '<xsl:value-of select="name(fo:table-footer[1])"/>' in '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(fo:list-item-body)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'list-item-body' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="fo:table-header[preceding-sibling::fo:table-body]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:table-header[1])"/>' should be located before '<xsl:value-of select="name(fo:table-body[1])"/>' in '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="count(fo:list-item-label) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:list-item-label[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="fo:table-body[following-sibling::*[not(self::fo:table-body)]]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">'<xsl:value-of select="name(fo:table-body[1])"/>' elements should be located last in '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="count(fo:list-item-body) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:list-item-body[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if
+			test="fo:list-item-body[following-sibling::fo:list-item-label]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:list-item-label[1])" />
+					' must precede '
+					<xsl:value-of select="name(fo:list-item-body[1])" />
+					' inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:if
+			test="fo:list-item-label and not (fo:list-item-label/@start-indent)                                    and not (fo:list-item-label/@margin)                                    and not (fo:list-item-label/@margin-left)                                    and not (fo:list-item-label/@margin-right)                                    and not (fo:list-item-label/@margin-top)                                    and not (fo:list-item-label/@margin-bottom)              and fo:list-item-body and not (fo:list-item-body/@start-indent)                                    and not (fo:list-item-body/@margin)                                    and not (fo:list-item-body/@margin-left)                                    and not (fo:list-item-body/@margin-right)                                    and not (fo:list-item-body/@margin-top)                                    and not (fo:list-item-body/@margin-bottom)">
+			<xsl:call-template name="print-warning">
+				<xsl:with-param name="msg">
+					Start-indent is not specified neither on '
+					<xsl:value-of select="name(fo:list-item-label[1])" />
+					' nor on '
+					<xsl:value-of select="name(fo:list-item-body[1])" />
+					': list subcomponents will overlap
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Row group elements                  -->
+		<xsl:if
+			test="fo:list-item-label and not (fo:list-item-label/@end-indent)                                    and not (fo:list-item-label/@margin)                                    and not (fo:list-item-label/@margin-left)                                    and not (fo:list-item-label/@margin-right)                                    and not (fo:list-item-label/@margin-top)                                    and not (fo:list-item-label/@margin-bottom)              and fo:list-item-body and not (fo:list-item-body/@end-indent)                                    and not (fo:list-item-body/@margin)                                    and not (fo:list-item-body/@margin-left)                                    and not (fo:list-item-body/@margin-right)                                    and not (fo:list-item-body/@margin-top)                                    and not (fo:list-item-body/@margin-bottom)">
+			<xsl:call-template name="print-warning">
+				<xsl:with-param name="msg">
+					End-indent is not specified neither on '
+					<xsl:value-of select="name(fo:list-item-label[1])" />
+					' nor on '
+					<xsl:value-of select="name(fo:list-item-body[1])" />
+					': list subcomponents will overlap
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:table-body | fo:table-header | fo:table-footer">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:apply-templates select="*[not(self::fo:table-row                                   or self::fo:table-cell                                   or self::fo:marker)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'table-row', 'table-cell', or 'marker' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
 
-      <xsl:if test="$strictness &gt; 0">
-         <xsl:if test="not (*)">
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Empty '<xsl:value-of select="name()"/>'. </xsl:with-param>
-            </xsl:call-template>
-         </xsl:if>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- List item subcomponents -->
 
-      <xsl:if test="fo:table-row and fo:table-cell">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">'<xsl:value-of select="name(fo:table-row[1])"/>' and '<xsl:value-of select="name(fo:table-cell[1])"/>' elements should not be mixed inside '<xsl:value-of select="name()"/>' element. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template
+		match="fo:list-item-label | fo:list-item-body">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="block-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
 
+	<!-- =================================== -->
+	<!-- Footnote -->
 
-   <!-- =================================== -->
-<!-- Table-row                           -->
+	<xsl:template match="fo:footnote">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
+		<xsl:call-template name="out-of-line" />
 
-<xsl:template match="fo:table-row">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:apply-templates
+			select="*[not(self::fo:inline                                   or self::fo:footnote-body)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Element '
+				<xsl:value-of select="name()" />
+				' shall consist of one 'inline' and one 'footnote-body'.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:apply-templates select="*[not(self::fo:table-cell)]" mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'table-cell' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+		<xsl:if test="not(fo:inline)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'inline' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(parent::fo:table-body or parent::fo:table-header or parent::fo:table-footer)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be wrapped in 'table-body', 'table-header', or 'table-footer'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(fo:footnote-body)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'footnote-body' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="count(fo:inline) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:inline[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- Table-cell                          -->
+		<xsl:if test="count(fo:footnote-body) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:footnote-body[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:table-cell">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="block-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="fo:footnote-body[following-sibling::fo:inline]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:inline[1])" />
+					' must precede '
+					<xsl:value-of select="name(fo:footnote-body[1])" />
+					' inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:for-each select="fo:inline">
+			<xsl:call-template name="inline-level" />
+		</xsl:for-each>
 
-   <!-- =================================== -->
-<!-- List-block                          -->
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-<xsl:template match="fo:list-block">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
 
-      <xsl:apply-templates select="*[not(self::fo:list-item or self::fo:marker)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'list-item' or 'marker' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
+	<!-- =================================== -->
+	<!-- Footnote-body -->
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<xsl:template match="fo:footnote-body">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="block-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- List-item                           -->
+	<!-- =================================== -->
+	<!-- Float -->
 
-<xsl:template match="fo:list-item">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+	<xsl:template match="fo:float">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="block-level" />
+		<xsl:call-template name="out-of-line" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:apply-templates select="*[not(self::fo:list-item-label                                   or self::fo:list-item-body                                   or self::fo:marker)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Element '<xsl:value-of select="name()"/>' shall consist of one 'list-item-label' and one 'list-item-body'.</xsl:with-param>
-      </xsl:apply-templates>
 
-      <xsl:if test="not(parent::fo:list-block)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a child of 'list-block'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- =================================== -->
+	<!-- Wrapper -->
 
-      <xsl:if test="not(fo:list-item-label)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'list-item-label' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:wrapper">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="mixed-level" />
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="not(fo:list-item-body)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'list-item-body' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="count(fo:list-item-label) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:list-item-label[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- === =============================== -->
+	<!-- Marker -->
 
-      <xsl:if test="count(fo:list-item-body) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:list-item-body[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:marker">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="mixed-level" />
 
-      <xsl:if test="fo:list-item-body[following-sibling::fo:list-item-label]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:list-item-label[1])"/>' must precede '<xsl:value-of select="name(fo:list-item-body[1])"/>' inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:choose>
+			<xsl:when test="not(@marker-class-name)">
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Attribute 'marker-class-name' is required for '
+						<xsl:value-of select="name()" />
+						'.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="marker-class-name"
+					select="@marker-class-name" />
+				<xsl:if
+					test="preceding-sibling::fo:marker[@marker-class-name=$marker-class-name]">
+					<xsl:call-template name="print-error">
+						<xsl:with-param name="msg">
+							Sibling
+							<xsl:value-of select="name()" />
+							elements have the same value of 'marker-class-name' attribute ("
+							<xsl:value-of select="@marker-class-name" />
+							").
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
 
-      <xsl:if test="fo:list-item-label and not (fo:list-item-label/@start-indent)                                    and not (fo:list-item-label/@margin)                                    and not (fo:list-item-label/@margin-left)                                    and not (fo:list-item-label/@margin-right)                                    and not (fo:list-item-label/@margin-top)                                    and not (fo:list-item-label/@margin-bottom)              and fo:list-item-body and not (fo:list-item-body/@start-indent)                                    and not (fo:list-item-body/@margin)                                    and not (fo:list-item-body/@margin-left)                                    and not (fo:list-item-body/@margin-right)                                    and not (fo:list-item-body/@margin-top)                                    and not (fo:list-item-body/@margin-bottom)">
-         <xsl:call-template name="print-warning">
-            <xsl:with-param name="msg">Start-indent is not specified neither on '<xsl:value-of select="name(fo:list-item-label[1])"/>' nor on '<xsl:value-of select="name(fo:list-item-body[1])"/>': list subcomponents will overlap</xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="preceding-sibling::*[not(self::fo:marker)]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					'
+					<xsl:value-of select="name()" />
+					' elements should be initial children of their parents.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="fo:list-item-label and not (fo:list-item-label/@end-indent)                                    and not (fo:list-item-label/@margin)                                    and not (fo:list-item-label/@margin-left)                                    and not (fo:list-item-label/@margin-right)                                    and not (fo:list-item-label/@margin-top)                                    and not (fo:list-item-label/@margin-bottom)              and fo:list-item-body and not (fo:list-item-body/@end-indent)                                    and not (fo:list-item-body/@margin)                                    and not (fo:list-item-body/@margin-left)                                    and not (fo:list-item-body/@margin-right)                                    and not (fo:list-item-body/@margin-top)                                    and not (fo:list-item-body/@margin-bottom)">
-         <xsl:call-template name="print-warning">
-            <xsl:with-param name="msg">End-indent is not specified neither on '<xsl:value-of select="name(fo:list-item-label[1])"/>' nor on '<xsl:value-of select="name(fo:list-item-body[1])"/>': list subcomponents will overlap</xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if
+			test="preceding-sibling::text()[normalize-space() != '']">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot be preceded by non-space text nodes.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="not(ancestor::fo:flow)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' should be a descendant of 'flow'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:if test="ancestor::fo:multi-case">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot be used inside '
+					<xsl:value-of
+						select="name(ancestor::fo:multi-case[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- =================================== -->
-<!-- List item subcomponents             -->
+		<xsl:if test="ancestor::fo:float">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot be used inside '
+					<xsl:value-of select="name(ancestor::fo:float[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:list-item-label | fo:list-item-body">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="block-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="ancestor::fo:footnote">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot be used inside '
+					<xsl:value-of select="name(ancestor::fo:footnote[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Footnote                            -->
+	<!-- === =============================== -->
+	<!-- Retrieve-marker -->
 
-<xsl:template match="fo:footnote">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
-      <xsl:call-template name="out-of-line"/>
+	<xsl:template match="fo:retrieve-marker">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-      <xsl:apply-templates select="*[not(self::fo:inline                                   or self::fo:footnote-body)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Element '<xsl:value-of select="name()"/>' shall consist of one 'inline' and one 'footnote-body'.</xsl:with-param>
-      </xsl:apply-templates>
+		<xsl:if test="not(@retrieve-class-name)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'retrieve-class-name' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(fo:inline)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'inline' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(ancestor::fo:static-content)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' should be a descendant of 'static-content'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-      <xsl:if test="not(fo:footnote-body)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'footnote-body' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="count(fo:inline) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:inline[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- === =============================== -->
+	<!-- Basic-link -->
 
-      <xsl:if test="count(fo:footnote-body) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:footnote-body[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:basic-link">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="mixed-level" />
 
-      <xsl:if test="fo:footnote-body[following-sibling::fo:inline]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:inline[1])"/>' must precede '<xsl:value-of select="name(fo:footnote-body[1])"/>' inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if
+			test="not(@internal-destination or @external-destination)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Either 'internal-destination' or 'external-destination' attribute
+					must be present on '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:for-each select="fo:inline">
-         <xsl:call-template name="inline-level"/>
-      </xsl:for-each>
+		<xsl:if test="@internal-destination and @external-destination">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Only one of 'internal-destination' or 'external-destination'
+					attributes can be present on '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
 
-   <!-- =================================== -->
-<!-- Footnote-body                       -->
+	<!-- =================================== -->
+	<!-- Multi-switch -->
 
-<xsl:template match="fo:footnote-body">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="block-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<xsl:template match="fo:multi-switch">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
+		<xsl:apply-templates
+			select="*[not(self::fo:multi-case)]" mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Only 'multi-case' elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-   <!-- =================================== -->
-<!-- Float                               -->
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-<xsl:template match="fo:float">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="block-level"/>
-      <xsl:call-template name="out-of-line"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
 
+	<!-- =================================== -->
+	<!-- Multi-case -->
 
-   <!-- =================================== -->
-<!-- Wrapper                             -->
+	<xsl:template match="fo:multi-case">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="mixed-level" />
+		<xsl:if test="not(parent::fo:multi-switch)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' should be a child of 'multi-switch'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-<xsl:template match="fo:wrapper">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="mixed-level"/>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
 
+	<!-- ===================================== -->
+	<!-- Multi-toggle -->
 
-   <!-- === =============================== -->
-<!-- Marker                              -->
+	<xsl:template match="fo:multi-toggle">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="mixed-level" />
 
-<xsl:template match="fo:marker">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="mixed-level"/>
+		<xsl:if test="not(ancestor::fo:multi-case)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' can be used only inside 'multi-case'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:choose>
-         <xsl:when test="not(@marker-class-name)">
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Attribute 'marker-class-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:variable name="marker-class-name" select="@marker-class-name"/>
-            <xsl:if test="preceding-sibling::fo:marker[@marker-class-name=$marker-class-name]">
-               <xsl:call-template name="print-error">
-                  <xsl:with-param name="msg">Sibling <xsl:value-of select="name()"/> elements have the same value of 'marker-class-name' attribute ("<xsl:value-of select="@marker-class-name"/>"). </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="preceding-sibling::*[not(self::fo:marker)]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">'<xsl:value-of select="name()"/>' elements should be initial children of their parents. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="preceding-sibling::text()[normalize-space() != '']">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be preceded by non-space text nodes. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- ===================================== -->
+	<!-- Multi-properties -->
 
-      <xsl:if test="not(ancestor::fo:flow)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a descendant of 'flow'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="fo:multi-properties">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="no-text" />
 
-      <xsl:if test="ancestor::fo:multi-case">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be used inside '<xsl:value-of select="name(ancestor::fo:multi-case[1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:apply-templates
+			select="*[not(self::fo:multi-property-set                                   or self::fo:wrapper)]"
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason">
+				Element '
+				<xsl:value-of select="name()" />
+				' shall consist of one or more 'multi-property-set' elements,
+				followed by a 'wrapper'.
+			</xsl:with-param>
+		</xsl:apply-templates>
 
-      <xsl:if test="ancestor::fo:float">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be used inside '<xsl:value-of select="name(ancestor::fo:float[1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(fo:multi-property-set)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					At least one 'multi-property-set' element should be specified in '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="ancestor::fo:footnote">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be used inside '<xsl:value-of select="name(ancestor::fo:footnote[1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="not(fo:wrapper)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element 'wrapper' is required inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="count(fo:wrapper) &gt; 1">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					There can be only one '
+					<xsl:value-of select="name(fo:wrapper[1])" />
+					' element inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- === =============================== -->
-<!-- Retrieve-marker                     -->
+		<xsl:if
+			test="fo:wrapper[following-sibling::fo:multi-property-set]">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name(fo:wrapper[1])" />
+					' must be located after all '
+					<xsl:value-of select="name(fo:multi-property-set[1])" />
+					' elements inside '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:retrieve-marker">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
+		<xsl:apply-templates select="*" />
+	</xsl:template>
 
-      <xsl:if test="not(@retrieve-class-name)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'retrieve-class-name' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="not(ancestor::fo:static-content)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a descendant of 'static-content'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<!-- ===================================== -->
+	<!-- Multi-property-set -->
 
+	<xsl:template match="fo:multi-property-set">
+		<xsl:apply-templates select="@*" />
+		<xsl:call-template name="empty-element" />
 
-   <!-- === =============================== -->
-<!-- Basic-link                          -->
+		<xsl:if test="not(@active-state)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'active-state' is required for '
+					<xsl:value-of select="name()" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:basic-link">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="mixed-level"/>
+		<xsl:if test="not(parent::fo:multi-properties)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' should be a child of 'multi-properties'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:if test="not(@internal-destination or @external-destination)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Either 'internal-destination' or 'external-destination' attribute must be present on '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	</xsl:template>
 
-      <xsl:if test="@internal-destination and @external-destination">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Only one of 'internal-destination' or 'external-destination' attributes can be present on '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Common structure-checking templates -->
 
+	<!-- Check for block-level elements -->
 
-   <!-- =================================== -->
-<!-- Multi-switch                        -->
+	<xsl:template name="block-level">
+		<xsl:call-template name="no-text">
+			<xsl:with-param name="reason">
+				Only block-level elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:call-template>
 
-<xsl:template match="fo:multi-switch">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:apply-templates
+			select="*[not(self::fo:block                                   or self::fo:block-container                                   or self::fo:list-block                                   or self::fo:table                                   or self::fo:table-and-caption                                   or self::fo:float                                   or self::fo:wrapper                                   or self::fo:marker                                   or self::fo:retrieve-marker                                   or self::fo:multi-switch                                   or self::fo:multi-properties                                   or self::rx:ruler                                   or self::rx:begin-index-range                                   or self::rx:end-index-range                                   or self::rx:flow-section)]"
+			mode="report-intrusive-elements-block">
+			<xsl:with-param name="reason">
+				Only block-level elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
+		<xsl:for-each
+			select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties">
+			<xsl:call-template name="block-level" />
+		</xsl:for-each>
+	</xsl:template>
 
-      <xsl:apply-templates select="*[not(self::fo:multi-case)]" mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Only 'multi-case' elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<!-- Check for inline-level elements -->
 
+	<xsl:template name="inline-level">
+		<xsl:apply-templates
+			select="*[not(self::fo:bidi-override                                   or self::fo:character                                   or self::fo:external-graphic                                   or self::fo:instream-foreign-object                                   or self::fo:inline                                   or self::fo:inline-container                                   or self::fo:leader                                   or self::fo:page-number                                   or self::fo:page-number-citation                                   or self::fo:basic-link                                   or self::fo:multi-toggle                                   or self::fo:footnote                                   or self::fo:float                                   or self::fo:wrapper                                   or self::fo:marker                                   or self::fo:retrieve-marker                                   or self::fo:multi-switch                                   or self::fo:multi-properties                                  or self::rx:page-index                                   or self::rx:page-number-citation-last                                   or self::rx:page-index                                   or self::rx:begin-index-range                                   or self::rx:end-index-range                                   or self::rx:pinpoint)]"
+			mode="report-intrusive-elements-inline">
+			<xsl:with-param name="reason">
+				Only inline-level elements are permitted in this context.
+			</xsl:with-param>
+		</xsl:apply-templates>
+		<xsl:for-each
+			select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties | fo:multi-toggle | fo:inline | fo:basic-link | fo:bidi-override">
+			<xsl:call-template name="inline-level" />
+		</xsl:for-each>
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Multi-case                          -->
 
-<xsl:template match="fo:multi-case">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="mixed-level"/>
-      <xsl:if test="not(parent::fo:multi-switch)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a child of 'multi-switch'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+	<!-- Check for mixed-level elements -->
 
+	<xsl:template name="mixed-level">
+		<xsl:apply-templates
+			select="*[not(self::fo:block                                   or self::fo:block-container                                   or self::fo:list-block                                   or self::fo:table                                   or self::fo:table-and-caption                                   or self::fo:bidi-override                                   or self::fo:character                                   or self::fo:external-graphic                                   or self::fo:initial-property-set                                   or self::fo:instream-foreign-object                                   or self::fo:inline                                   or self::fo:inline-container                                   or self::fo:leader                                   or self::fo:page-number                                   or self::fo:page-number-citation                                   or self::fo:basic-link                                   or self::fo:multi-toggle                                   or self::fo:footnote                                   or self::fo:float                                   or self::fo:wrapper                                   or self::fo:marker                                   or self::fo:retrieve-marker                                   or self::fo:multi-switch                                   or self::fo:multi-properties                                   or self::rx:page-number-citation-last                                   or self::rx:page-index                                   or self::rx:begin-index-range                                   or self::rx:end-index-range                                   or self::rx:pinpoint)]"
+			mode="report-intrusive-elements-block">
+			<xsl:with-param name="reason">
+				Only block-level or inline-level elements are permitted in this
+				context.
+			</xsl:with-param>
+		</xsl:apply-templates>
+		<xsl:for-each
+			select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties">
+			<xsl:call-template name="mixed-level" />
+		</xsl:for-each>
+	</xsl:template>
 
-   <!-- ===================================== -->
-<!-- Multi-toggle                          -->
 
-<xsl:template match="fo:multi-toggle">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="mixed-level"/>
+	<!-- Check constraints applicable to out-of-line elements -->
 
-      <xsl:if test="not(ancestor::fo:multi-case)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' can be used only inside 'multi-case'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template name="out-of-line">
+		<xsl:if test="not(ancestor::fo:flow)">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' should be a descendant of 'flow'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
+		<xsl:if test="ancestor::fo:float">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot be a descendant of '
+					<xsl:value-of select="name(ancestor::fo:float[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
+		<xsl:if test="ancestor::fo:footnote-body">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot be a descendant of '
+					<xsl:value-of
+						select="name(ancestor::fo:footnote-body[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-   <!-- ===================================== -->
-<!-- Multi-properties                    -->
+		<xsl:if test="ancestor::fo:marker">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot be a descendant of '
+					<xsl:value-of select="name(ancestor::fo:marker[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
 
-<xsl:template match="fo:multi-properties">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="no-text"/>
+		<xsl:if
+			test="ancestor::*[@position='absolute' or @absolute-position='absolute'                          or @position='fixed' or @absolute-position='fixed']">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot be a descendant of an absolutely positioned
+					'
+					<xsl:value-of
+						select="name(ancestor::*[@position='absolute' or @absolute-position='absolute'                                            or @position='fixed' or @absolute-position='fixed'][1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-      <xsl:apply-templates select="*[not(self::fo:multi-property-set                                   or self::fo:wrapper)]"
-                           mode="report-intrusive-elements">
-         <xsl:with-param name="reason">Element '<xsl:value-of select="name()"/>' shall consist of one or more 'multi-property-set' elements, followed by a 'wrapper'.</xsl:with-param>
-      </xsl:apply-templates>
+	<!-- =================================== -->
+	<!-- Auxiliary templates -->
 
-      <xsl:if test="not(fo:multi-property-set)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">At least one 'multi-property-set' element should be specified in '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="not(fo:wrapper)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element 'wrapper' is required inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- Check for non-blank #PCDATA -->
 
-      <xsl:if test="count(fo:wrapper) &gt; 1">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">There can be only one '<xsl:value-of select="name(fo:wrapper[1])"/>' element inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template name="no-text">
+		<xsl:param name="reason" select="''" />
 
-      <xsl:if test="fo:wrapper[following-sibling::fo:multi-property-set]">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name(fo:wrapper[1])"/>' must be located after all '<xsl:value-of select="name(fo:multi-property-set[1])"/>' elements inside '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+		<xsl:if test="text()[normalize-space(.) != '']">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' cannot have
+					non-empty text descendants here.
+					<xsl:value-of
+						select="text()[normalize-space(.) != '']" />
+					<xsl:if test="$reason != ''">
+						<xsl:value-of select="$reason" />
+					</xsl:if>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-      <xsl:apply-templates select="*"/>
-   </xsl:template>
 
+	<!-- Check for element being EMPTY -->
 
-   <!-- ===================================== -->
-<!-- Multi-property-set                    -->
+	<xsl:template name="empty-element">
+		<xsl:if test="* | text()">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Element '
+					<xsl:value-of select="name()" />
+					' must be empty.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-<xsl:template match="fo:multi-property-set">
-      <xsl:apply-templates select="@*"/>
-      <xsl:call-template name="empty-element"/>
 
-      <xsl:if test="not(@active-state)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'active-state' is required for '<xsl:value-of select="name()"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="not(parent::fo:multi-properties)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a child of 'multi-properties'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- Report an element that may not be present in a given point -->
 
-   </xsl:template>
+	<xsl:template match="*" mode="report-intrusive-elements"
+		priority="-1">
+		<xsl:param name="reason" select="''" />
+		<xsl:variable name="uri" select="namespace-uri()" />
 
+		<xsl:choose>
+			<xsl:when
+				test="$uri='http://www.w3.org/1999/XSL/Format'                  or $uri='http://www.renderx.com/XSL/Extensions'">
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Element '
+						<xsl:value-of select="name()" />
+						' cannot be a child of '
+						<xsl:value-of select="name(..)" />
+						'.
+						<xsl:if test="$reason != ''">
+							<xsl:value-of select="$reason" />
+						</xsl:if>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$uri = ''">
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Element '
+						<xsl:value-of select="name()" />
+						' belonging to the anonymous namespace cannot occur in an XSL-FO
+						document outside 'instream-foreign-object' elements.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$uri = 'http://www.w3.org/2000/svg'">
+				<xsl:if test="$strictness &gt; 0">
+					<xsl:call-template name="print-warning">
+						<xsl:with-param name="msg">
+							SVG element '
+							<xsl:value-of select="name()" />
+							' is located outside 'instream-foreign-object' element.
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$strictness &gt; 1">
+					<xsl:call-template name="print-warning">
+						<xsl:with-param name="msg">
+							Element '
+							<xsl:value-of select="name()" />
+							' belongs to an unknown namespace
+							<xsl:value-of select="$uri" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Common structure-checking templates -->
+	<xsl:template match="*"
+		mode="report-intrusive-elements-block" priority="-1">
+		<xsl:param name="reason" />
 
-<!-- Check for block-level elements         -->
+		<xsl:apply-templates select="."
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason" select="$reason" />
+		</xsl:apply-templates>
+	</xsl:template>
 
-<xsl:template name="block-level">
-      <xsl:call-template name="no-text">
-         <xsl:with-param name="reason">Only block-level elements are permitted in this context.</xsl:with-param>
-      </xsl:call-template>
+	<xsl:template match="*"
+		mode="report-intrusive-elements-inline" priority="-1">
+		<xsl:param name="reason" />
 
-      <xsl:apply-templates select="*[not(self::fo:block                                   or self::fo:block-container                                   or self::fo:list-block                                   or self::fo:table                                   or self::fo:table-and-caption                                   or self::fo:float                                   or self::fo:wrapper                                   or self::fo:marker                                   or self::fo:retrieve-marker                                   or self::fo:multi-switch                                   or self::fo:multi-properties                                   or self::rx:ruler                                   or self::rx:begin-index-range                                   or self::rx:end-index-range                                   or self::rx:flow-section)]"
-                           mode="report-intrusive-elements-block">
-         <xsl:with-param name="reason">Only block-level elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
-      <xsl:for-each select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties">
-         <xsl:call-template name="block-level"/>
-      </xsl:for-each>
-   </xsl:template>
+		<xsl:apply-templates select="."
+			mode="report-intrusive-elements">
+			<xsl:with-param name="reason" select="$reason" />
+		</xsl:apply-templates>
+	</xsl:template>
 
 
-   <!-- Check for inline-level elements         -->
+	<!-- Special case: report an invalid element contained in a wrapper -->
 
-<xsl:template name="inline-level">
-      <xsl:apply-templates select="*[not(self::fo:bidi-override                                   or self::fo:character                                   or self::fo:external-graphic                                   or self::fo:instream-foreign-object                                   or self::fo:inline                                   or self::fo:inline-container                                   or self::fo:leader                                   or self::fo:page-number                                   or self::fo:page-number-citation                                   or self::fo:basic-link                                   or self::fo:multi-toggle                                   or self::fo:footnote                                   or self::fo:float                                   or self::fo:wrapper                                   or self::fo:marker                                   or self::fo:retrieve-marker                                   or self::fo:multi-switch                                   or self::fo:multi-properties                                  or self::rx:page-index                                   or self::rx:page-number-citation-last                                   or self::rx:page-index                                   or self::rx:begin-index-range                                   or self::rx:end-index-range                                   or self::rx:pinpoint)]"
-                           mode="report-intrusive-elements-inline">
-         <xsl:with-param name="reason">Only inline-level elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
-      <xsl:for-each select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties | fo:multi-toggle | fo:inline | fo:basic-link | fo:bidi-override">
-         <xsl:call-template name="inline-level"/>
-      </xsl:for-each>
-   </xsl:template>
+	<xsl:template
+		match="fo:wrapper/*                    | fo:multi-properties/*                    | fo:multi-case/*"
+		mode="report-intrusive-elements-block">
+		<xsl:param name="reason" select="''" />
 
+		<xsl:call-template name="print-error">
+			<xsl:with-param name="msg">
+				Element '
+				<xsl:value-of select="name()" />
+				' cannot be a descendant of '
+				<xsl:value-of
+					select="name(ancestor::*[not(self::fo:wrapper or self::fo:multi-switch or self::fo:multi-case or self::fo:multi-properties)][1])" />
+				' through wrapper elements.
+				<xsl:if test="$reason != ''">
+					<xsl:value-of select="$reason" />
+				</xsl:if>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- Check for mixed-level elements         -->
+	<xsl:template
+		match="fo:wrapper/*                    | fo:inline/*                    | fo:basic-link/*                    | fo:bidi-override/*                    | fo:multi-toggle/*                    | fo:multi-properties/*                    | fo:multi-case/*"
+		mode="report-intrusive-elements-inline">
+		<xsl:param name="reason" select="''" />
 
-<xsl:template name="mixed-level">
-      <xsl:apply-templates select="*[not(self::fo:block                                   or self::fo:block-container                                   or self::fo:list-block                                   or self::fo:table                                   or self::fo:table-and-caption                                   or self::fo:bidi-override                                   or self::fo:character                                   or self::fo:external-graphic                                   or self::fo:initial-property-set                                   or self::fo:instream-foreign-object                                   or self::fo:inline                                   or self::fo:inline-container                                   or self::fo:leader                                   or self::fo:page-number                                   or self::fo:page-number-citation                                   or self::fo:basic-link                                   or self::fo:multi-toggle                                   or self::fo:footnote                                   or self::fo:float                                   or self::fo:wrapper                                   or self::fo:marker                                   or self::fo:retrieve-marker                                   or self::fo:multi-switch                                   or self::fo:multi-properties                                   or self::rx:page-number-citation-last                                   or self::rx:page-index                                   or self::rx:begin-index-range                                   or self::rx:end-index-range                                   or self::rx:pinpoint)]"
-                           mode="report-intrusive-elements-block">
-         <xsl:with-param name="reason">Only block-level or inline-level elements are permitted in this context.</xsl:with-param>
-      </xsl:apply-templates>
-      <xsl:for-each select="fo:wrapper | fo:multi-switch/fo:multi-case | fo:multi-properties">
-         <xsl:call-template name="mixed-level"/>
-      </xsl:for-each>
-   </xsl:template>
+		<xsl:call-template name="print-error">
+			<xsl:with-param name="msg">
+				Element '
+				<xsl:value-of select="name()" />
+				' cannot be a descendant of '
+				<xsl:value-of
+					select="name(ancestor::*[not(self::fo:wrapper or self::fo:multi-switch or self::fo:multi-case or self::fo:multi-toggle or self::fo:multi-properties or self::fo:inline)][1])" />
+				' through wrapper or inline elements.
+				<xsl:if test="$reason != ''">
+					<xsl:value-of select="$reason" />
+				</xsl:if>
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
 
-   <!-- Check constraints applicable to out-of-line elements  -->
+	<!-- Default rules -->
 
-<xsl:template name="out-of-line">
-      <xsl:if test="not(ancestor::fo:flow)">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' should be a descendant of 'flow'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<xsl:template match="*" priority="-1" />
+	<xsl:template match="text()" />
 
-      <xsl:if test="ancestor::fo:float">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::fo:float[1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
 
-      <xsl:if test="ancestor::fo:footnote-body">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::fo:footnote-body[1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- ##################################################################### -->
+	<!-- Processing of attributes. -->
+	<!-- ##################################################################### -->
 
-      <xsl:if test="ancestor::fo:marker">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::fo:marker[1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
+	<!-- Report any attribute not covered by enabling templates -->
 
-      <xsl:if test="ancestor::*[@position='absolute' or @absolute-position='absolute'                          or @position='fixed' or @absolute-position='fixed']">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' cannot be a descendant of an absolutely positioned
-      '<xsl:value-of select="name(ancestor::*[@position='absolute' or @absolute-position='absolute'                                            or @position='fixed' or @absolute-position='fixed'][1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template match="@*" priority="-2">
+		<xsl:call-template name="complain-attribute" />
+	</xsl:template>
 
-   <!-- =================================== -->
-<!-- Auxiliary templates                 -->
+	<!-- Report any attribute in fo:layout-master-set etc. as invalid. -->
+	<!-- This is overridden by a rule with higher priority for those (few) -->
+	<!-- properties that actually may occur in these special positions -->
 
+	<xsl:template
+		match="@*[not (parent::fo:root)                     and not (ancestor::fo:page-sequence)                     and not (parent::*/parent::fo:simple-page-master)]"
+		priority="4">
+		<xsl:call-template name="complain-attribute" />
+	</xsl:template>
 
-<!-- Check for non-blank #PCDATA -->
+	<xsl:template match="fo:simple-page-master/*/@*"
+		priority="2">
+		<xsl:call-template name="complain-attribute" />
+	</xsl:template>
 
-<xsl:template name="no-text">
-      <xsl:param name="reason" select="''"/>
+	<xsl:template name="complain-attribute">
+		<xsl:variable name="uri" select="namespace-uri()" />
 
-      <xsl:if test="text()[normalize-space(.) != '']">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">
-        Element '<xsl:value-of select="name()"/>' cannot have
-	non-empty text descendants here. <xsl:value-of select="text()[normalize-space(.) != '']"/>
-               <xsl:if test="$reason != ''">
-                  <xsl:value-of select="$reason"/>
-               </xsl:if>
-            </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+		<xsl:choose>
+			<!-- Ignore attributes from XML namespace - xml:space, xml:base, etc. -->
+			<xsl:when test="$uri='http://www.w3.org/XML/1998/namespace'" />
+			<xsl:when
+				test="$uri=''                  or $uri='http://www.w3.org/1999/XSL/Format'                  or $uri='http://www.renderx.com/XSL/Extensions'">
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Attribute '
+						<xsl:value-of select="name()" />
+						' cannot occur at element '
+						<xsl:value-of select="name(..)" />
+						'.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:if test="$strictness &gt; 1">
+					<xsl:call-template name="print-warning">
+						<xsl:with-param name="msg">
+							Attribute '
+							<xsl:value-of select="name()" />
+							' at element '
+							<xsl:value-of select="name(..)" />
+							' belongs to an unknown namespace
+							<xsl:value-of select="$uri" />
+						</xsl:with-param>
+					</xsl:call-template>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
+	<xsl:template name="disable-on-atomic-inlines">
+		<xsl:if
+			test="parent::fo:character              or parent::fo:page-number              or parent::fo:page-number-citation              or parent::rx:page-number-citation-last              or parent::fo:initial-property-set">
+			<xsl:call-template name="complain-attribute" />
+		</xsl:if>
+	</xsl:template>
 
-   <!-- Check for element being EMPTY -->
 
-<xsl:template name="empty-element">
-      <xsl:if test="* | text()">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Element '<xsl:value-of select="name()"/>' must be empty. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template name="disable-on-graphics">
+		<xsl:if
+			test="parent::fo:external-graphic              or parent::fo:instream-foreign-object">
+			<xsl:call-template name="complain-attribute" />
+		</xsl:if>
+	</xsl:template>
 
+	<!-- Report a value not in a list. Expressions (recognized by the presence -->
+	<!-- of parentheses or operators) are excluded from validation. -->
 
+	<xsl:template name="enumerated-values">
+		<xsl:param name="valuelist" />
+		<xsl:variable name="value" select="normalize-space(.)" />
+		<xsl:choose>
+			<xsl:when
+				test="contains($valuelist, concat(' ', $value, ' '))" />
+			<xsl:when
+				test="contains($value, '(') and contains ($value, ')')" />
+			<xsl:otherwise>
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Attribute '
+						<xsl:value-of select="name()" />
+						' cannot have a value of "
+						<xsl:value-of select="$value" />
+						".
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <!-- Report an element that may not be present in a given point -->
+	<!-- Report a value that is not a valid number or length. Skips validation -->
+	<!-- of attributes containing digits, parentheses, and math operators. -->
 
-<xsl:template match="*" mode="report-intrusive-elements" priority="-1">
-      <xsl:param name="reason" select="''"/>
-      <xsl:variable name="uri" select="namespace-uri()"/>
+	<xsl:template name="quantitative-values">
+		<xsl:param name="valuelist" />
+		<xsl:variable name="value" select="normalize-space(.)" />
+		<xsl:choose>
+			<xsl:when
+				test="contains($valuelist, concat(' ', $value, ' '))" />
+			<xsl:when
+				test="contains($value, '(') and contains ($value, ')')" />
+			<xsl:when test="contains($value, '0')" />
+			<xsl:when test="contains($value, '1')" />
+			<xsl:when test="contains($value, '2')" />
+			<xsl:when test="contains($value, '3')" />
+			<xsl:when test="contains($value, '4')" />
+			<xsl:when test="contains($value, '5')" />
+			<xsl:when test="contains($value, '6')" />
+			<xsl:when test="contains($value, '7')" />
+			<xsl:when test="contains($value, '8')" />
+			<xsl:when test="contains($value, '9')" />
+			<xsl:when test="contains($value, '+')" />
+			<xsl:when test="contains($value, ' - ')" />
+			<xsl:when test="contains($value, '*')" />
+			<xsl:when test="contains($value, ' div ')" />
+			<xsl:when test="contains($value, ' mod ')" />
+			<xsl:otherwise>
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Attribute '
+						<xsl:value-of select="name()" />
+						' cannot have a value of "
+						<xsl:value-of select="$value" />
+						".
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-      <xsl:choose>
-         <xsl:when test="$uri='http://www.w3.org/1999/XSL/Format'                  or $uri='http://www.renderx.com/XSL/Extensions'">
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">
-           Element '<xsl:value-of select="name()"/>' cannot be a child of '<xsl:value-of select="name(..)"/>'.
-           <xsl:if test="$reason != ''">
-                     <xsl:value-of select="$reason"/>
-                  </xsl:if>
-               </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$uri = ''">
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">
-          Element '<xsl:value-of select="name()"/>' belonging to the anonymous namespace cannot occur in an XSL-FO document outside 'instream-foreign-object' elements.
-        </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:when test="$uri = 'http://www.w3.org/2000/svg'">
-            <xsl:if test="$strictness &gt; 0">
-               <xsl:call-template name="print-warning">
-                  <xsl:with-param name="msg">
-            SVG element '<xsl:value-of select="name()"/>' is located outside 'instream-foreign-object' element.
-          </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:if test="$strictness &gt; 1">
-               <xsl:call-template name="print-warning">
-                  <xsl:with-param name="msg">
-             Element '<xsl:value-of select="name()"/>' belongs to an unknown namespace <xsl:value-of select="$uri"/>
-                  </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<!-- Check if a value is valid as a URL specifier -->
+	<xsl:template name="check-url">
+		<xsl:variable name="val" select="normalize-space()" />
+		<xsl:choose>
+			<xsl:when test="$val = 'inherit'" />
+			<xsl:when
+				test="starts-with($val, 'url(')                 and substring ($val, string-length($val)) = ')'" />
+			<xsl:otherwise>
+				<xsl:call-template name="print-warning">
+					<xsl:with-param name="msg">
+						Attribute '
+						<xsl:value-of select="name()" />
+						' cannot have a value of "
+						<xsl:value-of select="." />
+						": should be either 'inherit' or a URI:
+						<xsl:value-of select="name()" />
+						="url(...)".
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-   <xsl:template match="*" mode="report-intrusive-elements-block" priority="-1">
-      <xsl:param name="reason"/>
+	<!-- 7.3. Accessibility properties - ubiquitous; not validated -->
+	<xsl:template match="@source-document" priority="5">
+		<xsl:variable name="val" select="normalize-space()" />
+		<xsl:choose>
+			<xsl:when test="$val = 'inherit'" />
+			<xsl:when test="$val = 'none'" />
+			<xsl:when
+				test="starts-with($val, 'url(')                 and substring ($val, string-length($val)) = ')'" />
+			<xsl:otherwise>
+				<xsl:call-template name="print-error">
+					<xsl:with-param name="msg">
+						Attribute '
+						<xsl:value-of select="name()" />
+						' cannot have a value of "
+						<xsl:value-of select="." />
+						": should be 'inherit', 'none', or one or more URIs:
+						source="url(...) [url(...) ...]".
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-      <xsl:apply-templates select="." mode="report-intrusive-elements">
-         <xsl:with-param name="reason" select="$reason"/>
-      </xsl:apply-templates>
-   </xsl:template>
 
-   <xsl:template match="*" mode="report-intrusive-elements-inline" priority="-1">
-      <xsl:param name="reason"/>
+	<xsl:template match="@role" priority="5" />
 
-      <xsl:apply-templates select="." mode="report-intrusive-elements">
-         <xsl:with-param name="reason" select="$reason"/>
-      </xsl:apply-templates>
-   </xsl:template>
+	<!-- 7.4. Absolute position -->
+	<xsl:template
+		match="fo:block-container/@absolute-position">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto absolute fixed inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@top | @bottom | @left | @right">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- Special case: report an invalid element contained in a wrapper -->
+	<!-- 7.5. Aural properties. May happen everywhere in the flows. Not validated. -->
+	<xsl:template match="@azimuth" />
+	<xsl:template match="@cue-after" />
+	<xsl:template match="@cue-before" />
 
-<xsl:template match="fo:wrapper/*                    | fo:multi-properties/*                    | fo:multi-case/*"
-                 mode="report-intrusive-elements-block">
-      <xsl:param name="reason" select="''"/>
+	<xsl:template match="@elevation">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				below level above higher lower inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-      <xsl:call-template name="print-error">
-         <xsl:with-param name="msg">
-      Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::*[not(self::fo:wrapper or self::fo:multi-switch or self::fo:multi-case or self::fo:multi-properties)][1])"/>' through wrapper elements.
-      <xsl:if test="$reason != ''">
-               <xsl:value-of select="$reason"/>
-            </xsl:if>
-         </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@pause-after | @pause-before">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:wrapper/*                    | fo:inline/*                    | fo:basic-link/*                    | fo:bidi-override/*                    | fo:multi-toggle/*                    | fo:multi-properties/*                    | fo:multi-case/*"
-                 mode="report-intrusive-elements-inline">
-      <xsl:param name="reason" select="''"/>
+	<xsl:template match="@pitch">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				x-low low medium high x-high inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-      <xsl:call-template name="print-error">
-         <xsl:with-param name="msg">
-      Element '<xsl:value-of select="name()"/>' cannot be a descendant of '<xsl:value-of select="name(ancestor::*[not(self::fo:wrapper or self::fo:multi-switch or self::fo:multi-case or self::fo:multi-toggle or self::fo:multi-properties or self::fo:inline)][1])"/>' through wrapper or inline elements.
-      <xsl:if test="$reason != ''">
-               <xsl:value-of select="$reason"/>
-            </xsl:if>
-         </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@pitch-range">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@play-during" />
 
-   <!-- Default rules -->
+	<xsl:template match="@richness">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-<xsl:template match="*" priority="-1"/>
-   <xsl:template match="text()"/>
+	<xsl:template match="@speak">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				normal none spell-out inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@speak-header">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				once always inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- ##################################################################### -->
-<!-- Processing of attributes.                                             -->
-<!-- ##################################################################### -->
+	<xsl:template match="@speak-numeral">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				digits continuous inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-<!-- Report any attribute not covered by enabling templates -->
+	<xsl:template match="@speak-punctuation">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				code none inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-<xsl:template match="@*" priority="-2">
-      <xsl:call-template name="complain-attribute"/>
-   </xsl:template>
+	<xsl:template match="@speech-rate">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				x-slow slow medium fast x-fast faster slower inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- Report any attribute in fo:layout-master-set etc. as invalid.         -->
-<!-- This is overridden by a rule with higher priority for those (few)     -->
-<!-- properties that actually may occur in these special positions         -->
+	<xsl:template match="@stress">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-<xsl:template match="@*[not (parent::fo:root)                     and not (ancestor::fo:page-sequence)                     and not (parent::*/parent::fo:simple-page-master)]"
-                 priority="4">
-      <xsl:call-template name="complain-attribute"/>
-   </xsl:template>
+	<xsl:template match="@voice-family" />
+	<xsl:template match="@volume">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				silent x-soft soft medium loud x-loud inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:simple-page-master/*/@*" priority="2">
-      <xsl:call-template name="complain-attribute"/>
-   </xsl:template>
 
-   <xsl:template name="complain-attribute">
-      <xsl:variable name="uri" select="namespace-uri()"/>
+	<!-- 7.6. Border, padding, and background -->
+	<xsl:template priority="3" match="@background-attachment">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				scroll fixed inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-      <xsl:choose>
-    <!-- Ignore attributes from XML namespace - xml:space, xml:base, etc. -->
-    <xsl:when test="$uri='http://www.w3.org/XML/1998/namespace'"/> 
-         <xsl:when test="$uri=''                  or $uri='http://www.w3.org/1999/XSL/Format'                  or $uri='http://www.renderx.com/XSL/Extensions'">
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot occur at element '<xsl:value-of select="name(..)"/>'. </xsl:with-param>
-            </xsl:call-template>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:if test="$strictness &gt; 1">
-               <xsl:call-template name="print-warning">
-                  <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' at element '<xsl:value-of select="name(..)"/>' belongs to an unknown namespace <xsl:value-of select="$uri"/> 
-                  </xsl:with-param>
-               </xsl:call-template>
-            </xsl:if>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template priority="3" match="@background-color" />
 
-   <xsl:template name="disable-on-atomic-inlines">
-      <xsl:if test="parent::fo:character              or parent::fo:page-number              or parent::fo:page-number-citation              or parent::rx:page-number-citation-last              or parent::fo:initial-property-set">
-         <xsl:call-template name="complain-attribute"/>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template priority="3" match="@background-image">
+		<xsl:if test=". != 'none'">
+			<xsl:call-template name="check-url" />
+		</xsl:if>
+	</xsl:template>
 
+	<xsl:template priority="3" match="@background-repeat">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				repeat repeat-x repeat-y no-repeat inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template name="disable-on-graphics">
-      <xsl:if test="parent::fo:external-graphic              or parent::fo:instream-foreign-object">
-         <xsl:call-template name="complain-attribute"/>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template priority="3"
+		match="@background-position-horizontal">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				left center right inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- Report a value not in a list. Expressions (recognized by the presence -->
-<!-- of parentheses or operators) are excluded from validation.            -->
+	<xsl:template priority="3"
+		match="@background-position-vertical">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				top center bottom inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-<xsl:template name="enumerated-values">
-      <xsl:param name="valuelist"/>
-      <xsl:variable name="value" select="normalize-space(.)"/>
-      <xsl:choose>
-         <xsl:when test="contains($valuelist, concat(' ', $value, ' '))"/>
-         <xsl:when test="contains($value, '(') and contains ($value, ')')"/>
-         <xsl:otherwise>
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="$value"/>". </xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template priority="3"
+		match="@border-before-color                    | @border-after-color                    | @border-start-color                    | @border-end-color                    | @border-top-color                    | @border-bottom-color                    | @border-left-color                    | @border-right-color" />
 
-   <!-- Report a value that is not a valid number or length. Skips validation -->
-<!-- of attributes containing digits, parentheses, and math operators.     -->
+	<xsl:template priority="3"
+		match="@border-before-style                    | @border-after-style                    | @border-start-style                    | @border-end-style                    | @border-top-style                    | @border-bottom-style                    | @border-left-style                    | @border-right-style">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				none hidden dotted dashed solid double groove ridge inset outset
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-<xsl:template name="quantitative-values">
-      <xsl:param name="valuelist"/>
-      <xsl:variable name="value" select="normalize-space(.)"/>
-      <xsl:choose>
-         <xsl:when test="contains($valuelist, concat(' ', $value, ' '))"/>
-         <xsl:when test="contains($value, '(') and contains ($value, ')')"/>
-         <xsl:when test="contains($value, '0')"/>
-         <xsl:when test="contains($value, '1')"/>
-         <xsl:when test="contains($value, '2')"/>
-         <xsl:when test="contains($value, '3')"/>
-         <xsl:when test="contains($value, '4')"/>
-         <xsl:when test="contains($value, '5')"/>
-         <xsl:when test="contains($value, '6')"/>
-         <xsl:when test="contains($value, '7')"/>
-         <xsl:when test="contains($value, '8')"/>
-         <xsl:when test="contains($value, '9')"/>
-         <xsl:when test="contains($value, '+')"/>
-         <xsl:when test="contains($value, ' - ')"/>
-         <xsl:when test="contains($value, '*')"/>
-         <xsl:when test="contains($value, ' div ')"/>
-         <xsl:when test="contains($value, ' mod ')"/>
-         <xsl:otherwise>
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="$value"/>". </xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template priority="3"
+		match="@border-before-width                    | @border-before-width.length                    | @border-after-width                    | @border-after-width.length                    | @border-start-width                    | @border-start-width.length                    | @border-end-width                    | @border-end-width.length                    | @border-top-width                    | @border-bottom-width                    | @border-left-width                    | @border-right-width">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				thin medium thick inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- Check if a value is valid as a URL specifier -->
-<xsl:template name="check-url">
-      <xsl:variable name="val" select="normalize-space()"/>
-      <xsl:choose>
-         <xsl:when test="$val = 'inherit'"/>
-         <xsl:when test="starts-with($val, 'url(')                 and substring ($val, string-length($val)) = ')'"/>
-         <xsl:otherwise>
-            <xsl:call-template name="print-warning">
-               <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="."/>": should be either 'inherit' or a URI: <xsl:value-of select="name()"/>="url(...)".</xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template
+		match="@border-before-width.conditionality                    | @border-after-width.conditionality                    | @border-start-width.conditionality                    | @border-end-width.conditionality">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				discard retain
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.3. Accessibility properties - ubiquitous; not validated -->
-<xsl:template match="@source-document" priority="5">
-      <xsl:variable name="val" select="normalize-space()"/>
-      <xsl:choose>
-         <xsl:when test="$val = 'inherit'"/>
-         <xsl:when test="$val = 'none'"/>
-         <xsl:when test="starts-with($val, 'url(')                 and substring ($val, string-length($val)) = ')'"/>
-         <xsl:otherwise>
-            <xsl:call-template name="print-error">
-               <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="."/>": should be 'inherit', 'none', or one or more URIs: source="url(...) [url(...) ...]".</xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template priority="3"
+		match="@padding-before                    | @padding-before.length                    | @padding-after                    | @padding-after.length                    | @padding-start                    | @padding-start.length                    | @padding-end                    | @padding-end.length                    | @padding-top                    | @padding-bottom                    | @padding-left                    | @padding-right">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template
+		match="@padding-before.conditionality                    | @padding-after.conditionality                    | @padding-start.conditionality                    | @padding-end.conditionality">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				discard retain
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@role" priority="5"/>
+	<!-- 7.7. Font properties -->
+	<xsl:template match="@font-family">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <!-- 7.4. Absolute position -->
-<xsl:template match="fo:block-container/@absolute-position">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto absolute fixed inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@font-selection-strategy">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto character-by-character inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@top | @bottom | @left | @right">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@font-size">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				xx-small x-small small medium large x-large xx-large larger smaller
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.5. Aural properties. May happen everywhere in the flows. Not validated. -->
-<xsl:template match="@azimuth"/>
-   <xsl:template match="@cue-after"/>
-   <xsl:template match="@cue-before"/>
+	<xsl:template match="@font-stretch">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values"> <!-- this is kinda sorta extension -->
+			<xsl:with-param name="valuelist">
+				normal wider narrower ultra-condensed extra-condensed condensed
+				semi-condensed semi-expanded expanded extra-expanded ultra-expanded
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@elevation">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> below level above higher lower inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@font-size-adjust">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				none inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@pause-after | @pause-before">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@font-style">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				normal italic oblique backslant inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@pitch">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> x-low low medium high x-high inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@font-variant">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				normal small-caps inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@pitch-range">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@font-weight">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				normal bold bolder lighter inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@play-during"/>
+	<!-- 7.8. Hyphenation -->
+	<xsl:template match="@country">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <xsl:template match="@richness">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@language">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <xsl:template match="@speak">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> normal none spell-out inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@script">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <xsl:template match="@speak-header">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> once always inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@hyphenate">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				false true inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@speak-numeral">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> digits continuous inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@hyphenation-character">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <xsl:template match="@speak-punctuation">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> code none inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@hyphenation-push-character-count                    | @hyphenation-remain-character-count">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@speech-rate">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> x-slow slow medium fast x-fast faster slower inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template match="@stress">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.9 - 7.10. Margin properties - block and inline -->
+	<xsl:template
+		match="@margin-top                    | @margin-bottom                    | @margin-left                    | @margin-right">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@voice-family"/>
-   <xsl:template match="@volume">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> silent x-soft soft medium loud x-loud inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:region-body/@margin-top                    | fo:region-body/@margin-bottom                    | fo:region-body/@margin-left                    | fo:region-body/@margin-right                    | fo:simple-page-master/@margin-top                    | fo:simple-page-master/@margin-bottom                    | fo:simple-page-master/@margin-left                    | fo:simple-page-master/@margin-right">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
+	<xsl:template
+		match="@space-before                    | @space-before.minimum                    | @space-before.optimum                    | @space-before.maximum                    | @space-after                    | @space-after.minimum                    | @space-after.optimum                    | @space-after.maximum                    | @space-start                    | @space-start.minimum                    | @space-start.optimum                    | @space-start.maximum                    | @space-end                    | @space-end.minimum                    | @space-end.optimum                    | @space-end.maximum">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.6. Border, padding, and background -->
-<xsl:template priority="3" match="@background-attachment">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> scroll fixed inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template priority="3" match="@background-color"/>
+	<xsl:template
+		match="@space-before.conditionality                    | @space-after.conditionality                    | @space-start.conditionality                    | @space-end.conditionality">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				discard retain
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3" match="@background-image">
-      <xsl:if test=". != 'none'">
-         <xsl:call-template name="check-url"/>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template
+		match="@space-before.precedence                    | @space-after.precedence                    | @space-start.precedence                    | @space-end.precedence">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				force
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3" match="@background-repeat">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> repeat repeat-x repeat-y no-repeat inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template priority="3" match="@background-position-horizontal">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> left center right inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@start-indent | @end-indent">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3" match="@background-position-vertical">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> top center bottom inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template priority="3"
-                 match="@border-before-color                    | @border-after-color                    | @border-start-color                    | @border-end-color                    | @border-top-color                    | @border-bottom-color                    | @border-left-color                    | @border-right-color"/>
+	<!-- 7.11. Relative position -->
+	<xsl:template match="@relative-position">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				static relative inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3"
-                 match="@border-before-style                    | @border-after-style                    | @border-start-style                    | @border-end-style                    | @border-top-style                    | @border-bottom-style                    | @border-left-style                    | @border-right-style">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> none hidden dotted dashed solid double groove ridge inset outset inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.12. Area alignment -->
+	<xsl:template match="@alignment-adjust">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto baseline before-edge text-before-edge middle central after-edge
+				text-after-edge ideographic alphabetic hanging mathematical top
+				bottom text-top text-bottom inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3"
-                 match="@border-before-width                    | @border-before-width.length                    | @border-after-width                    | @border-after-width.length                    | @border-start-width                    | @border-start-width.length                    | @border-end-width                    | @border-end-width.length                    | @border-top-width                    | @border-bottom-width                    | @border-left-width                    | @border-right-width">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> thin medium thick inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@alignment-baseline">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto baseline before-edge text-before-edge middle central after-edge
+				text-after-edge ideographic alphabetic hanging mathematical top
+				bottom text-top text-bottom inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@border-before-width.conditionality                    | @border-after-width.conditionality                    | @border-start-width.conditionality                    | @border-end-width.conditionality">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> discard retain </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@baseline-shift">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				baseline sub super inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3"
-                 match="@padding-before                    | @padding-before.length                    | @padding-after                    | @padding-after.length                    | @padding-start                    | @padding-start.length                    | @padding-end                    | @padding-end.length                    | @padding-top                    | @padding-bottom                    | @padding-left                    | @padding-right">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="3" match="@display-align">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto before center after inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@padding-before.conditionality                    | @padding-after.conditionality                    | @padding-start.conditionality                    | @padding-end.conditionality">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> discard retain </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@dominant-baseline">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto use-script no-change reset-size ideographic alphabetic hanging
+				mathematical central middle text-after-edge text-before-edge inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.7. Font properties  -->
-<xsl:template match="@font-family">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
+	<xsl:template match="@relative-align">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				before baseline inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@font-selection-strategy">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto character-by-character inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.13. Area dimensions -->
+	<xsl:template
+		match="@block-progression-dimension                    | @block-progression-dimension.minimum                    | @block-progression-dimension.optimum                    | @block-progression-dimension.maximum                    | @inline-progression-dimension                    | @inline-progression-dimension.minimum                    | @inline-progression-dimension.optimum                    | @inline-progression-dimension.maximum                    | @height                    | @width">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@font-size">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> xx-small x-small small medium large x-large xx-large larger smaller inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@max-height | @max-width">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				none inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@font-stretch">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values"> <!-- this is kinda sorta extension -->
-    <xsl:with-param name="valuelist"> normal wider narrower ultra-condensed extra-condensed condensed semi-condensed semi-expanded expanded extra-expanded ultra-expanded inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@min-height | @min-width">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@font-size-adjust">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> none inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@content-height | @content-width">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto scale-to-fit inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@font-style">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> normal italic oblique backslant inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@scaling">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				uniform non-uniform inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@font-variant">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> normal small-caps inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@scaling-method">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto integer-pixels resample-any-method inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@font-weight">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> normal bold bolder lighter inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <!-- 7.8. Hyphenation  -->
-<xsl:template match="@country">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
+	<!-- 7.14. Block and line-related properties -->
+	<xsl:template match="@hyphenation-keep">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto column page inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@language">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
+	<xsl:template match="@hyphenation-ladder-count">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				no-limit inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@script">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
+	<xsl:template match="@text-indent | @last-line-end-indent">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@hyphenate">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> false true inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@line-height">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				normal inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@hyphenation-character">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
+	<xsl:template
+		match="@line-height.minimum                    | @line-height.optimum                    | @line-height.maximum">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@hyphenation-push-character-count                    | @hyphenation-remain-character-count">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@line-height.conditionality">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				discard retain
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@line-height.precedence">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				force
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.9 - 7.10. Margin properties - block and inline  -->
-<xsl:template match="@margin-top                    | @margin-bottom                    | @margin-left                    | @margin-right">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@line-height-shift-adjustment">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				consider-shifts disregard-shifts inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5"
-                 match="fo:region-body/@margin-top                    | fo:region-body/@margin-bottom                    | fo:region-body/@margin-left                    | fo:region-body/@margin-right                    | fo:simple-page-master/@margin-top                    | fo:simple-page-master/@margin-bottom                    | fo:simple-page-master/@margin-left                    | fo:simple-page-master/@margin-right">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template match="@line-stacking-strategy">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				line-height font-height max-height inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@space-before                    | @space-before.minimum                    | @space-before.optimum                    | @space-before.maximum                    | @space-after                    | @space-after.minimum                    | @space-after.optimum                    | @space-after.maximum                    | @space-start                    | @space-start.minimum                    | @space-start.optimum                    | @space-start.maximum                    | @space-end                    | @space-end.minimum                    | @space-end.optimum                    | @space-end.maximum">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@linefeed-treatment">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				ignore preserve treat-as-space treat-as-zero-width-space inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@white-space-treatment">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				ignore preserve ignore-if-before-linefeed ignore-if-after-linefeed
+				ignore-if-surrounding-linefeed inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@space-before.conditionality                    | @space-after.conditionality                    | @space-start.conditionality                    | @space-end.conditionality">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> discard retain </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@text-align">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:variable name="keyword-charset"
+			select="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
+		<xsl:variable name="token" select="normalize-space()" />
+		<xsl:if
+			test="string-length($token) != 0 and                 string-length(translate($token, $keyword-charset, '')) = 0">
+			<xsl:call-template name="enumerated-values">
+				<xsl:with-param name="valuelist">
+					start center end justify inside outside left right inherit
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
 
-   <xsl:template match="@space-before.precedence                    | @space-after.precedence                    | @space-start.precedence                    | @space-end.precedence">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> force </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
+	<xsl:template match="@text-align-last">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				relative start center end justify inside outside left right inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@start-indent | @end-indent">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@white-space-collapse">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				false true inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@wrap-option">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				no-wrap wrap inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.11. Relative position  -->
-<xsl:template match="@relative-position">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> static relative inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <!-- 7.12. Area alignment  -->
-<xsl:template match="@alignment-adjust">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto baseline before-edge text-before-edge middle central after-edge text-after-edge ideographic alphabetic hanging mathematical top bottom text-top text-bottom inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.15. Character properties -->
+	<xsl:template match="fo:character/@character" />
 
-   <xsl:template match="@alignment-baseline">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto baseline before-edge text-before-edge middle central after-edge text-after-edge ideographic alphabetic hanging mathematical top bottom text-top text-bottom inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@letter-spacing.minimum                     | @letter-spacing.optimum                      | @letter-spacing.maximum                      | @letter-spacing                     | @word-spacing.minimum                     | @word-spacing.optimum                     | @word-spacing.maximum                     | @word-spacing">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				normal inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@baseline-shift">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> baseline sub super inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@word-spacing.conditionality                    | @letter-spacing.conditionality">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				discard retain
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3" match="@display-align">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto before center after inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@word-spacing.precedence                    | @letter-spacing.precedence">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				force
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@dominant-baseline">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto use-script no-change reset-size ideographic alphabetic hanging mathematical central middle text-after-edge text-before-edge inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template match="@relative-align">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> before baseline inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@suppress-at-line-break">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto suppress retain inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.13. Area dimensions  -->
-<xsl:template match="@block-progression-dimension                    | @block-progression-dimension.minimum                    | @block-progression-dimension.optimum                    | @block-progression-dimension.maximum                    | @inline-progression-dimension                    | @inline-progression-dimension.minimum                    | @inline-progression-dimension.optimum                    | @inline-progression-dimension.maximum                    | @height                    | @width">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@text-decoration">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <xsl:template match="@max-height | @max-width">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> none inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@text-shadow">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <xsl:template match="@min-height | @min-width">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@text-transform">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				capitalize uppercase lowercase none inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@content-height | @content-width">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto scale-to-fit inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@treat-as-word-space">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto false true inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@scaling">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> uniform non-uniform inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.16. Color properties -->
+	<xsl:template match="@color" />
 
-   <xsl:template match="@scaling-method">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto integer-pixels resample-any-method inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="fo:color-profile/@color-profile-name"
+		priority="5" />
 
+	<xsl:template
+		match="fo:color-profile/@rendering-intent                    | fo:declarations/@rendering-intent                    | fo:root/@rendering-intent"
+		priority="5">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto perceptual relative-colorimetric saturation
+				absolute-colorimetric inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.14. Block and line-related properties  -->
-<xsl:template match="@hyphenation-keep">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto column page inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template match="@hyphenation-ladder-count">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> no-limit inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.17. Float properties -->
+	<xsl:template match="@clear">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				start end left right both none inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@text-indent | @last-line-end-indent">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@float">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				before start end left right inside outside none inherit
+			</xsl:with-param>
+		</xsl:call-template>
 
-   <xsl:template match="@line-height">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> normal inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+		<xsl:if test="$strictness &gt; 1">
+			<xsl:if test=".='inside' or .='outside'">
+				<xsl:call-template name="print-warning">
+					<xsl:with-param name="msg">
+						Value "
+						<xsl:value-of select="." />
+						" for 'float' attribute is a RenderX extension.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:if>
+		</xsl:if>
+	</xsl:template>
 
-   <xsl:template match="@line-height.minimum                    | @line-height.optimum                    | @line-height.maximum">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@intrusion-displace">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto none line indent block inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@line-height.conditionality">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> discard retain </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.18. Keeps and breaks -->
+	<xsl:template match="@break-after | @break-before">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto column page even-page odd-page inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@line-height.precedence">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> force </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@keep-together                    | @keep-together.within-line                    | @keep-together.within-column                    | @keep-together.within-page                    | @keep-with-next                    | @keep-with-next.within-line                    | @keep-with-next.within-column                    | @keep-with-next.within-page                    | @keep-with-previous                    | @keep-with-previous.within-line                    | @keep-with-previous.within-column                    | @keep-with-previous.within-page">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto always inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@line-height-shift-adjustment">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> consider-shifts disregard-shifts inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@orphans | @widows">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@line-stacking-strategy">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> line-height font-height max-height inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template match="@linefeed-treatment">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> ignore preserve treat-as-space treat-as-zero-width-space inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.19. Layout-related properties -->
+	<xsl:template priority="3" match="@clip" />
 
-   <xsl:template match="@white-space-treatment">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> ignore preserve ignore-if-before-linefeed ignore-if-after-linefeed ignore-if-surrounding-linefeed inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="3" match="@overflow">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				visible hidden scroll error-if-overflow auto inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@text-align">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:variable name="keyword-charset"
-                    select="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
-      <xsl:variable name="token" select="normalize-space()"/>
-      <xsl:if test="string-length($token) != 0 and                 string-length(translate($token, $keyword-charset, '')) = 0">
-         <xsl:call-template name="enumerated-values">
-            <xsl:with-param name="valuelist"> start center end justify inside outside left right inherit </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-   </xsl:template>
+	<xsl:template priority="3" match="@reference-orientation">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				0 90 180 270 -90 -180 -270 inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template priority="5"
+		match="fo:simple-page-master/@reference-orientation">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				0 90 180 270 -90 -180 -270 inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@text-align-last">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> relative start center end justify inside outside left right inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@span">
+		<xsl:if test="ancestor::fo:static-content">
+			<xsl:call-template name="print-error">
+				<xsl:with-param name="msg">
+					Attribute 'span' cannot be used inside '
+					<xsl:value-of
+						select="name(ancestor::fo:static-content[1])" />
+					'.
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:if>
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				none all inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@white-space-collapse">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> false true inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.20. Leader properties -->
+	<xsl:template match="@leader-alignment">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				none reference-area page inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@wrap-option">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> no-wrap wrap inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@leader-pattern">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				space rule dots use-content inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@leader-pattern-width">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				use-font-metrics inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.15. Character properties -->
-<xsl:template match="fo:character/@character"/>
+	<xsl:template
+		match="@leader-length                    | @leader-length.minimum                    | @leader-length.optimum                    | @leader-length.maximum">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@letter-spacing.minimum                     | @letter-spacing.optimum                      | @letter-spacing.maximum                      | @letter-spacing                     | @word-spacing.minimum                     | @word-spacing.optimum                     | @word-spacing.maximum                     | @word-spacing">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> normal inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@rule-style">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				none dotted dashed solid double groove ridge inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@word-spacing.conditionality                    | @letter-spacing.conditionality">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> discard retain </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@rule-thickness">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@word-spacing.precedence                    | @letter-spacing.precedence">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> force </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.21. Dynamic effects and hyperrefs -->
+	<xsl:template match="fo:multi-property-set/@active-state">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				link visited active hover focus
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@auto-restore">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				false true
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@suppress-at-line-break">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto suppress retain inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="fo:multi-case/@case-name" />
+	<xsl:template match="fo:multi-case/@case-title" />
 
-   <xsl:template match="@text-decoration">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
+	<xsl:template
+		match="fo:basic-link/@destination-placement-offset">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <xsl:template match="@text-shadow">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
+	<xsl:template match="fo:basic-link/@external-destination">
+		<xsl:call-template name="check-url" />
+	</xsl:template>
+	<xsl:template match="rx:bookmark/@external-destination"
+		priority="5">
+		<xsl:call-template name="check-url" />
+	</xsl:template>
 
-   <xsl:template match="@text-transform">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> capitalize uppercase lowercase none inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="fo:basic-link/@internal-destination" />
+	<xsl:template match="rx:bookmark/@internal-destination"
+		priority="5" />
 
-   <xsl:template match="@treat-as-word-space">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto false true inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="rx:bookmark/@collapse-subtree"
+		priority="5">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				true false
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.16. Color properties -->
-<xsl:template match="@color"/>
+	<xsl:template match="fo:root/@rx:initial-destination" />
 
-   <xsl:template match="fo:color-profile/@color-profile-name" priority="5"/>
+	<xsl:template match="fo:basic-link/@indicate-destination">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				true false
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:color-profile/@rendering-intent                    | fo:declarations/@rendering-intent                    | fo:root/@rendering-intent"
-                 priority="5">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto perceptual relative-colorimetric saturation absolute-colorimetric inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="fo:basic-link/@show-destination">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				replace new
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	<xsl:template match="rx:bookmark/@show-destination"
+		priority="5">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				replace new
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
 
-   <!-- 7.17. Float properties -->
-<xsl:template match="@clear">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> start end left right both none inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="fo:multi-case/@starting-state">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				show hide
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@float">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> before start end left right inside outside none inherit </xsl:with-param>
-      </xsl:call-template>
+	<xsl:template match="fo:multi-toggle/@switch-to" />
+	<xsl:template
+		match="fo:basic-link/@target-presentation-context" />
+	<xsl:template
+		match="fo:basic-link/@target-processing-context" />
+	<xsl:template match="fo:basic-link/@target-stylesheet" />
 
-      <xsl:if test="$strictness &gt; 1">
-         <xsl:if test=".='inside' or .='outside'">
-            <xsl:call-template name="print-warning">
-               <xsl:with-param name="msg">Value "<xsl:value-of select="."/>" for 'float' attribute is a RenderX extension.</xsl:with-param>
-            </xsl:call-template>  
-         </xsl:if>
-      </xsl:if>
-   </xsl:template>
+	<!-- 7.22. Marker properties -->
+	<xsl:template match="fo:marker/@marker-class-name" />
+	<xsl:template
+		match="fo:retrieve-marker/@retrieve-class-name" />
 
-   <xsl:template match="@intrusion-displace">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto none line indent block inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="fo:retrieve-marker/@retrieve-position">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				first-starting-within-page first-including-carryover
+				last-starting-within-page last-ending-within-page
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.18. Keeps and breaks -->
-<xsl:template match="@break-after | @break-before">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto column page even-page odd-page inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="fo:retrieve-marker/@retrieve-boundary">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				page page-sequence document
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@keep-together                    | @keep-together.within-line                    | @keep-together.within-column                    | @keep-together.within-page                    | @keep-with-next                    | @keep-with-next.within-line                    | @keep-with-next.within-column                    | @keep-with-next.within-page                    | @keep-with-previous                    | @keep-with-previous.within-line                    | @keep-with-previous.within-column                    | @keep-with-previous.within-page">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto always inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template match="@orphans | @widows">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.23. Number format properties -->
+	<xsl:template
+		match="fo:page-sequence/@format | rx:ruler/@format" />
+	<xsl:template
+		match="fo:page-sequence/@grouping-separator | rx:ruler/@grouping-separator" />
 
+	<xsl:template
+		match="fo:page-sequence/@grouping-size | rx:ruler/@grouping-size">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <!-- 7.19. Layout-related properties -->
-<xsl:template priority="3" match="@clip"/>
+	<xsl:template
+		match="fo:page-sequence/@letter-value | rx:ruler/@letter-value">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto alphabetic traditional
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3" match="@overflow">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> visible hidden scroll error-if-overflow auto inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.24. Pagination -->
+	<xsl:template priority="5"
+		match="fo:conditional-page-master-reference/@blank-or-not-blank">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				blank not-blank any
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="3" match="@reference-orientation">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> 0 90 180 270 -90 -180 -270 inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:conditional-page-master-reference/@odd-or-even">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				even odd any
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5" match="fo:simple-page-master/@reference-orientation">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> 0 90 180 270 -90 -180 -270 inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:conditional-page-master-reference/@page-position">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				first last rest any
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@span">
-      <xsl:if test="ancestor::fo:static-content">
-         <xsl:call-template name="print-error">
-            <xsl:with-param name="msg">Attribute 'span' cannot be used inside '<xsl:value-of select="name(ancestor::fo:static-content[1])"/>'. </xsl:with-param>
-         </xsl:call-template>
-      </xsl:if>
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> none all inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:region-body/@column-count">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <!-- 7.20. Leader properties -->
-<xsl:template match="@leader-alignment">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> none reference-area page inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:region-body/@column-gap">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <xsl:template match="@leader-pattern">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> space rule dots use-content inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="rx:flow-section/@column-count">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <xsl:template match="@leader-pattern-width">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> use-font-metrics inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="rx:flow-section/@column-gap">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <xsl:template match="@leader-length                    | @leader-length.minimum                    | @leader-length.optimum                    | @leader-length.maximum">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:region-before/@extent                    | fo:region-after/@extent                    | fo:region-start/@extent                    | fo:region-end/@extent">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <xsl:template match="@rule-style">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> none dotted dashed solid double groove ridge inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="fo:flow/@flow-name | fo:static-content/@flow-name" />
 
-   <xsl:template match="@rule-thickness">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="fo:page-sequence/@force-page-count">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto even odd end-on-even end-on-odd no-force
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.21. Dynamic effects and hyperrefs -->
-<xsl:template match="fo:multi-property-set/@active-state">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> link visited active hover focus </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="fo:page-sequence/@initial-page-number">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto auto-odd auto-even
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@auto-restore">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> false true </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:simple-page-master/@master-name                    | fo:page-sequence-master/@master-name" />
 
-   <xsl:template match="fo:multi-case/@case-name"/>
-   <xsl:template match="fo:multi-case/@case-title"/>
+	<xsl:template priority="5"
+		match="fo:page-sequence/@master-reference                    | fo:single-page-master-reference/@master-reference                    | fo:repeatable-page-master-reference/@master-reference                    | fo:conditional-page-master-reference/@master-reference" />
 
-   <xsl:template match="fo:basic-link/@destination-placement-offset">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:repeatable-page-master-reference/@maximum-repeats                    | fo:repeatable-page-master-alternatives/@maximum-repeats">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				no-limit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:basic-link/@external-destination">
-      <xsl:call-template name="check-url"/>
-   </xsl:template>
-   <xsl:template match="rx:bookmark/@external-destination" priority="5">
-      <xsl:call-template name="check-url"/>
-   </xsl:template>
 
-   <xsl:template match="fo:basic-link/@internal-destination"/>
-   <xsl:template match="rx:bookmark/@internal-destination" priority="5"/>
+	<xsl:template match="fo:root/@media-usage">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto paginate bounded-in-one-dimension unbounded
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="rx:bookmark/@collapse-subtree" priority="5">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> true false </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:simple-page-master/@page-height                    | fo:simple-page-master/@page-width">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto indefinite
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:root/@rx:initial-destination"/>
+	<xsl:template priority="5"
+		match="fo:region-before/@precedence                    | fo:region-after/@precedence                    | fo:region-start/@precedence                    | fo:region-end/@precedence">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				true false
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:basic-link/@indicate-destination">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> true false </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:region-body/@region-name                    | fo:region-before/@region-name                    | fo:region-after/@region-name                    | fo:region-start/@region-name                    | fo:region-end/@region-name" />
 
-   <xsl:template match="fo:basic-link/@show-destination">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> replace new </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-   <xsl:template match="rx:bookmark/@show-destination" priority="5">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> replace new </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.25. Table properties -->
+	<xsl:template
+		match="@border-after-precedence                    | @border-before-precedence                    | @border-end-precedence                    | @border-start-precedence">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				force inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@border-collapse">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				collapse collapse-with-precedence separate inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:multi-case/@starting-state">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> show hide </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@border-separation                    | @border-separation.block-progression-direction                    | @border-separation.inline-progression-direction">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:multi-toggle/@switch-to"/>
-   <xsl:template match="fo:basic-link/@target-presentation-context"/>
-   <xsl:template match="fo:basic-link/@target-processing-context"/>
-   <xsl:template match="fo:basic-link/@target-stylesheet"/>
 
-   <!-- 7.22. Marker properties -->
-<xsl:template match="fo:marker/@marker-class-name"/>
-   <xsl:template match="fo:retrieve-marker/@retrieve-class-name"/>
+	<xsl:template match="@caption-side">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				before after start end top bottom left right inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:retrieve-marker/@retrieve-position">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> first-starting-within-page first-including-carryover last-starting-within-page last-ending-within-page </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="fo:table-column/@column-number                    | fo:table-cell/@column-number">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <xsl:template match="fo:retrieve-marker/@retrieve-boundary">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> page page-sequence document </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="fo:table-column/@column-width">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
+	<xsl:template match="@empty-cells">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				show hide inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <!-- 7.23. Number format properties -->
-<xsl:template match="fo:page-sequence/@format | rx:ruler/@format"/>
-   <xsl:template match="fo:page-sequence/@grouping-separator | rx:ruler/@grouping-separator"/>
+	<xsl:template
+		match="fo:table-cell/@ends-row                    | fo:table-cell/@starts-row">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				true false
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:page-sequence/@grouping-size | rx:ruler/@grouping-size">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template
+		match="fo:table-column/@number-columns-repeated">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <xsl:template match="fo:page-sequence/@letter-value | rx:ruler/@letter-value">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto alphabetic traditional </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="fo:table-column/@number-columns-spanned                    | fo:table-cell/@number-columns-spanned">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <!-- 7.24. Pagination -->
-<xsl:template priority="5" match="fo:conditional-page-master-reference/@blank-or-not-blank">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> blank not-blank any </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="fo:table-cell/@number-rows-spanned">
+		<xsl:call-template name="quantitative-values" />
+	</xsl:template>
 
-   <xsl:template priority="5" match="fo:conditional-page-master-reference/@odd-or-even">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> even odd any </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@table-layout">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto fixed inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5" match="fo:conditional-page-master-reference/@page-position">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> first last rest any </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="fo:table/@table-omit-footer-at-break                    | fo:table/@table-omit-header-at-break                     | fo:table/@rx:table-omit-initial-header                    | fo:table/@rx:table-omit-final-footer">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				true false
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5" match="fo:region-body/@column-count">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
 
-   <xsl:template priority="5" match="fo:region-body/@column-gap">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<!-- 7.26. Writing mode -->
+	<xsl:template match="@direction">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				ltr rtl inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="rx:flow-section/@column-count">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template match="@glyph-orientation-horizontal">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="rx:flow-section/@column-gap">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template match="@glyph-orientation-vertical">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5"
-                 match="fo:region-before/@extent                    | fo:region-after/@extent                    | fo:region-start/@extent                    | fo:region-end/@extent">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template match="@text-altitude | @text-depth">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				use-font-metrics inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:flow/@flow-name | fo:static-content/@flow-name"/>
 
-   <xsl:template match="fo:page-sequence/@force-page-count">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto even odd end-on-even end-on-odd no-force </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@unicode-bidi">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				normal embed bidi-override inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:page-sequence/@initial-page-number">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto auto-odd auto-even </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="3" match="@writing-mode">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				lr-tb rl-tb tb-rl tb-lr lr-alternating-rl-tb lr-inverting-rl-tb
+				lr-bt rl-bt bt-rl bt-lr lr-alternating-rl-bt lr-inverting-rl-bt
+				tb-lr-in-lr-pairs lr rl tb inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5"
-                 match="fo:simple-page-master/@master-name                    | fo:page-sequence-master/@master-name"/>
+	<xsl:template priority="5"
+		match="fo:simple-page-master/@writing-mode">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				lr-tb rl-tb tb-rl tb-lr lr-alternating-rl-tb lr-inverting-rl-tb
+				lr-bt rl-bt bt-rl bt-lr lr-alternating-rl-bt lr-inverting-rl-bt
+				tb-lr-in-lr-pairs lr rl tb inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5"
-                 match="fo:page-sequence/@master-reference                    | fo:single-page-master-reference/@master-reference                    | fo:repeatable-page-master-reference/@master-reference                    | fo:conditional-page-master-reference/@master-reference"/>
 
-   <xsl:template priority="5"
-                 match="fo:repeatable-page-master-reference/@maximum-repeats                    | fo:repeatable-page-master-alternatives/@maximum-repeats">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> no-limit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- 7.27. Miscellaneous properties -->
+	<xsl:template
+		match="fo:external-graphic/@content-type                    | fo:instream-foreign-object/@content-type                    | rx:background-content-type"
+		priority="3">
+		<xsl:variable name="val" select="normalize-space()" />
+		<xsl:choose>
+			<xsl:when test="$val = 'auto'" />
+			<xsl:when test="starts-with($val, 'content-type:')" />
+			<xsl:when test="starts-with($val, 'namespace:')" />
+			<xsl:otherwise>
+				<xsl:call-template name="print-warning">
+					<xsl:with-param name="msg">
+						Attribute '
+						<xsl:value-of select="name()" />
+						' cannot have a value of "
+						<xsl:value-of select="." />
+						": if not 'auto', it should be prefixed by either 'namespace:' or
+						'content-type:'.
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
 
-   <xsl:template match="fo:root/@media-usage">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto paginate bounded-in-one-dimension unbounded </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@id" />
+	<xsl:template match="fo:page-number-citation/@ref-id" />
+	<xsl:template match="rx:page-number-citation-last/@ref-id" />
+	<xsl:template match="rx:end-index-range/@ref-id" />
 
-   <xsl:template priority="5"
-                 match="fo:simple-page-master/@page-height                    | fo:simple-page-master/@page-width">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto indefinite </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@provisional-label-separation                    | @provisional-distance-between-starts">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5"
-                 match="fo:region-before/@precedence                    | fo:region-after/@precedence                    | fo:region-start/@precedence                    | fo:region-end/@precedence">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> true false </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@score-spaces">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				true false inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template priority="5"
-                 match="fo:region-body/@region-name                    | fo:region-before/@region-name                    | fo:region-after/@region-name                    | fo:region-start/@region-name                    | fo:region-end/@region-name"/>
+	<xsl:template match="fo:external-graphic/@src">
+		<xsl:call-template name="check-url" />
+	</xsl:template>
 
-   <!-- 7.25. Table properties -->
-<xsl:template match="@border-after-precedence                    | @border-before-precedence                    | @border-end-precedence                    | @border-start-precedence">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> force inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template match="@border-collapse">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> collapse collapse-with-precedence separate inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template priority="5" match="fo:color-profile/@src">
+		<xsl:call-template name="check-url" />
+	</xsl:template>
 
-   <xsl:template match="@border-separation                    | @border-separation.block-progression-direction                    | @border-separation.inline-progression-direction">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@visibility">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				visible hidden collapse inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@z-index">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@caption-side">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> before after start end top bottom left right inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template match="fo:table-column/@column-number                    | fo:table-cell/@column-number">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<!-- 7.28. Shorthands -->
+	<xsl:template priority="3" match="@background" />
+	<xsl:template priority="3" match="@background-position" />
+	<xsl:template priority="3" match="@border" />
+	<xsl:template priority="3"
+		match="@border-top                    | @border-bottom                    | @border-left                    | @border-right" />
+	<xsl:template priority="3" match="@border-color" />
+	<xsl:template priority="3" match="@border-style" />
+	<xsl:template match="@border-spacing" />
+	<xsl:template priority="3" match="@border-width" />
+	<xsl:template match="@cue" />
+	<xsl:template match="@font">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
+	<xsl:template match="@margin" />
+	<xsl:template priority="5"
+		match="fo:simple-page-master/@margin                    | fo:region-body/@margin" />
 
-   <xsl:template match="fo:table-column/@column-width">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template priority="3" match="@padding" />
 
-   <xsl:template match="@empty-cells">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> show hide inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@page-break-after | @page-break-before">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto always avoid left right inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:table-cell/@ends-row                    | fo:table-cell/@starts-row">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> true false </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@page-break-inside">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				auto avoid inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:table-column/@number-columns-repeated">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template match="@pause" />
 
-   <xsl:template match="fo:table-column/@number-columns-spanned                    | fo:table-cell/@number-columns-spanned">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template match="@position">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				static relative absolute fixed inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:table-cell/@number-rows-spanned">
-      <xsl:call-template name="quantitative-values"/>
-   </xsl:template>
+	<xsl:template priority="5"
+		match="fo:simple-page-master/@size">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto landscape portrait
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@table-layout">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto fixed inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@vertical-align">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				baseline middle sub super text-top text-bottom top bottom inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="fo:table/@table-omit-footer-at-break                    | fo:table/@table-omit-header-at-break                     | fo:table/@rx:table-omit-initial-header                    | fo:table/@rx:table-omit-final-footer">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> true false </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@white-space">
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				normal pre nowrap inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="@xml:lang">
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <!-- 7.26. Writing mode -->
-<xsl:template match="@direction">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> ltr rtl inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
 
-   <xsl:template match="@glyph-orientation-horizontal">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- RenderX extensions -->
 
-   <xsl:template match="@glyph-orientation-vertical">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="@rx:background-content-width                    | @rx:background-content-height"
+		priority="3">
+		<xsl:call-template name="quantitative-values">
+			<xsl:with-param name="valuelist">
+				auto scale-to-fit inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@text-altitude | @text-depth">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> use-font-metrics inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@rx:background-scaling" priority="3">
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				uniform non-uniform inherit
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
+	<xsl:template match="rx:meta-field/@name" priority="5" />
+	<xsl:template match="rx:meta-field/@value" priority="5" />
 
-   <xsl:template match="@unicode-bidi">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> normal embed bidi-override inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="@rx:key | rx:begin-index-range/@key" />
 
-   <xsl:template priority="3" match="@writing-mode">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> lr-tb rl-tb tb-rl tb-lr lr-alternating-rl-tb lr-inverting-rl-tb lr-bt rl-bt bt-rl bt-lr lr-alternating-rl-bt lr-inverting-rl-bt tb-lr-in-lr-pairs lr rl tb inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template match="rx:pinpoint/@value" />
 
-   <xsl:template priority="5" match="fo:simple-page-master/@writing-mode">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> lr-tb rl-tb tb-rl tb-lr lr-alternating-rl-tb lr-inverting-rl-tb lr-bt rl-bt bt-rl bt-lr lr-alternating-rl-bt lr-inverting-rl-bt tb-lr-in-lr-pairs lr rl tb inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template
+		match="rx:page-index/@ref-key | rx:index-item/@ref-key" />
 
+	<xsl:template
+		match="@rx:list-separator | rx:page-index/@list-separator">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
-   <!-- 7.27. Miscellaneous properties -->
-<xsl:template match="fo:external-graphic/@content-type                    | fo:instream-foreign-object/@content-type                    | rx:background-content-type"
-                 priority="3">
-      <xsl:variable name="val" select="normalize-space()"/>
-      <xsl:choose>
-         <xsl:when test="$val = 'auto'"/>
-         <xsl:when test="starts-with($val, 'content-type:')"/>
-         <xsl:when test="starts-with($val, 'namespace:')"/>
-         <xsl:otherwise>
-            <xsl:call-template name="print-warning">
-               <xsl:with-param name="msg">Attribute '<xsl:value-of select="name()"/>' cannot have a value of "<xsl:value-of select="."/>": if not 'auto', it should be prefixed by either 'namespace:' or 'content-type:'.</xsl:with-param>
-            </xsl:call-template>
-         </xsl:otherwise>
-      </xsl:choose>
-   </xsl:template>
+	<xsl:template
+		match="@rx:range-separator | rx:page-index/@range-separator | rx:index-item/@range-separator">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+	</xsl:template>
 
+	<xsl:template
+		match="@rx:merge-subsequent-page-numbers | rx:page-index/@merge-subsequent-page-numbers | rx:index-item/@merge-subsequent-page-numbers">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				false true
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@id"/>
-   <xsl:template match="fo:page-number-citation/@ref-id"/>
-   <xsl:template match="rx:page-number-citation-last/@ref-id"/>
-   <xsl:template match="rx:end-index-range/@ref-id"/>
+	<xsl:template
+		match="@rx:link-back | rx:page-index/@link-back | rx:index-item/@link-back">
+		<xsl:call-template name="disable-on-atomic-inlines" />
+		<xsl:call-template name="disable-on-graphics" />
+		<xsl:call-template name="enumerated-values">
+			<xsl:with-param name="valuelist">
+				false true
+			</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
 
-   <xsl:template match="@provisional-label-separation                    | @provisional-distance-between-starts">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Print an error message -->
 
-   <xsl:template match="@score-spaces">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> true false inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
+	<xsl:template name="print-error">
+		<xsl:param name="msg" />
+		<xsl:message>
+			[error]
+			<xsl:value-of select="normalize-space($msg)" />
+		</xsl:message>
+	</xsl:template>
 
-   <xsl:template match="fo:external-graphic/@src">
-      <xsl:call-template name="check-url"/>
-   </xsl:template>
+	<!-- =================================== -->
+	<!-- Print a warning message -->
 
+	<xsl:template name="print-warning">
+		<xsl:param name="msg" />
+		<xsl:message>
+			[warning]
+			<xsl:value-of select="normalize-space($msg)" />
+		</xsl:message>
+	</xsl:template>
 
-   <xsl:template priority="5" match="fo:color-profile/@src">
-      <xsl:call-template name="check-url"/>
-   </xsl:template>
-
-   <xsl:template match="@visibility">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> visible hidden collapse inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="@z-index">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-
-   <!-- 7.28. Shorthands -->
-<xsl:template priority="3" match="@background"/>
-   <xsl:template priority="3" match="@background-position"/>
-   <xsl:template priority="3" match="@border"/>
-   <xsl:template priority="3"
-                 match="@border-top                    | @border-bottom                    | @border-left                    | @border-right"/>
-   <xsl:template priority="3" match="@border-color"/>
-   <xsl:template priority="3" match="@border-style"/>
-   <xsl:template match="@border-spacing"/>
-   <xsl:template priority="3" match="@border-width"/>
-   <xsl:template match="@cue"/>
-   <xsl:template match="@font">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
-   <xsl:template match="@margin"/>
-   <xsl:template priority="5"
-                 match="fo:simple-page-master/@margin                    | fo:region-body/@margin"/>
-
-   <xsl:template priority="3" match="@padding"/>
-
-   <xsl:template match="@page-break-after | @page-break-before">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto always avoid left right inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="@page-break-inside">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> auto avoid inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="@pause"/>
-
-   <xsl:template match="@position">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> static relative absolute fixed inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template priority="5" match="fo:simple-page-master/@size">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto landscape portrait </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="@vertical-align">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> baseline middle sub super text-top text-bottom top bottom inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="@white-space">
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> normal pre nowrap inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="@xml:lang">
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
-
-
-   <!-- RenderX extensions -->
-
-<xsl:template match="@rx:background-content-width                    | @rx:background-content-height"
-                 priority="3">
-      <xsl:call-template name="quantitative-values">
-         <xsl:with-param name="valuelist"> auto scale-to-fit inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="@rx:background-scaling" priority="3">
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> uniform non-uniform inherit </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="rx:meta-field/@name" priority="5"/>
-   <xsl:template match="rx:meta-field/@value" priority="5"/>
-
-   <xsl:template match="@rx:key | rx:begin-index-range/@key"/>
-
-   <xsl:template match="rx:pinpoint/@value"/>
-
-   <xsl:template match="rx:page-index/@ref-key | rx:index-item/@ref-key"/>
-
-   <xsl:template match="@rx:list-separator | rx:page-index/@list-separator">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
-
-   <xsl:template match="@rx:range-separator | rx:page-index/@range-separator | rx:index-item/@range-separator">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-   </xsl:template>
-
-   <xsl:template match="@rx:merge-subsequent-page-numbers | rx:page-index/@merge-subsequent-page-numbers | rx:index-item/@merge-subsequent-page-numbers">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> false true </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <xsl:template match="@rx:link-back | rx:page-index/@link-back | rx:index-item/@link-back">
-      <xsl:call-template name="disable-on-atomic-inlines"/>
-      <xsl:call-template name="disable-on-graphics"/>
-      <xsl:call-template name="enumerated-values">
-         <xsl:with-param name="valuelist"> false true </xsl:with-param>
-      </xsl:call-template>
-   </xsl:template>
-
-   <!-- =================================== -->
-<!-- Print an error message              -->
-
-<xsl:template name="print-error">
-      <xsl:param name="msg"/>
-      <xsl:message>[error] <xsl:value-of select="normalize-space($msg)"/>
-      </xsl:message>
-   </xsl:template>
-
-   <!-- =================================== -->
-<!-- Print a warning message             -->
-
-<xsl:template name="print-warning">
-      <xsl:param name="msg"/>
-      <xsl:message>[warning] <xsl:value-of select="normalize-space($msg)"/>
-      </xsl:message>
-   </xsl:template>
-
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/processpb.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/processpb.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/processpb.xsl	(revision 2397)
@@ -1,164 +1,157 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns="http://www.tei-c.org/ns/1.0"
-		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		xpath-default-namespace="http://www.tei-c.org/ns/1.0"
-		version="2.0">
-<!--
-This software is dual-licensed:
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
+	<!-- This software is dual-licensed: 1. Distributed under a Creative Commons 
+		Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+		2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution 
+		and use in source and binary forms, with or without modification, are permitted 
+		provided that the following conditions are met: * Redistributions of source 
+		code must retain the above copyright notice, this list of conditions and 
+		the following disclaimer. * Redistributions in binary form must reproduce 
+		the above copyright notice, this list of conditions and the following disclaimer 
+		in the documentation and/or other materials provided with the distribution. 
+		This software is provided by the copyright holders and contributors "as is" 
+		and any express or implied warranties, including, but not limited to, the 
+		implied warranties of merchantability and fitness for a particular purpose 
+		are disclaimed. In no event shall the copyright holder or contributors be 
+		liable for any direct, indirect, incidental, special, exemplary, or consequential 
+		damages (including, but not limited to, procurement of substitute goods or 
+		services; loss of use, data, or profits; or business interruption) however 
+		caused and on any theory of liability, whether in contract, strict liability, 
+		or tort (including negligence or otherwise) arising in any way out of the 
+		use of this software, even if advised of the possibility of such damage. 
+		$Id: processpb.xsl 9646 2011-11-05 23:39:08Z rahtz $ Take an arbitrary TEI 
+		file and move page breaks (<pb>) up in the hierarchy, splitting containers 
+		as needed, until <pb>s are at the same level as <div>. Wrap the resulting 
+		pages on <page> element. -->
+	<xsl:output indent="yes" />
 
-1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
+	<xsl:template match="teiHeader">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-2. http://www.opensource.org/licenses/BSD-2-Clause
-		
-All rights reserved.
+	<xsl:template match="TEI|teiCorpus|group">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:apply-templates
+				select="*|processing-instruction()|comment()|text()" />
+		</xsl:copy>
+	</xsl:template>
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+	<xsl:template match="text|body|back|front">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:variable name="pages">
+				<xsl:apply-templates
+					select="*|processing-instruction()|comment()|text()" />
+			</xsl:variable>
+			<xsl:for-each select="$pages">
+				<xsl:apply-templates
+					select="*|processing-instruction()|comment()|text()" mode="pass2" />
+			</xsl:for-each>
+		</xsl:copy>
+	</xsl:template>
 
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
 
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
+	<!-- first (recursive) pass. look for <pb> elements and group on them -->
+	<xsl:template
+		match="comment()|@*|processing-instruction()|text()">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose are disclaimed. In no event shall the copyright
-holder or contributors be liable for any direct, indirect, incidental,
-special, exemplary, or consequential damages (including, but not
-limited to, procurement of substitute goods or services; loss of use,
-data, or profits; or business interruption) however caused and on any
-theory of liability, whether in contract, strict liability, or tort
-(including negligence or otherwise) arising in any way out of the use
-of this software, even if advised of the possibility of such damage.
+	<xsl:template match="*">
+		<xsl:call-template name="checkpb">
+			<xsl:with-param name="eName" select="local-name()" />
+		</xsl:call-template>
+	</xsl:template>
 
-     $Id: processpb.xsl 9646 2011-11-05 23:39:08Z rahtz $
+	<xsl:template match="pb">
+		<pb>
+			<xsl:copy-of select="@*" />
+		</pb>
+	</xsl:template>
 
-    Take an arbitrary TEI file and move page breaks (<pb>) up in the
-    hierarchy, splitting containers as needed, until <pb>s are at the
-    same level as <div>. Wrap the resulting pages on <page> element.
--->
-  <xsl:output indent="yes"/>
+	<xsl:template name="checkpb">
+		<xsl:param name="eName" />
+		<xsl:choose>
+			<xsl:when test="not(.//pb)">
+				<xsl:copy>
+					<xsl:apply-templates select="@*" />
+					<xsl:apply-templates
+						select="*|processing-instruction()|comment()|text()" />
+				</xsl:copy>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="pass">
+					<xsl:call-template name="groupbypb">
+						<xsl:with-param name="Name" select="$eName" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:for-each select="$pass">
+					<xsl:apply-templates />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-  <xsl:template match="teiHeader">
-    <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template name="groupbypb">
+		<xsl:param name="Name" />
+		<xsl:for-each-group select="node()"
+			group-starting-with="pb">
+			<xsl:choose>
+				<xsl:when test="self::pb">
+					<xsl:copy-of select="." />
+					<xsl:element name="{$Name}">
+						<xsl:attribute name="rend">CONTINUED</xsl:attribute>
+						<xsl:apply-templates
+							select="current-group() except ." />
+					</xsl:element>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:element name="{$Name}">
+						<xsl:for-each select="..">
+							<xsl:copy-of select="@*" />
+							<xsl:apply-templates select="current-group()" />
+						</xsl:for-each>
+					</xsl:element>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+	</xsl:template>
 
-  <xsl:template match="TEI|teiCorpus|group">
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-    </xsl:copy>
-  </xsl:template>
+	<!-- second pass. group by <pb> (now all at top level) and wrap groups in 
+		<page> -->
+	<xsl:template match="*" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="@*|*|processing-instruction()|comment()|text()" mode="pass2" />
+		</xsl:copy>
+	</xsl:template>
 
-  <xsl:template match="text|body|back|front">
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:variable name="pages">
-        <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-      </xsl:variable>
-      <xsl:for-each select="$pages">
-        <xsl:apply-templates select="*|processing-instruction()|comment()|text()" mode="pass2"/>
-      </xsl:for-each>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template match="*[pb]" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:for-each-group select="*"
+				group-starting-with="pb">
+				<xsl:choose>
+					<xsl:when test="self::pb">
+						<page xmlns="http://www.tei-c.org/ns/notTEI">
+							<xsl:copy-of select="@*" />
+							<xsl:copy-of select="current-group() except ." />
+						</page>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy-of select="current-group()" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each-group>
+		</xsl:copy>
+	</xsl:template>
 
+	<xsl:template
+		match="comment()|@*|processing-instruction()|text()" mode="pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
- <!-- first (recursive) pass. look for <pb> elements and group on them -->
-  <xsl:template match="comment()|@*|processing-instruction()|text()">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-
-  <xsl:template match="*">
-    <xsl:call-template name="checkpb">
-      <xsl:with-param name="eName" select="local-name()"/>
-    </xsl:call-template>
-  </xsl:template>
-
-  <xsl:template match="pb">
-    <pb>
-      <xsl:copy-of select="@*"/>
-    </pb>
-  </xsl:template>
-
-  <xsl:template name="checkpb">
-    <xsl:param name="eName"/>
-    <xsl:choose>
-      <xsl:when test="not(.//pb)">
-        <xsl:copy>
-          <xsl:apply-templates select="@*"/>
-          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
-        </xsl:copy>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="pass">
-          <xsl:call-template name="groupbypb">
-            <xsl:with-param name="Name" select="$eName"/>
-          </xsl:call-template>
-        </xsl:variable>
-        <xsl:for-each select="$pass">
-          <xsl:apply-templates/>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template name="groupbypb">
-    <xsl:param name="Name"/>
-    <xsl:for-each-group select="node()" group-starting-with="pb">
-      <xsl:choose>
-        <xsl:when test="self::pb">
-          <xsl:copy-of select="."/>
-          <xsl:element name="{$Name}">
-	    <xsl:attribute name="rend">CONTINUED</xsl:attribute>
-            <xsl:apply-templates select="current-group() except ."/>
-          </xsl:element>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:element name="{$Name}">
-            <xsl:for-each select="..">
-              <xsl:copy-of select="@*"/>
-              <xsl:apply-templates select="current-group()"/>
-            </xsl:for-each>
-          </xsl:element>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each-group>
-  </xsl:template>
-
-  <!-- second pass. group by <pb> (now all at top level) and wrap groups
-       in <page> -->
-  <xsl:template match="*" mode="pass2">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|*|processing-instruction()|comment()|text()" mode="pass2"/>
-    </xsl:copy>
-  </xsl:template>
-
-  <xsl:template match="*[pb]" mode="pass2">
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:for-each-group select="*" group-starting-with="pb">
-        <xsl:choose>
-          <xsl:when test="self::pb">
-            <page xmlns="http://www.tei-c.org/ns/notTEI"> 
-              <xsl:copy-of select="@*"/>
-              <xsl:copy-of select="current-group() except ."/>
-            </page>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:copy-of select="current-group()"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each-group>
-    </xsl:copy>
-  </xsl:template>
-
-  <xsl:template match="comment()|@*|processing-instruction()|text()" mode="pass2">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/getfiles.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/getfiles.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/tools/getfiles.xsl	(revision 2397)
@@ -1,104 +1,128 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:n="www.example.com" xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version="2.0"
-                exclude-result-prefixes="n tei xs">
+<xsl:stylesheet xmlns:n="www.example.com"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	exclude-result-prefixes="n tei xs">
 
-  <xsl:param name="debug">false</xsl:param>
-  <xsl:param name="corpus"/>
-  <xsl:param name="suffix">xml</xsl:param>
-  <xsl:param name="corpusList"/>
-  <xsl:param name="processP4">false</xsl:param>
-  <xsl:param name="processP5">true</xsl:param>
-  <xsl:param name="verbose">false</xsl:param>
-  <xsl:key name="All" match="*" use="1"/>
-  <xsl:key name="AllTEI" match="tei:*" use="1"/>
-  <xsl:key name="E" match="*" use="local-name()"/>
+	<xsl:param name="debug">
+		false
+	</xsl:param>
+	<xsl:param name="corpus" />
+	<xsl:param name="suffix">
+		xml
+	</xsl:param>
+	<xsl:param name="corpusList" />
+	<xsl:param name="processP4">
+		false
+	</xsl:param>
+	<xsl:param name="processP5">
+		true
+	</xsl:param>
+	<xsl:param name="verbose">
+		false
+	</xsl:param>
+	<xsl:key name="All" match="*" use="1" />
+	<xsl:key name="AllTEI" match="tei:*" use="1" />
+	<xsl:key name="E" match="*" use="local-name()" />
 
-  <xsl:template name="main">
-      <xsl:variable name="pathlist">
-         <xsl:choose>
-	   <xsl:when test="$corpusList=''">
-	     <xsl:value-of select="concat($corpus,'?select=*.',$suffix,';recurse=yes;on-error=warning')"/>
-	   </xsl:when>
-	   <xsl:otherwise>
-	     <xsl:value-of select="$corpusList"/>
-	   </xsl:otherwise>
-         </xsl:choose>
-      </xsl:variable>
-      <xsl:if test="$debug='true'">
-	<xsl:message>Process <xsl:value-of select="$pathlist"/></xsl:message>
-      </xsl:if>
-      <xsl:variable name="docs" select="collection($pathlist)"/> 
-      <xsl:variable name="all">
-         <n:ROOT>
-	   <xsl:if test="$processP4='true'">
-	     <xsl:for-each select="$docs/TEI.2">
-	       <xsl:if test="$verbose='true'">
-		 <xsl:message>processing <xsl:value-of select="base-uri(.)"/>
-		 </xsl:message>
-	       </xsl:if>
-	       <TEI.2 xn="{base-uri(.)}">
-		 <xsl:apply-templates select="*|@*" mode="copy"/>
-	       </TEI.2>
-	     </xsl:for-each>
-	   </xsl:if>
-	   <xsl:if test="$processP5='true'">
-	     <xsl:for-each select="$docs/tei:*">
-	       <xsl:if test="$verbose='true'">
-		 <xsl:message>processing <xsl:value-of select="base-uri(.)"/>
-		 </xsl:message>
-	       </xsl:if>
-	       <tei:TEI xn="{base-uri(.)}">
-		 <xsl:apply-templates select="*|@*" mode="copy"/>
-	       </tei:TEI>
-	     </xsl:for-each>
-	     <xsl:for-each select="$docs/tei:teiCorpus">
-	       <xsl:if test="$verbose='true'">
-		 <xsl:message>processing <xsl:value-of select="base-uri(.)"/>
-		 </xsl:message>
-	       </xsl:if>
-	       <tei:teiCorpus xn="{base-uri(.)}">
-		 <xsl:copy-of select="@*|*"/>
-	       </tei:teiCorpus>
-	     </xsl:for-each>
-	   </xsl:if>
-         </n:ROOT>
-      </xsl:variable>
-      <xsl:for-each select="$all/*">
-	<xsl:call-template name="processAll"/>
-      </xsl:for-each>
-  </xsl:template>
+	<xsl:template name="main">
+		<xsl:variable name="pathlist">
+			<xsl:choose>
+				<xsl:when test="$corpusList=''">
+					<xsl:value-of
+						select="concat($corpus,'?select=*.',$suffix,';recurse=yes;on-error=warning')" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$corpusList" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:if test="$debug='true'">
+			<xsl:message>
+				Process
+				<xsl:value-of select="$pathlist" />
+			</xsl:message>
+		</xsl:if>
+		<xsl:variable name="docs" select="collection($pathlist)" />
+		<xsl:variable name="all">
+			<n:ROOT>
+				<xsl:if test="$processP4='true'">
+					<xsl:for-each select="$docs/TEI.2">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								processing
+								<xsl:value-of select="base-uri(.)" />
+							</xsl:message>
+						</xsl:if>
+						<TEI.2 xn="{base-uri(.)}">
+							<xsl:apply-templates select="*|@*"
+								mode="copy" />
+						</TEI.2>
+					</xsl:for-each>
+				</xsl:if>
+				<xsl:if test="$processP5='true'">
+					<xsl:for-each select="$docs/tei:*">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								processing
+								<xsl:value-of select="base-uri(.)" />
+							</xsl:message>
+						</xsl:if>
+						<tei:TEI xn="{base-uri(.)}">
+							<xsl:apply-templates select="*|@*"
+								mode="copy" />
+						</tei:TEI>
+					</xsl:for-each>
+					<xsl:for-each select="$docs/tei:teiCorpus">
+						<xsl:if test="$verbose='true'">
+							<xsl:message>
+								processing
+								<xsl:value-of select="base-uri(.)" />
+							</xsl:message>
+						</xsl:if>
+						<tei:teiCorpus xn="{base-uri(.)}">
+							<xsl:copy-of select="@*|*" />
+						</tei:teiCorpus>
+					</xsl:for-each>
+				</xsl:if>
+			</n:ROOT>
+		</xsl:variable>
+		<xsl:for-each select="$all/*">
+			<xsl:call-template name="processAll" />
+		</xsl:for-each>
+	</xsl:template>
 
-  <xsl:template name="processAll">
-      <html>
-         <body>
-	   <table border="1">
-	     <xsl:for-each-group select="key('All',1)" group-by="local-name()">
-	       <xsl:sort select="current-grouping-key()"/>
-	       <tr style="vertical-align:top;">
-		 <td> 
-		   <xsl:value-of select="current-grouping-key()"/>
-		 </td> 
-		 <td> 
-		   <xsl:value-of select="count(current-group())"/>
-		 </td> 
-	       </tr>
-	     </xsl:for-each-group>
-	   </table>
-         </body>
-      </html>
-  </xsl:template>
+	<xsl:template name="processAll">
+		<html>
+			<body>
+				<table border="1">
+					<xsl:for-each-group select="key('All',1)"
+						group-by="local-name()">
+						<xsl:sort select="current-grouping-key()" />
+						<tr style="vertical-align:top;">
+							<td>
+								<xsl:value-of select="current-grouping-key()" />
+							</td>
+							<td>
+								<xsl:value-of select="count(current-group())" />
+							</td>
+						</tr>
+					</xsl:for-each-group>
+				</table>
+			</body>
+		</html>
+	</xsl:template>
 
-  <xsl:template match="text()|@*" mode="copy">
-      <xsl:copy-of select="."/>
-  </xsl:template>
+	<xsl:template match="text()|@*" mode="copy">
+		<xsl:copy-of select="." />
+	</xsl:template>
 
-  <xsl:template match="*" mode="copy">
-      <xsl:copy>
-         <xsl:apply-templates select="*|@*|text()" mode="copy"/>
-      </xsl:copy>
-  </xsl:template>
-  
+	<xsl:template match="*" mode="copy">
+		<xsl:copy>
+			<xsl:apply-templates select="*|@*|text()"
+				mode="copy" />
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/xml/xsl/tei/html/build-to.xml
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/tei/html/build-to.xml	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/tei/html/build-to.xml	(revision 2397)
@@ -1,79 +1,77 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project basedir="." default="dist" name="teitohtml">
-<!--
-	This library is free software; you can redistribute it and/or
-	modify it under the terms of the GNU Lesser General Public
-	License as published by the Free Software Foundation; either
-	version 2.1 of the License, or (at your option) any later version.
-	
-	This library is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-	Lesser General Public License for more details.
-	
-	You should have received a copy of the GNU Lesser General Public
-	License along with this library; if not, write to the Free Software
-	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-	
-        Id: $Id: build-to.xml 9875 2011-12-04 18:27:43Z rahtz $
-        Copyright: 2011, TEI Consortium<
--->
-  <!--
- Convert TEI documents into HTML files.
- -->
-  <!-- Path to TEI XML file. -->
-  <property name="inputFile" value=""/>
-  <!-- Path where the output ePUB file will be saved. -->
-  <property name="outputFile" value=""/>
-  <!-- which profile -->
-  <property name="profile" value="default"/>
-  <!-- where does oxygen keep stuff -->
-  <property name="oxygenlib" value=""/>
-  <!-- Stylesheet for transformation -->
-  <property name="stylesheetFile"  value="../profiles/${profile}/html/to.xsl"/>
-  <dirname property="inputFileDir" file="${inputFile}"/>
-  <dirname property="outputDir" file="${outputFile}"/>
-  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
-  <path id="classpath">
-    <pathelement path="${java.class.path}"/>
-  </path>
-  <import file="../odds2/build-to.xml"/>
-  <target name="setup">
-    <delete dir="${outputTempDir}"/>
-    <mkdir dir="${outputTempDir}"/>
-  </target>
- 
-  <target name="transform">
-    <echo level="info">XSLT generate HTML files</echo>
-    <xslt force="yes" style="${stylesheetFile}" in="${outputTempDir}/tmp2.xml" out="${outputFile}" classpath="classpath">
-      <xmlcatalog>
-        <catalogpath>
-          <pathelement location="../../../../catalog.xml"/>
-          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
-        </catalogpath>
-      </xmlcatalog>
-      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
-      <classpath location="${oxygenlib}/saxon9ee.jar"/>
-      <param name="directory" expression="file:///${outputTempDir}"/>
-      <param name="inputDir" expression="${inputFileDir}/"/>
-      <param name="cssFile" expression="${cssFile}" if="cssFile"/>
-      <!-- name of media overlay file -->
-      <param name="mediaoverlay" expression="${mediaoverlay}" if="mediaoverlay"/>
-      <!-- file per page -->
-      <param name="filePerPage" expression="${filePerPage}" if="filePerPage"/>
-      <!-- supply name of language-->
-      <param name="lang" expression="${lang}" if="lang"/>
-      <!-- emit some diagnostics"-->
-      <param name="debug" expression="${debug}" if="debug"/>
-      <!-- be verbose-->
-      <param name="verbose" expression="${verbose}" if="verbose"/>
-    </xslt>
-  </target>
+	<!-- This library is free software; you can redistribute it and/or modify 
+		it under the terms of the GNU Lesser General Public License as published 
+		by the Free Software Foundation; either version 2.1 of the License, or (at 
+		your option) any later version. This library is distributed in the hope that 
+		it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
+		General Public License for more details. You should have received a copy 
+		of the GNU Lesser General Public License along with this library; if not, 
+		write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
+		Boston, MA 02111-1307 USA Id: $Id: build-to.xml 9875 2011-12-04 18:27:43Z 
+		rahtz $ Copyright: 2011, TEI Consortium< -->
+	<!-- Convert TEI documents into HTML files. -->
+	<!-- Path to TEI XML file. -->
+	<property name="inputFile" value="" />
+	<!-- Path where the output ePUB file will be saved. -->
+	<property name="outputFile" value="" />
+	<!-- which profile -->
+	<property name="profile" value="default" />
+	<!-- where does oxygen keep stuff -->
+	<property name="oxygenlib" value="" />
+	<!-- Stylesheet for transformation -->
+	<property name="stylesheetFile"
+		value="../profiles/${profile}/html/to.xsl" />
+	<dirname property="inputFileDir" file="${inputFile}" />
+	<dirname property="outputDir" file="${outputFile}" />
+	<property name="outputTempDir"
+		value="${outputDir}/temp-dir-for-ant" />
+	<path id="classpath">
+		<pathelement path="${java.class.path}" />
+	</path>
+	<import file="../odds2/build-to.xml" />
+	<target name="setup">
+		<delete dir="${outputTempDir}" />
+		<mkdir dir="${outputTempDir}" />
+	</target>
 
- <target name="dist" depends="setup,odd,notodd,transform,cleanup"/>
+	<target name="transform">
+		<echo level="info">XSLT generate HTML files</echo>
+		<xslt force="yes" style="${stylesheetFile}"
+			in="${outputTempDir}/tmp2.xml" out="${outputFile}"
+			classpath="classpath">
+			<xmlcatalog>
+				<catalogpath>
+					<pathelement location="../../../../catalog.xml" />
+					<pathelement
+						location="../../../../../xhtml11/dtd/xhtmlcatalog.xml" />
+				</catalogpath>
+			</xmlcatalog>
+			<factory name="net.sf.saxon.TransformerFactoryImpl" />
+			<classpath location="${oxygenlib}/saxon9ee.jar" />
+			<param name="directory" expression="file:///${outputTempDir}" />
+			<param name="inputDir" expression="${inputFileDir}/" />
+			<param name="cssFile" expression="${cssFile}" if="cssFile" />
+			<!-- name of media overlay file -->
+			<param name="mediaoverlay" expression="${mediaoverlay}"
+				if="mediaoverlay" />
+			<!-- file per page -->
+			<param name="filePerPage" expression="${filePerPage}"
+				if="filePerPage" />
+			<!-- supply name of language -->
+			<param name="lang" expression="${lang}" if="lang" />
+			<!-- emit some diagnostics" -->
+			<param name="debug" expression="${debug}" if="debug" />
+			<!-- be verbose -->
+			<param name="verbose" expression="${verbose}" if="verbose" />
+		</xslt>
+	</target>
 
-  <target name="cleanup" unless="debug">  
-    <delete dir="${outputTempDir}"/>
-  </target>
+	<target name="dist" depends="setup,odd,notodd,transform,cleanup" />
 
+	<target name="cleanup" unless="debug">
+		<delete dir="${outputTempDir}" />
+	</target>
+
 </project>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/2-default-pager.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/2-default-pager.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/2-default-pager.xsl	(revision 2397)
@@ -1,257 +1,281 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet exclude-result-prefixes="#all"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:xs="http://www.w3.org/2001/XMLSchema"
-  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-  version="2.0">
-    
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc" version="2.0">
 
-  <xd:doc type="stylesheet">
-    <xd:short>
-      This stylesheet is designed for TXM XTZ import module to create 
-      HTML editions of corpus texts. This stylesheet should be used at 
-      "4-edition" step and must be accompanied by 1-default-html.xsl. 
-      See TXM User Manual for more details 
-      (http://textometrie.ens-lyon.fr/spip.php?rubrique64)
-    </xd:short>
-    <xd:detail>
-      This software is dual-licensed:
-      
-      1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
-      Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
-      
-      2. http://www.opensource.org/licenses/BSD-2-Clause
-      
-      All rights reserved.
-      
-      Redistribution and use in source and binary forms, with or without
-      modification, are permitted provided that the following conditions are
-      met:
-      
-      * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-      
-      * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-      
-      This software is provided by the copyright holders and contributors
-      "as is" and any express or implied warranties, including, but not
-      limited to, the implied warranties of merchantability and fitness for
-      a particular purpose are disclaimed. In no event shall the copyright
-      holder or contributors be liable for any direct, indirect, incidental,
-      special, exemplary, or consequential damages (including, but not
-      limited to, procurement of substitute goods or services; loss of use,
-      data, or profits; or business interruption) however caused and on any
-      theory of liability, whether in contract, strict liability, or tort
-      (including negligence or otherwise) arising in any way out of the use
-      of this software, even if advised of the possibility of such damage.
-      
-      $Id$
-      
-      This stylesheet is based on TEI processpb.xsl by Sebastian Rahtz 
-      available at 
-      https://github.com/TEIC/Stylesheets/blob/master/tools/processpb.xsl 
-      
-      and is adapted by Alexei Lavrentiev to split an HTML edition for 
-      TXM platform.
-    </xd:detail>
-    <xd:author>Sebastian Rahtz and Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
-    <xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
-  </xd:doc>
 
-  <!--
+	<xd:doc type="stylesheet">
+		<xd:short>
+			This stylesheet is designed for TXM XTZ import module to create
+			HTML editions of corpus texts. This stylesheet should be used at
+			"4-edition" step and must be accompanied by 1-default-html.xsl.
+			See TXM User Manual for more details
+			(http://textometrie.ens-lyon.fr/spip.php?rubrique64)
+		</xd:short>
+		<xd:detail>
+			This software is dual-licensed:
 
-  -->
-  <xsl:output indent="no" method="html"/>
-  
-  <xsl:param name="css-name-txm">txm</xsl:param>
-  <xsl:param name="css-name"><xsl:value-of select="$current-corpus-name"/></xsl:param>
-  <xsl:param name="edition-name">default</xsl:param>
-  <xsl:param name="number-words-per-page">999999</xsl:param>
-  <xsl:param name="pagination-element">a[@class='txm-page']</xsl:param>
-  <xsl:param name="output-directory"><xsl:value-of select="concat($current-file-directory,'/',$edition-name)"/></xsl:param>
-  
-  <xsl:variable name="current-file-name">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
-  
-  <xsl:variable name="current-file-directory">
-    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(1)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
-  
-  <xsl:variable name="current-corpus-name">
-    <xsl:analyze-string select="$current-file-directory" regex="^(.*)/([^/]+)/[^/]+$">
-      <xsl:matching-substring>
-        <xsl:value-of select="regex-group(2)"/>
-      </xsl:matching-substring>
-    </xsl:analyze-string>
-  </xsl:variable>
-  
-  
-  <xsl:template match="html/body">
-    <xsl:variable name="pages">
-      <xsl:copy>
-        <xsl:apply-templates select="@*"/>
-        <xsl:apply-templates
-          select="*|processing-instruction()|comment()|text()"/>
-      </xsl:copy>
-    </xsl:variable>
-    <xsl:for-each select="$pages">
-      <xsl:apply-templates  mode="pass2"/>
-    </xsl:for-each>
-    <!-- creating title page with metadata -->
-  </xsl:template>
-  
-  
-  <!-- first (recursive) pass. look for <pb> elements and group on them -->
-  <xsl:template match="comment()|@*|processing-instruction()|text()">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  <xsl:template match="*">
-    <xsl:call-template name="checkpb">
-      <xsl:with-param name="eName" select="local-name()"/>
-    </xsl:call-template>
-  </xsl:template>
-  
-  <xsl:template match="a[@class='txm-page']">
-    
-    <!--    <xsl:variable name="next-word-position" as="xs:integer">
-      <xsl:choose>
-        <xsl:when test="following::span[@class='w']">
-          <xsl:value-of select="count(following::span[@class='w'][1]/preceding::span[@class='w'])"/>
-        </xsl:when>
-        <xsl:otherwise>20</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <xsl:variable name="next-pb-position" as="xs:integer">
-      <xsl:choose>
-        <xsl:when test="following::a[@class='txm-page']">
-          <xsl:value-of select="count(following::a[@class='txm-page'][1]/preceding::span[@class='w'])"/>
-        </xsl:when>
-        <xsl:otherwise>999999999</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    <!-\-<xsl:value-of select="count(following::a[@class='txm-page'][1]/preceding::a[@class='w'])"/>-\->
-    <xsl:variable name="next-word-id">
-      <xsl:choose>
-        <xsl:when test="$next-pb-position - $next-word-position = 999999999"><!-\-w_0-\-><xsl:value-of select="concat($next-pb-position,' - ',$next-word-position)"/></xsl:when>
-        <xsl:when test="$next-pb-position &gt; $next-word-position"><xsl:value-of select="following::*:span[@class='w'][1]/@id"/></xsl:when>
-        <xsl:otherwise><!-\- w_0 -\-><xsl:value-of select="concat($next-pb-position,' - ',$next-word-position)"/></xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>-->
-    
-    
-    <!--  <a xmlns="http://www.w3.org/1999/xhtml">  -->
-    
-    <a>
-      <xsl:copy-of select="@*"/>
-      <!--<xsl:attribute name="next-word-id"><xsl:value-of select="$next-word-id"/></xsl:attribute>-->
-    </a>
-  </xsl:template>
-  
-  <xsl:template name="checkpb">
-    <xsl:param name="eName"/>
-    <xsl:choose>
-      <xsl:when test="not(.//a[@class='txm-page'])">
-        <xsl:copy-of select="."/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="pass">
-          <xsl:call-template name="groupbypb">
-            <xsl:with-param name="Name" select="$eName"/>
-          </xsl:call-template>
-        </xsl:variable>
-        <xsl:for-each select="$pass">
-          <xsl:apply-templates/>
-        </xsl:for-each>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template name="groupbypb">
-    <xsl:param name="Name"/>
-    <xsl:for-each-group select="node()" group-starting-with="a[@class='txm-page']">
-      <xsl:choose>
-        <xsl:when test="self::a[@class='txm-page']">
-          <xsl:copy-of select="."/>
-          <xsl:element name="{$Name}">
-            <xsl:attribute name="rend">CONTINUED</xsl:attribute>
-            <xsl:apply-templates select="current-group() except ."/>
-          </xsl:element>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:element name="{$Name}">
-            <xsl:for-each select="..">
-              <xsl:copy-of select="@*"/>
-              <xsl:apply-templates select="current-group()"/>
-            </xsl:for-each>
-          </xsl:element>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:for-each-group>
-  </xsl:template>
-  
-  <!-- second pass. group by <pb> (now all at top level) and wrap groups
-       in <page> -->
-  <xsl:template match="*" mode="pass2">
-    <xsl:copy>
-      <xsl:apply-templates select="@*|*|processing-instruction()|comment()|text()" mode="pass2"/>
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="comment()|@*|processing-instruction()|text()" mode="pass2">
-    <xsl:copy-of select="."/>
-  </xsl:template>
-  
-  
-  
-  <!--	<xsl:variable name="style">
-	  <xsl:copy-of select="/html/head[1]/style[1]"></xsl:copy-of>
-	</xsl:variable>-->
-  
-  <xsl:template match="*[a[@class='txm-page']]" mode="pass2" >    
-    
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:for-each-group select="*" group-starting-with="a[@class='txm-page']">
-        <xsl:choose>
-          <xsl:when test="self::a[@class='txm-page']">
-            <xsl:comment> Page <xsl:value-of select="@title"/> déplacée vers <xsl:value-of select="concat($output-directory,'/',$current-file-name,'_',@title,'.html')"/></xsl:comment>
-            <xsl:result-document href="{$output-directory}/{$current-file-name}_{@title}.html/">
-              <html>
-                <head>
-                  <meta name="txm:first-word-id" content="{@next-word-id}"/>
-                  <title><xsl:value-of select="concat($current-file-name,', Page ',@title)"/></title>
-                  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-                  <link rel="stylesheet" media="all" type="text/css" href="css/{$css-name-txm}.css"/>
-                  <xsl:if test="matches($css-name,'\S')"><link rel="stylesheet" media="all" type="text/css" href="css/{$css-name}.css"/></xsl:if>
-                  <!--<xsl:copy-of select="$style"/>-->
-                </head>
-                <body>
-                  <div class="txmeditionpage">
-                    <xsl:copy-of select="current-group() except ."/>
-                  </div>
-                </body>
-              </html>
-            </xsl:result-document>
-            
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:copy-of select="current-group()"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:for-each-group>
-    </xsl:copy>
-  </xsl:template>
-  
+			1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
+			Unported License http://creativecommons.org/licenses/by-sa/3.0/
+
+			2. http://www.opensource.org/licenses/BSD-2-Clause
+
+			All rights reserved.
+
+			Redistribution and use in source and binary forms, with or without
+			modification, are permitted provided that the following conditions are
+			met:
+
+			* Redistributions of source code must retain the above copyright
+			notice, this list of conditions and the following disclaimer.
+
+			* Redistributions in binary form must reproduce the above copyright
+			notice, this list of conditions and the following disclaimer in the
+			documentation and/or other materials provided with the distribution.
+
+			This software is provided by the copyright holders and contributors
+			"as is" and any express or implied warranties, including, but not
+			limited to, the implied warranties of merchantability and fitness for
+			a particular purpose are disclaimed. In no event shall the copyright
+			holder or contributors be liable for any direct, indirect,
+			incidental,
+			special, exemplary, or consequential damages (including, but not
+			limited to, procurement of substitute goods or services; loss of use,
+			data, or profits; or business interruption) however caused and on any
+			theory of liability, whether in contract, strict liability, or tort
+			(including negligence or otherwise) arising in any way out of the use
+			of this software, even if advised of the possibility of such damage.
+
+			$Id$
+
+			This stylesheet is based on TEI processpb.xsl by Sebastian Rahtz
+			available at
+			https://github.com/TEIC/Stylesheets/blob/master/tools/processpb.xsl
+
+			and is adapted by Alexei Lavrentiev to split an HTML edition for
+			TXM platform.
+		</xd:detail>
+		<xd:author>Sebastian Rahtz and Alexei Lavrentiev
+			alexei.lavrentev@ens-lyon.fr</xd:author>
+		<xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
+	</xd:doc>
+
+	<!-- -->
+	<xsl:output indent="no" method="html" />
+
+	<xsl:param name="css-name-txm">
+		txm
+	</xsl:param>
+	<xsl:param name="css-name">
+		<xsl:value-of select="$current-corpus-name" />
+	</xsl:param>
+	<xsl:param name="edition-name">
+		default
+	</xsl:param>
+	<xsl:param name="number-words-per-page">
+		999999
+	</xsl:param>
+	<xsl:param name="pagination-element">
+		a[@class='txm-page']
+	</xsl:param>
+	<xsl:param name="output-directory">
+		<xsl:value-of
+			select="concat($current-file-directory,'/',$edition-name)" />
+	</xsl:param>
+
+	<xsl:variable name="current-file-name">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+	<xsl:variable name="current-file-directory">
+		<xsl:analyze-string select="document-uri(.)"
+			regex="^(.*)/([^/]+)\.[^/]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(1)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+	<xsl:variable name="current-corpus-name">
+		<xsl:analyze-string
+			select="$current-file-directory" regex="^(.*)/([^/]+)/[^/]+$">
+			<xsl:matching-substring>
+				<xsl:value-of select="regex-group(2)" />
+			</xsl:matching-substring>
+		</xsl:analyze-string>
+	</xsl:variable>
+
+
+	<xsl:template match="html/body">
+		<xsl:variable name="pages">
+			<xsl:copy>
+				<xsl:apply-templates select="@*" />
+				<xsl:apply-templates
+					select="*|processing-instruction()|comment()|text()" />
+			</xsl:copy>
+		</xsl:variable>
+		<xsl:for-each select="$pages">
+			<xsl:apply-templates mode="pass2" />
+		</xsl:for-each>
+		<!-- creating title page with metadata -->
+	</xsl:template>
+
+
+	<!-- first (recursive) pass. look for <pb> elements and group on them -->
+	<xsl:template
+		match="comment()|@*|processing-instruction()|text()">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+	<xsl:template match="*">
+		<xsl:call-template name="checkpb">
+			<xsl:with-param name="eName" select="local-name()" />
+		</xsl:call-template>
+	</xsl:template>
+
+	<xsl:template match="a[@class='txm-page']">
+
+		<!-- <xsl:variable name="next-word-position" as="xs:integer"> <xsl:choose> 
+			<xsl:when test="following::span[@class='w']"> <xsl:value-of select="count(following::span[@class='w'][1]/preceding::span[@class='w'])"/> 
+			</xsl:when> <xsl:otherwise>20</xsl:otherwise> </xsl:choose> </xsl:variable> 
+			<xsl:variable name="next-pb-position" as="xs:integer"> <xsl:choose> <xsl:when 
+			test="following::a[@class='txm-page']"> <xsl:value-of select="count(following::a[@class='txm-page'][1]/preceding::span[@class='w'])"/> 
+			</xsl:when> <xsl:otherwise>999999999</xsl:otherwise> </xsl:choose> </xsl:variable> 
+			<!-\-<xsl:value-of select="count(following::a[@class='txm-page'][1]/preceding::a[@class='w'])"/>-\-> 
+			<xsl:variable name="next-word-id"> <xsl:choose> <xsl:when test="$next-pb-position 
+			- $next-word-position = 999999999"><!-\-w_0-\-><xsl:value-of select="concat($next-pb-position,' 
+			- ',$next-word-position)"/></xsl:when> <xsl:when test="$next-pb-position 
+			&gt; $next-word-position"><xsl:value-of select="following::*:span[@class='w'][1]/@id"/></xsl:when> 
+			<xsl:otherwise><!-\- w_0 -\-><xsl:value-of select="concat($next-pb-position,' 
+			- ',$next-word-position)"/></xsl:otherwise> </xsl:choose> </xsl:variable> -->
+
+
+		<!-- <a xmlns="http://www.w3.org/1999/xhtml"> -->
+
+		<a>
+			<xsl:copy-of select="@*" />
+			<!--<xsl:attribute name="next-word-id"><xsl:value-of select="$next-word-id"/></xsl:attribute> -->
+		</a>
+	</xsl:template>
+
+	<xsl:template name="checkpb">
+		<xsl:param name="eName" />
+		<xsl:choose>
+			<xsl:when test="not(.//a[@class='txm-page'])">
+				<xsl:copy-of select="." />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="pass">
+					<xsl:call-template name="groupbypb">
+						<xsl:with-param name="Name" select="$eName" />
+					</xsl:call-template>
+				</xsl:variable>
+				<xsl:for-each select="$pass">
+					<xsl:apply-templates />
+				</xsl:for-each>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="groupbypb">
+		<xsl:param name="Name" />
+		<xsl:for-each-group select="node()"
+			group-starting-with="a[@class='txm-page']">
+			<xsl:choose>
+				<xsl:when test="self::a[@class='txm-page']">
+					<xsl:copy-of select="." />
+					<xsl:element name="{$Name}">
+						<xsl:attribute name="rend">CONTINUED</xsl:attribute>
+						<xsl:apply-templates
+							select="current-group() except ." />
+					</xsl:element>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:element name="{$Name}">
+						<xsl:for-each select="..">
+							<xsl:copy-of select="@*" />
+							<xsl:apply-templates select="current-group()" />
+						</xsl:for-each>
+					</xsl:element>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each-group>
+	</xsl:template>
+
+	<!-- second pass. group by <pb> (now all at top level) and wrap groups in 
+		<page> -->
+	<xsl:template match="*" mode="pass2">
+		<xsl:copy>
+			<xsl:apply-templates
+				select="@*|*|processing-instruction()|comment()|text()" mode="pass2" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template
+		match="comment()|@*|processing-instruction()|text()" mode="pass2">
+		<xsl:copy-of select="." />
+	</xsl:template>
+
+
+
+	<!-- <xsl:variable name="style"> <xsl:copy-of select="/html/head[1]/style[1]"></xsl:copy-of> 
+		</xsl:variable> -->
+
+	<xsl:template match="*[a[@class='txm-page']]" mode="pass2">
+
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:for-each-group select="*"
+				group-starting-with="a[@class='txm-page']">
+				<xsl:choose>
+					<xsl:when test="self::a[@class='txm-page']">
+						<xsl:comment>
+							Page
+							<xsl:value-of select="@title" />
+							déplacée vers
+							<xsl:value-of
+								select="concat($output-directory,'/',$current-file-name,'_',@title,'.html')" />
+						</xsl:comment>
+						<xsl:result-document
+							href="{$output-directory}/{$current-file-name}_{@title}.html/">
+							<html>
+								<head>
+									<meta name="txm:first-word-id" content="{@next-word-id}" />
+									<title>
+										<xsl:value-of
+											select="concat($current-file-name,', Page ',@title)" />
+									</title>
+									<meta http-equiv="Content-Type"
+										content="text/html;charset=UTF-8" />
+									<link rel="stylesheet" media="all" type="text/css"
+										href="css/{$css-name-txm}.css" />
+									<xsl:if test="matches($css-name,'\S')">
+										<link rel="stylesheet" media="all" type="text/css"
+											href="css/{$css-name}.css" />
+									</xsl:if>
+									<!--<xsl:copy-of select="$style"/> -->
+								</head>
+								<body>
+									<div class="txmeditionpage">
+										<xsl:copy-of select="current-group() except ." />
+									</div>
+								</body>
+							</html>
+						</xsl:result-document>
+
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:copy-of select="current-group()" />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:for-each-group>
+		</xsl:copy>
+	</xsl:template>
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/xml/xsl/ts2xmlw.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/ts2xmlw.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/ts2xmlw.xsl	(revision 2397)
@@ -1,85 +1,84 @@
 <?xml version="1.0"?>
 <xsl:stylesheet version="1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:tei="http://www.tei-c.org/ns/1.0"
-                xmlns:xd="http://www.pnp-software.com/XSLTdoc"
-                xmlns:edate="http://exslt.org/dates-and-times"
-                exclude-result-prefixes="edate xd">
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+	xmlns:edate="http://exslt.org/dates-and-times"
+	exclude-result-prefixes="edate xd">
 
-  <xd:doc type="stylesheet">
+	<xd:doc type="stylesheet">
 
-    <xd:short>
-      Feuille de transformation du format TIGER-XML vers le format XML-TXM
-    </xd:short>
+		<xd:short>
+			Feuille de transformation du format TIGER-XML vers le format XML-TXM
+		</xd:short>
 
-    <xd:detail>
-      This stylesheet is free software; you can redistribute it and/or
-      modify it under the terms of the GNU Lesser General Public
-      License as published by the Free Software Foundation; either
-      version 3 of the License, or (at your option) any later version.
-      
-      This stylesheet is distributed in the hope that it will be useful,
-      but WITHOUT ANY WARRANTY; without even the implied warranty of
-      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      Lesser General Public License for more details.
-      
-      You should have received a copy of GNU Lesser Public License with
-      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
-    </xd:detail>
+		<xd:detail>
+			This stylesheet is free software; you can redistribute it and/or
+			modify it under the terms of the GNU Lesser General Public
+			License as published by the Free Software Foundation; either
+			version 3 of the License, or (at your option) any later version.
 
-    <xd:author>Matthieu Decorde, matthieu.decorde AT ens-lyon.fr</xd:author>
-    <xd:author>Serge Heiden, slh AT ens-lyon.fr</xd:author>
-    <xd:author>Alexey Lavrentev, alexei.lavrentev AT ens-lyon.fr></xd:author>
+			This stylesheet is distributed in the hope that it will be useful,
+			but WITHOUT ANY WARRANTY; without even the implied warranty of
+			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+			Lesser General Public License for more details.
 
-    <xd:copyright>2016, ENS de Lyon/CNRS (UMR IHRIM Cactus)</xd:copyright>
+			You should have received a copy of GNU Lesser Public License with
+			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
+		</xd:detail>
 
-  </xd:doc>
-  
-  <xsl:output 
-   method="xml"
-   encoding="UTF-8"
-   indent="yes" />
+		<xd:author>Matthieu Decorde, matthieu.decorde AT ens-lyon.fr</xd:author>
+		<xd:author>Serge Heiden, slh AT ens-lyon.fr</xd:author>
+		<xd:author>Alexey Lavrentev, alexei.lavrentev AT ens-lyon.fr></xd:author>
 
-  <xsl:template match="corpus">
-    <corpus>
-    	<xsl:choose>
-    		<xsl:when test="subcorpus">
-    			<xsl:apply-templates select="subcorpus"/>
-    		</xsl:when>
-    		<xsl:otherwise>
-    			<text>
-    				<xsl:apply-templates select="s"/>
-    			</text>			
-    		</xsl:otherwise>
-    	</xsl:choose>
-    	<xsl:apply-templates/>
-    </corpus>
-  </xsl:template>
-  
-  <xsl:template match="subcorpus">
-    <text>
-	<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
-	<xsl:apply-templates select="s"/>
-    </text>
-  </xsl:template>
-  
-  <xsl:template match="s">
-	<p>
-	  <s>
-	    <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
-	      <xsl:apply-templates select="graph/terminals/t" />
-	  </s>
-	</p>
-  </xsl:template>
+		<xd:copyright>2016, ENS de Lyon/CNRS (UMR IHRIM Cactus)</xd:copyright>
 
-  <xsl:template match="t">
+	</xd:doc>
+
+	<xsl:output method="xml" encoding="UTF-8" indent="yes" />
+
+	<xsl:template match="corpus">
+		<corpus>
+			<xsl:choose>
+				<xsl:when test="subcorpus">
+					<xsl:apply-templates select="subcorpus" />
+				</xsl:when>
+				<xsl:otherwise>
+					<text>
+						<xsl:apply-templates select="s" />
+					</text>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:apply-templates />
+		</corpus>
+	</xsl:template>
+
+	<xsl:template match="subcorpus">
+		<text>
+			<xsl:attribute name="name"><xsl:value-of
+				select="@name" /></xsl:attribute>
+			<xsl:apply-templates select="s" />
+		</text>
+	</xsl:template>
+
+	<xsl:template match="s">
+		<p>
+			<s>
+				<xsl:attribute name="id"><xsl:value-of
+					select="@id" /></xsl:attribute>
+				<xsl:apply-templates select="graph/terminals/t" />
+			</s>
+		</p>
+	</xsl:template>
+
+	<xsl:template match="t">
 		<w>
 			<xsl:for-each select="@*[not(name()='word')]">
-				<xsl:copy/>
+				<xsl:copy />
 			</xsl:for-each>
-	        <xsl:value-of select="@word"/>
+			<xsl:value-of select="@word" />
 		</w>
-  </xsl:template>
+	</xsl:template>
 
 </xsl:stylesheet>
 
Index: tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xmltxm-textgrid.xsl
===================================================================
--- tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xmltxm-textgrid.xsl	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/xml/xsl/txm-edition-xmltxm-textgrid.xsl	(revision 2397)
@@ -1,171 +1,198 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:txm="http://textometrie.org/1.0"
-                exclude-result-prefixes="#all" version="2.0">
-                
-	<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
-                
-                <xsl:strip-space elements="*"/>
-                
-                <xsl:template match="/">
-                	<html>
-                		<head>
-                			<title><xsl:value-of select="//tei:text[1]/@id"/></title>
-                			<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-                			<link rel="stylesheet" media="all" type="text/css" href="css/txm-textgrid.css" />
-                			<style type="text/css">
-                				.verseline:before {
-                				position:absolute;
-                				left:-50px;
-                				top:-14px;
-                				width:25px;
-                				text-align:right;
-                				color:gray;
-                				content:attr(title);
-                				}
-                				.editionpage {
-                				page-break-before:always;                                
-                				color:gray;
-                				display:block;
-                				text-align:center;
-                				}
-                				.editionpageverse {
-                				position:relative;
-                				left:-5%;
-                				page-break-before:always;                                
-                				color:gray;
-                				display:block;
-                				text-align:center;
-                				}
-                				.noteinline {
-                				color:gray;                                
-                				}
-                				.head {
-                				color:indigo;
-                				font-weight:bold;
-                				}
-                				.speaker {
-                				color:darkblue;
-                				}
-                			</style>
-<!--                			<title>
-                				<xsl:if test="$author[not(contains(.,'anonym'))]">
-                					<xsl:value-of select="$author"/><xsl:text> : </xsl:text>
-                				</xsl:if>
-                				<xsl:value-of select="$title-normal"/>
-                			</title>                                                                -->
-                		</head>
-                			<xsl:apply-templates select="descendant::tei:text"/>
-                	</html>
-                </xsl:template>
+<xsl:stylesheet
+	xmlns:edate="http://exslt.org/dates-and-times"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:txm="http://textometrie.org/1.0" exclude-result-prefixes="#all"
+	version="2.0">
 
-<xsl:template match="tei:text">
-	<body>
-		<a class="txm-page" title="1">&#xa0;</a>
-		<div class="metadata-page">
-			<h1><xsl:value-of select="@id"></xsl:value-of></h1>
-			<br/>
-			<table>
-				<xsl:for-each select="@*">
-					<tr>
-						<td><xsl:value-of select="name()"/></td>
-						<td><xsl:value-of select="."/></td>
-					</tr>
-				</xsl:for-each>
-			</table>
-		</div>
-		<xsl:apply-templates/>		
-	</body>
-</xsl:template>
+	<xsl:output method="xml" encoding="UTF-8"
+		omit-xml-declaration="no" indent="no"
+		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
 
-                <xsl:template match="*">
-                                <xsl:choose>
-                                	<xsl:when test="descendant::tei:p|descendant::tei:ab|descendant::tei:lg">
-                                		<div>
-                                			<xsl:call-template name="addClass"/>
-                                			<xsl:call-template name="checkId"/>
-                                			<xsl:apply-templates/></div>
-                                		<xsl:text>&#xa;</xsl:text>
-                                	</xsl:when>
-                                	<xsl:otherwise><span>
-                                		<xsl:call-template name="addClass"/>
-                                		<xsl:call-template name="checkId"/>
-<!--                                		<xsl:if test="self::tei:add[@del]">
-                                			<xsl:attribute name="title"><xsl:value-of select="@del"/></xsl:attribute>
-                                		</xsl:if>-->
-                                		<xsl:apply-templates/></span>
-                                	<xsl:call-template name="spacing-xmltxm"/>
-                                	</xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="@*|processing-instruction()|comment()">
-                                <!--<xsl:copy/>-->
-                </xsl:template>
-                
-<!--                <xsl:template match="comment()">
-                                <xsl:copy/>
-                </xsl:template>
--->                
-                <xsl:template match="text()">
-                                <xsl:value-of select="."/>
-                </xsl:template>
-                
-                <xsl:template name="addClass">
-                	<xsl:attribute name="class">
-                		<xsl:value-of select="local-name(.)"/>
-                		<xsl:if test="@type"><xsl:value-of select="concat('-',@type)"/></xsl:if>
-                		<xsl:if test="@subtype"><xsl:value-of select="concat('-',@subtype)"/></xsl:if>
+	<xsl:strip-space elements="*" />
+
+	<xsl:template match="/">
+		<html>
+			<head>
+				<title>
+					<xsl:value-of select="//tei:text[1]/@id" />
+				</title>
+				<meta http-equiv="Content-Type"
+					content="text/html;charset=UTF-8" />
+				<link rel="stylesheet" media="all" type="text/css"
+					href="css/txm-textgrid.css" />
+				<style type="text/css">
+					.verseline:before {
+					position:absolute;
+					left:-50px;
+					top:-14px;
+					width:25px;
+					text-align:right;
+					color:gray;
+					content:attr(title);
+					}
+					.editionpage {
+					page-break-before:always;
+					color:gray;
+					display:block;
+					text-align:center;
+					}
+					.editionpageverse {
+					position:relative;
+					left:-5%;
+					page-break-before:always;
+					color:gray;
+					display:block;
+					text-align:center;
+					}
+					.noteinline {
+					color:gray;
+					}
+					.head {
+					color:indigo;
+					font-weight:bold;
+					}
+					.speaker {
+					color:darkblue;
+					}
+				</style>
+				<!-- <title> <xsl:if test="$author[not(contains(.,'anonym'))]"> <xsl:value-of 
+					select="$author"/><xsl:text> : </xsl:text> </xsl:if> <xsl:value-of select="$title-normal"/> 
+					</title> -->
+			</head>
+			<xsl:apply-templates
+				select="descendant::tei:text" />
+		</html>
+	</xsl:template>
+
+	<xsl:template match="tei:text">
+		<body>
+			<a class="txm-page" title="1">&#xa0;</a>
+			<div class="metadata-page">
+				<h1>
+					<xsl:value-of select="@id"></xsl:value-of>
+				</h1>
+				<br />
+				<table>
+					<xsl:for-each select="@*">
+						<tr>
+							<td>
+								<xsl:value-of select="name()" />
+							</td>
+							<td>
+								<xsl:value-of select="." />
+							</td>
+						</tr>
+					</xsl:for-each>
+				</table>
+			</div>
+			<xsl:apply-templates />
+		</body>
+	</xsl:template>
+
+	<xsl:template match="*">
+		<xsl:choose>
+			<xsl:when
+				test="descendant::tei:p|descendant::tei:ab|descendant::tei:lg">
+				<div>
+					<xsl:call-template name="addClass" />
+					<xsl:call-template name="checkId" />
+					<xsl:apply-templates />
+				</div>
+				<xsl:text>&#xa;</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<span>
+					<xsl:call-template name="addClass" />
+					<xsl:call-template name="checkId" />
+					<!-- <xsl:if test="self::tei:add[@del]"> <xsl:attribute name="title"><xsl:value-of 
+						select="@del"/></xsl:attribute> </xsl:if> -->
+					<xsl:apply-templates />
+				</span>
+				<xsl:call-template name="spacing-xmltxm" />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template
+		match="@*|processing-instruction()|comment()">
+		<!--<xsl:copy/> -->
+	</xsl:template>
+
+	<!-- <xsl:template match="comment()"> <xsl:copy/> </xsl:template> -->
+	<xsl:template match="text()">
+		<xsl:value-of select="." />
+	</xsl:template>
+
+	<xsl:template name="addClass">
+		<xsl:attribute name="class">
+                		<xsl:value-of select="local-name(.)" />
+                		<xsl:if test="@type"><xsl:value-of
+			select="concat('-',@type)" /></xsl:if>
+                		<xsl:if test="@subtype"><xsl:value-of
+			select="concat('-',@subtype)" /></xsl:if>
                 		<!--<xsl:if test="@rend"><xsl:value-of select="concat('-',@rend)"/></xsl:if>-->
-                	</xsl:attribute>                	
-                </xsl:template>
-                
-                <xsl:template name="checkId">
-                	<xsl:if test="@xml:id">
-                		<xsl:attribute name="id"><xsl:value-of select="@xml:id"/></xsl:attribute>
-                	</xsl:if>
-                	
-                </xsl:template>
-                <xsl:template match="tei:p|tei:ab|tei:lg">
-                	<p>
-                		<xsl:call-template name="addClass"/>
-                		<xsl:call-template name="checkId"/>
-                		<xsl:apply-templates/>
-                	</p>
-                	<xsl:text>&#xa;</xsl:text>
-                </xsl:template>
-	
+                	</xsl:attribute>
+	</xsl:template>
+
+	<xsl:template name="checkId">
+		<xsl:if test="@xml:id">
+			<xsl:attribute name="id"><xsl:value-of
+				select="@xml:id" /></xsl:attribute>
+		</xsl:if>
+
+	</xsl:template>
+	<xsl:template match="tei:p|tei:ab|tei:lg">
+		<p>
+			<xsl:call-template name="addClass" />
+			<xsl:call-template name="checkId" />
+			<xsl:apply-templates />
+		</p>
+		<xsl:text>&#xa;</xsl:text>
+	</xsl:template>
+
 	<xsl:template match="tei:l">
 		<xsl:if test="preceding-sibling::*">
-			<br/>
+			<br />
 		</xsl:if>
-		<span class="l"><xsl:apply-templates/></span>
+		<span class="l">
+			<xsl:apply-templates />
+		</span>
 	</xsl:template>
-	
+
 	<xsl:template match="tei:head">
 		<xsl:variable name="level">
-			<xsl:value-of select="count(ancestor::tei:div) + 1"/>
+			<xsl:value-of select="count(ancestor::tei:div) + 1" />
 		</xsl:variable>
 		<xsl:element name="h{$level}">
-			<xsl:call-template name="addClass"/>
-			<xsl:call-template name="checkId"/>
-			<xsl:apply-templates/>			
+			<xsl:call-template name="addClass" />
+			<xsl:call-template name="checkId" />
+			<xsl:apply-templates />
 		</xsl:element>
-<!--		<h2>
-			<xsl:call-template name="addClass"/>
-			<xsl:apply-templates/>
-		</h2>-->
+		<!-- <h2> <xsl:call-template name="addClass"/> <xsl:apply-templates/> </h2> -->
 	</xsl:template>
-                
+
 	<xsl:template match="//tei:lb">
 		<xsl:variable name="lbcount">
 			<xsl:choose>
-				<xsl:when test="ancestor::tei:ab"><xsl:number from="tei:ab" level="any"/></xsl:when>
-				<xsl:when test="ancestor::tei:p"><xsl:number from="tei:p" level="any"/></xsl:when>
-				<xsl:otherwise>999</xsl:otherwise>
+				<xsl:when test="ancestor::tei:ab">
+					<xsl:number from="tei:ab" level="any" />
+				</xsl:when>
+				<xsl:when test="ancestor::tei:p">
+					<xsl:number from="tei:p" level="any" />
+				</xsl:when>
+				<xsl:otherwise>
+					999
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		<xsl:if test="not($lbcount=1) or preceding-sibling::node()[matches(.,'\S')]"><br/><xsl:text>&#xa;</xsl:text></xsl:if>
+		<xsl:if
+			test="not($lbcount=1) or preceding-sibling::node()[matches(.,'\S')]">
+			<br />
+			<xsl:text>&#xa;</xsl:text>
+		</xsl:if>
 		<xsl:if test="@n and not(@rend='prose')">
 			<xsl:choose>
 				<xsl:when test="matches(@n,'^[0-9]*[05]$')">
@@ -179,112 +206,154 @@
 			</xsl:choose>
 		</xsl:if>
 	</xsl:template>
-	
-	<!-- Page breaks -->                
-	<xsl:template match="//tei:pb[not(following-sibling::tei:cb)]">
+
+	<!-- Page breaks -->
+	<xsl:template
+		match="//tei:pb[not(following-sibling::tei:cb)]">
 		<xsl:variable name="editionpagetype">
 			<xsl:choose>
-				<xsl:when test="ancestor::tei:ab">editionpageverse</xsl:when>
-				<xsl:otherwise>editionpage</xsl:otherwise>
+				<xsl:when test="ancestor::tei:ab">
+					editionpageverse
+				</xsl:when>
+				<xsl:otherwise>
+					editionpage
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
 		<xsl:variable name="pagenumber">
 			<xsl:choose>
-				<xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when>
-				<xsl:when test="@facs"><xsl:value-of select="substring-before(@facs,'.')"/></xsl:when>
-				<xsl:otherwise>[NN]</xsl:otherwise>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:when test="@facs">
+					<xsl:value-of select="substring-before(@facs,'.')" />
+				</xsl:when>
+				<xsl:otherwise>
+					[NN]
+				</xsl:otherwise>
 			</xsl:choose>
 		</xsl:variable>
-		<xsl:variable name="page_id"><xsl:value-of select="count(preceding::tei:pb)"/></xsl:variable>
-		<xsl:if test="//tei:ref[@type='noteAnchor'][following::tei:pb[1][count(preceding::tei:pb) = $page_id]]">
+		<xsl:variable name="page_id">
+			<xsl:value-of select="count(preceding::tei:pb)" />
+		</xsl:variable>
+		<xsl:if
+			test="//tei:ref[@type='noteAnchor'][following::tei:pb[1][count(preceding::tei:pb) = $page_id]]">
 			<xsl:text>&#xa;</xsl:text>
-			<br/>
-			<br/>			
-			<span style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">                                                
-				<xsl:for-each select="//tei:ref[@type='noteAnchor'][following::tei:pb[1][count(preceding::tei:pb) = $page_id]]">
+			<br />
+			<br />
+			<span
+				style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">
+				<xsl:for-each
+					select="//tei:ref[@type='noteAnchor'][following::tei:pb[1][count(preceding::tei:pb) = $page_id]]">
 					<span class="footnote">
-						<xsl:apply-templates mode="#current" select="id(substring-after(@target,'#'))"/>
-					</span>                                                                
-				</xsl:for-each></span><xsl:text>&#xa;</xsl:text>                                                                
-			
-			
+						<xsl:apply-templates mode="#current"
+							select="id(substring-after(@target,'#'))" />
+					</span>
+				</xsl:for-each>
+			</span>
+			<xsl:text>&#xa;</xsl:text>
+
+
 		</xsl:if>
-	<!--	<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::tei:pb[1][count(preceding::tei:pb) = $page_id]]">
-			<xsl:text>&#xa;</xsl:text>
-			<br/>
-			<br/>			
-			<span style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">                                                
-				<xsl:for-each select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::tei:pb[1][count(preceding::tei:pb) = $page_id]]">
-					<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) + 1"/></xsl:variable>
-					<!-\-<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-\->
-					<span class="note">
-						<span style="position:absolute;left:-30px"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
-						<xsl:apply-templates mode="#current"/>
-					</span>                                                                
-				</xsl:for-each></span><xsl:text>&#xa;</xsl:text>                                                                
-			
-		</xsl:if>-->                                
-		
+		<!-- <xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::tei:pb[1][count(preceding::tei:pb) 
+			= $page_id]]"> <xsl:text>&#xa;</xsl:text> <br/> <br/> <span style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px"> 
+			<xsl:for-each select="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::tei:pb[1][count(preceding::tei:pb) 
+			= $page_id]]"> <xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) 
+			+ 1"/></xsl:variable> <!-\-<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" 
+			name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, 
+			l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> 
+			<xsl:value-of select="."/></p>-\-> <span class="note"> <span style="position:absolute;left:-30px"><a 
+			href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. 
+			</span> <xsl:apply-templates mode="#current"/> </span> </xsl:for-each></span><xsl:text>&#xa;</xsl:text> 
+			</xsl:if> -->
+
 		<xsl:text>&#xa;</xsl:text>
-		<br/><xsl:text>&#xa;</xsl:text>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
 		<a class="txm-page" title="{count(preceding::tei:pb) + 2}">&#xa0;</a>
-		<span class="{$editionpagetype}"> - <xsl:value-of select="$pagenumber"/> - </span><br/><xsl:text>&#xa;</xsl:text>
+		<span class="{$editionpagetype}">
+			-
+			<xsl:value-of select="$pagenumber" />
+			-
+		</span>
+		<br />
+		<xsl:text>&#xa;</xsl:text>
 	</xsl:template>
-	
+
 	<!-- Notes -->
 	<xsl:template match="tei:ref[@type='noteAnchor']">
-		<a title="{id(substring-after(@target,'#'))//txm:form}" style="font-size:75%;position:relative;top:-5px" href="{@target}"><xsl:value-of select="descendant::txm:form"/></a>
-		<xsl:call-template name="spacing-xmltxm"/>                                
+		<a title="{id(substring-after(@target,'#'))//txm:form}"
+			style="font-size:75%;position:relative;top:-5px" href="{@target}">
+			<xsl:value-of select="descendant::txm:form" />
+		</a>
+		<xsl:call-template name="spacing-xmltxm" />
 	</xsl:template>
-	
-                
-                <xsl:template match="//tei:w"><span class="w">
-                                                <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
-                                	<xsl:attribute name="title">
-                                		<xsl:if test="ancestor::tei:corr">
-                                			<xsl:value-of select="concat(' sic : ',descendant::txm:ana[@type='#sic'])"/>
+
+
+	<xsl:template match="//tei:w">
+		<span class="w">
+			<xsl:attribute name="id"><xsl:value-of
+				select="@id" /></xsl:attribute>
+			<xsl:attribute name="title">
+                                		<xsl:if
+				test="ancestor::tei:corr">
+                                			<xsl:value-of
+				select="concat(' sic : ',descendant::txm:ana[@type='#sic'])" />
                                 		</xsl:if>
-                                		<xsl:if test="ancestor::tei:reg">
-                                			<xsl:value-of select="concat(' orig : ',descendant::txm:ana[@type='#orig'])"/>
+                                		<xsl:if
+				test="ancestor::tei:reg">
+                                			<xsl:value-of
+				select="concat(' orig : ',descendant::txm:ana[@type='#orig'])" />
                                 		</xsl:if>
-                                		<xsl:if test="descendant::txm:ana[matches(@type,'pos$')]">
-                                			<xsl:for-each select="descendant::txm:ana[matches(@type,'pos$')]">
-                                				<xsl:value-of select="concat(' ',substring-after(@type,'#'),' : ',.)"/>
+                                		<xsl:if
+				test="descendant::txm:ana[matches(@type,'pos$')]">
+                                			<xsl:for-each
+				select="descendant::txm:ana[matches(@type,'pos$')]">
+                                				<xsl:value-of
+				select="concat(' ',substring-after(@type,'#'),' : ',.)" />
                                 			</xsl:for-each>
                                 		</xsl:if>                                		
                                 	</xsl:attribute>
-                                                <!--<xsl:copy-of select="@*"/>-->
-                                                <xsl:apply-templates select="txm:form"/>
-                                </span><xsl:call-template name="spacing-xmltxm"></xsl:call-template></xsl:template>
-                
-                <xsl:template match="//txm:form">
-                                <xsl:apply-templates/>
-                </xsl:template>
-                
-                
-                <xsl:template match="tei:sp[not(descendant::tei:speaker)]">
-                	<div class="sp">
-                		<span class="speaker"><xsl:value-of select="@who"></xsl:value-of></span>
-                		<xsl:apply-templates/>
-                	</div>
-                </xsl:template>
-	
-	
+			<!--<xsl:copy-of select="@*"/> -->
+			<xsl:apply-templates select="txm:form" />
+		</span>
+		<xsl:call-template name="spacing-xmltxm"></xsl:call-template>
+	</xsl:template>
+
+	<xsl:template match="//txm:form">
+		<xsl:apply-templates />
+	</xsl:template>
+
+
+	<xsl:template match="tei:sp[not(descendant::tei:speaker)]">
+		<div class="sp">
+			<span class="speaker">
+				<xsl:value-of select="@who"></xsl:value-of>
+			</span>
+			<xsl:apply-templates />
+		</div>
+	</xsl:template>
+
+
 	<xsl:template name="spacing-xmltxm">
 		<xsl:choose>
-			<xsl:when test="ancestor::tei:w"/>
-			<xsl:when test="following::tei:w[1][matches(descendant::txm:form,'^[.,)\]]+$')]"/>			
-			<xsl:when test="matches(descendant::txm:form[1],'^[(\[]+$|\w(''|’)$')"></xsl:when>
-			<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
+			<xsl:when test="ancestor::tei:w" />
+			<xsl:when
+				test="following::tei:w[1][matches(descendant::txm:form,'^[.,)\]]+$')]" />
+			<xsl:when
+				test="matches(descendant::txm:form[1],'^[(\[]+$|\w(''|’)$')"></xsl:when>
+			<xsl:when
+				test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
 			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-			<xsl:when test="following::tei:w[1][matches(descendant::txm:form,'^[:;!?]+$')]">
+			<xsl:when
+				test="following::tei:w[1][matches(descendant::txm:form,'^[:;!?]+$')]">
 				<xsl:text>&#xa0;</xsl:text>
 			</xsl:when>
 			<xsl:otherwise>
 				<xsl:text> </xsl:text>
 			</xsl:otherwise>
-		</xsl:choose>                
+		</xsl:choose>
 	</xsl:template>
-	
-                
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.core/res/org/txm/css/doc.css
===================================================================
--- tmp/org.txm.core/res/org/txm/css/doc.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/css/doc.css	(revision 2397)
@@ -1,9 +1,9 @@
 body {
-	padding-top:25px;
-	padding-bottom:25px;
-	padding-right:10px;
-	padding-left:10px;
-	width:600px;
+	padding-top: 25px;
+	padding-bottom: 25px;
+	padding-right: 10px;
+	padding-left: 10px;
+	width: 600px;
 }
 
 table {
@@ -30,11 +30,11 @@
 }
 
 h2 {
-
+	
 }
 
 img {
 	display: block;
-	margin: 0 auto; 
+	margin: 0 auto;
 	padding: 5px;
 }
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/css/tmx.css
===================================================================
--- tmp/org.txm.core/res/org/txm/css/tmx.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/css/tmx.css	(revision 2397)
@@ -1,38 +1,32 @@
-body
-{
-	padding-top:25px;
-	padding-bottom:25px;
-	padding-right:10px;
-	padding-left:10px;
+body {
+	padding-top: 25px;
+	padding-bottom: 25px;
+	padding-right: 10px;
+	padding-left: 10px;
 }
 
-table
-{
-margin-left: auto;
-margin-right: auto;
-margin-bottom: 50px;
+table {
+	margin-left: auto;
+	margin-right: auto;
+	margin-bottom: 50px;
 }
 
-td
-{
-padding: 5px;
+td {
+	padding: 5px;
 }
 
 .header {
-
+	
 }
 
-.tuTitle
-{
-text-align: center;
+.tuTitle {
+	text-align: center;
 }
 
-.seg
-{
+.seg {
 	
 }
 
-.note
-{
-	color:red;
+.note {
+	color: red;
 }
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/css/txm.css
===================================================================
--- tmp/org.txm.core/res/org/txm/css/txm.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/css/txm.css	(revision 2397)
@@ -7,10 +7,9 @@
    TXM default CSS 06-2017
 
 */
-
 .txmeditionpage {
-	background-color: #fdfdf9; /* use #f8f7ee for book style */
-	#font-family: junicode, verdana; /* book style */
+	background-color: #fdfdf9; /* use #f8f7ee for book style */ #
+	font-family: junicode, verdana; /* book style */
 	font-size: 14px;
 	text-indent: none;
 	text-align: justify;
@@ -34,45 +33,45 @@
 }
 
 .txmlettrinep:first-letter {
-    float: left;
-    font-size: 6em;
-    line-height: 1;
-    margin-right: 0.2em;
+	float: left;
+	font-size: 6em;
+	line-height: 1;
+	margin-right: 0.2em;
 }
 
 a {
-	color:#802520;
+	color: #802520;
 }
 
 h1 {
 	font-size: 20px;
 	font-variant: small-caps;
 	text-align: center;
-	color:#802520;
+	color: #802520;
 }
 
 h2 {
 	font-size: 18px;
 	font-variant: small-caps;
 	text-align: center;
-	color:#802520;
+	color: #802520;
 }
 
 h3 {
 	font-size: 16px;
 	font-variant: small-caps;
 	text-align: center;
-	color:#802520;
+	color: #802520;
 }
 
 p {
-    	text-indent: 0.2cm;
+	text-indent: 0.2cm;
 	text-align: justify;
-    	text-justify: inter-word;	
-  }
+	text-justify: inter-word;
+}
 
 img {
-    margin: 10px 10px 10px 10px;
+	margin: 10px 10px 10px 10px;
 }
 
 td[rend="table-cell-align-right"] {
Index: tmp/org.txm.core/res/org/txm/css/transcriber.css
===================================================================
--- tmp/org.txm.core/res/org/txm/css/transcriber.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/css/transcriber.css	(revision 2397)
@@ -1,54 +1,54 @@
 body {
-	padding-top:25px;
-	padding-bottom:25px;
-	padding-right:10px;
-	padding-left:10px;
+	padding-top: 25px;
+	padding-bottom: 25px;
+	padding-right: 10px;
+	padding-left: 10px;
 }
 
 .comment {
-	font-style:italic;
-	font-weight:normal;
+	font-style: italic;
+	font-weight: normal;
 }
 
 .section {
-
+	
 }
 
 .title {
-
+	
 }
 
 .subtitle {
-
+	
 }
 
 .transcription-table {
-
+	
 }
 
 .section-desc {
-
+	
 }
 
 .section-title {
-
+	
 }
 
 .section-metadata {
-	column-count:2;
+	column-count: 2;
 	-webkit-column-count: 2;
 }
 
 .section-secondary {
-	column-count:2;
+	column-count: 2;
 	-webkit-column-count: 2;
 }
 
 .play-media {
 	background-color: white;
 	border: 1px solid #e7e7e7;
-  	color: black;
-  	border-radius: 2px;
+	color: black;
+	border-radius: 2px;
 }
 
 .play-media:hover {
@@ -58,38 +58,38 @@
 }
 
 .turn {
-
+	
 }
 
 .spk {
-	font-variant: small-caps ; 
+	font-variant: small-caps;
 }
 
 .event {
-	font-style:italic;
+	font-style: italic;
 }
 
 b .event {
-	font-style:italic;
-	font-weight:normal;
+	font-style: italic;
+	font-weight: normal;
 }
 
 .sync {
-	vertical-align: super; 
-	font-weight:normal;
+	vertical-align: super;
+	font-weight: normal;
 	font-size: 70%;
 }
 
 table {
-margin-left: auto;
-margin-right: auto;
-margin-bottom: 50px;
+	margin-left: auto;
+	margin-right: auto;
+	margin-bottom: 50px;
 }
 
 td {
-padding: 5px;
+	padding: 5px;
 }
 
 h2 {
-text-align: center;
-}
+	text-align: center;
+}
\ No newline at end of file
Index: tmp/org.txm.core/res/org/txm/js/test_sel.html
===================================================================
--- tmp/org.txm.core/res/org/txm/js/test_sel.html	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/js/test_sel.html	(revision 2397)
@@ -5,10 +5,10 @@
 <title>Demo</title>
 </head>
 <body>
-<button >TEST SELECTION</button>
-<script src="http://code.jquery.com/jquery-latest.js"></script>
-<script src="jquery.selection.js"></script>
-<script>
+	<button>TEST SELECTION</button>
+	<script src="http://code.jquery.com/jquery-latest.js"></script>
+	<script src="jquery.selection.js"></script>
+	<script>
 $( document ).ready(function() {
 $( "button" ).click(function( event ) {
 var sel = window.getSelection()
@@ -20,8 +20,9 @@
 });
 </script>
 
-<p>
-<span id="w_0" title="un">un</span> <span id="w_1" title="premier">premier</span> <span id="w_2" title="mot">mot</span>
-</p>
+	<p>
+		<span id="w_0" title="un">un</span> <span id="w_1" title="premier">premier</span>
+		<span id="w_2" title="mot">mot</span>
+	</p>
 </body>
 </html>
Index: tmp/org.txm.core/res/org/txm/js/viewer/toolbar-ext.css
===================================================================
--- tmp/org.txm.core/res/org/txm/js/viewer/toolbar-ext.css	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/js/viewer/toolbar-ext.css	(revision 2397)
@@ -5,28 +5,31 @@
 	top: 3px;
 	z-index: 5;
 }
+
 .toolbarButton {
 	margin: 0 2px;
 	cursor: pointer;
 }
+
 .helptext {
 	-webkit-border-radius: 7px;
 	-khtml-border-radius: 7px;
 	-moz-border-radius: 7px;
 	border-radius: 7px;
 	background-color: #fff;
-	border:1px dotted #D0D0D0;
-	color:#404040;
-	font-size:12px;
-	height:150px;
-	overflow:auto;
-	padding:5px;
-	position:absolute;
-	right:11px;
-	top:11px;
-	width:300px;
+	border: 1px dotted #D0D0D0;
+	color: #404040;
+	font-size: 12px;
+	height: 150px;
+	overflow: auto;
+	padding: 5px;
+	position: absolute;
+	right: 11px;
+	top: 11px;
+	width: 300px;
 	z-index: 5;
 }
+
 .toolbar hr {
 	border-top: 0px solid #fff;
 	border-left: 0px solid #fff;
@@ -34,6 +37,7 @@
 	border-bottom: 1px dotted #808080;
 	margin: 1px 0px 7px 0px;
 }
+
 .movement-controls {
 	position: absolute;
 	right: 3px;
Index: tmp/org.txm.core/res/org/txm/js/testjquery.html
===================================================================
--- tmp/org.txm.core/res/org/txm/js/testjquery.html	(revision 2396)
+++ tmp/org.txm.core/res/org/txm/js/testjquery.html	(revision 2397)
@@ -5,10 +5,10 @@
 <title>Demo</title>
 </head>
 <body>
-<button >TEST SELECTION</button>
-<script src="http://code.jquery.com/jquery-latest.js"></script>
-<script src="jquery.selection.js"></script>
-<script>
+	<button>TEST SELECTION</button>
+	<script src="http://code.jquery.com/jquery-latest.js"></script>
+	<script src="jquery.selection.js"></script>
+	<script>
 $( document ).ready(function() {
 $( "button" ).click(function( event ) {
 var sel = window.getSelection()
@@ -20,8 +20,9 @@
 });
 </script>
 
-<p>
-<span id="w_0" title="un">un</span> <span id="w_1" title="premier">premier</span> <span id="w_2" title="mot">mot</span>
-</p>
+	<p>
+		<span id="w_0" title="un">un</span> <span id="w_1" title="premier">premier</span>
+		<span id="w_2" title="mot">mot</span>
+	</p>
 </body>
 </html>
Index: tmp/org.txm.core.tests/.classpath
===================================================================
--- tmp/org.txm.core.tests/.classpath	(revision 2396)
+++ tmp/org.txm.core.tests/.classpath	(revision 2397)
@@ -1,12 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry exported="true" kind="con"
+		path="GROOVY_DSL_SUPPORT" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.concordance.core/.classpath
===================================================================
--- tmp/org.txm.concordance.core/.classpath	(revision 2396)
+++ tmp/org.txm.concordance.core/.classpath	(revision 2397)
@@ -1,15 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/package.html
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/package.html	(revision 2396)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Concordance.</p>
+	<p>Concordance.</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/package.html
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/package.html	(revision 2396)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Sorters for displaying concordance.</p>
+	<p>Sorters for displaying concordance.</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.internalview.core/src/org/txm/internalview/core/preferences/InternalViewPreferences.java
===================================================================
--- tmp/org.txm.internalview.core/src/org/txm/internalview/core/preferences/InternalViewPreferences.java	(revision 2396)
+++ tmp/org.txm.internalview.core/src/org/txm/internalview/core/preferences/InternalViewPreferences.java	(revision 2397)
@@ -12,25 +12,26 @@
  *
  */
 public class InternalViewPreferences extends TXMPreferences {
-
+	
 	/**
-	 * Current page number. 
+	 * Current page number.
 	 */
 	public static final String CURRENT_PAGE = "current_page"; //$NON-NLS-1$
-
 	
+	
 	/**
 	 * Gets the instance.
+	 * 
 	 * @return the instance
 	 */
-	public static TXMPreferences getInstance()	{
+	public static TXMPreferences getInstance() {
 		if (!TXMPreferences.instances.containsKey(InternalViewPreferences.class)) {
 			new InternalViewPreferences();
 		}
 		return TXMPreferences.instances.get(InternalViewPreferences.class);
 	}
-
 	
+	
 	@Override
 	public void initializeDefaultPreferences() {
 		super.initializeDefaultPreferences();
Index: tmp/org.txm.internalview.core/src/org/txm/internalview/core/messages/InternalViewCoreMessages.java
===================================================================
--- tmp/org.txm.internalview.core/src/org/txm/internalview/core/messages/InternalViewCoreMessages.java	(revision 2396)
+++ tmp/org.txm.internalview.core/src/org/txm/internalview/core/messages/InternalViewCoreMessages.java	(revision 2397)
@@ -15,12 +15,14 @@
 	private static final String BUNDLE_NAME = "org.txm.internalview.core.messages.messages"; //$NON-NLS-1$
 	
 	public static String RESULT_TYPE;
-
 	
-	public static String structureInformationsColon; 
-	public static String internalViewColonFailedToRetrieveStructPropertiesValuesColonP0; 
-	public static String noStructureInformations; 
 	
+	public static String structureInformationsColon;
+	
+	public static String internalViewColonFailedToRetrieveStructPropertiesValuesColonP0;
+	
+	public static String noStructureInformations;
+	
 	static {
 		Utf8NLS.initializeMessages(BUNDLE_NAME, InternalViewCoreMessages.class);
 	}
Index: tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/package.html
===================================================================
--- tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/package.html	(revision 2396)
+++ tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Internal view</p>
+	<p>Internal view</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java
===================================================================
--- tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java	(revision 2396)
+++ tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java	(revision 2397)
@@ -30,42 +30,43 @@
 import org.txm.utils.logger.Log;
 
 /**
- * Internal view. 
+ * Internal view.
  * 
  * @author mdecorde
  * @author sjacquot
  *
  */
-public class InternalView extends TXMResult  {
-
+public class InternalView extends TXMResult {
+	
 	protected List<Match> matches = new ArrayList<Match>();
+	
 	protected int nmatches = 0;
-
+	
 	/**
 	 * Current page.
 	 */
-	@Parameter(key=InternalViewPreferences.CURRENT_PAGE)
+	@Parameter(key = InternalViewPreferences.CURRENT_PAGE)
 	protected int pCurrentPage;
-
+	
 	/**
 	 * Structural unit to explore.
 	 */
-	@Parameter(key=TXMPreferences.STRUCTURAL_UNIT)
+	@Parameter(key = TXMPreferences.STRUCTURAL_UNIT)
 	protected StructuralUnit pStructuralUnit;
-
+	
 	/**
 	 * Word properties to display.
 	 */
-	@Parameter(key=TXMPreferences.UNIT_PROPERTIES)
+	@Parameter(key = TXMPreferences.UNIT_PROPERTIES)
 	protected List<WordProperty> pWordProperties;
-
+	
 	/**
 	 * Structural units to display.
 	 */
-	@Parameter(key=TXMPreferences.STRUCTURAL_UNIT_PROPERTIES)
+	@Parameter(key = TXMPreferences.STRUCTURAL_UNIT_PROPERTIES)
 	protected List<StructuralUnitProperty> pStructuralUnitsProperties;
-
-
+	
+	
 	/**
 	 * 
 	 * @param parent
@@ -73,7 +74,7 @@
 	public InternalView(CQPCorpus parent) {
 		super(parent);
 	}
-
+	
 	/**
 	 * 
 	 * @param parametersNodePath
@@ -81,72 +82,75 @@
 	public InternalView(String parametersNodePath) {
 		super(parametersNodePath);
 	}
-
-
-
+	
+	
+	
 	@Override
 	public boolean loadParameters() throws Exception {
 		try {
 			String str = this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT);
 			this.pStructuralUnit = this.getCorpus().getStructuralUnit(str);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.printStackTrace(e);
 		}
 		try {
 			String str = this.getStringParameterValue(TXMPreferences.UNIT_PROPERTIES);
 			this.pWordProperties = (List<WordProperty>) WordProperty.stringToProperties(this.getCorpus(), str);
-		} catch (Exception e2) {
+		}
+		catch (Exception e2) {
 			Log.printStackTrace(e2);
 		}
 		try {
 			String str = this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT_PROPERTIES);
 			this.pStructuralUnitsProperties = StructuralUnitProperty.stringToProperties(this.getCorpus(), str);
-		} catch (Exception e3) {
+		}
+		catch (Exception e3) {
 			Log.printStackTrace(e3);
 		}
 		return true;
 	}
-
-
+	
+	
 	@Override
 	protected boolean _compute() throws Exception {
-
-		if(this.hasParameterChanged(InternalViewPreferences.STRUCTURAL_UNIT))	{
+		
+		if (this.hasParameterChanged(InternalViewPreferences.STRUCTURAL_UNIT)) {
 			
 			// reset the current page (only if the result has been computed at least once otherwise it breaks the deserialization)
-			if(this.hasBeenComputedOnce)	{
+			if (this.hasBeenComputedOnce) {
 				this.pCurrentPage = 0;
 			}
 			
-			//find struct start-end
+			// find struct start-end
 			CQLQuery query = new CQLQuery("<" + pStructuralUnit.getName() + "> [] expand to " + pStructuralUnit); //$NON-NLS-1$ //$NON-NLS-2$
-			//System.out.println(query);
+			// System.out.println(query);
 			QueryResult result = getCorpus().query(query, "test", false); //$NON-NLS-1$
 			nmatches = result.getNMatch();
 			if (nmatches > 0) {
 				matches = result.getMatches();
 			}
 			result.drop();
-			//System.out.println(matches);
+			// System.out.println(matches);
 			dirty = false;
 			return (nmatches > 0);
 		}
 		return true;
 	}
-
-
-
-
+	
+	
+	
+	
 	@Override
 	public boolean canCompute() {
-		return getCorpus() != null && 
-				pStructuralUnit != null && 
-				pWordProperties != null && 
-				pWordProperties.size() > 0 && 
-				pStructuralUnitsProperties != null && 
+		return getCorpus() != null &&
+				pStructuralUnit != null &&
+				pWordProperties != null &&
+				pWordProperties.size() > 0 &&
+				pStructuralUnitsProperties != null &&
 				pStructuralUnitsProperties.size() > 0;
 	}
-
+	
 	/**
 	 * get the ith page and set the current page number to i
 	 * 
@@ -156,13 +160,13 @@
 	 */
 	protected LinkedHashMap<Property, List<String>> getPageContent(int i) throws CqiClientException {
 		LinkedHashMap<Property, List<String>> rez = new LinkedHashMap<Property, List<String>>();
-
+		
 		if (i >= 0 && i < nmatches) {
 			Match m = matches.get(i);
 			Collection<? extends Integer> positions = m.getRange();
 			int[] p = new int[positions.size()];
 			int c = 0;
-			for(int v : positions) {
+			for (int v : positions) {
 				p[c++] = v;
 			}
 			for (Property prop : pWordProperties) {
@@ -172,8 +176,8 @@
 		}
 		return rez;
 	}
-
-
+	
+	
 	/**
 	 * 
 	 * @return the current page content map
@@ -183,18 +187,19 @@
 		HashMap<Property, List<String>> current = this.getPageContent(pCurrentPage);
 		return current;
 	}
-
-
-
-
+	
+	
+	
+	
 	/**
 	 * Gets the current page number.
+	 * 
 	 * @return the current page number
 	 */
 	public int getCurrentPage() {
 		return pCurrentPage;
 	}
-
+	
 	@Override
 	public boolean saveParameters() {
 		if (pStructuralUnit != null) {
@@ -207,68 +212,71 @@
 		if (pWordProperties != null) {
 			this.saveParameter(InternalViewPreferences.UNIT_PROPERTIES, WordProperty.propertiesToString(pWordProperties));
 		}
-
+		
 		return true;
 	}
-
+	
 	@Override
 	public void clean() {
 		// nothing to do
 	}
-
-
+	
+	
 	/**
 	 * Gets the linked corpus.
+	 * 
 	 * @return
 	 */
 	public CQPCorpus getCorpus() {
-		return (CQPCorpus)getParent();
+		return (CQPCorpus) getParent();
 	}
-
-
+	
+	
 	@Override
 	public String getDetails() {
-		return getCorpus().getName()+" "+pStructuralUnit.getName()+" "+(pCurrentPage+1); //$NON-NLS-1$ //$NON-NLS-2$
+		return getCorpus().getName() + " " + pStructuralUnit.getName() + " " + (pCurrentPage + 1); //$NON-NLS-1$ //$NON-NLS-2$
 	}
-
+	
 	@Override
 	public String getComputingDoneMessage() {
 		return "";
-		//return TXMCoreMessages.common_done;
+		// return TXMCoreMessages.common_done;
 	}
-
+	
 	@Override
 	public String getSimpleName() {
 		return getName();
 	}
-
-
+	
+	
 	@Override
 	public String getName() {
 		if (pStructuralUnit != null) {
-			return pStructuralUnit.getName( ) + " (" + (this.pCurrentPage + 1) + " / " + this.nmatches + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			return pStructuralUnit.getName() + " (" + (this.pCurrentPage + 1) + " / " + this.nmatches + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		}
 		return getCorpus().getName();
 	}
-
-
+	
+	
 	/**
 	 * Gets the number of matched segments.
+	 * 
 	 * @return
 	 */
 	public int getSegmentsCount() {
 		return nmatches;
 	}
-
-
+	
+	
 	/**
 	 * Gets lexical properties to display.
+	 * 
 	 * @return
 	 */
 	public List<WordProperty> getProperties() {
 		return pWordProperties;
 	}
-
+	
 	/**
 	 * 
 	 * @return
@@ -280,86 +288,89 @@
 		if (matches.size() < pCurrentPage) {
 			return 0;
 		}
-
+		
 		Match m = matches.get(pCurrentPage);
 		return m.size();
 	}
-
+	
 	/**
 	 * 
 	 * @return
 	 */
 	public String getStructInfos() {
-
+		
 		try {
 			if (pStructuralUnitsProperties.size() > 0) {
 				String str = InternalViewCoreMessages.structureInformationsColon;
 				for (Property sup : pStructuralUnitsProperties) {
-					int[] array = {getCurrentPage()};
-					str += " "+sup.getName()+"="+CQPSearchEngine.getCqiClient().struc2Str(sup.getQualifiedName(), array)[0]; //$NON-NLS-1$ //$NON-NLS-2$
+					int[] array = { getCurrentPage() };
+					str += " " + sup.getName() + "=" + CQPSearchEngine.getCqiClient().struc2Str(sup.getQualifiedName(), array)[0]; //$NON-NLS-1$ //$NON-NLS-2$
 				}
 				return str;
 			}
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			System.out.println(NLS.bind(InternalViewCoreMessages.internalViewColonFailedToRetrieveStructPropertiesValuesColonP0, e.getMessage()));
 			org.txm.utils.logger.Log.printStackTrace(e);
 		}
 		return InternalViewCoreMessages.noStructureInformations;
 	}
-
+	
 	/**
 	 * Gets the structural unit to explore.
+	 * 
 	 * @return
 	 */
 	public StructuralUnit getStructuralUnit() {
 		return pStructuralUnit;
 	}
-
-
+	
+	
 	/**
 	 * Dumps the specified segment in the console.
+	 * 
 	 * @param seg
 	 */
 	public void printSeg(HashMap<Property, List<String>> seg) {
 		Collection<List<String>> values = seg.values();
-		if(values.size() == 0) {
+		if (values.size() == 0) {
 			return;
 		}
-
-		for(List<String> list : values) {
-			for(String value : list) {
-				System.out.print("\t"+value); //$NON-NLS-1$
+		
+		for (List<String> list : values) {
+			for (String value : list) {
+				System.out.print("\t" + value); //$NON-NLS-1$
 			}
 			System.out.println();
 		}
 		System.out.println();
 	}
-
-
+	
+	
 	public void setParameters(List<WordProperty> properties, StructuralUnit struct, List<StructuralUnitProperty> structProperties, Integer currentStructure) {
 		if (properties != null) this.pWordProperties = properties;
 		if (struct != null) this.pStructuralUnit = struct;
 		if (structProperties != null) this.pStructuralUnitsProperties = structProperties;
 		if (currentStructure != null) this.pCurrentPage = currentStructure;
-
+		
 		dirty = true;
 	}
-
-
-
-
+	
+	
+	
+	
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
 		// FIXME: Debug
 		System.err.println("InternalView.setParameters(): not yet implemented.");
 		return false;
 	}
-
-
+	
+	
 	@Override
 	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
 		PrintWriter writer = IOUtils.getWriter(outfile, encoding);
-		for (int ipage = 0 ; ipage < nmatches ; ipage++) { // run through all pages
+		for (int ipage = 0; ipage < nmatches; ipage++) { // run through all pages
 			LinkedHashMap<Property, List<String>> page = getPageContent(ipage);
 			for (Property p : pWordProperties) {
 				writer.println(StringUtils.join(page.get(p), colseparator));
@@ -369,50 +380,54 @@
 		writer.close();
 		return false;
 	}
-
-
+	
+	
 	/**
 	 * Sets the structural unit to explore.
+	 * 
 	 * @param structuralUnit
 	 */
 	public void setStructuralUnit(StructuralUnit structuralUnit) {
 		this.pStructuralUnit = structuralUnit;
 	}
-
-
+	
+	
 	/**
 	 * Sets the word properties to display.
+	 * 
 	 * @param properties
 	 */
-	public void setWordProperties(List<WordProperty> properties)	{
+	public void setWordProperties(List<WordProperty> properties) {
 		this.pWordProperties = properties;
 	}
-
+	
 	/**
 	 * Sets the structural unit properties to display.
+	 * 
 	 * @param structuralUnitProperties
 	 */
 	public void setStructuralUnitProperties(List<StructuralUnitProperty> structuralUnitProperties) {
 		this.pStructuralUnitsProperties = structuralUnitProperties;
 	}
-
-
+	
+	
 	/**
 	 * Sets the current page number.
+	 * 
 	 * @param currentPage the currentPage to set
 	 */
 	public void setCurrentPage(int currentPage) {
 		this.pCurrentPage = currentPage;
-
-		if(this.pCurrentPage < 0 || this.pCurrentPage > (this.nmatches - 1))	 {
+		
+		if (this.pCurrentPage < 0 || this.pCurrentPage > (this.nmatches - 1)) {
 			System.err.println("InternalView.setCurrentPage(): current page (" + this.pCurrentPage + ") is outside matches range (" + this.nmatches + ").");
 			this.pCurrentPage = 0;
 		}
 	}
-
+	
 	@Override
 	public String getResultType() {
 		return InternalViewCoreMessages.RESULT_TYPE;
 	}
-
-}
\ No newline at end of file
+	
+}
Index: tmp/org.txm.internalview.core/.classpath
===================================================================
--- tmp/org.txm.internalview.core/.classpath	(revision 2396)
+++ tmp/org.txm.internalview.core/.classpath	(revision 2397)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.connlu.core/groovy/org/txm/scripts/importer/connlu/package.html
===================================================================
--- tmp/org.txm.connlu.core/groovy/org/txm/scripts/importer/connlu/package.html	(revision 2396)
+++ tmp/org.txm.connlu.core/groovy/org/txm/scripts/importer/connlu/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>TIGERSearch import module. This is a prototype that can only manage SRCMF TIGERSearch sources</p>
+	<p>TIGERSearch import module. This is a prototype that can only
+		manage SRCMF TIGERSearch sources</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.connlu.core/.classpath
===================================================================
--- tmp/org.txm.connlu.core/.classpath	(revision 2396)
+++ tmp/org.txm.connlu.core/.classpath	(revision 2397)
@@ -1,13 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
-	  <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry exported="true" kind="con"
+		path="GROOVY_SUPPORT" />
+	<classpathentry exported="true" kind="con"
+		path="GROOVY_DSL_SUPPORT" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.internalview.rcp/.classpath
===================================================================
--- tmp/org.txm.internalview.rcp/.classpath	(revision 2396)
+++ tmp/org.txm.internalview.rcp/.classpath	(revision 2397)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java	(revision 2396)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java	(revision 2397)
@@ -51,57 +51,60 @@
  *
  */
 public class InternalViewEditor extends TXMEditor<InternalView> {
-
+	
 	public static final String ID = InternalViewEditor.class.getName();
 	
 	protected CQPCorpus corpus;
+	
 	protected InternalView internalView;
 	
 	
 	protected TableViewer viewer;
+	
 	protected Table table;
 	
 	protected Label structInfos;
+	
 	protected Composite navigationPanel;
-
-
+	
+	
 	/**
 	 * For current page parameter synchronization.
 	 */
-	@Parameter(key=InternalViewPreferences.CURRENT_PAGE)
+	@Parameter(key = InternalViewPreferences.CURRENT_PAGE)
 	protected NewNavigationWidget navigation;
 	
 	/**
 	 * Structural unit to explore.
 	 */
-	@Parameter(key=InternalViewPreferences.STRUCTURAL_UNIT)
-	protected StructuralUnitsComboViewer structuralUnitsComboViewer; 
-
+	@Parameter(key = InternalViewPreferences.STRUCTURAL_UNIT)
+	protected StructuralUnitsComboViewer structuralUnitsComboViewer;
+	
 	/**
 	 * Word properties to display.
 	 */
-	@Parameter(key=InternalViewPreferences.UNIT_PROPERTIES)
+	@Parameter(key = InternalViewPreferences.UNIT_PROPERTIES)
 	protected PropertiesSelector<WordProperty> propertiesSelector;
 	
 	/**
 	 * Structural units to display.
 	 */
-	@Parameter(key=InternalViewPreferences.STRUCTURAL_UNIT_PROPERTIES)
+	@Parameter(key = InternalViewPreferences.STRUCTURAL_UNIT_PROPERTIES)
 	protected PropertiesSelector<StructuralUnitProperty> structuralUnitPropertiesSelector;
-
 	
+	
 	@Override
 	public void _createPartControl() {
-
+		
 		internalView = this.getResult();
-
+		
 		// Computing listener
 		ComputeSelectionListener computeSelectionListener = new ComputeSelectionListener(this, true);
 		ComputeKeyListener computeKeyListener = new ComputeKeyListener(this);
 		
 		
 		Composite parametersArea = getExtendedParametersGroup();
-		parametersArea.setLayout(new GridLayout(5,false));
+		parametersArea.setLayout(new GridLayout(5, false));
 		parametersArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 		
 		Composite resultPanel = getResultArea();
@@ -113,6 +116,7 @@
 		this.structuralUnitsComboViewer = new StructuralUnitsComboViewer(parametersArea, this, true);
 		// Listener
 		this.structuralUnitsComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+			
 			@Override
 			public void selectionChanged(SelectionChangedEvent event) {
 				structuralUnitPropertiesSelector.setProperties(structuralUnitsComboViewer.getSelectedStructuralUnit().getUserDefinedOrderedProperties());
@@ -141,30 +145,30 @@
 		structuralUnitPropertiesSelector.addSelectionListener(computeSelectionListener);
 		
 		
-		navigationPanel = getBottomToolbar().installGLComposite(InternalViewUIMessages.navigation, 4 , false);
+		navigationPanel = getBottomToolbar().installGLComposite(InternalViewUIMessages.navigation, 4, false);
 		navigationPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
-
 		
+		
 		// Navigation widget
 		navigation = new NewNavigationWidget(navigationPanel);
 		navigation.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, true));
 		navigation.addGoToKeyListener(computeKeyListener);
-
 		
+		
 		// Listeners
 		navigation.addFirstListener(computeSelectionListener);
 		navigation.addPreviousListener(computeSelectionListener);
 		navigation.addNextListener(computeSelectionListener);
 		navigation.addLastListener(computeSelectionListener);
-
 		
+		
 		structInfos = new Label(navigationPanel, SWT.NONE);
 		structInfos.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, true));
 		structInfos.setText(""); //$NON-NLS-1$
-
-		//		Button style = new Button(navigationPanel, SWT.RADIO);
-		//		style.setText("table");
-
+		
+		// Button style = new Button(navigationPanel, SWT.RADIO);
+		// style.setText("table");
+		
 		viewer = new TableViewer(resultPanel);
 		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
 		viewer.getTable().setLinesVisible(true);
@@ -172,28 +176,28 @@
 		table = viewer.getTable();
 		table.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
 		viewer.setContentProvider(new IStructuredContentProvider() {
-
+			
 			@Override
-			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { }
-
+			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+			
 			@Override
-			public void dispose() { }
-
+			public void dispose() {}
+			
 			@Override
 			public Object[] getElements(Object inputElement) {
 				int nlines = internalView.getSegmentLength();
 				List<WordProperty> props = internalView.getProperties();
-
+				
 				ArrayList<Object[]> lines = new ArrayList<Object[]>();
-				for (int i = 0 ; i < nlines ; i++) {
+				for (int i = 0; i < nlines; i++) {
 					lines.add(new String[props.size()]);
 				}
-				if (inputElement instanceof HashMap<?,?>) {
+				if (inputElement instanceof HashMap<?, ?>) {
 					HashMap<Property, List<String>> l = (HashMap<Property, List<String>>) inputElement;
-					for (int i = 0 ; i < props.size() ; i++) {
+					for (int i = 0; i < props.size(); i++) {
 						Property prop = props.get(i);
 						List<String> data = l.get(prop);
-						for (int j = 0 ; j < nlines ; j++) {
+						for (int j = 0; j < nlines; j++) {
 							lines.get(j)[i] = data.get(j);
 						}
 					}
@@ -211,85 +215,91 @@
 	protected boolean goToPage(int page) throws CqiClientException {
 		internalView.setCurrentPage(page);
 		fillResultArea(); // one segment at time
-
+		
 		if (page == 0) {
 			navigation.setFirstEnabled(false);
 			navigation.setPreviousEnabled(false);
-		} else {
+		}
+		else {
 			navigation.setFirstEnabled(true);
 			navigation.setFirstEnabled(true);
 		}
-
-		if (page == internalView.getSegmentsCount() -1) {
+		
+		if (page == internalView.getSegmentsCount() - 1) {
 			navigation.setNextEnabled(false);
 			navigation.setLastEnabled(false);
-		} else {
+		}
+		else {
 			navigation.setNextEnabled(true);
 			navigation.setLastEnabled(true);
 		}
 		return true;
 	}
-
 	
+	
 	HashMap<Property, TableViewerColumn> columns = new HashMap<Property, TableViewerColumn>();
+	
 	HashMap<TableViewerColumn, Integer> columnsOrder = new HashMap<TableViewerColumn, Integer>();
+	
 	private void initColumns() {
-
-		for( TableViewerColumn col : columns.values()) {
+		
+		for (TableViewerColumn col : columns.values()) {
 			col.getColumn().dispose();
 		}
 		columnsOrder = new HashMap<TableViewerColumn, Integer>();
 		columns = new HashMap<Property, TableViewerColumn>();
-
+		
 		if (internalView == null) {
-			//System.out.println("REMOVE NON USED COLUMNS");
-		} else {
+			// System.out.println("REMOVE NON USED COLUMNS");
+		}
+		else {
 			int c = 0;
-
+			
 			for (final Property prop : internalView.getProperties()) {
 				if (!columns.containsKey(prop)) {
 					final TableViewerColumn col = new TableViewerColumn(viewer, SWT.NONE);
 					col.getColumn().setWidth(100);
 					col.getColumn().setText(prop.getName());
 					col.setLabelProvider(new ColumnLabelProvider() {
+						
 						@Override
 						public String getText(Object element) {
 							if (element instanceof Object[]) {
 								Integer idx = columnsOrder.get(col);
-								return ""+((Object[])element)[idx]; //$NON-NLS-1$
+								return "" + ((Object[]) element)[idx]; //$NON-NLS-1$
 							}
 							return TXMCoreMessages.errorColonP0;
 						}
 					});
 					columns.put(prop, col);
-
+					
 				}
 				TableViewerColumn col = columns.get(prop);
 				columnsOrder.put(col, c++);
 			}
 		}
 	}
-
-
+	
+	
 	public String createQuery() {
 		TableColumn[] cols = viewer.getTable().getColumns();
 		TableItem[] items = viewer.getTable().getItems();
 		int[] indexes = viewer.getTable().getSelectionIndices();
-		if (indexes.length == 0 ) {
+		if (indexes.length == 0) {
 			return ""; //$NON-NLS-1$
 		}
-
+		
 		StringBuffer query = new StringBuffer("["); //$NON-NLS-1$
-		for (int icol = 0 ; icol < cols.length ; icol++) {
+		for (int icol = 0; icol < cols.length; icol++) {
 			TableColumn col = cols[icol];
 			if (icol > 0) {
-				query.append(" & " +col.getText()+"=\""); //$NON-NLS-1$ //$NON-NLS-2$
+				query.append(" & " + col.getText() + "=\""); //$NON-NLS-1$ //$NON-NLS-2$
 			}
 			else {
-				query.append(col.getText()+"=\""); //$NON-NLS-1$
+				query.append(col.getText() + "=\""); //$NON-NLS-1$
 			}
 			HashSet<String> values = new HashSet<String>();
-			for (int i = 0 ; i < indexes.length ; i++) {
+			for (int i = 0; i < indexes.length; i++) {
 				int idx = indexes[i];
 				values.add(CQLQuery.addBackSlash(items[idx].getText(icol)));
 			}
@@ -298,9 +308,10 @@
 				if (firstValue) {
 					query.append(value);
 					firstValue = false;
-				} else {
-					query.append("|"+value); //$NON-NLS-1$
 				}
+				else {
+					query.append("|" + value); //$NON-NLS-1$
+				}
 			}
 			query.append("\""); //$NON-NLS-1$
 		}
@@ -308,11 +319,11 @@
 		System.out.println(NLS.bind(InternalViewUIMessages.queryColonP0, query));
 		return query.toString();
 	}
-
+	
 	public boolean backToText(Match m) {
-//		Match m = line.getMatch();
+		// Match m = line.getMatch();
 		internalView.getCurrentPage();
-		int[] cpos= {m.getStart()};
+		int[] cpos = { m.getStart() };
 		int[] n;
 		try {
 			StructuralUnitProperty sup = null;
@@ -322,16 +333,17 @@
 			}
 			n = CQPSearchEngine.getCqiClient().cpos2Struc(sup.getQualifiedName(), cpos);
 			return goToPage(n[0]);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			System.out.println(NLS.bind(InternalViewUIMessages.errorWhileInternalViewGoBackToP0, m));
 			Log.printStackTrace(e);
-		} 
+		}
 		return false;
 	}
-
-
-
-
+	
+	
+	
+	
 	@Override
 	public void updateResultFromEditor() {
 		// nothing to do
@@ -348,9 +360,9 @@
 		
 		navigation.setInfoLineText(" / " + this.getResult().getSegmentsCount()); //$NON-NLS-1$
 		navigation.refresh();
-		navigationPanel.layout();		
+		navigationPanel.layout();
 	}
-
+	
 	@Override
 	public void updateEditorFromResult(boolean update) {
 		try {
@@ -360,4 +372,4 @@
 			e.printStackTrace();
 		}
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/ComputeInternalView.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/ComputeInternalView.java	(revision 2396)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/ComputeInternalView.java	(revision 2397)
@@ -18,8 +18,8 @@
  * 
  */
 public class ComputeInternalView extends BaseAbstractHandler {
-
-
+	
+	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		
@@ -36,7 +36,7 @@
 		}
 		// Reopen an existing result
 		else if (selection instanceof InternalView) {
-			internalView = (InternalView)selection;
+			internalView = (InternalView) selection;
 		}
 		else {
 			System.out.println(InternalViewUIMessages.errorColonSelectionIsNotACorpus);
@@ -46,6 +46,6 @@
 		TXMEditor.openEditor(internalView, InternalViewEditor.class.getName());
 		return null;
 	}
-
-
-}
\ No newline at end of file
+	
+	
+}
Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/SendInternalViewTo.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/SendInternalViewTo.java	(revision 2396)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/SendInternalViewTo.java	(revision 2397)
@@ -42,17 +42,17 @@
  * 
  */
 public class SendInternalViewTo extends SendSelectionToQueryable {
-
-
+	
+	
 	@Override
 	public String createQuery(ExecutionEvent event, ISelection selection) {
 		if (selection instanceof StructuredSelection) {
-			StructuredSelection sselection = (StructuredSelection)selection;
+			StructuredSelection sselection = (StructuredSelection) selection;
 			return ((InternalViewEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart()).createQuery();
 		}
 		return null;
 	}
-
-
-
+	
+	
+	
 }
Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/BackToInternalView.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/BackToInternalView.java	(revision 2396)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/BackToInternalView.java	(revision 2397)
@@ -21,23 +21,24 @@
 import org.txm.utils.logger.Log;
 
 public class BackToInternalView {
-
+	
 	public void doit(TXMEditor<? extends TXMResult> sourceEditor, CQPCorpus corpus, Match match, List<WordProperty> props) {
 		// Last resort edition
 		try {
 			InternalView iview = new InternalView(corpus);
-			iview.setParameters(props, 
+			iview.setParameters(props,
 					corpus.getStructuralUnit(TBXPreferences.DEFAULT_STRUCTURAL_UNIT),
 					new ArrayList<StructuralUnitProperty>(), null);
-
+			
 			TXMResultEditorInput<InternalView> editorInput = new TXMResultEditorInput<InternalView>(iview);
-
+			
 			IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
-
-			InternalViewEditor editor = (InternalViewEditor)page.openEditor(editorInput,InternalViewEditor.class.getName()); //$NON-NLS-1$
+			
+			InternalViewEditor editor = (InternalViewEditor) page.openEditor(editorInput, InternalViewEditor.class.getName()); // $NON-NLS-1$
 			editor.backToText(match);
 			SWTEditorsUtils.addEditor(sourceEditor, editor, EModelService.ABOVE);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			System.err.println(InternalViewUIMessages.bind(InternalViewUIMessages.error_backto_internalview, e));
 			Log.printStackTrace(e);
 		}
Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/adapters/InternalViewAdapterFactory.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/adapters/InternalViewAdapterFactory.java	(revision 2396)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/adapters/InternalViewAdapterFactory.java	(revision 2397)
@@ -15,14 +15,14 @@
 public class InternalViewAdapterFactory extends TXMResultAdapterFactory {
 	
 	
-	public static final ImageDescriptor ICON =
-			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(InternalViewAdapterFactory.class).getSymbolicName(),
-					"platform:/plugin/"+ FrameworkUtil.getBundle(InternalViewAdapterFactory.class).getSymbolicName() + "/icons/application_form_magnify.png"); //$NON-NLS-1$ //$NON-NLS-2$
+	public static final ImageDescriptor ICON = AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(InternalViewAdapterFactory.class).getSymbolicName(),
+			"platform:/plugin/" + FrameworkUtil.getBundle(InternalViewAdapterFactory.class).getSymbolicName() + "/icons/application_form_magnify.png"); //$NON-NLS-1$ //$NON-NLS-2$
 	
 	@Override
 	public Object getAdapter(Object adaptableObject, Class adapterType) {
-		if(this.canAdapt(adapterType) && adaptableObject instanceof InternalView)	{
+		if (this.canAdapt(adapterType) && adaptableObject instanceof InternalView) {
 			return new TXMResultAdapter() {
+				
 				@Override
 				public ImageDescriptor getImageDescriptor(Object object) {
 					return ICON;
Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/messages/InternalViewUIMessages.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/messages/InternalViewUIMessages.java	(revision 2396)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/messages/InternalViewUIMessages.java	(revision 2397)
@@ -13,16 +13,18 @@
 	
 	private static final String BUNDLE_NAME = "org.txm.internalview.rcp.messages.messages"; //$NON-NLS-1$
 	
-	public static String errorColonSelectionIsNotACorpus; 
-
-	public static String navigation; 
-
-	public static String errorWhileInternalViewGoBackToP0; 
+	public static String errorColonSelectionIsNotACorpus;
 	
-	public static String queryColonP0; 
-	public static String structure; 
-	public static String structuralProperties; 
+	public static String navigation;
 	
+	public static String errorWhileInternalViewGoBackToP0;
+	
+	public static String queryColonP0;
+	
+	public static String structure;
+	
+	public static String structuralProperties;
+	
 	public static String error_backto_internalview;
 	
 	static {
Index: tmp/org.txm.concordance.rcp/.classpath
===================================================================
--- tmp/org.txm.concordance.rcp/.classpath	(revision 2396)
+++ tmp/org.txm.concordance.rcp/.classpath	(revision 2397)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.cooccurrence.rcp/.classpath
===================================================================
--- tmp/org.txm.cooccurrence.rcp/.classpath	(revision 2396)
+++ tmp/org.txm.cooccurrence.rcp/.classpath	(revision 2397)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/.classpath
===================================================================
--- tmp/org.txm.groovy.core/.classpath	(revision 2396)
+++ tmp/org.txm.groovy.core/.classpath	(revision 2397)
@@ -1,13 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="src" path="src/java"/>
-	  <classpathentry exported="true" kind="lib" path="bin/"/>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="con" path="GROOVY_DSL_SUPPORT"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="src" path="src/java" />
+	<classpathentry exported="true" kind="lib" path="bin/" />
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="con" path="GROOVY_DSL_SUPPORT" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java	(revision 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java	(revision 2397)
@@ -18,28 +18,28 @@
  *
  */
 public class InstallGroovyFiles extends PostTXMHOMEInstallationStep {
-
-	final static String createfolders[] = {"scripts/groovy/lib", "scripts/groovy/user", "scripts/groovy/system"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 	
+	final static String createfolders[] = { "scripts/groovy/lib", "scripts/groovy/user", "scripts/groovy/system" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+	
 	@Override
 	public boolean do_install(Workspace workspace) {
 		File txmhomedir = new File(Toolbox.getTxmHomePath());
 		
-//		String version = GroovyPreferences.getInstance().getString(GroovyPreferences.VERSION);
-//		
-//		boolean doInstall = false;
-//		Version installedVersion = BundleUtils.getBundleVersion("org.txm.groovy.core");
-//		if (version != null && version.length() > 0) {
-//			Version v = new Version(version);
-//			
-//			doInstall = v.compareTo(installedVersion) > 0;
-//			Log.fine("Groovy installed version: "+installedVersion+" preferenced version: "+v+" -> "+doInstall);
-//		} else {
-//			doInstall = true;
-//			GroovyPreferences.getInstance().put(GroovyPreferences.VERSION, installedVersion.toString());
-//		}
-//		
-//		if (!doInstall) return true; // nothing to do
+		// String version = GroovyPreferences.getInstance().getString(GroovyPreferences.VERSION);
+		//
+		// boolean doInstall = false;
+		// Version installedVersion = BundleUtils.getBundleVersion("org.txm.groovy.core");
+		// if (version != null && version.length() > 0) {
+		// Version v = new Version(version);
+		//
+		// doInstall = v.compareTo(installedVersion) > 0;
+		// Log.fine("Groovy installed version: "+installedVersion+" preferenced version: "+v+" -> "+doInstall);
+		// } else {
+		// doInstall = true;
+		// GroovyPreferences.getInstance().put(GroovyPreferences.VERSION, installedVersion.toString());
+		// }
+		//
+		// if (!doInstall) return true; // nothing to do
 		
 		for (String folder : createfolders) {
 			new File(txmhomedir, folder).mkdirs();
@@ -47,40 +47,40 @@
 		File scriptsDirectory = new File(txmhomedir, "scripts/groovy");
 		File userDirectory = new File(scriptsDirectory, "user");
 		File systemDirectory = new File(scriptsDirectory, "system");
-		Log.fine("Installing Groovy files to "+userDirectory);
+		Log.fine("Installing Groovy files to " + userDirectory);
 		
-//		HashMap<String, String> publishedImports = new HashMap<String, String>();
-//		String IMPORTERPACKAGE="org/txm/scriptsimporter/";
-//		publishedImports.put(IMPORTERPACKAGE+"alceste","alcesteLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"discours","discoursLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"bfm","bfmLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"frantext","frantextLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"hyperbase","hyperbaseLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"txt","txtLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"xml","xmlLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"xtz","xtzLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"factiva","factivaLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"factiva","factivamailLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"xmltxm","xmltxmLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"transcriber","transcriberLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"tmx","tmxLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"doc","docLoader.groovy");
-//		publishedImports.put(IMPORTERPACKAGE+"cqp","cqpLoader.groovy");
-//		
-//		for (String p : publishedImports.keySet()) {
-//			BundleUtils.copyFiles(bundle_id, "src/", "groovy/"+p, publishedImports.get(p), importDirectory);
-//		}
-//		
-//		// copy published macros
-//		macroDirectory.mkdirs();
-//		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "macro/", macroDirectory);
-//		
-//		// copy sample Groovy scripts
-//		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "export/", samplesDirectory);
-//		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "functions/", samplesDirectory);
-//		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "importer/", samplesDirectory);
-//		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "sw/", samplesDirectory);
-//		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "tal/", samplesDirectory);
+		// HashMap<String, String> publishedImports = new HashMap<String, String>();
+		// String IMPORTERPACKAGE="org/txm/scriptsimporter/";
+		// publishedImports.put(IMPORTERPACKAGE+"alceste","alcesteLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"discours","discoursLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"bfm","bfmLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"frantext","frantextLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"hyperbase","hyperbaseLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"txt","txtLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"xml","xmlLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"xtz","xtzLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"factiva","factivaLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"factiva","factivamailLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"xmltxm","xmltxmLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"transcriber","transcriberLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"tmx","tmxLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"doc","docLoader.groovy");
+		// publishedImports.put(IMPORTERPACKAGE+"cqp","cqpLoader.groovy");
+		//
+		// for (String p : publishedImports.keySet()) {
+		// BundleUtils.copyFiles(bundle_id, "src/", "groovy/"+p, publishedImports.get(p), importDirectory);
+		// }
+		//
+		// // copy published macros
+		// macroDirectory.mkdirs();
+		// BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "macro/", macroDirectory);
+		//
+		// // copy sample Groovy scripts
+		// BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "export/", samplesDirectory);
+		// BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "functions/", samplesDirectory);
+		// BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "importer/", samplesDirectory);
+		// BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "sw/", samplesDirectory);
+		// BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "tal/", samplesDirectory);
 		
 		String bundle_id = "org.txm.groovy.core";
 		BundleUtils.copyFiles(bundle_id, "", "src/groovy", "", userDirectory);
@@ -92,20 +92,21 @@
 		
 		try {
 			FileCopy.copyFiles(userDirectory, systemDirectory);
-			Log.fine("Copying user Groovy files to "+systemDirectory);
-		} catch (IOException e) {
+			Log.fine("Copying user Groovy files to " + systemDirectory);
+		}
+		catch (IOException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
 		
 		return scriptsDirectory.exists();
 	}
-
+	
 	@Override
 	public String getName() {
 		return "Groovy (org.txm.groovy.core)";
 	}
-
+	
 	@Override
 	public boolean needsReinstall(Workspace workspace) {
 		File txmhomedir = new File(Toolbox.getTxmHomePath());
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyProgressMonitor.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyProgressMonitor.java	(revision 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyProgressMonitor.java	(revision 2397)
@@ -3,68 +3,68 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 
 /**
- * IProgressMonitor wrapper 
+ * IProgressMonitor wrapper
  * 
  * adds some methods for Groovy scripts
  * 
  * @author mdecorde
  *
  */
-public class GroovyProgressMonitor implements IProgressMonitor{
+public class GroovyProgressMonitor implements IProgressMonitor {
 	
 	private IProgressMonitor monitor;
-
+	
 	public GroovyProgressMonitor(IProgressMonitor monitor) {
 		this.monitor = monitor;
 	}
-
+	
 	@Override
 	public void beginTask(String name, int totalWork) {
 		if (monitor == null) return;
-
+		
 		monitor.beginTask(name, totalWork);
 	}
-
+	
 	@Override
 	public void done() {
 		if (monitor == null) return;
 		monitor.done();
 	}
-
+	
 	@Override
 	public void internalWorked(double work) {
 		if (monitor == null) return;
 		monitor.internalWorked(work);
 	}
-
+	
 	@Override
 	public boolean isCanceled() {
 		if (monitor == null) return false;
 		
 		return monitor.isCanceled();
 	}
-
+	
 	@Override
 	public void setCanceled(boolean value) {
 		if (monitor == null) return;
 		
 		monitor.setCanceled(value);
 	}
-
+	
 	@Override
 	public void setTaskName(String name) {
 		if (monitor == null) return;
 		
 		monitor.setTaskName(name);
 	}
-
+	
 	@Override
 	public void subTask(String name) {
 		if (monitor == null) return;
 		
 		monitor.subTask(name);
 	}
-
+	
 	@Override
 	public void worked(int work) {
 		if (monitor == null) return;
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java	(revision 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java	(revision 2397)
@@ -32,11 +32,11 @@
 import groovy.lang.Script;
 
 public class GroovyScriptedImportEngine extends ScriptedImportEngine {
-
+	
 	File importer, compiler, pager, annotate;
 	
 	public GroovyScriptedImportEngine(File directory) {
-		super(directory.getName(), new File(directory, directory.getName()+"Loader.groovy"));
+		super(directory.getName(), new File(directory, directory.getName() + "Loader.groovy"));
 		importer = new File(directory, "importer.groovy");
 		compiler = new File(directory, "compiler.groovy");
 		pager = new File(directory, "pager.groovy");
@@ -65,115 +65,122 @@
 			
 			if (project.getDoUpdate()) {
 				// drop CorpusBuild and Editions
-//				List<? extends CorpusBuild> corpora = project.getCorpora();
-//				while (project.getCorpora().size() > 0) {
-//					CorpusBuild c = project.getCorpora().get(0);
-//					c.delete();
-//				}
-//				List<Text> texts = project.getTexts();
-//				for (Text t : texts) {
-//					while (t.getEditions().size() > 0) {
-//						Edition ed = t.getEditions().get(0);
-//						ed.delete();
-//					}
-//				}
-			} else {
+				// List<? extends CorpusBuild> corpora = project.getCorpora();
+				// while (project.getCorpora().size() > 0) {
+				// CorpusBuild c = project.getCorpora().get(0);
+				// c.delete();
+				// }
+				// List<Text> texts = project.getTexts();
+				// for (Text t : texts) {
+				// while (t.getEditions().size() > 0) {
+				// Edition ed = t.getEditions().get(0);
+				// ed.delete();
+				// }
+				// }
+			}
+			else {
 				// clear all children
 				while (project.getChildren().size() > 0) {
 					TXMResult child = project.getChildren().get(0);
 					child.delete();
 				}
 			}
-
+			
 			// the binary directory which is going to be created
-
-//			final File basedir = project.getProjectDirectory();
-//			final File tempBinDirectory = new File(basedir.getAbsolutePath()+"_temp"); //$NON-NLS-1$
-//			final File errorBinDirectory = new File(basedir.getAbsolutePath()+"_error"); //$NON-NLS-1$
-//			if (tempBinDirectory.exists()) DeleteDir.deleteDirectory(tempBinDirectory);
-//			if (errorBinDirectory.exists()) DeleteDir.deleteDirectory(errorBinDirectory);
-
-			//this.setCurrentMonitor(monitor);
+			
+			// final File basedir = project.getProjectDirectory();
+			// final File tempBinDirectory = new File(basedir.getAbsolutePath()+"_temp"); //$NON-NLS-1$
+			// final File errorBinDirectory = new File(basedir.getAbsolutePath()+"_error"); //$NON-NLS-1$
+			// if (tempBinDirectory.exists()) DeleteDir.deleteDirectory(tempBinDirectory);
+			// if (errorBinDirectory.exists()) DeleteDir.deleteDirectory(errorBinDirectory);
+			
+			// this.setCurrentMonitor(monitor);
 			monitor.beginTask("Importing sources " + project.getSrcdir(), 100); //$NON-NLS-1$
-
-			//org.txm.Toolbox.shutdownSearchEngine();
+			
+			// org.txm.Toolbox.shutdownSearchEngine();
 			monitor.worked(5);
-
+			
 			GSERunner gse = GSERunner.buildDefaultGSE();
-
+			
 			Binding binding = new Binding();
 			binding.setProperty("projectBinding", project); //$NON-NLS-1$
 			binding.setProperty("monitor", new GroovyProgressMonitor(monitor)); //$NON-NLS-1$
-
-			boolean logLevel = Log.getLevel().intValue() < Level.INFO.intValue();			
+			
+			boolean logLevel = Log.getLevel().intValue() < Level.INFO.intValue();
 			binding.setProperty("debug", logLevel); //$NON-NLS-1$
 			binding.setProperty("readyToLoad", Boolean.FALSE); //$NON-NLS-1$
-			//System.out.println("script="+script);
-
+			// System.out.println("script="+script);
+			
 			TokenizerClasses.reset();
 			if (!TokenizerClasses.loadFromProject(project.getPreferencesScope())) {
 				Log.severe("Error: failed to load tokenizer parameters");
 				monitor.done();
-//				if (basedir.exists()) basedir.renameTo(errorBinDirectory);
-//				if (tempBinDirectory.exists()) tempBinDirectory.renameTo(basedir);
+				// if (basedir.exists()) basedir.renameTo(errorBinDirectory);
+				// if (tempBinDirectory.exists()) tempBinDirectory.renameTo(basedir);
 				return Status.CANCEL_STATUS;
 			}
-
+			
 			ExecTimer.start();
 			Log.info(NLS.bind("Compiling {0} import module...", project.getImportModuleName()));
 			Script s = gse.createScript(mainScript.toURI().toURL().toString(), binding);
 			Log.info(NLS.bind(GroovyMessages.startingTheP0importModule, project.getImportModuleName()));
 			s.run(); // run the groovy import script
 			monitor.worked(90);
-
+			
 			TokenizerClasses.reset(); // restore default tokenizer classes
-
+			
 			Object ready = binding.getVariable("readyToLoad"); //$NON-NLS-1$
 			if (ready != null && ready instanceof Boolean) {
-				Boolean readyToLoad = (Boolean)ready;
-				//System.out.println("TRY TO LOAD THE BINARY CORPUS CREATED: "+basedir);
+				Boolean readyToLoad = (Boolean) ready;
+				// System.out.println("TRY TO LOAD THE BINARY CORPUS CREATED: "+basedir);
 				if (readyToLoad) {
 					
 					project.saveParameters(true);
 					
 					if (monitor != null) monitor.setTaskName(TXMCoreMessages.common_done);
 					
-//					Log.info(GroovyMessages.restartingToolboxSearchengines);
-//					Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
+					// Log.info(GroovyMessages.restartingToolboxSearchengines);
+					// Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
 					if (project.getDoUpdate()) {
 						Log.info(NLS.bind(TXMCoreMessages.corpusImportDoneInP0, ExecTimer.stop()));
-					} else {
+					}
+					else {
 						Log.info(NLS.bind(TXMCoreMessages.corpusUpdateDoneInP0, ExecTimer.stop()));
 					}
 					
-				} else {
+				}
+				else {
 					Log.fine(GroovyMessages.errorImportNotCorrectlyEndedSeeConsoleMessages);
 					
 					if (!project.getDoUpdate()) { // clear all
 						project.deleteChildren();
 					}
 					
-//					if (basedir.exists()) basedir.renameTo(errorBinDirectory);
-//					if (tempBinDirectory.exists()) tempBinDirectory.renameTo(basedir);
+					// if (basedir.exists()) basedir.renameTo(errorBinDirectory);
+					// if (tempBinDirectory.exists()) tempBinDirectory.renameTo(basedir);
 					return new Status(Status.ERROR, "org.txm.groovy.core", GroovyMessages.errorImportNotCorrectlyEndedSeeConsoleMessages);
 				}
-			} else {
+			}
+			else {
 				Log.fine(GroovyMessages.errorImportNotCorrectlyEndedSeeConsoleMessages);
 				return new Status(Status.ERROR, "org.txm.groovy.core", GroovyMessages.errorImportNotCorrectlyEndedSeeConsoleMessages);
 			}
-		} catch (ThreadDeath td) {
+		}
+		catch (ThreadDeath td) {
 			return Status.CANCEL_STATUS;
-		} catch (Exception e) {
-			//System.out.println(NLS.bind(TXMUIMessages.errorWhileRunningScriptColonP0, e));
+		}
+		catch (Exception e) {
+			// System.out.println(NLS.bind(TXMUIMessages.errorWhileRunningScriptColonP0, e));
 			Log.printStackTrace(e);
 			return new Status(Status.ERROR, "org.txm.groovy.core", e.getMessage());
-		} finally {
-//			if (!CQPSearchEngine.isInitialized()) { // the import failed
-//				monitor.setTaskName(GroovyMessages.restartingToolboxSearchengines); //$NON-NLS-1$
-//				Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
-//			}
 		}
+		finally {
+			// if (!CQPSearchEngine.isInitialized()) { // the import failed
+			// monitor.setTaskName(GroovyMessages.restartingToolboxSearchengines); //$NON-NLS-1$
+			// Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
+			// }
+		}
 		System.gc();
 		return Status.OK_STATUS;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/TXMClassLoader.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/TXMClassLoader.java	(revision 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/TXMClassLoader.java	(revision 2397)
@@ -12,42 +12,47 @@
  *
  */
 public class TXMClassLoader extends ClassLoader {
+	
 	private HashSet<ClassLoader> loaders;
-
+	
 	public TXMClassLoader(HashSet<ClassLoader> loaders2) {
-		this.loaders  = loaders2;
+		this.loaders = loaders2;
 	}
 	
 	@Override
-    public Class findClass(String name) throws ClassNotFoundException {
-    	
-		 // try with the System class loader
-    	try {
-    		return this.getClass().getClassLoader().loadClass(name);
-    	} catch(Exception e) {}
-    	
-        for (ClassLoader cl : loaders) {
-        	
-        	// FIXME: SJ: tests to speed up this very long process        	
-//        	if(cl instanceof EquinoxClassLoader)	{
-//        		EquinoxClassLoader ecl = (EquinoxClassLoader) cl;
-//        		
-//            	//Log.finest("TXMClassLoader.findClass(): looking for class " + name + " in bundle " + ecl.getBundle().getSymbolicName());
-//
-//            	// FIXME: trying to skip Bundle where Bundle id not matching the class package
-//            	String pack = name.split("\\$")[0];
-//            	if(!ecl.getBundle().getSymbolicName().startsWith(pack))	{
-//                	// FIXME: SJ: for debugging to speed up the process
-//                	//Log.finest("TXMClassLoader.findClass(): skipping bundle " + ecl.getBundle().getSymbolicName() + " for class starting with " + pack);
-//            		continue;
-//            	}
-//        	}
-//        	
-
-        	try {
-        		return cl.loadClass(name);
-        	} catch(Exception e) {}
-        }
-        throw new ClassNotFoundException(name);
-    }
+	public Class findClass(String name) throws ClassNotFoundException {
+		
+		// try with the System class loader
+		try {
+			return this.getClass().getClassLoader().loadClass(name);
+		}
+		catch (Exception e) {
+		}
+		
+		for (ClassLoader cl : loaders) {
+			
+			// FIXME: SJ: tests to speed up this very long process
+			// if(cl instanceof EquinoxClassLoader) {
+			// EquinoxClassLoader ecl = (EquinoxClassLoader) cl;
+			//
+			// //Log.finest("TXMClassLoader.findClass(): looking for class " + name + " in bundle " + ecl.getBundle().getSymbolicName());
+			//
+			// // FIXME: trying to skip Bundle where Bundle id not matching the class package
+			// String pack = name.split("\\$")[0];
+			// if(!ecl.getBundle().getSymbolicName().startsWith(pack)) {
+			// // FIXME: SJ: for debugging to speed up the process
+			// //Log.finest("TXMClassLoader.findClass(): skipping bundle " + ecl.getBundle().getSymbolicName() + " for class starting with " + pack);
+			// continue;
+			// }
+			// }
+			//
+			
+			try {
+				return cl.loadClass(name);
+			}
+			catch (Exception e) {
+			}
+		}
+		throw new ClassNotFoundException(name);
+	}
 }
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyImportEngine.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyImportEngine.java	(revision 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyImportEngine.java	(revision 2397)
@@ -13,12 +13,12 @@
 import org.txm.utils.io.IOUtils;
 
 public class GroovyImportEngine extends ImportEngine {
-
+	
 	@Override
 	public boolean isRunning() {
 		return false;
 	}
-
+	
 	@Override
 	public boolean initialize() throws Exception {
 		
@@ -32,36 +32,37 @@
 			if (!dir.isDirectory()) continue;
 			
 			String name = dir.getName();
-			File loader = new File(dir, name+"Loader.groovy");
+			File loader = new File(dir, name + "Loader.groovy");
 			if (loader.exists()) {
 				ScriptedImportEngine sengine = new GroovyScriptedImportEngine(dir);
 				if (engines.getEngine(name) == null) {
 					engines.put(name, sengine);
-				} else {
-					System.out.println("Scripted import module in "+dir+" not registered since one with the same name is registered.");
 				}
+				else {
+					System.out.println("Scripted import module in " + dir + " not registered since one with the same name is registered.");
+				}
 			}
 		}
 		return true;
 	}
-
+	
 	@Override
 	public boolean start(IProgressMonitor monitor) throws Exception {
 		// TODO Auto-generated method stub
 		return true;
 	}
-
+	
 	@Override
 	public boolean stop() throws Exception {
 		// TODO Auto-generated method stub
 		return true;
 	}
-
+	
 	@Override
 	public String getName() {
 		return "groovy scripted imports installers - not meant to be used";
 	}
-
+	
 	@Override
 	public IStatus build(Project project, IProgressMonitor monitor) {
 		return Status.CANCEL_STATUS;
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyPreferences.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyPreferences.java	(revision 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyPreferences.java	(revision 2397)
@@ -1,17 +1,19 @@
 package org.txm.groovy.core;
+
 import org.txm.core.preferences.TXMPreferences;
 
 public class GroovyPreferences extends TXMPreferences {
 	
-	public static final String PREFERENCES_NODE = GroovyPreferences.class.getName();//FrameworkUtil.getBundle(RPreferences.class).getSymbolicName();
-
+	public static final String PREFERENCES_NODE = GroovyPreferences.class.getName();// FrameworkUtil.getBundle(RPreferences.class).getSymbolicName();
+	
 	public static final String VERSION = "version";
 	
 	/**
 	 * Gets the instance.
+	 * 
 	 * @return the instance
 	 */
-	public static TXMPreferences getInstance()	{
+	public static TXMPreferences getInstance() {
 		if (!TXMPreferences.instances.containsKey(GroovyPreferences.class)) {
 			new GroovyPreferences();
 		}
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/messages/GroovyMessages.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/messages/GroovyMessages.java	(revision 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/messages/GroovyMessages.java	(revision 2397)
@@ -8,10 +8,13 @@
 	private static final String BUNDLE_NAME = "org.txm.groovy.core.messages.messages"; //$NON-NLS-1$
 	
 	public static String restartingToolboxSearchengines;
+	
 	public static String startingTheP0GroovyImportScript;
+	
 	public static String errorImportNotCorrectlyEndedSeeConsoleMessages;
+	
 	public static String errorTreeTaggerAnnotationEngineIsNotReady;
-
+	
 	public static String startingTheP0importModule;
 	
 	static {
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 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java	(revision 2397)
@@ -42,6 +42,7 @@
 	}
 	
 	protected static GSERunner defaultGSE;
+	
 	protected static File defaultScriptRootDir;
 	
 	public static void clearDefaultGSE() {
@@ -60,34 +61,35 @@
 		File rootDir = new File(Toolbox.getTxmHomePath(), "scripts/groovy/");
 		// check if script root dir was changed
 		if (defaultScriptRootDir != null && defaultScriptRootDir.equals(rootDir) && defaultGSE != null) {
-			//			try {
-			//				defaultGSE.getGroovyClassLoader().addURL(rootDir.toURI().toURL());
-			//			} catch (MalformedURLException e) {
-			//				// TODO Auto-generated catch block
-			//				e.printStackTrace();
-			//			}
+			// try {
+			// defaultGSE.getGroovyClassLoader().addURL(rootDir.toURI().toURL());
+			// } catch (MalformedURLException e) {
+			// // TODO Auto-generated catch block
+			// e.printStackTrace();
+			// }
 			return defaultGSE;
 		}
 		
-		String[] roots = new String[] { 
-				rootDir.getAbsolutePath()+"/user/", //$NON-NLS-1$
-				//rootDir.getAbsolutePath()+"/system/", //$NON-NLS-1$
-		}; 
-		
+		String[] roots = new String[] {
+				rootDir.getAbsolutePath() + "/user/", //$NON-NLS-1$
+				// rootDir.getAbsolutePath()+"/system/", //$NON-NLS-1$
+		};
+				
 		try {
 			defaultScriptRootDir = rootDir;
-			Log.fine("GSE roots: "+Arrays.toString(roots));
+			Log.fine("GSE roots: " + Arrays.toString(roots));
 			defaultGSE = new GSERunner(roots);
-		} catch (IOException e) {
+		}
+		catch (IOException e) {
 			e.printStackTrace();
 			return null;
 		}
 		
 		ImportCustomizer imports = new ImportCustomizer();
-		imports.addStarImports("org.txm.rcp.utils", 
-				"org.txm.utils", 
-				"org.txm", 
-				"org.kohsuke.args4j", 
+		imports.addStarImports("org.txm.rcp.utils",
+				"org.txm.utils",
+				"org.txm",
+				"org.kohsuke.args4j",
 				"org.txm.rcp.swt.widget.parameters");
 		imports.addImports("groovy.transform.Field");
 		CompilerConfiguration configuration = new CompilerConfiguration();
@@ -99,40 +101,42 @@
 		try {
 			defaultGSE.getGroovyClassLoader().addClasspath(jardir.getAbsolutePath());
 			defaultGSE.getGroovyClassLoader().addURL(jardir.toURI().toURL());
-		} catch (MalformedURLException e) {
+		}
+		catch (MalformedURLException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
 		
 		if (jardir.exists() && jardir.isDirectory()) {
-			for (File f: jardir.listFiles(new FilenameFilter() {
+			for (File f : jardir.listFiles(new FilenameFilter() {
+				
 				@Override
 				public boolean accept(File dir, String name) {
 					return name.endsWith(".jar") || name.endsWith(".so") || name.endsWith(".dylib") || name.endsWith(".dll"); //$NON-NLS-1$
 				}
-			}))
-			{
+			})) {
 				try {
 					defaultGSE.getGroovyClassLoader().addURL(f.toURI().toURL());
-				} catch (MalformedURLException e) {
+				}
+				catch (MalformedURLException e) {
 					// TODO Auto-generated catch block
 					e.printStackTrace();
 				}
 			}
-		}	
+		}
 		defaultGSE.getGroovyClassLoader().addClasspath(rootDir.getAbsolutePath()); // for the .class files if any
 		
 		return defaultGSE;
 	}
 	
 	public static void getDependancies(String bundle, HashSet<String> defaultPlugins) {
-		//if (defaultPlugins.contains(bundle)) return;
+		// if (defaultPlugins.contains(bundle)) return;
 		
 		Bundle rcpBundle = BundleUtils.getBundle(bundle);
 		if (rcpBundle == null) return;
 		String dependanciesString = rcpBundle.getHeaders().get("Require-Bundle");
 		if (dependanciesString == null) return;
-		//System.out.println("Require-Bundle: "+dependanciesString);
+		// System.out.println("Require-Bundle: "+dependanciesString);
 		for (String dependancy : dependanciesString.split(",")) {
 			String name = dependancy.split(";", 2)[0];
 			defaultPlugins.add(name);
@@ -148,16 +152,16 @@
 		HashSet<ClassLoader> loaders = new HashSet<ClassLoader>();
 		BundleContext bundleContext = InternalPlatform.getDefault().getBundleContext();
 		Bundle[] bundles = bundleContext.getBundles();
-		//		java.util.Arrays.sort(bundles, new Comparator<Bundle>() {
+		// java.util.Arrays.sort(bundles, new Comparator<Bundle>() {
 		//
-		//			@Override
-		//			public int compare(Bundle o1, Bundle o2) {
-		//				if (o1.getSymbolicName().startsWith("org.txm")) return 1;
-		//				return -1;
-		//			}
-		//		});
+		// @Override
+		// public int compare(Bundle o1, Bundle o2) {
+		// if (o1.getSymbolicName().startsWith("org.txm")) return 1;
+		// return -1;
+		// }
+		// });
 		HashSet<String> defaultPlugins = new HashSet<String>();
-		//getDependancies("org.txm.rcp", defaultPlugins);
+		// getDependancies("org.txm.rcp", defaultPlugins);
 		
 		for (Bundle b : bundles) {
 			if (b == null) continue;
@@ -167,18 +171,20 @@
 			
 			BundleWiring bundleWiring = b.adapt(BundleWiring.class);
 			if (bundleWiring == null) {
-				//System.out.println("GSERunner.createGSERunner(): NO wiring: " + b.getSymbolicName());
-			} else if (bundleWiring.getClassLoader() != null) {
+				// System.out.println("GSERunner.createGSERunner(): NO wiring: " + b.getSymbolicName());
+			}
+			else if (bundleWiring.getClassLoader() != null) {
 				loaders.add(bundleWiring.getClassLoader());
-				//FIXME: debug
-				//System.out.println("GSERunner.createGSERunner(): ADD class loader: " + b.getSymbolicName());
-			} else {
-				//System.out.println("GSERunner.createGSERunner(): NO  class loader: " + b.getSymbolicName());
+				// FIXME: debug
+				// System.out.println("GSERunner.createGSERunner(): ADD class loader: " + b.getSymbolicName());
 			}
+			else {
+				// System.out.println("GSERunner.createGSERunner(): NO class loader: " + b.getSymbolicName());
+			}
 		}
 		
 		Log.fine("Initializing TXMClassLoader with " + loaders.size() + " bundles.");
-		//for (ClassLoader l : loaders) System.out.println(l);
+		// for (ClassLoader l : loaders) System.out.println(l);
 		return new TXMClassLoader(loaders);
 	}
 	
@@ -189,7 +195,7 @@
 	 * @param clazz
 	 * @param args
 	 * @return
-	 * @throws MalformedURLException 
+	 * @throws MalformedURLException
 	 * @throws ResourceException
 	 * @throws ScriptException
 	 */
@@ -210,7 +216,7 @@
 	 */
 	@SuppressWarnings("rawtypes")
 	public Object run(Class clazz, Map args) throws ResourceException, ScriptException {
-		return run(clazz.getCanonicalName().replace(".", "/")+".groovy", new Binding(args));
+		return run(clazz.getCanonicalName().replace(".", "/") + ".groovy", new Binding(args));
 	}
 	
 	/**
@@ -231,18 +237,17 @@
 		
 		// Find the Groovy Script
 		/*
-Binding binding = null;
-if (bean instanceof groovy.lang.Script) {
-			groovy.lang.Script script = (groovy.lang.Script) bean;
-
-			// if the "args" variable exists then use its values. Can be used to set a default value by another Macro
-			if (script.getBinding().hasVariable("args")) {
-				oArgs = script.getBinding().getVariable("args"); //$NON-NLS-1$
-			}
-		}
+		 * Binding binding = null;
+		 * if (bean instanceof groovy.lang.Script) {
+		 * groovy.lang.Script script = (groovy.lang.Script) bean;
+		 * // if the "args" variable exists then use its values. Can be used to set a default value by another Macro
+		 * if (script.getBinding().hasVariable("args")) {
+		 * oArgs = script.getBinding().getVariable("args"); //$NON-NLS-1$
+		 * }
+		 * }
 		 */
 		
-		return run(clazz.getCanonicalName().replace(".", "/")+".groovy", new Binding(arrangedMap));
+		return run(clazz.getCanonicalName().replace(".", "/") + ".groovy", new Binding(arrangedMap));
 	}
 	
 	/**
@@ -259,25 +264,25 @@
 	public Object runMacro(Class clazz) throws ResourceException, ScriptException {
 		HashMap<String, Object> arrangedMap = new HashMap<String, Object>();
 		arrangedMap.put("args", new HashMap<String, Object>());
-		return run(clazz.getCanonicalName().replace(".", "/")+".groovy", new Binding(arrangedMap));
+		return run(clazz.getCanonicalName().replace(".", "/") + ".groovy", new Binding(arrangedMap));
 	}
 	
-	////TODO ScriptCacheEntry is a private class...
-//	public boolean needToRecompile(String scriptName) throws ResourceException, ScriptException {
-//		
-//		URLConnection conn = this.getResourceConnection(scriptName);
-//		String path = conn.getURL().toExternalForm();
-//		ScriptCacheEntry entry = null;
-//		Class clazz = null;
-//		if (entry != null) clazz = entry.scriptClass;
-//		try {
-//			return isSourceNewer(entry);
-//				
-//			}
-//			catch(Exception e) {
-//				
-//			}
-//			
-//		}
-//	}
-}
\ No newline at end of file
+	//// TODO ScriptCacheEntry is a private class...
+	// public boolean needToRecompile(String scriptName) throws ResourceException, ScriptException {
+	//
+	// URLConnection conn = this.getResourceConnection(scriptName);
+	// String path = conn.getURL().toExternalForm();
+	// ScriptCacheEntry entry = null;
+	// Class clazz = null;
+	// if (entry != null) clazz = entry.scriptClass;
+	// try {
+	// return isSourceNewer(entry);
+	//
+	// }
+	// catch(Exception e) {
+	//
+	// }
+	//
+	// }
+	// }
+}
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/TXMGroovyScriptEngine.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/TXMGroovyScriptEngine.java	(revision 2396)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/TXMGroovyScriptEngine.java	(revision 2397)
@@ -9,32 +9,32 @@
 import org.txm.core.engines.ScriptEngine;
 
 public class TXMGroovyScriptEngine extends ScriptEngine {
-
+	
 	public TXMGroovyScriptEngine() {
 		super("groovy");
 	}
-
+	
 	@Override
 	public boolean isRunning() {
 		return GSERunner.defaultGSE != null;
 	}
-
+	
 	@Override
 	public boolean initialize() throws Exception {
 		return GSERunner.buildDefaultGSE() != null;
 	}
-
+	
 	@Override
 	public boolean start(IProgressMonitor monitor) throws Exception {
 		return true;
 	}
-
+	
 	@Override
 	public boolean stop() throws Exception {
 		GSERunner.clearDefaultGSE();
 		return true;
 	}
-
+	
 	@Override
 	public IStatus executeScript(File script, HashMap<String, Object> env) {
 		return Status.CANCEL_STATUS;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/svn/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/svn/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/svn/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Contains Groovy scripts used to manipulate SVN repositories</p>
+	<p>Contains Groovy scripts used to manipulate SVN repositories</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/BuildXmlLiturgie/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/BuildXmlLiturgie/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/BuildXmlLiturgie/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter to transform the "Liturgie" XML files</p>
+	<p>Deprecated package: Filter to transform the "Liturgie" XML files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenWords/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenWords/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenWords/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter of the BFM tokenizer</p>
+	<p>Deprecated package: Filter of the BFM tokenizer</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenTags/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenTags/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenTags/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter of the BFM tokenizer</p>
+	<p>Deprecated package: Filter of the BFM tokenizer</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/eliminateNAttributes/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/eliminateNAttributes/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/eliminateNAttributes/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter to remove attributes of XML-TEI files</p>
+	<p>Deprecated package: Filter to remove attributes of XML-TEI files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/MinimalFilter/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/MinimalFilter/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/MinimalFilter/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Sample Filter</p>
+	<p>Deprecated package: Sample Filter</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneTagPerLine/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneTagPerLine/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneTagPerLine/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter to prepare the BFM tokenizer files</p>
+	<p>Deprecated package: Filter to prepare the BFM tokenizer files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Main filter of the BFM tokenizer</p>
+	<p>Main filter of the BFM tokenizer</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/test.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/test.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/test.xml	(revision 2397)
@@ -1,14 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<text><!--Fichier XML de test du tokenizer XML de TXM. Chaque div contient un cas particulier que le tokenizer doit gérer-->
-    <div id="ignore element"></div>
-    <div id="delete element"></div>    
-    <div id="delete element and its content"></div>
-    <div id="replace newlines with spaces"></div>
-    <div id="delete Ctrl (C class) characters"></div>
-    <div id="split using whitespaces regexp"></div>
-    <div id="fclitics"></div>
-    <div id="elision"></div>
-    <div id="..."></div>
-    <div id="punct"></div>
-    <div id="other things"></div>
+<text><!--Fichier XML de test du tokenizer XML de TXM. Chaque div contient 
+		un cas particulier que le tokenizer doit gérer -->
+	<div id="ignore element"></div>
+	<div id="delete element"></div>
+	<div id="delete element and its content"></div>
+	<div id="replace newlines with spaces"></div>
+	<div id="delete Ctrl (C class) characters"></div>
+	<div id="split using whitespaces regexp"></div>
+	<div id="fclitics"></div>
+	<div id="elision"></div>
+	<div id="..."></div>
+	<div id="punct"></div>
+	<div id="other things"></div>
 </text>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/CutHeader/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/CutHeader/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/CutHeader/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter to cut TEIHeader of XML-TEI files</p>
+	<p>Deprecated package: Filter to cut TEIHeader of XML-TEI files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/EliminateWhiteSpaces/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/EliminateWhiteSpaces/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/EliminateWhiteSpaces/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Deprecated package: Filter to eliminate whitespace in the BFM tokenizer</p>
+	<p>Deprecated package: Filter to eliminate whitespace in the BFM
+		tokenizer</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/FusionXmlHeaderBody/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/FusionXmlHeaderBody/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/FusionXmlHeaderBody/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Deprecated package: Filter to restore the XML-TEI header of XML-TEI files</p>
+	<p>Deprecated package: Filter to restore the XML-TEI header of
+		XML-TEI files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/FusionHeader/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/FusionHeader/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/FusionHeader/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Deprecated package: Filter to restore the XML-TEI header of XML-TEI files</p>
+	<p>Deprecated package: Filter to restore the XML-TEI header of
+		XML-TEI files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessEnclitics/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessEnclitics/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessEnclitics/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Deprecated package: Filter to process enclitics in the BFM tokenizer</p>
+	<p>Deprecated package: Filter to process enclitics in the BFM
+		tokenizer</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneOpenTagPerLine/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneOpenTagPerLine/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneOpenTagPerLine/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter to prepare the BFM tokenizer files</p>
+	<p>Deprecated package: Filter to prepare the BFM tokenizer files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessQuotes/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessQuotes/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessQuotes/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Deprecated package: Filter to process quotes in the BFM tokenizer</p>
+	<p>Deprecated package: Filter to process quotes in the BFM
+		tokenizer</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Concatenator/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Concatenator/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Concatenator/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter to concat 2 files</p>
+	<p>Deprecated package: Filter to concat 2 files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/RegexFilter/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/RegexFilter/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/RegexFilter/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Deprecated package: Filter to select lines with a regular expression</p>
+	<p>Deprecated package: Filter to select lines with a regular
+		expression</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/WordInternalElement/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/WordInternalElement/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/WordInternalElement/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package: Filter of the BFM tokenizer</p>
+	<p>Deprecated package: Filter of the BFM tokenizer</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Deprecated package:  BFM sentencer</p>
+	<p>Deprecated package: BFM sentencer</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/export/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/export/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/export/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>export scripts from TXM's format to xxxx's format</p>
+	<p>export scripts from TXM's format to xxxx's format</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/ant/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/ant/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/ant/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Contains prototypes of Ant Groovy scripts</p>
+	<p>Contains prototypes of Ant Groovy scripts</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/prototypes/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/prototypes/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/prototypes/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Scripts to test the platform. All theses scripts can be executed in TXM too</p>
+	<p>Scripts to test the platform. All theses scripts can be executed
+		in TXM too</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/swb/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/swb/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/swb/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Contains Groovy scripts that will be included in the Source Workbench</p>
+	<p>Contains Groovy scripts that will be included in the Source
+		Workbench</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Contains various Groovy scripts not yet classified</p>
+	<p>Contains various Groovy scripts not yet classified</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/diff-wrapper-definition.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/diff-wrapper-definition.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/diff-wrapper-definition.xml	(revision 2397)
@@ -1,19 +1,31 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<application name="Diff" version="0.0.0" desc="Diff src and target">
+<application name="Diff" version="0.0.0"
+	desc="Diff src and target">
 	<progs>
 		<prog exec="diff" version="0.0.0" desc="Diff">
 			<args>
-				<arg prefix="-" name="nb" type="int" state="optional" desc="number of context lines"/>
-				<arg prefix="-" name="a" type="none" state="optional" desc="process files as text files"/>
-				<arg prefix="-" name="b" type="none" state="optional" desc="don't check whitespaces"/>
-				<arg prefix="-" name="B" type="none" state="optional" desc="don't check empty lines"/>
-				<arg prefix="-" name="c" type="none" state="optional" desc="Utiliser le format de sortie contextuel."/>
-				<arg prefix="-" name="C" type="int" state="optional" desc="number of line displayed."/>
-				<arg prefix="-" name="d" type="none" state="optional" desc="makes diff slower but change the algorithm to find more small differences"/>
-				<arg prefix="-" name="D" type="String" state="optional" desc="outfile of the merged texts"/>
-				<arg prefix="-" name="e" type="none" state="optional" desc="valid output for ed."/>
-				<arg prefix="" name="source" type="String" state="must" desc="the source file"/>
-				<arg prefix="" name="target" type="String" state="must" desc="the target file"/>
+				<arg prefix="-" name="nb" type="int" state="optional"
+					desc="number of context lines" />
+				<arg prefix="-" name="a" type="none" state="optional"
+					desc="process files as text files" />
+				<arg prefix="-" name="b" type="none" state="optional"
+					desc="don't check whitespaces" />
+				<arg prefix="-" name="B" type="none" state="optional"
+					desc="don't check empty lines" />
+				<arg prefix="-" name="c" type="none" state="optional"
+					desc="Utiliser le format de sortie contextuel." />
+				<arg prefix="-" name="C" type="int" state="optional"
+					desc="number of line displayed." />
+				<arg prefix="-" name="d" type="none" state="optional"
+					desc="makes diff slower but change the algorithm to find more small differences" />
+				<arg prefix="-" name="D" type="String" state="optional"
+					desc="outfile of the merged texts" />
+				<arg prefix="-" name="e" type="none" state="optional"
+					desc="valid output for ed." />
+				<arg prefix="" name="source" type="String" state="must"
+					desc="the source file" />
+				<arg prefix="" name="target" type="String" state="must"
+					desc="the target file" />
 			</args>
 		</prog>
 	</progs>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/sh-wrapper-definition.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/sh-wrapper-definition.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/sh-wrapper-definition.xml	(revision 2397)
@@ -2,12 +2,14 @@
 	<progs>
 		<prog exec="sh.exe" version="0.0.0" desc="Sh">
 			<args>
-				<arg state="optional" type="String" name="c" desc="execute command line in argument"/>
+				<arg state="optional" type="String" name="c"
+					desc="execute command line in argument" />
 			</args>
 		</prog>
 		<prog exec="sh" version="0.0.0" desc="Sh">
 			<args>
-				<arg state="optional" type="String" name="c" desc="execute command line in argument"/>
+				<arg state="optional" type="String" name="c"
+					desc="execute command line in argument" />
 			</args>
 		</prog>
 	</progs>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Contains various Groovy scripts generated with the CLIX module</p>
+	<p>Contains various Groovy scripts generated with the CLIX module</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/cwb-decode-wrapper-definition.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/cwb-decode-wrapper-definition.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/cwb-decode-wrapper-definition.xml	(revision 2397)
@@ -1,50 +1,85 @@
 <?xml version="1.0"?>
-<application name="CwbDecode" version="0.0.0" desc="Decode CWB indexes">
+<application name="CwbDecode" version="0.0.0"
+	desc="Decode CWB indexes">
 	<progs>
 		<prog exec="cwb-decode.exe" version="0.0.0" desc="Decode">
 			<args>
-				<arg state="optional" type="none" name="L" desc="Lisp output mode"/>
-				<arg state="optional" type="none" name="H" desc="concordance line ('horizonta'l) output mode"/>
-				<arg state="optional" type="none" name="C" desc="compact output mode (suitable for encode)"/>
-				<arg state="optional" type="none" name="Cx" desc="XML-compatible compact output (for {encode -x ...}))"/>
-				<arg state="optional" type="none" name="X" desc="XML output mode"/>
-				<arg state="optional" type="none" name="n" desc="show corpus position ('numbers')"/>
-				<arg state="optional" type="int" name="s" desc="first token to print (at corpus position {n})"/>
-				<arg state="optional" type="int" name="e" desc="last token to print (at corpus position {n})"/>
-				<arg state="optional" type="String" name="r" desc="set registry directory"/>
-				<arg state="optional" type="none" name="p" desc="matchlist mode (input from stdin)"/>
-				<arg state="optional" type="String" name="f" desc="matchlist mode (input from {file})"/>
-				<arg state="must" type="String" name="corpus" desc="corpus name"/>
-				<arg state="optional" type="none" name="h" desc="this help page"/>
-				<arg state="multiple" type="String" name="P" desc="print p-attribute {att}"/>
-				<arg state="multiple" type="String" name="S" desc="print s-attribute {att} (possibly including annotations)"/>
-				<arg state="multiple" type="String" name="V" desc="show s-attribute annotation for each range in matchlist mode"/>
-				<arg state="multiple" type="String" name="A" desc="print alignment attribute {att}"/>
-				<arg state="optional" type="none" name="ALL" desc="print all p-attributes and s-attributes"/>
-				<arg state="optional" type="String" name="c" desc="expand ranges to full {att} region (matchlist mode)"/>
+				<arg state="optional" type="none" name="L"
+					desc="Lisp output mode" />
+				<arg state="optional" type="none" name="H"
+					desc="concordance line ('horizonta'l) output mode" />
+				<arg state="optional" type="none" name="C"
+					desc="compact output mode (suitable for encode)" />
+				<arg state="optional" type="none" name="Cx"
+					desc="XML-compatible compact output (for {encode -x ...}))" />
+				<arg state="optional" type="none" name="X"
+					desc="XML output mode" />
+				<arg state="optional" type="none" name="n"
+					desc="show corpus position ('numbers')" />
+				<arg state="optional" type="int" name="s"
+					desc="first token to print (at corpus position {n})" />
+				<arg state="optional" type="int" name="e"
+					desc="last token to print (at corpus position {n})" />
+				<arg state="optional" type="String" name="r"
+					desc="set registry directory" />
+				<arg state="optional" type="none" name="p"
+					desc="matchlist mode (input from stdin)" />
+				<arg state="optional" type="String" name="f"
+					desc="matchlist mode (input from {file})" />
+				<arg state="must" type="String" name="corpus" desc="corpus name" />
+				<arg state="optional" type="none" name="h" desc="this help page" />
+				<arg state="multiple" type="String" name="P"
+					desc="print p-attribute {att}" />
+				<arg state="multiple" type="String" name="S"
+					desc="print s-attribute {att} (possibly including annotations)" />
+				<arg state="multiple" type="String" name="V"
+					desc="show s-attribute annotation for each range in matchlist mode" />
+				<arg state="multiple" type="String" name="A"
+					desc="print alignment attribute {att}" />
+				<arg state="optional" type="none" name="ALL"
+					desc="print all p-attributes and s-attributes" />
+				<arg state="optional" type="String" name="c"
+					desc="expand ranges to full {att} region (matchlist mode)" />
 			</args>
 		</prog>
 		<prog exec="cwb-decode" version="0.0.0" desc="Decode">
 			<args>
-				<arg state="optional" type="none" name="L" desc="Lisp output mode"/>
-				<arg state="optional" type="none" name="H" desc="concordance line ('horizonta'l) output mode"/>
-				<arg state="optional" type="none" name="C" desc="compact output mode (suitable for encode)"/>
-				<arg state="optional" type="none" name="Cx" desc="XML-compatible compact output (for {encode -x ...}))"/>
-				<arg state="optional" type="none" name="X" desc="XML output mode"/>
-				<arg state="optional" type="none" name="n" desc="show corpus position ('numbers')"/>
-				<arg state="optional" type="int" name="s" desc="first token to print (at corpus position {n})"/>
-				<arg state="optional" type="int" name="e" desc="last token to print (at corpus position {n})"/>
-				<arg state="optional" type="String" name="r" desc="set registry directory"/>
-				<arg state="optional" type="none" name="p" desc="matchlist mode (input from stdin)"/>
-				<arg state="optional" type="String" name="f" desc="matchlist mode (input from {file})"/>
-				<arg state="must" type="String" name="corpus" desc="corpus name"/>
-				<arg state="optional" type="none" name="h" desc="this help page"/>
-				<arg state="multiple" type="String" name="P" desc="print p-attribute {att}"/>
-				<arg state="multiple" type="String" name="S" desc="print s-attribute {att} (possibly including annotations)"/>
-				<arg state="multiple" type="String" name="V" desc="show s-attribute annotation for each range in matchlist mode"/>
-				<arg state="multiple" type="String" name="A" desc="print alignment attribute {att}"/>
-				<arg state="optional" type="none" name="ALL" desc="print all p-attributes and s-attributes"/>
-				<arg state="optional" type="String" name="c" desc="expand ranges to full {att} region (matchlist mode)"/>
+				<arg state="optional" type="none" name="L"
+					desc="Lisp output mode" />
+				<arg state="optional" type="none" name="H"
+					desc="concordance line ('horizonta'l) output mode" />
+				<arg state="optional" type="none" name="C"
+					desc="compact output mode (suitable for encode)" />
+				<arg state="optional" type="none" name="Cx"
+					desc="XML-compatible compact output (for {encode -x ...}))" />
+				<arg state="optional" type="none" name="X"
+					desc="XML output mode" />
+				<arg state="optional" type="none" name="n"
+					desc="show corpus position ('numbers')" />
+				<arg state="optional" type="int" name="s"
+					desc="first token to print (at corpus position {n})" />
+				<arg state="optional" type="int" name="e"
+					desc="last token to print (at corpus position {n})" />
+				<arg state="optional" type="String" name="r"
+					desc="set registry directory" />
+				<arg state="optional" type="none" name="p"
+					desc="matchlist mode (input from stdin)" />
+				<arg state="optional" type="String" name="f"
+					desc="matchlist mode (input from {file})" />
+				<arg state="must" type="String" name="corpus" desc="corpus name" />
+				<arg state="optional" type="none" name="h" desc="this help page" />
+				<arg state="multiple" type="String" name="P"
+					desc="print p-attribute {att}" />
+				<arg state="multiple" type="String" name="S"
+					desc="print s-attribute {att} (possibly including annotations)" />
+				<arg state="multiple" type="String" name="V"
+					desc="show s-attribute annotation for each range in matchlist mode" />
+				<arg state="multiple" type="String" name="A"
+					desc="print alignment attribute {att}" />
+				<arg state="optional" type="none" name="ALL"
+					desc="print all p-attributes and s-attributes" />
+				<arg state="optional" type="String" name="c"
+					desc="expand ranges to full {att} region (matchlist mode)" />
 			</args>
 		</prog>
 	</progs>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/ls-wrapper-definition.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/ls-wrapper-definition.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/ls-wrapper-definition.xml	(revision 2397)
@@ -3,10 +3,13 @@
 	<progs>
 		<prog exec="ls" version="0.0.0" desc="Ls">
 			<args>
-				<arg prefix="-" name="l" type="none" state="optional" desc="use a long listing format"/>
-				<arg prefix="-" name="a" type="none" state="optional" desc="do not ignore entries starting with '.'"/>
-				<arg prefix="-" name="d" type="String" state="optional" desc="list directory entries instead of contents"/>
-				
+				<arg prefix="-" name="l" type="none" state="optional"
+					desc="use a long listing format" />
+				<arg prefix="-" name="a" type="none" state="optional"
+					desc="do not ignore entries starting with '.'" />
+				<arg prefix="-" name="d" type="String" state="optional"
+					desc="list directory entries instead of contents" />
+
 			</args>
 		</prog>
 	</progs>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/xmlstarlet-wrapper-definition.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/xmlstarlet-wrapper-definition.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/xmlstarlet-wrapper-definition.xml	(revision 2397)
@@ -1,24 +1,41 @@
 <!-- TO BE FINISHED, WORK IN PROGRESS : SLH 2010-04-10 -->
-<application name="XMLStarlet" version="1.0.1" desc="XMLStarlet Toolkit: Command line utilities for XML">
+<application name="XMLStarlet" version="1.0.1"
+	desc="XMLStarlet Toolkit: Command line utilities for XML">
 	<progs>
-		<prog exec="xml.exe ed" version="1.0.1" desc="XMLStarlet Toolkit: Edit XML document(s), Usage: xml ed &lt;global-options> {&lt;action>} [ &lt;xml-file-or-uri> ... ], where &lt;global-options>  - global options for editing, &lt;xml-file-or-uri> - input XML document file name/uri (stdin otherwise)">
+		<prog exec="xml.exe ed" version="1.0.1"
+			desc="XMLStarlet Toolkit: Edit XML document(s), Usage: xml ed &lt;global-options> {&lt;action>} [ &lt;xml-file-or-uri> ... ], where &lt;global-options>  - global options for editing, &lt;xml-file-or-uri> - input XML document file name/uri (stdin otherwise)">
 			<args>
-				<arg state="optional" type="none" name="P" desc="-P (or --pf)        - preserve original formatting"/>
-				<arg state="optional" type="none" name="S" desc="-S (or --ps)        - preserve non-significant spaces"/>
-				<arg state="optional" type="none" name="O" desc="-O (or --omit-decl) - omit XML declaration (&lt;?xml ...?>)"/>
-				<arg state="optional" type="String" name="N" desc="-N &lt;name>=&lt;value>   - predefine namespaces (name without 'xmlns:'), ex: xsql=urn:oracle-xsql, Multiple -N options are allowed., -N options must be last global options."/>
-				<arg state="optional" type="none" name="h" desc="--help or -h        - display help"/>
-				<arg state="optional" type="String" name="d" desc="-d or --delete &lt;xpath>"/>
-				<arg state="optional" type="String" name="i" desc="-i or --insert &lt;xpath> -t (--type) elem|text|attr -n &lt;name> -v (--value) &lt;value>"/>
-				<arg state="optional" type="String" name="t" desc="-t (--type) elem|text|attr"/>
-				<arg state="optional" type="String" name="n" desc="-n &lt;name>"/>
-				<arg state="optional" type="String" name="v" desc="-v (--value) &lt;value>"/>
-				<arg state="optional" type="String" name="a" desc="-a or --append &lt;xpath> -t (--type) elem|text|attr -n &lt;name> -v (--value) &lt;value>"/>
-				<arg state="optional" type="String" name="s" desc="-s or --subnode &lt;xpath> -t (--type) elem|text|attr -n &lt;name> -v (--value) &lt;value>"/>
-				<arg state="optional" type="String" name="m" desc="-m or --move &lt;xpath1> &lt;xpath2>"/>
-				<arg state="optional" type="String" name="r" desc="-r or --rename &lt;xpath1> -v &lt;new-name>"/>
-				<arg state="optional" type="String" name="u" desc="-u or --update &lt;xpath> -v (--value) &lt;value>"/>
-				<arg state="optional" type="String" name="x" desc="-x (--expr) &lt;xpath> (-x is not implemented yet)"/>
+				<arg state="optional" type="none" name="P"
+					desc="-P (or --pf)        - preserve original formatting" />
+				<arg state="optional" type="none" name="S"
+					desc="-S (or --ps)        - preserve non-significant spaces" />
+				<arg state="optional" type="none" name="O"
+					desc="-O (or --omit-decl) - omit XML declaration (&lt;?xml ...?>)" />
+				<arg state="optional" type="String" name="N"
+					desc="-N &lt;name>=&lt;value>   - predefine namespaces (name without 'xmlns:'), ex: xsql=urn:oracle-xsql, Multiple -N options are allowed., -N options must be last global options." />
+				<arg state="optional" type="none" name="h"
+					desc="--help or -h        - display help" />
+				<arg state="optional" type="String" name="d"
+					desc="-d or --delete &lt;xpath>" />
+				<arg state="optional" type="String" name="i"
+					desc="-i or --insert &lt;xpath> -t (--type) elem|text|attr -n &lt;name> -v (--value) &lt;value>" />
+				<arg state="optional" type="String" name="t"
+					desc="-t (--type) elem|text|attr" />
+				<arg state="optional" type="String" name="n" desc="-n &lt;name>" />
+				<arg state="optional" type="String" name="v"
+					desc="-v (--value) &lt;value>" />
+				<arg state="optional" type="String" name="a"
+					desc="-a or --append &lt;xpath> -t (--type) elem|text|attr -n &lt;name> -v (--value) &lt;value>" />
+				<arg state="optional" type="String" name="s"
+					desc="-s or --subnode &lt;xpath> -t (--type) elem|text|attr -n &lt;name> -v (--value) &lt;value>" />
+				<arg state="optional" type="String" name="m"
+					desc="-m or --move &lt;xpath1> &lt;xpath2>" />
+				<arg state="optional" type="String" name="r"
+					desc="-r or --rename &lt;xpath1> -v &lt;new-name>" />
+				<arg state="optional" type="String" name="u"
+					desc="-u or --update &lt;xpath> -v (--value) &lt;value>" />
+				<arg state="optional" type="String" name="x"
+					desc="-x (--expr) &lt;xpath> (-x is not implemented yet)" />
 			</args>
 		</prog>
 	</progs>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/cwb-align-wrapper-definition.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/cwb-align-wrapper-definition.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/cwb-align-wrapper-definition.xml	(revision 2397)
@@ -1,31 +1,48 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<application name="CwbAlign" version="3.2" desc="Align a corpus with an other">
+<application name="CwbAlign" version="3.2"
+	desc="Align a corpus with an other">
 	<progs>
 		<prog exec="cwb-align" version="3.2" desc="create align file">
 			<args>
-				<arg state="optional" type="String" name="P" desc="use positional attribute [word]"/>
-				<arg state="optional" type="String" name="S" desc="ordered prealignment"/>
-				<arg state="optional" type="String" name="V" desc="ordered prealignment with annotations, ex : seg_id"/>
-				<arg state="optional" type="String" name="o" desc="outfile file [out.align]"/>
-				<arg state="optional" type="String" name="s" desc="set 2:2 alignment split factor [1.2]"/>
-				<arg state="optional" type="String" name="w" desc="use best path search beam of width [50]"/>
-				<arg state="optional" type="String" name="r" desc="use registry directory"/>
-				<arg state="optional" type="none" name="v" desc="verbose mode"/>
-				<arg state="optional" type="none" name="h" desc="show help"/>
-				<arg state="must" type="String" name="source" desc="source corpus identifier"/>
-				<arg state="must" type="String" name="target" desc="target corpus identifier"/>
-				<arg state="must" type="String" name="sattrib" desc="the aligned structure, ex : seg"/>
+				<arg state="optional" type="String" name="P"
+					desc="use positional attribute [word]" />
+				<arg state="optional" type="String" name="S"
+					desc="ordered prealignment" />
+				<arg state="optional" type="String" name="V"
+					desc="ordered prealignment with annotations, ex : seg_id" />
+				<arg state="optional" type="String" name="o"
+					desc="outfile file [out.align]" />
+				<arg state="optional" type="String" name="s"
+					desc="set 2:2 alignment split factor [1.2]" />
+				<arg state="optional" type="String" name="w"
+					desc="use best path search beam of width [50]" />
+				<arg state="optional" type="String" name="r"
+					desc="use registry directory" />
+				<arg state="optional" type="none" name="v" desc="verbose mode" />
+				<arg state="optional" type="none" name="h" desc="show help" />
+				<arg state="must" type="String" name="source"
+					desc="source corpus identifier" />
+				<arg state="must" type="String" name="target"
+					desc="target corpus identifier" />
+				<arg state="must" type="String" name="sattrib"
+					desc="the aligned structure, ex : seg" />
 			</args>
 		</prog>
-		<prog exec="cwb-align-encode" version="3.2" desc="create corpus align data">
+		<prog exec="cwb-align-encode" version="3.2"
+			desc="create corpus align data">
 			<args>
-				<arg state="optional" type="String" name="d" desc="write data file to directory"/>
-				<arg state="optional" type="none" name="D" desc="write data files to corpus data directory"/>
-				<arg state="optional" type="none" name="C" desc="compatibility mode (creates .alg file)"/>
-				<arg state="optional" type="String" name="r" desc="set registry directory"/>
-				<arg state="optional" type="none" name="v" desc="verbose mode"/>
-				<arg state="optional" type="none" name="h" desc="show help"/>
-				<arg state="must" type="String" name="alignmentfile" desc="the align file created by cwb-align"/>
+				<arg state="optional" type="String" name="d"
+					desc="write data file to directory" />
+				<arg state="optional" type="none" name="D"
+					desc="write data files to corpus data directory" />
+				<arg state="optional" type="none" name="C"
+					desc="compatibility mode (creates .alg file)" />
+				<arg state="optional" type="String" name="r"
+					desc="set registry directory" />
+				<arg state="optional" type="none" name="v" desc="verbose mode" />
+				<arg state="optional" type="none" name="h" desc="show help" />
+				<arg state="must" type="String" name="alignmentfile"
+					desc="the align file created by cwb-align" />
 			</args>
 		</prog>
 	</progs>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/printenv-wrapper-definition.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/printenv-wrapper-definition.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/printenv-wrapper-definition.xml	(revision 2397)
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<application name="Printenv" version="0.0.0" desc="Print Environment">
+<application name="Printenv" version="0.0.0"
+	desc="Print Environment">
 	<progs>
 		<prog exec="printenv.exe" version="0.0.0" desc="Printenv">
 			<args>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/tnt-wrapper-definition.xml
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/tnt-wrapper-definition.xml	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/clix/tnt-wrapper-definition.xml	(revision 2397)
@@ -1,57 +1,89 @@
-<application name="TnT" version="0.0.0" desc="Trigrams'n'Tags : part-of-speach tagger">
+<application name="TnT" version="0.0.0"
+	desc="Trigrams'n'Tags : part-of-speach tagger">
 	<progs>
-	
-		<prog exec="tnt" version="0.0.0" desc="tagging. the language model is loaded from model.lex and model.123. if model.map exists, it is used for output mapping compressed files are recognized by suffix .gz, .bz2, or .Z">
+
+		<prog exec="tnt" version="0.0.0"
+			desc="tagging. the language model is loaded from model.lex and model.123. if model.map exists, it is used for output mapping compressed files are recognized by suffix .gz, .bz2, or .Z">
 			<args>
-				<arg state="optional" type="int" name="a" desc="use suffix trie with max. suffix length = len; default = 10"/>
-				<arg state="optional" type="File" name="b" desc="use fil as backup lexicon"/>
-				<arg state="optional" type="int" name="B" desc="backup mode : 0=main only, 1=mix, 2=backup only (default: 1)"/>
-				<arg state="optional" type="String" name="d" desc="sparse data mode"/>
-				<arg state="optional" type="none" name="H" desc="copy HTML tags to output (without tagging)"/>
-				<arg state="optional" type="none" name="m" desc="mark unknown words in output with an asterisk (*)"/>
-				<arg state="optional" type="int" name="n" desc="use num-grams, num = 1, 2, 3, default = 3"/>
-				<arg state="optional" type="int" name="u" desc="unknown word count, default = 3"/>
-				<arg state="optional" type="int" name="v" desc="set verbosity level num: (default = 3)"/>
-				<arg state="optional" type="int" name="z" desc="output tag if prob is in beam num, default =0 (means infinity)"/>
-				<arg state="optional" type="int" name="Z" desc="cut off path if prob is not in beam num (default 1000)"/>
-				<arg state="must" type="String" name="model" desc="model name, will be searched in current dir or in the path specified in the env var TNT_MODELS"/>
-				<arg state="must" type="File" name="corpus" desc="corpus file ?"/>
+				<arg state="optional" type="int" name="a"
+					desc="use suffix trie with max. suffix length = len; default = 10" />
+				<arg state="optional" type="File" name="b"
+					desc="use fil as backup lexicon" />
+				<arg state="optional" type="int" name="B"
+					desc="backup mode : 0=main only, 1=mix, 2=backup only (default: 1)" />
+				<arg state="optional" type="String" name="d"
+					desc="sparse data mode" />
+				<arg state="optional" type="none" name="H"
+					desc="copy HTML tags to output (without tagging)" />
+				<arg state="optional" type="none" name="m"
+					desc="mark unknown words in output with an asterisk (*)" />
+				<arg state="optional" type="int" name="n"
+					desc="use num-grams, num = 1, 2, 3, default = 3" />
+				<arg state="optional" type="int" name="u"
+					desc="unknown word count, default = 3" />
+				<arg state="optional" type="int" name="v"
+					desc="set verbosity level num: (default = 3)" />
+				<arg state="optional" type="int" name="z"
+					desc="output tag if prob is in beam num, default =0 (means infinity)" />
+				<arg state="optional" type="int" name="Z"
+					desc="cut off path if prob is not in beam num (default 1000)" />
+				<arg state="must" type="String" name="model"
+					desc="model name, will be searched in current dir or in the path specified in the env var TNT_MODELS" />
+				<arg state="must" type="File" name="corpus" desc="corpus file ?" />
 			</args>
 		</prog>
-		
+
 		<prog exec="tnt-diff" version="0.0.0" desc="counting differences">
 			<args>
-				<arg state="optional" type="none" name="a" desc="print accuracy vs. ambiguity"/>
-				<arg state="optional" type="int" name="f" desc="print accuracy vs. frequency, max freq = max"/>
-				<arg state="optional" type="none" name="i" desc="ignore upper/lower case of tokens"/>
-				<arg state="optional" type="File" name="l" desc="lexicon to account for known/unknown words"/>
-				<arg state="optional" type="File" name="m" desc="use tagset mapping in file"/>
-				<arg state="must" type="File" name="originalfile" desc="model file"/>
-				<arg state="must" type="File" name="resultfile" desc="corpus file ?"/>
+				<arg state="optional" type="none" name="a"
+					desc="print accuracy vs. ambiguity" />
+				<arg state="optional" type="int" name="f"
+					desc="print accuracy vs. frequency, max freq = max" />
+				<arg state="optional" type="none" name="i"
+					desc="ignore upper/lower case of tokens" />
+				<arg state="optional" type="File" name="l"
+					desc="lexicon to account for known/unknown words" />
+				<arg state="optional" type="File" name="m"
+					desc="use tagset mapping in file" />
+				<arg state="must" type="File" name="originalfile"
+					desc="model file" />
+				<arg state="must" type="File" name="resultfile"
+					desc="corpus file ?" />
 			</args>
 		</prog>
-		
-		<prog exec="tnt-para" version="0.0.0" desc="parameters generation">
+
+		<prog exec="tnt-para" version="0.0.0"
+			desc="parameters generation">
 			<args>
-				<arg state="optional" type="none" name="c" desc="encode capitalization in tag"/>
-				<arg state="optional" type="none" name="H" desc="ignore HTML tags for parameter generation"/>
-				<arg state="optional" type="none" name="i" desc="ignore case"/>
-				<arg state="optional" type="none" name="l" desc="generate lexicon only"/>
-				<arg state="optional" type="none" name="n" desc="generate ngrams only"/>
-				<arg state="optional" type="String" name="o" desc="base name for output files, default=basename of corpus"/>
-				<arg state="optional" type="none" name="v" desc="generate verbose ngrams"/>
-				<arg state="must" type="File" name="corpus" desc="corpus file ?"/>
+				<arg state="optional" type="none" name="c"
+					desc="encode capitalization in tag" />
+				<arg state="optional" type="none" name="H"
+					desc="ignore HTML tags for parameter generation" />
+				<arg state="optional" type="none" name="i" desc="ignore case" />
+				<arg state="optional" type="none" name="l"
+					desc="generate lexicon only" />
+				<arg state="optional" type="none" name="n"
+					desc="generate ngrams only" />
+				<arg state="optional" type="String" name="o"
+					desc="base name for output files, default=basename of corpus" />
+				<arg state="optional" type="none" name="v"
+					desc="generate verbose ngrams" />
+				<arg state="must" type="File" name="corpus" desc="corpus file ?" />
 			</args>
 		</prog>
-		
-		<prog exec="tnt-wc" version="0.0.0" desc="counting tokens and types">
+
+		<prog exec="tnt-wc" version="0.0.0"
+			desc="counting tokens and types">
 			<args>
-				<arg state="optional" type="none" name="H" desc="ignore HTML tags for parameter generation"/>
-				<arg state="optional" type="none" name="i" desc="ignore case"/>
-				<arg state="optional" type="none" name="l" desc="count word types"/>
-				<arg state="optional" type="none" name="t" desc="count tags"/>
-				<arg state="optional" type="none" name="w" desc="count words tokens"/>
-				<arg state="must" type="File" name="corpus" desc="corpus file ?"/>
+				<arg state="optional" type="none" name="H"
+					desc="ignore HTML tags for parameter generation" />
+				<arg state="optional" type="none" name="i" desc="ignore case" />
+				<arg state="optional" type="none" name="l"
+					desc="count word types" />
+				<arg state="optional" type="none" name="t" desc="count tags" />
+				<arg state="optional" type="none" name="w"
+					desc="count words tokens" />
+				<arg state="must" type="File" name="corpus" desc="corpus file ?" />
 			</args>
 		</prog>
 	</progs>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/setup/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/setup/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/setup/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Contains Groovy scripts used to update&build TXM setups</p>
+	<p>Contains Groovy scripts used to update&build TXM setups</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/tigersearch/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/tigersearch/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/tigersearch/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Manage tigerSearch source file</p>
+	<p>Manage tigerSearch source file</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/commands/mesures/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/commands/mesures/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/commands/mesures/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Prototype scripts of the "Mesures" functionnality</p>
+	<p>Prototype scripts of the "Mesures" functionnality</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bfm/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bfm/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bfm/package.html	(revision 2397)
@@ -1,12 +1,12 @@
 <html>
 <body>
-<p>The BFM import module<br/>
-The bfmLoader.groovy script is the main entry point.<br/>
-Process : <br/>
-1- Read a directory containing XML files who follow the BFM encoding guidelines (<a href="http://bfm.ens-lsh.fr/">BFM website</a>) <br/>
-2- Add annotations on words <br/>
-3- Build a TXM corpus with the same name as the directory <br/>
-4- Build a HTML edition <br/>
-</p>
+	<p>
+		The BFM import module<br /> The bfmLoader.groovy script is the main
+		entry point.<br /> Process : <br /> 1- Read a directory containing XML
+		files who follow the BFM encoding guidelines (<a
+			href="http://bfm.ens-lsh.fr/">BFM website</a>) <br /> 2- Add
+		annotations on words <br /> 3- Build a TXM corpus with the same name
+		as the directory <br /> 4- Build a HTML edition <br />
+	</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/package.html	(revision 2397)
@@ -4,87 +4,100 @@
 <title>IMPORT WORD-ODT</title>
 </head>
 <body>
-<h3>IMPORT WORD-ODT </h3>
+	<h3>IMPORT WORD-ODT</h3>
 
-<h4>Processus :</h4> 
-Pour l'instant, l'import WORD-ODT repose grandement sur l'import XML/w
-<ul>
- <li>transformation en ODT de tous les documents : doc et docx</li>
- <li>transformation en TEI avec XSL de Ratz</li>
- <li>retire &lt;term> et &lt;teiHeader> (de toute façon vide)</li>
- <li>import XML/w</li>
-</ul>
+	<h4>Processus :</h4>
+	Pour l'instant, l'import WORD-ODT repose grandement sur l'import XML/w
+	<ul>
+		<li>transformation en ODT de tous les documents : doc et docx</li>
+		<li>transformation en TEI avec XSL de Ratz</li>
+		<li>retire &lt;term> et &lt;teiHeader> (de toute façon vide)</li>
+		<li>import XML/w</li>
+	</ul>
 
-<h4>Sauts de pages</h4>
- Les pages sont paginées en fonction des soft-page-break d'ODT<br/>
- repérage des &lt;xsl:template match="text:soft-page-break"><br/>
+	<h4>Sauts de pages</h4>
+	Les pages sont paginées en fonction des soft-page-break d'ODT
+	<br /> repérage des &lt;xsl:template match="text:soft-page-break">
+	<br />
 
-<h4>Images</h4>
- Le chemin des images de la source sont conservés jusqu'en l'édition dans l'attribut "url" des balises "graphic".<br/>
- Il faut placer le dossier "Pictures" à coté des pages d'édition.<br/>
- Il n'y a aucune différence dans le codage d'image linkée ou pas.<br/>
- On peut différentier si une image est linké par son url : <br/>
-<ul>
-  <li>incorporée : "Pictures/xxx", Pictures est un dossier de l'archive ODT</li>
-  <li>linkée : "../xxx"</li>
-  <li>web : "http://" "ftp://" ...</li>
-</ul>
+	<h4>Images</h4>
+	Le chemin des images de la source sont conservés jusqu'en l'édition
+	dans l'attribut "url" des balises "graphic".
+	<br /> Il faut placer le dossier "Pictures" à coté des pages d'édition.
+	<br /> Il n'y a aucune différence dans le codage d'image linkée ou pas.
+	<br /> On peut différentier si une image est linké par son url :
+	<br />
+	<ul>
+		<li>incorporée : "Pictures/xxx", Pictures est un dossier de
+			l'archive ODT</li>
+		<li>linkée : "../xxx"</li>
+		<li>web : "http://" "ftp://" ...</li>
+	</ul>
 
-<h4>Tokenisation</h4>
- Pour cet import, j'ai branché le Tokenizer paramétrable en variables et en tests.<br/>
- Les mots sont typés à l'import grâce aux paramétrages : protocole, tag, path, number<br/>
- corrections de bugs de tokenisation du "SimpleXmlTokenizer"<br/>
+	<h4>Tokenisation</h4>
+	Pour cet import, j'ai branché le Tokenizer paramétrable en variables et
+	en tests.
+	<br /> Les mots sont typés à l'import grâce aux paramétrages :
+	protocole, tag, path, number
+	<br /> corrections de bugs de tokenisation du "SimpleXmlTokenizer"
+	<br />
 
-<h3>MODIFS XSL RATZ</h3>
-<h4>Paragraphes</h4>
- styles automatiques PN -> prend style parent<br/>
- erreur xsl avec certains odt<br/>
- récupération du style parent des styles automatiques<br/>
+	<h3>MODIFS XSL RATZ</h3>
+	<h4>Paragraphes</h4>
+	styles automatiques PN -> prend style parent
+	<br /> erreur xsl avec certains odt
+	<br /> récupération du style parent des styles automatiques
+	<br />
 
-<h4>Sauts de page</h4>
- text:soft-page-break -> pb<br/>
+	<h4>Sauts de page</h4>
+	text:soft-page-break -> pb
+	<br />
 
-<h4>gestion par défaut de certains [[[UNTRANSLATED...]]]</h4>
-Affichage du content des éléments :<br/>
-<ul>
- <li>text:editing-cycles</li>
- <li>text:page-count</li>
- <li>text:word-count</li>
- <li>text:image-count</li>
- <li>text:table-count</li>
- <li>text:modification-date</li>
- <li>text:modification-time</li>
- <li>text:sequence-ref</li>
-</ul>
-<h3>A FAIRE</h3>
+	<h4>gestion par défaut de certains [[[UNTRANSLATED...]]]</h4>
+	Affichage du content des éléments :
+	<br />
+	<ul>
+		<li>text:editing-cycles</li>
+		<li>text:page-count</li>
+		<li>text:word-count</li>
+		<li>text:image-count</li>
+		<li>text:table-count</li>
+		<li>text:modification-date</li>
+		<li>text:modification-time</li>
+		<li>text:sequence-ref</li>
+	</ul>
+	<h3>A FAIRE</h3>
 
-<h4>Images</h4>
- Automatiser la déplacement des images lors de l'import pour que les url pointent bien les fichiers.<br/>
- xxxx-files -> $TXMHOME/corpora/$CORPUS/HTML/default<br/>
+	<h4>Images</h4>
+	Automatiser la déplacement des images lors de l'import pour que les url
+	pointent bien les fichiers.
+	<br /> xxxx-files -> $TXMHOME/corpora/$CORPUS/HTML/default
+	<br />
 
-<h4>Tokenisation</h4>
- PB: les mots sont dabord découpés par blanc (ex: pas bon pour <tag attr="" atrt2="">)<br/>
+	<h4>Tokenisation</h4>
+	PB: les mots sont dabord découpés par blanc (ex: pas bon pour
+	<tag attr="" atrt2="">)<br />
 
-<h4>UNTRANSLATED</h4>
-Faut-il marquer ces infos : <br/>
-<ul>
- <li>text:editing-cycles</li>
- <li>text:page-count</li>
- <li>text:word-count</li>
- <li>text:image-count</li>
- <li>text:table-count</li>
- <li>text:modification-date</li>
- <li>text:modification-time</li>
- <li>text:sequence-ref</li>
-</ul>
-<h4>Sauts de page durs</h4>
- Ils sont codés dans les styles de paragraphe **automatiques**<br/>
- &lt;style:paragraph-properties fo:break-before="page"/><br/>
+	<h4>UNTRANSLATED</h4>
+	Faut-il marquer ces infos : <br />
+	<ul>
+		<li>text:editing-cycles</li>
+		<li>text:page-count</li>
+		<li>text:word-count</li>
+		<li>text:image-count</li>
+		<li>text:table-count</li>
+		<li>text:modification-date</li>
+		<li>text:modification-time</li>
+		<li>text:sequence-ref</li>
+	</ul>
+	<h4>Sauts de page durs</h4>
+	Ils sont codés dans les styles de paragraphe **automatiques**<br />
+	&lt;style:paragraph-properties fo:break-before="page"/><br />
 
-<h4>Typage des paragraphes</h4>
- but atteindre un typage comme celui fait par l'export xHTML d'oo<br/>
- lire styles.xml et créer une css<br/>
- Unifier les styles identiques ?<br/>
- Reclasser les @rend ?<br/>
+	<h4>Typage des paragraphes</h4>
+	but atteindre un typage comme celui fait par l'export xHTML d'oo<br />
+	lire styles.xml et créer une css<br />
+	Unifier les styles identiques ?<br />
+	Reclasser les @rend ?<br />
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/RGAQCJ/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/RGAQCJ/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/RGAQCJ/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>RGAQCJ import module - old</p>
+	<p>RGAQCJ import module - old</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>TMX import module - not yet finished </p>
+	<p>TMX import module - not yet finished</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Factiva XML and mail import modules</p>
+	<p>Factiva XML and mail import modules</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/limsi/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/limsi/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/limsi/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Limsi format transformation scripts</p>
+	<p>Limsi format transformation scripts</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Transcriber import module.</p>
+	<p>Transcriber import module.</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Quick import module : text files</p>
+	<p>Quick import module : text files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bvh/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bvh/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bvh/package.html	(revision 2397)
@@ -1,12 +1,16 @@
 <html>
 <body>
-<p>The BVH import module<br>
-The bvhLoader.groovy script is the main entry point.<br>
-Process : <br>
-1- Reads a directory containing XML files who follow the BVH encoding guidelines, see <a href="http://www.bvh.univ-tours.fr/">BVH website</a>.<br/>
-2- Annotates with <b>rgaqcj.par</b> and <b>afr.par</b> models.<br> 
-3- Builds a TXM corpus with the name of the directory. <br/>
-4- Builds an edition similar to the BVH's one.<br/><big>Hello</big><big><br></big><big>
-</big></p><big>
-</big></body><big>
-</big></html>
\ No newline at end of file
+	<p>
+		The BVH import module<br> The bvhLoader.groovy script is the main
+		entry point.<br> Process : <br> 1- Reads a directory
+		containing XML files who follow the BVH encoding guidelines, see <a
+			href="http://www.bvh.univ-tours.fr/">BVH website</a>.<br /> 2-
+		Annotates with <b>rgaqcj.par</b> and <b>afr.par</b> models.<br>
+		3- Builds a TXM corpus with the name of the directory. <br /> 4-
+		Builds an edition similar to the BVH's one.<br />
+		<big>Hello</big><big><br></big><big> </big>
+	</p>
+	<big> </big>
+</body>
+<big> </big>
+</html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Alceste import module</p>
+	<p>Alceste import module</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Hyperbase import module</p>
+	<p>Hyperbase import module</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/cqp/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/cqp/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/cqp/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>CWB import module.</p>
+	<p>CWB import module.</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_cms.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_cms.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_cms.xsl	(revision 2397)
@@ -1,193 +1,233 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
-    xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0"
-    xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
 
-    <!-- Eléments communs à toutes les présentations -->
+	<!-- Eléments communs à toutes les présentations -->
 
-    <xsl:output method="html" encoding="UTF-8" version="4.0" indent="yes"/>
+	<xsl:output method="html" encoding="UTF-8" version="4.0"
+		indent="yes" />
 
-    <xsl:strip-space elements="*"/>
+	<xsl:strip-space elements="*" />
 
-    <xsl:variable name="text_id">
-        <xsl:value-of select="//tei:teiHeader//tei:title[@type='reference']"/>
-    </xsl:variable>
+	<xsl:variable name="text_id">
+		<xsl:value-of
+			select="//tei:teiHeader//tei:title[@type='reference']" />
+	</xsl:variable>
 
-    <xsl:template match="/">
-        <html>
-            <head> </head>
-            <body>
-                <xsl:apply-templates select="//tei:text"/>
-                <xsl:apply-templates select="//tei:note" mode="final"/>
-            </body>
-        </html>
-    </xsl:template>
+	<xsl:template match="/">
+		<html>
+			<head>
+			</head>
+			<body>
+				<xsl:apply-templates select="//tei:text" />
+				<xsl:apply-templates select="//tei:note"
+					mode="final" />
+			</body>
+		</html>
+	</xsl:template>
 
 
-    <xsl:template match="//tei:body/tei:div">
-        <br/>
-        <span style="font-family:Times;color:indigo">[<i>
-                <xsl:value-of select="@type"/>
-            </i>&#xa0;<xsl:value-of select="@n"/>]</span>
-        <xsl:apply-templates/>
-    </xsl:template>
+	<xsl:template match="//tei:body/tei:div">
+		<br />
+		<span style="font-family:Times;color:indigo">
+			[
+			<i>
+				<xsl:value-of select="@type" />
+			</i>
+			&#xa0;
+			<xsl:value-of select="@n" />
+			]
+		</span>
+		<xsl:apply-templates />
+	</xsl:template>
 
-    <xsl:template match="//tei:body/tei:div/tei:div">
-        <br/>
-        <span style="font-family:Times;color:indigo">[<i>
-                <xsl:value-of select="@type"/>
-            </i>&#xa0;<xsl:value-of select="@n"/>]</span>
-        <br/>
-        <xsl:apply-templates/>
-    </xsl:template>
+	<xsl:template match="//tei:body/tei:div/tei:div">
+		<br />
+		<span style="font-family:Times;color:indigo">
+			[
+			<i>
+				<xsl:value-of select="@type" />
+			</i>
+			&#xa0;
+			<xsl:value-of select="@n" />
+			]
+		</span>
+		<br />
+		<xsl:apply-templates />
+	</xsl:template>
 
-    <xsl:template match="tei:head">
-        <span style="font-family:Arial; color:darkred">
-            <xsl:apply-templates/>
-        </span>
-        <br/>
-    </xsl:template>
+	<xsl:template match="tei:head">
+		<span style="font-family:Arial; color:darkred">
+			<xsl:apply-templates />
+		</span>
+		<br />
+	</xsl:template>
 
-    <xsl:template match="//tei:p">
-        <p>
-            <xsl:if test="@n"> [ § <xsl:value-of select="@n"/>]&#xa0; </xsl:if>
-            <xsl:apply-templates/>
-        </p>
-    </xsl:template>
+	<xsl:template match="//tei:p">
+		<p>
+			<xsl:if test="@n">
+				[ §
+				<xsl:value-of select="@n" />
+				]&#xa0;
+			</xsl:if>
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
 
-    <xsl:template match="tei:pb">
-        <br/>
-        <br/>
-        <span style="font-family:Times" id="{$text_id}-{@n}">[folio <xsl:value-of select="@n"/>] <a
-                href="{$text_id}-compare.html#{$text_id}-{@n}">[autres facettes]</a>
-            <xsl:if test="@facs">
-                <xsl:text> </xsl:text>
-                <a href="../{@facs}" target="_blank">[Image]</a>
-            </xsl:if>
-        </span>
-        <xsl:if test="not(following-sibling::*[1][self::cb])">
-            <br/>
-        </xsl:if>
-    </xsl:template>
+	<xsl:template match="tei:pb">
+		<br />
+		<br />
+		<span style="font-family:Times" id="{$text_id}-{@n}">
+			[folio
+			<xsl:value-of select="@n" />
+			]
+			<a href="{$text_id}-compare.html#{$text_id}-{@n}">[autres facettes]</a>
+			<xsl:if test="@facs">
+				<xsl:text> </xsl:text>
+				<a href="../{@facs}" target="_blank">[Image]</a>
+			</xsl:if>
+		</span>
+		<xsl:if test="not(following-sibling::*[1][self::cb])">
+			<br />
+		</xsl:if>
+	</xsl:template>
 
-    <xsl:template match="//tei:cb">
-        <br/>
-        <xsl:if test="not(preceding-sibling::*[1][self::pb])">
-            <br/>
-        </xsl:if>
-        <span style="font-family:Times">[colonne <xsl:value-of select="@n"/>]</span>
-        <br/>
-    </xsl:template>
+	<xsl:template match="//tei:cb">
+		<br />
+		<xsl:if test="not(preceding-sibling::*[1][self::pb])">
+			<br />
+		</xsl:if>
+		<span style="font-family:Times">
+			[colonne
+			<xsl:value-of select="@n" />
+			]
+		</span>
+		<br />
+	</xsl:template>
 
-    <xsl:template match="tei:note">
-        <xsl:variable name="note_num">
-            <xsl:choose>
-                <xsl:when test="@n">
-                    <xsl:value-of select="@n"/>
-                </xsl:when>
-                <xsl:otherwise>
-                    <xsl:value-of select="count(preceding::tei:note) + 1"/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
-        <a style="font-size:75%;color:blue;font-family:Times" title="{.}" id="noteref_{$note_num}"
-            href="#note_{$note_num}">
-            <sup>[<xsl:value-of select="count(preceding::tei:note) + 1"/>]</sup>
-        </a>
-        <xsl:if test="following::*[1][self::tei:w]">
-            <xsl:text> </xsl:text>
-        </xsl:if>
-    </xsl:template>
+	<xsl:template match="tei:note">
+		<xsl:variable name="note_num">
+			<xsl:choose>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="count(preceding::tei:note) + 1" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<a style="font-size:75%;color:blue;font-family:Times" title="{.}"
+			id="noteref_{$note_num}" href="#note_{$note_num}">
+			<sup>
+				[
+				<xsl:value-of select="count(preceding::tei:note) + 1" />
+				]
+			</sup>
+		</a>
+		<xsl:if test="following::*[1][self::tei:w]">
+			<xsl:text> </xsl:text>
+		</xsl:if>
+	</xsl:template>
 
-    <xsl:template match="tei:note" mode="final">
-        <xsl:variable name="note_num">
-            <xsl:choose>
-                <xsl:when test="@n">
-                    <xsl:value-of select="@n"/>
-                </xsl:when>
-                <xsl:otherwise>
-                    <xsl:value-of select="position()"/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
-        <span id="note_{$note_num}">
-            <a href="#noteref_{$note_num}">[<xsl:value-of select="$note_num"/>]</a>
-            (fol. <xsl:value-of select="preceding::tei:pb[1]/@n"/>, col. 
-            <xsl:value-of select="preceding::tei:cb[1]/@n"/>, l. 
-            <xsl:value-of select="preceding::tei:lb[1]/@n"/>) 
-            <xsl:apply-templates/>
-        </span>
-        <br/>
-    </xsl:template>
+	<xsl:template match="tei:note" mode="final">
+		<xsl:variable name="note_num">
+			<xsl:choose>
+				<xsl:when test="@n">
+					<xsl:value-of select="@n" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="position()" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<span id="note_{$note_num}">
+			<a href="#noteref_{$note_num}">
+				[
+				<xsl:value-of select="$note_num" />
+				]
+			</a>
+			(fol.
+			<xsl:value-of select="preceding::tei:pb[1]/@n" />
+			, col.
+			<xsl:value-of select="preceding::tei:cb[1]/@n" />
+			, l.
+			<xsl:value-of select="preceding::tei:lb[1]/@n" />
+			)
+			<xsl:apply-templates />
+		</span>
+		<br />
+	</xsl:template>
 
-    <xsl:template match="tei:q">
-        <span style="color:darkblue">
-            <xsl:apply-templates/>
-        </span>
-    </xsl:template>
+	<xsl:template match="tei:q">
+		<span style="color:darkblue">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
 
 
-    <xsl:template match="tei:gap">
-        <xsl:text> [...] </xsl:text>
-    </xsl:template>
-    
-    
-<!--    <xsl:template match="tei:q">
-        <span style="background-color:khaki">
-            <xsl:apply-templates/>
-        </span>
-    </xsl:template>-->
-    
-    <xsl:template match="tei:gap">
-        <xsl:apply-templates/>
-    </xsl:template>
-    
-    <xsl:template match="//tei:lb">
-        <xsl:choose>
-            <xsl:when
-                test="position()=1 and not(ancestor::tei:seg)"/>
-            <xsl:otherwise>
-                <br/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
-    
-    <xsl:template match="//tei:w">
-        <span class="word" id="{@xml:id}" title="{@type}">
-            <xsl:if
-                test="starts-with(.,':') or starts-with(.,'!') or starts-with(.,'?') or starts-with(.,';')"
-                >&#xa0;</xsl:if>
-            <xsl:value-of select="."/>
-            <xsl:choose>
-                <xsl:when
-                    test="following::*[1][starts-with(., ',') or starts-with(., '.') or starts-with(., ']') or starts-with(., ')') or starts-with(.,':') or starts-with(.,'!') or starts-with(.,'?') or starts-with(.,';')]"/>
-                <xsl:when
-                    test=".[string-length(.) = 0]"/>
-                <xsl:when test="@bfm:aggl='elision'">'</xsl:when>
-                <xsl:otherwise>
-                    <xsl:text> </xsl:text>
-                </xsl:otherwise>
-            </xsl:choose>
-        </span>
-    </xsl:template>
-    
-    <xsl:template match="tei:sic" >
-        <span style="text-decoration:line-through;color:red">
-            <xsl:apply-templates mode="norm"/>
-        </span>
-    </xsl:template>
-    
-    <xsl:template match="tei:del"> </xsl:template>
-    
-    
-    <xsl:template match="//tei:hi[@rend='sup']">
-        <sup>
-            <xsl:apply-templates/>
-        </sup>
-    </xsl:template>
+	<xsl:template match="tei:gap">
+		<xsl:text> [...] </xsl:text>
+	</xsl:template>
 
-    <!-- fin éléments communs -->
 
+	<!-- <xsl:template match="tei:q"> <span style="background-color:khaki"> 
+		<xsl:apply-templates/> </span> </xsl:template> -->
 
+	<xsl:template match="tei:gap">
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="//tei:lb">
+		<xsl:choose>
+			<xsl:when test="position()=1 and not(ancestor::tei:seg)" />
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="//tei:w">
+		<span class="word" id="{@xml:id}" title="{@type}">
+			<xsl:if
+				test="starts-with(.,':') or starts-with(.,'!') or starts-with(.,'?') or starts-with(.,';')">
+				&#xa0;
+			</xsl:if>
+			<xsl:value-of select="." />
+			<xsl:choose>
+				<xsl:when
+					test="following::*[1][starts-with(., ',') or starts-with(., '.') or starts-with(., ']') or starts-with(., ')') or starts-with(.,':') or starts-with(.,'!') or starts-with(.,'?') or starts-with(.,';')]" />
+				<xsl:when test=".[string-length(.) = 0]" />
+				<xsl:when test="@bfm:aggl='elision'">
+					'
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:sic">
+		<span style="text-decoration:line-through;color:red">
+			<xsl:apply-templates mode="norm" />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:del">
+	</xsl:template>
+
+
+	<xsl:template match="//tei:hi[@rend='sup']">
+		<sup>
+			<xsl:apply-templates />
+		</sup>
+	</xsl:template>
+
+	<!-- fin éléments communs -->
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_common.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_common.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_common.xsl	(revision 2397)
@@ -1,158 +1,198 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
 
-    <!-- Eléments communs à toutes les présentations -->
+	<!-- Eléments communs à toutes les présentations -->
 
-<xsl:variable name="text_id"><xsl:value-of select="//tei:teiHeader//tei:title[@type='reference']"/></xsl:variable>
+	<xsl:variable name="text_id">
+		<xsl:value-of
+			select="//tei:teiHeader//tei:title[@type='reference']" />
+	</xsl:variable>
 
-<!--    <xsl:template match="/">
-        <html>
-            <head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-            </head>
-            <body>
-                <div class="head"><xsl:apply-templates select="//tei:teiHeader"/></div>
-                <xsl:apply-templates select="//tei:text">
-                    <xsl:with-param name="form"><xsl:value-of select="$form"/></xsl:with-param>
-                </xsl:apply-templates>
-                <!-\-<xsl:apply-templates select="//tei:note" mode="final"></xsl:apply-templates>-\->
-            </body>
-        </html>
-    </xsl:template>
--->    
-    <xsl:template match="/">
-                <xsl:apply-templates select="//tei:text">
-                    <xsl:with-param name="form"><xsl:value-of select="$form"/></xsl:with-param>
-                </xsl:apply-templates>
-    </xsl:template>
+	<!-- <xsl:template match="/"> <html> <head><meta http-equiv="Content-Type" 
+		content="text/html;charset=UTF-8"/> </head> <body> <div class="head"><xsl:apply-templates 
+		select="//tei:teiHeader"/></div> <xsl:apply-templates select="//tei:text"> 
+		<xsl:with-param name="form"><xsl:value-of select="$form"/></xsl:with-param> 
+		</xsl:apply-templates> <!-\-<xsl:apply-templates select="//tei:note" mode="final"></xsl:apply-templates>-\-> 
+		</body> </html> </xsl:template> -->
+	<xsl:template match="/">
+		<xsl:apply-templates select="//tei:text">
+			<xsl:with-param name="form">
+				<xsl:value-of select="$form" />
+			</xsl:with-param>
+		</xsl:apply-templates>
+	</xsl:template>
 
-                                                <!-- TEI-Header Processing -->
-                                
-                                                <xsl:variable name="title-source" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='source']"/>
-                
-                <xsl:variable name="title-normal" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='normal']"/>
-                
-                <xsl:variable name="title-ref" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='reference']"/>
-                
-                
-                <xsl:variable name="author" select="//tei:titleStmt/tei:author"/>
-                
-                <xsl:variable name="apostrophe" select='"&apos;"'/>
+	<!-- TEI-Header Processing -->
 
-                
-                
-                <xsl:template match="//tei:teiHeader">
-                                <p align="center">
-                                                
-                                                <!-- Author (only appears if not anonymous) -->
-                                                <xsl:if test="$author[not(contains(.,'anonym'))]">
-                                                                <span style="font-variant:small-caps;font-weight:bold"><xsl:value-of select="$author"/></span><br/>                
-                                                </xsl:if>
-                                                <!-- Title -->
-                                                <span style="color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size:200%"><xsl:value-of select="$title-normal"/></span><br/>
-                                                <!-- Scientific editor(s) -->
-                                                Edition par <xsl:apply-templates select="//tei:titleStmt/tei:editor[@role='editor']"/><br/>
-                                                Avec la collaboration de <xsl:apply-templates select="//tei:titleStmt/tei:editor[@role='associate_editor']"/><br/>
-                                                
-                                                <!-- Series Statement, Publisher, Year 	
-                                                                <xsl:apply-templates select="fileDesc/seriesStmt/title"/><br/>
-                                                                <xsl:apply-templates select="//sourceDesc//publicationStmt/pubPlace"/>,
-                                                                <xsl:apply-templates select="//sourceDesc//publicationStmt/publisher"/>,
-                                                                <xsl:apply-templates select="//sourceDesc//publicationStmt/date"/>
-                                                                
-                                                -->
-                                </p>
-                                
-                                <!-- Information on the electronic version  -->                
-                                <p align="center">_____________________________________________________<br/><br/>
-                                                <span style="font-size:75%">Edition électronique<br/>
-                                                                Dernière révision : <xsl:value-of select="//tei:revisionDesc/tei:change[1]/@when"/></span><br/>
-                                                                _____________________________________________________</p>
-                                <p align="center">Version <xsl:value-of select="$form"/>
-                                                <br/>_____________________________________________________</p>
-                </xsl:template>
+	<xsl:variable name="title-source"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='source']" />
 
+	<xsl:variable name="title-normal"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='normal']" />
 
-    
-    <xsl:template match="//tei:body/tei:div">
-        <br/><span style="font-family:Times;color:indigo">[<i><xsl:value-of select="@type"/></i>&#xa0;<xsl:value-of select="@n"/>]</span>
-        <xsl:apply-templates/>
-    </xsl:template>
-    
-    <xsl:template match="//tei:body/tei:div/tei:div">
-        <br/><span style="font-family:Times;color:indigo">[<i><xsl:value-of select="@type"/></i>&#xa0;<xsl:value-of select="@n"/>]</span><br/>
-        <xsl:apply-templates/>
-    </xsl:template>
-    
-    <xsl:template match="tei:head">
-        <span style="font-family:Arial; color:darkred"><xsl:apply-templates/></span><br/>
-    </xsl:template> 
-    <!-- 
-    <xsl:template match="//tei:p">
-        <p>
-            <xsl:if test="@n">
-                [ § <xsl:value-of select="@n"/>]&#xa0;
-            </xsl:if>
-            <xsl:apply-templates/>
-        </p>
-    </xsl:template>
-    -->
-    <xsl:template name="pb_common" match="tei:pb">
-<!--        <br/><br/>
-        <span style="font-family:Times" id="{$text_id}-{@n}">[folio <xsl:value-of select="@n"/>] <a href="{$text_id}-compare.html#{$text_id}-{@n}">[autres facettes]</a>
-        <xsl:if test="@facs">
-            <xsl:text> </xsl:text><a href="../{@facs}" target="_blank">[Image]</a>
-        </xsl:if>
-        </span>
-        <xsl:if test="not(following-sibling::*[1][self::cb])">
-            <br/>
-        </xsl:if>-->
-    </xsl:template>
-    
-    <xsl:template match="//tei:cb" name="cb_common">
-        <br/>
-        <xsl:if test="not(preceding-sibling::*[1][self::pb])"><br/></xsl:if>
-        <span style="font-family:Times">[colonne <xsl:value-of select="@n"/>]</span>
-        <br/>
-    </xsl:template>
-        
-    <xsl:template match="tei:note" name="note_common">
-<!--        <xsl:variable name="note_num">
-            <xsl:choose>
-                <xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when>
-                <xsl:otherwise><xsl:value-of select="count(preceding::tei:note) + 1"/></xsl:otherwise>
-            </xsl:choose>            
-        </xsl:variable>
-        <a style="font-size:75%;color:blue;font-family:Times" title="{.}" id="noteref_{$note_num}" href="#note_{$note_num}"><sup>[<xsl:value-of select="count(preceding::tei:note) + 1"/>]</sup></a>
-        <xsl:if test="following::*[1][self::tei:w]"><xsl:text> </xsl:text></xsl:if>-->
-    </xsl:template>
-    
-    <xsl:template match="tei:note" mode="final">
-<!--        <xsl:variable name="note_num">
-            <xsl:choose>
-                <xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when>
-                <xsl:otherwise><xsl:value-of select="position()"/></xsl:otherwise>
-            </xsl:choose>            
-        </xsl:variable>
-        <span id="note_{$note_num}"><a href="#noteref_{$note_num}">[<xsl:value-of select="$note_num"/>]</a> (fol. <xsl:value-of select="preceding::tei:pb[1]/@n"/>, col. <xsl:value-of select="preceding::tei:cb[1]/@n"/>,  l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>) <xsl:apply-templates/></span><br/>
--->    </xsl:template>
-    
-<!--    <xsl:template match="tei:q" name="q_common">
-        <span style="color:darkblue"><xsl:apply-templates/></span>
-    </xsl:template>
--->    
-    
-    <xsl:template match="tei:gap" name="gap_common">
-        <xsl:text> [...] </xsl:text>
-    </xsl:template>
+	<xsl:variable name="title-ref"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='reference']" />
 
-<xsl:template name="supplied_common">
-    <xsl:text>[</xsl:text>
-    <xsl:apply-templates/>
-    <xsl:text>]</xsl:text>
-</xsl:template>
 
-    <!-- fin éléments communs -->
-    
-    
+	<xsl:variable name="author"
+		select="//tei:titleStmt/tei:author" />
+
+	<xsl:variable name="apostrophe" select='"&apos;"' />
+
+
+
+	<xsl:template match="//tei:teiHeader">
+		<p align="center">
+
+			<!-- Author (only appears if not anonymous) -->
+			<xsl:if test="$author[not(contains(.,'anonym'))]">
+				<span style="font-variant:small-caps;font-weight:bold">
+					<xsl:value-of select="$author" />
+				</span>
+				<br />
+			</xsl:if>
+			<!-- Title -->
+			<span
+				style="color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size:200%">
+				<xsl:value-of select="$title-normal" />
+			</span>
+			<br />
+			<!-- Scientific editor(s) -->
+			Edition par
+			<xsl:apply-templates
+				select="//tei:titleStmt/tei:editor[@role='editor']" />
+			<br />
+			Avec la collaboration de
+			<xsl:apply-templates
+				select="//tei:titleStmt/tei:editor[@role='associate_editor']" />
+			<br />
+
+			<!-- Series Statement, Publisher, Year <xsl:apply-templates select="fileDesc/seriesStmt/title"/><br/> 
+				<xsl:apply-templates select="//sourceDesc//publicationStmt/pubPlace"/>, <xsl:apply-templates 
+				select="//sourceDesc//publicationStmt/publisher"/>, <xsl:apply-templates 
+				select="//sourceDesc//publicationStmt/date"/> -->
+		</p>
+
+		<!-- Information on the electronic version -->
+		<p align="center">
+			_____________________________________________________
+			<br />
+			<br />
+			<span style="font-size:75%">
+				Edition électronique
+				<br />
+				Dernière révision :
+				<xsl:value-of
+					select="//tei:revisionDesc/tei:change[1]/@when" />
+			</span>
+			<br />
+			_____________________________________________________
+		</p>
+		<p align="center">
+			Version
+			<xsl:value-of select="$form" />
+			<br />
+			_____________________________________________________
+		</p>
+	</xsl:template>
+
+
+
+	<xsl:template match="//tei:body/tei:div">
+		<br />
+		<span style="font-family:Times;color:indigo">
+			[
+			<i>
+				<xsl:value-of select="@type" />
+			</i>
+			&#xa0;
+			<xsl:value-of select="@n" />
+			]
+		</span>
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="//tei:body/tei:div/tei:div">
+		<br />
+		<span style="font-family:Times;color:indigo">
+			[
+			<i>
+				<xsl:value-of select="@type" />
+			</i>
+			&#xa0;
+			<xsl:value-of select="@n" />
+			]
+		</span>
+		<br />
+		<xsl:apply-templates />
+	</xsl:template>
+
+	<xsl:template match="tei:head">
+		<span style="font-family:Arial; color:darkred">
+			<xsl:apply-templates />
+		</span>
+		<br />
+	</xsl:template>
+	<!-- <xsl:template match="//tei:p"> <p> <xsl:if test="@n"> [ § <xsl:value-of 
+		select="@n"/>]&#xa0; </xsl:if> <xsl:apply-templates/> </p> </xsl:template> -->
+	<xsl:template name="pb_common" match="tei:pb">
+		<!-- <br/><br/> <span style="font-family:Times" id="{$text_id}-{@n}">[folio 
+			<xsl:value-of select="@n"/>] <a href="{$text_id}-compare.html#{$text_id}-{@n}">[autres 
+			facettes]</a> <xsl:if test="@facs"> <xsl:text> </xsl:text><a href="../{@facs}" 
+			target="_blank">[Image]</a> </xsl:if> </span> <xsl:if test="not(following-sibling::*[1][self::cb])"> 
+			<br/> </xsl:if> -->
+	</xsl:template>
+
+	<xsl:template match="//tei:cb" name="cb_common">
+		<br />
+		<xsl:if test="not(preceding-sibling::*[1][self::pb])">
+			<br />
+		</xsl:if>
+		<span style="font-family:Times">
+			[colonne
+			<xsl:value-of select="@n" />
+			]
+		</span>
+		<br />
+	</xsl:template>
+
+	<xsl:template match="tei:note" name="note_common">
+		<!-- <xsl:variable name="note_num"> <xsl:choose> <xsl:when test="@n"><xsl:value-of 
+			select="@n"/></xsl:when> <xsl:otherwise><xsl:value-of select="count(preceding::tei:note) 
+			+ 1"/></xsl:otherwise> </xsl:choose> </xsl:variable> <a style="font-size:75%;color:blue;font-family:Times" 
+			title="{.}" id="noteref_{$note_num}" href="#note_{$note_num}"><sup>[<xsl:value-of 
+			select="count(preceding::tei:note) + 1"/>]</sup></a> <xsl:if test="following::*[1][self::tei:w]"><xsl:text> 
+			</xsl:text></xsl:if> -->
+	</xsl:template>
+
+	<xsl:template match="tei:note" mode="final">
+		<!-- <xsl:variable name="note_num"> <xsl:choose> <xsl:when test="@n"><xsl:value-of 
+			select="@n"/></xsl:when> <xsl:otherwise><xsl:value-of select="position()"/></xsl:otherwise> 
+			</xsl:choose> </xsl:variable> <span id="note_{$note_num}"><a href="#noteref_{$note_num}">[<xsl:value-of 
+			select="$note_num"/>]</a> (fol. <xsl:value-of select="preceding::tei:pb[1]/@n"/>, 
+			col. <xsl:value-of select="preceding::tei:cb[1]/@n"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>) 
+			<xsl:apply-templates/></span><br/> -->
+	</xsl:template>
+
+	<!-- <xsl:template match="tei:q" name="q_common"> <span style="color:darkblue"><xsl:apply-templates/></span> 
+		</xsl:template> -->
+
+	<xsl:template match="tei:gap" name="gap_common">
+		<xsl:text> [...] </xsl:text>
+	</xsl:template>
+
+	<xsl:template name="supplied_common">
+		<xsl:text>[</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>]</xsl:text>
+	</xsl:template>
+
+	<!-- fin éléments communs -->
+
+
 </xsl:stylesheet>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_dipl.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_dipl.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_dipl.xsl	(revision 2397)
@@ -1,183 +1,189 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- This is a stylesheet that gives a "diplomatic" presentation of old French manuscript transcriptions
-	- abbreviations are resolved and rendered in italics;
-	- agglutinations and deglutinations are not marked (word limits 
-	  are "normalized");
-                                                          - Strong punctuation is marked with a dot followed by a capital letter;
-                                                             weak punctuation is marked with a comma.
-	- direct speech is marked with darkblue color;
-	- uncertain readings are marked with grey background color;
-	- text deleted in the original is not visualized;
-	- text corrected in the normalized version is marked with darkred
-                                                             color and followed by "(sic!)" note;
-                                                          - notes are rendered with [*] sign in the text body; the text of the note
-                                                            appears on "mouse-over" and is reproduced in the end.
--->
+<!-- This is a stylesheet that gives a "diplomatic" presentation of old French 
+	manuscript transcriptions - abbreviations are resolved and rendered in italics; 
+	- agglutinations and deglutinations are not marked (word limits are "normalized"); 
+	- Strong punctuation is marked with a dot followed by a capital letter; weak 
+	punctuation is marked with a comma. - direct speech is marked with darkblue 
+	color; - uncertain readings are marked with grey background color; - text 
+	deleted in the original is not visualized; - text corrected in the normalized 
+	version is marked with darkred color and followed by "(sic!)" note; - notes 
+	are rendered with [*] sign in the text body; the text of the note appears 
+	on "mouse-over" and is reproduced in the end. -->
 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
-                <xsl:include href="mdv_common.xsl"/>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+	<xsl:include href="mdv_common.xsl" />
 
-                <xsl:param name="form">diplomatique</xsl:param>
+	<xsl:param name="form">
+		diplomatique
+	</xsl:param>
 
-                <xsl:variable name="mode">dipl</xsl:variable>
+	<xsl:variable name="mode">
+		dipl
+	</xsl:variable>
 
-                <xsl:output method="html" encoding="UTF-8" version="4.0" indent="yes"/>
+	<xsl:output method="html" encoding="UTF-8" version="4.0"
+		indent="yes" />
 
-                <xsl:strip-space elements="*"/>
+	<xsl:strip-space elements="*" />
 
-                <!--                <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/>
-                                
-                                <xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/>
-                                
-                                <xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/>
-                                
-                                <xsl:variable name="author" select="//titleStmt/author"/>
-                -->
+	<!-- <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/> 
+		<xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/> 
+		<xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/> 
+		<xsl:variable name="author" select="//titleStmt/author"/> -->
 
-                <xsl:template match="//tei:p|//tei:head">
-                                <p>
-                                                <xsl:if test="@n"> [ § <xsl:value-of select="@n"
-                                                  />]&#xa0; </xsl:if>
-                                                <xsl:apply-templates mode="dipl"/>
-                                </p>
-                </xsl:template>
+	<xsl:template match="//tei:p|//tei:head">
+		<p>
+			<xsl:if test="@n">
+				[ §
+				<xsl:value-of select="@n" />
+				]&#xa0;
+			</xsl:if>
+			<xsl:apply-templates mode="dipl" />
+		</p>
+	</xsl:template>
 
-                <xsl:template match="tei:pb" mode="dipl">
-                                <xsl:call-template name="pb_common"/>
-                </xsl:template>
+	<xsl:template match="tei:pb" mode="dipl">
+		<xsl:call-template name="pb_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:cb" mode="dipl">
-                                <xsl:call-template name="cb_common"/>
-                </xsl:template>
+	<xsl:template match="tei:cb" mode="dipl">
+		<xsl:call-template name="cb_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:note" mode="dipl">
-                                <xsl:call-template name="note_common"/>
-                </xsl:template>
+	<xsl:template match="tei:note" mode="dipl">
+		<xsl:call-template name="note_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:q" mode="dipl">
-                                <span style="background-color:khaki">
-                                                <xsl:apply-templates mode="dipl"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:q" mode="dipl">
+		<span style="background-color:khaki">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:gap" mode="dipl">
-                                <xsl:call-template name="gap_common"/>
-                </xsl:template>
+	<xsl:template match="tei:gap" mode="dipl">
+		<xsl:call-template name="gap_common" />
+	</xsl:template>
 
 
-                <xsl:template match="//tei:lb[@ed='norm']" mode="dipl"> </xsl:template>
+	<xsl:template match="//tei:lb[@ed='norm']" mode="dipl">
+	</xsl:template>
 
-                <xsl:template match="//tei:lb[not(@ed)]" mode="dipl">
-                                <xsl:choose>
-                                                <xsl:when
-                                                  test="position()=1 and not(ancestor::tei:seg)"/>
-                                                <xsl:when
-                                                  test="preceding::tei:w[1][descendant::bfm:headlb]"/>
-                                                <xsl:when
-                                                  test="preceding::tei:w[1][descendant::tei:lb]"/>
-                                                <xsl:otherwise>
-                                                  <br/>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
+	<xsl:template match="//tei:lb[not(@ed)]" mode="dipl">
+		<xsl:choose>
+			<xsl:when test="position()=1 and not(ancestor::tei:seg)" />
+			<xsl:when test="preceding::tei:w[1][descendant::bfm:headlb]" />
+			<xsl:when test="preceding::tei:w[1][descendant::tei:lb]" />
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-                <xsl:template match="//tei:lb[@ed='facs']" mode="dipl">
-                                <xsl:text>-</xsl:text>
-                                <br/>
-                </xsl:template>
+	<xsl:template match="//tei:lb[@ed='facs']" mode="dipl">
+		<xsl:text>-</xsl:text>
+		<br />
+	</xsl:template>
 
-                <xsl:template match="//tei:w|//bfm:punct" mode="dipl">
-                                <span class="word" id="{@xml:id}" title="{@type}">
-                                                <xsl:apply-templates select="descendant::me:dipl"
-                                                  mode="dipl"/>
-                                                <xsl:if
-                                                  test="descendant::tei:sic and not(following-sibling::tei:w[1][descendant::tei:sic])">
-                                                  <i>
-                                                  <xsl:text> (sic !)</xsl:text>
-                                                  </i>
-                                                </xsl:if>
-                                                <xsl:choose>
-                                                  <xsl:when
-                                                  test="following::*[1][self::bfm:punct][contains(., ',') or contains(., '.') or contains(., ']')or contains(., ')')]"/>
-                                                  <xsl:when test="@bfm:aggl='elision'">'</xsl:when>
-                                                  <xsl:otherwise>
-                                                  <xsl:text> </xsl:text>
-                                                  </xsl:otherwise>
-                                                </xsl:choose>
-                                </span>
-                </xsl:template>
+	<xsl:template match="//tei:w|//bfm:punct" mode="dipl">
+		<span class="word" id="{@xml:id}" title="{@type}">
+			<xsl:apply-templates select="descendant::me:dipl"
+				mode="dipl" />
+			<xsl:if
+				test="descendant::tei:sic and not(following-sibling::tei:w[1][descendant::tei:sic])">
+				<i>
+					<xsl:text> (sic !)</xsl:text>
+				</i>
+			</xsl:if>
+			<xsl:choose>
+				<xsl:when
+					test="following::*[1][self::bfm:punct][contains(., ',') or contains(., '.') or contains(., ']')or contains(., ')')]" />
+				<xsl:when test="@bfm:aggl='elision'">
+					'
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:ex" mode="dipl">
-                                <xsl:choose>
-                                                <xsl:when test="@cert='high'">
-                                                  <span style="color:darkgreen;font-style:italic">
-                                                  <xsl:apply-templates mode="dipl"/>
-                                                  </span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                  <span style="color:darkred;font-style:italic">
-                                                  <xsl:apply-templates mode="dipl"/>
-                                                  </span>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
+	<xsl:template match="tei:ex" mode="dipl">
+		<xsl:choose>
+			<xsl:when test="@cert='high'">
+				<span style="color:darkgreen;font-style:italic">
+					<xsl:apply-templates mode="dipl" />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:darkred;font-style:italic">
+					<xsl:apply-templates mode="dipl" />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-                <xsl:template match="tei:sic" mode="dipl">
-                                <span style="color:darkred" title="sic!">
-                                                <xsl:apply-templates mode="dipl"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:sic" mode="dipl">
+		<span style="color:darkred" title="sic!">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:subst" mode="dipl">[<xsl:apply-templates mode="dipl"
-                                />]</xsl:template>
+	<xsl:template match="tei:subst" mode="dipl">
+		[
+		<xsl:apply-templates mode="dipl" />
+		]
+	</xsl:template>
 
-                <xsl:template match="tei:del" mode="dipl">
-                                <span style="color:red;text-decoration:line-through">
-                                                <xsl:apply-templates mode="dipl"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:del" mode="dipl">
+		<span style="color:red;text-decoration:line-through">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:add[not(@seq)]" mode="dipl">
-                                <span style="color:blue;text-decoration:underline">
-                                                <xsl:apply-templates mode="dipl"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:add[not(@seq)]" mode="dipl">
+		<span style="color:blue;text-decoration:underline">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:add[@seq]" mode="dipl">
-                                <span style="color:blue">
-                                                <sup>&lt;<xsl:value-of select="@seq"/></sup>
-                                                <xsl:apply-templates mode="dipl"/>
-                                                <sup><xsl:value-of select="@seq"/>&gt;</sup>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:add[@seq]" mode="dipl">
+		<span style="color:blue">
+			<sup>
+				&lt;
+				<xsl:value-of select="@seq" />
+			</sup>
+			<xsl:apply-templates mode="dipl" />
+			<sup>
+				<xsl:value-of select="@seq" />
+				&gt;
+			</sup>
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:unclear" mode="dipl">
-                                <span style="background-color:lightgrey">
-                                                <xsl:apply-templates mode="dipl"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:unclear" mode="dipl">
+		<span style="background-color:lightgrey">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:hi[@rend='initiale']" mode="dipl">
-                                <span style="font-weight:bold;font-size:xx-large">
-                                                <xsl:apply-templates mode="dipl"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:hi[@rend='initiale']" mode="dipl">
+		<span style="font-weight:bold;font-size:xx-large">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="//tei:hi[@rend='sup']" mode="dipl">
-                                <sup>
-                                                <xsl:apply-templates mode="dipl"/>
-                                </sup>
-                </xsl:template>
+	<xsl:template match="//tei:hi[@rend='sup']" mode="dipl">
+		<sup>
+			<xsl:apply-templates mode="dipl" />
+		</sup>
+	</xsl:template>
 
 
 
-                <!-- 
-
-
-<xsl:template match="tei:name">
-	<xsl:value-of select="@reg"/>
-</xsl:template>
-
-                -->
+	<!-- <xsl:template match="tei:name"> <xsl:value-of select="@reg"/> </xsl:template> -->
 </xsl:stylesheet>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_frmod.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_frmod.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_frmod.xsl	(revision 2397)
@@ -1,175 +1,213 @@
 <?xml version='1.0'?>
 
-<!--
-                #######################################
-                Qgraal_cm BASIC stylesheet
-                
-                #######################################
-                author: Alexei Lavrentiev
-                version: 1.2
-                date: 2009-02-16
-                
-                version: 1.1
-                date: 2008-09-30
-                
-                version: 1.0
-                date: 2008-02-21
-                
-                #######################################
-                Description
-                This is a basic stylesheet for viewing BFM texts in XML-TEI
-                Modified for QGRAAL modern French translation
-                
--->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
-                version="1.0"> 
+<!-- ####################################### Qgraal_cm BASIC stylesheet ####################################### 
+	author: Alexei Lavrentiev version: 1.2 date: 2009-02-16 version: 1.1 date: 
+	2008-09-30 version: 1.0 date: 2008-02-21 ####################################### 
+	Description This is a basic stylesheet for viewing BFM texts in XML-TEI Modified 
+	for QGRAAL modern French translation -->
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0" version="1.0">
 
-                <xsl:output method="html" encoding="utf-8" version="4.0" indent="yes"/>
-                
-                <xsl:strip-space elements="*"/>
-                
-                
-                <xsl:template match="/">
-<!--                                <html>
-                                                <head>
-                                                                <title>Quête du Graal (français moderne)</title>
-                                                </head>
-                                                <body style="margin-left:10%;margin-right:10%">-->
-                                                                <xsl:apply-templates select="//tei:text"/>			
-<!--                                                </body>		
-                                </html>	-->
-                </xsl:template>
+	<xsl:output method="html" encoding="utf-8" version="4.0"
+		indent="yes" />
 
-                <!-- TEI-Header Processing -->
-                
-                <xsl:template match="//tei:teiHeader">
-                </xsl:template>
-                
-                <!-- End of TEI-header processing -->
-                
-                <!-- Text body processing -->
+	<xsl:strip-space elements="*" />
 
-                <!-- "Original" titles found sometimes immediately before text body -->
-                <xsl:template match="//tei:div[@type='titre']">
-                                <p align="center"><b><xsl:apply-templates/></b></p>
-                </xsl:template>
-                
-                <!-- Text divisions (general) -->
-                <xsl:template match="//tei:div[not(@type='titre')]">
-                                <xsl:if test="child::tei:head">
-                                                <xsl:apply-templates select="head"/><br/>                                                
-                                </xsl:if>
-                                <xsl:apply-templates select="*[not(self::tei:head)]"/>                                
-                </xsl:template>
-                
-                <!-- Paragraphs -->
-                <xsl:template match="//tei:text//tei:p">
-                                <p align="justify"><xsl:apply-templates/></p>
-                </xsl:template>
-                
 
-                
-<!-- Page breaks -->                
-              
-                <xsl:template match="//tei:pb[@ed='Pauphilet1923']">
-                                (p. <xsl:value-of select="@n"/>)
-                </xsl:template>
+	<xsl:template match="/">
+		<!-- <html> <head> <title>Quête du Graal (français moderne)</title> </head> 
+			<body style="margin-left:10%;margin-right:10%"> -->
+		<xsl:apply-templates select="//tei:text" />
+		<!-- </body> </html> -->
+	</xsl:template>
 
-                <xsl:template match="//tei:milestone[@unit='column']">
-                                <br/><span style="color:darkviolet;font-family:arial;font-size:80%">&lt;<xsl:value-of select="@xml:id"/>&gt;</span>
-                </xsl:template>
-                
+	<!-- TEI-Header Processing -->
 
-                <!-- Line breaks : note special processing for numbered lb used in BFM verse texts -->
-                <xsl:template match="tei:lb">
-                                                                <xsl:if test="not(parent::tei:p and not(preceding-sibling::*))"><br/></xsl:if>
-                </xsl:template>
-                
-              
-                <!-- Processing elements with "rend" attributes  -->
-                
-                <xsl:template match="//*[@rend='ital']">
-                                <i><xsl:apply-templates/></i>
-                </xsl:template>
+	<xsl:template match="//tei:teiHeader">
+	</xsl:template>
 
-                <xsl:template match="//*[@rend='gras']">
-                                <b><xsl:apply-templates/></b>
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='exp']">
-                                <sup><xsl:apply-templates/></sup>
-                </xsl:template>
+	<!-- End of TEI-header processing -->
 
-                <xsl:template match="//*[@rend='ind']">
-                                <sub><xsl:apply-templates/></sub>
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='maj']">
-                                <span style="text-transform:uppercase"><xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='pmaj']">
-<span style="font-variant:small-caps"><xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='crochets']">[<xsl:apply-templates/>]</xsl:template>
+	<!-- Text body processing -->
 
-                <xsl:template match="//*[@rend='chevrons']">
-                                <xsl:text>&lt;</xsl:text><xsl:apply-templates/><xsl:text>&gt; </xsl:text>
-                </xsl:template>
-                                
-                <xsl:template match="//*[@rend='crochets-ital']">
-                                <xsl:text>[</xsl:text><i><xsl:apply-templates/></i><xsl:text>]</xsl:text>
-                </xsl:template>
-                                
+	<!-- "Original" titles found sometimes immediately before text body -->
+	<xsl:template match="//tei:div[@type='titre']">
+		<p align="center">
+			<b>
+				<xsl:apply-templates />
+			</b>
+		</p>
+	</xsl:template>
 
-                <!-- Numbers -->
-                <xsl:template match="tei:num">
-                                <span style="color:blue"><xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <!-- Notes -->
-                <xsl:template match="tei:note">
-                                <span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] </span>	
-                </xsl:template>
-                
-                <!-- Word formatting for morphologically tagged texts -->
-                <xsl:strip-space elements="tei:s"/>
-                <xsl:template match="//text()[starts-with(., ' ')][preceding-sibling::*[1][self::tei:w]]">
-                                <xsl:copy-of select="substring(., 2)"/>
-                </xsl:template>
-                <xsl:template match="//tei:w">
-                                <span title="{@type}" class="word" id="{@xml:id}" >
-                                <xsl:variable name="apostrophe" select='"&apos;"'/>
-                                <xsl:apply-templates/>
-                                <xsl:choose>
-                                                <xsl:when test="following::tei:w[1][starts-with(@type, 'pon')][contains(., ',') or contains(., '.') or contains(., ']')or contains(., ')')]">
-                                                </xsl:when>
-                                                <xsl:when test="following::node()[1][self::text()][starts-with(normalize-space(.), ',') or starts-with(normalize-space(.), '.') or starts-with(normalize-space(.), ']') or starts-with(normalize-space(.), ')')]">
-                                                </xsl:when>
-                                                <xsl:when test="self::tei:w[starts-with(@type, 'pon')][contains(., '[') or contains(., '(')]">
-                                                </xsl:when>
-                                                <xsl:when test="substring(., string-length(.))=$apostrophe">
-                                                </xsl:when>
-                                                <xsl:when test="following::tei:w[1][starts-with(@type, 'pon')][contains(., ':') or contains(., ';') or contains(., '!')or contains(., '?')]">
-                                                                <xsl:text>&#xa0;</xsl:text>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <xsl:text> </xsl:text>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                                                </span>
-                </xsl:template>
-                
-<xsl:template match="tei:ptr"/>
+	<!-- Text divisions (general) -->
+	<xsl:template match="//tei:div[not(@type='titre')]">
+		<xsl:if test="child::tei:head">
+			<xsl:apply-templates select="head" />
+			<br />
+		</xsl:if>
+		<xsl:apply-templates
+			select="*[not(self::tei:head)]" />
+	</xsl:template>
 
-                <!--  Direct speech, not currently tagged -->
-                <xsl:template match="tei:q[ancestor::tei:q]">
-                                <span style="background-color:cyan"> <xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:q[not(ancestor::tei:q)]">
-                                <span style="background-color:lightcyan"> <xsl:apply-templates/></span>
-                </xsl:template>
-                
+	<!-- Paragraphs -->
+	<xsl:template match="//tei:text//tei:p">
+		<p align="justify">
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
+
+
+
+	<!-- Page breaks -->
+
+	<xsl:template match="//tei:pb[@ed='Pauphilet1923']">
+		(p.
+		<xsl:value-of select="@n" />
+		)
+	</xsl:template>
+
+	<xsl:template match="//tei:milestone[@unit='column']">
+		<br />
+		<span style="color:darkviolet;font-family:arial;font-size:80%">
+			&lt;
+			<xsl:value-of select="@xml:id" />
+			&gt;
+		</span>
+	</xsl:template>
+
+
+	<!-- Line breaks : note special processing for numbered lb used in BFM verse 
+		texts -->
+	<xsl:template match="tei:lb">
+		<xsl:if test="not(parent::tei:p and not(preceding-sibling::*))">
+			<br />
+		</xsl:if>
+	</xsl:template>
+
+
+	<!-- Processing elements with "rend" attributes -->
+
+	<xsl:template match="//*[@rend='ital']">
+		<i>
+			<xsl:apply-templates />
+		</i>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='gras']">
+		<b>
+			<xsl:apply-templates />
+		</b>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='exp']">
+		<sup>
+			<xsl:apply-templates />
+		</sup>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='ind']">
+		<sub>
+			<xsl:apply-templates />
+		</sub>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='maj']">
+		<span style="text-transform:uppercase">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='pmaj']">
+		<span style="font-variant:small-caps">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='crochets']">
+		[
+		<xsl:apply-templates />
+		]
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='chevrons']">
+		<xsl:text>&lt;</xsl:text>
+		<xsl:apply-templates />
+		<xsl:text>&gt; </xsl:text>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='crochets-ital']">
+		<xsl:text>[</xsl:text>
+		<i>
+			<xsl:apply-templates />
+		</i>
+		<xsl:text>]</xsl:text>
+	</xsl:template>
+
+
+	<!-- Numbers -->
+	<xsl:template match="tei:num">
+		<span style="color:blue">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<!-- Notes -->
+	<xsl:template match="tei:note">
+		<span style="color:violet">
+			[
+			<b>Note :</b>
+			<xsl:apply-templates />
+			]
+		</span>
+	</xsl:template>
+
+	<!-- Word formatting for morphologically tagged texts -->
+	<xsl:strip-space elements="tei:s" />
+	<xsl:template
+		match="//text()[starts-with(., ' ')][preceding-sibling::*[1][self::tei:w]]">
+		<xsl:copy-of select="substring(., 2)" />
+	</xsl:template>
+	<xsl:template match="//tei:w">
+		<span title="{@type}" class="word" id="{@xml:id}">
+			<xsl:variable name="apostrophe" select='"&apos;"' />
+			<xsl:apply-templates />
+			<xsl:choose>
+				<xsl:when
+					test="following::tei:w[1][starts-with(@type, 'pon')][contains(., ',') or contains(., '.') or contains(., ']')or contains(., ')')]">
+				</xsl:when>
+				<xsl:when
+					test="following::node()[1][self::text()][starts-with(normalize-space(.), ',') or starts-with(normalize-space(.), '.') or starts-with(normalize-space(.), ']') or starts-with(normalize-space(.), ')')]">
+				</xsl:when>
+				<xsl:when
+					test="self::tei:w[starts-with(@type, 'pon')][contains(., '[') or contains(., '(')]">
+				</xsl:when>
+				<xsl:when test="substring(., string-length(.))=$apostrophe">
+				</xsl:when>
+				<xsl:when
+					test="following::tei:w[1][starts-with(@type, 'pon')][contains(., ':') or contains(., ';') or contains(., '!')or contains(., '?')]">
+					<xsl:text>&#xa0;</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:ptr" />
+
+	<!-- Direct speech, not currently tagged -->
+	<xsl:template match="tei:q[ancestor::tei:q]">
+		<span style="background-color:cyan">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:q[not(ancestor::tei:q)]">
+		<span style="background-color:lightcyan">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/breakByMilestone.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/breakByMilestone.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/breakByMilestone.xsl	(revision 2397)
@@ -1,75 +1,83 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
 
-    <!-- Based on a stylesheet for creating separate XML-TEI files for
-        each page by Paul Caton (posted on TEI-L 2008-12-11)-->
+	<!-- Based on a stylesheet for creating separate XML-TEI files for each 
+		page by Paul Caton (posted on TEI-L 2008-12-11) -->
 
-    <xsl:output method="xml" encoding="UTF-8"/>
+	<xsl:output method="xml" encoding="UTF-8" />
 
-    <xsl:param name="pbval1">7</xsl:param>
-    <xsl:param name="pbval2">8</xsl:param>
+	<xsl:param name="pbval1">
+		7
+	</xsl:param>
+	<xsl:param name="pbval2">
+		8
+	</xsl:param>
 
-    <xsl:function name="tei:page-content" as="node()*">
-        <xsl:param name="pb1" as="node()"/>
-        <xsl:param name="pb2" as="node()"/>
-        <xsl:param name="node" as="node()"/>
-        <xsl:choose>
-            <xsl:when test="$node[self::*]">
-                <!-- $node is an element() -->
-                <xsl:choose>
-                    <!--                    <xsl:when test="$node is $pb1">
-                        <xsl:copy-of select="$node"/>
-                    </xsl:when>
--->
-                    <xsl:when
-                        test="some $n in $node/descendant::* satisfies ($n is $pb1 or $n is $pb2)">
-                        <xsl:element name="{name($node)}" namespace="http://www.tei-c.org/ns/1.0">
-                            <!--<xsl:attribute name="testttt">http://www.menota.org/ns/1.0</xsl:attribute>-->
-                            <xsl:sequence select="for $i in ( $node/node() | $node/@* ) return tei:page-content($pb1, $pb2, $i)"/>
-                        </xsl:element>
-                    </xsl:when>
-                    <xsl:when test="($node >> $pb1) and ($node &lt;&lt; $pb2)">
-                        <xsl:copy-of select="$node"/>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <!-- do nothing -->
-                    </xsl:otherwise>
-                </xsl:choose>
-            </xsl:when>
-            <xsl:when test="$node[count(. | ../@*) = count(../@*)]">
-                <!-- $node is an attribute -->
-                <xsl:attribute name="{name($node)}">
-                    <xsl:sequence select="data($node)"/>
+	<xsl:function name="tei:page-content" as="node()*">
+		<xsl:param name="pb1" as="node()" />
+		<xsl:param name="pb2" as="node()" />
+		<xsl:param name="node" as="node()" />
+		<xsl:choose>
+			<xsl:when test="$node[self::*]">
+				<!-- $node is an element() -->
+				<xsl:choose>
+					<!-- <xsl:when test="$node is $pb1"> <xsl:copy-of select="$node"/> </xsl:when> -->
+					<xsl:when
+						test="some $n in $node/descendant::* satisfies ($n is $pb1 or $n is $pb2)">
+						<xsl:element name="{name($node)}"
+							namespace="http://www.tei-c.org/ns/1.0">
+							<!--<xsl:attribute name="testttt">http://www.menota.org/ns/1.0</xsl:attribute> -->
+							<xsl:sequence
+								select="for $i in ( $node/node() | $node/@* ) return tei:page-content($pb1, $pb2, $i)" />
+						</xsl:element>
+					</xsl:when>
+					<xsl:when test="($node >> $pb1) and ($node &lt;&lt; $pb2)">
+						<xsl:copy-of select="$node" />
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- do nothing -->
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="$node[count(. | ../@*) = count(../@*)]">
+				<!-- $node is an attribute -->
+				<xsl:attribute name="{name($node)}">
+                    <xsl:sequence select="data($node)" />
                 </xsl:attribute>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:choose>
-                    <xsl:when test="($node >> $pb1) and ($node &lt;&lt; $pb2)">
-                        <xsl:copy-of select="$node"/>
-                    </xsl:when>
-                    <xsl:otherwise>
-                        <!-- do nothing -->
-                    </xsl:otherwise>
-                </xsl:choose>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:function>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:choose>
+					<xsl:when test="($node >> $pb1) and ($node &lt;&lt; $pb2)">
+						<xsl:copy-of select="$node" />
+					</xsl:when>
+					<xsl:otherwise>
+						<!-- do nothing -->
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
 
-    <xsl:template match="*|text()|@*">
-        <xsl:copy>
-            <xsl:apply-templates select="@*"/>
-            <xsl:apply-templates/>
-        </xsl:copy>
-    </xsl:template>
+	<xsl:template match="*|text()|@*">
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
 
-    <xsl:template match="processing-instruction()">
-        <xsl:copy>
-            <xsl:value-of select="."/>
-        </xsl:copy>
-    </xsl:template>
+	<xsl:template match="processing-instruction()">
+		<xsl:copy>
+			<xsl:value-of select="." />
+		</xsl:copy>
+	</xsl:template>
 
-    <xsl:template match="tei:body">
-        <!-- <xsl:variable name="containingNode" select="//tei:text"/> -->
-        <xsl:sequence select="tei:page-content(//tei:milestone[@unit='column'][@n=$pbval1], //tei:milestone[@unit='column'][@n=$pbval2], //tei:body)"/>
-    </xsl:template>
+	<xsl:template match="tei:body">
+		<!-- <xsl:variable name="containingNode" select="//tei:text"/> -->
+		<xsl:sequence
+			select="tei:page-content(//tei:milestone[@unit='column'][@n=$pbval1], //tei:milestone[@unit='column'][@n=$pbval2], //tei:body)" />
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_cour.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_cour.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_cour.xsl	(revision 2397)
@@ -1,583 +1,772 @@
 <?xml version='1.0'?>
 
-<!--
-                #######################################
-                Qgraal_cm BASIC stylesheet
-                
-                #######################################
-                author: Alexei Lavrentiev
-                
-                version: 3.3
-                date: 2011-06-03
-                (handling agglutinations of "en cours de figement" phrases)
+<!-- ####################################### Qgraal_cm BASIC stylesheet ####################################### 
+	author: Alexei Lavrentiev version: 3.3 date: 2011-06-03 (handling agglutinations 
+	of "en cours de figement" phrases) version: 3.2 date: 2011-01-19 (handling 
+	inline and final notes) version: 3.1 date: 2010-06-17 (utf-8 encoding; correcting 
+	spacing after "sic : " and "comma" sign) version: 3.0 date: 2010-01-25 (adding 
+	table with line numbers and text in different columns) version: 2.0 date: 
+	2009-08-24 (including multi-facet transcription) version: 1.2 date: 2009-02-16 
+	version: 1.1 date: 2008-09-30 version: 1.0 date: 2008-02-21 ####################################### 
+	Description This is a basic stylesheet for viewing BFM texts in XML-TEI -->
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0" version="1.0">
 
-                version: 3.2
-                date: 2011-01-19
-                (handling inline and final notes) 
-                
-                version: 3.1
-                date: 2010-06-17
-                (utf-8 encoding; correcting spacing after "sic : " and "comma" sign)
+	<xsl:output method="html" encoding="utf-8" indent="yes" />
 
-                version: 3.0
-                date: 2010-01-25
-                (adding table with line numbers and text in different columns)
-                
-                version: 2.0
-                date: 2009-08-24
-                (including multi-facet transcription)
-                
-                version: 1.2
-                date: 2009-02-16
-                
-                version: 1.1
-                date: 2008-09-30
-                
-                version: 1.0
-                date: 2008-02-21
-                
-                #######################################
-                Description
-                This is a basic stylesheet for viewing BFM texts in XML-TEI
-                
--->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"  xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0"
-                version="1.0"> 
+	<xsl:strip-space elements="*" />
 
-                <xsl:output method = "html" encoding="utf-8" indent="yes"/>
-                
-                <xsl:strip-space elements="*"/>
-                
-                <xsl:variable name="title-source" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='source']"/>
-                
-                <xsl:variable name="title-normal" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='normal']"/>
-                
-                <xsl:variable name="title-ref" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='reference']"/>
+	<xsl:variable name="title-source"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='source']" />
 
-                
-                <xsl:variable name="author" select="//tei:titleStmt/tei:author"/>
-                
-                <xsl:variable name="apostrophe" select='"&apos;"'/>
-                
-<!--                <xsl:template match="/">
-                                <html>
-                                                <head>
-                                                                <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-                                                                <title>
-                                                                                <xsl:if test="$author[not(contains(.,'anonym'))]">
-                                                                                                <xsl:value-of select="$author"/><xsl:text> : </xsl:text>
-                                                                                </xsl:if>
-                                                                                <xsl:value-of select="$title-normal"/>
-                                                                </title>
-                                                                <xsl:apply-templates select="//tei:teiHeader"/>
-                                                </head>
-                                                <body style="margin-left:10%;margin-right:10%">
-                                                                <div class="text">
-                                                                <xsl:apply-templates select="//tei:text"/>
-                                                                </div>
-                                                                <div class="notes">
-                                                                                <p align="center"><b>Notes</b></p>
-                                                                                <xsl:apply-templates select="//tei:note[not(@place='inline')]" mode="notes"/>
-                                                                                </div>
-                                                </body>		
-                                </html>	
-                </xsl:template>
--->
-                
-                <xsl:template match="/">
-                                <xsl:apply-templates select="//tei:text//tei:p|//tei:note[@place='inline']"/>
-                </xsl:template>
+	<xsl:variable name="title-normal"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='normal']" />
 
-                <!-- TEI-Header Processing -->
-                
-                <xsl:template match="//tei:teiHeader">
-	<p align="center">
-	                
-	                <!-- Author (only appears if not anonymous) -->
-	                <xsl:if test="$author[not(contains(.,'anonym'))]">
-	                                <span style="font-variant:small-caps;font-weight:bold"><xsl:value-of select="$author"/></span><br/>                
-	                </xsl:if>
-	                <!-- Title -->
-	                <span style="color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size:200%"><xsl:value-of select="$title-normal"/></span><br/>
-	                <!-- Scientific editor(s) -->
-	                Edition par <xsl:apply-templates select="//tei:titleStmt/tei:editor[@role='editor']"/><br/>
-	                Avec la collaboration de <xsl:apply-templates select="//tei:titleStmt/tei:editor[@role='associate_editor']"/><br/>
-	                
-	                <!-- Series Statement, Publisher, Year 	
-	                <xsl:apply-templates select="fileDesc/seriesStmt/title"/><br/>
-	                <xsl:apply-templates select="//sourceDesc//publicationStmt/pubPlace"/>,
-	                <xsl:apply-templates select="//sourceDesc//publicationStmt/publisher"/>,
-	                <xsl:apply-templates select="//sourceDesc//publicationStmt/date"/>
-	                
-	                -->
-	</p>
-                                
-                                <!-- Information on the electronic version  -->                
-	<p align="center">_____________________________________________________<br/><br/>
-	<span style="font-size:75%">Edition électronique<br/>
-	                Dernière révision : <xsl:value-of select="//tei:revisionDesc/tei:change[1]/@when"/></span><br/>
-	                _____________________________________________________</p>
-                                <p align="center">Version courante<br/>
-                                _____________________________________________________</p>
-                                
-                </xsl:template>
+	<xsl:variable name="title-ref"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='reference']" />
 
-                <!-- Last change date formatting 
-                <xsl:template match="//revisionDesc/change/date[following-sibling::item[contains(.,'Dernière mise à jour')]]">
-                                <xsl:value-of select="substring-before(., ' 00:')"/>
-                </xsl:template> -->
-                
-                <!-- End of TEI-header processing -->
-                
-                <!-- Text body processing -->
 
-                <!-- "Original" titles found sometimes immediately before text body -->
-                <xsl:template match="//tei:div[@type='titre']">
-                                <p align="center"><b><xsl:apply-templates/></b></p>
-                </xsl:template>
-                
-                <!-- Text divisions (general) -->
-                <xsl:template match="//tei:div[not(@type='titre')]">
-                                <xsl:if test="child::tei:head">
-                                                <xsl:apply-templates select="head"/><br/>                                                
-                                </xsl:if>
-                                <xsl:apply-templates select="*[not(self::tei:head)]"/>                                
-                </xsl:template>
-                
-                <!-- Paragraphs -->
-                <xsl:template match="//tei:text//tei:p">
-                                             <table width="100%" style="border:none">
-                                                             <tr style="border:none">
-                                                                             <td width="10%" valign="top" style="white-space:nowrap;padding-right:10pt;line-height:18px;font-family:Arial;font-size:14px;border-:none;text-align:right">
-                                                                                             <xsl:if test="@n"><span style="color:gray;font-size:12px">[§ <xsl:value-of select="@n"/>] </span></xsl:if><xsl:apply-templates select="descendant::tei:lb|descendant::tei:milestone[@unit='column']" mode="number"/></td>
-                                                                             <td valign="top" style="white-space:nowrap;line-height:18px;font-family:Arial;font-size:14px;border:none">&#xa0;<xsl:apply-templates/></td>
-                                             </tr>
-                                             </table>
-                </xsl:template>
-                
+	<xsl:variable name="author"
+		select="//tei:titleStmt/tei:author" />
 
-                
-                <!--<xsl:template match="//p[@rend]/lb[1][@n]">
-                                <br/>[<xsl:value-of select="@n"/>]
-                                </xsl:template> -->
-                
-<!-- Page breaks -->                
-              
-                <xsl:template match="//tei:pb[@ed='Pauphilet1923']">
-                                (p. <xsl:value-of select="@n"/>)
-                </xsl:template>
+	<xsl:variable name="apostrophe" select='"&apos;"' />
 
-                <xsl:template match="//tei:milestone[@unit='column'][ancestor::tei:p]">
-                                <br/>&#xa0;<br/><span style="color:darkviolet;font-family:arial;font-size:80%">&lt;<xsl:value-of select="substring-after(@xml:id,'col_')"/>&gt;</span><br/>
-                </xsl:template>
-                
-                <xsl:template match="//tei:milestone[@unit='column'][ancestor::tei:p]" mode="number">
-                                <br/>&#xa0;<br/><span style="color:darkviolet;font-family:arial;font-size:80%">&#xa0;</span><br/>
-                </xsl:template>
-                
-                <xsl:template match="//tei:milestone[@unit='column'][not(ancestor::tei:p)]">
-                                <table width="100%">
-                                                <tr>
-                                                                <td width="10%" align="right" valign="top" style="padding-right:10pt"><span style="color:darkviolet;font-family:arial;font-size:80%">&#xa0;</span></td>
-                                                                <td valign="top" style="white-space:nowrap"><span style="color:darkviolet;font-family:arial;font-size:80%">&lt;<xsl:value-of select="substring-after(@xml:id,'col_')"/>&gt;</span></td>
-                                                </tr>
-                                </table>                                
-                </xsl:template>
-                
+	<!-- <xsl:template match="/"> <html> <head> <meta http-equiv="Content-Type" 
+		content="text/html;charset=UTF-8" /> <title> <xsl:if test="$author[not(contains(.,'anonym'))]"> 
+		<xsl:value-of select="$author"/><xsl:text> : </xsl:text> </xsl:if> <xsl:value-of 
+		select="$title-normal"/> </title> <xsl:apply-templates select="//tei:teiHeader"/> 
+		</head> <body style="margin-left:10%;margin-right:10%"> <div class="text"> 
+		<xsl:apply-templates select="//tei:text"/> </div> <div class="notes"> <p 
+		align="center"><b>Notes</b></p> <xsl:apply-templates select="//tei:note[not(@place='inline')]" 
+		mode="notes"/> </div> </body> </html> </xsl:template> -->
 
-                <xsl:template match="tei:lb">
-                                <xsl:choose>
-                                                <xsl:when test="@ed='facs'"></xsl:when>
-                                                <xsl:when test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
-                                                <xsl:otherwise><br/></xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="tei:lb" mode="number">
-                                <xsl:choose>
-                                                <xsl:when test="@ed='facs'"></xsl:when>
-                                                <xsl:when test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
-                                                <xsl:otherwise><br/>&#xa0;</xsl:otherwise>
-                                </xsl:choose>
-                                <xsl:if test="substring(@n, string-length(@n)) = 0 or substring(@n, string-length(@n)) = 5"><xsl:value-of select="@n"/></xsl:if>
-                </xsl:template>
-                
-              
-                <!-- Processing elements with "rend" attributes  -->
-                
-                <xsl:template match="//*[@rend='ital']">
-                                <i>
-                                                <xsl:choose>
-                                                                <xsl:when test="self::tei:hi">
-                                                                                <span style="color:blue"><xsl:apply-templates/></span>
-                                                                </xsl:when>
-                                                                <xsl:when test="self::tei:foreign">
-                                                                                <span style="color:darkblue"><xsl:apply-templates/></span>
-                                                                </xsl:when>
-                                                                <xsl:otherwise>
-                                                                                <span style="color:red"><xsl:apply-templates/></span>
-                                                                </xsl:otherwise>
-                                                </xsl:choose>
-                                </i>
-                </xsl:template>
+	<xsl:template match="/">
+		<xsl:apply-templates
+			select="//tei:text//tei:p|//tei:note[@place='inline']" />
+	</xsl:template>
 
-                <xsl:template match="//*[@rend='gras']">
-                                <b>
-                                                <xsl:choose>
-                                                                <xsl:when test="self::tei:hi">
-                                                                                <span style="color:blue"><xsl:apply-templates/></span>
-                                                                </xsl:when>
-                                                                <xsl:otherwise>
-                                                                                <span style="color:red"><xsl:apply-templates/></span>
-                                                                </xsl:otherwise>
-                                                </xsl:choose>
-                                </b>
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='exp']">
-                                <sup>
-                                                <xsl:choose>
-                                                                <xsl:when test="self::tei:hi">
-                                                                                <span style="color:blue"><xsl:apply-templates/></span>
-                                                                </xsl:when>
-                                                                <xsl:otherwise>
-                                                                                <span style="color:red"><xsl:apply-templates/></span>
-                                                                </xsl:otherwise>
-                                                </xsl:choose>                                                
-                                </sup>
-                </xsl:template>
+	<!-- TEI-Header Processing -->
 
-                <xsl:template match="//*[@rend='ind']">
-                                <sub>
-                                                <xsl:choose>
-                                                                <xsl:when test="self::tei:hi">
-                                                                                <span style="color:blue"><xsl:apply-templates/></span>
-                                                                </xsl:when>
-                                                                <xsl:otherwise>
-                                                                                <span style="color:red"><xsl:apply-templates/></span>
-                                                                </xsl:otherwise>
-                                                </xsl:choose>                                                
-                                </sub>
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='maj']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:hi">
-                                                                <span style="text-transform:uppercase;color:blue"><xsl:apply-templates/></span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="text-transform:uppercase;color:red"><xsl:apply-templates/></span>
-                                                </xsl:otherwise>
-                                </xsl:choose>                                
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='pmaj']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:hi">
-                                                                <span style="font-variant:small-caps;color:blue"><xsl:apply-templates/></span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="font-variant:small-caps;color:red"><xsl:apply-templates/></span>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                                
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='crochets']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:corr">
-                                                                <span style="color:brown"> [<xsl:apply-templates/>] </span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="color:red"> [<xsl:apply-templates/>] </span>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                                
-                </xsl:template>
+	<xsl:template match="//tei:teiHeader">
+		<p align="center">
 
-                <xsl:template match="//*[@rend='chevrons']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:corr">
-                                                                <span style="color:brown"><xsl:text>&lt;</xsl:text><xsl:apply-templates/><xsl:text>&gt; </xsl:text></span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="color:red"><xsl:text>&lt;</xsl:text><xsl:apply-templates/><xsl:text>&gt; </xsl:text></span>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                                
-                </xsl:template>
-                                
-                <xsl:template match="//*[@rend='crochets-ital']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:head">
-                                                                <span style="color:indigo">
-                                                                                <xsl:text>[</xsl:text>
-                                                                                <i>
-                                                                                                <xsl:if test="parent::div[@n]">
-                                                                                                                <xsl:value-of select="parent::div/@n"/>
-                                                                                                                <xsl:text>. </xsl:text>
-                                                                                                </xsl:if>
-                                                                                                <xsl:apply-templates/>
-                                                                                </i>
-                                                                                <xsl:text>]</xsl:text>
-                                                                </span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="color:red">
-                                                                                <xsl:text> [</xsl:text>
-                                                                                <i>
-                                                                                                <xsl:if test="parent::div[@n]">
-                                                                                                                <xsl:value-of select="parent::div/@n"/>
-                                                                                                                <xsl:text>. </xsl:text>
-                                                                                                </xsl:if>
-                                                                                                <xsl:apply-templates/>
-                                                                                </i>
-                                                                                <xsl:text>] </xsl:text>
-                                                                </span>                                                               
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                                
-                <xsl:template match="//*[@rend='crochets-maj']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:head">
-                                                                <span style="font-family:Times;text-transform:uppercase;color:indigo">
-                                                                                <xsl:text>[</xsl:text>
-                                                                                <xsl:if test="parent::div[@n]">
-                                                                                                <xsl:value-of select="parent::div/@n"/>
-                                                                                                <xsl:text>. </xsl:text>
-                                                                                </xsl:if>
-                                                                                <xsl:apply-templates/>
-                                                                                <xsl:text>]</xsl:text>
-                                                                </span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="text-transform:uppercase;color:red"> [<xsl:apply-templates/>] </span>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='crochets-pmaj']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:head">
-                                                                <span style="font-family:Times;font-variant:small-caps;color:indigo">
-                                                                                <xsl:text>[</xsl:text>
-                                                                                <xsl:if test="parent::tei:div[@n]">
-                                                                                                <xsl:value-of select="parent::tei:div/@n"/>
-                                                                                                <xsl:text>. </xsl:text>
-                                                                                </xsl:if>
-                                                                                <xsl:apply-templates/>
-                                                                                <xsl:text>]</xsl:text>
-                                                                </span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="font-variant:small-caps;color:red"> [<xsl:apply-templates/>] </span>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='points']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:gap">
-                                                                <span style="color:brown"><xsl:text> . . . . . . . . .  </xsl:text></span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="color:red"><xsl:text> . . . . . . . . .  </xsl:text></span>
-                                                </xsl:otherwise>
-                                </xsl:choose>                                
-                </xsl:template>
-                
-                <xsl:template match="//*[@rend='susp']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:gap">
-                                                                <span style="color:brown"><xsl:text> ... </xsl:text></span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="color:red"><xsl:text> ... </xsl:text></span>
-                                                </xsl:otherwise>
-                                </xsl:choose>                                
-                </xsl:template>
+			<!-- Author (only appears if not anonymous) -->
+			<xsl:if test="$author[not(contains(.,'anonym'))]">
+				<span style="font-variant:small-caps;font-weight:bold">
+					<xsl:value-of select="$author" />
+				</span>
+				<br />
+			</xsl:if>
+			<!-- Title -->
+			<span
+				style="color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size:200%">
+				<xsl:value-of select="$title-normal" />
+			</span>
+			<br />
+			<!-- Scientific editor(s) -->
+			Edition par
+			<xsl:apply-templates
+				select="//tei:titleStmt/tei:editor[@role='editor']" />
+			<br />
+			Avec la collaboration de
+			<xsl:apply-templates
+				select="//tei:titleStmt/tei:editor[@role='associate_editor']" />
+			<br />
 
-                <xsl:template match="//*[@rend='crochets-susp']">
-                                <xsl:choose>
-                                                <xsl:when test="self::tei:gap">
-                                                                <span style="color:brown"><xsl:text> [...] </xsl:text></span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <span style="color:red"><xsl:text> [...] </xsl:text></span>
-                                                </xsl:otherwise>
-                                </xsl:choose>                                
-                </xsl:template>                
-                <!-- End of @rend processing -->
+			<!-- Series Statement, Publisher, Year <xsl:apply-templates select="fileDesc/seriesStmt/title"/><br/> 
+				<xsl:apply-templates select="//sourceDesc//publicationStmt/pubPlace"/>, <xsl:apply-templates 
+				select="//sourceDesc//publicationStmt/publisher"/>, <xsl:apply-templates 
+				select="//sourceDesc//publicationStmt/date"/> -->
+		</p>
 
-                <!-- Gaps without normalized @rend -->
-                <xsl:template match="tei:gap[not(@rend)]">
-                                <span style="color:darkblue"><xsl:text> [...] </xsl:text></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:gap[@rend][not(@rend='susp' or @rend='points' or @rend='crochets-susp')]">
-                                <span style="color:orange"><xsl:text> [...] </xsl:text></span>
-                </xsl:template>
-                
-                <!-- Corrections without normalized @rend -->
-                
-                <xsl:template match="tei:choice">
-                                <span title="{child::tei:corr/@type}"><xsl:apply-templates select="tei:corr"/><xsl:text> </xsl:text><xsl:apply-templates select="tei:sic"/></span>
-                                <xsl:if test="not(ancestor::tei:w)">
-                                                <xsl:call-template name="spacing"/>
-                                </xsl:if>
-                </xsl:template>
-                
-                <xsl:template match="tei:corr[not(@rend)]">
-                                <span style="color:darkblue;background-color:yellow"><xsl:text> </xsl:text><xsl:apply-templates/><xsl:text> </xsl:text></span>
-                </xsl:template>
-                
-<!--                <xsl:template match="tei:corr[@rend][not(@rend='crochets' or @rend='chevrons')]">
-                                <span style="color:orange"> <i><xsl:value-of select="@rend"/></i><xsl:text> </xsl:text></span><xsl:apply-templates/>
-                </xsl:template>
--->                
-                <xsl:template match="tei:sic">(<i>sic&#xa0;:</i><xsl:text> </xsl:text><span style="background-color:pink"><xsl:apply-templates/></span>)</xsl:template>
-                <!--  Supplied text -->
-                
-                <xsl:template match="tei:supplied">
-                                <span style="color:blue">[<xsl:apply-templates/>]</span>
-                                <xsl:if test="not(ancestor::tei:w)"><xsl:call-template name="spacing"/></xsl:if>
-                </xsl:template>
-                
-                <!-- Deletions -->
-                
-                <xsl:template match="tei:del">
-                                <span style="background-color:lightpink"><xsl:apply-templates/></span>
-                </xsl:template>
+		<!-- Information on the electronic version -->
+		<p align="center">
+			_____________________________________________________
+			<br />
+			<br />
+			<span style="font-size:75%">
+				Edition électronique
+				<br />
+				Dernière révision :
+				<xsl:value-of
+					select="//tei:revisionDesc/tei:change[1]/@when" />
+			</span>
+			<br />
+			_____________________________________________________
+		</p>
+		<p align="center">
+			Version courante
+			<br />
+			_____________________________________________________
+		</p>
 
-                <xsl:template match="tei:add">
-                                <span style="background-color:lightgreen"><xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <!-- Redundant text -->
-                
-                <xsl:template match="tei:surplus">(<span style="background-color:lightpink"><xsl:apply-templates/></span><xsl:text> </xsl:text><i>répété</i>)<xsl:call-template name="spacing"></xsl:call-template></xsl:template>
-                
-                
-                <!-- Numbers -->
-                <xsl:template match="tei:num">
-                                <span style="color:blue"><xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <!-- Notes -->
-                <xsl:template match="tei:note[not(@place='inline')]">
-                                <xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) + 1"/></xsl:variable>
-                                <!--<a title="{.}" style="color:violet;font-size:75%" href="#note_{$note_count}" name="noteref_{$note_count}">[Note <xsl:value-of select="$note_count"/>]</a>-->
-                                <span title="{.}" style="color:violet">[<xsl:value-of select="$note_count"/>]</span>
-                                <xsl:call-template name="spacing"/>
-                </xsl:template>
-                
-                <xsl:template match="tei:note[not(@place='inline')]" mode="notes">
-                                <xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) + 1"/></xsl:variable>
-                                <p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:milestone[@unit='column'][1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>
-                </xsl:template>
-                
-                <xsl:template match="tei:note[@place='inline']">
-                                <p style="text-align:justify;text-indent:30px;padding-right:20px;padding-left:20px"><span style="color:blue;font-family:Times New Roman;font-style:italic"><xsl:value-of select="."/></span></p>
-                </xsl:template>
-                
-                <!-- Word formatting for morphologically tagged texts -->
-                <xsl:strip-space elements="tei:s"/>
-                <xsl:template match="//text()[starts-with(., ' ')][preceding-sibling::*[1][self::tei:w]]">
-                                <xsl:copy-of select="substring(., 2)"/>
-                </xsl:template>
-                
-                <xsl:template match="//tei:w"> <!-- modified 2011-06-03 -->                               
-                                <xsl:element name="span">
-                                                <xsl:attribute name="class">word</xsl:attribute>
-                                                <xsl:attribute name="title"><xsl:value-of select="@type"/></xsl:attribute>
-                                                <xsl:attribute name="id"><xsl:value-of select="@xml:id"/></xsl:attribute>
-                                                <xsl:if test="@rend='fgmt'">
-                                                                <xsl:attribute name="style">color:red</xsl:attribute>
-                                                </xsl:if>
-                                                <xsl:choose>
-                                                                <xsl:when test="descendant::me:norm">
-                                                                                <xsl:apply-templates select="descendant::me:norm"/>
-                                                                </xsl:when>
-                                                                <xsl:otherwise>
-                                                                                <xsl:apply-templates/>
-                                                                </xsl:otherwise>
-                                                </xsl:choose>
-                                                
-                                </xsl:element>
-                                <xsl:call-template name="spacing"/>
-                                <!--<xsl:choose>
-                                                <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][contains(., ',') or contains(., '.') or contains(., ']')or contains(., ')')]">
-                                                </xsl:when>
-                                                <xsl:when test="following::node()[1][self::text()][starts-with(normalize-space(.), ',') or starts-with(normalize-space(.), '.') or starts-with(normalize-space(.), ']') or starts-with(normalize-space(.), ')')]">
-                                                </xsl:when>
-                                                <xsl:when test="self::tei:w[starts-with(@type, 'PON')][contains(., '[') or contains(., '(')]">
-                                                </xsl:when>
-                                                <xsl:when test="substring(., string-length(.))=$apostrophe">
-                                                </xsl:when>
-                                                <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][contains(., ':') or contains(., ';') or contains(., '!')or contains(., '?')]">
-                                                                <xsl:text>&#xa0;</xsl:text>
-                                                </xsl:when>
-                                                <xsl:when test="@rend='elision'">&apos;</xsl:when>
-                                                <xsl:otherwise>
-                                                                <xsl:text> </xsl:text>
-                                                </xsl:otherwise>
-                                </xsl:choose>-->
-                </xsl:template>
-                
-                <xsl:template match="//tei:w[not(starts-with(@type,'PON'))]/text()">
-                                <xsl:choose>
-                                                <xsl:when test="substring(., string-length(.))=$apostrophe">
-                                                                <xsl:value-of select="translate(.,$apostrophe,'’')"/>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                                <xsl:value-of select="."/>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
+	</xsl:template>
 
-<xsl:template name="spacing">
-                <xsl:choose>
-                                <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][starts-with(normalize-space(descendant::text()[1]), ',') or starts-with(normalize-space(descendant::text()[1]), '.') or starts-with(normalize-space(descendant::text()[1]), ']')or contains(., ')')]">
-                                </xsl:when>
-                                <xsl:when test="following::node()[1][self::text()][starts-with(normalize-space(.), ',') or starts-with(normalize-space(.), '.') or starts-with(normalize-space(.), ']') or starts-with(normalize-space(.), ')')]">
-                                </xsl:when>
-                                <xsl:when test="self::tei:w[starts-with(@type, 'PON')][starts-with(normalize-space(descendant::text()[1]), '[') or starts-with(normalize-space(descendant::text()[1]), '(')]">
-                                </xsl:when>
-                                <xsl:when test="substring(., string-length(.))=$apostrophe and not(@type='PONfbl' or @type='PONpdr' or self::tei:note)">
-                                </xsl:when>
-                                <xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')] or ancestor::tei:surplus)"></xsl:when>
-                                <xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-                                <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][contains(., ':') or contains(., ';') or contains(., '!') or contains(., '?')]">
-                                                <xsl:text>&#xa0;</xsl:text>
-                                </xsl:when>
-                                <!--
-                                <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][contains(descendant::me:norm, ':') or contains(descendant::me:norm, ';') or contains(descendant::me:norm, '!')or contains(descendant::me:norm, '?')]">
-                                                <xsl:text>&#xa0;</xsl:text>
-                                </xsl:when>                                
-                                -->
-                                <xsl:when test="@rend='elision'">’</xsl:when>
-                                <!-- new 201106-03 -->
-                                <xsl:when test="@rend='fgmt'"></xsl:when>
-                                <xsl:otherwise>
-                                                <xsl:text> </xsl:text>
-                                </xsl:otherwise>
-                </xsl:choose>
-                
-</xsl:template>
+	<!-- Last change date formatting <xsl:template match="//revisionDesc/change/date[following-sibling::item[contains(.,'Dernière 
+		mise à jour')]]"> <xsl:value-of select="substring-before(., ' 00:')"/> </xsl:template> -->
 
-                <xsl:template match="tei:q[ancestor::tei:q[ancestor::tei:q]]">
-                                <span style="background-color:darkcyan"> <xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:q[ancestor::tei:q][not(ancestor::tei:q[ancestor::tei:q])]">
-                                <span style="background-color:cyan"> <xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:q[not(ancestor::tei:q)]">
-                                <span style="background-color:lightcyan"> <xsl:apply-templates/></span>
-                </xsl:template>
-                
-                <xsl:template match="bfm:sb"><span style="color:violet">_</span></xsl:template>
-                                
+	<!-- End of TEI-header processing -->
+
+	<!-- Text body processing -->
+
+	<!-- "Original" titles found sometimes immediately before text body -->
+	<xsl:template match="//tei:div[@type='titre']">
+		<p align="center">
+			<b>
+				<xsl:apply-templates />
+			</b>
+		</p>
+	</xsl:template>
+
+	<!-- Text divisions (general) -->
+	<xsl:template match="//tei:div[not(@type='titre')]">
+		<xsl:if test="child::tei:head">
+			<xsl:apply-templates select="head" />
+			<br />
+		</xsl:if>
+		<xsl:apply-templates
+			select="*[not(self::tei:head)]" />
+	</xsl:template>
+
+	<!-- Paragraphs -->
+	<xsl:template match="//tei:text//tei:p">
+		<table width="100%" style="border:none">
+			<tr style="border:none">
+				<td width="10%" valign="top"
+					style="white-space:nowrap;padding-right:10pt;line-height:18px;font-family:Arial;font-size:14px;border-:none;text-align:right">
+					<xsl:if test="@n">
+						<span style="color:gray;font-size:12px">
+							[§
+							<xsl:value-of select="@n" />
+							]
+						</span>
+					</xsl:if>
+					<xsl:apply-templates
+						select="descendant::tei:lb|descendant::tei:milestone[@unit='column']"
+						mode="number" />
+				</td>
+				<td valign="top"
+					style="white-space:nowrap;line-height:18px;font-family:Arial;font-size:14px;border:none">
+					&#xa0;
+					<xsl:apply-templates />
+				</td>
+			</tr>
+		</table>
+	</xsl:template>
+
+
+
+	<!--<xsl:template match="//p[@rend]/lb[1][@n]"> <br/>[<xsl:value-of select="@n"/>] 
+		</xsl:template> -->
+
+	<!-- Page breaks -->
+
+	<xsl:template match="//tei:pb[@ed='Pauphilet1923']">
+		(p.
+		<xsl:value-of select="@n" />
+		)
+	</xsl:template>
+
+	<xsl:template
+		match="//tei:milestone[@unit='column'][ancestor::tei:p]">
+		<br />
+		&#xa0;
+		<br />
+		<span style="color:darkviolet;font-family:arial;font-size:80%">
+			&lt;
+			<xsl:value-of select="substring-after(@xml:id,'col_')" />
+			&gt;
+		</span>
+		<br />
+	</xsl:template>
+
+	<xsl:template
+		match="//tei:milestone[@unit='column'][ancestor::tei:p]" mode="number">
+		<br />
+		&#xa0;
+		<br />
+		<span style="color:darkviolet;font-family:arial;font-size:80%">&#xa0;</span>
+		<br />
+	</xsl:template>
+
+	<xsl:template
+		match="//tei:milestone[@unit='column'][not(ancestor::tei:p)]">
+		<table width="100%">
+			<tr>
+				<td width="10%" align="right" valign="top"
+					style="padding-right:10pt">
+					<span style="color:darkviolet;font-family:arial;font-size:80%">&#xa0;</span>
+				</td>
+				<td valign="top" style="white-space:nowrap">
+					<span style="color:darkviolet;font-family:arial;font-size:80%">
+						&lt;
+						<xsl:value-of
+							select="substring-after(@xml:id,'col_')" />
+						&gt;
+					</span>
+				</td>
+			</tr>
+		</table>
+	</xsl:template>
+
+
+	<xsl:template match="tei:lb">
+		<xsl:choose>
+			<xsl:when test="@ed='facs'"></xsl:when>
+			<xsl:when
+				test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="tei:lb" mode="number">
+		<xsl:choose>
+			<xsl:when test="@ed='facs'"></xsl:when>
+			<xsl:when
+				test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
+			<xsl:otherwise>
+				<br />
+				&#xa0;
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if
+			test="substring(@n, string-length(@n)) = 0 or substring(@n, string-length(@n)) = 5">
+			<xsl:value-of select="@n" />
+		</xsl:if>
+	</xsl:template>
+
+
+	<!-- Processing elements with "rend" attributes -->
+
+	<xsl:template match="//*[@rend='ital']">
+		<i>
+			<xsl:choose>
+				<xsl:when test="self::tei:hi">
+					<span style="color:blue">
+						<xsl:apply-templates />
+					</span>
+				</xsl:when>
+				<xsl:when test="self::tei:foreign">
+					<span style="color:darkblue">
+						<xsl:apply-templates />
+					</span>
+				</xsl:when>
+				<xsl:otherwise>
+					<span style="color:red">
+						<xsl:apply-templates />
+					</span>
+				</xsl:otherwise>
+			</xsl:choose>
+		</i>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='gras']">
+		<b>
+			<xsl:choose>
+				<xsl:when test="self::tei:hi">
+					<span style="color:blue">
+						<xsl:apply-templates />
+					</span>
+				</xsl:when>
+				<xsl:otherwise>
+					<span style="color:red">
+						<xsl:apply-templates />
+					</span>
+				</xsl:otherwise>
+			</xsl:choose>
+		</b>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='exp']">
+		<sup>
+			<xsl:choose>
+				<xsl:when test="self::tei:hi">
+					<span style="color:blue">
+						<xsl:apply-templates />
+					</span>
+				</xsl:when>
+				<xsl:otherwise>
+					<span style="color:red">
+						<xsl:apply-templates />
+					</span>
+				</xsl:otherwise>
+			</xsl:choose>
+		</sup>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='ind']">
+		<sub>
+			<xsl:choose>
+				<xsl:when test="self::tei:hi">
+					<span style="color:blue">
+						<xsl:apply-templates />
+					</span>
+				</xsl:when>
+				<xsl:otherwise>
+					<span style="color:red">
+						<xsl:apply-templates />
+					</span>
+				</xsl:otherwise>
+			</xsl:choose>
+		</sub>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='maj']">
+		<xsl:choose>
+			<xsl:when test="self::tei:hi">
+				<span style="text-transform:uppercase;color:blue">
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="text-transform:uppercase;color:red">
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='pmaj']">
+		<xsl:choose>
+			<xsl:when test="self::tei:hi">
+				<span style="font-variant:small-caps;color:blue">
+					<xsl:apply-templates />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="font-variant:small-caps;color:red">
+					<xsl:apply-templates />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='crochets']">
+		<xsl:choose>
+			<xsl:when test="self::tei:corr">
+				<span style="color:brown">
+					[
+					<xsl:apply-templates />
+					]
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:red">
+					[
+					<xsl:apply-templates />
+					]
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='chevrons']">
+		<xsl:choose>
+			<xsl:when test="self::tei:corr">
+				<span style="color:brown">
+					<xsl:text>&lt;</xsl:text>
+					<xsl:apply-templates />
+					<xsl:text>&gt; </xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:red">
+					<xsl:text>&lt;</xsl:text>
+					<xsl:apply-templates />
+					<xsl:text>&gt; </xsl:text>
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='crochets-ital']">
+		<xsl:choose>
+			<xsl:when test="self::tei:head">
+				<span style="color:indigo">
+					<xsl:text>[</xsl:text>
+					<i>
+						<xsl:if test="parent::div[@n]">
+							<xsl:value-of select="parent::div/@n" />
+							<xsl:text>. </xsl:text>
+						</xsl:if>
+						<xsl:apply-templates />
+					</i>
+					<xsl:text>]</xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:red">
+					<xsl:text> [</xsl:text>
+					<i>
+						<xsl:if test="parent::div[@n]">
+							<xsl:value-of select="parent::div/@n" />
+							<xsl:text>. </xsl:text>
+						</xsl:if>
+						<xsl:apply-templates />
+					</i>
+					<xsl:text>] </xsl:text>
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='crochets-maj']">
+		<xsl:choose>
+			<xsl:when test="self::tei:head">
+				<span
+					style="font-family:Times;text-transform:uppercase;color:indigo">
+					<xsl:text>[</xsl:text>
+					<xsl:if test="parent::div[@n]">
+						<xsl:value-of select="parent::div/@n" />
+						<xsl:text>. </xsl:text>
+					</xsl:if>
+					<xsl:apply-templates />
+					<xsl:text>]</xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="text-transform:uppercase;color:red">
+					[
+					<xsl:apply-templates />
+					]
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='crochets-pmaj']">
+		<xsl:choose>
+			<xsl:when test="self::tei:head">
+				<span
+					style="font-family:Times;font-variant:small-caps;color:indigo">
+					<xsl:text>[</xsl:text>
+					<xsl:if test="parent::tei:div[@n]">
+						<xsl:value-of select="parent::tei:div/@n" />
+						<xsl:text>. </xsl:text>
+					</xsl:if>
+					<xsl:apply-templates />
+					<xsl:text>]</xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="font-variant:small-caps;color:red">
+					[
+					<xsl:apply-templates />
+					]
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='points']">
+		<xsl:choose>
+			<xsl:when test="self::tei:gap">
+				<span style="color:brown">
+					<xsl:text> . . . . . . . . .  </xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:red">
+					<xsl:text> . . . . . . . . .  </xsl:text>
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='susp']">
+		<xsl:choose>
+			<xsl:when test="self::tei:gap">
+				<span style="color:brown">
+					<xsl:text> ... </xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:red">
+					<xsl:text> ... </xsl:text>
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="//*[@rend='crochets-susp']">
+		<xsl:choose>
+			<xsl:when test="self::tei:gap">
+				<span style="color:brown">
+					<xsl:text> [...] </xsl:text>
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:red">
+					<xsl:text> [...] </xsl:text>
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- End of @rend processing -->
+
+	<!-- Gaps without normalized @rend -->
+	<xsl:template match="tei:gap[not(@rend)]">
+		<span style="color:darkblue">
+			<xsl:text> [...] </xsl:text>
+		</span>
+	</xsl:template>
+
+	<xsl:template
+		match="tei:gap[@rend][not(@rend='susp' or @rend='points' or @rend='crochets-susp')]">
+		<span style="color:orange">
+			<xsl:text> [...] </xsl:text>
+		</span>
+	</xsl:template>
+
+	<!-- Corrections without normalized @rend -->
+
+	<xsl:template match="tei:choice">
+		<span title="{child::tei:corr/@type}">
+			<xsl:apply-templates select="tei:corr" />
+			<xsl:text> </xsl:text>
+			<xsl:apply-templates select="tei:sic" />
+		</span>
+		<xsl:if test="not(ancestor::tei:w)">
+			<xsl:call-template name="spacing" />
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="tei:corr[not(@rend)]">
+		<span style="color:darkblue;background-color:yellow">
+			<xsl:text> </xsl:text>
+			<xsl:apply-templates />
+			<xsl:text> </xsl:text>
+		</span>
+	</xsl:template>
+
+	<!-- <xsl:template match="tei:corr[@rend][not(@rend='crochets' or @rend='chevrons')]"> 
+		<span style="color:orange"> <i><xsl:value-of select="@rend"/></i><xsl:text> 
+		</xsl:text></span><xsl:apply-templates/> </xsl:template> -->
+	<xsl:template match="tei:sic">
+		(
+		<i>sic&#xa0;:</i>
+		<xsl:text> </xsl:text>
+		<span style="background-color:pink">
+			<xsl:apply-templates />
+		</span>
+		)
+	</xsl:template>
+	<!-- Supplied text -->
+
+	<xsl:template match="tei:supplied">
+		<span style="color:blue">
+			[
+			<xsl:apply-templates />
+			]
+		</span>
+		<xsl:if test="not(ancestor::tei:w)">
+			<xsl:call-template name="spacing" />
+		</xsl:if>
+	</xsl:template>
+
+	<!-- Deletions -->
+
+	<xsl:template match="tei:del">
+		<span style="background-color:lightpink">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:add">
+		<span style="background-color:lightgreen">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<!-- Redundant text -->
+
+	<xsl:template match="tei:surplus">
+		(
+		<span style="background-color:lightpink">
+			<xsl:apply-templates />
+		</span>
+		<xsl:text> </xsl:text>
+		<i>répété</i>
+		)
+		<xsl:call-template name="spacing"></xsl:call-template>
+	</xsl:template>
+
+
+	<!-- Numbers -->
+	<xsl:template match="tei:num">
+		<span style="color:blue">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<!-- Notes -->
+	<xsl:template match="tei:note[not(@place='inline')]">
+		<xsl:variable name="note_count">
+			<xsl:value-of
+				select="count(preceding::tei:note[not(@place='inline')]) + 1" />
+		</xsl:variable>
+		<!--<a title="{.}" style="color:violet;font-size:75%" href="#note_{$note_count}" 
+			name="noteref_{$note_count}">[Note <xsl:value-of select="$note_count"/>]</a> -->
+		<span title="{.}" style="color:violet">
+			[
+			<xsl:value-of select="$note_count" />
+			]
+		</span>
+		<xsl:call-template name="spacing" />
+	</xsl:template>
+
+	<xsl:template match="tei:note[not(@place='inline')]"
+		mode="notes">
+		<xsl:variable name="note_count">
+			<xsl:value-of
+				select="count(preceding::tei:note[not(@place='inline')]) + 1" />
+		</xsl:variable>
+		<p>
+			<xsl:value-of select="$note_count" />
+			.
+			<a href="#noteref_{$note_count}" name="note_{$note_count}">
+				[
+				<xsl:value-of
+					select="preceding::tei:milestone[@unit='column'][1]/@xml:id" />
+				, l.
+				<xsl:value-of select="preceding::tei:lb[1]/@n" />
+				]
+			</a>
+			<xsl:text> </xsl:text>
+			<xsl:value-of select="." />
+		</p>
+	</xsl:template>
+
+	<xsl:template match="tei:note[@place='inline']">
+		<p
+			style="text-align:justify;text-indent:30px;padding-right:20px;padding-left:20px">
+			<span
+				style="color:blue;font-family:Times New Roman;font-style:italic">
+				<xsl:value-of select="." />
+			</span>
+		</p>
+	</xsl:template>
+
+	<!-- Word formatting for morphologically tagged texts -->
+	<xsl:strip-space elements="tei:s" />
+	<xsl:template
+		match="//text()[starts-with(., ' ')][preceding-sibling::*[1][self::tei:w]]">
+		<xsl:copy-of select="substring(., 2)" />
+	</xsl:template>
+
+	<xsl:template match="//tei:w"> <!-- modified 2011-06-03 -->
+		<xsl:element name="span">
+			<xsl:attribute name="class">word</xsl:attribute>
+			<xsl:attribute name="title"><xsl:value-of
+				select="@type" /></xsl:attribute>
+			<xsl:attribute name="id"><xsl:value-of
+				select="@xml:id" /></xsl:attribute>
+			<xsl:if test="@rend='fgmt'">
+				<xsl:attribute name="style">color:red</xsl:attribute>
+			</xsl:if>
+			<xsl:choose>
+				<xsl:when test="descendant::me:norm">
+					<xsl:apply-templates
+						select="descendant::me:norm" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+
+		</xsl:element>
+		<xsl:call-template name="spacing" />
+		<!--<xsl:choose> <xsl:when test="following::tei:w[1][starts-with(@type, 
+			'PON')][contains(., ',') or contains(., '.') or contains(., ']')or contains(., 
+			')')]"> </xsl:when> <xsl:when test="following::node()[1][self::text()][starts-with(normalize-space(.), 
+			',') or starts-with(normalize-space(.), '.') or starts-with(normalize-space(.), 
+			']') or starts-with(normalize-space(.), ')')]"> </xsl:when> <xsl:when test="self::tei:w[starts-with(@type, 
+			'PON')][contains(., '[') or contains(., '(')]"> </xsl:when> <xsl:when test="substring(., 
+			string-length(.))=$apostrophe"> </xsl:when> <xsl:when test="following::tei:w[1][starts-with(@type, 
+			'PON')][contains(., ':') or contains(., ';') or contains(., '!')or contains(., 
+			'?')]"> <xsl:text>&#xa0;</xsl:text> </xsl:when> <xsl:when test="@rend='elision'">&apos;</xsl:when> 
+			<xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> -->
+	</xsl:template>
+
+	<xsl:template
+		match="//tei:w[not(starts-with(@type,'PON'))]/text()">
+		<xsl:choose>
+			<xsl:when test="substring(., string-length(.))=$apostrophe">
+				<xsl:value-of select="translate(.,$apostrophe,'’')" />
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="." />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="spacing">
+		<xsl:choose>
+			<xsl:when
+				test="following::tei:w[1][starts-with(@type, 'PON')][starts-with(normalize-space(descendant::text()[1]), ',') or starts-with(normalize-space(descendant::text()[1]), '.') or starts-with(normalize-space(descendant::text()[1]), ']')or contains(., ')')]">
+			</xsl:when>
+			<xsl:when
+				test="following::node()[1][self::text()][starts-with(normalize-space(.), ',') or starts-with(normalize-space(.), '.') or starts-with(normalize-space(.), ']') or starts-with(normalize-space(.), ')')]">
+			</xsl:when>
+			<xsl:when
+				test="self::tei:w[starts-with(@type, 'PON')][starts-with(normalize-space(descendant::text()[1]), '[') or starts-with(normalize-space(descendant::text()[1]), '(')]">
+			</xsl:when>
+			<xsl:when
+				test="substring(., string-length(.))=$apostrophe and not(@type='PONfbl' or @type='PONpdr' or self::tei:note)">
+			</xsl:when>
+			<xsl:when
+				test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')] or ancestor::tei:surplus)"></xsl:when>
+			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
+			<xsl:when
+				test="following::tei:w[1][starts-with(@type, 'PON')][contains(., ':') or contains(., ';') or contains(., '!') or contains(., '?')]">
+				<xsl:text>&#xa0;</xsl:text>
+			</xsl:when>
+			<!-- <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][contains(descendant::me:norm, 
+				':') or contains(descendant::me:norm, ';') or contains(descendant::me:norm, 
+				'!')or contains(descendant::me:norm, '?')]"> <xsl:text>&#xa0;</xsl:text> 
+				</xsl:when> -->
+			<xsl:when test="@rend='elision'">
+				’
+			</xsl:when>
+			<!-- new 201106-03 -->
+			<xsl:when test="@rend='fgmt'"></xsl:when>
+			<xsl:otherwise>
+				<xsl:text> </xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+
+	</xsl:template>
+
+	<xsl:template
+		match="tei:q[ancestor::tei:q[ancestor::tei:q]]">
+		<span style="background-color:darkcyan">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<xsl:template
+		match="tei:q[ancestor::tei:q][not(ancestor::tei:q[ancestor::tei:q])]">
+		<span style="background-color:cyan">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:q[not(ancestor::tei:q)]">
+		<span style="background-color:lightcyan">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="bfm:sb">
+		<span style="color:violet">_</span>
+	</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_dipl.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_dipl.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_dipl.xsl	(revision 2397)
@@ -1,407 +1,560 @@
 <?xml version='1.0'?>
 
-<!-- This is a stylesheet that gives a "diplomatic" presentation of old French manuscript transcriptions
-	- abbreviations are resolved and rendered in italics;
-	- agglutinations are marked with a red +
-	- deglutinations are marked with e red _
-                                                          - Strong punctuation is marked with a dot followed by a capital letter;
-                                                             weak punctuation is marked with a comma.
-	- direct speech is marked with darkblue color;
-	- uncertain readings are marked with grey background color;
-	- text deleted in the original is not visualized;
-	- text corrected in the normalized version is marked with darkred
-                                                             color and followed by "(sic!)" note;
-                                                          - notes are rendered with [*] sign in the text body; the text of the note
-                                                            appears on "mouse-over" and is reproduced in the end.
--->
+<!-- This is a stylesheet that gives a "diplomatic" presentation of old French 
+	manuscript transcriptions - abbreviations are resolved and rendered in italics; 
+	- agglutinations are marked with a red + - deglutinations are marked with 
+	e red _ - Strong punctuation is marked with a dot followed by a capital letter; 
+	weak punctuation is marked with a comma. - direct speech is marked with darkblue 
+	color; - uncertain readings are marked with grey background color; - text 
+	deleted in the original is not visualized; - text corrected in the normalized 
+	version is marked with darkred color and followed by "(sic!)" note; - notes 
+	are rendered with [*] sign in the text body; the text of the note appears 
+	on "mouse-over" and is reproduced in the end. -->
 
 
 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
-                <xsl:import href="mdv_common.xsl"/>
-                <xsl:param name="form">diplomatique</xsl:param>
-                <xsl:variable name="mode">dipl</xsl:variable>
-                
-                <xsl:output method="html"  encoding="utf-8" indent="yes"/>
-                
-                <xsl:strip-space elements="*"/>
-                
-                <!--                <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/>
-                                
-                                <xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/>
-                                
-                                <xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/>
-                                
-                                <xsl:variable name="author" select="//titleStmt/author"/>
-                -->
-                
-<!--                <xsl:template match="//tei:p|//tei:head">
-                                <p>
-                                                <xsl:if test="@n">
-                                                                [ § <xsl:value-of select="@n"/>]&#xa0;
-                                                </xsl:if>
-                                                <xsl:apply-templates mode="dipl"/>
-                                </p>
-                </xsl:template>
--->                
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+	<xsl:import href="mdv_common.xsl" />
+	<xsl:param name="form">
+		diplomatique
+	</xsl:param>
+	<xsl:variable name="mode">
+		dipl
+	</xsl:variable>
 
-                <xsl:variable name="title-source" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='source']"/>
-                
-                <xsl:variable name="title-normal" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='normal']"/>
-                
-                <xsl:variable name="title-ref" select="//tei:fileDesc/tei:titleStmt/tei:title[@type='reference']"/>
-                
-                
-                <xsl:variable name="author" select="//tei:titleStmt/tei:author"/>
-                
-                <xsl:variable name="apostrophe" select='"&apos;"'/>
-                
-                
-<!--                <xsl:template match="/">
-                                <html>
-                                                <head>
-                                                                <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-                                                                <title>
-                                                                                <xsl:if test="$author[not(contains(.,'anonym'))]">
-                                                                                                <xsl:value-of select="$author"/><xsl:text> : </xsl:text>
-                                                                                </xsl:if>
-                                                                                <xsl:value-of select="$title-normal"/>
-                                                                </title>
-                                                                <xsl:apply-templates select="//tei:teiHeader"/>
-                                                </head>
-                                                <body style="margin-left:10%;margin-right:10%">
-                                                                <div class="text">
-                                                                                <xsl:apply-templates select="//tei:text"/>
-                                                                </div>
-                                                                <div class="notes">
-                                                                                <p align="center"><b>Notes</b></p>
-                                                                                <xsl:apply-templates select="//tei:note[not(@place='inline')]" mode="notes"/>
-                                                                </div>			
-                                                </body>		
-                                </html>	
-                </xsl:template>
--->                
-                <xsl:template match="/">
-                                <xsl:apply-templates select="//tei:note[@place='inline']" mode="dipl"/>
-                                <xsl:apply-templates select="//tei:text//tei:p|//tei:text//tei:head"/>                                
-                </xsl:template>
+	<xsl:output method="html" encoding="utf-8" indent="yes" />
 
+	<xsl:strip-space elements="*" />
 
-                
-                <!-- TEI-Header Processing -->
-                
-                <xsl:template match="//tei:teiHeader">
-                                <p align="center">
-                                                
-                                                <!-- Author (only appears if not anonymous) -->
-                                                <xsl:if test="$author[not(contains(.,'anonym'))]">
-                                                                <span style="font-variant:small-caps;font-weight:bold"><xsl:value-of select="$author"/></span><br/>                
-                                                </xsl:if>
-                                                <!-- Title -->
-                                                <span style="color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size:200%"><xsl:value-of select="$title-normal"/></span><br/>
-                                                <!-- Scientific editor(s) -->
-                                                Edition par <xsl:apply-templates select="//tei:titleStmt/tei:editor[@role='editor']"/><br/>
-                                                Avec la collaboration de <xsl:apply-templates select="//tei:titleStmt/tei:editor[@role='associate_editor']"/><br/>
-                                                
-                                                <!-- Series Statement, Publisher, Year 	
-                                                                <xsl:apply-templates select="fileDesc/seriesStmt/title"/><br/>
-                                                                <xsl:apply-templates select="//sourceDesc//publicationStmt/pubPlace"/>,
-                                                                <xsl:apply-templates select="//sourceDesc//publicationStmt/publisher"/>,
-                                                                <xsl:apply-templates select="//sourceDesc//publicationStmt/date"/>
-                                                                
-                                                -->
-                                </p>
-                                
-                                <!-- Information on the electronic version  -->                
-                                <p align="center">_____________________________________________________<br/><br/>
-                                                <span style="font-size:75%">Edition électronique<br/>
-                                                                Dernière révision : <xsl:value-of select="//tei:revisionDesc/tei:change[1]/@when"/></span><br/>
-                                                                _____________________________________________________</p>
-                                <p align="center">Version diplomatique
-                                                <br/>_____________________________________________________</p>
-                </xsl:template>
-                              
-                <!-- Gaps without normalized @rend -->
-                <xsl:template match="tei:gap[not(@rend)]" mode="dipl">
-                                <span style="color:darkblue"><xsl:text> [...] </xsl:text></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:gap[@rend][not(@rend='susp' or @rend='points' or @rend='crochets-susp')]" mode="dipl">
-                                <span style="color:orange"><xsl:text> [...] </xsl:text></span>
-                </xsl:template>
-                
-                <!-- Corrections without normalized @rend -->
-                
-                <xsl:template match="tei:choice" mode="dipl">
-                                <span title="{child::tei:corr/@type}"><xsl:apply-templates select="tei:corr" mode="dipl"/><xsl:text> </xsl:text><xsl:apply-templates select="tei:sic" mode="dipl"/></span>
-                                <xsl:if test="not(ancestor::tei:w)">
-                                                <xsl:call-template name="spacing"/>
-                                </xsl:if>
-                </xsl:template>
-                
-                <xsl:template match="tei:corr[not(@rend)]" mode="dipl">
-                                <span style="color:darkblue;background-color:yellow"><xsl:text> </xsl:text><xsl:apply-templates mode="dipl"/><xsl:text> </xsl:text></span>
-                </xsl:template>
-                
-                <!--                <xsl:template match="tei:corr[@rend][not(@rend='crochets' or @rend='chevrons')]">
-                                <span style="color:orange"> <i><xsl:value-of select="@rend"/></i><xsl:text> </xsl:text></span><xsl:apply-templates/>
-                                </xsl:template>
-                -->                
-                <xsl:template match="tei:sic" mode="dipl">(<i>sic&#xa0;:</i><xsl:text> </xsl:text><span style="background-color:pink"><xsl:apply-templates mode="dipl"/></span>)</xsl:template>
-                
-                              
-                <!--  Supplied text -->
-                
-                <xsl:template match="tei:supplied" mode="dipl">
-                                <span style="color:blue">[<xsl:apply-templates mode="dipl"/>]</span>
-                                <xsl:if test="not(ancestor::tei:w)"><xsl:call-template name="spacing"/></xsl:if>
-                </xsl:template>
-                
-                <!-- Deletions -->
-                
-                <xsl:template match="tei:del" mode="dipl">
-                                <span style="background-color:lightpink"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:add" mode="dipl">
-                                <span style="background-color:lightgreen"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                
-                <!-- Redundant text -->
-                
-                <xsl:template match="tei:surplus" mode="dipl">(<span style="background-color:lightpink"><xsl:apply-templates mode="dipl"/></span><xsl:text> </xsl:text><i>répété</i>)<xsl:call-template name="spacing"></xsl:call-template></xsl:template>
-                
-                <!-- Numbers -->
-                <xsl:template match="tei:num" mode="dipl">
-                                <span style="color:blue"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                                              
-                              
-                <!-- NOTES -->
-                
-                <xsl:template match="tei:note[not(@place='inline')]" mode="dipl">
-                                <xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) + 1"/></xsl:variable>
-                                <!--<a title="{.}" style="color:violet;font-size:75%" href="#note_{$note_count}" name="noteref_{$note_count}">[Note <xsl:value-of select="$note_count"/>]</a>-->
-                                <span title="{.}" style="color:violet">[<xsl:value-of select="$note_count"/>]</span>
-                                <xsl:call-template name="spacing"/>
-                </xsl:template>
-                
-                <xsl:template match="tei:note[not(@place='inline')]" mode="notes">
-                                <xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note[not(@place='inline')]) + 1"/></xsl:variable>
-                                <p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:milestone[@unit='column'][1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>
-                </xsl:template>
-                <xsl:template match="tei:note[@place='inline']" mode="dipl">
-                                <p style="text-align:justify;text-indent:30px;padding-right:20px;padding-left:20px"><span style="color:blue;font-family:Times;font-style:italic"><xsl:value-of select="."/></span></p>
-                </xsl:template>
-                
-                
-                
-                <xsl:template match="//tei:text//tei:p|//tei:text//tei:head">
-                                <table width="100%" style="border:none">
-                                                <tr>
-                                                                <td width="10%" valign="top" style="white-space:nowrap;padding-right:10pt;line-height:18px;font-family:Arial;font-size:14px;border:none;text-align:right">
-                                                                                <xsl:if test="@n"><span style="color:gray;font-size:12px">[§ <xsl:value-of select="@n"/>] </span></xsl:if><xsl:apply-templates select="descendant::tei:lb|descendant::tei:milestone[@unit='column']|descendant::tei:hi[@rend='initiale']" mode="number"/></td>
-                                                                <td valign="top" style="white-space:nowrap;line-height:18px;font-family:Arial;font-size:14px;border:none">&#xa0;<xsl:apply-templates mode="dipl"/></td>
-                                                </tr>
-                                </table>
-                </xsl:template>
-                
-                
-<!--                <xsl:template match="tei:pb" mode="dipl">
-                                <xsl:call-template name="pb_common"/>
-                </xsl:template>
+	<!-- <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/> 
+		<xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/> 
+		<xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/> 
+		<xsl:variable name="author" select="//titleStmt/author"/> -->
 
-                <xsl:template match="tei:cb" mode="dipl">
-                                <xsl:call-template name="cb_common"></xsl:call-template>
-                </xsl:template>
-                
-                <xsl:template match="tei:note" mode="dipl">
-                                <xsl:call-template name="note_common"></xsl:call-template>
-                </xsl:template>
+	<!-- <xsl:template match="//tei:p|//tei:head"> <p> <xsl:if test="@n"> [ 
+		§ <xsl:value-of select="@n"/>]&#xa0; </xsl:if> <xsl:apply-templates mode="dipl"/> 
+		</p> </xsl:template> -->
 
-                <xsl:template match="tei:q" mode="dipl">
-                                <span style="background-color:lightcyan"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:gap" mode="dipl">
-                                <xsl:call-template name="gap_common"></xsl:call-template>
-                </xsl:template>
--->                                
-      
-                <!-- Page breaks -->                
-                
-                <xsl:template match="//tei:pb[@ed='Pauphilet1923']" mode="dipl">
-                                (p. <xsl:value-of select="@n"/>)
-                </xsl:template>
-                
-                <xsl:template match="//tei:milestone[@unit='column'][ancestor::tei:p]" mode="dipl">
-                                <br/><br/><span style="color:darkviolet;font-family:arial;font-size:80%">&lt;<xsl:value-of select="substring-after(@xml:id,'col_')"/>&gt;</span><br/>
-                </xsl:template>
-                
-                <xsl:template match="//tei:milestone[@unit='column'][ancestor::tei:p]" mode="number">
-                                <br/>&#xa0;<br/><span style="color:darkviolet;font-family:arial;font-size:80%">&#xa0;</span><br/>
-                </xsl:template>
-                
-                <xsl:template match="//tei:milestone[@unit='column'][not(ancestor::tei:p)]">
-                                <table width="100%">
-                                                <tr>
-                                                                <td width="10%" align="right" valign="top" style="padding-right:10pt"><span style="color:darkviolet;font-family:arial;font-size:80%">&#xa0;</span></td>
-                                                                <td valign="top" style="white-space:nowrap"><span style="color:darkviolet;font-family:arial;font-size:80%">&lt;<xsl:value-of select="substring-after(@xml:id,'col_')"/>&gt;</span></td>
-                                                </tr>
-                                </table>                                
-                </xsl:template>
-                
-      
-                <xsl:template match="tei:lb" mode="dipl">
-                                <xsl:choose>
-                                                <xsl:when test="@ed='facs'"><xsl:text>-</xsl:text><br/></xsl:when>
-                                                <xsl:when test="@ed='norm' or preceding::tei:lb[1][@ed='facs']"></xsl:when>
-                                                <xsl:when test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
-                                                <xsl:otherwise><br/></xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="tei:lb" mode="number">
-                                <xsl:choose>
-                                                <xsl:when test="@ed='facs'"></xsl:when>
-                                                <xsl:when test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
-                                                <xsl:otherwise><br/>&#xa0;</xsl:otherwise>
-                                </xsl:choose>
-                                <xsl:if test="substring(@n, string-length(@n)) = 0 or substring(@n, string-length(@n)) = 5"><xsl:value-of select="@n"/></xsl:if>
-                </xsl:template>
-                                
-                
-                <!--<xsl:template match="//tei:lb[@ed='norm']" mode="dipl">                                
-                </xsl:template>
-                
-                <xsl:template match="//tei:lb[not(@ed)]" mode="dipl">
-                                <xsl:choose>
-                                                <xsl:when test="position()=1 and not(ancestor::tei:seg)"></xsl:when>
-                                                <xsl:when test="preceding::tei:w[1][descendant::bfm:headlb]"></xsl:when>
-                                                <xsl:when test="preceding::tei:w[1][descendant::tei:lb]"></xsl:when>
-                                                <xsl:otherwise><br/></xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <xsl:template match="//tei:lb[@ed='facs']" mode="dipl">
-                                <xsl:text>-</xsl:text><br/>
-                </xsl:template>-->
-                
-                
-                
-                               
-                <xsl:template match="//tei:w" mode="dipl">
-                                <span title="{@type}" class="word" id="{@xml:id}" >
-                                                <xsl:if test="@rend='fgmt'"><xsl:attribute name="style">color:red</xsl:attribute></xsl:if>
-                                                <xsl:if test="descendant::me:dipl">
-                                                                <xsl:apply-templates select="descendant::me:dipl" mode="dipl"/>
-                                                                <xsl:if test="descendant::tei:sic and not(following-sibling::tei:w[1][descendant::tei:sic])">
-                                                                                <i><xsl:text> (sic !)</xsl:text></i>
-                                                                </xsl:if>
-                                                </xsl:if>
-                                                <xsl:call-template name="spacing"/>
-                                </span>
-                </xsl:template>
-                
-<xsl:template name="spacing">
-                <xsl:choose>
-                                <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][starts-with(normalize-space(descendant::text()[1]), ',') or starts-with(normalize-space(descendant::text()[1]), '.') or starts-with(normalize-space(descendant::text()[1]), ']')or contains(., ')')]">
-                                </xsl:when>
-                                <xsl:when test="following::node()[1][self::text()][starts-with(normalize-space(.), ',') or starts-with(normalize-space(.), '.') or starts-with(normalize-space(.), ']') or starts-with(normalize-space(.), ')')]">
-                                </xsl:when>
-                                <xsl:when test="self::tei:w[starts-with(@type, 'PON')][starts-with(normalize-space(descendant::text()[1]), '[') or starts-with(normalize-space(descendant::text()[1]), '(')]">
-                                </xsl:when>
-                                <xsl:when test="substring(., string-length(.))=$apostrophe and not(@type='PONfbl' or @type='PONpdr' or self::tei:note)">
-                                </xsl:when>
-                                <xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')] or ancestor::tei:surplus)"></xsl:when>
-                                <xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
-                                <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][contains(., ':') or contains(., ';') or contains(., '!') or contains(., '?')]">
-                                                <xsl:text>&#xa0;</xsl:text>
-                                </xsl:when>
-                                <!--
-                                <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][contains(descendant::me:norm, ':') or contains(descendant::me:norm, ';') or contains(descendant::me:norm, '!')or contains(descendant::me:norm, '?')]">
-                                                <xsl:text>&#xa0;</xsl:text>
-                                </xsl:when>                                
-                                -->
-                                <xsl:when test="@rend='elision'">’</xsl:when>
-                                <!-- new 201106-03 -->
-                                <xsl:when test="@rend='fgmt'"></xsl:when>
-                                <xsl:otherwise>
-                                                <xsl:text> </xsl:text>
-                                </xsl:otherwise>
-                </xsl:choose>
-                
-</xsl:template>
+	<xsl:variable name="title-source"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='source']" />
 
-                
-                
-                <xsl:template match="tei:ex" mode="dipl">
-                                <xsl:choose>
-                                                <xsl:when test="@cert='high'"><span style="color:darkgreen;font-style:italic"><xsl:apply-templates mode="dipl"/></span></xsl:when>
-                                                <xsl:otherwise><span style="color:darkred;font-style:italic"><xsl:apply-templates mode="dipl"/></span></xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
-                
-                <!-- added degl -->
-                <xsl:template match="bfm:sb" mode="dipl"><span style="color:red">_</span></xsl:template>
-                
-<!--                <xsl:template match="tei:sic" mode="dipl">
-                                <span style="color:darkred" title="sic!"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:subst" mode="dipl">[<xsl:apply-templates mode="dipl"/>]</xsl:template>
-                
-                <xsl:template match="tei:del" mode="dipl">
-                                <span style="color:red;text-decoration:line-through"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:add[not(@seq)]" mode="dipl">
-                                <span style="color:blue;text-decoration:underline"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
--->                
-                <xsl:template match="tei:add[@seq]" mode="dipl">
-                                <span style="color:blue"><sup>&lt;<xsl:value-of select="@seq"/></sup><xsl:apply-templates mode="dipl"/><sup><xsl:value-of select="@seq"/>&gt;</sup></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:unclear" mode="dipl">
-                                <span style="background-color:lightgrey"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                <!-- font-size:xx-large enlevé -->
-                <xsl:template match="tei:hi[@rend='initiale']" mode="dipl">
-                                <span style="font-weight:bold;font-size:large"><xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
+	<xsl:variable name="title-normal"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='normal']" />
 
-                <xsl:template match="tei:hi[@rend='initiale']" mode="number">
-                                <span style="font-weight:bold;font-size:large">&#xa0;</span>
-                </xsl:template>
-                
-                <xsl:template match="//tei:hi[@rend='sup']" mode="dipl">
-                                <sup><xsl:apply-templates mode="dipl"/></sup>
-                </xsl:template>
-                
-                <!-- Discours direct -->
-                                <xsl:template match="tei:q[ancestor::tei:q[ancestor::tei:q]]" mode="dipl">
-                                <span style="background-color:darkcyan"> <xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:q[ancestor::tei:q][not(ancestor::tei:q[ancestor::tei:q])]" mode="dipl">
-                                <span style="background-color:cyan"> <xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                
-                <xsl:template match="tei:q[not(ancestor::tei:q)]" mode="dipl">
-                                <span style="background-color:lightcyan"> <xsl:apply-templates mode="dipl"/></span>
-                </xsl:template>
-                
-                <!--<xsl:template match="bfm:sb" mode="dipl"><span style="color:violet">_</span></xsl:template>-->
+	<xsl:variable name="title-ref"
+		select="//tei:fileDesc/tei:titleStmt/tei:title[@type='reference']" />
 
-                
-                
-                <!-- 
 
+	<xsl:variable name="author"
+		select="//tei:titleStmt/tei:author" />
 
-<xsl:template match="tei:name">
-	<xsl:value-of select="@reg"/>
-</xsl:template>
+	<xsl:variable name="apostrophe" select='"&apos;"' />
 
-                -->
+
+	<!-- <xsl:template match="/"> <html> <head> <meta http-equiv="Content-Type" 
+		content="text/html;charset=UTF-8" /> <title> <xsl:if test="$author[not(contains(.,'anonym'))]"> 
+		<xsl:value-of select="$author"/><xsl:text> : </xsl:text> </xsl:if> <xsl:value-of 
+		select="$title-normal"/> </title> <xsl:apply-templates select="//tei:teiHeader"/> 
+		</head> <body style="margin-left:10%;margin-right:10%"> <div class="text"> 
+		<xsl:apply-templates select="//tei:text"/> </div> <div class="notes"> <p 
+		align="center"><b>Notes</b></p> <xsl:apply-templates select="//tei:note[not(@place='inline')]" 
+		mode="notes"/> </div> </body> </html> </xsl:template> -->
+	<xsl:template match="/">
+		<xsl:apply-templates
+			select="//tei:note[@place='inline']" mode="dipl" />
+		<xsl:apply-templates
+			select="//tei:text//tei:p|//tei:text//tei:head" />
+	</xsl:template>
+
+
+
+	<!-- TEI-Header Processing -->
+
+	<xsl:template match="//tei:teiHeader">
+		<p align="center">
+
+			<!-- Author (only appears if not anonymous) -->
+			<xsl:if test="$author[not(contains(.,'anonym'))]">
+				<span style="font-variant:small-caps;font-weight:bold">
+					<xsl:value-of select="$author" />
+				</span>
+				<br />
+			</xsl:if>
+			<!-- Title -->
+			<span
+				style="color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size:200%">
+				<xsl:value-of select="$title-normal" />
+			</span>
+			<br />
+			<!-- Scientific editor(s) -->
+			Edition par
+			<xsl:apply-templates
+				select="//tei:titleStmt/tei:editor[@role='editor']" />
+			<br />
+			Avec la collaboration de
+			<xsl:apply-templates
+				select="//tei:titleStmt/tei:editor[@role='associate_editor']" />
+			<br />
+
+			<!-- Series Statement, Publisher, Year <xsl:apply-templates select="fileDesc/seriesStmt/title"/><br/> 
+				<xsl:apply-templates select="//sourceDesc//publicationStmt/pubPlace"/>, <xsl:apply-templates 
+				select="//sourceDesc//publicationStmt/publisher"/>, <xsl:apply-templates 
+				select="//sourceDesc//publicationStmt/date"/> -->
+		</p>
+
+		<!-- Information on the electronic version -->
+		<p align="center">
+			_____________________________________________________
+			<br />
+			<br />
+			<span style="font-size:75%">
+				Edition électronique
+				<br />
+				Dernière révision :
+				<xsl:value-of
+					select="//tei:revisionDesc/tei:change[1]/@when" />
+			</span>
+			<br />
+			_____________________________________________________
+		</p>
+		<p align="center">
+			Version diplomatique
+			<br />
+			_____________________________________________________
+		</p>
+	</xsl:template>
+
+	<!-- Gaps without normalized @rend -->
+	<xsl:template match="tei:gap[not(@rend)]" mode="dipl">
+		<span style="color:darkblue">
+			<xsl:text> [...] </xsl:text>
+		</span>
+	</xsl:template>
+
+	<xsl:template
+		match="tei:gap[@rend][not(@rend='susp' or @rend='points' or @rend='crochets-susp')]"
+		mode="dipl">
+		<span style="color:orange">
+			<xsl:text> [...] </xsl:text>
+		</span>
+	</xsl:template>
+
+	<!-- Corrections without normalized @rend -->
+
+	<xsl:template match="tei:choice" mode="dipl">
+		<span title="{child::tei:corr/@type}">
+			<xsl:apply-templates select="tei:corr"
+				mode="dipl" />
+			<xsl:text> </xsl:text>
+			<xsl:apply-templates select="tei:sic" mode="dipl" />
+		</span>
+		<xsl:if test="not(ancestor::tei:w)">
+			<xsl:call-template name="spacing" />
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="tei:corr[not(@rend)]" mode="dipl">
+		<span style="color:darkblue;background-color:yellow">
+			<xsl:text> </xsl:text>
+			<xsl:apply-templates mode="dipl" />
+			<xsl:text> </xsl:text>
+		</span>
+	</xsl:template>
+
+	<!-- <xsl:template match="tei:corr[@rend][not(@rend='crochets' or @rend='chevrons')]"> 
+		<span style="color:orange"> <i><xsl:value-of select="@rend"/></i><xsl:text> 
+		</xsl:text></span><xsl:apply-templates/> </xsl:template> -->
+	<xsl:template match="tei:sic" mode="dipl">
+		(
+		<i>sic&#xa0;:</i>
+		<xsl:text> </xsl:text>
+		<span style="background-color:pink">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+		)
+	</xsl:template>
+
+
+	<!-- Supplied text -->
+
+	<xsl:template match="tei:supplied" mode="dipl">
+		<span style="color:blue">
+			[
+			<xsl:apply-templates mode="dipl" />
+			]
+		</span>
+		<xsl:if test="not(ancestor::tei:w)">
+			<xsl:call-template name="spacing" />
+		</xsl:if>
+	</xsl:template>
+
+	<!-- Deletions -->
+
+	<xsl:template match="tei:del" mode="dipl">
+		<span style="background-color:lightpink">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:add" mode="dipl">
+		<span style="background-color:lightgreen">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
+
+	<!-- Redundant text -->
+
+	<xsl:template match="tei:surplus" mode="dipl">
+		(
+		<span style="background-color:lightpink">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+		<xsl:text> </xsl:text>
+		<i>répété</i>
+		)
+		<xsl:call-template name="spacing"></xsl:call-template>
+	</xsl:template>
+
+	<!-- Numbers -->
+	<xsl:template match="tei:num" mode="dipl">
+		<span style="color:blue">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
+
+
+	<!-- NOTES -->
+
+	<xsl:template match="tei:note[not(@place='inline')]"
+		mode="dipl">
+		<xsl:variable name="note_count">
+			<xsl:value-of
+				select="count(preceding::tei:note[not(@place='inline')]) + 1" />
+		</xsl:variable>
+		<!--<a title="{.}" style="color:violet;font-size:75%" href="#note_{$note_count}" 
+			name="noteref_{$note_count}">[Note <xsl:value-of select="$note_count"/>]</a> -->
+		<span title="{.}" style="color:violet">
+			[
+			<xsl:value-of select="$note_count" />
+			]
+		</span>
+		<xsl:call-template name="spacing" />
+	</xsl:template>
+
+	<xsl:template match="tei:note[not(@place='inline')]"
+		mode="notes">
+		<xsl:variable name="note_count">
+			<xsl:value-of
+				select="count(preceding::tei:note[not(@place='inline')]) + 1" />
+		</xsl:variable>
+		<p>
+			<xsl:value-of select="$note_count" />
+			.
+			<a href="#noteref_{$note_count}" name="note_{$note_count}">
+				[
+				<xsl:value-of
+					select="preceding::tei:milestone[@unit='column'][1]/@xml:id" />
+				, l.
+				<xsl:value-of select="preceding::tei:lb[1]/@n" />
+				]
+			</a>
+			<xsl:text> </xsl:text>
+			<xsl:value-of select="." />
+		</p>
+	</xsl:template>
+	<xsl:template match="tei:note[@place='inline']"
+		mode="dipl">
+		<p
+			style="text-align:justify;text-indent:30px;padding-right:20px;padding-left:20px">
+			<span style="color:blue;font-family:Times;font-style:italic">
+				<xsl:value-of select="." />
+			</span>
+		</p>
+	</xsl:template>
+
+
+
+	<xsl:template
+		match="//tei:text//tei:p|//tei:text//tei:head">
+		<table width="100%" style="border:none">
+			<tr>
+				<td width="10%" valign="top"
+					style="white-space:nowrap;padding-right:10pt;line-height:18px;font-family:Arial;font-size:14px;border:none;text-align:right">
+					<xsl:if test="@n">
+						<span style="color:gray;font-size:12px">
+							[§
+							<xsl:value-of select="@n" />
+							]
+						</span>
+					</xsl:if>
+					<xsl:apply-templates
+						select="descendant::tei:lb|descendant::tei:milestone[@unit='column']|descendant::tei:hi[@rend='initiale']"
+						mode="number" />
+				</td>
+				<td valign="top"
+					style="white-space:nowrap;line-height:18px;font-family:Arial;font-size:14px;border:none">
+					&#xa0;
+					<xsl:apply-templates mode="dipl" />
+				</td>
+			</tr>
+		</table>
+	</xsl:template>
+
+
+	<!-- <xsl:template match="tei:pb" mode="dipl"> <xsl:call-template name="pb_common"/> 
+		</xsl:template> <xsl:template match="tei:cb" mode="dipl"> <xsl:call-template 
+		name="cb_common"></xsl:call-template> </xsl:template> <xsl:template match="tei:note" 
+		mode="dipl"> <xsl:call-template name="note_common"></xsl:call-template> </xsl:template> 
+		<xsl:template match="tei:q" mode="dipl"> <span style="background-color:lightcyan"><xsl:apply-templates 
+		mode="dipl"/></span> </xsl:template> <xsl:template match="tei:gap" mode="dipl"> 
+		<xsl:call-template name="gap_common"></xsl:call-template> </xsl:template> -->
+
+	<!-- Page breaks -->
+
+	<xsl:template match="//tei:pb[@ed='Pauphilet1923']"
+		mode="dipl">
+		(p.
+		<xsl:value-of select="@n" />
+		)
+	</xsl:template>
+
+	<xsl:template
+		match="//tei:milestone[@unit='column'][ancestor::tei:p]" mode="dipl">
+		<br />
+		<br />
+		<span style="color:darkviolet;font-family:arial;font-size:80%">
+			&lt;
+			<xsl:value-of select="substring-after(@xml:id,'col_')" />
+			&gt;
+		</span>
+		<br />
+	</xsl:template>
+
+	<xsl:template
+		match="//tei:milestone[@unit='column'][ancestor::tei:p]" mode="number">
+		<br />
+		&#xa0;
+		<br />
+		<span style="color:darkviolet;font-family:arial;font-size:80%">&#xa0;</span>
+		<br />
+	</xsl:template>
+
+	<xsl:template
+		match="//tei:milestone[@unit='column'][not(ancestor::tei:p)]">
+		<table width="100%">
+			<tr>
+				<td width="10%" align="right" valign="top"
+					style="padding-right:10pt">
+					<span style="color:darkviolet;font-family:arial;font-size:80%">&#xa0;</span>
+				</td>
+				<td valign="top" style="white-space:nowrap">
+					<span style="color:darkviolet;font-family:arial;font-size:80%">
+						&lt;
+						<xsl:value-of
+							select="substring-after(@xml:id,'col_')" />
+						&gt;
+					</span>
+				</td>
+			</tr>
+		</table>
+	</xsl:template>
+
+
+	<xsl:template match="tei:lb" mode="dipl">
+		<xsl:choose>
+			<xsl:when test="@ed='facs'">
+				<xsl:text>-</xsl:text>
+				<br />
+			</xsl:when>
+			<xsl:when
+				test="@ed='norm' or preceding::tei:lb[1][@ed='facs']"></xsl:when>
+			<xsl:when
+				test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="tei:lb" mode="number">
+		<xsl:choose>
+			<xsl:when test="@ed='facs'"></xsl:when>
+			<xsl:when
+				test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
+			<xsl:otherwise>
+				<br />
+				&#xa0;
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if
+			test="substring(@n, string-length(@n)) = 0 or substring(@n, string-length(@n)) = 5">
+			<xsl:value-of select="@n" />
+		</xsl:if>
+	</xsl:template>
+
+
+	<!--<xsl:template match="//tei:lb[@ed='norm']" mode="dipl"> </xsl:template> 
+		<xsl:template match="//tei:lb[not(@ed)]" mode="dipl"> <xsl:choose> <xsl:when 
+		test="position()=1 and not(ancestor::tei:seg)"></xsl:when> <xsl:when test="preceding::tei:w[1][descendant::bfm:headlb]"></xsl:when> 
+		<xsl:when test="preceding::tei:w[1][descendant::tei:lb]"></xsl:when> <xsl:otherwise><br/></xsl:otherwise> 
+		</xsl:choose> </xsl:template> <xsl:template match="//tei:lb[@ed='facs']" 
+		mode="dipl"> <xsl:text>-</xsl:text><br/> </xsl:template> -->
+
+
+
+
+	<xsl:template match="//tei:w" mode="dipl">
+		<span title="{@type}" class="word" id="{@xml:id}">
+			<xsl:if test="@rend='fgmt'">
+				<xsl:attribute name="style">color:red</xsl:attribute>
+			</xsl:if>
+			<xsl:if test="descendant::me:dipl">
+				<xsl:apply-templates
+					select="descendant::me:dipl" mode="dipl" />
+				<xsl:if
+					test="descendant::tei:sic and not(following-sibling::tei:w[1][descendant::tei:sic])">
+					<i>
+						<xsl:text> (sic !)</xsl:text>
+					</i>
+				</xsl:if>
+			</xsl:if>
+			<xsl:call-template name="spacing" />
+		</span>
+	</xsl:template>
+
+	<xsl:template name="spacing">
+		<xsl:choose>
+			<xsl:when
+				test="following::tei:w[1][starts-with(@type, 'PON')][starts-with(normalize-space(descendant::text()[1]), ',') or starts-with(normalize-space(descendant::text()[1]), '.') or starts-with(normalize-space(descendant::text()[1]), ']')or contains(., ')')]">
+			</xsl:when>
+			<xsl:when
+				test="following::node()[1][self::text()][starts-with(normalize-space(.), ',') or starts-with(normalize-space(.), '.') or starts-with(normalize-space(.), ']') or starts-with(normalize-space(.), ')')]">
+			</xsl:when>
+			<xsl:when
+				test="self::tei:w[starts-with(@type, 'PON')][starts-with(normalize-space(descendant::text()[1]), '[') or starts-with(normalize-space(descendant::text()[1]), '(')]">
+			</xsl:when>
+			<xsl:when
+				test="substring(., string-length(.))=$apostrophe and not(@type='PONfbl' or @type='PONpdr' or self::tei:note)">
+			</xsl:when>
+			<xsl:when
+				test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')] or ancestor::tei:surplus)"></xsl:when>
+			<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
+			<xsl:when
+				test="following::tei:w[1][starts-with(@type, 'PON')][contains(., ':') or contains(., ';') or contains(., '!') or contains(., '?')]">
+				<xsl:text>&#xa0;</xsl:text>
+			</xsl:when>
+			<!-- <xsl:when test="following::tei:w[1][starts-with(@type, 'PON')][contains(descendant::me:norm, 
+				':') or contains(descendant::me:norm, ';') or contains(descendant::me:norm, 
+				'!')or contains(descendant::me:norm, '?')]"> <xsl:text>&#xa0;</xsl:text> 
+				</xsl:when> -->
+			<xsl:when test="@rend='elision'">
+				’
+			</xsl:when>
+			<!-- new 201106-03 -->
+			<xsl:when test="@rend='fgmt'"></xsl:when>
+			<xsl:otherwise>
+				<xsl:text> </xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+
+	</xsl:template>
+
+
+
+	<xsl:template match="tei:ex" mode="dipl">
+		<xsl:choose>
+			<xsl:when test="@cert='high'">
+				<span style="color:darkgreen;font-style:italic">
+					<xsl:apply-templates mode="dipl" />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:darkred;font-style:italic">
+					<xsl:apply-templates mode="dipl" />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<!-- added degl -->
+	<xsl:template match="bfm:sb" mode="dipl">
+		<span style="color:red">_</span>
+	</xsl:template>
+
+	<!-- <xsl:template match="tei:sic" mode="dipl"> <span style="color:darkred" 
+		title="sic!"><xsl:apply-templates mode="dipl"/></span> </xsl:template> <xsl:template 
+		match="tei:subst" mode="dipl">[<xsl:apply-templates mode="dipl"/>]</xsl:template> 
+		<xsl:template match="tei:del" mode="dipl"> <span style="color:red;text-decoration:line-through"><xsl:apply-templates 
+		mode="dipl"/></span> </xsl:template> <xsl:template match="tei:add[not(@seq)]" 
+		mode="dipl"> <span style="color:blue;text-decoration:underline"><xsl:apply-templates 
+		mode="dipl"/></span> </xsl:template> -->
+	<xsl:template match="tei:add[@seq]" mode="dipl">
+		<span style="color:blue">
+			<sup>
+				&lt;
+				<xsl:value-of select="@seq" />
+			</sup>
+			<xsl:apply-templates mode="dipl" />
+			<sup>
+				<xsl:value-of select="@seq" />
+				&gt;
+			</sup>
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:unclear" mode="dipl">
+		<span style="background-color:lightgrey">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
+	<!-- font-size:xx-large enlevé -->
+	<xsl:template match="tei:hi[@rend='initiale']" mode="dipl">
+		<span style="font-weight:bold;font-size:large">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:hi[@rend='initiale']"
+		mode="number">
+		<span style="font-weight:bold;font-size:large">&#xa0;</span>
+	</xsl:template>
+
+	<xsl:template match="//tei:hi[@rend='sup']" mode="dipl">
+		<sup>
+			<xsl:apply-templates mode="dipl" />
+		</sup>
+	</xsl:template>
+
+	<!-- Discours direct -->
+	<xsl:template
+		match="tei:q[ancestor::tei:q[ancestor::tei:q]]" mode="dipl">
+		<span style="background-color:darkcyan">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
+
+	<xsl:template
+		match="tei:q[ancestor::tei:q][not(ancestor::tei:q[ancestor::tei:q])]"
+		mode="dipl">
+		<span style="background-color:cyan">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:q[not(ancestor::tei:q)]"
+		mode="dipl">
+		<span style="background-color:lightcyan">
+			<xsl:apply-templates mode="dipl" />
+		</span>
+	</xsl:template>
+
+	<!--<xsl:template match="bfm:sb" mode="dipl"><span style="color:violet">_</span></xsl:template> -->
+
+
+
+	<!-- <xsl:template match="tei:name"> <xsl:value-of select="@reg"/> </xsl:template> -->
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/test.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/test.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/test.xsl	(revision 2397)
@@ -1,69 +1,95 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:tei="http://www.tei-c.org/ns/1.0"> <xsl:output encoding="UTF-8" indent="yes" method="html"/>
-    <xsl:output method="html" encoding="UTF-8" version="4.0" indent="yes"/>
-    <xsl:strip-space elements="*"/>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0">
+	<xsl:output encoding="UTF-8" indent="yes" method="html" />
+	<xsl:output method="html" encoding="UTF-8" version="4.0"
+		indent="yes" />
+	<xsl:strip-space elements="*" />
 
-    <xsl:template match="/">
-        <xsl:apply-templates select="//tei:text"/>
-    </xsl:template>
+	<xsl:template match="/">
+		<xsl:apply-templates select="//tei:text" />
+	</xsl:template>
 
 
-    <xsl:template match="//tei:body/tei:div">
-        <br/>
-        <span style="font-family:Times;color:indigo">[<i>
-                <xsl:value-of select="@type"/>
-            </i>&#xa0;<xsl:value-of select="@n"/>]</span>
-        <xsl:apply-templates/>
-    </xsl:template>
+	<xsl:template match="//tei:body/tei:div">
+		<br />
+		<span style="font-family:Times;color:indigo">
+			[
+			<i>
+				<xsl:value-of select="@type" />
+			</i>
+			&#xa0;
+			<xsl:value-of select="@n" />
+			]
+		</span>
+		<xsl:apply-templates />
+	</xsl:template>
 
-    <xsl:template match="//tei:body/tei:div/tei:div">
-        <br/>
-        <span style="font-family:Times;color:indigo">[<i>
-                <xsl:value-of select="@type"/>
-            </i>&#xa0;<xsl:value-of select="@n"/>]</span>
-        <br/>
-        <xsl:apply-templates/>
-    </xsl:template>
+	<xsl:template match="//tei:body/tei:div/tei:div">
+		<br />
+		<span style="font-family:Times;color:indigo">
+			[
+			<i>
+				<xsl:value-of select="@type" />
+			</i>
+			&#xa0;
+			<xsl:value-of select="@n" />
+			]
+		</span>
+		<br />
+		<xsl:apply-templates />
+	</xsl:template>
 
-    <xsl:template match="tei:head">
-        <span style="font-family:Arial; color:darkred">
-            <xsl:apply-templates/>
-        </span>
-        <br/>
-    </xsl:template>
+	<xsl:template match="tei:head">
+		<span style="font-family:Arial; color:darkred">
+			<xsl:apply-templates />
+		</span>
+		<br />
+	</xsl:template>
 
-    <xsl:template match="//tei:p">
-        <p>
-            <xsl:if test="@n"> [ § <xsl:value-of select="@n"/>]&#xa0; </xsl:if>
-            <xsl:apply-templates/>
-        </p>
-    </xsl:template>
+	<xsl:template match="//tei:p">
+		<p>
+			<xsl:if test="@n">
+				[ §
+				<xsl:value-of select="@n" />
+				]&#xa0;
+			</xsl:if>
+			<xsl:apply-templates />
+		</p>
+	</xsl:template>
 
-    <xsl:template match="//tei:lb">
-        <xsl:choose>
-            <xsl:when test="position()=1 and not(ancestor::tei:seg)"/>
-            <xsl:otherwise>
-                <br/>
-            </xsl:otherwise>
-        </xsl:choose>
-    </xsl:template>
+	<xsl:template match="//tei:lb">
+		<xsl:choose>
+			<xsl:when test="position()=1 and not(ancestor::tei:seg)" />
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-    <xsl:template match="tei:q" mode="norm">
-        <span style="background-color:khaki">
-            <xsl:apply-templates/>
-        </span>
-    </xsl:template>
-    <xsl:template match="//tei:w">
-        <span class="word" id="{@xml:id}" title="{@type}">
-            <xsl:choose>
-                <xsl:when test="@type[starts-with(., 'PON')]">
-                    <xsl:apply-templates/>
-                </xsl:when>
-                <xsl:otherwise> &#xa0;<xsl:apply-templates/>
-                </xsl:otherwise>
-            </xsl:choose>
-        </span>
-    </xsl:template>
-    <xsl:template match="tei:supplied"> [<xsl:apply-templates/>] </xsl:template>
+	<xsl:template match="tei:q" mode="norm">
+		<span style="background-color:khaki">
+			<xsl:apply-templates />
+		</span>
+	</xsl:template>
+	<xsl:template match="//tei:w">
+		<span class="word" id="{@xml:id}" title="{@type}">
+			<xsl:choose>
+				<xsl:when test="@type[starts-with(., 'PON')]">
+					<xsl:apply-templates />
+				</xsl:when>
+				<xsl:otherwise>
+					&#xa0;
+					<xsl:apply-templates />
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
+	<xsl:template match="tei:supplied">
+		[
+		<xsl:apply-templates />
+		]
+	</xsl:template>
 </xsl:stylesheet>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_norm.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_norm.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_norm.xsl	(revision 2397)
@@ -1,129 +1,123 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- This is a stylesheet that gives a "normalized" presentation of old French manuscript transcriptions
-	- abbreviations are resolved;
-	- agglutinations and deglutinations are not marked (word limits 
-	  are "normalized");
-                                                           - punctuation is normalized as it is in the edition; 
-	- direct speech is marked with quotation marks and darkblue color;
-	- uncertain readings are not marked;
-	- text deleted in the original is not visualized;
-	- corrections are marked with darkred color;
-                                                           - notes are rendered with [*] sign in the text body; the text of the note
-                                                             appears on "mouse-over" and is reproduced in the end.
--->
+<!-- This is a stylesheet that gives a "normalized" presentation of old French 
+	manuscript transcriptions - abbreviations are resolved; - agglutinations 
+	and deglutinations are not marked (word limits are "normalized"); - punctuation 
+	is normalized as it is in the edition; - direct speech is marked with quotation 
+	marks and darkblue color; - uncertain readings are not marked; - text deleted 
+	in the original is not visualized; - corrections are marked with darkred 
+	color; - notes are rendered with [*] sign in the text body; the text of the 
+	note appears on "mouse-over" and is reproduced in the end. -->
 
 
 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
-                <xsl:param name="form">normalisée</xsl:param>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+	<xsl:param name="form">
+		normalisée
+	</xsl:param>
 
-                <xsl:variable name="mode">facs</xsl:variable>
+	<xsl:variable name="mode">
+		facs
+	</xsl:variable>
 
-                <xsl:output method="html" encoding="UTF-8" version="4.0" indent="yes"/>
+	<xsl:output method="html" encoding="UTF-8" version="4.0"
+		indent="yes" />
 
-                <xsl:strip-space elements="*"/>
+	<xsl:strip-space elements="*" />
 
-                <!--            <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/>
-                
-                <xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/>
-                
-                <xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/>
-                
-                <xsl:variable name="author" select="//titleStmt/author"/>
- -->
+	<!-- <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/> 
+		<xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/> 
+		<xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/> 
+		<xsl:variable name="author" select="//titleStmt/author"/> -->
 
-                <xsl:include href="mdv_common.xsl"/>
+	<xsl:include href="mdv_common.xsl" />
 
-                <xsl:template match="//tei:p|//tei:head">
-                                <p>
-                                                <xsl:if test="@n"> [ § <xsl:value-of select="@n"
-                                                  />]&#xa0; </xsl:if>
-                                                <xsl:apply-templates mode="norm"/>
-                                </p>
-                </xsl:template>
+	<xsl:template match="//tei:p|//tei:head">
+		<p>
+			<xsl:if test="@n">
+				[ §
+				<xsl:value-of select="@n" />
+				]&#xa0;
+			</xsl:if>
+			<xsl:apply-templates mode="norm" />
+		</p>
+	</xsl:template>
 
-                <xsl:template match="tei:pb" mode="norm">
-                                <xsl:call-template name="pb_common"/>
-                </xsl:template>
+	<xsl:template match="tei:pb" mode="norm">
+		<xsl:call-template name="pb_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:cb" mode="norm">
-                                <xsl:call-template name="cb_common"/>
-                </xsl:template>
+	<xsl:template match="tei:cb" mode="norm">
+		<xsl:call-template name="cb_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:note" mode="norm">
-                                <xsl:call-template name="note_common"/>
-                </xsl:template>
+	<xsl:template match="tei:note" mode="norm">
+		<xsl:call-template name="note_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:q" mode="norm">
-                                <span style="background-color:khaki">
-                                                <xsl:apply-templates mode="norm"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:q" mode="norm">
+		<span style="background-color:khaki">
+			<xsl:apply-templates mode="norm" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:gap" mode="norm">
-                                <xsl:call-template name="gap_common"/>
-                </xsl:template>
+	<xsl:template match="tei:gap" mode="norm">
+		<xsl:call-template name="gap_common" />
+	</xsl:template>
 
-                <xsl:template match="//tei:lb" mode="norm">
-                                <xsl:choose>
-                                                <xsl:when
-                                                  test="position()=1 and not(ancestor::tei:seg)"/>
-                                                <xsl:otherwise>
-                                                  <br/>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
+	<xsl:template match="//tei:lb" mode="norm">
+		<xsl:choose>
+			<xsl:when test="position()=1 and not(ancestor::tei:seg)" />
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-                <xsl:template match="//tei:w" mode="norm">
-                                <span class="word" id="{@xml:id}" title="{@type}">
-                                                <xsl:if
-                                                  test="starts-with(.,':') or starts-with(.,'!') or starts-with(.,'?') or starts-with(.,';')"
-                                                  >&#xa0;</xsl:if>
-                                                <xsl:apply-templates select="descendant::me:norm"
-                                                  mode="norm"/>
-                                                <xsl:choose>
-                                                  <xsl:when
-                                                  test="following::*[1][self::bfm:punct][starts-with(., ',') or starts-with(., '.') or starts-with(., ']') or starts-with(., ')') or starts-with(.,':') or starts-with(.,'!') or starts-with(.,'?') or starts-with(.,';')]"/>
-                                                  <xsl:when
-                                                  test="child::me:norm[string-length(.) = 0]"/>
-                                                  <xsl:when test="@bfm:aggl='elision'">'</xsl:when>
-                                                  <xsl:otherwise>
-                                                  <xsl:text> </xsl:text>
-                                                  </xsl:otherwise>
-                                                </xsl:choose>
-                                </span>
-                </xsl:template>
+	<xsl:template match="//tei:w" mode="norm">
+		<span class="word" id="{@xml:id}" title="{@type}">
+			<xsl:if
+				test="starts-with(.,':') or starts-with(.,'!') or starts-with(.,'?') or starts-with(.,';')">
+				&#xa0;
+			</xsl:if>
+			<xsl:apply-templates select="descendant::me:norm"
+				mode="norm" />
+			<xsl:choose>
+				<xsl:when
+					test="following::*[1][self::bfm:punct][starts-with(., ',') or starts-with(., '.') or starts-with(., ']') or starts-with(., ')') or starts-with(.,':') or starts-with(.,'!') or starts-with(.,'?') or starts-with(.,';')]" />
+				<xsl:when test="child::me:norm[string-length(.) = 0]" />
+				<xsl:when test="@bfm:aggl='elision'">
+					'
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text> </xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:sic" mode="norm">
-                                <span style="text-decoration:line-through;color:red">
-                                                <xsl:apply-templates mode="norm"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:sic" mode="norm">
+		<span style="text-decoration:line-through;color:red">
+			<xsl:apply-templates mode="norm" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:del" mode="norm"> </xsl:template>
+	<xsl:template match="tei:del" mode="norm">
+	</xsl:template>
 
 
-                <xsl:template match="//tei:hi[@rend='sup']" mode="norm">
-                                <sup>
-                                                <xsl:apply-templates mode="norm"/>
-                                </sup>
-                </xsl:template>
+	<xsl:template match="//tei:hi[@rend='sup']" mode="norm">
+		<sup>
+			<xsl:apply-templates mode="norm" />
+		</sup>
+	</xsl:template>
 
 
 
-                <!-- 
-
-
-<xsl:template match="del">
-
-</xsl:template>
-
-
-
-<xsl:template match="name">
-	<xsl:value-of select="@reg"/>
-</xsl:template>
-
-                -->
+	<!-- <xsl:template match="del"> </xsl:template> <xsl:template match="name"> 
+		<xsl:value-of select="@reg"/> </xsl:template> -->
 </xsl:stylesheet>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_facs.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_facs.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/mdv_facs.xsl	(revision 2397)
@@ -1,235 +1,240 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a "facsimilary" stylesheet for Old French XML transcriptions:
-	- most abbreviations and medieval letter variants are rendered with the 
-                                                             corresponding Unicode and MUFI characters. "Andron Scriptor Web"
-                                                             font should be installed for correct visualization;
-	- agglutinations and deglutinations are presented "as they are" in
-	  the original;
-	- direct speech is marked with darkblue color;
-	- uncertain readings are marked with grey background color;
-	- text deleted in the original is marked with rose background color;
-	- notes are rendered with [*] sign in the text body; the text of the note
-                                                             appears on "mouse-over" and is reproduced in the end.
--->
+<!-- This is a "facsimilary" stylesheet for Old French XML transcriptions: 
+	- most abbreviations and medieval letter variants are rendered with the corresponding 
+	Unicode and MUFI characters. "Andron Scriptor Web" font should be installed 
+	for correct visualization; - agglutinations and deglutinations are presented 
+	"as they are" in the original; - direct speech is marked with darkblue color; 
+	- uncertain readings are marked with grey background color; - text deleted 
+	in the original is marked with rose background color; - notes are rendered 
+	with [*] sign in the text body; the text of the note appears on "mouse-over" 
+	and is reproduced in the end. -->
 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
-                <xsl:param name="form">facsimilaire</xsl:param>
-                <xsl:variable name="mode">facs</xsl:variable>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+	<xsl:param name="form">
+		facsimilaire
+	</xsl:param>
+	<xsl:variable name="mode">
+		facs
+	</xsl:variable>
 
-                <xsl:output method="html" encoding="UTF-8" version="4.0" indent="yes"/>
+	<xsl:output method="html" encoding="UTF-8" version="4.0"
+		indent="yes" />
 
-                <xsl:strip-space elements="*"/>
+	<xsl:strip-space elements="*" />
 
-                <!--                <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/>
-                                                
-                                                <xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/>
-                                                
-                                                <xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/>
-                                                
-                                                <xsl:variable name="author" select="//titleStmt/author"/>
-                                -->
+	<!-- <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/> 
+		<xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/> 
+		<xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/> 
+		<xsl:variable name="author" select="//titleStmt/author"/> -->
 
-                <xsl:include href="mdv_common.xsl"/>
+	<xsl:include href="mdv_common.xsl" />
 
-                <xsl:template match="//tei:p|//tei:head">
-                                <p>
-                                                <xsl:if test="@n"> [ § <xsl:value-of select="@n"
-                                                  />]&#xa0; </xsl:if>
-                                                <xsl:apply-templates mode="facs"/>
-                                </p>
-                </xsl:template>
+	<xsl:template match="//tei:p|//tei:head">
+		<p>
+			<xsl:if test="@n">
+				[ §
+				<xsl:value-of select="@n" />
+				]&#xa0;
+			</xsl:if>
+			<xsl:apply-templates mode="facs" />
+		</p>
+	</xsl:template>
 
-                <xsl:template match="tei:pb" mode="facs">
-                                <xsl:call-template name="pb_common"/>
-                </xsl:template>
+	<xsl:template match="tei:pb" mode="facs">
+		<xsl:call-template name="pb_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:cb" mode="facs">
-                                <xsl:call-template name="cb_common"/>
-                </xsl:template>
+	<xsl:template match="tei:cb" mode="facs">
+		<xsl:call-template name="cb_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:note" mode="facs">
-                                <xsl:call-template name="note_common"/>
-                </xsl:template>
+	<xsl:template match="tei:note" mode="facs">
+		<xsl:call-template name="note_common" />
+	</xsl:template>
 
-                <xsl:template match="tei:q" mode="facs">
-                                <span style="background-color:khaki">
-                                                <xsl:apply-templates mode="facs"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:q" mode="facs">
+		<span style="background-color:khaki">
+			<xsl:apply-templates mode="facs" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:gap" mode="facs">
-                                <xsl:call-template name="gap_common"/>
-                </xsl:template>
+	<xsl:template match="tei:gap" mode="facs">
+		<xsl:call-template name="gap_common" />
+	</xsl:template>
 
 
-                <xsl:template match="//tei:lb" mode="facs">
-                                <xsl:choose>
-                                                <xsl:when
-                                                  test="position()=1 and not(ancestor::tei:seg)"/>
-                                                <xsl:when test="@ed='norm'"/>
-                                                <xsl:when
-                                                  test="preceding::tei:w[1][descendant::bfm:headlb]"/>
-                                                <xsl:when
-                                                  test="preceding::tei:w[1][descendant::tei:lb]"/>
-                                                <xsl:otherwise>
-                                                  <br/>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
+	<xsl:template match="//tei:lb" mode="facs">
+		<xsl:choose>
+			<xsl:when test="position()=1 and not(ancestor::tei:seg)" />
+			<xsl:when test="@ed='norm'" />
+			<xsl:when test="preceding::tei:w[1][descendant::bfm:headlb]" />
+			<xsl:when test="preceding::tei:w[1][descendant::tei:lb]" />
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-                <xsl:template match="//bfm:headlb" mode="facs">
-                                <br/>
-                </xsl:template>
+	<xsl:template match="//bfm:headlb" mode="facs">
+		<br />
+	</xsl:template>
 
-                <xsl:template match="//tei:w|//bfm:punct" mode="facs">
-                                <span style="font-family:Andron Scriptor Web" class="word"
-                                                title="{@type}" id="{@xml:id}">
-                                                <xsl:apply-templates select="descendant::me:facs"
-                                                  mode="facs"/>
-                                </span>
-                                <xsl:choose>
-                                                <xsl:when test="@bfm:aggl"/>
-                                                <xsl:otherwise>
-                                                  <xsl:text> </xsl:text>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
+	<xsl:template match="//tei:w|//bfm:punct" mode="facs">
+		<span style="font-family:Andron Scriptor Web" class="word"
+			title="{@type}" id="{@xml:id}">
+			<xsl:apply-templates select="descendant::me:facs"
+				mode="facs" />
+		</span>
+		<xsl:choose>
+			<xsl:when test="@bfm:aggl" />
+			<xsl:otherwise>
+				<xsl:text> </xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-                <xsl:template match="text()[ancestor::me:facs]" mode="facs">
-                                <xsl:value-of select="translate(., 'i', '&#x0131;')"/>
-                </xsl:template>
+	<xsl:template match="text()[ancestor::me:facs]"
+		mode="facs">
+		<xsl:value-of select="translate(., 'i', '&#x0131;')" />
+	</xsl:template>
 
-                <xsl:template match="bfm:mdvAbbr" mode="facs">
-                                <span style="color:darkgreen">
-                                                <xsl:apply-templates mode="facs"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="bfm:mdvAbbr" mode="facs">
+		<span style="color:darkgreen">
+			<xsl:apply-templates mode="facs" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:sic" mode="facs">
-                                <span style="color:darkred" title="sic!">
-                                                <xsl:apply-templates mode="facs"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:sic" mode="facs">
+		<span style="color:darkred" title="sic!">
+			<xsl:apply-templates mode="facs" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:subst" mode="facs"> [<xsl:choose>
-                                                <xsl:when
-                                                  test="child::tei:del[@rend='line-through']">
-                                                  <span
-                                                  style="color:red;text-decoration:line-through">
-                                                  <xsl:value-of select="child::tei:del"/>
-                                                  </span> \ <span
-                                                  style="color:blue;text-decoration:underline">
-                                                  <xsl:value-of select="child::tei:add"/>
-                                                  </span>
-                                                </xsl:when>
-                                                <xsl:when test="child::tei:del[@rend='dotobl']">
-                                                  <span style="color:red">
-                                                  <xsl:value-of select="child::tei:del"/>
-                                                  </span> \ <span
-                                                  style="color:blue;text-decoration:underline">
-                                                  <xsl:value-of select="child::tei:add"/>
-                                                  </span>
-                                                </xsl:when>
-                                                <xsl:when test="child::tei:del[@rend='transform']">
-                                                  <span
-                                                  style="color:red;text-decoration:line-through">
-                                                  <xsl:value-of select="child::tei:del"/>
-                                                  </span> &gt; <span
-                                                  style="color:blue;text-decoration:underline">
-                                                  <xsl:value-of select="child::tei:add"/>
-                                                  </span>
-                                                </xsl:when>
-                                                <xsl:when
-                                                  test="child::tei:del[@rend='unmarked'] and child::tei:add[@place='overwrite']">
-                                                  <span
-                                                  style="color:red;text-decoration:line-through">
-                                                  <xsl:value-of select="child::tei:del"/>
-                                                  </span> + <span
-                                                  style="color:blue;text-decoration:underline">
-                                                  <xsl:value-of select="child::tei:add"/>
-                                                  </span>
-                                                </xsl:when>
-                                                <xsl:when
-                                                  test="child::tei:del[@rend='unmarked'] and child::tei:add[contains(@place,'linear')]">
-                                                  <span
-                                                  style="color:red;text-decoration:line-through">
-                                                  <xsl:value-of select="child::tei:del"/>
-                                                  </span> + \ <span
-                                                  style="color:blue;text-decoration:underline">
-                                                  <xsl:value-of select="child::tei:add"/>
-                                                  </span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                  <span
-                                                  style="color:red;text-decoration:line-through">
-                                                  <xsl:value-of select="child::tei:del"/>
-                                                  </span> / <span
-                                                  style="color:blue;text-decoration:underline">
-                                                  <xsl:value-of select="child::tei:add"/>
-                                                  </span>
-                                                </xsl:otherwise>
-                                </xsl:choose>] </xsl:template>
+	<xsl:template match="tei:subst" mode="facs">
+		[
+		<xsl:choose>
+			<xsl:when test="child::tei:del[@rend='line-through']">
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				\
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:when test="child::tei:del[@rend='dotobl']">
+				<span style="color:red">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				\
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:when test="child::tei:del[@rend='transform']">
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				&gt;
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="child::tei:del[@rend='unmarked'] and child::tei:add[@place='overwrite']">
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				+
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="child::tei:del[@rend='unmarked'] and child::tei:add[contains(@place,'linear')]">
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				+ \
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				/
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+		]
+	</xsl:template>
 
-                <xsl:template match="tei:add" mode="facs">
-                                <span style="color:blue;text-decoration:underline">
-                                                <xsl:choose>
-                                                  <xsl:when
-                                                  test="@place='interlinear' or @place='supralinear'"
-                                                  >\<xsl:apply-templates mode="facs"/>/</xsl:when>
-                                                  <xsl:when test="starts-with(@place,'margin')"
-                                                  >\\<xsl:apply-templates mode="facs"/>//</xsl:when>
-                                                  <xsl:otherwise>
-                                                  <xsl:apply-templates mode="facs"/>
-                                                  </xsl:otherwise>
-                                                </xsl:choose>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:add" mode="facs">
+		<span style="color:blue;text-decoration:underline">
+			<xsl:choose>
+				<xsl:when
+					test="@place='interlinear' or @place='supralinear'">
+					\
+					<xsl:apply-templates mode="facs" />
+					/
+				</xsl:when>
+				<xsl:when test="starts-with(@place,'margin')">
+					\\
+					<xsl:apply-templates mode="facs" />
+					//
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="facs" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
 
-                <xsl:template match="tei:del" mode="facs">
-                                <xsl:choose>
-                                                <xsl:when test="@rend='dotbl'">
-                                                  <span style="color:red">
-                                                  <xsl:apply-templates mode="facs"/>
-                                                  </span>
-                                                </xsl:when>
-                                                <xsl:otherwise>
-                                                  <span
-                                                  style="text-decoration:line-through;color:red">
-                                                  <xsl:apply-templates mode="facs"/>
-                                                  </span>
-                                                </xsl:otherwise>
-                                </xsl:choose>
-                </xsl:template>
+	<xsl:template match="tei:del" mode="facs">
+		<xsl:choose>
+			<xsl:when test="@rend='dotbl'">
+				<span style="color:red">
+					<xsl:apply-templates mode="facs" />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="text-decoration:line-through;color:red">
+					<xsl:apply-templates mode="facs" />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
 
-                <xsl:template match="tei:unclear" mode="facs">
-                                <span style="background-color:lightgrey">
-                                                <xsl:apply-templates mode="facs"/>
-                                </span>
-                </xsl:template>
+	<xsl:template match="tei:unclear" mode="facs">
+		<span style="background-color:lightgrey">
+			<xsl:apply-templates mode="facs" />
+		</span>
+	</xsl:template>
 
-                <xsl:template match="bfm:lettrine" mode="facs">
-                                <font color="{@color}" size="{@size}00%" style="font-weight:bold">
-                                                <xsl:apply-templates mode="facs"/>
-                                </font>
-                </xsl:template>
+	<xsl:template match="bfm:lettrine" mode="facs">
+		<font color="{@color}" size="{@size}00%" style="font-weight:bold">
+			<xsl:apply-templates mode="facs" />
+		</font>
+	</xsl:template>
 
-                <xsl:template match="bfm:sb" mode="facs">
-                                <xsl:text>&#xa0;</xsl:text>
-                </xsl:template>
+	<xsl:template match="bfm:sb" mode="facs">
+		<xsl:text>&#xa0;</xsl:text>
+	</xsl:template>
 
-                <xsl:template match="//tei:hi[@rend='sup']" mode="facs">
-                                <sup>
-                                                <xsl:apply-templates mode="facs"/>
-                                </sup>
-                </xsl:template>
+	<xsl:template match="//tei:hi[@rend='sup']" mode="facs">
+		<sup>
+			<xsl:apply-templates mode="facs" />
+		</sup>
+	</xsl:template>
 
 
-                <!-- 
-                                                
-                                                
-                                                <xsl:template match="tei:name">
-                                                <xsl:value-of select="@reg"/>
-                                                </xsl:template>
-                                                
-                                -->
+	<!-- <xsl:template match="tei:name"> <xsl:value-of select="@reg"/> </xsl:template> -->
 </xsl:stylesheet>
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_facs.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_facs.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/xsl/qgraal_facs.xsl	(revision 2397)
@@ -1,192 +1,297 @@
 <?xml version='1.0'?>
 
-<!-- This is a "facsimilary" stylesheet for Old French XML transcriptions:
-	- most abbreviations and medieval letter variants are rendered with the 
-                                                             corresponding Unicode and MUFI characters. "Andron Scriptor Web"
-                                                             font should be installed for correct visualization;
-	- agglutinations and deglutinations are presented "as they are" in
-	  the original;
-	- direct speech is marked with darkblue color;
-	- uncertain readings are marked with grey background color;
-	- text deleted in the original is marked with rose background color;
-	- notes are rendered with [*] sign in the text body; the text of the note
-                                                             appears on "mouse-over" and is reproduced in the end.
--->
+<!-- This is a "facsimilary" stylesheet for Old French XML transcriptions: 
+	- most abbreviations and medieval letter variants are rendered with the corresponding 
+	Unicode and MUFI characters. "Andron Scriptor Web" font should be installed 
+	for correct visualization; - agglutinations and deglutinations are presented 
+	"as they are" in the original; - direct speech is marked with darkblue color; 
+	- uncertain readings are marked with grey background color; - text deleted 
+	in the original is marked with rose background color; - notes are rendered 
+	with [*] sign in the text body; the text of the note appears on "mouse-over" 
+	and is reproduced in the end. -->
 
-                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:me="http://www.menota.org/ns/1.0" xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
-                                <xsl:import href="mdv_common.xsl"/>
-                                <xsl:param name="form">fac-similaire</xsl:param>
-                                <xsl:variable name="mode">facs</xsl:variable>
-                                
-                                <xsl:output method="html"  encoding="utf-8" version="4.0" indent="yes"/>
-                                
-                                <xsl:strip-space elements="*"/>
-                                
-                                <!--                <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/>
-                                                
-                                                <xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/>
-                                                
-                                                <xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/>
-                                                
-                                                <xsl:variable name="author" select="//titleStmt/author"/>
-                                -->               
-                                
-                                
-                                
-                                <xsl:template match="//tei:text//tei:p|//tei:text//tei:head">
-                                                <table width="100%" style="border:none">
-                                                                <tr style="border:none">
-                                                                                <td width="10%" valign="top" style="white-space:nowrap;padding-right:10pt;line-height:18px;font-family:Arial;font-size:14px;border:none;text-align:right">
-                                                                                                <xsl:if test="@n"><span style="color:gray;font-size:12px">[§ <xsl:value-of select="@n"/>] </span></xsl:if><xsl:apply-templates select="descendant::tei:lb|descendant::tei:milestone[@unit='column']|descendant::bfm:lettrine" mode="number"/></td>
-                                                                                <td valign="top" style="white-space:nowrap;line-height:18px;font-family:Andron Scriptor Web;font-size:14px;border:none"><xsl:apply-templates mode="facs"/></td>
-                                                                </tr>
-                                                </table>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:pb" mode="facs">
-                                                <xsl:call-template name="pb_common"/>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:cb" mode="facs">
-                                                <xsl:call-template name="cb_common"></xsl:call-template>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:note" mode="facs">
-                                                <xsl:call-template name="note_common"></xsl:call-template>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:q" mode="facs">
-                                                <span style="background-color:lightcyan"><xsl:apply-templates mode="facs"/></span>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:gap" mode="facs">
-                                                <xsl:call-template name="gap_common"></xsl:call-template>
-                                </xsl:template>
-                                
-                                <xsl:template match="//tei:lb" mode="facs">
-                                                <xsl:choose>
-                                                                <xsl:when test="@ed='facs'"><br/></xsl:when>
-                                                                <!--<xsl:when test="position()=1 and not(ancestor::tei:seg)"></xsl:when>-->
-                                                                <xsl:when test="@ed='norm' or preceding::tei:lb[1][@ed='facs']"></xsl:when>
-                                                                <xsl:when test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
-                                                                <xsl:when test="preceding::tei:w[1][descendant::bfm:headlb]"></xsl:when>
-                                                                <xsl:when test="preceding::tei:w[1][descendant::tei:lb]"></xsl:when>
-                                                                <xsl:otherwise><br/></xsl:otherwise>
-                                                </xsl:choose>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:lb" mode="number">
-                                                <xsl:choose>
-                                                                <xsl:when test="@ed='facs'"></xsl:when>
-                                                                <xsl:when test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
-                                                                <xsl:otherwise><br/>&#xa0;</xsl:otherwise>
-                                                </xsl:choose>
-                                                <xsl:if test="substring(@n, string-length(@n)) = 0 or substring(@n, string-length(@n)) = 5"><xsl:value-of select="@n"/></xsl:if>
-                                </xsl:template>
-                                
-                               
-                               
-                                <xsl:template match="//bfm:headlb" mode="facs">
-                                                <br/>
-                                </xsl:template>
-                                
-                                <xsl:template match="//tei:w" mode="facs">
-                                                <span title="{@type}" class="word" id="{@xml:id}" >
-                                                <xsl:if test="descendant::me:facs"><xsl:apply-templates select="descendant::me:facs" mode="facs"/>
-                                                <xsl:choose>
-                                                                <xsl:when test="@rend='aggl' or @rend='elision'"></xsl:when>
-                                                                <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
-                                                </xsl:choose></xsl:if>
-                                                                </span>
-                                </xsl:template>
-                                
-                                <xsl:template match="text()[ancestor::me:facs]" mode="facs">
-                                                <xsl:value-of select="translate(., 'i', '&#x0131;')"/>
-                                </xsl:template>
-                                
-                                <xsl:template match="bfm:mdvAbbr" mode="facs">
-                                                <xsl:apply-templates mode="facs"/>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:sic" mode="facs">
-                                                <span style="color:darkred" title="sic!"><xsl:apply-templates mode="facs"/></span>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:subst" mode="facs">
-                                                [<xsl:choose>
-                                                                <xsl:when test="child::tei:del[@rend='line-through']">
-                                                                                <span style="color:red;text-decoration:line-through"><xsl:value-of select="child::tei:del"/></span> \ <span style="color:blue;text-decoration:underline"><xsl:value-of select="child::tei:add"/></span>
-                                                                </xsl:when>
-                                                                <xsl:when test="child::tei:del[@rend='dotobl']">
-                                                                                <span style="color:red"><xsl:value-of select="child::tei:del"/></span> \ <span style="color:blue;text-decoration:underline"><xsl:value-of select="child::tei:add"/></span>
-                                                                </xsl:when>
-                                                                <xsl:when test="child::tei:del[@rend='transform']">
-                                                                                <span style="color:red;text-decoration:line-through"><xsl:value-of select="child::tei:del"/></span> &gt; <span style="color:blue;text-decoration:underline"><xsl:value-of select="child::tei:add"/></span>
-                                                                </xsl:when>
-                                                                <xsl:when test="child::tei:del[@rend='unmarked'] and child::tei:add[@place='overwrite']">
-                                                                                <span style="color:red;text-decoration:line-through"><xsl:value-of select="child::tei:del"/></span> +  <span style="color:blue;text-decoration:underline"><xsl:value-of select="child::tei:add"/></span>
-                                                                </xsl:when>
-                                                                <xsl:when test="child::tei:del[@rend='unmarked'] and child::tei:add[contains(@place,'linear')]">
-                                                                                <span style="color:red;text-decoration:line-through"><xsl:value-of select="child::tei:del"/></span> +  \ <span style="color:blue;text-decoration:underline"><xsl:value-of select="child::tei:add"/></span>
-                                                                </xsl:when>
-                                                                <xsl:otherwise>
-                                                                                <span style="color:red;text-decoration:line-through"><xsl:value-of select="child::tei:del"/></span> / <span style="color:blue;text-decoration:underline"><xsl:value-of select="child::tei:add"/></span>
-                                                                </xsl:otherwise>                                                
-                                                </xsl:choose>]
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:add" mode="facs">
-                                                <span style="color:blue;text-decoration:underline">
-                                                                <xsl:choose>
-                                                                                <xsl:when test="@place='interlinear' or @place='supralinear'">\<xsl:apply-templates mode="facs"/>/</xsl:when>
-                                                                                <xsl:when test="starts-with(@place,'margin')">\\<xsl:apply-templates mode="facs"/>//</xsl:when>
-                                                                                <xsl:otherwise><xsl:apply-templates mode="facs"/></xsl:otherwise>
-                                                                </xsl:choose>
-                                                </span>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:del" mode="facs">
-                                                <xsl:choose>
-                                                                <xsl:when test="@rend='dotbl'"><span style="color:red"><xsl:apply-templates mode="facs"/></span></xsl:when>
-                                                                <xsl:otherwise><span style="text-decoration:line-through;color:red"><xsl:apply-templates mode="facs"/></span></xsl:otherwise>
-                                                </xsl:choose>
-                                </xsl:template>
-                                
-                                <xsl:template match="tei:unclear" mode="facs">
-                                                <span style="background-color:lightgrey"><xsl:apply-templates mode="facs"/></span>
-                                </xsl:template>
-                                
-                                <xsl:template match="bfm:lettrine" mode="facs">
-                                                <font color="{@color}" size="{@size}00%" style="font-weight:bold"><xsl:apply-templates mode="facs"/></font>
-                                </xsl:template>
-                                
-                                <xsl:template match="bfm:lettrine" mode="number">
-                                                <font color="black" size="{@size}00%" style="font-weight:bold">&#xa0;</font>
-                                </xsl:template>
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:me="http://www.menota.org/ns/1.0"
+	xmlns:bfm="http://bfm.ens-lsh.fr/ns/1.0">
+	<xsl:import href="mdv_common.xsl" />
+	<xsl:param name="form">
+		fac-similaire
+	</xsl:param>
+	<xsl:variable name="mode">
+		facs
+	</xsl:variable>
 
-                                <xsl:template match="bfm:sb" mode="facs">
-                                                <xsl:text>&#xa0;</xsl:text>
-                                </xsl:template>
-                                
-                                <xsl:template match="//tei:hi[@rend='sup']" mode="facs">
-                                                <sup><xsl:apply-templates mode="facs"/></sup>
-                                </xsl:template>
-                  
-                                  <xsl:template match="tei:supplied" mode="facs">
-                                <span style="color:blue">[<xsl:apply-templates mode="facs"/>]</span>
-                                <xsl:if test="not(ancestor::tei:w)"> </xsl:if>
-                </xsl:template>
-                                
-                                <xsl:template match="tei:surplus">
-                                                <span style="color:darkred" title="sic!"><xsl:apply-templates mode="facs"/></span>
-                                </xsl:template>
-                                
-                                <!-- 
-                                                
-                                                
-                                                <xsl:template match="tei:name">
-                                                <xsl:value-of select="@reg"/>
-                                                </xsl:template>
-                                                
-                                -->
- </xsl:stylesheet>
\ No newline at end of file
+	<xsl:output method="html" encoding="utf-8" version="4.0"
+		indent="yes" />
+
+	<xsl:strip-space elements="*" />
+
+	<!-- <xsl:variable name="title-formal" select="//fileDesc/titleStmt/title[@type='formal']"/> 
+		<xsl:variable name="title-normal" select="//fileDesc/titleStmt/title[@type='normal']"/> 
+		<xsl:variable name="title-ref" select="//fileDesc/titleStmt/title[@type='reference']"/> 
+		<xsl:variable name="author" select="//titleStmt/author"/> -->
+
+
+
+	<xsl:template
+		match="//tei:text//tei:p|//tei:text//tei:head">
+		<table width="100%" style="border:none">
+			<tr style="border:none">
+				<td width="10%" valign="top"
+					style="white-space:nowrap;padding-right:10pt;line-height:18px;font-family:Arial;font-size:14px;border:none;text-align:right">
+					<xsl:if test="@n">
+						<span style="color:gray;font-size:12px">
+							[§
+							<xsl:value-of select="@n" />
+							]
+						</span>
+					</xsl:if>
+					<xsl:apply-templates
+						select="descendant::tei:lb|descendant::tei:milestone[@unit='column']|descendant::bfm:lettrine"
+						mode="number" />
+				</td>
+				<td valign="top"
+					style="white-space:nowrap;line-height:18px;font-family:Andron Scriptor Web;font-size:14px;border:none">
+					<xsl:apply-templates mode="facs" />
+				</td>
+			</tr>
+		</table>
+	</xsl:template>
+
+	<xsl:template match="tei:pb" mode="facs">
+		<xsl:call-template name="pb_common" />
+	</xsl:template>
+
+	<xsl:template match="tei:cb" mode="facs">
+		<xsl:call-template name="cb_common"></xsl:call-template>
+	</xsl:template>
+
+	<xsl:template match="tei:note" mode="facs">
+		<xsl:call-template name="note_common"></xsl:call-template>
+	</xsl:template>
+
+	<xsl:template match="tei:q" mode="facs">
+		<span style="background-color:lightcyan">
+			<xsl:apply-templates mode="facs" />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:gap" mode="facs">
+		<xsl:call-template name="gap_common"></xsl:call-template>
+	</xsl:template>
+
+	<xsl:template match="//tei:lb" mode="facs">
+		<xsl:choose>
+			<xsl:when test="@ed='facs'">
+				<br />
+			</xsl:when>
+			<!--<xsl:when test="position()=1 and not(ancestor::tei:seg)"></xsl:when> -->
+			<xsl:when
+				test="@ed='norm' or preceding::tei:lb[1][@ed='facs']"></xsl:when>
+			<xsl:when
+				test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
+			<xsl:when test="preceding::tei:w[1][descendant::bfm:headlb]"></xsl:when>
+			<xsl:when test="preceding::tei:w[1][descendant::tei:lb]"></xsl:when>
+			<xsl:otherwise>
+				<br />
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="tei:lb" mode="number">
+		<xsl:choose>
+			<xsl:when test="@ed='facs'"></xsl:when>
+			<xsl:when
+				test="position() = 1 and ancestor::tei:s[not(preceding-sibling::*)]"></xsl:when>
+			<xsl:otherwise>
+				<br />
+				&#xa0;
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:if
+			test="substring(@n, string-length(@n)) = 0 or substring(@n, string-length(@n)) = 5">
+			<xsl:value-of select="@n" />
+		</xsl:if>
+	</xsl:template>
+
+
+
+	<xsl:template match="//bfm:headlb" mode="facs">
+		<br />
+	</xsl:template>
+
+	<xsl:template match="//tei:w" mode="facs">
+		<span title="{@type}" class="word" id="{@xml:id}">
+			<xsl:if test="descendant::me:facs">
+				<xsl:apply-templates
+					select="descendant::me:facs" mode="facs" />
+				<xsl:choose>
+					<xsl:when test="@rend='aggl' or @rend='elision'"></xsl:when>
+					<xsl:otherwise>
+						<xsl:text> </xsl:text>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</span>
+	</xsl:template>
+
+	<xsl:template match="text()[ancestor::me:facs]"
+		mode="facs">
+		<xsl:value-of select="translate(., 'i', '&#x0131;')" />
+	</xsl:template>
+
+	<xsl:template match="bfm:mdvAbbr" mode="facs">
+		<xsl:apply-templates mode="facs" />
+	</xsl:template>
+
+	<xsl:template match="tei:sic" mode="facs">
+		<span style="color:darkred" title="sic!">
+			<xsl:apply-templates mode="facs" />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:subst" mode="facs">
+		[
+		<xsl:choose>
+			<xsl:when test="child::tei:del[@rend='line-through']">
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				\
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:when test="child::tei:del[@rend='dotobl']">
+				<span style="color:red">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				\
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:when test="child::tei:del[@rend='transform']">
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				&gt;
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="child::tei:del[@rend='unmarked'] and child::tei:add[@place='overwrite']">
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				+
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:when
+				test="child::tei:del[@rend='unmarked'] and child::tei:add[contains(@place,'linear')]">
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				+ \
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="color:red;text-decoration:line-through">
+					<xsl:value-of select="child::tei:del" />
+				</span>
+				/
+				<span style="color:blue;text-decoration:underline">
+					<xsl:value-of select="child::tei:add" />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+		]
+	</xsl:template>
+
+	<xsl:template match="tei:add" mode="facs">
+		<span style="color:blue;text-decoration:underline">
+			<xsl:choose>
+				<xsl:when
+					test="@place='interlinear' or @place='supralinear'">
+					\
+					<xsl:apply-templates mode="facs" />
+					/
+				</xsl:when>
+				<xsl:when test="starts-with(@place,'margin')">
+					\\
+					<xsl:apply-templates mode="facs" />
+					//
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates mode="facs" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+	</xsl:template>
+
+	<xsl:template match="tei:del" mode="facs">
+		<xsl:choose>
+			<xsl:when test="@rend='dotbl'">
+				<span style="color:red">
+					<xsl:apply-templates mode="facs" />
+				</span>
+			</xsl:when>
+			<xsl:otherwise>
+				<span style="text-decoration:line-through;color:red">
+					<xsl:apply-templates mode="facs" />
+				</span>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="tei:unclear" mode="facs">
+		<span style="background-color:lightgrey">
+			<xsl:apply-templates mode="facs" />
+		</span>
+	</xsl:template>
+
+	<xsl:template match="bfm:lettrine" mode="facs">
+		<font color="{@color}" size="{@size}00%" style="font-weight:bold">
+			<xsl:apply-templates mode="facs" />
+		</font>
+	</xsl:template>
+
+	<xsl:template match="bfm:lettrine" mode="number">
+		<font color="black" size="{@size}00%" style="font-weight:bold">&#xa0;</font>
+	</xsl:template>
+
+	<xsl:template match="bfm:sb" mode="facs">
+		<xsl:text>&#xa0;</xsl:text>
+	</xsl:template>
+
+	<xsl:template match="//tei:hi[@rend='sup']" mode="facs">
+		<sup>
+			<xsl:apply-templates mode="facs" />
+		</sup>
+	</xsl:template>
+
+	<xsl:template match="tei:supplied" mode="facs">
+		<span style="color:blue">
+			[
+			<xsl:apply-templates mode="facs" />
+			]
+		</span>
+		<xsl:if test="not(ancestor::tei:w)">
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="tei:surplus">
+		<span style="color:darkred" title="sic!">
+			<xsl:apply-templates mode="facs" />
+		</span>
+	</xsl:template>
+
+	<!-- <xsl:template match="tei:name"> <xsl:value-of select="@reg"/> </xsl:template> -->
+</xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Hyperprince import module : multi-ling corpus</p>
+	<p>Hyperprince import module : multi-ling corpus</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxm/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxm/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxm/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>XML-TXM import module</p>
+	<p>XML-TXM import module</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/discours/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/discours/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/discours/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Discours import module : CNR + CSV</p>
+	<p>Discours import module : CNR + CSV</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/frantext/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/frantext/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/frantext/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Frantext import module (uses the BFM import module)</p>
+	<p>Frantext import module (uses the BFM import module)</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/lasla/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/lasla/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/lasla/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Lasla import module - not yet finished</p>
+	<p>Lasla import module - not yet finished</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxmpara/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxmpara/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxmpara/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>XML-TXM import module specialized with aligned corpus</p>
+	<p>XML-TXM import module specialized with aligned corpus</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/perrault/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/perrault/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/perrault/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Perault import module : teiCorpus</p>
+	<p>Perault import module : teiCorpus</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/fleurs/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/fleurs/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/fleurs/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Fleur import module : Astartex</p>
+	<p>Fleur import module : Astartex</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>XML import module</p>
+	<p>XML import module</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/corptef/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/corptef/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/corptef/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Corptef import module</p>
+	<p>Corptef import module</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/doc/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/doc/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/doc/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Contains scripts to manipulates Word or ODT or RTF files</p>
+	<p>Contains scripts to manipulates Word or ODT or RTF files</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/refaireEditionTRS.xsl
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/refaireEditionTRS.xsl	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/refaireEditionTRS.xsl	(revision 2397)
@@ -1,204 +1,187 @@
 <?xml version="1.0"?>
 
 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:atilf="http://www.atilf.fr" version="2.0">
+<xsl:stylesheet
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:tei="http://www.tei-c.org/ns/1.0"
+	xmlns:atilf="http://www.atilf.fr" version="2.0">
 
-  <xsl:output method="xml"/>
-  
-  <xsl:param name="soundFile"/>
+	<xsl:output method="xml" />
 
+	<xsl:param name="soundFile" />
 
-  
-  
-  <xsl:function name="atilf:traduireTemps">
-    <xsl:param name="t"/>
 
-    <xsl:choose>
-      <xsl:when test="count($t) != 0">
-	<xsl:analyze-string select="$t" regex="([0-9]+):([0-9]+):([0-9]+)">
-	  <xsl:matching-substring>
-	    <xsl:value-of select="number(regex-group(1))*3600+number(regex-group(2))*60+number(regex-group(3))"/>
-	  </xsl:matching-substring>
-	  <xsl:non-matching-substring><xsl:text>0</xsl:text></xsl:non-matching-substring>
-	</xsl:analyze-string>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:text>0</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:function>
 
-  <xsl:template match="/">
-    <xsl:apply-templates/>
-  </xsl:template>
 
+	<xsl:function name="atilf:traduireTemps">
+		<xsl:param name="t" />
 
-  <xsl:template match="html">
-    <xsl:copy>
-      <xsl:apply-templates select="meta"/>
-      <xsl:apply-templates select="head"/>
-      <xsl:apply-templates select="link"/>
-      <xsl:apply-templates select="*[not(self::meta) and not(self::head) and
-				   not(self::link) and not(self::body) and not(self::tei:body)]"/>
-      <xsl:apply-templates select="tei:body"/>
-    </xsl:copy>
-  </xsl:template>
-  
-  <xsl:template match="*">
-    <xsl:copy>
-      <xsl:apply-templates select="@* | node()"/>
-    </xsl:copy>
-  </xsl:template>
+		<xsl:choose>
+			<xsl:when test="count($t) != 0">
+				<xsl:analyze-string select="$t"
+					regex="([0-9]+):([0-9]+):([0-9]+)">
+					<xsl:matching-substring>
+						<xsl:value-of
+							select="number(regex-group(1))*3600+number(regex-group(2))*60+number(regex-group(3))" />
+					</xsl:matching-substring>
+					<xsl:non-matching-substring>
+						<xsl:text>0</xsl:text>
+					</xsl:non-matching-substring>
+				</xsl:analyze-string>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:text>0</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:function>
 
-  <xsl:template match="@* | text() | comment() | processing-instruction()">
-    <xsl:copy/>
-  </xsl:template>
+	<xsl:template match="/">
+		<xsl:apply-templates />
+	</xsl:template>
 
- 
 
-  <xsl:template match="tei:body">
-    <xsl:copy>
-	<script>
-	  <!-- Element.prototype.documentOffsetTop = function () {
-	  return this.offsetTop + ( this.offsetParent ? this.offsetParent.documentOffsetTop() : 0 );
-	  };
-	  
-	 
-	  function myFunc2(event) {
-	  document.getElementById('tracktime').innerHTML = Math.floor(event.currentTime) + ' / ' + Math.floor(event.duration);
-	  };
-	     function myFunc3(event) {
-	     var x = document.getElementsByTagName("span");
-	     for (index = 0; index &lt; x.length; index++){
-	     if ((x[index].getAttribute("begin") &lt; event.currentTime)
-	        &amp;&amp;
-	        (x[index].getAttribute("end") &gt; event.currentTime)){
-	    
-		x[index].className = "spk_hi";
-		/*x[index].scrollIntoView( true );*/
-		/*var top = x[index].documentOffsetTop() - ( window.innerHeight / 2 );
-	
-		window.scrollTo(0, top );*/
-		
-		var topPos = x[index].offsetTop;
-		document.getElementById('scrollDiv').scrollTop = topPos-110;
-		}
-		else{
-		x[index].className="spk";
-		}
-	     };
-	    };-->
-	    
-	       function moveInSound(t){
-	       var player = document.getElementById("audioPlay");
-	       
-	       if (player.paused){
-	          player.currentTime = t;
-	          player.play();
-		  }
-		  else{
-		  player.pause();
-		  }
-	       };
+	<xsl:template match="html">
+		<xsl:copy>
+			<xsl:apply-templates select="meta" />
+			<xsl:apply-templates select="head" />
+			<xsl:apply-templates select="link" />
+			<xsl:apply-templates
+				select="*[not(self::meta) and not(self::head) and
+				   not(self::link) and not(self::body) and not(self::tei:body)]" />
+			<xsl:apply-templates select="tei:body" />
+		</xsl:copy>
+	</xsl:template>
 
-	        function stopSound(t){
-	       var player = document.getElementById("audioPlay");
+	<xsl:template match="*">
+		<xsl:copy>
+			<xsl:apply-templates select="@* | node()" />
+		</xsl:copy>
+	</xsl:template>
 
-	       player.pause();
-	     };
-	</script>
-	 <audio id="audioPlay" controls="controls" style="height:100px; display:none">
-	    <source src="{$soundFile}"/>
-	  </audio>
-	<xsl:apply-templates/>
-    </xsl:copy>
-  </xsl:template>
+	<xsl:template
+		match="@* | text() | comment() | processing-instruction()">
+		<xsl:copy />
+	</xsl:template>
 
 
-  <!-- En fait, on veut mettre un bouton play, stop -->
-  <xsl:template match="span[@class='spk']">
 
-    <!-- <button type="button" style='background: url("play.png") no-repeat; width:25px;height:25px;background-size:100%;'>
-       <xsl:attribute name="onclick">
-	<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text>
-      </xsl:attribute>
-      <xsl:text> </xsl:text>
-    </button> -->
-      
- 
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:attribute name="onclick">
-	<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text>
-      </xsl:attribute>
-      <xsl:apply-templates select="node()"/>
+	<xsl:template match="tei:body">
+		<xsl:copy>
+			<script>
+				<!-- Element.prototype.documentOffsetTop = function () { return this.offsetTop 
+					+ ( this.offsetParent ? this.offsetParent.documentOffsetTop() : 0 ); }; function 
+					myFunc2(event) { document.getElementById('tracktime').innerHTML = Math.floor(event.currentTime) 
+					+ ' / ' + Math.floor(event.duration); }; function myFunc3(event) { var x 
+					= document.getElementsByTagName("span"); for (index = 0; index &lt; x.length; 
+					index++){ if ((x[index].getAttribute("begin") &lt; event.currentTime) &amp;&amp; 
+					(x[index].getAttribute("end") &gt; event.currentTime)){ x[index].className 
+					= "spk_hi"; /*x[index].scrollIntoView( true );*/ /*var top = x[index].documentOffsetTop() 
+					- ( window.innerHeight / 2 ); window.scrollTo(0, top );*/ var topPos = x[index].offsetTop; 
+					document.getElementById('scrollDiv').scrollTop = topPos-110; } else{ x[index].className="spk"; 
+					} }; }; -->
 
-    </xsl:copy>
-    
-    <!-- <button type="button"  style='background: url("pause.png") no-repeat; width:25px;height:25px;background-size:100%;'>
-       <xsl:attribute name="onclick">
-	<xsl:text>stopSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text>
-      </xsl:attribute>
-      <xsl:text> </xsl:text>
-</button> -->
- 
-  </xsl:template>
+				function moveInSound(t){
+				var player = document.getElementById("audioPlay");
 
-  <xsl:template match="span[@class='sync']">
+				if (player.paused){
+				player.currentTime = t;
+				player.play();
+				}
+				else{
+				player.pause();
+				}
+				};
 
-    <!-- <button type="button" style='background: url("play.png") no-repeat; width:25px;height:25px;background-size:100%;'>
-       <xsl:attribute name="onclick">
-	<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text>
-      </xsl:attribute>
-      <xsl:text> </xsl:text>
-    </button> -->
-      
- 
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:attribute name="onclick">
-	<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(./text())"/><xsl:text>)</xsl:text>
-      </xsl:attribute>
-      <xsl:apply-templates select="node()"/>
+				function stopSound(t){
+				var player = document.getElementById("audioPlay");
 
-    </xsl:copy>
-    
-    <!-- <button type="button"  style='background: url("pause.png") no-repeat; width:25px;height:25px;background-size:100%;'>
-       <xsl:attribute name="onclick">
-	<xsl:text>stopSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text>
+				player.pause();
+				};
+			</script>
+			<audio id="audioPlay" controls="controls"
+				style="height:100px; display:none">
+				<source src="{$soundFile}" />
+			</audio>
+			<xsl:apply-templates />
+		</xsl:copy>
+	</xsl:template>
+
+
+	<!-- En fait, on veut mettre un bouton play, stop -->
+	<xsl:template match="span[@class='spk']">
+
+		<!-- <button type="button" style='background: url("play.png") no-repeat; 
+			width:25px;height:25px;background-size:100%;'> <xsl:attribute name="onclick"> 
+			<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text> 
+			</xsl:attribute> <xsl:text> </xsl:text> </button> -->
+
+
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="onclick">
+	<xsl:text>moveInSound(</xsl:text><xsl:value-of
+				select="atilf:traduireTemps(following::span[@class='sync'][1]/text())" /><xsl:text>)</xsl:text>
       </xsl:attribute>
-      <xsl:text> </xsl:text>
-</button> -->
- 
-  </xsl:template>
+			<xsl:apply-templates select="node()" />
 
-  <xsl:template match="span[@class='word']">
+		</xsl:copy>
 
-    <!-- <button type="button" style='background: url("play.png") no-repeat; width:25px;height:25px;background-size:100%;'>
-       <xsl:attribute name="onclick">
-	<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text>
+		<!-- <button type="button" style='background: url("pause.png") no-repeat; 
+			width:25px;height:25px;background-size:100%;'> <xsl:attribute name="onclick"> 
+			<xsl:text>stopSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text> 
+			</xsl:attribute> <xsl:text> </xsl:text> </button> -->
+
+	</xsl:template>
+
+	<xsl:template match="span[@class='sync']">
+
+		<!-- <button type="button" style='background: url("play.png") no-repeat; 
+			width:25px;height:25px;background-size:100%;'> <xsl:attribute name="onclick"> 
+			<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text> 
+			</xsl:attribute> <xsl:text> </xsl:text> </button> -->
+
+
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="onclick">
+	<xsl:text>moveInSound(</xsl:text><xsl:value-of
+				select="atilf:traduireTemps(./text())" /><xsl:text>)</xsl:text>
       </xsl:attribute>
-      <xsl:text> </xsl:text>
-    </button> -->
-      
- 
-    <xsl:copy>
-      <xsl:apply-templates select="@*"/>
-      <xsl:attribute name="onclick">
-	<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(preceding::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text>
-      </xsl:attribute>
-      <xsl:apply-templates select="node()"/>
+			<xsl:apply-templates select="node()" />
 
-    </xsl:copy>
-    
-    <!-- <button type="button"  style='background: url("pause.png") no-repeat; width:25px;height:25px;background-size:100%;'>
-       <xsl:attribute name="onclick">
-	<xsl:text>stopSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text>
+		</xsl:copy>
+
+		<!-- <button type="button" style='background: url("pause.png") no-repeat; 
+			width:25px;height:25px;background-size:100%;'> <xsl:attribute name="onclick"> 
+			<xsl:text>stopSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text> 
+			</xsl:attribute> <xsl:text> </xsl:text> </button> -->
+
+	</xsl:template>
+
+	<xsl:template match="span[@class='word']">
+
+		<!-- <button type="button" style='background: url("play.png") no-repeat; 
+			width:25px;height:25px;background-size:100%;'> <xsl:attribute name="onclick"> 
+			<xsl:text>moveInSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text> 
+			</xsl:attribute> <xsl:text> </xsl:text> </button> -->
+
+
+		<xsl:copy>
+			<xsl:apply-templates select="@*" />
+			<xsl:attribute name="onclick">
+	<xsl:text>moveInSound(</xsl:text><xsl:value-of
+				select="atilf:traduireTemps(preceding::span[@class='sync'][1]/text())" /><xsl:text>)</xsl:text>
       </xsl:attribute>
-      <xsl:text> </xsl:text>
-</button> -->
- 
-  </xsl:template>
+			<xsl:apply-templates select="node()" />
 
-  
+		</xsl:copy>
+
+		<!-- <button type="button" style='background: url("pause.png") no-repeat; 
+			width:25px;height:25px;background-size:100%;'> <xsl:attribute name="onclick"> 
+			<xsl:text>stopSound(</xsl:text><xsl:value-of select="atilf:traduireTemps(following::span[@class='sync'][1]/text())"/><xsl:text>)</xsl:text> 
+			</xsl:attribute> <xsl:text> </xsl:text> </button> -->
+
+	</xsl:template>
+
+
 </xsl:stylesheet>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Contains various macro samples</p>
+	<p>Contains various macro samples</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/package.html
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/package.html	(revision 2396)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/package.html	(revision 2397)
@@ -1,5 +1,6 @@
 <html>
 <body>
-<p>Macros which transform transcriptions written in ODT, WORD or RTF (like Transana) files to the Transcriber format</p>
+	<p>Macros which transform transcriptions written in ODT, WORD or
+		RTF (like Transana) files to the Transcriber format</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.edition.rcp/.classpath
===================================================================
--- tmp/org.txm.edition.rcp/.classpath	(revision 2396)
+++ tmp/org.txm.edition.rcp/.classpath	(revision 2397)
@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="src" path="res"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="src" path="res" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.edition.rcp/res/js/empty.html
===================================================================
--- tmp/org.txm.edition.rcp/res/js/empty.html	(revision 2396)
+++ tmp/org.txm.edition.rcp/res/js/empty.html	(revision 2397)
@@ -1 +1,4 @@
-<html><head></head><body></body></html>
\ No newline at end of file
+<html>
+<head></head>
+<body></body>
+</html>
\ No newline at end of file
Index: tmp/org.txm.cooccurrence.chartsengine/.classpath
===================================================================
--- tmp/org.txm.cooccurrence.chartsengine/.classpath	(revision 2396)
+++ tmp/org.txm.cooccurrence.chartsengine/.classpath	(revision 2397)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
 		<accessrules>
-			<accessrule kind="accessible" pattern="**"/>
+			<accessrule kind="accessible" pattern="**" />
 		</accessrules>
 	</classpathentry>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="output" path="bin"/>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
Index: tmp/org.txm.index.core/groovy/org/txm/test/IndexSample.groovy
===================================================================
--- tmp/org.txm.index.core/groovy/org/txm/test/IndexSample.groovy	(revision 2396)
+++ tmp/org.txm.index.core/groovy/org/txm/test/IndexSample.groovy	(revision 2397)
@@ -39,37 +39,27 @@
 import org.txm.searchengine.cqp.corpus.query.*
 
 // on récupère le corpus DISCOURS
-MainCorpus discours = CorpusManager.getCorpusManager().getCorpus("BFM")
-println discours
+MainCorpus discours=CorpusManager.getCorpusManager().getCorpus("BFM")println discours
 
 // on récupère ses propriétés
-Property pos = discours.getProperty("ttpos")
-Property word = discours.getProperty("word")
+Property pos=discours.getProperty("ttpos")Property word=discours.getProperty("word")
 
 // on créé une Query, ici "[]"
-Query query = new Query(Query.fixQuery("[word=\"je\"]"))
+Query query=new Query(Query.fixQuery("[word=\"je\"]"))
 
-List<Property> props = [pos,word]
+List<Property>props=[pos,word]
 
 // on exécute la commande
-def time = System.currentTimeMillis()
-println(""+discours+"\t"+query+"\t"+props)
-Index index = new Index(discours, query, props )
-println("execution time : "+(System.currentTimeMillis()-time)+" ms")
+def time=System.currentTimeMillis()println(""+discours+"\t"+query+"\t"+props)Index index=new Index(discours,query,props)println("execution time : "+(System.currentTimeMillis()-time)+" ms")
 
-//sort
-//index.sortLines(LineComparator.SortMode.FREQUNIT)
+// sort
+// index.sortLines(LineComparator.SortMode.FREQUNIT)
 
-//get some infos
-println("V : "+index.getV())
-println("T : "+index.getT())
+// get some infos
+println("V : "+index.getV())println("T : "+index.getT())
 
-//filter
-index.filterLines(2,3000)
-println("V after: "+index.getV())
-println("T after: "+index.getT())
+// filter
+index.filterLines(2,3000)println("V after: "+index.getV())println("T after: "+index.getT())
 
-//on écrit tout dans un fichier
-File file = new File("voc.txt")
-index.toTxt(file, "'", "\t", "UTF-8")
-println("index file : "+ file.getAbsolutePath())
\ No newline at end of file
+// on écrit tout dans un fichier
+File file=new File("voc.txt")index.toTxt(file,"'","\t","UTF-8")println("index file : "+file.getAbsolutePath())
Index: tmp/org.txm.index.core/groovy/org/txm/test/IndexPartition.groovy
===================================================================
--- tmp/org.txm.index.core/groovy/org/txm/test/IndexPartition.groovy	(revision 2396)
+++ tmp/org.txm.index.core/groovy/org/txm/test/IndexPartition.groovy	(revision 2397)
@@ -39,52 +39,36 @@
 import org.txm.searchengine.cqp.corpus.query.*
 // TODO: Auto-generated Javadoc
 
-/* (non-Javadoc)
+/*
+ * (non-Javadoc)
  * @see groovy.lang.Script#run()
  */
-boolean manualInit = false
-if(!org.txm.Toolbox.isInitialized())
-{
-	manualInit = true
-	org.txm.Toolbox.initialize(new File(System.getProperty("user.home")+"/TXM/install.prefs"))
-}
-	// on récupère le corpus DISCOURS
-	MainCorpus discours = CorpusManager.getCorpusManager().getCorpus("DISCOURS")
-	Partition discours_dates = discours.createPartition( discours.getStructuralUnit("text"), discours.getStructuralUnit("text").getProperty("date"))
-	println discours
-	
-	// on récupère ses propriétés
-	Property pos = discours.getProperty("pos")
-	Property word = discours.getProperty("word")
-	
-	// on créé une Query, ici "[]"
-	Query query = new Query(Query.fixQuery("[word=\"j.*\"]"))
-	
-	List<Property> props = [pos,word]
-	
-	// on exécute la commande
-	def time = System.currentTimeMillis()
-	println(""+discours+"\t"+query+"\t"+props)
-	Index index = new Index(discours_dates, query, props )
-	println("execution time : "+(System.currentTimeMillis()-time)+" ms")
-	
-	//sort
-	//index.sortLines(LineComparator.SortMode.FREQUNIT)
-	
-	//get some infos
-	println("V : "+index.getV())
-	println("T : "+index.getT())
-	
-	//filter
-	index.filterLines(2,3000)
-	println("V after: "+index.getV())
-	println("T after: "+index.getT())
-	
-	//on écrit tout dans un fichier
-	File file = new File("voc.txt")
-	index.toTxt(file)
-	println("index file : "+ file.getAbsolutePath())
+boolean manualInit=false if(!org.txm.Toolbox.isInitialized()){manualInit=true org.txm.Toolbox.initialize(new File(System.getProperty("user.home")+"/TXM/install.prefs"))}
+// on récupère le corpus DISCOURS
+MainCorpus discours=CorpusManager.getCorpusManager().getCorpus("DISCOURS")Partition discours_dates=discours.createPartition(discours.getStructuralUnit("text"),discours.getStructuralUnit("text").getProperty("date"))println discours
 
-	
-if(manualInit)
-	org.txm.Toolbox.shutdown()
\ No newline at end of file
+// on récupère ses propriétés
+Property pos=discours.getProperty("pos")Property word=discours.getProperty("word")
+
+// on créé une Query, ici "[]"
+Query query=new Query(Query.fixQuery("[word=\"j.*\"]"))
+
+List<Property>props=[pos,word]
+
+// on exécute la commande
+def time=System.currentTimeMillis()println(""+discours+"\t"+query+"\t"+props)Index index=new Index(discours_dates,query,props)println("execution time : "+(System.currentTimeMillis()-time)+" ms")
+
+// sort
+// index.sortLines(LineComparator.SortMode.FREQUNIT)
+
+// get some infos
+println("V : "+index.getV())println("T : "+index.getT())
+
+// filter
+index.filterLines(2,3000)println("V after: "+index.getV())println("T after: "+index.getT())
+
+// on écrit tout dans un fichier
+File file=new File("voc.txt")index.toTxt(file)println("index file : "+file.getAbsolutePath())
+
+
+if(manualInit)org.txm.Toolbox.shutdown()
Index: tmp/org.txm.index.core/groovy/org/txm/test/TestIndex.java
===================================================================
--- tmp/org.txm.index.core/groovy/org/txm/test/TestIndex.java	(revision 2396)
+++ tmp/org.txm.index.core/groovy/org/txm/test/TestIndex.java	(revision 2397)
@@ -21,6 +21,7 @@
  *
  */
 public class TestIndex {
+	
 	/**
 	 * the corpus name to use
 	 */
@@ -33,20 +34,22 @@
 	
 	/**
 	 * First test
+	 * 
 	 * @param outdir : the out folder
 	 */
 	public boolean test1(File outdir) {
-		return testCorpus(new File(outdir, TestIndex.class.getName()+"_test1.csv"), CORPUS, null, "je", //$NON-NLS-1$ //$NON-NLS-2$
+		return testCorpus(new File(outdir, TestIndex.class.getName() + "_test1.csv"), CORPUS, null, "je", //$NON-NLS-1$ //$NON-NLS-2$
 				Arrays.asList("word"), null); //$NON-NLS-1$
 	}
 	
 	/**
 	 * First test
+	 * 
 	 * @param outdir : the out folder
 	 */
 	public boolean test2(File outdir) {
-//		return testPartition(new File(outdir, TestIndex.class.getName()+"_test2.csv"), CORPUS, "texts", "je", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-//				Arrays.asList("word"), null); //$NON-NLS-1$
+		// return testPartition(new File(outdir, TestIndex.class.getName()+"_test2.csv"), CORPUS, "texts", "je", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		// Arrays.asList("word"), null); //$NON-NLS-1$
 		return false;
 	}
 	
@@ -60,8 +63,9 @@
 			CQLQuery query = new CQLQuery(CQLQuery.fixQuery(queryString));
 			
 			List<WordProperty> properties = new ArrayList<WordProperty>();
-			for (String p : propertiesString) properties.add(corpus.getProperty(p));
-
+			for (String p : propertiesString)
+				properties.add(corpus.getProperty(p));
+			
 			Index index = new Index(corpus);
 			index.setParameters(query, properties, null, null, null, null);
 			index.compute();
@@ -72,38 +76,39 @@
 				else if ("unitfreq".equals(sortBy)) index.sortLines(SortMode.UNITFREQ, false); //$NON-NLS-1$
 			}
 			index.toTxt(outfile, "UTF-8", "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
 			return false;
 		}
 		return true;
 	}
 	
-//	private boolean testPartition(File outfile, String corpusname, String partitionname, String queryString,
-//			List<String> propertiesString, String sortBy) {
-//		try {
-//			CQPCorpus corpus = CorpusManager.getCorpusManager().getCorpus(corpusname);
-//			Partition partition = corpus.getPartition(partitionname);
-//			
-//			CQLQuery query = new CQLQuery(CQLQuery.fixQuery(queryString));
-//			
-//			List<WordProperty> properties = new ArrayList<WordProperty>();
-//			for (String p : propertiesString) properties.add(corpus.getProperty(p));
-//
-//			Index index = new Index(partition);
-//			index.setParameters(query, properties, null, null, null, null);
-//			index.compute();
-//			index.getAllLines();
-//			
-//			if (sortBy != null) {
-//				if ("frequnit".equals(sortBy)) index.sortLines(SortMode.FREQUNIT, false); //$NON-NLS-1$
-//				else if ("unitfreq".equals(sortBy)) index.sortLines(SortMode.UNITFREQ, false); //$NON-NLS-1$
-//			}
-//			index.toTxt(outfile, "UTF-8", "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-//		} catch (Exception e) {
-//			org.txm.utils.logger.Log.printStackTrace(e);
-//			return false;
-//		}
-//		return true;
-//	}
+	// private boolean testPartition(File outfile, String corpusname, String partitionname, String queryString,
+	// List<String> propertiesString, String sortBy) {
+	// try {
+	// CQPCorpus corpus = CorpusManager.getCorpusManager().getCorpus(corpusname);
+	// Partition partition = corpus.getPartition(partitionname);
+	//
+	// CQLQuery query = new CQLQuery(CQLQuery.fixQuery(queryString));
+	//
+	// List<WordProperty> properties = new ArrayList<WordProperty>();
+	// for (String p : propertiesString) properties.add(corpus.getProperty(p));
+	//
+	// Index index = new Index(partition);
+	// index.setParameters(query, properties, null, null, null, null);
+	// index.compute();
+	// index.getAllLines();
+	//
+	// if (sortBy != null) {
+	// if ("frequnit".equals(sortBy)) index.sortLines(SortMode.FREQUNIT, false); //$NON-NLS-1$
+	// else if ("unitfreq".equals(sortBy)) index.sortLines(SortMode.UNITFREQ, false); //$NON-NLS-1$
+	// }
+	// index.toTxt(outfile, "UTF-8", "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+	// } catch (Exception e) {
+	// org.txm.utils.logger.Log.printStackTrace(e);
+	// return false;
+	// }
+	// return true;
+	// }
 }
Index: tmp/org.txm.index.core/groovy/org/txm/macro/r/ExecRMacro.groovy
===================================================================
--- tmp/org.txm.index.core/groovy/org/txm/macro/r/ExecRMacro.groovy	(revision 2396)
+++ tmp/org.txm.index.core/groovy/org/txm/macro/r/ExecRMacro.groovy	(revision 2397)
@@ -9,36 +9,18 @@
 import org.txm.statsengine.r.core.RWorkspace
 
 
-def sel = corpusViewSelection
+def sel=corpusViewSelection
 
-String symbol = null;
-String prop = "none"
-if (sel instanceof Index) {
-	println "Sending Index data to R..."
-	((Index)sel).asRMatrix()
-	symbol = "t("+((Index)sel).getSymbol()+'$data)'
-	prop = ((Index)sel).getProperties().toString()
-}
+String symbol=null;String prop="none"if(sel instanceof Index){println"Sending Index data to R..."((Index)sel).asRMatrix()symbol="t("+((Index)sel).getSymbol()+'$data)'prop=((Index)sel).getProperties().toString()}
 
-if (symbol == null) {
-	println "Selection is not an Index. Aborting."
-	return
-}
+if(symbol==null){println"Selection is not an Index. Aborting."return}
 
-def r = RWorkspace.getRWorkspaceInstance()
-def file = File.createTempFile("IndexHist", ".svg", new File(Toolbox.getTxmHomePath(), "results"))
+def r=RWorkspace.getRWorkspaceInstance()def file=File.createTempFile("IndexHist",".svg",new File(Toolbox.getTxmHomePath(),"results"))
 
 /// BEGIN SCRIPTS
-def script ="""
-par(las=2)
-barplot($symbol, xlab="$prop", ylab="f")
-"""
+def script="""par(las=2)barplot($symbol,xlab="$prop",ylab="f")"""
 /// END SCRIPTS
-r.plot(file, script)
-println "Result saved in: "+file.getAbsolutePath()
+r.plot(file,script)println"Result saved in: "+file.getAbsolutePath()
 
-//display the graphic
-monitor.syncExec(new Runnable() {
-	@Override
-	public void run() {	OpenSVGGraph.OpenSVGFile(file.getAbsolutePath(), "Specificity distribution") }
-});
+// display the graphic
+monitor.syncExec(new Runnable(){@Override public void run(){OpenSVGGraph.OpenSVGFile(file.getAbsolutePath(),"Specificity distribution")}});
Index: tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java	(revision 2397)
@@ -6,12 +6,13 @@
 
 /**
  * Preferences initializer and manager.
+ * 
  * @author mdecorde
  * @author sjacquot
  *
  */
 public class IndexPreferences extends TXMPreferences {
-
+	
 	/**
 	 * 
 	 */
@@ -21,26 +22,27 @@
 	 * Number of the line of the current page.
 	 */
 	public static final String N_TOP_INDEX = "n_top_index"; //$NON-NLS-1$
-
+	
 	/**
 	 * Gets the instance.
+	 * 
 	 * @return the instance
 	 */
-	public static TXMPreferences getInstance()	{
+	public static TXMPreferences getInstance() {
 		if (!TXMPreferences.instances.containsKey(IndexPreferences.class)) {
 			new IndexPreferences();
 		}
 		return TXMPreferences.instances.get(IndexPreferences.class);
 	}
-
 	
+	
 	@Override
 	public void initializeDefaultPreferences() {
 		super.initializeDefaultPreferences();
 		
 		Preferences preferences = this.getDefaultPreferencesNode();
-		preferences.put(UNIT_PROPERTIES, DEFAULT_UNIT_PROPERTY); //$NON-NLS-1$
-		preferences.put(UNIT_PROPERTY, DEFAULT_UNIT_PROPERTY); //$NON-NLS-1$
+		preferences.put(UNIT_PROPERTIES, DEFAULT_UNIT_PROPERTY); // $NON-NLS-1$
+		preferences.put(UNIT_PROPERTY, DEFAULT_UNIT_PROPERTY); // $NON-NLS-1$
 		preferences.put(PROPERTIES_SEPARATOR, "_"); //$NON-NLS-1$
 		preferences.put(QUERY, ""); //$NON-NLS-1$
 		preferences.putInt(F_MIN, 1);
Index: tmp/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/r/IndexRTransformer.java	(revision 2397)
@@ -11,24 +11,24 @@
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 
 public class IndexRTransformer extends RTransformer<Index> {
-
+	
 	/** The novoc. */
 	protected static int novoc = 1;
-
+	
 	/** The prefix r. */
 	protected static String prefixR = "Index"; //$NON-NLS-1$
-
 	
+	
 	public IndexRTransformer() {
 		// TODO Auto-generated constructor stub
 	}
-
+	
 	@Override
 	public Index fromRtoTXM(String symbol) {
 		// TODO Auto-generated method stub
 		return null;
 	}
-
+	
 	/**
 	 * As r matrix.
 	 *
@@ -39,41 +39,41 @@
 	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
 		if (!(o instanceof Index)) return null;
 		
-		Index index = (Index)o;
+		Index index = (Index) o;
 		
-		String symbol = prefixR+novoc;
-
+		String symbol = prefixR + novoc;
+		
 		ArrayList<String> colnames = new ArrayList<String>();
-
+		
 		colnames.add("F"); //$NON-NLS-1$
 		
-		//System.out.println("cols: "+colnames);
+		// System.out.println("cols: "+colnames);
 		List<Line> lines = index.getAllLines();
 		String[] keywords = new String[lines.size()];
-
+		
 		int[] freq = new int[lines.size()];
-
-		for (int i = 0 ; i < lines.size() ; i++) {
+		
+		for (int i = 0; i < lines.size(); i++) {
 			Line line = lines.get(i);
-			freq[i] = line.getFrequency(); 
+			freq[i] = line.getFrequency();
 			keywords[i] = line.toString();
 		}
-
+		
 		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
 		rw.addVectorToWorkspace("vocfreq", freq); //$NON-NLS-1$
 		rw.addVectorToWorkspace("vockeywords", keywords); //$NON-NLS-1$
 		rw.addVectorToWorkspace("voccolnames", colnames.toArray(new String[colnames.size()])); //$NON-NLS-1$
-
+		
 		int ncol = 1;
-
+		
 		int nrow = lines.size();
 		String partscmd = ""; //$NON-NLS-1$
 		
-		rw.eval(symbol+ "<- matrix(data = c(vocfreq"+partscmd+"), nrow = "+nrow+", ncol = "+ncol+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		rw.eval("colnames("+symbol+" ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval("rownames("+symbol+" ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval(symbol+ "<- list(data="+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
-
+		rw.eval(symbol + "<- matrix(data = c(vocfreq" + partscmd + "), nrow = " + nrow + ", ncol = " + ncol + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		rw.eval("colnames(" + symbol + " ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("rownames(" + symbol + " ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval(symbol + "<- list(data=" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+		
 		novoc++;
 		return symbol;
 	}
Index: tmp/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/r/ParitionIndexRTransformer.java	(revision 2397)
@@ -11,23 +11,23 @@
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 
 public class ParitionIndexRTransformer extends RTransformer<PartitionIndex> {
-
+	
 	/** The novoc. */
 	protected static int novoc = 1;
-
+	
 	/** The prefix r. */
 	protected static String prefixR = "PartitionIndex"; //$NON-NLS-1$
-
 	
+	
 	public ParitionIndexRTransformer() {
 		// TODO Auto-generated constructor stub
 	}
-
+	
 	@Override
 	public PartitionIndex fromRtoTXM(String symbol) {
 		return null;
 	}
-
+	
 	/**
 	 * As r matrix.
 	 *
@@ -38,55 +38,55 @@
 	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
 		if (!(o instanceof PartitionIndex)) return null;
 		
-		PartitionIndex index = (PartitionIndex)o;
+		PartitionIndex index = (PartitionIndex) o;
 		
-		String symbol = prefixR+novoc;
-
+		String symbol = prefixR + novoc;
+		
 		ArrayList<String> colnames = new ArrayList<String>();
 		List<String> partnames = index.getPartnames();
 		
 		colnames.add("F"); //$NON-NLS-1$
 		colnames.addAll(partnames);
 		
-		//System.out.println("cols: "+colnames);
+		// System.out.println("cols: "+colnames);
 		List<Line> lines = index.getAllLines();
 		String[] keywords = new String[lines.size()];
-
+		
 		int[] freq = new int[lines.size()];
 		ArrayList<int[]> partfreqs = new ArrayList<int[]>(partnames.size());
 		for (int j = 0; j < partnames.size(); j++) {
 			partfreqs.add(new int[lines.size()]);
 		}
 		
-		for (int i = 0 ; i < lines.size() ; i++) {
+		for (int i = 0; i < lines.size(); i++) {
 			Line line = lines.get(i);
-			freq[i] = line.getFrequency(); 
+			freq[i] = line.getFrequency();
 			keywords[i] = line.toString();
 			for (int j = 0; j < partnames.size(); j++) {
 				partfreqs.get(j)[i] = line.getFrequency(j);
 			}
 		}
-
+		
 		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
 		for (int j = 0; j < partnames.size(); j++) {
-			rw.addVectorToWorkspace("vocpartfreqs"+j, partfreqs.get(j)); //$NON-NLS-1$
+			rw.addVectorToWorkspace("vocpartfreqs" + j, partfreqs.get(j)); //$NON-NLS-1$
 		}
 		rw.addVectorToWorkspace("vocfreq", freq); //$NON-NLS-1$
 		rw.addVectorToWorkspace("vockeywords", keywords); //$NON-NLS-1$
 		rw.addVectorToWorkspace("voccolnames", colnames.toArray(new String[colnames.size()])); //$NON-NLS-1$
-
+		
 		int ncol = 1 + partnames.size();
-
+		
 		int nrow = lines.size();
 		String partscmd = ""; //$NON-NLS-1$
 		for (int j = 0; j < partnames.size(); j++) {
-			partscmd +=", vocpartfreqs"+j; //$NON-NLS-1$
+			partscmd += ", vocpartfreqs" + j; //$NON-NLS-1$
 		}
-		rw.eval(symbol+ "<- matrix(data = c(vocfreq"+partscmd+"), nrow = "+nrow+", ncol = "+ncol+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		rw.eval("colnames("+symbol+" ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval("rownames("+symbol+" ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval(symbol+ "<- list(data="+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
-
+		rw.eval(symbol + "<- matrix(data = c(vocfreq" + partscmd + "), nrow = " + nrow + ", ncol = " + ncol + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		rw.eval("colnames(" + symbol + " ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("rownames(" + symbol + " ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval(symbol + "<- list(data=" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+		
 		novoc++;
 		return symbol;
 	}
Index: tmp/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/r/LexiconRTransformer.java	(revision 2397)
@@ -11,24 +11,24 @@
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 
 public class LexiconRTransformer extends RTransformer<Lexicon> {
-
+	
 	/** The novoc. */
 	protected static int novoc = 1;
-
+	
 	/** The prefix r. */
 	protected static String prefixR = "Lexicon"; //$NON-NLS-1$
-
 	
+	
 	public LexiconRTransformer() {
 		// TODO Auto-generated constructor stub
 	}
-
+	
 	@Override
 	public Lexicon fromRtoTXM(String symbol) {
 		// TODO Auto-generated method stub
 		return null;
 	}
-
+	
 	/**
 	 * As r matrix.
 	 *
@@ -39,41 +39,41 @@
 	public String fromTXMtoR(TXMResult o) throws RWorkspaceException {
 		if (!(o instanceof Lexicon)) return null;
 		
-		Lexicon index = (Lexicon)o;
+		Lexicon index = (Lexicon) o;
 		
-		String symbol = prefixR+novoc;
-
+		String symbol = prefixR + novoc;
+		
 		ArrayList<String> colnames = new ArrayList<String>();
-
+		
 		colnames.add("F"); //$NON-NLS-1$
 		
-		//System.out.println("cols: "+colnames);
+		// System.out.println("cols: "+colnames);
 		List<Line> lines = index.getAllLines();
 		String[] keywords = new String[lines.size()];
-
+		
 		int[] freq = new int[lines.size()];
-
-		for (int i = 0 ; i < lines.size() ; i++) {
+		
+		for (int i = 0; i < lines.size(); i++) {
 			Line line = lines.get(i);
-			freq[i] = line.getFrequency(); 
+			freq[i] = line.getFrequency();
 			keywords[i] = line.toString();
 		}
-
+		
 		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
 		rw.addVectorToWorkspace("vocfreq", freq); //$NON-NLS-1$
 		rw.addVectorToWorkspace("vockeywords", keywords); //$NON-NLS-1$
 		rw.addVectorToWorkspace("voccolnames", colnames.toArray(new String[colnames.size()])); //$NON-NLS-1$
-
+		
 		int ncol = 1;
-
+		
 		int nrow = lines.size();
 		String partscmd = ""; //$NON-NLS-1$
 		
-		rw.eval(symbol+ "<- matrix(data = c(vocfreq"+partscmd+"), nrow = "+nrow+", ncol = "+ncol+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		rw.eval("colnames("+symbol+" ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval("rownames("+symbol+" ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.eval(symbol+ "<- list(data="+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
-
+		rw.eval(symbol + "<- matrix(data = c(vocfreq" + partscmd + "), nrow = " + nrow + ", ncol = " + ncol + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		rw.eval("colnames(" + symbol + " ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval("rownames(" + symbol + " ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
+		rw.eval(symbol + "<- list(data=" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+		
 		novoc++;
 		return symbol;
 	}
Index: tmp/org.txm.index.core/src/org/txm/index/core/messages/IndexCoreMessages.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/messages/IndexCoreMessages.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/messages/IndexCoreMessages.java	(revision 2397)
@@ -9,32 +9,38 @@
  *
  */
 public class IndexCoreMessages extends NLS {
-
+	
 	private static final String BUNDLE_NAME = "org.txm.index.core.messages.messages"; //$NON-NLS-1$
 	
-	public static String indexColonPartitionP0queryP1propertiesP2FminP3FmaxP4; 
-	public static String indexColonCorpusP0queryP1propertiesP2FminP3FmaxP4; 
+	public static String indexColonPartitionP0queryP1propertiesP2FminP3FmaxP4;
 	
+	public static String indexColonCorpusP0queryP1propertiesP2FminP3FmaxP4;
+	
 	public static String RESULT_TYPE;
-	public static String lexicon; 
 	
-	public static String consoleColonP0; 
-	public static String error_failedToExportLexiconColonP0; 
-
-
-	public static String formsAndFrequenciesTablesMustHaveTheSameSize; 
-	public static String lexiconColonP0; 
+	public static String lexicon;
+	
+	public static String consoleColonP0;
+	
+	public static String error_failedToExportLexiconColonP0;
+	
+	
+	public static String formsAndFrequenciesTablesMustHaveTheSameSize;
+	
+	public static String lexiconColonP0;
+	
 	public static String computingTheLexiconOfSubcorpusP0;
+	
 	public static String lexiconOfP0InTheP1Corpus;
+	
 	public static String indexOfP0PropertiesP1InTheP2Corpus;
 	
 	
-
+	
 	static {
 		// initialize resource bundle
 		Utf8NLS.initializeMessages(BUNDLE_NAME, IndexCoreMessages.class);
 	}
-
-	private IndexCoreMessages() {
-	}
+	
+	private IndexCoreMessages() {}
 }
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/package.html
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/package.html	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Index function</p>
+	<p>Index function</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/LineComparator.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/LineComparator.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/LineComparator.java	(revision 2397)
@@ -37,31 +37,31 @@
  * The Class LineComparator.
  */
 public class LineComparator implements Comparator<Line> {
-
+	
 	/** The collator. */
 	protected Collator collator;
-
+	
 	/**
 	 * The Enum SortMode.
 	 */
 	public enum SortMode { // the sort methods
 		/** The FREQ. */
- FREQ, // compare only frequency
+		FREQ, // compare only frequency
 		/** The UNIT. */
- UNIT, // compare only units
+		UNIT, // compare only units
 		/** The FREQUNIT. */
- FREQUNIT, // compare frequency then units
+		FREQUNIT, // compare frequency then units
 		/** The UNITFREQ. */
- UNITFREQ
+		UNITFREQ
 		// compare units then frequency
 	}
-
+	
 	/** The currentsortmode. */
 	SortMode currentsortmode = SortMode.FREQUNIT;
 	
 	/** The reverse. */
 	boolean reverse;
-
+	
 	/**
 	 * Instantiates a new line comparator.
 	 *
@@ -72,7 +72,7 @@
 		setSortByFrequence(mode);
 		setReverse(reverse);
 	}
-
+	
 	/**
 	 * set if the sort must be reverted.
 	 *
@@ -81,41 +81,42 @@
 	private void setReverse(boolean reverse) {
 		this.reverse = reverse;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
 	 */
 	@Override
 	public int compare(Line arg0, Line arg1) {
 		int sort = 0;
 		switch (currentsortmode) {
-		case FREQUNIT:
-			sort = arg0.getFrequency() - arg1.getFrequency();
+			case FREQUNIT:
+				sort = arg0.getFrequency() - arg1.getFrequency();
+				
+				if (sort == 0)
+					sort = -collator.compare(arg0.toString(), arg1.toString());
+				
+				break;
 			
-			if (sort == 0)
-				sort = -collator.compare(arg0.toString(), arg1.toString());
+			case UNITFREQ:
+				sort = collator.compare(arg0.toString(), arg1.toString());
+				if (sort == 0)
+					sort = arg0.getFrequency() - arg1.getFrequency();
+				break;
 			
-			break;
-
-		case UNITFREQ:
-			sort = collator.compare(arg0.toString(), arg1.toString());
-			if (sort == 0)
+			case FREQ:
 				sort = arg0.getFrequency() - arg1.getFrequency();
-			break;
-
-		case FREQ:
-			sort = arg0.getFrequency() - arg1.getFrequency();
-			break;
-
-		case UNIT:
-			sort = collator.compare(arg0.toString(), arg1.toString());
-			break;
+				break;
+			
+			case UNIT:
+				sort = collator.compare(arg0.toString(), arg1.toString());
+				break;
 		}
 		if (reverse)
 			sort = -sort;
 		return sort;
 	}
-
+	
 	/**
 	 * set the sort method.
 	 *
@@ -124,7 +125,7 @@
 	public void setSortByFrequence(SortMode mode) {
 		currentsortmode = mode;
 	}
-
+	
 	/**
 	 * Initialize.
 	 *
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/___Lexicon2.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/___Lexicon2.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/___Lexicon2.java	(revision 2397)
@@ -69,66 +69,68 @@
  * @author sloiseau
  */
 public class ___Lexicon2 extends Index {
-
+	
 	/** The nolex. */
 	protected static int nolex = 1;
-
+	
 	/** The prefix r. */
 	protected static String prefixR = "Lexicon_"; //$NON-NLS-1$
-
+	
 	/** The forms. */
 	private String[] forms;
-
+	
 	/** The freqs. */
 	private int[] freqs;
-
+	
 	/** The ids. */
 	private int[] ids;
-
+	
 	/** The number of tokens. */
 	int numberOfTokens = -1;
-
+	
 	/** The symbol. */
 	private String symbol;
-
+	
 	/** The writer. */
 	private OutputStreamWriter writer;
-
+	
 	/**
 	 * The property.
 	 */
-	@Parameter(key=TXMPreferences.UNIT_PROPERTY)
+	@Parameter(key = TXMPreferences.UNIT_PROPERTY)
 	protected Property pProperty;
 	
-
+	
 	/**
 	 * Creates a not computed lexicon from the specified corpus.
+	 * 
 	 * @param parent
 	 */
-	public ___Lexicon2(CQPCorpus parent)	{
+	public ___Lexicon2(CQPCorpus parent) {
 		super(parent);
 	}
-
+	
 	/**
 	 * Creates a not computed lexicon from the specified parametersNodePath node name.
+	 * 
 	 * @param parametersNodePath
 	 */
-	public ___Lexicon2(String parametersNodePath)	{
+	public ___Lexicon2(String parametersNodePath) {
 		super(parametersNodePath);
 	}
 	
-
 	
+	
 	@Override
 	public CQPCorpus getParent() {
-		return (CQPCorpus)super.getParent();
+		return (CQPCorpus) super.getParent();
 	}
-
+	
 	@Override
 	public boolean loadParameters() {
 		super.loadParameters();
 		try {
-			//this.persistable = false; // FIXME: remove that later
+			// this.persistable = false; // FIXME: remove that later
 			String p = this.getStringParameterValue(TXMPreferences.UNIT_PROPERTY);
 			if (p != null && p.length() > 0) {
 				CQPCorpus parent = getParent();
@@ -152,29 +154,29 @@
 	public boolean saveParameters() {
 		super.saveParameters();
 		// FIXME: became useless? check that it's well automated by autoSaveParametersFromAnnotations()?
-		//this.saveParameter(TXMPreferences.UNIT_PROPERTY, this.pProperty);
+		// this.saveParameter(TXMPreferences.UNIT_PROPERTY, this.pProperty);
 		return true;
 	}
-
 	
+	
 	@Override
 	public void clean() {
 		super.clean();
 		// TODO Auto-generated method stub
 	}
-
+	
 	@Override
 	public boolean canCompute() {
 		return super.canCompute() && (pProperty != null);
 	}
-
+	
 	@Override
 	protected boolean _computeLines() throws Exception {
 		if (this.getParent() instanceof MainCorpus) {
-			return computeWithMainCorpus((MainCorpus)this.getParent(), pProperty, monitor);
+			return computeWithMainCorpus((MainCorpus) this.getParent(), pProperty, monitor);
 		}
 		else if (this.getParent() instanceof Subcorpus) {
-			return computewithSubCorpus((Subcorpus)this.getParent(), pProperty, monitor);
+			return computewithSubCorpus((Subcorpus) this.getParent(), pProperty, monitor);
 		}
 		else {
 			Log.severe("Error: Lexicon parent is neither a Maincorpus nor a Subcorpus."); //$NON-NLS-1$
@@ -201,27 +203,29 @@
 		int lexiconSize;
 		try {
 			lexiconSize = CorpusManager.getCorpusManager().getCqiClient().lexiconSize(property.getQualifiedName());
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			throw new CqiClientException(e);
 		}
-
+		
 		int[] ids = new int[lexiconSize];
 		for (int i = 0; i < ids.length; i++) {
 			ids[i] = i;
 		}
-
+		
 		int[] freqs;
 		try {
 			this.subTask("Computing lexicon frequencies...");
 			freqs = CorpusManager.getCorpusManager().getCqiClient().id2Freq(property.getQualifiedName(), ids);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			throw new CqiClientException(e);
 		}
-
+		
 		this.init(corpus, property, freqs, ids);
 		return true;
 	}
-
+	
 	/**
 	 * 
 	 * @param corpus
@@ -231,16 +235,16 @@
 	 * @throws CqiClientException
 	 */
 	// FIXME: why this method needs to create and delete some new subcorpus???? the computing can't be done directly on the corpus argument???
-	// eg. dist = CorpusManager.getCorpusManager().getCqiClient().fdist1(corpus.getQualifiedCqpId(), 0,	ICqiClient.CQI_CONST_FIELD_MATCH, property.getName());
+	// eg. dist = CorpusManager.getCorpusManager().getCqiClient().fdist1(corpus.getQualifiedCqpId(), 0, ICqiClient.CQI_CONST_FIELD_MATCH, property.getName());
 	protected boolean computewithSubCorpus(Subcorpus corpus, Property property, IProgressMonitor monitor) throws CqiClientException {
-
-//		if (corpus instanceof Part) {
-//			this.persistable = false;
-//		}
 		
-		//System.out.println("not found");
+		// if (corpus instanceof Part) {
+		// this.persistable = false;
+		// }
+		
+		// System.out.println("not found");
 		Log.finest(NLS.bind(IndexCoreMessages.computingTheLexiconOfSubcorpusP0, corpus.getName()));
-		//long start = System.currentTimeMillis();
+		// long start = System.currentTimeMillis();
 		int[][] fdist = null;
 		Subcorpus tmp = null;
 		try {
@@ -248,14 +252,16 @@
 			tmp = corpus.createSubcorpus(new CQLQuery("[]"), "S" + corpus.getNextSubcorpusCounter(), true); //$NON-NLS-1$
 			if (tmp != null) {
 				fdist = CorpusManager.getCorpusManager().getCqiClient().fdist1(tmp.getQualifiedCqpId(), 0, ICqiClient.CQI_CONST_FIELD_MATCH, property.getName());
-
+				
 				corpus.dropSubcorpus(tmp);
 				tmp.delete();
 			}
-			//System.out.println("nb lines: "+fdist.length);
-		} catch (Exception e) {
+			// System.out.println("nb lines: "+fdist.length);
+		}
+		catch (Exception e) {
 			throw new CqiClientException(e);
-		} finally {
+		}
+		finally {
 			if (tmp != null) {
 				try {
 					corpus.dropSubcorpus(tmp);
@@ -266,14 +272,14 @@
 			}
 		}
 		int lexiconSize = fdist.length;
-
+		
 		int[] freqs = new int[lexiconSize];
 		int[] ids = new int[lexiconSize];
 		for (int i = 0; i < fdist.length; i++) {
 			ids[i] = fdist[i][0];
 			freqs[i] = fdist[i][1];
 		}
-
+		
 		init(corpus, property, freqs, ids);
 		return true;
 	}
@@ -291,7 +297,7 @@
 		this.symbol = v.getSymbol();
 		return v;
 	}
-
+	
 	/**
 	 * Compute number of tokens. / this.nbr
 	 */
@@ -301,7 +307,7 @@
 			numberOfTokens += freqs[i];
 		}
 	}
-
+	
 	/**
 	 * Dump lexicon forms and frequencies in a String.
 	 *
@@ -313,12 +319,13 @@
 		StringBuffer buffer = new StringBuffer();
 		getForms();
 		for (int i = 0; i < forms.length; i++) {
-			buffer.append(txt + forms[i].replace(txt, txt + txt) + txt + col + freqs[i] + "\n"); //$NON-NLS-1$ 
+			buffer.append(txt + forms[i].replace(txt, txt + txt) + txt + col + freqs[i] + "\n"); //$NON-NLS-1$
 		}
 		return buffer.toString();
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see java.lang.Object#equals(java.lang.Object)
 	 */
 	@Override
@@ -327,15 +334,15 @@
 			return false;
 		}
 		___Lexicon2 other = (___Lexicon2) obj;
-
+		
 		if (other.nbrOfType() != this.nbrOfType()) {
 			return false;
 		}
 		return (Arrays.equals(freqs, other.getFreq()) && Arrays.equals(getForms(), other.getForms()));
 	}
-
-
-
+	
+	
+	
 	public String getDetails() {
 		try {
 			return this.getParent().getName() + " " + this.pProperty.getName(); //$NON-NLS-1$
@@ -344,26 +351,26 @@
 			return this.getCurrentName();
 		}
 	}
-
-	//TODO: move this into a Lexicon chart renderer
-	//	/**
-	//	 * Draw a pareto graphic with this frequency list and record it into the
-	//	 * provided filename into svg format.
-	//	 *
-	//	 * @param file where to save the pareto graphic.
-	//	 * @return the pareto graphic
-	//	 * @throws StatException if anything goes wrong.
-	//	 */
-	//	public void getParetoGraphic(File file) throws StatException {
-	//		String rName = asVector().getSymbol();
-	//		String expr = "pareto(" + rName + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-	//		try {
-	//			RWorkspace.getRWorkspaceInstance().plot(file, expr, RDevice.SVG);
-	//		} catch (Exception e) {
-	//			throw new StatException(e);
-	//		}
-	//	}
-
+	
+	// TODO: move this into a Lexicon chart renderer
+	// /**
+	// * Draw a pareto graphic with this frequency list and record it into the
+	// * provided filename into svg format.
+	// *
+	// * @param file where to save the pareto graphic.
+	// * @return the pareto graphic
+	// * @throws StatException if anything goes wrong.
+	// */
+	// public void getParetoGraphic(File file) throws StatException {
+	// String rName = asVector().getSymbol();
+	// String expr = "pareto(" + rName + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+	// try {
+	// RWorkspace.getRWorkspaceInstance().plot(file, expr, RDevice.SVG);
+	// } catch (Exception e) {
+	// throw new StatException(e);
+	// }
+	// }
+	
 	/**
 	 * The dif ferent types in the lexicon, the type at the index <code>j</code>
 	 * of this array have the frequency at index <code>j</code> in the array
@@ -373,19 +380,20 @@
 	 */
 	public String[] getForms() {
 		if (forms == null) {
-			if(ids == null) {
+			if (ids == null) {
 				return new String[0];
 			}
 			try {
 				forms = CorpusManager.getCorpusManager().getCqiClient().id2Str(pProperty.getQualifiedName(), ids);
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				// TODO Auto-generated catch block
 				org.txm.utils.logger.Log.printStackTrace(e);
 			}
 		}
 		return forms;
 	}
-
+	
 	/**
 	 * The different types in the lexicon, the type at the index <code>j</code>
 	 * of this array have the frequency at index <code>j</code> in the array
@@ -395,7 +403,7 @@
 	 * @return types as an array of <code>String</code>
 	 */
 	public String[] getForms(int number) {
-		//System.out.println("Lexicon("+this.property+" get forms. number="+number+", ids len="+ids.length);
+		// System.out.println("Lexicon("+this.property+" get forms. number="+number+", ids len="+ids.length);
 		if (forms == null) {
 			try {
 				number = Math.min(number, ids.length);
@@ -405,12 +413,14 @@
 				int[] subpositions = new int[number];
 				System.arraycopy(ids, 0, subpositions, 0, number);
 				return CorpusManager.getCorpusManager().getCqiClient().id2Str(pProperty.getQualifiedName(), subpositions);
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				// TODO Auto-generated catch block
 				org.txm.utils.logger.Log.printStackTrace(e);
 				return null;
 			}
-		} else {
+		}
+		else {
 			number = Math.min(number, ids.length);
 			if (number <= 0) {
 				return new String[0];
@@ -420,7 +430,7 @@
 			return subforms;
 		}
 	}
-
+	
 	/**
 	 * The dif ferent frequencies in the lexicon. See {@link #getForms()}.
 	 * 
@@ -429,7 +439,7 @@
 	public int[] getFreq() {
 		return freqs;
 	}
-
+	
 	/**
 	 * return the ids of the entries.
 	 *
@@ -438,17 +448,17 @@
 	public int[] getIds() {
 		return ids;
 	}
-
+	
 	@Override
 	public String getName() {
 		try {
-			return IndexCoreMessages.lexicon + ": " + this.parent.getSimpleName() + ": " + this.getSimpleName();	
+			return IndexCoreMessages.lexicon + ": " + this.parent.getSimpleName() + ": " + this.getSimpleName();
 		}
-		catch(Exception e) {
+		catch (Exception e) {
 		}
 		return ""; //$NON-NLS-1$
 	}
-
+	
 	/**
 	 * The property this lexicon is build on.
 	 * 
@@ -457,17 +467,17 @@
 	public Property getProperty() {
 		return pProperty;
 	}
-
+	
 	@Override
 	public String getSimpleName() {
 		try {
 			return this.getProperty().getName();
 		}
-		catch(Exception e) {
+		catch (Exception e) {
 			return this.getEmptyName();
 		}
 	}
-
+	
 	/**
 	 * Gets the symbol.
 	 *
@@ -476,33 +486,33 @@
 	public String getSymbol() {
 		return this.symbol;
 	}
-
+	
 	/**
 	 * Hack frequencies using a map to set forms and frequencies
 	 *
 	 * @param corpus the corpus
 	 * @param pProperty the property
 	 * @param map the map
-	 * {@link Corpus#getLexicon(Property)} or
-	 * {@link Subcorpus#getLexicon(Property)}.
+	 *            {@link Corpus#getLexicon(Property)} or
+	 *            {@link Subcorpus#getLexicon(Property)}.
 	 */
 	public boolean hack(Map<String, Integer> map) {
 		if (map.size() != forms.length) {
 			return false;
 		}
-
-		//super(corpus);
+		
+		// super(corpus);
 		int size = map.size();
 		int[] freqs = new int[size];
 		String[] forms = map.keySet().toArray(new String[] {});
 		for (int i = 0; i < forms.length; i++) {
 			freqs[i] = map.get(forms[i]);
 		}
-
+		
 		this.freqs = freqs;
 		return true;
 	}
-
+	
 	/**
 	 * Protected on purpose: should be accessed through others initializer.
 	 *
@@ -510,8 +520,8 @@
 	 * @param property the property
 	 * @param freq the freq
 	 * @param ids the ids
-	 * {@link Corpus#getLexicon(Property)} or
-	 * {@link Subcorpus#getLexicon(Property)}.
+	 *            {@link Corpus#getLexicon(Property)} or
+	 *            {@link Subcorpus#getLexicon(Property)}.
 	 */
 	protected void init(TXMResult corpus, Property property, int[] freq, int[] ids) {
 		if (freq.length != ids.length) {
@@ -522,8 +532,8 @@
 		this.forms = null;
 		this.pProperty = property;
 	}
-
-
+	
+	
 	/**
 	 * Number of tokens (sum of all the frequencies) in the corpus.
 	 * 
@@ -535,8 +545,8 @@
 		}
 		return numberOfTokens;
 	}
-
-
+	
+	
 	/**
 	 * Number of different types in the frequency list.
 	 * 
@@ -550,23 +560,24 @@
 			return 0;
 		}
 	}
-
+	
 	public void setParameters(Property property) {
 		this.pProperty = property;
 	}
-
+	
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
 		try {
 			Property p = (Property) parameters.get("properties");
 			this.setParameters(p);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.printStackTrace(e);
 			return false;
 		}
 		return true;
 	}
-
+	
 	/**
 	 * Sets the symbol.
 	 *
@@ -575,13 +586,13 @@
 	public void setSymbol(String symbol) {
 		this.symbol = symbol;
 	}
-
-
+	
+	
 	@Override
 	public String toString() {
 		return NLS.bind(IndexCoreMessages.lexiconColonP0, this.getCurrentName());
 	}
-
+	
 	/**
 	 * To txt.
 	 *
@@ -597,38 +608,43 @@
 		// OutputStreamWriter writer;
 		try {
 			this.writer = new OutputStreamWriter(new FileOutputStream(outfile),
-					encoding); 
-		} catch (UnsupportedEncodingException e1) {
+					encoding);
+		}
+		catch (UnsupportedEncodingException e1) {
 			org.txm.utils.logger.Log.printStackTrace(e1);
 			return false;
-		} catch (FileNotFoundException e1) {
+		}
+		catch (FileNotFoundException e1) {
 			org.txm.utils.logger.Log.printStackTrace(e1);
 			return false;
 		}
-
+		
 		try {
 			writer.write(this.dump(colseparator, txtseparator));
 			writer.close();
-		} catch (IOException e) {
+		}
+		catch (IOException e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
 			return false;
 		}
-
+		
 		return true;
 	}
-
+	
 	/**
 	 * Sets the unit property.
+	 * 
 	 * @param property the unit property
 	 */
 	public void setProperty(Property property) {
 		this.pProperty = property;
 	}
-
-
+	
+	
 	/**
 	 * Gets a Lexicon from the specified corpus.
 	 * If a Lexicon child exists in the Corpus fro the specified property, returns it otherwise creates and computes a new Lexicon.
+	 * 
 	 * @param corpus
 	 * @param property
 	 * @return
@@ -637,22 +653,22 @@
 	public static ___Lexicon2 getLexicon(CQPCorpus corpus, Property property, IProgressMonitor monitor) throws Exception {
 		___Lexicon2 lexicon = null;
 		
-		// recycling parent Lexicon if exists 
-		ArrayList<___Lexicon2> partLexicons = (ArrayList<___Lexicon2>)corpus.getChildren(___Lexicon2.class);
+		// recycling parent Lexicon if exists
+		ArrayList<___Lexicon2> partLexicons = (ArrayList<___Lexicon2>) corpus.getChildren(___Lexicon2.class);
 		for (int i = 0; i < partLexicons.size(); i++) {
-			if(partLexicons.get(i).getProperty() == property)	{
+			if (partLexicons.get(i).getProperty() == property) {
 				lexicon = partLexicons.get(i);
 				break;
 			}
 		}
 		
 		// creating new Lexicon
-		if(lexicon == null || lexicon.getProperty() != property)	{
+		if (lexicon == null || lexicon.getProperty() != property) {
 			lexicon = new ___Lexicon2(corpus);
 			lexicon.setProperty(property);
 		}
 		
-		if(!lexicon.hasBeenComputedOnce())	{
+		if (!lexicon.hasBeenComputedOnce()) {
 			lexicon.compute(monitor);
 		}
 		
@@ -660,39 +676,39 @@
 	}
 	
 	
-//	/**
-//	 * Find or build a lexicon given a Corpus (MainCorpus or SubCorpus).
-//	 * 
-//	 * @param corpus
-//	 * @param property
-//	 * @return a Lexicon. May return null if the lexicon forms or freqs are null.
-//	 * @throws Exception 
-//	 */
-//	public static Lexicon getLexicon(Corpus corpus, Property property) throws Exception {
-//		HashSet<Object> results = corpus.getStoredData(Lexicon.class);
-//		for (Object result : results) {
-//			Lexicon lex = (Lexicon)result;
-//			if (lex.getProperty().equals(property)) {
-//				return lex;
-//			}
-//		}
-//
-//		Lexicon lex = new Lexicon(corpus);
-//		lex.setParameters(property);
-//		if (lex.compute(null) && lex.getForms() != null && lex.getFreq() != null) {
-//			corpus.storeData(lex);
-//			return lex;
-//		} else {
-//			return null;
-//		}
-//	}
-
-
-
+	// /**
+	// * Find or build a lexicon given a Corpus (MainCorpus or SubCorpus).
+	// *
+	// * @param corpus
+	// * @param property
+	// * @return a Lexicon. May return null if the lexicon forms or freqs are null.
+	// * @throws Exception
+	// */
+	// public static Lexicon getLexicon(Corpus corpus, Property property) throws Exception {
+	// HashSet<Object> results = corpus.getStoredData(Lexicon.class);
+	// for (Object result : results) {
+	// Lexicon lex = (Lexicon)result;
+	// if (lex.getProperty().equals(property)) {
+	// return lex;
+	// }
+	// }
+	//
+	// Lexicon lex = new Lexicon(corpus);
+	// lex.setParameters(property);
+	// if (lex.compute(null) && lex.getForms() != null && lex.getFreq() != null) {
+	// corpus.storeData(lex);
+	// return lex;
+	// } else {
+	// return null;
+	// }
+	// }
+	
+	
+	
 	@Override
 	public String getResultType() {
 		return IndexCoreMessages.lexicon;
 	}
-
 	
-}
\ No newline at end of file
+	
+}
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java	(revision 2397)
@@ -47,8 +47,8 @@
  * @author mdecorde
  */
 public class Lexicon extends Index {
-
-
+	
+	
 	public Lexicon(CQPCorpus parent) {
 		super(parent);
 	}
@@ -60,10 +60,10 @@
 	@Override
 	protected boolean _computeLines() {
 		try {
-
-			//this.query = new Query("[]"); //$NON-NLS-1$
-			//			this.props = new ArrayList<Property>();
-			//			this.props.add(property);
+			
+			// this.query = new Query("[]"); //$NON-NLS-1$
+			// this.props = new ArrayList<Property>();
+			// this.props.add(property);
 			Property property = pProperties.get(0);
 			
 			CQPLexicon lexicon = CQPLexicon.getLexicon(this.getCorpus(), property, monitor);
@@ -86,9 +86,9 @@
 					c[0] = freqs[i];
 					l.setCounts(c, freqs[i] / lexicon.nbrOfToken());
 					l.putIds(property, new int[] { ids[i] });
-
+					
 					lines.add(l);
-
+					
 					if (Fmin > freqs[i]) {
 						Fmin = freqs[i];
 					}
@@ -98,7 +98,8 @@
 				}
 			}
 			
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.severe(TXMCoreMessages.bind(TXMCoreMessages.errorColonP0, e.getLocalizedMessage()));
 			Log.printStackTrace(e);
 			return false;
@@ -118,14 +119,14 @@
 	public String getComputingStartMessage() {
 		return TXMCoreMessages.bind(IndexCoreMessages.lexiconOfP0InTheP1Corpus, WordProperty.propertiesToString(this.pProperties), this.getCorpus().getName());
 	}
-
 	
+	
 	@Override
 	public String getName() {
 		try {
 			return this.getParent().getSimpleName() + ": " + this.getSimpleName();
 		}
-		catch(NullPointerException e) {
+		catch (NullPointerException e) {
 			return this.getEmptyName();
 		}
 	}
@@ -139,5 +140,5 @@
 			return getParent().getSimpleName();
 		}
 	}
-
-}
\ No newline at end of file
+	
+}
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/PartitionIndex.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/PartitionIndex.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/PartitionIndex.java	(revision 2397)
@@ -68,92 +68,93 @@
 import org.txm.utils.logger.Log;
 
 /**
- * Computes an index of a corpus or a partition. 
+ * Computes an index of a corpus or a partition.
  * 
  * @author mdecorde
  */
-public class PartitionIndex extends TXMResult  {
-
+public class PartitionIndex extends TXMResult {
+	
 	/** The counts. */
 	protected LinkedHashMap<String, ArrayList<Integer>> counts = new LinkedHashMap<String, ArrayList<Integer>>();
-
+	
 	/** The currentpartid. */
 	protected int currentpartid = 0;
-
+	
 	/** The current Fmax value. */
 	protected int Fmax = 0;
 	
 	/** The current Fmin value. */
 	protected int Fmin = 9999999;
-
+	
 	/** The lexicon used to compute the index (if query = null || query == [] && properties.size() == 1 */
 	@Deprecated
 	protected CQPLexicon lexicon;
 	
 	@Deprecated
 	protected boolean lexiconMode = false;
-
+	
 	/** The current lines. */
 	protected List<Line> lines = new ArrayList<Line>();
+	
 	/** The current number of lines. */
 	protected int nTotalTokens = 0;
-
+	
 	/** The partnames. The corpus name if built with a Corpus or the parts names if built with a Partition */
 	protected List<String> partnames = new ArrayList<String>();
-
+	
 	/** The writer. */
 	// FIXME: should be in an exporter extension
 	@Deprecated
 	private BufferedWriter writer;
-
+	
 	/**
 	 * Maximum frequency filter value.
 	 */
-	@Parameter(key=TXMPreferences.F_MAX)
+	@Parameter(key = TXMPreferences.F_MAX)
 	protected Integer pFmaxFilter;
-
+	
 	/**
 	 * Minimum frequency filter value.
 	 */
-	@Parameter(key=TXMPreferences.F_MIN)
+	@Parameter(key = TXMPreferences.F_MIN)
 	protected Integer pFminFilter;
-
+	
 	/**
 	 * Number of lines to display per page.
 	 */
-	@Parameter(key=TXMPreferences.N_LINES_PER_PAGE)
+	@Parameter(key = TXMPreferences.N_LINES_PER_PAGE)
 	protected Integer pNLinesPerPage;
-
+	
 	/**
 	 * The word properties to display.
 	 */
-	@Parameter(key=TXMPreferences.UNIT_PROPERTIES)
+	@Parameter(key = TXMPreferences.UNIT_PROPERTIES)
 	protected List<WordProperty> pProperties;
-
+	
 	/**
 	 * The string used to separated property values.
 	 */
-	@Parameter(key=IndexPreferences.PROPERTIES_SEPARATOR)
+	@Parameter(key = IndexPreferences.PROPERTIES_SEPARATOR)
 	protected String pPropertiesSeparator;
-
+	
 	/**
 	 * The CQP query.
 	 */
-	@Parameter(key=TXMPreferences.QUERY)
+	@Parameter(key = TXMPreferences.QUERY)
 	protected IQuery pQuery;
-
+	
 	/**
 	 * The line index of the current index page.
 	 */
-	@Parameter(key=IndexPreferences.N_TOP_INDEX)
+	@Parameter(key = IndexPreferences.N_TOP_INDEX)
 	private Integer pTopIndex;
-
+	
 	/**
 	 * The vmax filter value parameter.
 	 */
-	@Parameter(key=TXMPreferences.V_MAX)
+	@Parameter(key = TXMPreferences.V_MAX)
 	protected Integer pVmaxFilter;
-
+	
 	/**
 	 * 
 	 * @param parent
@@ -161,12 +162,12 @@
 	public PartitionIndex(Partition parent) {
 		super(null, parent);
 	}
-
+	
 	/**
 	 * 
 	 * @param parametersNodePath
 	 */
-	public PartitionIndex(String parametersNodePath)	{
+	public PartitionIndex(String parametersNodePath) {
 		this(parametersNodePath, null);
 	}
 	
@@ -183,16 +184,16 @@
 			partnames.add(part.getName());
 		}
 	}
-
+	
 	public Partition getParent() {
-		return (Partition)parent;
+		return (Partition) parent;
 	}
 	
 	public String getComputingDoneMessage() {
-		if(this.lines.isEmpty())	{
+		if (this.lines.isEmpty()) {
 			return TXMCoreMessages.common_noResults;
 		}
-		else	{
+		else {
 			return TXMCoreMessages.bind(TXMCoreMessages.common_P0ItemsForP1Occurrences, this.lines.size(), this.nTotalTokens);
 		}
 	}
@@ -204,7 +205,7 @@
 		partnames.clear();
 		currentpartid = 0;
 		nTotalTokens = 0;
-
+		
 		Partition partition = getParent();
 		partnames.clear();
 		for (Part part : partition.getParts()) {
@@ -214,27 +215,27 @@
 		}
 		
 		setLineCounts();
-
+		
 		getAllLines();
-
+		
 		this.filterLines();
-
+		
 		this.subTask("Sorting...");
-
+		
 		this.sortLines(SortMode.FREQUNIT, true);
-
+		
 		this.cut();
-
+		
 		this.dirty = false;
 		this.pTopIndex = 0;
-
+		
 		this.subTask("Index done.");
-
+		
 		return true;
 	}
-
-
-
+	
+	
+	
 	/**
 	 * Creates a CQL query string from the specified Index lines.
 	 *
@@ -246,7 +247,7 @@
 		if (lines.size() == 0) {
 			return query;
 		}
-
+		
 		Line line = lines.get(0);
 		int nbToken = line.getUnitsProperties().get(0).size();
 		int nbProps = line.getProperties().size();
@@ -256,7 +257,7 @@
 			query += "["; //$NON-NLS-1$
 			for (int p = 0; p < nbProps; p++) {
 				if (props.get(p) instanceof StructuralUnitProperty) {
-					query += "_."+((StructuralUnitProperty)props.get(p)).getFullName() + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
+					query += "_." + ((StructuralUnitProperty) props.get(p)).getFullName() + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
 				}
 				else {
 					query += props.get(p) + "=\""; //$NON-NLS-1$
@@ -277,10 +278,11 @@
 		query = query.substring(0, query.length() - 1);
 		return query;
 	}
-
-
+	
+	
 	/**
 	 * Creates a Query list from the specified Index lines.
+	 * 
 	 * @param lines
 	 * @return
 	 */
@@ -307,11 +309,11 @@
 			queries.add(new CQLQuery(query));
 		}
 		return queries;
-
+		
 	}
-
-
-
+	
+	
+	
 	/**
 	 * This method alter the index first column frequencies using a table stored in the R workspace
 	 * 
@@ -322,69 +324,69 @@
 	 * @throws REXPMismatchException
 	 */
 	public boolean alterFrequencies(String referenceCorpus) throws RWorkspaceException, REXPMismatchException {
-		String[] ref_forms = RWorkspace.getRWorkspaceInstance().eval("rownames("+referenceCorpus+")").asStrings(); //$NON-NLS-1$ //$NON-NLS-2$
-		int[] ref_freqs = RWorkspace.getRWorkspaceInstance().eval(referenceCorpus+"[,1]").asIntegers(); //$NON-NLS-1$
+		String[] ref_forms = RWorkspace.getRWorkspaceInstance().eval("rownames(" + referenceCorpus + ")").asStrings(); //$NON-NLS-1$ //$NON-NLS-2$
+		int[] ref_freqs = RWorkspace.getRWorkspaceInstance().eval(referenceCorpus + "[,1]").asIntegers(); //$NON-NLS-1$
 		if (ref_forms.length != ref_freqs.length) {
-			System.out.println("Cannot alter index frequencies with the '"+referenceCorpus+"' empty table.");
+			System.out.println("Cannot alter index frequencies with the '" + referenceCorpus + "' empty table.");
 			return false;
 		}
 		HashMap<String, Integer> ref_counts = new HashMap<String, Integer>();
-		for(int i = 0 ; i < ref_forms.length ; i++) {
+		for (int i = 0; i < ref_forms.length; i++) {
 			ref_counts.put(ref_forms[i], ref_freqs[i]);
 		}
-
+		
 		for (org.txm.index.core.functions.Line l : this.getAllLines()) {
 			String key = l.toString();
 			if (ref_counts.containsKey(key)) {
-				int[] f = {ref_counts.get(key)};
+				int[] f = { ref_counts.get(key) };
 				l.setCounts(f, 0);
 			}
 		}
 		this.updateFminFmax();
 		return true;
-		//voc.toTxt(new File("/home/mdecorde/TEMP/after.tsv"), "UTF-8", "\t", "");
+		// voc.toTxt(new File("/home/mdecorde/TEMP/after.tsv"), "UTF-8", "\t", "");
 	}
-
+	
 	@Override
 	public boolean canCompute() {
 		if (this.getPartition() == null) {
 			Log.fine("Partition not set."); //$NON-NLS-1$
 			return false;
 		}
-
+		
 		if (pProperties == null || pProperties.size() == 0) {
 			Log.fine("No property set."); //$NON-NLS-1$
 			return false;
 		}
-
+		
 		if (pQuery == null || pQuery.getQueryString().length() == 0) {
 			Log.fine("No query set."); //$NON-NLS-1$
 			return false;
 		}
-
+		
 		return true;
 	}
-
+	
 	@Override
 	public boolean saveParameters() {
-
+		
 		this.saveParameter(TXMPreferences.UNIT_PROPERTIES, WordProperty.propertiesToString(pProperties));
-
+		
 		if (pQuery != null) {
 			this.saveParameter(TXMPreferences.QUERY, pQuery.getQueryString());
 		}
-
-
+		
+		
 		return true;
 	}
-
+	
 	@Override
 	public boolean loadParameters() {
 		this.pProperties = (List<WordProperty>) Property.stringToProperties(getCorpus(), this.getStringParameterValue(TXMPreferences.UNIT_PROPERTIES));
 		this.pQuery = new CQLQuery(this.getStringParameterValue(TXMPreferences.QUERY));
 		return true;
 	}
-
+	
 	@Override
 	public void clean() {
 		try {
@@ -392,11 +394,12 @@
 				this.writer.flush();
 				this.writer.close();
 			}
-		} catch (IOException e) {
+		}
+		catch (IOException e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
 		}
 	}
-
+	
 	/**
 	 * keep the vmax lines more frequents.
 	 *
@@ -405,18 +408,18 @@
 		if (pVmaxFilter == null) {
 			return;
 		}
-
+		
 		this.acquireSemaphore();
-
-		Log.fine("Cutting Tmax="+pVmaxFilter);
+		
+		Log.fine("Cutting Tmax=" + pVmaxFilter);
 		// assume the lines are sorted
-		//int before = lines.size();
+		// int before = lines.size();
 		this.lines = this.lines.subList(0, Math.min(lines.size(), pVmaxFilter));
 		this.updateFminFmax();
-
+		
 		this.releaseSemaphore();
 	}
-
+	
 	/**
 	 * Equals.
 	 *
@@ -430,46 +433,46 @@
 					&& this.pFminFilter == index.getFilterFmin()
 					&& this.pFmaxFilter == index.getFilterFmax();
 		}
-		catch(Exception e) {
+		catch (Exception e) {
 		}
 		return false;
 	}
-
-
+	
+	
 	/**
 	 * Removes lines with frequency not in [Fmin,Fmax] range.
 	 *
 	 **/
 	public void filterLines() {
-
+		
 		if (!(pFminFilter > 0 && pFmaxFilter > 0 && pFminFilter <= pFmaxFilter)) {
 			return;
 		}
-
-		Log.fine("Filtering Fmin = " + pFminFilter + " and Fmax = " + pFmaxFilter); //$NON-NLS-1$  //$NON-NLS-2$
-
+		
+		Log.fine("Filtering Fmin = " + pFminFilter + " and Fmax = " + pFmaxFilter); //$NON-NLS-1$ //$NON-NLS-2$
+		
 		for (int i = 0; i < lines.size(); i++) { // for each line
-
+			
 			Line line = lines.get(i);
 			int f = line.getFrequency();
 			if (f < pFminFilter) { // if its frequency is not in the interval, remove it
-
+				
 				nTotalTokens -= line.getFrequency();
 				lines.remove(i);
 				i--;
 				continue; // no need to go further the line is removed
 			}
 			if (f > pFmaxFilter) { // if its frequency is not in the interval, remove it
-
+				
 				nTotalTokens -= line.getFrequency();
 				lines.remove(i);
 				i--;
 			}
 		}
-
+		
 		this.updateFminFmax();
 	}
-
+	
 	/**
 	 * Gets the corpus.
 	 *
@@ -478,38 +481,42 @@
 	public CQPCorpus getCorpus() {
 		if (this.parent instanceof CQPCorpus) {
 			return (CQPCorpus) this.parent;
-		} else if (this.parent instanceof Partition) {
-			return ((Partition)this.parent).getParent();
-		} else if (this.lexicon != null) {
+		}
+		else if (this.parent instanceof Partition) {
+			return ((Partition) this.parent).getParent();
+		}
+		else if (this.lexicon != null) {
 			return this.lexicon.getParent();
-		} else {
+		}
+		else {
 			return null;
 		}
 	}
-
+	
 	@Override
 	public String getDetails() {
 		if (lexicon != null) {
 			return lexicon.getDetails();
-		} else {
-
+		}
+		else {
+			
 			try {
-				Object[] params = new Object[]{this.parent.getSimpleName(), this.getQuery().getQueryString(), this.getProperties(), this.getFmin(), this.getFmax()}; 
+				Object[] params = new Object[] { this.parent.getSimpleName(), this.getQuery().getQueryString(), this.getProperties(), this.getFmin(), this.getFmax() };
 				String str;
-				if(this.parent instanceof Partition)	{
+				if (this.parent instanceof Partition) {
 					str = IndexCoreMessages.indexColonPartitionP0queryP1propertiesP2FminP3FmaxP4;
 				}
-				else	{
+				else {
 					str = IndexCoreMessages.indexColonCorpusP0queryP1propertiesP2FminP3FmaxP4;
 				}
 				return NLS.bind(str, params);
 			}
-			catch(Exception e) {
+			catch (Exception e) {
 				return getName();
 			}
 		}
 	}
-
+	
 	/**
 	 * Gets the filter fmax.
 	 *
@@ -518,7 +525,7 @@
 	public Integer getFilterFmax() {
 		return pFmaxFilter;
 	}
-
+	
 	/**
 	 * Gets the filter fmin.
 	 *
@@ -527,7 +534,7 @@
 	public Integer getFilterFmin() {
 		return pFminFilter;
 	}
-
+	
 	/**
 	 * Gets the filter vmax.
 	 *
@@ -536,7 +543,7 @@
 	public Integer getFilterVmax() {
 		return pVmaxFilter;
 	}
-
+	
 	/**
 	 * Gets the fmax.
 	 *
@@ -545,7 +552,7 @@
 	public int getFmax() {
 		return Fmax;
 	}
-
+	
 	/**
 	 * Gets the fmin.
 	 *
@@ -554,7 +561,7 @@
 	public int getFmin() {
 		return Fmin;
 	}
-
+	
 	/**
 	 * If the index has been build with corpus + property, the method returns the lexicon used.
 	 *
@@ -563,11 +570,11 @@
 	public CQPLexicon getLexicon() {
 		return lexicon;
 	}
-
+	
 	public boolean getLexiconMode() {
 		return this.lexiconMode;
 	}
-
+	
 	/**
 	 * return the lines from le "start"th one to the "end"th one.
 	 *
@@ -576,22 +583,22 @@
 	 * @return the lines
 	 */
 	public List<Line> getLines(int start, int end) {
-		//	long time = System.currentTimeMillis();
+		// long time = System.currentTimeMillis();
 		List<Line> selectedLines = new ArrayList<Line>();
 		if (lines.size() > 0) {
 			start = Math.max(0, start);
 			end = Math.min(end, lines.size());
 			selectedLines = lines.subList(start, end);
-
+			
 			int p = 0;
 			// for each property get the string values of the tokens
 			for (Property property : pProperties) {
-
+				
 				int len = 0;
 				for (Line l : selectedLines) {
 					len += l.UnitsIds.get(p).length;
 				}
-
+				
 				int[] indices = new int[len]; // build the array of indices
 				len = 0;
 				for (Line l : selectedLines) {
@@ -607,7 +614,8 @@
 					else {
 						strs = CorpusManager.getCorpusManager().getCqiClient().id2Str(property.getQualifiedName(), indices);
 					}
-				} catch (Exception e) {
+				}
+				catch (Exception e) {
 					org.txm.utils.logger.Log.printStackTrace(e);
 					return null;
 				}
@@ -626,8 +634,8 @@
 		// System.out.println("Time get lines "+(System.currentTimeMillis()-time));
 		return selectedLines;
 	}
-
-
+	
+	
 	/**
 	 * return all the lines of the index.
 	 *
@@ -636,7 +644,7 @@
 	public List<Line> getAllLines() {
 		return getLines(0, lines.size());
 	}
-
+	
 	/**
 	 * update the lines counts.
 	 */
@@ -654,10 +662,10 @@
 			line.setCounts(c, -1);
 		}
 	}
-
-
-
-
+	
+	
+	
+	
 	@Override
 	public String getName() {
 		try {
@@ -668,20 +676,21 @@
 				return IndexCoreMessages.RESULT_TYPE + ": " + this.parent.getSimpleName() + ": " + this.getSimpleName();
 			}
 		}
-		catch(Exception e) {
+		catch (Exception e) {
 			return this.getEmptyName();
 		}
 	}
-
+	
 	/**
 	 * Gets the number of lines per page.
+	 * 
 	 * @return the number of lines per page
 	 */
 	public Integer getNLinesPerPage() {
-		return pNLinesPerPage ;
+		return pNLinesPerPage;
 	}
-
-
+	
+	
 	/**
 	 * Gets the partition.
 	 *
@@ -691,11 +700,11 @@
 		try {
 			return (Partition) this.parent;
 		}
-		catch(ClassCastException e) {
+		catch (ClassCastException e) {
 		}
 		return null;
 	}
-
+	
 	/**
 	 * Gets the part names.
 	 *
@@ -704,7 +713,7 @@
 	public List<String> getPartnames() {
 		return partnames;
 	}
-
+	
 	/**
 	 * Gets the properties.
 	 *
@@ -713,16 +722,16 @@
 	public List<WordProperty> getProperties() {
 		return this.pProperties;
 	}
-
-
+	
+	
 	/**
 	 * 
 	 * @return
 	 */
 	public String getPropertySeparator() {
-		return pPropertiesSeparator ;
+		return pPropertiesSeparator;
 	}
-
+	
 	/**
 	 * Gets the query.
 	 *
@@ -731,7 +740,7 @@
 	public IQuery getQuery() {
 		return pQuery;
 	}
-
+	
 	@Override
 	public String getSimpleName() {
 		if (lexicon != null) {
@@ -742,7 +751,7 @@
 			if (pQuery != null && !pQuery.isEmpty()) {
 				name += pQuery.getQueryString();
 				name += ": "; //$NON-NLS-1$
-
+				
 				for (Property s : pProperties) {
 					name += s.getName() + pPropertiesSeparator;
 				}
@@ -756,7 +765,7 @@
 			}
 		}
 	}
-
+	
 	/**
 	 * Gets the number of tokens found.
 	 *
@@ -765,7 +774,7 @@
 	public int getT() {
 		return nTotalTokens;
 	}
-
+	
 	/**
 	 * 
 	 * @return
@@ -773,7 +782,7 @@
 	public int getTopIndex() {
 		return pTopIndex;
 	}
-
+	
 	/**
 	 * Gets the v.
 	 *
@@ -782,7 +791,7 @@
 	public int getV() {
 		return lines.size();
 	}
-
+	
 	/**
 	 * Tell if the index has been computed with a partition or not.
 	 *
@@ -791,30 +800,31 @@
 	public boolean isComputedWithPartition() {
 		return (this.getParent() instanceof Partition);
 	}
-
+	
 	/**
 	 * count tokens.
 	 *
 	 * @param corpus the corpus to scan
 	 * @return true, if successful
-	 * @throws CqiClientException 
-	 * @throws CqiServerError 
-	 * @throws IOException 
+	 * @throws CqiClientException
+	 * @throws CqiServerError
+	 * @throws IOException
 	 */
 	protected boolean scanCorpus(CQPCorpus corpus) throws Exception {
 		// get the cqp result of the query
-
-		//long time = System.currentTimeMillis();
+		
+		// long time = System.currentTimeMillis();
 		Selection result = null;
 		if (pQuery instanceof CQLQuery) {
-			result = corpus.query((CQLQuery)pQuery, "index", true); //$NON-NLS-1$
-		} else {
+			result = corpus.query((CQLQuery) pQuery, "index", true); //$NON-NLS-1$
+		}
+		else {
 			result = pQuery.getSearchEngine().query(corpus, pQuery, "index", true); //$NON-NLS-1$
 		}
 		boolean isTargetUsed = result.isTargetUsed();
 		int nbresults = result.getNMatch();
 		this.nTotalTokens += nbresults; // get number of tokens
-
+		
 		// System.out.println("nLines : "+nLines);
 		List<? extends Match> matches = null;
 		if (nbresults > 0) {
@@ -849,15 +859,15 @@
 		// lengthOfKeywords));
 		// }
 		// System.out.println("took "+(System.currentTimeMillis()-time));
-
+		
 		// System.out.println("get count data");
-
+		
 		int[] allpositionsarray = new int[allpositions.size()];
 		int pcount = 0;
 		for (int p : allpositions) {
 			allpositionsarray[pcount++] = p;
 		}
-
+		
 		// time = System.currentTimeMillis();
 		HashMap<Property, int[]> propsId = new HashMap<Property, int[]>();
 		for (Property property : pProperties) {
@@ -870,7 +880,8 @@
 					int[] indices = CorpusManager.getCorpusManager().getCqiClient().cpos2Id(property.getQualifiedName(), allpositionsarray);
 					propsId.put(property, indices);
 				}
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				org.txm.utils.logger.Log.printStackTrace(e);
 				result.drop();
 				return false;
@@ -894,9 +905,9 @@
 				line.putIds(property, ids);
 			}
 			currentIndex += size;
-
+			
 			String signature = line.getSignature();
-
+			
 			// if the counts contains the signature, increment its corresponding value
 			if (counts.containsKey(signature)) {
 				while (counts.get(signature).size() <= currentpartid) {
@@ -914,7 +925,7 @@
 				}
 				counts.put(signature, tmp);
 				counts.get(signature).set(currentpartid, 1);
-
+				
 				lines.add(line);
 			}
 		}
@@ -922,9 +933,9 @@
 		// System.out.println("Time count lines "+(System.currentTimeMillis()-time));
 		// System.out.println("took "+(System.currentTimeMillis()-time));
 		return true;
-
+		
 	}
-
+	
 	/**
 	 * 
 	 * @param nLinesPerPage
@@ -932,7 +943,7 @@
 	public void setNLinesPerPage(int nLinesPerPage) {
 		this.pNLinesPerPage = Math.max(nLinesPerPage, 1);
 	}
-
+	
 	/**
 	 * 
 	 * @param props
@@ -942,36 +953,39 @@
 		this.pProperties = props;
 		this.lexicon = null;
 	}
-
+	
 	/**
 	 * Sets the query.
+	 * 
 	 * @param query
 	 */
-	public void setQuery(CQLQuery query)	{
+	public void setQuery(CQLQuery query) {
 		this.pQuery = query;
 	}
-
+	
 	/**
 	 * Sets the properties.
+	 * 
 	 * @param properties
 	 */
-	public void setProperties(List<WordProperty> properties)	{
+	public void setProperties(List<WordProperty> properties) {
 		this.pProperties = properties;
 	}
-
+	
 	/**
 	 * Sets the property.
 	 * Clears all existing properties.
+	 * 
 	 * @param property
 	 */
-	public void setProperty(WordProperty property)	{
+	public void setProperty(WordProperty property) {
 		List<WordProperty> properties = new ArrayList<WordProperty>();
 		properties.add(property);
 		this.setProperties(properties);
 	}
-
-
-
+	
+	
+	
 	public void setParameters(CQLQuery query, List<WordProperty> props, Integer filterFmin, Integer filterFmax, Integer filterVmax, Integer nLinesPerPage) {
 		this.pQuery = query;
 		this.pProperties = props;
@@ -980,7 +994,7 @@
 		if (filterVmax != null) this.pVmaxFilter = filterVmax;
 		if (nLinesPerPage != null) this.pNLinesPerPage = nLinesPerPage;
 	}
-
+	
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
 		try {
@@ -990,25 +1004,26 @@
 			Integer filterFmax = (Integer) parameters.get("filterFmax"); //$NON-NLS-1$
 			Integer filterVmax = (Integer) parameters.get("filterVmax"); //$NON-NLS-1$
 			Integer nLinesPerPage = (Integer) parameters.get("nLinesPerPage"); //$NON-NLS-1$
-
+			
 			this.setParameters(query, props, filterFmin, filterFmax, filterVmax, nLinesPerPage);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.severe("Error while setting parameters of Index: " + e.getLocalizedMessage()); //$NON-NLS-1$
 			Log.printStackTrace(e);
 			return false;
 		}
 		return true;
 	}
-
-
+	
+	
 	public void setTopLine(int i) {
 		pTopIndex = Math.max(i, 0);
 	}
-
+	
 	public void setVMax(int maxFilter) {
 		this.pVmaxFilter = maxFilter;
 	}
-
+	
 	/**
 	 * Sort lines.
 	 *
@@ -1021,7 +1036,7 @@
 		Collections.sort(lines, lc);
 		this.pTopIndex = 0; // return to the first page
 	}
-
+	
 	/**
 	 * dump the index in the console.
 	 *
@@ -1032,7 +1047,7 @@
 		System.out.println(NLS.bind(IndexCoreMessages.consoleColonP0, (lines.size())));
 		toConsole(0, lines.size());
 	}
-
+	
 	/**
 	 * dump a part of the index.
 	 *
@@ -1042,7 +1057,7 @@
 	 * @throws IOException Signals that an I/O exception has occurred.
 	 */
 	public void toConsole(int from, int to) throws CqiClientException, IOException {
-
+		
 		String header = ""; //$NON-NLS-1$
 		for (Property p : pProperties) {
 			header += (p + pPropertiesSeparator);
@@ -1054,11 +1069,11 @@
 				header += "\t" + partnames.get(j); //$NON-NLS-1$
 			}
 		}
-
+		
 		System.out.println(header);
 		for (int i = from; i < to; i++) {
 			Line ligne = lines.get(i);
-			System.out.print(ligne + "\t" + ligne.getFrequency()); //$NON-NLS-1$ 
+			System.out.print(ligne + "\t" + ligne.getFrequency()); //$NON-NLS-1$
 			if (partnames.size() > 1) {
 				for (int j = 0; j < partnames.size(); j++) {
 					System.out.print("\t" + ligne.getFrequency(j)); //$NON-NLS-1$
@@ -1068,8 +1083,8 @@
 		}
 		System.out.flush();
 	}
-
-
+	
+	
 	/**
 	 * Write the lines between from and to on a writer.
 	 *
@@ -1087,26 +1102,26 @@
 	public void toTxt(File outfile, int from, int to, String encoding, String colseparator, String txtseparator)
 			throws CqiClientException, IOException {
 		// NK: writer declared as class attribute to perform a clean if the operation is interrupted
-		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), encoding)); 
+		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), encoding));
 		// if ("UTF-8".equals(encoding)) writer.write('\ufeff'); // UTF-8 BOM
 		String header = ""; //$NON-NLS-1$
 		for (Property p : pProperties) {
 			header += (p + pPropertiesSeparator);
 		}
-		header = txtseparator+ header.substring(0, header.length() - 1) +txtseparator;
-		header += colseparator+ txtseparator+ "F" + txtseparator; //$NON-NLS-1$
+		header = txtseparator + header.substring(0, header.length() - 1) + txtseparator;
+		header += colseparator + txtseparator + "F" + txtseparator; //$NON-NLS-1$
 		if (partnames.size() > 1) {
 			for (int j = 0; j < partnames.size(); j++) {
-				header += colseparator + txtseparator+ partnames.get(j).replace(txtseparator, txtseparator+txtseparator)+txtseparator;
+				header += colseparator + txtseparator + partnames.get(j).replace(txtseparator, txtseparator + txtseparator) + txtseparator;
 			}
 		}
 		header += "\n"; //$NON-NLS-1$
 		writer.write(header);
-
+		
 		// for(Line ligne: lines)
 		for (int i = from; i < to; i++) {
 			Line ligne = lines.get(i);
-			writer.write(txtseparator+ ligne.toString().replace(txtseparator, txtseparator+txtseparator)+ txtseparator + colseparator + ligne.getFrequency()); 
+			writer.write(txtseparator + ligne.toString().replace(txtseparator, txtseparator + txtseparator) + txtseparator + colseparator + ligne.getFrequency());
 			if (partnames.size() > 1) {
 				for (int j = 0; j < partnames.size(); j++) {
 					writer.write(colseparator + ligne.getFrequency(j));
@@ -1117,7 +1132,7 @@
 		writer.flush();
 		writer.close();
 	}
-
+	
 	/**
 	 * Write all the lines on a writer.
 	 *
@@ -1132,13 +1147,14 @@
 	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
 		try {
 			toTxt(outfile, 0, lines.size(), encoding, colseparator, txtseparator);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.severe(TXMCoreMessages.bind(IndexCoreMessages.error_failedToExportLexiconColonP0, Log.toString(e)));
 			return false;
 		}
 		return true;
 	}
-
+	
 	/**
 	 * checks all lines to update Fmin and Fmax.
 	 */
@@ -1156,9 +1172,9 @@
 			}
 		}
 	}
-
+	
 	@Override
 	public String getResultType() {
 		return PartitionIndex.class.getSimpleName();
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 2397)
@@ -70,77 +70,79 @@
  * 
  * @author mdecorde
  */
-public class Index extends TXMResult  {
-
+public class Index extends TXMResult {
+	
 	/** The counts. */
 	protected LinkedHashMap<String, ArrayList<Integer>> counts = new LinkedHashMap<String, ArrayList<Integer>>();
-
+	
 	/** The currentpartid. */
 	protected int currentpartid = 0;
-
+	
 	/** The current Fmax value. */
 	protected int Fmax = 0;
+	
 	/** The current Fmin value. */
 	protected int Fmin = 9999999;
-
+	
 	/** The current lines. */
 	protected List<Line> lines = new ArrayList<Line>();
+	
 	/** The current number of lines. */
 	protected int nTotalTokens = 0;
-
+	
 	/** The writer. */
 	// FIXME: should be in an exporter extension
 	@Deprecated
 	private BufferedWriter writer;
-
+	
 	/**
 	 * Maximum frequency filter value.
 	 */
-	@Parameter(key=TXMPreferences.F_MAX)
+	@Parameter(key = TXMPreferences.F_MAX)
 	protected Integer pFmaxFilter;
-
+	
 	/**
 	 * Minimum frequency filter value.
 	 */
-	@Parameter(key=TXMPreferences.F_MIN)
+	@Parameter(key = TXMPreferences.F_MIN)
 	protected Integer pFminFilter;
-
+	
 	/**
 	 * Number of lines to display per page.
 	 */
-	@Parameter(key=TXMPreferences.N_LINES_PER_PAGE)
+	@Parameter(key = TXMPreferences.N_LINES_PER_PAGE)
 	protected Integer pNLinesPerPage;
-
+	
 	/**
 	 * The word properties to display.
 	 */
-	@Parameter(key=TXMPreferences.UNIT_PROPERTIES)
+	@Parameter(key = TXMPreferences.UNIT_PROPERTIES)
 	protected List<WordProperty> pProperties;
-
+	
 	/**
 	 * The string used to separated property values.
 	 */
-	@Parameter(key=IndexPreferences.PROPERTIES_SEPARATOR)
+	@Parameter(key = IndexPreferences.PROPERTIES_SEPARATOR)
 	protected String pPropertiesSeparator;
-
+	
 	/**
 	 * The CQP query.
 	 */
-	@Parameter(key=TXMPreferences.QUERY)
+	@Parameter(key = TXMPreferences.QUERY)
 	protected IQuery pQuery;
-
+	
 	/**
 	 * The line index of the current index page.
 	 */
-	@Parameter(key=IndexPreferences.N_TOP_INDEX)
+	@Parameter(key = IndexPreferences.N_TOP_INDEX)
 	private Integer pTopIndex;
-
+	
 	/**
 	 * The vmax filter value parameter.
 	 */
-	@Parameter(key=TXMPreferences.V_MAX)
+	@Parameter(key = TXMPreferences.V_MAX)
 	protected Integer pVmaxFilter;
-
+	
 	/**
 	 * 
 	 * @param parent
@@ -148,12 +150,12 @@
 	public Index(CQPCorpus parent) {
 		super(parent);
 	}
-
+	
 	/**
 	 * 
 	 * @param parametersNodePath
 	 */
-	public Index(String parametersNodePath)	{
+	public Index(String parametersNodePath) {
 		super(parametersNodePath);
 	}
 	
@@ -161,16 +163,16 @@
 	 * 
 	 * @param parametersNodePath
 	 */
-	public Index(String parametersNodePath, TXMResult parent)	{
+	public Index(String parametersNodePath, TXMResult parent) {
 		super(parametersNodePath, parent);
 	}
-
-
+	
+	
 	@Override
 	protected final boolean _compute() throws Exception {
-
 		
 		
+		
 		// reset all stored data
 		if (lines != null) {
 			lines.clear();
@@ -178,49 +180,50 @@
 			currentpartid = 0;
 			nTotalTokens = 0;
 		}
-
+		
 		// FIXME: tests to not recompute all on fmax, vmax, etc. changes
 		// It works but the problem is the cut() method that really cut the lines rather than doing getLines() that could filtering and returns only the lines between fmin/fmax
-		//		if(this.hasParameterChanged(TXMPreferences.QUERY) || this.hasParameterChanged(TXMPreferences.UNIT_PROPERTIES))	{
-
+		// if(this.hasParameterChanged(TXMPreferences.QUERY) || this.hasParameterChanged(TXMPreferences.UNIT_PROPERTIES)) {
+		
 		if (!_computeLines()) {
 			Log.severe("Error while computing lines. Aborting.");
 			return false;
 		}
-		//	}
-
+		// }
+		
 		this.filterLines();
-
+		
 		this.subTask("Sorting...");
-
+		
 		this.sortLines(SortMode.FREQUNIT, true);
-
+		
 		this.cut();
-
+		
 		this.dirty = false;
 		this.pTopIndex = 0;
-
+		
 		this.subTask("Index done.");
-
+		
 		return true;
 	}
-
-
+	
+	
 	/**
-	 * Extends this method to change the way the line are computed. the lines are sorted and filterd afterward 
+	 * Extends this method to change the way the line are computed. the lines are sorted and filterd afterward
+	 * 
 	 * @return true if the index lines hae been computed
 	 * @throws Exception
 	 */
 	protected boolean _computeLines() throws Exception {
 		if (parent instanceof CQPCorpus) {
-
-			if (!scanCorpus((CQPCorpus)parent)) {
+			
+			if (!scanCorpus((CQPCorpus) parent)) {
 				lines = new ArrayList<Line>();
 				return false;
 			}
-
+			
 			setLineCounts();
-
+			
 			getAllLines();
 			return true;
 		}
@@ -229,7 +232,7 @@
 			return false;
 		}
 	}
-
+	
 	/**
 	 * Creates a CQL query string from the specified Index lines.
 	 *
@@ -241,7 +244,7 @@
 		if (lines.size() == 0) {
 			return query;
 		}
-
+		
 		Line line = lines.get(0);
 		int nbToken = line.getUnitsProperties().get(0).size();
 		int nbProps = line.getProperties().size();
@@ -251,7 +254,7 @@
 			query += "["; //$NON-NLS-1$
 			for (int p = 0; p < nbProps; p++) {
 				if (props.get(p) instanceof StructuralUnitProperty) {
-					query += "_."+((StructuralUnitProperty)props.get(p)).getFullName() + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
+					query += "_." + ((StructuralUnitProperty) props.get(p)).getFullName() + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
 				}
 				else {
 					query += props.get(p) + "=\""; //$NON-NLS-1$
@@ -272,10 +275,11 @@
 		query = query.substring(0, query.length() - 1);
 		return query;
 	}
-
-
+	
+	
 	/**
 	 * Creates a Query list from the specified Index lines.
+	 * 
 	 * @param lines
 	 * @return
 	 */
@@ -302,11 +306,11 @@
 			queries.add(new CQLQuery(query));
 		}
 		return queries;
-
+		
 	}
-
-
-
+	
+	
+	
 	/**
 	 * This method alter the index first column frequencies using a table stored in the R workspace
 	 * 
@@ -317,69 +321,69 @@
 	 * @throws REXPMismatchException
 	 */
 	public boolean alterFrequencies(String referenceCorpus) throws RWorkspaceException, REXPMismatchException {
-		String[] ref_forms = RWorkspace.getRWorkspaceInstance().eval("rownames("+referenceCorpus+")").asStrings(); //$NON-NLS-1$ //$NON-NLS-2$
-		int[] ref_freqs = RWorkspace.getRWorkspaceInstance().eval(referenceCorpus+"[,1]").asIntegers(); //$NON-NLS-1$
+		String[] ref_forms = RWorkspace.getRWorkspaceInstance().eval("rownames(" + referenceCorpus + ")").asStrings(); //$NON-NLS-1$ //$NON-NLS-2$
+		int[] ref_freqs = RWorkspace.getRWorkspaceInstance().eval(referenceCorpus + "[,1]").asIntegers(); //$NON-NLS-1$
 		if (ref_forms.length != ref_freqs.length) {
-			System.out.println("Cannot alter index frequencies with the '"+referenceCorpus+"' empty table.");
+			System.out.println("Cannot alter index frequencies with the '" + referenceCorpus + "' empty table.");
 			return false;
 		}
 		HashMap<String, Integer> ref_counts = new HashMap<String, Integer>();
-		for(int i = 0 ; i < ref_forms.length ; i++) {
+		for (int i = 0; i < ref_forms.length; i++) {
 			ref_counts.put(ref_forms[i], ref_freqs[i]);
 		}
-
+		
 		for (org.txm.index.core.functions.Line l : this.getAllLines()) {
 			String key = l.toString();
 			if (ref_counts.containsKey(key)) {
-				int[] f = {ref_counts.get(key)};
+				int[] f = { ref_counts.get(key) };
 				l.setCounts(f, 0);
 			}
 		}
 		this.updateFminFmax();
 		return true;
-		//voc.toTxt(new File("/home/mdecorde/TEMP/after.tsv"), "UTF-8", "\t", "");
+		// voc.toTxt(new File("/home/mdecorde/TEMP/after.tsv"), "UTF-8", "\t", "");
 	}
-
+	
 	@Override
 	public boolean canCompute() {
 		if (getCorpus() == null) {
 			Log.fine("Corpus not set."); //$NON-NLS-1$
 			return false;
 		}
-
+		
 		if (pProperties == null || pProperties.size() == 0) {
 			Log.fine("No property set."); //$NON-NLS-1$
 			return false;
 		}
-
+		
 		if (pQuery == null || pQuery.getQueryString().length() == 0) {
 			Log.fine("No query set."); //$NON-NLS-1$
 			return false;
 		}
-
+		
 		return true;
 	}
-
+	
 	@Override
 	public boolean saveParameters() {
-
+		
 		this.saveParameter(TXMPreferences.UNIT_PROPERTIES, WordProperty.propertiesToString(pProperties));
-
+		
 		if (pQuery != null) {
 			this.saveParameter(TXMPreferences.QUERY, pQuery.getQueryString());
 		}
-
-
+		
+		
 		return true;
 	}
-
+	
 	@Override
 	public boolean loadParameters() {
 		this.pProperties = (List<WordProperty>) Property.stringToProperties(getCorpus(), this.getStringParameterValue(TXMPreferences.UNIT_PROPERTIES));
 		this.pQuery = new CQLQuery(this.getStringParameterValue(TXMPreferences.QUERY));
 		return true;
 	}
-
+	
 	@Override
 	public void clean() {
 		try {
@@ -387,11 +391,12 @@
 				this.writer.flush();
 				this.writer.close();
 			}
-		} catch (IOException e) {
+		}
+		catch (IOException e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
 		}
 	}
-
+	
 	/**
 	 * keep the vmax lines more frequents.
 	 *
@@ -400,18 +405,18 @@
 		if (pVmaxFilter == null) {
 			return;
 		}
-
+		
 		this.acquireSemaphore();
-
-		Log.fine("Cutting Tmax="+pVmaxFilter);
+		
+		Log.fine("Cutting Tmax=" + pVmaxFilter);
 		// assume the lines are sorted
-		//int before = lines.size();
+		// int before = lines.size();
 		this.lines = this.lines.subList(0, Math.min(lines.size(), pVmaxFilter));
 		this.updateFminFmax();
-
+		
 		this.releaseSemaphore();
 	}
-
+	
 	/**
 	 * Equals.
 	 *
@@ -425,46 +430,46 @@
 					&& this.pFminFilter == index.getFilterFmin()
 					&& this.pFmaxFilter == index.getFilterFmax();
 		}
-		catch(Exception e) {
+		catch (Exception e) {
 		}
 		return false;
 	}
-
-
+	
+	
 	/**
 	 * Removes lines with frequency not in [Fmin,Fmax] range.
 	 *
 	 **/
 	public void filterLines() {
-
+		
 		if (!(pFminFilter > 0 && pFmaxFilter > 0 && pFminFilter <= pFmaxFilter)) {
 			return;
 		}
-
-		Log.fine("Filtering Fmin = " + pFminFilter + " and Fmax = " + pFmaxFilter); //$NON-NLS-1$  //$NON-NLS-2$
-
+		
+		Log.fine("Filtering Fmin = " + pFminFilter + " and Fmax = " + pFmaxFilter); //$NON-NLS-1$ //$NON-NLS-2$
+		
 		for (int i = 0; i < lines.size(); i++) { // for each line
-
+			
 			Line line = lines.get(i);
 			int f = line.getFrequency();
 			if (f < pFminFilter) { // if its frequency is not in the interval, remove it
-
+				
 				nTotalTokens -= line.getFrequency();
 				lines.remove(i);
 				i--;
 				continue; // no need to go further the line is removed
 			}
 			if (f > pFmaxFilter) { // if its frequency is not in the interval, remove it
-
+				
 				nTotalTokens -= line.getFrequency();
 				lines.remove(i);
 				i--;
 			}
 		}
-
+		
 		this.updateFminFmax();
 	}
-
+	
 	/**
 	 * Gets the corpus.
 	 *
@@ -473,36 +478,37 @@
 	public CQPCorpus getCorpus() {
 		return (CQPCorpus) this.parent;
 	}
-
+	
 	@Override
 	public String getDetails() {
-
+		
 		try {
-			Object[] params = new Object[]{this.parent.getSimpleName(), this.getQuery().getQueryString(), this.getProperties(), this.getFmin(), this.getFmax()}; 
+			Object[] params = new Object[] { this.parent.getSimpleName(), this.getQuery().getQueryString(), this.getProperties(), this.getFmin(), this.getFmax() };
 			String str;
 			str = IndexCoreMessages.indexColonCorpusP0queryP1propertiesP2FminP3FmaxP4;
 			return NLS.bind(str, params);
 		}
-		catch(Exception e) {
+		catch (Exception e) {
 			return getName();
 		}
 	}
 	
 	@Override
 	public String getSimpleDetails() {
-
+		
 		try {
 			if (hasBeenComputedOnce) {
 				return TXMCoreMessages.bind(TXMCoreMessages.fminP0fmaxP1tP2vP3, getFmin(), getFmax(), getT(), getV());
-			} else {
+			}
+			else {
 				return getName();
 			}
 		}
-		catch(Exception e) {
+		catch (Exception e) {
 			return getName();
 		}
 	}
-
+	
 	/**
 	 * Gets the filter fmax.
 	 *
@@ -511,7 +517,7 @@
 	public Integer getFilterFmax() {
 		return pFmaxFilter;
 	}
-
+	
 	/**
 	 * Gets the filter fmin.
 	 *
@@ -520,7 +526,7 @@
 	public Integer getFilterFmin() {
 		return pFminFilter;
 	}
-
+	
 	/**
 	 * Gets the filter vmax.
 	 *
@@ -529,7 +535,7 @@
 	public Integer getFilterVmax() {
 		return pVmaxFilter;
 	}
-
+	
 	/**
 	 * Gets the fmax.
 	 *
@@ -538,7 +544,7 @@
 	public int getFmax() {
 		return Fmax;
 	}
-
+	
 	/**
 	 * Gets the fmin.
 	 *
@@ -547,7 +553,7 @@
 	public int getFmin() {
 		return Fmin;
 	}
-
+	
 	/**
 	 * return the lines from le "start"th one to the "end"th one.
 	 *
@@ -556,22 +562,22 @@
 	 * @return the lines
 	 */
 	public List<Line> getLines(int start, int end) {
-		//	long time = System.currentTimeMillis();
+		// long time = System.currentTimeMillis();
 		List<Line> selectedLines = new ArrayList<Line>();
 		if (lines.size() > 0) {
 			start = Math.max(0, start);
 			end = Math.min(end, lines.size());
 			selectedLines = lines.subList(start, end);
-
+			
 			int p = 0;
 			// for each property get the string values of the tokens
 			for (Property property : pProperties) {
-
+				
 				int len = 0;
 				for (Line l : selectedLines) {
 					len += l.UnitsIds.get(p).length;
 				}
-
+				
 				int[] indices = new int[len]; // build the array of indices
 				len = 0;
 				for (Line l : selectedLines) {
@@ -587,7 +593,8 @@
 					else {
 						strs = CorpusManager.getCorpusManager().getCqiClient().id2Str(property.getQualifiedName(), indices);
 					}
-				} catch (Exception e) {
+				}
+				catch (Exception e) {
 					org.txm.utils.logger.Log.printStackTrace(e);
 					return null;
 				}
@@ -606,7 +613,7 @@
 		// System.out.println("Time get lines "+(System.currentTimeMillis()-time));
 		return selectedLines;
 	}
-
+	
 	/**
 	 * return all the lines of the index.
 	 *
@@ -615,7 +622,7 @@
 	public List<Line> getAllLines() {
 		return getLines(0, lines.size());
 	}
-
+	
 	/**
 	 * update the lines counts.
 	 */
@@ -633,25 +640,26 @@
 			line.setCounts(c, -1);
 		}
 	}
-
+	
 	@Override
 	public String getName() {
 		try {
 			return IndexCoreMessages.RESULT_TYPE + ": " + this.getSimpleName();
 		}
-		catch(Exception e) {
+		catch (Exception e) {
 			return this.getEmptyName();
 		}
 	}
-
+	
 	/**
 	 * Gets the number of lines per page.
+	 * 
 	 * @return the number of lines per page
 	 */
 	public Integer getNLinesPerPage() {
-		return pNLinesPerPage ;
+		return pNLinesPerPage;
 	}
-
+	
 	/**
 	 * Gets the properties.
 	 *
@@ -660,16 +668,16 @@
 	public List<WordProperty> getProperties() {
 		return this.pProperties;
 	}
-
-
+	
+	
 	/**
 	 * 
 	 * @return
 	 */
 	public String getPropertySeparator() {
-		return pPropertiesSeparator ;
+		return pPropertiesSeparator;
 	}
-
+	
 	/**
 	 * Gets the query.
 	 *
@@ -678,14 +686,14 @@
 	public IQuery getQuery() {
 		return pQuery;
 	}
-
+	
 	@Override
 	public String getSimpleName() {
 		String name = ""; //$NON-NLS-1$
 		if (pQuery != null && !pQuery.isEmpty()) {
 			name += pQuery.getQueryString();
 			name += ": "; //$NON-NLS-1$
-
+			
 			for (Property s : pProperties) {
 				name += s.getName() + pPropertiesSeparator;
 			}
@@ -698,19 +706,20 @@
 			return this.getEmptyName();
 		}
 	}
-
+	
 	@Override
 	public String getComputingStartMessage() {
-		return TXMCoreMessages.bind(IndexCoreMessages.indexOfP0PropertiesP1InTheP2Corpus, this.pQuery, WordProperty.propertiesToString(this.pProperties).replaceAll(TXMPreferences.LIST_SEPARATOR, ", "), this.getCorpus().getName()); //$NON-NLS-1$
+		return TXMCoreMessages.bind(IndexCoreMessages.indexOfP0PropertiesP1InTheP2Corpus, this.pQuery, WordProperty.propertiesToString(this.pProperties).replaceAll(TXMPreferences.LIST_SEPARATOR,
+				", "), this.getCorpus().getName()); //$NON-NLS-1$
 	}
-
 	
+	
 	@Override
 	public String getComputingDoneMessage() {
-		if(this.lines.isEmpty())	{
+		if (this.lines.isEmpty()) {
 			return TXMCoreMessages.common_noResults;
 		}
-		else	{
+		else {
 			return TXMCoreMessages.bind(TXMCoreMessages.common_P0ItemsForP1Occurrences, this.lines.size(), this.nTotalTokens);
 		}
 	}
@@ -724,7 +733,7 @@
 	public int getT() {
 		return nTotalTokens;
 	}
-
+	
 	/**
 	 * 
 	 * @return
@@ -732,7 +741,7 @@
 	public int getTopIndex() {
 		return pTopIndex;
 	}
-
+	
 	/**
 	 * Gets the v.
 	 *
@@ -741,30 +750,31 @@
 	public int getV() {
 		return lines.size();
 	}
-
+	
 	/**
 	 * count tokens.
 	 *
 	 * @param corpus the corpus to scan
 	 * @return true, if successful
-	 * @throws CqiClientException 
-	 * @throws CqiServerError 
-	 * @throws IOException 
+	 * @throws CqiClientException
+	 * @throws CqiServerError
+	 * @throws IOException
 	 */
 	protected boolean scanCorpus(CQPCorpus corpus) throws Exception {
 		// get the cqp result of the query
-
-		//long time = System.currentTimeMillis();
+		
+		// long time = System.currentTimeMillis();
 		Selection result = null;
 		if (pQuery instanceof CQLQuery) {
-			result = corpus.query((CQLQuery)pQuery, "index", true); //$NON-NLS-1$
-		} else {
+			result = corpus.query((CQLQuery) pQuery, "index", true); //$NON-NLS-1$
+		}
+		else {
 			result = pQuery.getSearchEngine().query(corpus, pQuery, "index", true); //$NON-NLS-1$
 		}
 		boolean isTargetUsed = result.isTargetUsed();
 		int nbresults = result.getNMatch();
 		this.nTotalTokens += nbresults; // get number of tokens
-
+		
 		// System.out.println("nLines : "+nLines);
 		List<? extends Match> matches = null;
 		if (nbresults > 0) {
@@ -799,15 +809,15 @@
 		// lengthOfKeywords));
 		// }
 		// System.out.println("took "+(System.currentTimeMillis()-time));
-
+		
 		// System.out.println("get count data");
-
+		
 		int[] allpositionsarray = new int[allpositions.size()];
 		int pcount = 0;
 		for (int p : allpositions) {
 			allpositionsarray[pcount++] = p;
 		}
-
+		
 		// time = System.currentTimeMillis();
 		HashMap<Property, int[]> propsId = new HashMap<Property, int[]>();
 		for (Property property : pProperties) {
@@ -820,7 +830,8 @@
 					int[] indices = CorpusManager.getCorpusManager().getCqiClient().cpos2Id(property.getQualifiedName(), allpositionsarray);
 					propsId.put(property, indices);
 				}
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				org.txm.utils.logger.Log.printStackTrace(e);
 				result.drop();
 				return false;
@@ -844,9 +855,9 @@
 				line.putIds(property, ids);
 			}
 			currentIndex += size;
-
+			
 			String signature = line.getSignature();
-
+			
 			// if the counts contains the signature, increment its corresponding value
 			if (counts.containsKey(signature)) {
 				while (counts.get(signature).size() <= currentpartid) {
@@ -864,7 +875,7 @@
 				}
 				counts.put(signature, tmp);
 				counts.get(signature).set(currentpartid, 1);
-
+				
 				lines.add(line);
 			}
 		}
@@ -872,9 +883,9 @@
 		// System.out.println("Time count lines "+(System.currentTimeMillis()-time));
 		// System.out.println("took "+(System.currentTimeMillis()-time));
 		return true;
-
+		
 	}
-
+	
 	/**
 	 * 
 	 * @param nLinesPerPage
@@ -882,7 +893,7 @@
 	public void setNLinesPerPage(int nLinesPerPage) {
 		this.pNLinesPerPage = Math.max(nLinesPerPage, 1);
 	}
-
+	
 	/**
 	 * 
 	 * @param props
@@ -891,34 +902,37 @@
 		this.pQuery = new CQLQuery("[]"); //$NON-NLS-1$
 		this.pProperties = props;
 	}
-
+	
 	/**
 	 * Sets the query.
+	 * 
 	 * @param query
 	 */
-	public void setQuery(CQLQuery query)	{
+	public void setQuery(CQLQuery query) {
 		this.pQuery = query;
 	}
-
+	
 	/**
 	 * Sets the properties.
+	 * 
 	 * @param properties
 	 */
-	public void setProperties(List<WordProperty> properties)	{
+	public void setProperties(List<WordProperty> properties) {
 		this.pProperties = properties;
 	}
-
+	
 	/**
 	 * Sets the property.
 	 * Clears all existing properties.
+	 * 
 	 * @param property
 	 */
-	public void setProperty(WordProperty property)	{
+	public void setProperty(WordProperty property) {
 		List<WordProperty> properties = new ArrayList<WordProperty>();
 		properties.add(property);
 		this.setProperties(properties);
 	}
-
+	
 	public void setParameters(CQLQuery query, List<WordProperty> props, Integer filterFmin, Integer filterFmax, Integer filterVmax, Integer nLinesPerPage) {
 		this.pQuery = query;
 		this.pProperties = props;
@@ -927,7 +941,7 @@
 		if (filterVmax != null) this.pVmaxFilter = filterVmax;
 		if (nLinesPerPage != null) this.pNLinesPerPage = nLinesPerPage;
 	}
-
+	
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
 		try {
@@ -937,25 +951,26 @@
 			Integer filterFmax = (Integer) parameters.get("filterFmax"); //$NON-NLS-1$
 			Integer filterVmax = (Integer) parameters.get("filterVmax"); //$NON-NLS-1$
 			Integer nLinesPerPage = (Integer) parameters.get("nLinesPerPage"); //$NON-NLS-1$
-
+			
 			this.setParameters(query, props, filterFmin, filterFmax, filterVmax, nLinesPerPage);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.severe("Error while setting parameters of Index: " + e.getLocalizedMessage()); //$NON-NLS-1$
 			Log.printStackTrace(e);
 			return false;
 		}
 		return true;
 	}
-
-
+	
+	
 	public void setTopLine(int i) {
 		pTopIndex = Math.max(i, 0);
 	}
-
+	
 	public void setVMax(int maxFilter) {
 		this.pVmaxFilter = maxFilter;
 	}
-
+	
 	/**
 	 * Sort lines.
 	 *
@@ -968,7 +983,7 @@
 		Collections.sort(lines, lc);
 		this.pTopIndex = 0; // return to the first page
 	}
-
+	
 	/**
 	 * dump the index in the console.
 	 *
@@ -979,7 +994,7 @@
 		System.out.println(NLS.bind(IndexCoreMessages.consoleColonP0, (lines.size())));
 		toConsole(0, lines.size());
 	}
-
+	
 	/**
 	 * dump a part of the index.
 	 *
@@ -989,23 +1004,23 @@
 	 * @throws IOException Signals that an I/O exception has occurred.
 	 */
 	public void toConsole(int from, int to) throws CqiClientException, IOException {
-
+		
 		String header = ""; //$NON-NLS-1$
 		for (Property p : pProperties) {
 			header += (p + pPropertiesSeparator);
 		}
 		header = header.substring(0, header.length() - 1);
 		header += "\tF"; //$NON-NLS-1$
-
+		
 		System.out.println(header);
 		for (int i = from; i < to; i++) {
 			Line ligne = lines.get(i);
-			System.out.print(ligne + "\t" + ligne.getFrequency()); //$NON-NLS-1$ 
+			System.out.print(ligne + "\t" + ligne.getFrequency()); //$NON-NLS-1$
 			System.out.print("\n"); //$NON-NLS-1$
 		}
 		System.out.flush();
 	}
-
+	
 	/**
 	 * Write the lines between from and to on a writer.
 	 *
@@ -1021,35 +1036,35 @@
 	// FIXME: should be in an exporter extension
 	@Deprecated
 	public void toTSVDictionnary(File outfile, String colseparator, String encoding) throws CqiClientException, IOException {
-
-		//String colseparator = "\t";
-
-		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), encoding)); 
-
+		
+		// String colseparator = "\t";
+		
+		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), encoding));
+		
 		String header = ""; //$NON-NLS-1$
 		for (Property p : pProperties) {
 			header += (p + colseparator);
 		}
-
-		//header = header.substring(0, header.length() - 1);
+		
+		// header = header.substring(0, header.length() - 1);
 		header += "F"; //$NON-NLS-1$
 		header += "\n"; //$NON-NLS-1$
 		writer.write(header);
-
+		
 		for (Line ligne : lines) {
-
-			for (int i = 0 ; i < pProperties.size() ; i++) {
+			
+			for (int i = 0; i < pProperties.size(); i++) {
 				writer.write(StringUtils.join(ligne.getUnitsProperties().get(i), " ") + colseparator);
 			}
-
+			
 			writer.write(Integer.toString(ligne.getFrequency()));
-
+			
 			writer.write("\n"); //$NON-NLS-1$
 		}
 		writer.flush();
 		writer.close();
 	}
-
+	
 	/**
 	 * Write the lines between from and to on a writer.
 	 *
@@ -1067,27 +1082,27 @@
 	public void toTxt(File outfile, int from, int to, String encoding, String colseparator, String txtseparator)
 			throws CqiClientException, IOException {
 		// NK: writer declared as class attribute to perform a clean if the operation is interrupted
-		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), encoding)); 
+		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), encoding));
 		// if ("UTF-8".equals(encoding)) writer.write('\ufeff'); // UTF-8 BOM
 		String header = ""; //$NON-NLS-1$
 		for (Property p : pProperties) {
 			header += (p + pPropertiesSeparator);
 		}
-		header = txtseparator+ header.substring(0, header.length() - 1) +txtseparator;
-		header += colseparator+ txtseparator+ "F" + txtseparator; //$NON-NLS-1$
+		header = txtseparator + header.substring(0, header.length() - 1) + txtseparator;
+		header += colseparator + txtseparator + "F" + txtseparator; //$NON-NLS-1$
 		header += "\n"; //$NON-NLS-1$
 		writer.write(header);
-
+		
 		// for(Line ligne: lines)
 		for (int i = from; i < to; i++) {
 			Line ligne = lines.get(i);
-			writer.write(txtseparator+ ligne.toString().replace(txtseparator, txtseparator+txtseparator)+ txtseparator + colseparator + ligne.getFrequency()); 
+			writer.write(txtseparator + ligne.toString().replace(txtseparator, txtseparator + txtseparator) + txtseparator + colseparator + ligne.getFrequency());
 			writer.write("\n"); //$NON-NLS-1$
 		}
 		writer.flush();
 		writer.close();
 	}
-
+	
 	/**
 	 * Write all the lines on a writer.
 	 *
@@ -1102,13 +1117,14 @@
 	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
 		try {
 			toTxt(outfile, 0, lines.size(), encoding, colseparator, txtseparator);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.severe(TXMCoreMessages.bind(IndexCoreMessages.error_failedToExportLexiconColonP0, Log.toString(e)));
 			return false;
 		}
 		return true;
 	}
-
+	
 	/**
 	 * checks all lines to update Fmin and Fmax.
 	 */
@@ -1126,9 +1142,9 @@
 			}
 		}
 	}
-
+	
 	@Override
 	public String getResultType() {
 		return IndexCoreMessages.RESULT_TYPE;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Line.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Line.java	(revision 2396)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Line.java	(revision 2397)
@@ -35,37 +35,37 @@
 import org.txm.searchengine.cqp.corpus.query.Occurrence;
 
 /**
- * Contains the signature of the line all properties value and counts 
+ * Contains the signature of the line all properties value and counts
  * 
  * @author mdecorde
  * 
  */
 public class Line {
-
+	
 	/** The Units property. */
 	public List<List<String>> UnitsProperty; // the values, for each property there is a list of property values
-
+	
 	/** The Units ids. */
 	public List<int[]> UnitsIds; // the values, for each property there is a list of property values
-
+	
 	/** The properties. */
 	public List<Property> properties = new ArrayList<Property>(); // the properties name UnitsProperty and properties have the same order
-
+	
 	/** The signature. */
 	private String signature;
-
+	
 	/** The counts. */
 	private int[] counts;
-
+	
 	/** The total. */
 	private int total;
-
+	
 	/** The frelatif. */
 	private float frelatif = 0;
-
+	
 	/** The str. */
 	private String str;
-
+	
 	/**
 	 * Instantiates a new line.
 	 */
@@ -73,7 +73,7 @@
 		this.UnitsProperty = new ArrayList<List<String>>();
 		UnitsIds = new ArrayList<int[]>();
 	}
-
+	
 	/**
 	 * add line's values for the given property.
 	 *
@@ -84,7 +84,7 @@
 		UnitsProperty.add(values);
 		// properties.add(p);
 	}
-
+	
 	/**
 	 * add line's values for the given property.
 	 *
@@ -95,7 +95,7 @@
 		UnitsIds.add(ids);
 		properties.add(p);
 	}
-
+	
 	/**
 	 * return the signature of a Line, an id to compare them quickly if L1 ==
 	 * L2, L1.signature = L2.signature else L1.signature != L2.signature
@@ -104,7 +104,7 @@
 	 */
 	public String getSignature() {
 		if (signature == null) {
-			//System.out.println("getSignature() props size "+properties.size());
+			// System.out.println("getSignature() props size "+properties.size());
 			signature = ""; //$NON-NLS-1$
 			for (int i = 0; i < properties.size(); i++) {
 				for (int s : UnitsIds.get(i)) {
@@ -114,7 +114,7 @@
 		}
 		return signature;
 	}
-
+	
 	/**
 	 * Sets the counts.
 	 *
@@ -129,7 +129,7 @@
 		}
 		frelatif = f;
 	}
-
+	
 	/**
 	 * Gets the frequency.
 	 *
@@ -138,7 +138,7 @@
 	public int getFrequency() {
 		return total;
 	}
-
+	
 	/**
 	 * Gets the frequency.
 	 *
@@ -151,7 +151,7 @@
 		}
 		return counts[i];
 	}
-
+	
 	/**
 	 * Gets the properties.
 	 *
@@ -160,7 +160,7 @@
 	public List<Property> getProperties() {
 		return this.properties;
 	}
-
+	
 	/**
 	 * Gets the units properties.
 	 *
@@ -169,17 +169,18 @@
 	public List<List<String>> getUnitsProperties() {
 		return this.UnitsProperty;
 	}
-
+	
 	/**
 	 * Gets the relative frequency.
 	 *
 	 * @return the relative frequency
 	 */
 	public float getRelativeFrenquency() {
-		return frelatif ;
+		return frelatif;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see java.lang.Object#toString()
 	 */
 	@Override
@@ -189,7 +190,7 @@
 		}
 		return str;
 	}
-
+	
 	/**
 	 * To string.
 	 *
@@ -199,11 +200,11 @@
 	public String toString(String separator) {
 		String rez = ""; //$NON-NLS-1$
 		int len = 0;
-		for (int i = 0; i < properties.size(); ) {
+		for (int i = 0; i < properties.size();) {
 			len = UnitsProperty.get(i).size();
 			break;
 		}
-
+		
 		for (int i = 0; i < len; i++) { // for each token
 			for (int j = 0; j < properties.size(); j++) {
 				rez += UnitsProperty.get(j).get(i);
@@ -211,14 +212,14 @@
 					rez += separator;
 				}
 			}
-
+			
 			if (i < len - 1) {
 				rez += " "; //$NON-NLS-1$
 			}
 		}
 		return rez;
 	}
-
+	
 	/**
 	 * compare to lines with their signature.
 	 *
@@ -228,7 +229,7 @@
 	public boolean equals(Line l) {
 		return l.getSignature().equals(this.getSignature());
 	}
-
+	
 	/**
 	 * Sets the signature.
 	 *
@@ -237,7 +238,7 @@
 	public void setSignature(String signature) {
 		this.signature = signature;
 	}
-
+	
 	/**
 	 * Gets the frequencies.
 	 *
@@ -246,15 +247,15 @@
 	public int[] getFrequencies() {
 		return counts;
 	}
-
+	
 	/**
 	 * The Class Signature.
 	 */
 	public static class Signature {
-
+		
 		/** The sign. */
 		Occurrence[] sign;// [token][prop]
-
+		
 		/**
 		 * Equals.
 		 *
@@ -262,11 +263,11 @@
 		 * @return true, if successful
 		 */
 		public boolean equals(Signature s) {
-
+			
 			if (sign.length != s.sign.length) {
 				return false;
 			}
-
+			
 			for (int i = 0; i < sign.length; i++) {
 				if (!sign[i].equals(s.sign[i])) {
 					return false;
@@ -275,7 +276,7 @@
 			return true;
 		}
 	}
-
+	
 	/**
 	 * Gets the units ids.
 	 *
Index: tmp/org.txm.index.core/.classpath
===================================================================
--- tmp/org.txm.index.core/.classpath	(revision 2396)
+++ tmp/org.txm.index.core/.classpath	(revision 2397)
@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="src" path="groovy"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="src" path="groovy" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.cooccurrence.core/.classpath
===================================================================
--- tmp/org.txm.cooccurrence.core/.classpath	(revision 2396)
+++ tmp/org.txm.cooccurrence.core/.classpath	(revision 2397)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	  <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		    <accessrules>
-			      <accessrule kind="accessible" pattern="**"/>
-		    </accessrules>
-	  </classpathentry>
-	  <classpathentry kind="src" path="src"/>
-	  <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="con"
+		path="org.eclipse.jdt.launching.JRE_CONTAINER" />
+	<classpathentry kind="con"
+		path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**" />
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src" />
+	<classpathentry kind="output" path="bin" />
 </classpath>
\ No newline at end of file
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/package.html
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/package.html	(revision 2396)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/package.html	(revision 2397)
@@ -1,5 +1,5 @@
 <html>
 <body>
-<p>Cooccurrence.</p>
+	<p>Cooccurrence.</p>
 </body>
 </html>
\ No newline at end of file
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/comparators/package.html
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/comparators/package.html	(revision 2396)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/comparators/package.html	(revision 2397)
@@ -1,13 +1,13 @@
 <html>
 <body>
-<p>Cooccurrences sorters :
-<ul>
-<li>Mean dist</li>
-<li>Cooccurrent</li>
-<li>CoFrequency</li>
-<li>Frequency</li>
-<li>Score</li>
-</ul>
-</p>
+	<p>Cooccurrences sorters :
+	<ul>
+		<li>Mean dist</li>
+		<li>Cooccurrent</li>
+		<li>CoFrequency</li>
+		<li>Frequency</li>
+		<li>Score</li>
+	</ul>
+	</p>
 </body>
 </html>
\ No newline at end of file
